lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230420202003.1e9af9e0@kernel.org>
Date:   Thu, 20 Apr 2023 20:20:03 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Shmuel Hazan <shmuel.h@...lu.com>
Cc:     Russell King <linux@...linux.org.uk>,
        Marcin Wojtas <mw@...ihalf.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Richard Cochran <richardcochran@...il.com>,
        horatiu.vultur@...rochip.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        devicetree@...r.kernel.org
Subject: Re: [PATCH v3 1/3] net: mvpp2: tai: add refcount for ptp worker

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ