Re: [PATCH] xhci: Add quirks module option

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

 



On Mon, Dec 09, 2013 at 12:42:48PM +0100, Takashi Iwai wrote:
> It makes easier for debugging some hardware specific issues.
> 
> Note that this option won't override the value to be set.  That is,
> you can turn quirks on by this option but cannot turn them off if set
> by the driver.
> 
> Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
> ---
> 
> I noticed the lack of quirks module option during investigating the
> recent bug report for my Haswell S5 fix quirk
>     https://bugzilla.kernel.org/show_bug.cgi?id=66171

Hi Takashi,

We're trying to get away from adding new module parameters in general.

However, I do I think this module parameter would be highly useful.  It
means we can ask bug reporters to reload the xhci_hcd module with a
quirk instead of forcing them to recompile their driver.

I also don't really see a good way to allow users to change the quirks
without a module parameter.  We can't really add a way to manipulate the
quirks through sysfs or debugfs, because most of the quirks code assumes
quirks are set at module load.  Modifying the existing 18 quirks to be
able to be turned on or off on the fly would be difficult to implement
and test, considering I don't have access to most of the hardware the
quirks were enabled for.

Greg, thoughts on this?

Sarah Sharp

> 
>  drivers/usb/host/xhci.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 4265b48856f6..08a4fd458d22 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -40,6 +40,10 @@ static int link_quirk;
>  module_param(link_quirk, int, S_IRUGO | S_IWUSR);
>  MODULE_PARM_DESC(link_quirk, "Don't clear the chain bit on a link TRB");
>  
> +static unsigned int quirks;
> +module_param(quirks, uint, S_IRUGO);
> +MODULE_PARM_DESC(quirks, "Bit flags for quirks to be enabled as default");
> +
>  /* TODO: copied from ehci-hcd.c - can this be refactored? */
>  /*
>   * xhci_handshake - spin reading hc until handshake completes or fails
> @@ -4760,6 +4764,8 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
>  	xhci->hcc_params = xhci_readl(xhci, &xhci->cap_regs->hcc_params);
>  	xhci_print_registers(xhci);
>  
> +	xhci->quirks = quirks;
> +
>  	get_quirks(dev, xhci);
>  
>  	/* In xhci controllers which follow xhci 1.0 spec gives a spurious
> -- 
> 1.8.5
> 
--
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