RE: [PATCH] USB host: Fix lockdep warning in AMD PLL quirk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Roedel, Joerg [mailto:Joerg.Roedel@xxxxxxx]
> Sent: Thursday, April 07, 2011 3:51 PM
> To: Alan Stern
> Cc: Greg Kroah-Hartman; Sarah Sharp; Xu, Andiry;
linux-usb@xxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx; stable@xxxxxxxxxx
> 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:
> 
> > 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.
> >
> > > +	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.
> 
> Hmm, we can get rid of the amd_lock completly if every thread uses the
> following call-order:
> 
> 	usb_amd_find_chipset_info();
> 	usb_amd_quirk_pll_enable();
> 	usb_amd_quirk_pll_disable();
> 	usb_amd_dev_put();
> 

The correct order is:

usb_amd_find_chipset_info();
usb_amd_quirk_pll_disable();
usb_amd_quirk_pll_enable();
usb_amd_dev_put();

The pair of pll disable and enable may be called for multiple times.

Thanks,
Andiry

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux