[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+h21hqt+iLJ5yCTvnysEoeK08Ce7yRK1+nSniaBd=p=4y0_SQ@mail.gmail.com>
Date: Tue, 1 Oct 2019 07:59:27 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: David Miller <davem@...emloft.net>
Cc: Richard Cochran <richardcochran@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net] net: dsa: sja1105: Fix sleeping while atomic in .port_hwtstamp_set
Hi David,
On Tue, 1 Oct 2019 at 03:20, David Miller <davem@...emloft.net> wrote:
>
> From: Vladimir Oltean <olteanv@...il.com>
> Date: Sun, 29 Sep 2019 01:07:45 +0300
>
> > Currently this stack trace can be seen with CONFIG_DEBUG_ATOMIC_SLEEP=y:
> ...
> > Enabling RX timestamping will logically disturb the fastpath (processing
> > of meta frames). Replace bool hwts_rx_en with a bit that is checked
> > atomically from the fastpath and temporarily unset from the sleepable
> > context during a change of the RX timestamping process (a destructive
> > operation anyways, requires switch reset).
> > If found unset, the fastpath will just drop any received meta frame and
> > not take the meta_lock at all.
> >
> > Fixes: a602afd200f5 ("net: dsa: sja1105: Expose PTP timestamping ioctls to userspace")
> > Signed-off-by: Vladimir Oltean <olteanv@...il.com>
>
> Well, two things:
>
> 1) Even assuming #2 wasn't true, you're adding the missing initialization
> of meta_lock and that would need to be mentioned in the commit message.
>
Thanks, I forgot to break that line apart into a new patch.
> 2) After these changes meta_lock is no longer used so it should be removed.
The meta_lock is still very much used: see net/dsa/tag_sja1105.c (that
is where DSA keeps its fastpath). The fact that meta_lock is no longer
used within the driver (slowpath) is entirely the point of the patch.
-Vladimir
Powered by blists - more mailing lists