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: <CAFv23Q=UXVd0qGBD3irDQejFhiK=qQaWf6B4KpiMkCzzGmP4hQ@mail.gmail.com>
Date:   Thu, 26 Oct 2023 14:21:54 +0800
From:   AceLan Kao <acelan.kao@...onical.com>
To:     Dhruva Gole <d-gole@...com>
Cc:     Tudor Ambarus <tudor.ambarus@...aro.org>,
        Pratyush Yadav <pratyush@...nel.org>,
        Michael Walle <michael@...le.cc>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Richard Weinberger <richard@....at>,
        Vignesh Raghavendra <vigneshr@...com>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] mtd: spi-nor: Improve reporting for software reset failures

Dhruva Gole <d-gole@...com> 於 2023年10月26日 週四 下午2:11寫道:
>
> On Oct 26, 2023 at 09:20:17 +0800, AceLan Kao wrote:
> > From: "Chia-Lin Kao (AceLan)" <acelan.kao@...onical.com>
> >
> > When the software reset command isn't supported, we now report it
> > as an informational message(dev_info) instead of a warning(dev_warn).
> > This adjustment helps avoid unnecessary alarm and confusion regarding
> > software reset capabilities.
> >
> > Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@...onical.com>
> > ---
> > v2. only lower the priority for the not supported failure
> > v3. replace ENOTSUPP with EOPNOTSUPP and check the first command only
> > v4. move the version information below the '---' line
> > ---
> >  drivers/mtd/spi-nor/core.c | 5 ++++-
> >  drivers/spi/spi-mem.c      | 2 +-
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> > index 1b0c6770c14e..42e52af76289 100644
> > --- a/drivers/mtd/spi-nor/core.c
> > +++ b/drivers/mtd/spi-nor/core.c
> > @@ -3252,7 +3252,10 @@ static void spi_nor_soft_reset(struct spi_nor *nor)
> >
> >       ret = spi_mem_exec_op(nor->spimem, &op);
> >       if (ret) {
> > -             dev_warn(nor->dev, "Software reset failed: %d\n", ret);
> > +             if (ret == -EOPNOTSUPP)
> > +                     dev_info(nor->dev, "Software reset enable command doesn't support: %d\n", ret);
>
> Does "Software reset command isn't supported:" make more sense?
That's because the op is "software reset enable" command

#define SPINOR_OP_SRSTEN        0x66    /* Software Reset Enable */
#define SPINOR_SRSTEN_OP                                                \
          SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_SRSTEN, 0),                 \
                     SPI_MEM_OP_NO_DUMMY,                                 \
                     SPI_MEM_OP_NO_ADDR,                                  \
                     SPI_MEM_OP_NO_DATA)
op = (struct spi_mem_op)SPINOR_SRSTEN_OP;

>
> > +             else
> > +                     dev_warn(nor->dev, "Software reset failed: %d\n", ret);
> >               return;
> >       }
> >
> > diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
> > index edd7430d4c05..93b77ac0b798 100644
> > --- a/drivers/spi/spi-mem.c
> > +++ b/drivers/spi/spi-mem.c
> > @@ -323,7 +323,7 @@ int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
> >               return ret;
> >
> >       if (!spi_mem_internal_supports_op(mem, op))
> > -             return -ENOTSUPP;
> > +             return -EOPNOTSUPP;
>
> Reviewed-by: Dhruva Gole <d-gole@...com>
>
> >
> >       if (ctlr->mem_ops && ctlr->mem_ops->exec_op && !spi_get_csgpiod(mem->spi, 0)) {
> >               ret = spi_mem_access_start(mem);
> > --
> > 2.34.1
> >
> >
>
>
> --
> Best regards,
> Dhruva Gole <d-gole@...com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ