3.0.36-stable review
Subsystems (16)
Greg KH
maintainercover 3.0.36-stable review
This is the start of the stable review cycle for the 3.0.36 release. There are 20 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Jun 22 17:30:38 UTC 2012. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.36-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Makefile | 4 +- arch/arm/mach-imx/mach-mx21ads.c | 2 +- arch/x86/xen/enlighten.c | 8 ++++ drivers/pci/pci.c | 5 ++ drivers/pci/quirks.c | 26 ++++++++++ drivers/usb/class/cdc-acm.c | 8 ++++ drivers/usb/core/hcd-pci.c | 9 ---- drivers/usb/core/message.c | 3 +- drivers/usb/host/ehci-pci.c | 8 ---- drivers/usb/host/xhci.c | 8 ++-- drivers/usb/serial/cp210x.c | 1 + drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 1 + drivers/usb/serial/mct_u232.c | 13 +++-- drivers/usb/serial/mos7840.c | 2 +- drivers/usb/serial/option.c | 96 ++++++++++++++++++------------------- drivers/usb/serial/qcserial.c | 6 +++ drivers/usb/serial/sierra.c | 4 ++ drivers/usb/serial/usb-serial.c | 6 ++- fs/hfsplus/wrapper.c | 2 +- include/linux/pci.h | 2 + include/linux/usb/hcd.h | 2 - net/sunrpc/svc.c | 3 +- 23 files changed, 134 insertions(+), 86 deletions(-)
Greg KH
maintainerPATCH 1/20 ARM i.MX imx21ads: Fix overlapping static i/o mappings
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jaccon Bastiaansen <[email protected]>
commit 350ab15bb2ffe7103bc6bf6c634f3c5b286eaf2a upstream.
The statically defined I/O memory regions for the i.MX21 on chip peripherals and the on board I/O peripherals of the i.MX21ADS board overlap. This results in a kernel crash during startup. This is fixed by reducing the memory range for the on board I/O peripherals to the actually required range.
--- arch/arm/mach-imx/mach-mx21ads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mach-mx21ads.c +1 -1
@@ -32,7 +32,7 @@* Memory-mapped I/O on MX21ADS base board */ #define MX21ADS_MMIO_BASE_ADDR 0xf5000000 -#define MX21ADS_MMIO_SIZE SZ_16M +#define MX21ADS_MMIO_SIZE 0xc00000#define MX21ADS_REG_ADDR (offset) (void __force __iomem *) \ (MX21ADS_MMIO_BASE_ADDR + (offset))
Greg KH
maintainerPATCH 2/20 xen/setup: filter APERFMPERF cpuid feature out
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andre Przywara <[email protected]>
commit 5e626254206a709c6e937f3dda69bf26c7344f6f upstream.
Xen PV kernels allow access to the APERF/MPERF registers to read the effective frequency. Access to the MSRs is however redirected to the currently scheduled physical CPU, making consecutive read and compares unreliable. In addition each rdmsr traps into the hypervisor. So to avoid bogus readouts and expensive traps, disable the kernel internal feature flag for APERF/MPERF if running under Xen. This will
a) remove the aperfmperf flag from /proc/cpuinfo
b) not mislead the power scheduler (arch/x86/kernel/cpu/sched.c) to use the feature to improve scheduling (by default disabled)
c) not mislead the cpufreq driver to use the MSRs
This does not cover userland programs which access the MSRs via the device file interface, but this will be addressed separately.
--- arch/x86/xen/enlighten.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/x86/xen/enlighten.c +8 -0
@@ -198,6 +198,9 @@ static void __init xen_banner(void) xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : ""); } +#define CPUID_THERM_POWER_LEAF 6 +#define APERFMPERF_PRESENT 0 +static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0 ;static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0 ;
@@ -218,6 +221,11 @@ static void xen_cpuid(unsigned int *ax, maskedx = cpuid_leaf1_edx_mask;break ; +case CPUID_THERM_POWER_LEAF : +/* Disabling APERFMPERF for kernel usage */ + maskecx = ~(1 <<APERFMPERF_PRESENT ); +break ; +case 0xb :/* Suppress extended topology stuff */ maskebx =0 ;
Greg KH
maintainerPATCH 3/20 NFSv4.1: Fix a request leak on the back channel
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit b3b02ae5865c2dcd506322e0fc6def59a042e72f upstream.
If the call to svc_process_common() fails, then the request needs to be freed before we can exit bc_svc_process.
--- net/sunrpc/svc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sunrpc/svc.c +2 -1
@@ -1302,7 +1302,8 @@ bc_svc_process(struct svc_serv *serv, st sizeof(req->rq_snd_buf));return bc_send (req); }else { -/* Nothing to do to drop request */ +/* drop request */ +xprt_free_bc_request (req);return 0 ; } }
Greg KH
maintainerPATCH 4/20 USB: option: Add Vodafone/Huawei K5005 support
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit 4cbbb039a9719fb3bba73d255c6a95bc6dc6428b upstream.
--- drivers/usb/serial/option.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/serial/option.c +4 -0
@@ -150,6 +150,7 @@ static void option_instat_callback(struc#define HUAWEI_PRODUCT_E14AC 0x14AC#define HUAWEI_PRODUCT_K3806 0x14AE#define HUAWEI_PRODUCT_K4605 0x14C6 +#define HUAWEI_PRODUCT_K5005 0x14C8#define HUAWEI_PRODUCT_K3770 0x14C9#define HUAWEI_PRODUCT_K3771 0x14CA#define HUAWEI_PRODUCT_K4510 0x14CB
@@ -666,6 +667,9 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3806, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x31) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x32) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x33) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x31) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x32) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3771, 0xff, 0x02, 0x31) },
Greg KH
maintainerPATCH 5/20 USB: option: Updated Huawei K4605 has better id
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Bird <[email protected]>
commit 42ca7da1c2363dbef4ba1b6917c4c02274b6a5e2 upstream.
Later firmwares for this device now have proper subclass and protocol info so we can identify it nicely without needing to use the blacklist. I'm not removing the old 0xff matching as there may be devices in the field that still need that.
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -667,6 +667,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3806, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x31) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x32) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x31) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x32) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x33) },
Greg KH
maintainerPATCH 6/20 USB: option: add more YUGA device ids
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?=E8=AF=B4=E4=B8=8D=E5=BE=97?= <[email protected]>
commit 0ef0be15fd2564767f114c249fc4af704d8e16f4 upstream.
--- drivers/usb/serial/option.c | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-)
drivers/usb/serial/option.c +26 -16
@@ -426,7 +426,7 @@ static void option_instat_callback(struc#define SAMSUNG_VENDOR_ID 0x04e8#define SAMSUNG_PRODUCT_GT_B3730 0x6889 -/* YUGA products www.yuga-info.com*/ +/* YUGA products www.yuga-info.com [email protected] */ #define YUGA_VENDOR_ID 0x257A#define YUGA_PRODUCT_CEM600 0x1601#define YUGA_PRODUCT_CEM610 0x1602
@@ -443,6 +443,8 @@ static void option_instat_callback(struc#define YUGA_PRODUCT_CEU516 0x160C#define YUGA_PRODUCT_CEU528 0x160D#define YUGA_PRODUCT_CEU526 0x160F +#define YUGA_PRODUCT_CEU881 0x161F +#define YUGA_PRODUCT_CEU882 0x162F#define YUGA_PRODUCT_CWM600 0x2601#define YUGA_PRODUCT_CWM610 0x2602
@@ -458,23 +460,26 @@ static void option_instat_callback(struc#define YUGA_PRODUCT_CWU518 0x260B#define YUGA_PRODUCT_CWU516 0x260C#define YUGA_PRODUCT_CWU528 0x260D +#define YUGA_PRODUCT_CWU581 0x260E#define YUGA_PRODUCT_CWU526 0x260F +#define YUGA_PRODUCT_CWU582 0x261F +#define YUGA_PRODUCT_CWU583 0x262F -#define YUGA_PRODUCT_CLM600 0x2601 -#define YUGA_PRODUCT_CLM610 0x2602 -#define YUGA_PRODUCT_CLM500 0x2603 -#define YUGA_PRODUCT_CLM510 0x2604 -#define YUGA_PRODUCT_CLM800 0x2605 -#define YUGA_PRODUCT_CLM900 0x2606 - -#define YUGA_PRODUCT_CLU718 0x2607 -#define YUGA_PRODUCT_CLU716 0x2608 -#define YUGA_PRODUCT_CLU728 0x2609 -#define YUGA_PRODUCT_CLU726 0x260A -#define YUGA_PRODUCT_CLU518 0x260B -#define YUGA_PRODUCT_CLU516 0x260C -#define YUGA_PRODUCT_CLU528 0x260D -#define YUGA_PRODUCT_CLU526 0x260F +#define YUGA_PRODUCT_CLM600 0x3601 +#define YUGA_PRODUCT_CLM610 0x3602 +#define YUGA_PRODUCT_CLM500 0x3603 +#define YUGA_PRODUCT_CLM510 0x3604 +#define YUGA_PRODUCT_CLM800 0x3605 +#define YUGA_PRODUCT_CLM900 0x3606 + +#define YUGA_PRODUCT_CLU718 0x3607 +#define YUGA_PRODUCT_CLU716 0x3608 +#define YUGA_PRODUCT_CLU728 0x3609 +#define YUGA_PRODUCT_CLU726 0x360A +#define YUGA_PRODUCT_CLU518 0x360B +#define YUGA_PRODUCT_CLU516 0x360C +#define YUGA_PRODUCT_CLU528 0x360D +#define YUGA_PRODUCT_CLU526 0x360F/* Viettel products */ #define VIETTEL_VENDOR_ID 0x2262
@@ -1213,6 +1218,11 @@ static const struct usb_device_id option { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU516) }, { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) }, { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) }, + { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU881) }, + { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU882) }, + { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU581) }, + { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU582) }, + { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU583) }, { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) }, { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */
Greg KH
maintainerPATCH 7/20 USB: option: fix memory leak
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit b9c3aab315b51f81649a0d737c4c73783fbd8de0 upstream.
Fix memory leak introduced by commit 383cedc3bb435de7a2 ("USB: serial:
full autosuspend support for the option driver") which allocates usb-serial data but never frees it.
--- drivers/usb/serial/option.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/usb/serial/option.c +11 -1
@@ -47,6 +47,7 @@/* Function prototypes */ static int option_probe (struct usb_serial *serial,const struct usb_device_id *id); +static void option_release (struct usb_serial *serial);static int option_send_setup (struct usb_serial_port *port);static void option_instat_callback (struct urb *urb);
@@ -1273,7 +1274,7 @@ static struct usb_serial_driver option_1 .ioctl = usb_wwan_ioctl, .attach = usb_wwan_startup, .disconnect = usb_wwan_disconnect, - .release = usb_wwan_release, + .release = option_release, .read_int_callback = option_instat_callback, #ifdef CONFIG_PM .suspend = usb_wwan_suspend,
@@ -1409,6 +1410,15 @@ static int option_probe(struct usb_seriareturn 0 ; } +static void option_release (struct usb_serial *serial) +{ +struct usb_wwan_intf_private *priv =usb_get_serial_data (serial); + +usb_wwan_release (serial); + +kfree (priv); +} +static void option_instat_callback (struct urb *urb) {int err;
Greg KH
maintainerPATCH 8/20 USB: option: fix port-data abuse
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 4273f9878b0a8271df055e3c8f2e7f08c6a4a2f4 upstream.
Commit 8b4c6a3ab596961b78465 ("USB: option: Use generic USB wwan code") moved option port-data allocation to usb_wwan_startup but still cast the port data to the old struct...
--- drivers/usb/serial/option.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-)
drivers/usb/serial/option.c +3 -31
@@ -1284,35 +1284,6 @@ static struct usb_serial_driver option_1static int debug; -/* per port private data */ - -#define N_IN_URB 4 -#define N_OUT_URB 4 -#define IN_BUFLEN 4096 -#define OUT_BUFLEN 4096 - -struct option_port_private { -/* Input endpoints and buffer for this port */ -struct urb *in_urbs[N_IN_URB ]; -u8 *in_buffer[N_IN_URB ]; -/* Output endpoints and buffer for this port */ -struct urb *out_urbs[N_OUT_URB ]; -u8 *out_buffer[N_OUT_URB ]; -unsigned long out_busy;/* Bit vector of URBs in use */ -int opened; -struct usb_anchor delayed; - -/* Settings for the port */ -int rts_state;/* Handshaking pins (outputs) */ -int dtr_state; -int cts_state;/* Handshaking pins (inputs) */ -int dsr_state; -int dcd_state; -int ri_state; - -unsigned long tx_start_time[N_OUT_URB ]; -}; -/* Functions used by new usb-serial code. */ static int __init option_init (void ) {
@@ -1424,7 +1395,8 @@ static void option_instat_callback(strucint err;int status = urb->status;struct usb_serial_port *port = urb->context; -struct option_port_private *portdata =usb_get_serial_port_data (port); +struct usb_wwan_port_private *portdata = +usb_get_serial_port_data (port);dbg ("%s" , __func__);dbg ("%s: urb %p port %p has data %p" , __func__, urb, port, portdata);
@@ -1485,7 +1457,7 @@ static int option_send_setup(struct usb_struct usb_serial *serial = port->serial;struct usb_wwan_intf_private *intfdata = (struct usb_wwan_intf_private *) serial->private; -struct option_port_private *portdata; +struct usb_wwan_port_private *portdata;int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber;int val =0 ;dbg ("%s" , __func__);
Greg KH
maintainerPATCH 9/20 hfsplus: fix overflow in sector calculations in hfsplus_submit_bio
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Janne Kalliomäki <[email protected]>
commit a6dc8c04218eb752ff79cdc24a995cf51866caed upstream.
The variable io_size was unsigned int, which caused the wrong sector number to be calculated after aligning it. This then caused mount to fail with big volumes, as backup volume header information was searched from a wrong sector.
--- fs/hfsplus/wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfsplus/wrapper.c +1 -1
@@ -56,7 +56,7 @@ int hfsplus_submit_bio(struct super_blocDECLARE_COMPLETION_ONSTACK (wait);struct bio *bio;int ret =0 ; -unsigned int io_size; +u64 io_size;loff_t start;int offset;
Greg KH
maintainerPATCH 10/20 xHCI: Increase the timeout for controller save/restore state operation
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andiry Xu <[email protected]>
commit 622eb783fe6ff4c1baa47db16c3a5db97f9e6e50 upstream.
When system software decides to power down the xHC with the intent of resuming operation at a later time, it will ask xHC to save the internal state and restore it when resume to correctly recover from a power event. Two bits are used to enable this operation: Save State and Restore State.
xHCI spec 4.23.2 says software should "Set the Controller Save/Restore State flag in the USBCMD register and wait for the Save/Restore State Status flag in the USBSTS register to transition to '0'". However, it does not define how long software should wait for the SSS/RSS bit to transition to 0.
Currently the timeout is set to 1ms. There is bug report
(https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1002697)
indicates that the timeout is too short for ASMedia ASM1042 host controller to save/restore the state successfully. Increase the timeout to 10ms helps to resolve the issue.
This patch should be backported to stable kernels as old as 2.6.37, that contain the commit 5535b1d5f8885695c6ded783c692e3c0d0eda8ca "USB: xHCI:
PCI power management implementation"
--- drivers/usb/host/xhci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/host/xhci.c +4 -4
@@ -730,8 +730,8 @@ int xhci_suspend(struct xhci_hcd *xhci) command =xhci_readl (xhci, &xhci->op_regs->command); command |=CMD_CSS ;xhci_writel (xhci, command, &xhci->op_regs->command); -if (handshake (xhci, &xhci->op_regs->status,STS_SAVE ,0 ,10 *100 )) { -xhci_warn (xhci,"WARN: xHC CMD_CSS timeout\n" ); +if (handshake (xhci, &xhci->op_regs->status,STS_SAVE ,0 ,10 *1000 )) { +xhci_warn (xhci,"WARN: xHC save state timeout\n" );spin_unlock_irq (&xhci->lock);return -ETIMEDOUT ; }
@@ -786,8 +786,8 @@ int xhci_resume(struct xhci_hcd *xhci, b command |=CMD_CRS ;xhci_writel (xhci, command, &xhci->op_regs->command);if (handshake (xhci, &xhci->op_regs->status, -STS_RESTORE ,0 ,10 *100 )) { -xhci_dbg (xhci,"WARN: xHC CMD_CSS timeout\n" ); +STS_RESTORE ,0 ,10 *1000 )) { +xhci_warn (xhci,"WARN: xHC restore state timeout\n" );spin_unlock_irq (&xhci->lock);return -ETIMEDOUT ; }
Greg KH
maintainerPATCH 11/20 USB: mos7840: Fix compilation of usb serial driver
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Zelenoff <[email protected]>
commit b9c87663eead64c767e72a373ae6f8a94bead459 upstream.
The __devinitconst section can't be referenced from usb_serial_device structure. Thus removed it as it done in other mos* device drivers.
Error itself:
WARNING: drivers/usb/serial/mos7840.o(.data+0x8): Section mismatch in reference from the variable moschip7840_4port_device to the variable .devinit.rodata:id_table
The variable moschip7840_4port_device references
the variable __devinitconst id_table
[v2] no attach now
--- drivers/usb/serial/mos7840.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/mos7840.c +1 -1
@@ -206,7 +206,7 @@ static const struct usb_device_id moschi {}/* terminating entry */ }; -static const struct usb_device_id moschip_id_table_combined[]__devinitconst = { +static const struct usb_device_id moschip_id_table_combined[] = { {USB_DEVICE (USB_VENDOR_ID_MOSCHIP ,MOSCHIP_DEVICE_ID_7840 )}, {USB_DEVICE (USB_VENDOR_ID_MOSCHIP ,MOSCHIP_DEVICE_ID_7820 )}, {USB_DEVICE (USB_VENDOR_ID_BANDB ,BANDB_DEVICE_ID_USO9ML2_2 )},
Greg KH
maintainerPATCH 12/20 USB: qcserial: Add Sierra Wireless device IDs
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit c41444ccfa33a1c20efa319e554cb531576e64a2 upstream.
Some additional IDs found in the BSD/GPL licensed out-of-tree GobiSerial driver from Sierra Wireless.
--- drivers/usb/serial/qcserial.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/qcserial.c +6 -0
@@ -104,7 +104,13 @@ static const struct usb_device_id id_tab {USB_DEVICE(0x1410, 0xa021)}, /* Novatel Gobi 3000 Composite */ {USB_DEVICE(0x413c, 0x8193)}, /* Dell Gobi 3000 QDL */ {USB_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */ + {USB_DEVICE(0x1199, 0x9010)}, /* Sierra Wireless Gobi 3000 QDL */ + {USB_DEVICE(0x1199, 0x9012)}, /* Sierra Wireless Gobi 3000 QDL */ {USB_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ + {USB_DEVICE(0x1199, 0x9014)}, /* Sierra Wireless Gobi 3000 QDL */ + {USB_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ + {USB_DEVICE(0x1199, 0x9018)}, /* Sierra Wireless Gobi 3000 QDL */ + {USB_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ { } /* Terminating entry */
Greg KH
maintainerPATCH 13/20 USB: mct_u232: Fix incorrect TIOCMSET return
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Cox <[email protected]>
commit 1aa3c63cf0a79153ee13c8f82e4eb6c40b66a161 upstream.
The low level helper returns 1 on success. The ioctl should however return
0. As this is the only user of the helper return, make the helper return 0 or an error code.
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=43009
--- drivers/usb/serial/mct_u232.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/usb/serial/mct_u232.c +8 -5
@@ -359,13 +359,16 @@ static int mct_u232_set_modem_ctrl(strucMCT_U232_SET_REQUEST_TYPE ,0 ,0 , buf,MCT_U232_SET_MODEM_CTRL_SIZE , WDR_TIMEOUT); -if (rc <0 ) -dev_err (&serial->dev->dev, -"Set MODEM CTRL 0x%x failed (error = %d)\n" , mcr, rc); +kfree (buf); +dbg ("set_modem_ctrl: state=0x%x ==> mcr=0x%x" , control_state, mcr); -kfree (buf); -return rc; +if (rc <0 ) { +dev_err (&serial->dev->dev, +"Set MODEM CTRL 0x%x failed (error = %d)\n" , mcr, rc); +return rc; + } +return 0 ; }/* mct_u232_set_modem_ctrl */ static int mct_u232_get_modem_stat(struct usb_serial *serial,
Greg KH
maintainerPATCH 14/20 USB: serial: cp210x: add Optris MS Pro usb id
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikko Tuumanen <[email protected]>
commit 5bbfa6f427c1d7244a5ee154ab8fa37265a5e049 upstream.
--- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/cp210x.c +1 -0
@@ -82,6 +82,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ { USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */ { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ + { USB_DEVICE(0x10C4, 0x80C4) }, /* Cygnal Integrated Products, Inc., Optris infrared thermometer */ { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ { USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */ { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */
Greg KH
maintainerPATCH 15/20 USB: ftdi-sio: Add support for RT Systems USB-RTS01 serial adapter
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Evan McNabb <[email protected]>
commit e00a54d772210d450e5c1a801534c3c8a448549f upstream.
Add support for RT Systems USB-RTS01 USB to Serial adapter:
http://www.rtsystemsinc.com/Photos/USBRTS01.html
Tested by controlling Icom IC-718 amateur radio transceiver via hamlib.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 1 + 2 files changed, 2 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -735,6 +735,7 @@ static struct usb_device_id id_table_com { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, + { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_RTS01_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
drivers/usb/serial/ftdi_sio_ids.h +1 -0
@@ -784,6 +784,7 @@#define RTSYSTEMS_VID 0x2100/* Vendor ID */ #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52/* Serial converter for VX-7 Radios using FT232RL */ #define RTSYSTEMS_CT29B_PID 0x9e54/* CT29B Radio Cable */ +#define RTSYSTEMS_RTS01_PID 0x9e57/* USB-RTS01 Radio Cable */ /*
Greg KH
maintainerPATCH 16/20 USB: add NO_D3_DURING_SLEEP flag and revert 151b61284776be2
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit c2fb8a3fa25513de8fedb38509b1f15a5bbee47b upstream.
This patch (as1558) fixes a problem affecting several ASUS computers:
The machine crashes or corrupts memory when going into suspend if the ehci-hcd driver is bound to any controllers. Users have been forced to unbind or unload ehci-hcd before putting their systems to sleep.
After extensive testing, it was determined that the machines don't like going into suspend when any EHCI controllers are in the PCI D3 power state. Presumably this is a firmware bug, but there's nothing we can do about it except to avoid putting the controllers in D3 during system sleep.
The patch adds a new flag to indicate whether the problem is present, and avoids changing the controller's power state if the flag is set. Runtime suspend is unaffected; this matters only for system suspend. However as a side effect, the controller will not respond to remote wakeup requests while the system is asleep. Hence USB wakeup is not functional -- but of course, this is already true in the current state of affairs.
A similar patch has already been applied as commit 151b61284776be2d6f02d48c23c3625678960b97 (USB: EHCI: fix crash during suspend on ASUS computers). The patch supersedes that one and reverts it. There are two differences:
The old patch added the flag at the USB level; this patch adds it at the PCI level.
The old patch applied to all chipsets with the same vendor, subsystem vendor, and product IDs; this patch makes an exception for a known-good system (based on DMI information).
--- drivers/pci/pci.c | 5 +++++ drivers/pci/quirks.c | 26 ++++++++++++++++++++++++++ drivers/usb/core/hcd-pci.c | 9 --------- drivers/usb/host/ehci-pci.c | 8 -------- include/linux/pci.h | 2 ++ include/linux/usb/hcd.h | 2 -- 6 files changed, 33 insertions(+), 19 deletions(-)
drivers/pci/pci.c +5 -0
@@ -1682,6 +1682,11 @@ int pci_prepare_to_sleep(struct pci_devif (target_state ==PCI_POWER_ERROR )return -EIO ; +/* Some devices mustn't be in D3 during system sleep */ +if (target_state == PCI_D3hot && + (dev->dev_flags &PCI_DEV_FLAGS_NO_D3_DURING_SLEEP )) +return 0 ; +pci_enable_wake (dev, target_state,device_may_wakeup (&dev->dev)); error =pci_set_power_state (dev, target_state);
drivers/pci/quirks.c +26 -0
@@ -2856,6 +2856,32 @@ static void __devinit disable_igfx_irq(sDECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0102 , disable_igfx_irq);DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x010a , disable_igfx_irq); +/* +* The Intel 6 Series/C200 Series chipset's EHCI controllers on many +* ASUS motherboards will cause memory corruption or a system crash +* if they are in D3 while the system is put into S3 sleep. +*/ +static void __devinit asus_ehci_no_d3 (struct pci_dev *dev) +{ +const char *sys_info; +static const char good_Asus_board[] ="P8Z68-V" ; + +if (dev->dev_flags &PCI_DEV_FLAGS_NO_D3_DURING_SLEEP ) +return ; +if (dev->subsystem_vendor !=PCI_VENDOR_ID_ASUSTEK ) +return ; + sys_info =dmi_get_system_info (DMI_BOARD_NAME ); +if (sys_info &&memcmp (sys_info, good_Asus_board, +sizeof (good_Asus_board) -1 ) ==0 ) +return ; + +dev_info (&dev->dev,"broken D3 during system sleep on ASUS\n" ); + dev->dev_flags |=PCI_DEV_FLAGS_NO_D3_DURING_SLEEP ; +device_set_wakeup_capable (&dev->dev, false); +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1c26 , asus_ehci_no_d3); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1c2d , asus_ehci_no_d3); +static void pci_do_fixups (struct pci_dev *dev,struct pci_fixup *f,struct pci_fixup *end) {
drivers/usb/core/hcd-pci.c +0 -9
@@ -495,15 +495,6 @@ static int hcd_pci_suspend_noirq(structpci_save_state (pci_dev); -/* -* Some systems crash if an EHCI controller is in D3 during -* a sleep transition. We have to leave such controllers in D0. -*/ -if (hcd->broken_pci_sleep) { -dev_dbg (dev,"Staying in PCI D0\n" ); -return retval; - } -/* If the root hub is dead rather than suspended, disallow remote * wakeup. usb_hc_died() should ensure that both hosts are marked as * dying, so we only need to check the primary roothub.
drivers/usb/host/ehci-pci.c +0 -8
@@ -144,14 +144,6 @@ static int ehci_pci_setup(struct usb_hcd hcd->has_tt =1 ;tdi_reset (ehci); } -if (pdev->subsystem_vendor ==PCI_VENDOR_ID_ASUSTEK ) { -/* EHCI #1 or #2 on 6 Series/C200 Series chipset */ -if (pdev->device ==0x1c26 || pdev->device ==0x1c2d ) { -ehci_info (ehci,"broken D3 during system sleep on ASUS\n" ); - hcd->broken_pci_sleep =1 ; -device_set_wakeup_capable (&pdev->dev, false); - } - }break ;case PCI_VENDOR_ID_TDI :if (pdev->device ==PCI_DEVICE_ID_TDI_EHCI ) {
include/linux/pci.h +2 -0
@@ -174,6 +174,8 @@ enum pci_dev_flags {PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t )1 ,/* Device configuration is irrevocably lost if disabled into D3 */ PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t )2 , +/* Device causes system crash if in D3 during S3 sleep */ + PCI_DEV_FLAGS_NO_D3_DURING_SLEEP = (__force pci_dev_flags_t) 8, }; enum pci_irq_reroute_variant {
include/linux/usb/hcd.h +0 -2
@@ -128,8 +128,6 @@ struct usb_hcd { unsigned wireless:1; /* Wireless USB HCD */ unsigned authorized_default:1; unsigned has_tt:1; /* Integrated TT in root hub */ - unsigned broken_pci_sleep:1; /* Don't put the -controller in PCI-D3 for system sleep */ int irq;/* irq allocated */ void __iomem *regs;/* device memory/io */
Greg KH
maintainerPATCH 17/20 usb: cdc-acm: fix devices not unthrottled on open
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Otto Meta <[email protected]>
commit 6c4707f3f8c44ec18282e1c014c80e1c257042f9 upstream.
Currently CDC-ACM devices stay throttled when their TTY is closed while throttled, stalling further communication attempts after the next open.
Unthrottling during open/activate got lost starting with kernel 3.0.0 and this patch reintroduces it.
--- drivers/usb/class/cdc-acm.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/usb/class/cdc-acm.c +8 -0
@@ -498,6 +498,14 @@ static int acm_tty_open(struct tty_strucusb_autopm_put_interface (acm->control); +/* +* Unthrottle device in case the TTY was closed while throttled. +*/ +spin_lock_irq (&acm->read_lock); + acm->throttled =0 ; + acm->throttle_req =0 ; +spin_unlock_irq (&acm->read_lock); +if (acm_submit_read_urbs (acm,GFP_KERNEL )) goto bail_out;
Greg KH
maintainerPATCH 18/20 USB: serial: sierra: Add support for Sierra Wireless AirCard 320U modem
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tom Cassidy <[email protected]>
commit 19a3dd1575e954e8c004413bee3e12d3962f2525 upstream.
Add support for Sierra Wireless AirCard 320U modem
--- drivers/usb/serial/sierra.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/serial/sierra.c +4 -0
@@ -304,6 +304,10 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist }, +/* AT&T Direct IP LTE modems */ + { USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68AA, 0xFF, 0xFF, 0xFF), + .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist + }, { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist },
Greg KH
maintainerPATCH 19/20 USB: serial: Enforce USB driver and USB serial driver match
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit 954c3f8a5f1b7716be9eee978b3bc85bae92d7c8 upstream.
We need to make sure that the USB serial driver we find matches the USB driver whose probe we are currently executing. Otherwise we will end up with USB serial devices bound to the correct serial driver but wrong USB driver.
An example of such cross-probing, where the usbserial_generic USB driver has found the sierra serial driver:
May 29 18:26:15 nemi kernel: [ 4442.559246] usbserial_generic 4-4:1.0: Sierra USB modem converter detected May 29 18:26:20 nemi kernel: [ 4447.556747] usbserial_generic 4-4:1.2: Sierra USB modem converter detected May 29 18:26:25 nemi kernel: [ 4452.557288] usbserial_generic 4-4:1.3: Sierra USB modem converter detected
sysfs view of the same problem:
bjorn@nemi:~$ ls -l /sys/bus/usb/drivers/sierra/ total 0 --w------- 1 root root 4096 May 29 18:23 bind lrwxrwxrwx 1 root root 0 May 29 18:23 module -> ../../../../module/usbserial --w------- 1 root root 4096 May 29 18:23 uevent --w------- 1 root root 4096 May 29 18:23 unbind bjorn@nemi:~$ ls -l /sys/bus/usb-serial/drivers/sierra/ total 0 --w------- 1 root root 4096 May 29 18:23 bind lrwxrwxrwx 1 root root 0 May 29 18:23 module -> ../../../../module/sierra -rw-r--r-- 1 root root 4096 May 29 18:23 new_id lrwxrwxrwx 1 root root 0 May 29 18:32 ttyUSB0 -> ../../../../devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4:1.0/ttyUSB0 lrwxrwxrwx 1 root root 0 May 29 18:32 ttyUSB1 -> ../../../../devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4:1.2/ttyUSB1 lrwxrwxrwx 1 root root 0 May 29 18:32 ttyUSB2 -> ../../../../devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4:1.3/ttyUSB2 --w------- 1 root root 4096 May 29 18:23 uevent --w------- 1 root root 4096 May 29 18:23 unbind
bjorn@nemi:~$ ls -l /sys/bus/usb/drivers/usbserial_generic/ total 0 lrwxrwxrwx 1 root root 0 May 29 18:33 4-4:1.0 -> ../../../../devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4:1.0 lrwxrwxrwx 1 root root 0 May 29 18:33 4-4:1.2 -> ../../../../devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4:1.2 lrwxrwxrwx 1 root root 0 May 29 18:33 4-4:1.3 -> ../../../../devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4:1.3 --w------- 1 root root 4096 May 29 18:33 bind lrwxrwxrwx 1 root root 0 May 29 18:33 module -> ../../../../module/usbserial --w------- 1 root root 4096 May 29 18:22 uevent --w------- 1 root root 4096 May 29 18:33 unbind bjorn@nemi:~$ ls -l /sys/bus/usb-serial/drivers/generic/ total 0 --w------- 1 root root 4096 May 29 18:33 bind lrwxrwxrwx 1 root root 0 May 29 18:33 module -> ../../../../module/usbserial -rw-r--r-- 1 root root 4096 May 29 18:33 new_id --w------- 1 root root 4096 May 29 18:22 uevent --w------- 1 root root 4096 May 29 18:33 unbind
So we end up with a mismatch between the USB driver and the USB serial driver. The reason for the above is simple: The USB driver probe will succeed if *any* registered serial driver matches, and will use that serial driver for all serial driver functions.
This makes ref counting go wrong. We count the USB driver as used, but not the USB serial driver. This may result in Oops'es as demonstrated by Johan Hovold <[email protected]>:
[11811.646396] drivers/usb/serial/usb-serial.c: get_free_serial 1 [11811.646443] drivers/usb/serial/usb-serial.c: get_free_serial - minor base = 0 [11811.646460] drivers/usb/serial/usb-serial.c: usb_serial_probe - registering ttyUSB0 [11811.646766] usb 6-1: pl2303 converter now attached to ttyUSB0 [11812.264197] USB Serial deregistering driver FTDI USB Serial Device [11812.264865] usbcore: deregistering interface driver ftdi_sio [11812.282180] USB Serial deregistering driver pl2303 [11812.283141] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0 [11812.283272] usbcore: deregistering interface driver pl2303 [11812.301056] USB Serial deregistering driver generic [11812.301186] usbcore: deregistering interface driver usbserial_generic [11812.301259] drivers/usb/serial/usb-serial.c: usb_serial_disconnect [11812.301823] BUG: unable to handle kernel paging request at f8e7438c [11812.301845] IP: [<f8e38445>] usb_serial_disconnect+0xb5/0x100 [usbserial] [11812.301871] *pde = 357ef067 *pte = 00000000 [11812.301957] Oops: 0000 [#1] PREEMPT SMP [11812.301983] Modules linked in: usbserial(-) [last unloaded: pl2303] [11812.302008] [11812.302019] Pid: 1323, comm: modprobe Tainted: G W 3.4.0-rc7+ #101 Dell Inc. Vostro 1520/0T816J [11812.302115] EIP: 0060:[<f8e38445>] EFLAGS: 00010246 CPU: 1 [11812.302130] EIP is at usb_serial_disconnect+0xb5/0x100 [usbserial] [11812.302141] EAX: f508a180 EBX: f508a180 ECX: 00000000 EDX: f8e74300 [11812.302151] ESI: f5050800 EDI: 00000001 EBP: f5141e78 ESP: f5141e58 [11812.302160] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [11812.302170] CR0: 8005003b CR2: f8e7438c CR3: 34848000 CR4: 000007d0 [11812.302180] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 [11812.302189] DR6: ffff0ff0 DR7: 00000400 [11812.302199] Process modprobe (pid: 1323, ti=f5140000 task=f61e2bc0 task.ti=f5140000) [11812.302209] Stack: [11812.302216] f8e3be0f f8e3b29c f8e3ae00 00000000 f513641c f5136400 f513641c f507a540 [11812.302325] f5141e98 c133d2c1 00000000 00000000 f509c400 f513641c f507a590 f5136450 [11812.302372] f5141ea8 c12f0344 f513641c f507a590 f5141ebc c12f0c67 00000000 f507a590 [11812.302419] Call Trace: [11812.302439] [<c133d2c1>] usb_unbind_interface+0x51/0x190 [11812.302456] [<c12f0344>] __device_release_driver+0x64/0xb0 [11812.302469] [<c12f0c67>] driver_detach+0x97/0xa0 [11812.302483] [<c12f001c>] bus_remove_driver+0x6c/0xe0 [11812.302500] [<c145938d>] ? __mutex_unlock_slowpath+0xcd/0x140 [11812.302514] [<c12f0ff9>] driver_unregister+0x49/0x80 [11812.302528] [<c1457df6>] ? printk+0x1d/0x1f [11812.302540] [<c133c50d>] usb_deregister+0x5d/0xb0 [11812.302557] [<f8e37c55>] ? usb_serial_deregister+0x45/0x50 [usbserial] [11812.302575] [<f8e37c8d>] usb_serial_deregister_drivers+0x2d/0x40 [usbserial] [11812.302593] [<f8e3a6e2>] usb_serial_generic_deregister+0x12/0x20 [usbserial] [11812.302611] [<f8e3acf0>] usb_serial_exit+0x8/0x32 [usbserial] [11812.302716] [<c1080b48>] sys_delete_module+0x158/0x260 [11812.302730] [<c110594e>] ? mntput+0x1e/0x30 [11812.302746] [<c145c3c3>] ? sysenter_exit+0xf/0x18 [11812.302746] [<c107777c>] ? trace_hardirqs_on_caller+0xec/0x170 [11812.302746] [<c145c390>] sysenter_do_call+0x12/0x36 [11812.302746] Code: 24 02 00 00 e8 dd f3 20 c8 f6 86 74 02 00 00 02 74 b4 8d 86 4c 02 00 00 47 e8 78 55 4b c8 0f b6 43 0e 39 f8 7f a9 8b 53 04 89 d8 <ff> 92 8c 00 00 00 89 d8 e8 0e ff ff ff 8b 45 f0 c7 44 24 04 2f [11812.302746] EIP: [<f8e38445>] usb_serial_disconnect+0xb5/0x100 [usbserial] SS:ESP 0068:f5141e58 [11812.302746] CR2: 00000000f8e7438c
Fix by only evaluating serial drivers pointing back to the USB driver we are currently probing. This still allows two or more drivers to match the same device, running their serial driver probes to sort out which one to use.
--- drivers/usb/serial/usb-serial.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/serial/usb-serial.c +4 -2
@@ -669,12 +669,14 @@ exit:static struct usb_serial_driver *search_serial_device (struct usb_interface *iface) { -const struct usb_device_id *id; +const struct usb_device_id *id =NULL ;struct usb_serial_driver *drv; +struct usb_driver *driver =to_usb_driver (iface->dev.driver);/* Check if the usb id matches a known device */ list_for_each_entry (drv, &usb_serial_driver_list, driver_list) { - id =get_iface_id (drv, iface); +if (drv->usb_driver == driver) + id =get_iface_id (drv, iface);if (id)return drv; }
Greg KH
maintainerPATCH 20/20 USB: fix gathering of interface associations
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Mack <[email protected]>
commit b3a3dd074f7053ef824ad077e5331b52220ceba1 upstream.
TEAC's UD-H01 (and probably other devices) have a gap in the interface number allocation of their descriptors:
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 220
bNumInterfaces 3
[...]
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
[...]
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 2
bInterfaceCount 2
bFunctionClass 1 Audio
bFunctionSubClass 0
bFunctionProtocol 32
iFunction 4
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
[...]Once a configuration is selected, usb_set_configuration() walks the known interfaces of a given configuration and calls find_iad() on each of them to set the interface association pointer the interface is included in.
The problem here is that the loop variable is taken for the interface number in the comparison logic that gathers the association. Which is fine as long as the descriptors are sane.
In the case above, however, the logic gets out of sync and the interface association fields of all interfaces beyond the interface number gap are wrong.
Fix this by passing the interface's bInterfaceNumber to find_iad() instead.
--- drivers/usb/core/message.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/core/message.c +2 -1
@@ -1803,7 +1803,6 @@ free_interfaces: intfc = cp->intf_cache[i]; intf->altsetting = intfc->altsetting; intf->num_altsetting = intfc->num_altsetting; - intf->intf_assoc =find_iad (dev, cp, i);kref_get (&intfc->ref); alt =usb_altnum_to_altsetting (intf,0 );
@@ -1816,6 +1815,8 @@ free_interfaces:if (!alt) alt = &intf->altsetting[0 ]; + intf->intf_assoc = +find_iad (dev, cp, alt->desc.bInterfaceNumber); intf->cur_altsetting = alt;usb_enable_interface (dev, intf, true); intf->dev.parent = &dev->dev;