[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110406152552.GU23633@amd.com>
Date: Wed, 6 Apr 2011 17:25:52 +0200
From: "Roedel, Joerg" <Joerg.Roedel@....com>
To: Alan Stern <stern@...land.harvard.edu>
CC: Greg Kroah-Hartman <gregkh@...e.de>,
Sarah Sharp <sarah.a.sharp@...ux.intel.com>,
"Xu, Andiry" <Andiry.Xu@....com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...nel.org" <stable@...nel.org>
Subject: Re: [PATCH] USB host: Fix lockdep warning in AMD PLL quirk
On Wed, Apr 06, 2011 at 11:16:07AM -0400, Alan Stern wrote:
> On Wed, 6 Apr 2011, Joerg Roedel wrote:
> > amd_chipset.probe_count++;
> > /* probe only once */
> > if (amd_chipset.probe_count > 1) {
> > spin_unlock_irqrestore(&amd_lock, flags);
> > return amd_chipset.probe_result;
> > }
>
> The counter really should be a bool: Has the chipset already been
> probed or not? After all, nobody cares how many times this routine was
> called.
The quirk function needs a re-structuring anyway. The code-path is not
very straight-forward and readable. But for this fix I tried to keep the
changes small.
>
> > + spin_unlock_irqrestore(&amd_lock, flags);
>
> This code now contains a bug: You incremented the probe_count _before_
> doing the probe. If another thread calls this routine right now, it
> will get an incorrect result.
>
> Fixing this up should be fairly easy.
Okay, I will do. Thanks for the feedback.
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists