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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Dec 2017 19:02:26 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     Boris Brezillon <boris.brezillon@...e-electrons.com>
Cc:     Kamal Dasu <kdasu.kdev@...il.com>,
        Richard Weinberger <richard@....at>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Broadcom Kernel Feedback List 
        <bcm-kernel-feedback-list@...adcom.com>,
        Marek Vasut <marek.vasut@...il.com>,
        Chen-Yu Tsai <wens@...e.org>,
        linux-mtd <linux-mtd@...ts.infradead.org>,
        Cyrille Pitchen <cyrille.pitchen@...ev4u.fr>,
        Han Xu <han.xu@....com>,
        Maxime Ripard <maxime.ripard@...e-electrons.com>,
        Brian Norris <computersforpeace@...il.com>,
        David Woodhouse <dwmw2@...radead.org>,
        linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] mtd: nand: squash struct nand_buffers into struct nand_chip

Hi Boris,

2017-12-04 18:10 GMT+09:00 Boris Brezillon <boris.brezillon@...e-electrons.com>:

>>       }
>>
>>       if (!(chip->options & NAND_OWN_BUFFERS)) {
>> -             nbuf = kzalloc(sizeof(*nbuf), GFP_KERNEL);
>> -             if (!nbuf)
>> +             chip->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL);
>> +             if (!chip->ecccalc)
>>                       return -ENOMEM;
>>
>> -             nbuf->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL);
>> -             if (!nbuf->ecccalc) {
>> +             chip->ecccode = kmalloc(mtd->oobsize, GFP_KERNEL);
>> +             if (!chip->ecccode) {
>>                       ret = -ENOMEM;
>>                       goto err_free_nbuf;
>>               }
>
> Hm, again not directly related to this patch, but I wonder if we
> couldn't allocate those buffers only when they are really needed. For
> example, most NAND controllers do the ECC calculation/correct in HW and
> simply don't need those buffers.


The only idea I came up with is to add a new flag,
but I am not sure if you are happy with it
because we are removing NAND_OWN_BUFFERS.





-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ