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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 02 Mar 2012 15:15:29 +0400
From:	Sergei Shtylyov <sshtylyov@...sta.com>
To:	Yinghai Lu <yinghai@...nel.org>
CC:	Sarah Sharp <sarah.a.sharp@...ux.intel.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	linux-usb@...r.kernel.org, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 1/3] usb, PCI: split quirk for usb host controller
 to four

Hello.

On 01-03-2012 23:24, Yinghai Lu wrote:

> so we avoid checking class again and again in that quirk.

> following patches will remove disable/enable for non-xhci
> and nelogic vendor checking for uhci/xhci

    Why add them in the first place?

> So total lines will increase 8 at last.

> need to be applied after pci/linux-next and usb/usb-next

> Signed-off-by: Yinghai Lu<yinghai@...nel.org>
>
> ---
>   drivers/usb/host/pci-quirks.c |   64 ++++++++++++++++++++++++++++++++----------
>   1 file changed, 50 insertions(+), 14 deletions(-)
>
> Index: linux-2.6/drivers/usb/host/pci-quirks.c
> ===================================================================
> --- linux-2.6.orig/drivers/usb/host/pci-quirks.c
> +++ linux-2.6/drivers/usb/host/pci-quirks.c
> @@ -884,17 +884,60 @@ static void __devinit quirk_usb_handoff_
>   	iounmap(base);
>   }
>
> -static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
> +static void __devinit quirk_usb_early_handoff_uhci(struct pci_dev *pdev)
> +{
> +	if (pdev->vendor == 0x184e)	/* vendor Netlogic */
> +		return;

    NetLogic vendor check should be only in quirk_usb_early_handoff_ohci() and
quirk_usb_early_handoff_ehci() according to the comment below.

> +
> +	if (pci_enable_device(pdev)<  0) {
> +		dev_warn(&pdev->dev, "Can't enable PCI device, "
> +				"BIOS handoff failed.\n");
> +		return;
> +	}
> +	quirk_usb_handoff_uhci(pdev);
> +	pci_disable_device(pdev);
> +}
> +DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
> +		PCI_CLASS_SERIAL_USB_UHCI, 0, quirk_usb_early_handoff_uhci);
> +
> +static void __devinit quirk_usb_early_handoff_ohci(struct pci_dev *pdev)
>   {
>   	/* Skip Netlogic mips SoC's internal PCI USB controller.
>   	 * This device does not need/support EHCI/OHCI handoff
>   	 */
>   	if (pdev->vendor == 0x184e)	/* vendor Netlogic */
>   		return;
> -	if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI&&
> -			pdev->class != PCI_CLASS_SERIAL_USB_OHCI&&
> -			pdev->class != PCI_CLASS_SERIAL_USB_EHCI&&
> -			pdev->class != PCI_CLASS_SERIAL_USB_XHCI)
> +
> +	if (pci_enable_device(pdev)<  0) {
> +		dev_warn(&pdev->dev, "Can't enable PCI device, "
> +				"BIOS handoff failed.\n");
> +		return;
> +	}
> +	quirk_usb_handoff_ohci(pdev);
> +	pci_disable_device(pdev);
> +}
> +DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
> +		PCI_CLASS_SERIAL_USB_OHCI, 0, quirk_usb_early_handoff_ohci);
> +
> +static void __devinit quirk_usb_early_handoff_ehci(struct pci_dev *pdev)
> +{

    The NetLogic comment should probably be repeated here.

> +	if (pdev->vendor == 0x184e)	/* vendor Netlogic */
> +		return;
> +
> +	if (pci_enable_device(pdev)<  0) {
> +		dev_warn(&pdev->dev, "Can't enable PCI device, "
> +				"BIOS handoff failed.\n");
> +		return;
> +	}
> +	quirk_usb_handoff_ehci(pdev);
> +	pci_disable_device(pdev);
> +}
> +DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
> +		PCI_CLASS_SERIAL_USB_EHCI, 0, quirk_usb_early_handoff_ehci);
> +
> +static void __devinit quirk_usb_early_handoff_xhci(struct pci_dev *pdev)
> +{
> +	if (pdev->vendor == 0x184e)	/* vendor Netlogic */

    Not needed.

WBR, Sergei
--
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