Netdev List
 help / color / mirror / Atom feed
From: Christian Eggers <ceggers@arri.de>
To: "Andrew Lunn" <andrew@lunn.ch>, "Jörg Sommer" <joerg@jo-so.de>
Cc: <netdev@vger.kernel.org>
Subject: Re: KSZ8795 not detected at start to boot from NFS
Date: Sat, 7 Dec 2024 23:44:41 +0100	[thread overview]
Message-ID: <7080052.9J7NaK4W3v@n9w6sw14> (raw)
In-Reply-To: <phab74r5xxbufhe6llruqa3tgkxzalytgzqrko4o2bg2xzizjv@apha3we342xn>

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



  reply	other threads:[~2024-12-07 22:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07  7:53 KSZ8795 not detected at start to boot from NFS Jörg Sommer
2024-12-07 20:47 ` Andrew Lunn
2024-12-07 21:07   ` Jörg Sommer
2024-12-07 22:44     ` Christian Eggers [this message]
2024-12-08 16:44       ` Jörg Sommer
2024-12-10 16:43         ` Jörg Sommer
2024-12-10 17:41           ` Andrew Lunn
2024-12-10 21:21             ` Jörg Sommer
2024-12-11 10:18           ` Christian Eggers
2024-12-11 12:23             ` Jörg Sommer
2024-12-11 13:04               ` Christian Eggers
2024-12-11 14:46                 ` Jörg Sommer
2025-01-05 16:33                   ` Jörg Sommer
2025-01-05 17:08                     ` Andrew Lunn
2025-01-06 13:38                       ` Pieter Van Trappen
2025-01-07 22:14                         ` Jörg Sommer
2025-01-08  0:07                           ` Tristram.Ha
2024-12-11 13:24             ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7080052.9J7NaK4W3v@n9w6sw14 \
    --to=ceggers@arri.de \
    --cc=andrew@lunn.ch \
    --cc=joerg@jo-so.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox