public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Horatiu Vultur <horatiu.vultur@microchip.com>,
	"Allan W . Nielsen" <allan.nielsen@microchip.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Steen Hegelund <steen.hegelund@microchip.com>
Subject: Re: [PATCH net] net: mscc: ocelot: install MAC addresses in .ndo_set_rx_mode from process context
Date: Fri, 4 Dec 2020 17:40:59 +0000	[thread overview]
Message-ID: <20201204174059.fnnkthxfjgw47z65@skbuf> (raw)
In-Reply-To: <ae82dc10-11af-e48a-a317-fc60cda3b993@gmail.com>

On Fri, Dec 04, 2020 at 09:34:54AM -0800, Florian Fainelli wrote:
> On 12/4/2020 9:09 AM, Vladimir Oltean wrote:
> > Currently ocelot_set_rx_mode calls ocelot_mact_learn directly, which has
> > a very nice ocelot_mact_wait_for_completion at the end. Introduced in
> > commit 639c1b2625af ("net: mscc: ocelot: Register poll timeout should be
> > wall time not attempts"), this function uses readx_poll_timeout which
> > triggers a lot of lockdep warnings and is also dangerous to use from
> > atomic context, leading to lockups and panics.
> > 
> > Steen Hegelund added a poll timeout of 100 ms for checking the MAC
> > table, a duration which is clearly absurd to poll in atomic context.
> > So we need to defer the MAC table access to process context, which we do
> > via a dynamically allocated workqueue which contains all there is to
> > know about the MAC table operation it has to do.
> > 
> > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> Did you want to have a Fixes tag to help identify how far back this
> needs to be back ported?

I was on the fence about whether I should even target "net", considering
that it's not a small patch. But the lockdep warnings are super annoying,
I cannot do anything further on the ocelot switchdev driver with them.

There's also a small concern I have that I should have taken a reference
count on ocelot->dev using get_device, to avoid racing with the unbind.
I think I'll send a v2 with this and a Fixes: tag.

      reply	other threads:[~2020-12-04 17:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 17:09 [PATCH net] net: mscc: ocelot: install MAC addresses in .ndo_set_rx_mode from process context Vladimir Oltean
2020-12-04 17:34 ` Florian Fainelli
2020-12-04 17:40   ` Vladimir Oltean [this message]

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=20201204174059.fnnkthxfjgw47z65@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=steen.hegelund@microchip.com \
    --cc=vivien.didelot@gmail.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