mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Yang <mmyangfl@gmail.com>
Cc: netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: dsa: motorcomm: Resync SMI slave after interrupted MDIO access
Date: Sat, 14 Nov 2026 22:27:45 +0100	[thread overview]
Message-ID: <d03e27a4-4777-4477-b827-0fda7a112ec9@lunn.ch> (raw)
In-Reply-To: <CAAXyoMOokp1yJYKo-r9MFehrVTLcL9+eQQ386Ycwmw0ut-KVYg@mail.gmail.com>

> > > @@ -136,6 +230,9 @@ static int yt921x_reg_mdio_read(void *context, u32 reg, u32 *valp)
> > >
> > >  end:
> > >       mutex_unlock(&bus->mdio_lock);
> > > +
> > > +     if (res)
> > > +             mdio->synced = false;
> >
> > Why defer the recovery to the next transaction? Why not do it now. And
> > if the recovery fails, you can report the transaction which actually
> > killed it, which might be useful for debugging.
> >
> >        Andrew
> 
> If the recovery fails, you have to, anyway, try to resync in the next
> transaction, so recovery here does not help other than adding more
> code.

I don't know why it adds more code. You don't need mdio->synced. You
just call the recovery function. If it fails, it fails, and you assume
the switch is dead, but report the error and keep going. The next
transaction is also likely to fail, probably causing another sync
attempt, which might work, but by then, you have to assume the switch
is wrongly configured, even if the transaction works.

	Andrew

  reply	other threads:[~2026-11-14 21:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 16:39 David Yang
2026-11-14 15:40 ` Andrew Lunn
2026-11-14 16:33   ` David Yang
2026-11-14 21:27     ` Andrew Lunn [this message]
2026-11-14 21:32 ` 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=d03e27a4-4777-4477-b827-0fda7a112ec9@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmyangfl@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    /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

all inboxes | Powered by JetHome®