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]
Message-ID: <CAAyq3SbX-gBH2vVrMnxDqvf_g4nt5CcT0Dcv9a1cx0Jw-CusSg@mail.gmail.com>
Date: Thu, 11 Sep 2025 13:15:53 +0800
From: Cheng Ming Lin <linchengming884@...il.com>
To: Miquel Raynal <miquel.raynal@...tlin.com>
Cc: richard@....at, vigneshr@...com, robh@...nel.org, krzk+dt@...nel.org, 
	conor+dt@...nel.org, tudor.ambarus@...aro.org, mmkurbanov@...utedevices.com, 
	Takahiro.Kuwano@...ineon.com, pratyush@...nel.org, 
	linux-mtd@...ts.infradead.org, devicetree@...r.kernel.org, 
	linux-kernel@...r.kernel.org, alvinzhou@...c.com.tw, 
	Cheng Ming Lin <chengminglin@...c.com.tw>
Subject: Re: [PATCH v2 3/3] mtd: spi-nand: macronix: Add randomizer support

Hi Miquel,

Miquel Raynal <miquel.raynal@...tlin.com> 於 2025年9月10日 週三 下午5:43寫道:
>
> On 10/09/2025 at 17:26:13 +08, Cheng Ming Lin <linchengming884@...il.com> wrote:
>
> > Hi Miquel,
> >
> > Miquel Raynal <miquel.raynal@...tlin.com> 於 2025年9月10日 週三 下午5:12寫道:
> >>
> >>
> >> > +static int macronix_set_randomizer(struct spinand_device *spinand)
> >> > +{
> >> > +     struct spi_mem_op exec_op = SPINAND_PROG_EXEC_1S_1S_0_OP(0);
> >> > +     struct nand_device *nand = spinand_to_nand(spinand);
> >> > +     struct device_node *dn = nanddev_get_of_node(nand);
> >> > +     int randopt, ret;
> >> > +     u8 cfg, status;
> >> > +
> >> > +     ret = spinand_read_reg_op(spinand, MACRONIX_FEATURE_ADDR_RANDOMIZER, &cfg);
> >> > +     if (ret)
> >> > +             return ret;
> >> > +     if (cfg)
> >> > +             return 0;
> >> > +
> >> > +     cfg = MACRONIX_CFG_ENPGM | MACRONIX_CFG_RANDEN;
> >> > +     randopt = of_property_read_bool(dn, "mxic,randopt");
> >>
> >> Isn't that a leftover?
> >
> > The property "mxic,randopt" corresponds to bit2 of the configuration
> > register 0x10. Its purpose is to control whether the randomizer also
> > covers the initial portion of the spare area.
>
> Do we need a DT property for that?
>
> In any case, it must be declared in the bindings (which I do not think
> it is?).
>
> > Since the randomizer feature is only documented in Macronix datasheets,
> > it is not clear whether the "randopt" bit is used by all vendors. For
> > this reason, the handling is placed inside macronix.c.
>
> Didn't we discuss in the past of a volatile version for SPI NAND
> devices? I thought we could use a volatile approach instead.

I think a DT property makes sense here. Once the randomizer feature is
enabled, the range it covers must be defined as well. If we rely on a
volatile approach, the randomizer coverage might change dynamically,
which I believe is less safe and harder to guarantee consistency.

>
> Thanks,
> Miquèl

Thanks,
Cheng Ming Lin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ