Re: [PATCH 2/2] rtc: imxdi: use the security violation interrupt

From: Alexandre Belloni
Date: Wed Dec 07 2016 - 10:47:36 EST


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 <martin@xxxxxxxxx>
> ---
> .../devicetree/bindings/rtc/imxdi-rtc.txt | 4 +-
> arch/arm/boot/dts/imx25.dtsi | 2 +-

This change should be in a separate patch.

> @@ -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