[rtc-linux] Re: [PATCH 2/2] rtc: imxdi: use the security violation interrupt
From: Alexandre Belloni <hidden>
Date: 2016-12-07 15:47:33
Also in:
lkml
Hi, On 19/11/2016 at 14:03:34 +0100, Martin Kaiser wrote :
The DryIce chipset has a dedicated security violation interrupt that is triggered for security violations (if configured to do so). According to the publicly available imx258 reference manual, irq 56 is used for this interrupt. Install a handler for the security violation interrupt. Move the code for handling security violations from the "normal" interrupt handler into the security violation interrupt handler. Signed-off-by: Martin Kaiser <redacted> --- .../devicetree/bindings/rtc/imxdi-rtc.txt | 4 +- arch/arm/boot/dts/imx25.dtsi | 2 +-
This change should be in a separate patch.
quoted hunk ↗ jump to hunk
@@ -783,6 +801,9 @@ static int __init dryice_rtc_probe(struct platform_device *pdev) imxdi->irq = platform_get_irq(pdev, 0); if (imxdi->irq < 0) return imxdi->irq; + imxdi->sec_irq = platform_get_irq(pdev, 1); + if (imxdi->sec_irq < 0) + return imxdi->sec_irq; init_waitqueue_head(&imxdi->write_wait);@@ -815,6 +836,13 @@ static int __init dryice_rtc_probe(struct platform_device *pdev) goto err; } + rc = devm_request_irq(&pdev->dev, imxdi->sec_irq, dryice_sec_irq, + IRQF_SHARED, pdev->name, imxdi); + if (rc) { + dev_warn(&pdev->dev, "security violation interrupt not available.\n"); + goto err;
If you make that error fatal, it means that the DT ABI changed. I would simply issue the warning and continue anyway.
+ } + platform_set_drvdata(pdev, imxdi); imxdi->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, &dryice_rtc_ops, THIS_MODULE); -- 1.7.10.4
-- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.