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]
Date:	Mon, 11 Apr 2011 11:49:30 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	"Roedel, Joerg" <Joerg.Roedel@....com>
cc:	Borislav Petkov <bp@...en8.de>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Sarah Sharp <sarah.a.sharp@...ux.intel.com>,
	Andiry Xu <andiry.xu@....com>,
	USB list <linux-usb@...r.kernel.org>,
	Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5] USB host: Fix lockdep warning in AMD PLL quirk

On Mon, 11 Apr 2011, Roedel, Joerg wrote:

> On Mon, Apr 11, 2011 at 02:26:00AM -0400, Borislav Petkov wrote:
> > You mean 2.6.39-rc2 right? I'm asking because I hit the same warning
> > with 39-rc2 now too but it didn't appear with .38 - so it has to have
> > snuck in after the merge window. If so, you don't need the stable tag.
> 
> You were right, just tested plain 2.6.38 and it doesn't happen. So I
> removed the stable tag. Here is the updated patch.

...

> --- a/drivers/usb/host/pci-quirks.c
> +++ b/drivers/usb/host/pci-quirks.c
> @@ -84,65 +84,92 @@ int usb_amd_find_chipset_info(void)
>  {

...

> +commit:
> +
> +	spin_lock_irqsave(&amd_lock, flags);
> +	if (amd_chipset.probe_count > 0) {
> +		/* race - someone else was faster - drop devices */
> +
> +		/* Mark that we where here */
> +		amd_chipset.probe_count++;

This line should be moved above the "if" statement, since you always 
want to increment the count.

> +		ret = amd_chipset.probe_result;
> +
> +		spin_unlock_irqrestore(&amd_lock, flags);
> +
> +		if (info.nb_dev)
> +			pci_dev_put(info.nb_dev);
> +		if (info.smbus_dev)
> +			pci_dev_put(info.smbus_dev);
> +
> +	} else {
> +		/* no race - commit the result */
> +		info.probe_count++;

This isn't right, because info.probe_count was initialized to 0.  Maybe 
amd_chipset.probe_count should be made into a separate variable, not a 
part of the structure, like amd_lock.

> +		amd_chipset = info;
> +		spin_unlock_irqrestore(&amd_lock, flags);
> +	}
> +
> +	return ret;
>  }
>  EXPORT_SYMBOL_GPL(usb_amd_find_chipset_info);

Alan Stern

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ