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: <BL3PR11MB6484B2AE23D324AD24B614AEFBB29@BL3PR11MB6484.namprd11.prod.outlook.com>
Date:   Wed, 22 Jun 2022 13:47:22 +0000
From:   <Thomas.Kopp@...rochip.com>
To:     <mkl@...gutronix.de>
CC:     <pavel.modilaynen@...vocars.com>, <drew@...gleboard.org>,
        <linux-can@...r.kernel.org>, <menschel.p@...teo.de>,
        <netdev@...r.kernel.org>, <will@...china.cc>
Subject: RE: [net-next 6/6] can: mcp251xfd: mcp251xfd_regmap_crc_read(): work
 around broken CRC on TBC register

Hi Marc,

> Picking up this old thread....
> 
> Thomas, can I have your Signed-off-by for this patch?
> 
> Marc

> > diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c
> b/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c
> > index 297491516a26..e5bc897f37e8 100644
> > --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c
> > +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c
> > @@ -332,12 +332,10 @@ mcp251xfd_regmap_crc_read(void *context,
> >                  *
> >                  * If the highest bit in the lowest byte is flipped
> >                  * the transferred CRC matches the calculated one. We
> > -                * assume for now the CRC calculation in the chip
> > -                * works on wrong data and the transferred data is
> > -                * correct.
> > +                * assume for now the CRC operates on the correct data.
> >                  */
> >                 if (reg == MCP251XFD_REG_TBC &&
> > -                   (buf_rx->data[0] == 0x0 || buf_rx->data[0] == 0x80)) {
> > +                   ((buf_rx->data[0] & 0xF8) == 0x0 || (buf_rx->data[0] & 0xF8) ==
> 0x80)) {
> >                         /* Flip highest bit in lowest byte of le32 */
> >                         buf_rx->data[0] ^= 0x80;
> >
> > @@ -347,10 +345,8 @@ mcp251xfd_regmap_crc_read(void *context,
> >                                                                   val_len);
> >                         if (!err) {
> >                                 /* If CRC is now correct, assume
> > -                                * transferred data was OK, flip bit
> > -                                * back to original value.
> > +                                * flipped data was OK.
> >                                  */
> > -                               buf_rx->data[0] ^= 0x80;
> >                                 goto out;
> >                         }
> >                 }
> >

Signed-off-by: Thomas Kopp <thomas.kopp@...rochip.com>

> The mcp2517fd errata says the transmitted data is okay, but the CRC is
> calculated on wrong data:

Yes, will be updated.

Best Regards,
Thomas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ