From: Alexandre Belloni <alexandre.belloni@free-electrons.com> To: Martin Kaiser <martin@kaiser.cx> Cc: Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <kernel@pengutronix.de>, Juergen Borleis <jbe@pengutronix.de>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Fabio Estevam <fabio.estevam@nxp.com>, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] rtc: imxdi: use the security violation interrupt Date: Wed, 7 Dec 2016 16:47:16 +0100 [thread overview] Message-ID: <20161207154716.5pkdctgnjhnuqp53@piout.net> (raw) In-Reply-To: <1479560614-19293-2-git-send-email-martin@kaiser.cx> 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@kaiser.cx> > --- > .../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
WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@free-electrons.com> To: Martin Kaiser <martin@kaiser.cx> Cc: Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <kernel@pengutronix.de>, Juergen Borleis <jbe@pengutronix.de>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Fabio Estevam <fabio.estevam@nxp.com>, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [rtc-linux] Re: [PATCH 2/2] rtc: imxdi: use the security violation interrupt Date: Wed, 7 Dec 2016 16:47:16 +0100 [thread overview] Message-ID: <20161207154716.5pkdctgnjhnuqp53@piout.net> (raw) In-Reply-To: <1479560614-19293-2-git-send-email-martin@kaiser.cx> 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@kaiser.cx> > --- > .../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 -- 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.
next prev parent reply other threads:[~2016-12-07 15:47 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-11-19 13:03 [PATCH 1/2] rtc: imxdi: (trivial) fix a typo Martin Kaiser 2016-11-19 13:03 ` [rtc-linux] " Martin Kaiser 2016-11-19 13:03 ` [PATCH 2/2] rtc: imxdi: use the security violation interrupt Martin Kaiser 2016-11-19 13:03 ` [rtc-linux] " Martin Kaiser 2016-12-07 15:47 ` Alexandre Belloni [this message] 2016-12-07 15:47 ` [rtc-linux] " Alexandre Belloni 2016-12-07 15:48 ` [PATCH 1/2] rtc: imxdi: (trivial) fix a typo Alexandre Belloni 2016-12-07 15:48 ` [rtc-linux] " Alexandre Belloni 2016-12-19 22:41 ` [PATCH v2] rtc: imxdi: use the security violation interrupt Martin Kaiser 2016-12-19 22:41 ` [rtc-linux] " Martin Kaiser 2016-12-20 9:23 ` Lucas Stach 2016-12-20 9:23 ` [rtc-linux] " Lucas Stach 2016-12-21 23:06 ` Martin Kaiser 2016-12-21 23:06 ` [rtc-linux] " Martin Kaiser 2016-12-21 22:56 ` [PATCH 1/2 v3] " Martin Kaiser 2016-12-21 22:56 ` [rtc-linux] " Martin Kaiser 2016-12-21 23:01 ` [PATCH 2/2 v2] ARM: i.MX25: add the optional security violation irq Martin Kaiser 2016-12-21 23:01 ` [rtc-linux] " Martin Kaiser 2016-12-30 2:44 ` Shawn Guo 2016-12-30 2:44 ` [rtc-linux] " Shawn Guo 2017-01-03 18:49 ` [PATCH 1/3 v4] rtc: imxdi: use the security violation interrupt Martin Kaiser 2017-01-03 18:49 ` [rtc-linux] " Martin Kaiser 2017-01-10 23:46 ` Alexandre Belloni 2017-01-10 23:46 ` [rtc-linux] " Alexandre Belloni 2017-01-03 18:50 ` [PATCH 2/3] ARM: dts: imx25.dtsi: DryIce " Martin Kaiser 2017-01-03 18:50 ` [rtc-linux] " Martin Kaiser 2017-01-10 1:53 ` Shawn Guo 2017-01-10 1:53 ` [rtc-linux] " Shawn Guo 2017-01-03 18:51 ` [PATCH 3/3] Documentation: dt: rtc-imxdi: " Martin Kaiser 2017-01-03 18:51 ` [rtc-linux] " Martin Kaiser 2017-01-10 23:47 ` Alexandre Belloni 2017-01-10 23:47 ` [rtc-linux] " Alexandre Belloni
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20161207154716.5pkdctgnjhnuqp53@piout.net \ --to=alexandre.belloni@free-electrons.com \ --cc=fabio.estevam@nxp.com \ --cc=jbe@pengutronix.de \ --cc=kernel@pengutronix.de \ --cc=linux-kernel@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=martin@kaiser.cx \ --cc=robh+dt@kernel.org \ --cc=rtc-linux@googlegroups.com \ --cc=shawnguo@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.