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: <7080052.9J7NaK4W3v@n9w6sw14>
Date: Sat, 7 Dec 2024 23:44:41 +0100
From: Christian Eggers <ceggers@...i.de>
To: Andrew Lunn <andrew@...n.ch>, Jörg Sommer
	<joerg@...so.de>
CC: <netdev@...r.kernel.org>
Subject: Re: KSZ8795 not detected at start to boot from NFS

Hi Jörg, hi Andrew,

On Saturday, 7 December 2024, 21:47:31 CET, Andrew Lunn wrote:
> What i don't understand from your description is why:
> 
> > +       /* setup spi */
> > +       spi->mode = SPI_MODE_3;
> > +       ret = spi_setup(spi);
> > +       if (ret)
> > +               return ret;
> > +
> 
> is causing this issue. Is spi_setup() failing?

On Saturday, 7 December 2024, 22:07:23 CET, Jörg Sommer wrote:

> I've added another dev_err() after the spi_setup:
> 
> [    1.680516] ksz8795-switch spi0.1: ksz8795_spi_probe:55: ret of spi_setup=0
> [    1.819194] ksz8795-switch spi0.1: ksz8795_spi_probe:61: ret=-22#

It doesn't look so.

@Jörg. You didn't explicitly mention which kernel version you are trying to run.
But from the line numbers in you log I guess at could be 5.11 or similar.

I guess that the 2nd return code (-22) originates from ksz8795_switch_register()
which in turn calls ksz_switch_register() [ksz_common.c]. Maybe the -EINVAL comes from 
line 414:

    if (dev->dev_ops->detect(dev))
        return -EINVAL;

But this is only a guess. Can you please add further debug messages in ksz_switch_register()
in order to track down were the -EINVAL actually comes from? Maybe it's one of the
error returns from ksz8795_register_switch().

My original intention for the mentioned patch presumably was, that always SPI mode 3
should be configured for this switch (as stated in the data sheet). But maybe this
isn't true for your setup (do you have an inverter in your SPI clock line)? 


> Andrew Lunn schrieb am Sa 07. Dez, 21:47 (+0100):
> > 
> > What i don't understand from your description is why:
> > 
> > > +       /* setup spi */
> > > +       spi->mode = SPI_MODE_3;
> > > +       ret = spi_setup(spi);
> > > +       if (ret)
> > > +               return ret;
> > > +
> > 
> > is causing this issue. Is spi_setup() failing?

Maybe that the configured SPI mode does somehow not work for Jörg's setup.
Perhaps SPI mode 3 on his controller is not the same as for my one (NXP i.MX6).
This could then cause a mismatch when reading the chip id in ksz8795_switch_detect().

@Jörg: Can you please check this? If possible, a measurement of the SPI lines (with
an oscilloscope or logic analyzer) would be interesting.

regards,
Christian



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ