From: Paolo Abeni <pabeni@redhat.com>
To: Stefan Wahren <wahrenst@gmx.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>
Cc: Lino Sanfilippo <LinoSanfilippo@gmx.de>,
Florian Fainelli <f.fainelli@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4 net] qca_spi: Fix SPI IRQ handling
Date: Fri, 24 Nov 2023 16:33:04 +0100 [thread overview]
Message-ID: <9e2bba3c98cd24ebf1b6d9fde2e0b9229ad6b99f.camel@redhat.com> (raw)
In-Reply-To: <bf3dd03e-a1f2-4586-8f00-7003848016aa@gmx.net>
On Fri, 2023-11-24 at 15:01 +0100, Stefan Wahren wrote:
> Hi Paolo,
>
> Am 23.11.23 um 12:37 schrieb Paolo Abeni:
> > On Tue, 2023-11-21 at 17:30 +0100, Stefan Wahren wrote:
> > > The functions qcaspi_netdev_open/close are responsible of request &
> > > free of the SPI interrupt, which wasn't the best choice. Currently
> > > it's possible to trigger a double free of the interrupt by calling
> > > qcaspi_netdev_close() after qcaspi_netdev_open() has failed.
> > > So let us split IRQ allocation & enabling, so we can take advantage
> > > of a device managed IRQ and also fix the issue.
> > >
> > > Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000")
> > > Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> > The change makes sense, but the changelog is confusing.
> >
> > qcaspi_netdev_close() and qcaspi_netdev_open() are invoked only via
> > ndo_open and ndo_close(), right? So qcaspi_netdev_close() will never be
> > invoked qcaspi_netdev_open(), failure - that is when IFF_UP is not set.
> sorry, i missed to mention an important part. This issue is partly
> connected to patch 3.
> Please look at qcaspi_set_ringparam() which also call ndo_close() and
> ndo_open().
Ah, I see it now. IMHO root cause of the problem is there. The ethtool
op should not flip the device state.
A more narrow fix would be to park/unpark the thread inside
set_ringparam() - instead of the whole patch 1 && 2 I suspect.
IMHO the changes in this still make sense - a refactor for net-next.
Cheers,
Paolo
next prev parent reply other threads:[~2023-11-24 15:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 16:30 [PATCH 0/4 net] qca_spi: collection of major fixes Stefan Wahren
2023-11-21 16:30 ` [PATCH 1/4 net] qca_spi: Fix SPI thread creation Stefan Wahren
2023-11-23 11:26 ` Paolo Abeni
2023-11-24 13:40 ` Stefan Wahren
2023-11-21 16:30 ` [PATCH 2/4 net] qca_spi: Fix SPI IRQ handling Stefan Wahren
2023-11-23 11:37 ` Paolo Abeni
2023-11-24 14:01 ` Stefan Wahren
2023-11-24 15:33 ` Paolo Abeni [this message]
2023-11-24 22:02 ` Stefan Wahren
2023-11-21 16:30 ` [PATCH 3/4 net] qca_spi: Fix ethtool -G iface tx behavior Stefan Wahren
2023-11-23 11:51 ` Paolo Abeni
2023-11-24 14:17 ` Stefan Wahren
2023-11-24 15:49 ` Paolo Abeni
2023-11-21 16:30 ` [PATCH 4/4 net] qca_spi: Fix reset behavior Stefan Wahren
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=9e2bba3c98cd24ebf1b6d9fde2e0b9229ad6b99f.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=LinoSanfilippo@gmx.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wahrenst@gmx.net \
/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®