From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Stefan Agner <stefan@agner.ch>
Cc: boris.brezillon@bootlin.com, computersforpeace@gmail.com,
dwmw2@infradead.org, marek.vasut@gmail.com, richard@nod.at,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] mtd: rawnand: vf610_nfc: explicitly disable interrupts first
Date: Wed, 8 Aug 2018 11:54:37 +0200 [thread overview]
Message-ID: <20180808115437.34365451@xps13> (raw)
In-Reply-To: <20180806092909.28980-2-stefan@agner.ch>
Hi Stefan,
Stefan Agner <stefan@agner.ch> wrote on Mon, 6 Aug 2018 11:29:08 +0200:
> Explicitly disable all interrupts on probe. This should be the
> default state, but the bootloader could leave the device in any
> state. No issues have been observed so far, but it is still worth
> fixing it.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
> drivers/mtd/nand/raw/vf610_nfc.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c
> index 740a91c5c86e..52e7811c0bde 100644
> --- a/drivers/mtd/nand/raw/vf610_nfc.c
> +++ b/drivers/mtd/nand/raw/vf610_nfc.c
> @@ -130,8 +130,13 @@
> #define CONFIG_PAGE_CNT_SHIFT 0
>
> /* NFC_IRQ_STATUS Field */
> +#define WERR_IRQ_BIT BIT(31)
> +#define DONE_IRQ_BIT BIT(30)
> #define IDLE_IRQ_BIT BIT(29)
> +#define WERR_EN_BIT BIT(22)
> +#define DONE_EN_BIT BIT(21)
> #define IDLE_EN_BIT BIT(20)
> +#define WERR_CLEAR_BIT BIT(19)
> #define DONE_CLEAR_BIT BIT(18)
> #define IDLE_CLEAR_BIT BIT(17)
>
> @@ -819,6 +824,10 @@ static int vf610_nfc_probe(struct platform_device *pdev)
>
> init_completion(&nfc->cmd_done);
>
> + vf610_nfc_clear(nfc, NFC_IRQ_STATUS, WERR_EN_BIT);
> + vf610_nfc_clear(nfc, NFC_IRQ_STATUS, DONE_EN_BIT);
> + vf610_nfc_clear(nfc, NFC_IRQ_STATUS, IDLE_EN_BIT);
> +
Why not just one call with:
vf610_nfc_clear(nfc, NFC_IRQ_STATUS, WERR_EN_BIT | DONE_EN_BIT | IDLE_EN_BIT);
The comment applies for the next patch as well.
> err = devm_request_irq(nfc->dev, irq, vf610_nfc_irq, 0, DRV_NAME, mtd);
> if (err) {
> dev_err(nfc->dev, "Error requesting IRQ!\n");
Thanks,
Miquèl
next prev parent reply other threads:[~2018-08-08 9:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-06 9:29 [PATCH 1/3] mtd: rawnand: vf610_nfc: align IRQ bit naming Stefan Agner
2018-08-06 9:29 ` [PATCH 2/3] mtd: rawnand: vf610_nfc: explicitly disable interrupts first Stefan Agner
2018-08-08 9:54 ` Miquel Raynal [this message]
2018-08-06 9:29 ` [PATCH 3/3] mtd: rawnand: vf610_nfc: handle only idle interrupts Stefan Agner
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=20180808115437.34365451@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=boris.brezillon@bootlin.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
--cc=stefan@agner.ch \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).