lkml.org 
[lkml]   [2021]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10 3/4] mtd: rawnand: Add support for secure regions in NAND memory
On Fri, Apr 02, 2021 at 10:51:54AM +0200, Boris Brezillon wrote:
> On Thu, 1 Apr 2021 21:46:22 +0530
> Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> wrote:
>
> > On Thu, Apr 01, 2021 at 05:54:21PM +0200, Boris Brezillon wrote:
> > > On Thu, 1 Apr 2021 20:49:54 +0530
> > > Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> wrote:
> > >
> > > > @@ -565,6 +608,11 @@ static int nand_block_isreserved(struct mtd_info *mtd, loff_t ofs)
> > > >
> > > > if (!chip->bbt)
> > > > return 0;
> > > > +
> > > > + /* Check if the region is secured */
> > > > + if (nand_region_is_secured(chip, ofs, 0))
> > > > + return -EIO;
> > >
> > > That would is still wrong, you should never pass a 0 size to
> > > nand_region_is_secured().
> > >
> >
> > Size doesn't matter here, that's why I passed 0. Maybe 1 would be
> > appropriate?
>
> You're checking if a block is reserved, so I think passing the
> eraseblock size would make more sense, but I actually don't understand
> why you need to check if the region is secure here (looks like
> nand_block_isreserved() does not access the flash).
>

Ah yes indeed, brain fade...

Thanks,
Mani

\
 
 \ /
  Last update: 2021-04-02 16:28    [W:0.063 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site