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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 15 Apr 2019 14:04:28 +0800
From:   Liang Yang <liang.yang@...ogic.com>
To:     Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        <linux-amlogic@...ts.infradead.org>,
        <linux-mtd@...ts.infradead.org>, <richard@....at>,
        <miquel.raynal@...tlin.com>
CC:     <linux-arm-kernel@...ts.infradead.org>, <marek.vasut@...il.com>,
        <linux-kernel@...r.kernel.org>, <computersforpeace@...il.com>,
        <dwmw2@...radead.org>, <bbrezillon@...nel.org>,
        <jianxin.pan@...ogic.com>
Subject: Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB
 completion once


On 2019/4/12 6:00, Martin Blumenstingl wrote:
> Documentation/scheduler/completion.txt states:
>    Calling init_completion() on the same completion object twice is
>    most likely a bug as it re-initializes the queue to an empty queue and
>    enqueued tasks could get "lost" - use reinit_completion() in that case,
>    but be aware of other races.
> 
> Initialize nfc->completion in meson_nfc_probe using init_completion and
> change the call in meson_nfc_queue_rb to reinit_completion so the logic
> matches what the documentation suggests.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
> ---
>   drivers/mtd/nand/raw/meson_nand.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
> index 57cc4bd3f665..ea57ddcec41e 100644
> --- a/drivers/mtd/nand/raw/meson_nand.c
> +++ b/drivers/mtd/nand/raw/meson_nand.c
> @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms)
>   	cfg |= NFC_RB_IRQ_EN;
>   	writel(cfg, nfc->reg_base + NFC_REG_CFG);
>   
> -	init_completion(&nfc->completion);
> +	reinit_completion(&nfc->completion);
Tested-by:Liang Yang <liang.yang@...ogic.com>
Acked-by: Liang Yang <liang.yang@...ogic.com>
>   
>   	/* use the max erase time as the maximum clock for waiting R/B */
>   	cmd = NFC_CMD_RB | NFC_CMD_RB_INT
> @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev)
>   
>   	nand_controller_init(&nfc->controller);
>   	INIT_LIST_HEAD(&nfc->chips);
> +	init_completion(&nfc->completion);
Tested-by:Liang Yang <liang.yang@...ogic.com>
Acked-by: Liang Yang <liang.yang@...ogic.com>
>   
>   	nfc->dev = dev;
>   
> 

Powered by blists - more mailing lists