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] [day] [month] [year] [list]
Message-ID: <311d3b9816d40311acdbc4bb1c793ff75972923a.camel@siklu.com>
Date:   Sun, 30 Apr 2023 20:09:42 +0300
From:   Shmuel Hazan <shmuel.h@...lu.com>
To:     Jakub Kicinski <kuba@...nel.org>
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 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



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ