netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Shmuel Hazan <shmuel.h@siklu.com>
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: Thu, 20 Apr 2023 20:20:03 -0700	[thread overview]
Message-ID: <20230420202003.1e9af9e0@kernel.org> (raw)
In-Reply-To: <20230419151457.22411-2-shmuel.h@siklu.com>

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

>  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

  reply	other threads:[~2023-04-21  3:20 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 [this message]
2023-04-30 17:09     ` Shmuel Hazan
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=20230420202003.1e9af9e0@kernel.org \
    --to=kuba@kernel.org \
    --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=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 \
    --cc=shmuel.h@siklu.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;
as well as URLs for NNTP newsgroup(s).