From: Shmuel Hazan <shmuel.h@siklu.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>,
Marcin Wojtas <mw@semihalf.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
horatiu.vultur@microchip.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
devicetree@vger.kernel.org
Subject: Re: [PATCH v3 1/3] net: mvpp2: tai: add refcount for ptp worker
Date: Sun, 30 Apr 2023 20:09:42 +0300 [thread overview]
Message-ID: <311d3b9816d40311acdbc4bb1c793ff75972923a.camel@siklu.com> (raw)
In-Reply-To: <20230420202003.1e9af9e0@kernel.org>
On Thu, 2023-04-20 at 20:20 -0700, Jakub Kicinski wrote:
> > Caution: This is an external email. Please take care when clicking
> > links or opening attachments.
> >
> >
> > On Wed, 19 Apr 2023 18:14:55 +0300 Shmuel Hazan wrote:
> > > > +static void mvpp22_tai_stop_unlocked(struct mvpp2_tai *tai)
> > > > +{
> > > > + tai->poll_worker_refcount--;
> > > > + if (tai->poll_worker_refcount)
> > > > + return;
> > > > + ptp_cancel_worker_sync(tai->ptp_clock);
> >
> > How can you cancel it _sync() when the work takes the same
> > lock you're already holding?
> >
> > https://elixir.bootlin.com/linux/v6.3-rc7/source/drivers/net/ethernet/marvell/mvpp2/mvpp2_tai.c#L246
Hi Jakub,
Thanks for finding that. Strange that I have not encountered any
deadlocks while testing; I will apply a fix and resend after testing
it.
> >
> > > > void mvpp22_tai_stop(struct mvpp2_tai *tai)
> > > > {
> > > > - ptp_cancel_worker_sync(tai->ptp_clock);
> > > > + unsigned long flags;
> > > > +
> > > > + spin_lock_irqsave(&tai->lock, flags);
> > > > + mvpp22_tai_stop_unlocked(tai);
> >
> > --
> > pw-bot: cr
next prev parent reply other threads:[~2023-04-30 17:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 15:14 [PATCH v3 0/3] net: mvpp2: tai: add extts support Shmuel Hazan
2023-04-19 15:14 ` [PATCH v3 1/3] net: mvpp2: tai: add refcount for ptp worker Shmuel Hazan
2023-04-21 3:20 ` Jakub Kicinski
2023-04-30 17:09 ` Shmuel Hazan [this message]
2023-04-19 15:14 ` [PATCH v3 2/3] net: mvpp2: tai: add extts support Shmuel Hazan
2023-04-19 15:14 ` [PATCH v3 3/3] dt-bindings: net: marvell,pp2: add extts docs Shmuel Hazan
2023-04-21 7:43 ` Krzysztof Kozlowski
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=311d3b9816d40311acdbc4bb1c793ff75972923a.camel@siklu.com \
--to=shmuel.h@siklu.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=horatiu.vultur@microchip.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mw@semihalf.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh+dt@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
all inboxes | Powered by JetHome®