lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 8 Aug 2018 11:54:37 +0200
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     Stefan Agner <stefan@...er.ch>
Cc:     boris.brezillon@...tlin.com, computersforpeace@...il.com,
        dwmw2@...radead.org, marek.vasut@...il.com, richard@....at,
        linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] mtd: rawnand: vf610_nfc: explicitly disable
 interrupts first

Hi Stefan,

Stefan Agner <stefan@...er.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@...er.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ