From: Greg Kroah-Hartman Date: Thu, 29 Jan 2009 01:03:46 +0000 (-0800) Subject: more .27 patches X-Git-Tag: v2.6.27.14~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3414f2ca830dd2208979b9d45c51ea6b7aafceb0;p=thirdparty%2Fkernel%2Fstable-queue.git more .27 patches --- diff --git a/queue-2.6.27/alpha-nautilus-fix-compile-failure-with-gcc-4.3.patch b/queue-2.6.27/alpha-nautilus-fix-compile-failure-with-gcc-4.3.patch new file mode 100644 index 00000000000..2bcf2468b67 --- /dev/null +++ b/queue-2.6.27/alpha-nautilus-fix-compile-failure-with-gcc-4.3.patch @@ -0,0 +1,42 @@ +From 70b66cbfd3316b792a855cb9a2574e85f1a63d0f Mon Sep 17 00:00:00 2001 +From: Ivan Kokshaysky +Date: Thu, 15 Jan 2009 13:51:17 -0800 +Subject: alpha: nautilus - fix compile failure with gcc-4.3 + +From: Ivan Kokshaysky + +commit 70b66cbfd3316b792a855cb9a2574e85f1a63d0f upstream. + +init_srm_irq() deals with irq's #16 and above, but size of irq_desc +array on nautilus and some other system types is 16. So gcc-4.3 +complains that "array subscript is above array bounds", even though +this function is never called on those systems. + +This adds a check for NR_IRQS <= 16, which effectively optimizes +init_srm_irq() code away on problematic platforms. + +Thanks to Daniel Drake for detailed analysis +of the problem. + +Signed-off-by: Ivan Kokshaysky +Cc: Richard Henderson +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Cc: Tobias Klausmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/alpha/kernel/irq_srm.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/alpha/kernel/irq_srm.c ++++ b/arch/alpha/kernel/irq_srm.c +@@ -63,6 +63,8 @@ init_srm_irqs(long max, unsigned long ig + { + long i; + ++ if (NR_IRQS <= 16) ++ return; + for (i = 16; i < max; ++i) { + if (i < 64 && ((ignore_mask >> i) & 1)) + continue; diff --git a/queue-2.6.27/it821x-add-ultra_mask-quirk-for-vortex86sx.patch b/queue-2.6.27/it821x-add-ultra_mask-quirk-for-vortex86sx.patch new file mode 100644 index 00000000000..37b5287043e --- /dev/null +++ b/queue-2.6.27/it821x-add-ultra_mask-quirk-for-vortex86sx.patch @@ -0,0 +1,85 @@ +From b94b898f3107046b5c97c556e23529283ea5eadd Mon Sep 17 00:00:00 2001 +From: Brandon Philips +Date: Wed, 14 Jan 2009 19:19:02 +0100 +Subject: it821x: Add ultra_mask quirk for Vortex86SX + +From: Brandon Philips + +commit b94b898f3107046b5c97c556e23529283ea5eadd upstream. + +On Vortex86SX with IDE controller revision 0x11 ultra DMA must be +disabled. This patch was tested by DMP and seems to work. + +It is a cleaned up version of their older Kernel patch: + http://www.dmp.com.tw/tech/vortex86sx/patch-2.6.24-DMP.gz + +Tested-by: Shawn Lin +Signed-off-by: Brandon Philips +Cc: Alan Cox +Signed-off-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ide/pci/it821x.c | 12 ++++++++++++ + include/linux/pci_ids.h | 1 + + 2 files changed, 13 insertions(+) + +--- a/drivers/ide/pci/it821x.c ++++ b/drivers/ide/pci/it821x.c +@@ -69,6 +69,8 @@ + + #define DRV_NAME "it821x" + ++#define QUIRK_VORTEX86 1 ++ + struct it821x_dev + { + unsigned int smart:1, /* Are we in smart raid mode */ +@@ -80,6 +82,7 @@ struct it821x_dev + u16 pio[2]; /* Cached PIO values */ + u16 mwdma[2]; /* Cached MWDMA values */ + u16 udma[2]; /* Cached UDMA values (per drive) */ ++ u16 quirks; + }; + + #define ATA_66 0 +@@ -586,6 +589,12 @@ static void __devinit init_hwif_it821x(i + + hwif->ultra_mask = ATA_UDMA6; + hwif->mwdma_mask = ATA_MWDMA2; ++ ++ /* Vortex86SX quirk: prevent Ultra-DMA mode to fix BadCRC issue */ ++ if (idev->quirks & QUIRK_VORTEX86) { ++ if (dev->revision == 0x11) ++ hwif->ultra_mask = 0; ++ } + } + + static void __devinit it8212_disable_raid(struct pci_dev *dev) +@@ -658,6 +667,8 @@ static int __devinit it821x_init_one(str + return -ENOMEM; + } + ++ itdevs->quirks = id->driver_data; ++ + rc = ide_pci_init_one(dev, &it821x_chipset, itdevs); + if (rc) + kfree(itdevs); +@@ -677,6 +688,7 @@ static void __devexit it821x_remove(stru + static const struct pci_device_id it821x_pci_tbl[] = { + { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), 0 }, + { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), 0 }, ++ { PCI_VDEVICE(RDC, PCI_DEVICE_ID_RDC_D1010), QUIRK_VORTEX86 }, + { 0, }, + }; + +--- a/include/linux/pci_ids.h ++++ b/include/linux/pci_ids.h +@@ -2148,6 +2148,7 @@ + #define PCI_DEVICE_ID_RDC_R6040 0x6040 + #define PCI_DEVICE_ID_RDC_R6060 0x6060 + #define PCI_DEVICE_ID_RDC_R6061 0x6061 ++#define PCI_DEVICE_ID_RDC_D1010 0x1010 + + #define PCI_VENDOR_ID_LENOVO 0x17aa + diff --git a/queue-2.6.27/libata-pata_via-support-vx855-future-chips-whose-ide-controller-use-0x0571.patch b/queue-2.6.27/libata-pata_via-support-vx855-future-chips-whose-ide-controller-use-0x0571.patch new file mode 100644 index 00000000000..fa937abb217 --- /dev/null +++ b/queue-2.6.27/libata-pata_via-support-vx855-future-chips-whose-ide-controller-use-0x0571.patch @@ -0,0 +1,122 @@ +From e4d866cdea24543ee16ce6d07d80c513e86ba983 Mon Sep 17 00:00:00 2001 +From: JosephChan@via.com.tw +Date: Fri, 23 Jan 2009 15:37:39 +0800 +Subject: libata: pata_via: support VX855, future chips whose IDE controller use 0x0571 + +From: JosephChan@via.com.tw + +commit e4d866cdea24543ee16ce6d07d80c513e86ba983 upstream. + +It supports VX855 and future chips whose IDE controller uses PCI ID 0x0571. + +Signed-off-by: Joseph Chan +Acked-by: Tejun Heo +Signed-off-by: Jeff Garzik +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/pata_via.c | 22 +++++++++++++++++----- + include/linux/pci_ids.h | 4 ++++ + 2 files changed, 21 insertions(+), 5 deletions(-) + +--- a/drivers/ata/pata_via.c ++++ b/drivers/ata/pata_via.c +@@ -87,6 +87,10 @@ enum { + VIA_SATA_PATA = 0x800, /* SATA/PATA combined configuration */ + }; + ++enum { ++ VIA_IDFLAG_SINGLE = (1 << 0), /* single channel controller) */ ++}; ++ + /* + * VIA SouthBridge chips. + */ +@@ -98,8 +102,12 @@ static const struct via_isa_bridge { + u8 rev_max; + u16 flags; + } via_isa_bridges[] = { ++ { "vx855", PCI_DEVICE_ID_VIA_VX855, 0x00, 0x2f, ++ VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA }, + { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | + VIA_BAD_AST | VIA_SATA_PATA }, ++ { "vt8261", PCI_DEVICE_ID_VIA_8261, 0x00, 0x2f, ++ VIA_UDMA_133 | VIA_BAD_AST }, + { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, + { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, + { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA }, +@@ -123,6 +131,8 @@ static const struct via_isa_bridge { + { "vt82c586", PCI_DEVICE_ID_VIA_82C586_0, 0x00, 0x0f, VIA_UDMA_NONE | VIA_SET_FIFO }, + { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK }, + { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK | VIA_BAD_ID }, ++ { "vtxxxx", PCI_DEVICE_ID_VIA_ANON, 0x00, 0x2f, ++ VIA_UDMA_133 | VIA_BAD_AST }, + { NULL } + }; + +@@ -461,6 +471,7 @@ static int via_init_one(struct pci_dev * + static int printed_version; + u8 enable; + u32 timing; ++ unsigned long flags = id->driver_data; + int rc; + + if (!printed_version++) +@@ -470,9 +481,13 @@ static int via_init_one(struct pci_dev * + if (rc) + return rc; + ++ if (flags & VIA_IDFLAG_SINGLE) ++ ppi[1] = &ata_dummy_port_info; ++ + /* To find out how the IDE will behave and what features we + actually have to look at the bridge not the IDE controller */ +- for (config = via_isa_bridges; config->id; config++) ++ for (config = via_isa_bridges; config->id != PCI_DEVICE_ID_VIA_ANON; ++ config++) + if ((isa = pci_get_device(PCI_VENDOR_ID_VIA + + !!(config->flags & VIA_BAD_ID), + config->id, NULL))) { +@@ -483,10 +498,6 @@ static int via_init_one(struct pci_dev * + pci_dev_put(isa); + } + +- if (!config->id) { +- printk(KERN_WARNING "via: Unknown VIA SouthBridge, disabling.\n"); +- return -ENODEV; +- } + pci_dev_put(isa); + + if (!(config->flags & VIA_NO_ENABLES)) { +@@ -588,6 +599,7 @@ static const struct pci_device_id via[] + { PCI_VDEVICE(VIA, 0x1571), }, + { PCI_VDEVICE(VIA, 0x3164), }, + { PCI_VDEVICE(VIA, 0x5324), }, ++ { PCI_VDEVICE(VIA, 0xC409), VIA_IDFLAG_SINGLE }, + + { }, + }; +--- a/include/linux/pci_ids.h ++++ b/include/linux/pci_ids.h +@@ -1346,6 +1346,7 @@ + #define PCI_DEVICE_ID_VIA_8783_0 0x3208 + #define PCI_DEVICE_ID_VIA_8237 0x3227 + #define PCI_DEVICE_ID_VIA_8251 0x3287 ++#define PCI_DEVICE_ID_VIA_8261 0x3402 + #define PCI_DEVICE_ID_VIA_8237A 0x3337 + #define PCI_DEVICE_ID_VIA_8237S 0x3372 + #define PCI_DEVICE_ID_VIA_SATA_EIDE 0x5324 +@@ -1355,10 +1356,13 @@ + #define PCI_DEVICE_ID_VIA_CX700 0x8324 + #define PCI_DEVICE_ID_VIA_CX700_IDE 0x0581 + #define PCI_DEVICE_ID_VIA_VX800 0x8353 ++#define PCI_DEVICE_ID_VIA_VX855 0x8409 + #define PCI_DEVICE_ID_VIA_8371_1 0x8391 + #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 + #define PCI_DEVICE_ID_VIA_838X_1 0xB188 + #define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198 ++#define PCI_DEVICE_ID_VIA_C409_IDE 0XC409 ++#define PCI_DEVICE_ID_VIA_ANON 0xFFFF + + #define PCI_VENDOR_ID_SIEMENS 0x110A + #define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 diff --git a/queue-2.6.27/rtl8187-add-termination-packet-to-prevent-stall.patch b/queue-2.6.27/rtl8187-add-termination-packet-to-prevent-stall.patch new file mode 100644 index 00000000000..5a625e1bc54 --- /dev/null +++ b/queue-2.6.27/rtl8187-add-termination-packet-to-prevent-stall.patch @@ -0,0 +1,30 @@ +From 2fcbab044a3faf4d4a6e269148dd1f188303b206 Mon Sep 17 00:00:00 2001 +From: Larry Finger +Date: Fri, 23 Jan 2009 11:46:32 -0600 +Subject: rtl8187: Add termination packet to prevent stall + +From: Larry Finger + +commit 2fcbab044a3faf4d4a6e269148dd1f188303b206 upstream. + +The RTL8187 and RTL8187B devices can stall unless an explicit termination +packet is sent. + +Signed-off-by: Larry Finger +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/rtl8187_dev.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/rtl8187_dev.c ++++ b/drivers/net/wireless/rtl8187_dev.c +@@ -263,6 +263,7 @@ static int rtl8187_tx(struct ieee80211_h + + usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, ep), + buf, skb->len, rtl8187_tx_cb, skb); ++ urb->transfer_flags |= URB_ZERO_PACKET; + rc = usb_submit_urb(urb, GFP_ATOMIC); + if (rc < 0) { + usb_free_urb(urb); diff --git a/queue-2.6.27/serial_8250-support-for-sealevel-systems-model-7803-comm-8.patch b/queue-2.6.27/serial_8250-support-for-sealevel-systems-model-7803-comm-8.patch new file mode 100644 index 00000000000..b1826330ee8 --- /dev/null +++ b/queue-2.6.27/serial_8250-support-for-sealevel-systems-model-7803-comm-8.patch @@ -0,0 +1,43 @@ +From e65f0f8271b1b0452334e5da37fd35413a000de4 Mon Sep 17 00:00:00 2001 +From: Flavio Leitner +Date: Fri, 2 Jan 2009 13:50:43 +0000 +Subject: serial_8250: support for Sealevel Systems Model 7803 COMM+8 + +From: Flavio Leitner + +commit e65f0f8271b1b0452334e5da37fd35413a000de4 upstream. + +Add support for Sealevel Systems Model 7803 COMM+8 + +Signed-off-by: Flavio Leitner +Signed-off-by: Alan Cox +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/serial/8250_pci.c | 3 +++ + include/linux/pci_ids.h | 1 + + 2 files changed, 4 insertions(+) + +--- a/drivers/serial/8250_pci.c ++++ b/drivers/serial/8250_pci.c +@@ -2190,6 +2190,9 @@ static struct pci_device_id serial_pci_t + { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b2_8_115200 }, ++ { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_7803, ++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, ++ pbn_b2_8_460800 }, + { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b2_8_115200 }, +--- a/include/linux/pci_ids.h ++++ b/include/linux/pci_ids.h +@@ -1784,6 +1784,7 @@ + #define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202 + #define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401 + #define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801 ++#define PCI_DEVICE_ID_SEALEVEL_7803 0x7803 + #define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804 + + #define PCI_VENDOR_ID_HYPERCOPE 0x1365 diff --git a/queue-2.6.27/series b/queue-2.6.27/series index fa9c66bcb70..d09e8680cb7 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -5,3 +5,13 @@ inotify-clean-up-inotify_read-and-fix-locking-problems.patch mac80211-decrement-ref-count-to-netdev-after-launching-mesh-discovery.patch sysfs-fix-problems-with-binary-files.patch x86-mm-fix-pte_free.patch +alpha-nautilus-fix-compile-failure-with-gcc-4.3.patch +it821x-add-ultra_mask-quirk-for-vortex86sx.patch +libata-pata_via-support-vx855-future-chips-whose-ide-controller-use-0x0571.patch +rtl8187-add-termination-packet-to-prevent-stall.patch +serial_8250-support-for-sealevel-systems-model-7803-comm-8.patch +sunrpc-fix-a-memory-leak-in-rpcb_getport_async.patch +sunrpc-fix-autobind-on-cloned-rpc-clients.patch +usb-fix-char-device-disconnect-handling.patch +usb-storage-add-unusual-devs-entry.patch +usb-usbmon-implement-compat_ioctl.patch diff --git a/queue-2.6.27/sunrpc-fix-a-memory-leak-in-rpcb_getport_async.patch b/queue-2.6.27/sunrpc-fix-a-memory-leak-in-rpcb_getport_async.patch new file mode 100644 index 00000000000..2dece860554 --- /dev/null +++ b/queue-2.6.27/sunrpc-fix-a-memory-leak-in-rpcb_getport_async.patch @@ -0,0 +1,36 @@ +From 96165e2b7c4e2c82a0b60c766d4a2036444c21a0 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Fri, 3 Oct 2008 16:48:40 -0400 +Subject: SUNRPC: Fix a memory leak in rpcb_getport_async + +From: Trond Myklebust + +commit 96165e2b7c4e2c82a0b60c766d4a2036444c21a0 upstream. + +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + net/sunrpc/rpcb_clnt.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/net/sunrpc/rpcb_clnt.c ++++ b/net/sunrpc/rpcb_clnt.c +@@ -558,7 +558,7 @@ void rpcb_getport_async(struct rpc_task + status = -ENOMEM; + dprintk("RPC: %5u %s: no memory available\n", + task->tk_pid, __func__); +- goto bailout_nofree; ++ goto bailout_release_client; + } + map->r_prog = clnt->cl_prog; + map->r_vers = clnt->cl_vers; +@@ -583,6 +583,8 @@ void rpcb_getport_async(struct rpc_task + task->tk_xprt->stat.bind_count++; + return; + ++bailout_release_client: ++ rpc_release_client(rpcb_clnt); + bailout_nofree: + rpcb_wake_rpcbind_waiters(xprt, status); + task->tk_status = status; diff --git a/queue-2.6.27/sunrpc-fix-autobind-on-cloned-rpc-clients.patch b/queue-2.6.27/sunrpc-fix-autobind-on-cloned-rpc-clients.patch new file mode 100644 index 00000000000..58b727176ff --- /dev/null +++ b/queue-2.6.27/sunrpc-fix-autobind-on-cloned-rpc-clients.patch @@ -0,0 +1,100 @@ +From 9a4bd29fe8f6d3f015fe1c8e5450eb62cfebfcc9 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Fri, 3 Oct 2008 16:48:34 -0400 +Subject: SUNRPC: Fix autobind on cloned rpc clients + +From: Trond Myklebust + +commit 9a4bd29fe8f6d3f015fe1c8e5450eb62cfebfcc9 upstream. + +Despite the fact that cloned rpc clients won't have the cl_autobind flag +set, they may still find themselves calling rpcb_getport_async(). For this +to happen, it suffices for a _parent_ rpc_clnt to use autobinding, in which +case any clone may find itself triggering the !xprt_bound() case in +call_bind(). + +The correct fix for this is to walk back up the tree of cloned rpc clients, +in order to find the parent that 'owns' the transport, either because it +has clnt->cl_autobind set, or because it originally created the +transport... + +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + net/sunrpc/rpcb_clnt.c | 36 +++++++++++++++++++++++++++++------- + 1 file changed, 29 insertions(+), 7 deletions(-) + +--- a/net/sunrpc/rpcb_clnt.c ++++ b/net/sunrpc/rpcb_clnt.c +@@ -469,6 +469,28 @@ static struct rpc_task *rpcb_call_async( + return rpc_run_task(&task_setup_data); + } + ++/* ++ * In the case where rpc clients have been cloned, we want to make ++ * sure that we use the program number/version etc of the actual ++ * owner of the xprt. To do so, we walk back up the tree of parents ++ * to find whoever created the transport and/or whoever has the ++ * autobind flag set. ++ */ ++static struct rpc_clnt *rpcb_find_transport_owner(struct rpc_clnt *clnt) ++{ ++ struct rpc_clnt *parent = clnt->cl_parent; ++ ++ while (parent != clnt) { ++ if (parent->cl_xprt != clnt->cl_xprt) ++ break; ++ if (clnt->cl_autobind) ++ break; ++ clnt = parent; ++ parent = parent->cl_parent; ++ } ++ return clnt; ++} ++ + /** + * rpcb_getport_async - obtain the port for a given RPC service on a given host + * @task: task that is waiting for portmapper request +@@ -478,10 +500,10 @@ static struct rpc_task *rpcb_call_async( + */ + void rpcb_getport_async(struct rpc_task *task) + { +- struct rpc_clnt *clnt = task->tk_client; ++ struct rpc_clnt *clnt; + struct rpc_procinfo *proc; + u32 bind_version; +- struct rpc_xprt *xprt = task->tk_xprt; ++ struct rpc_xprt *xprt; + struct rpc_clnt *rpcb_clnt; + static struct rpcbind_args *map; + struct rpc_task *child; +@@ -490,13 +512,13 @@ void rpcb_getport_async(struct rpc_task + size_t salen; + int status; + ++ clnt = rpcb_find_transport_owner(task->tk_client); ++ xprt = clnt->cl_xprt; ++ + dprintk("RPC: %5u %s(%s, %u, %u, %d)\n", + task->tk_pid, __func__, + clnt->cl_server, clnt->cl_prog, clnt->cl_vers, xprt->prot); + +- /* Autobind on cloned rpc clients is discouraged */ +- BUG_ON(clnt->cl_parent != clnt); +- + /* Put self on the wait queue to ensure we get notified if + * some other task is already attempting to bind the port */ + rpc_sleep_on(&xprt->binding, task, NULL); +@@ -578,9 +600,9 @@ void rpcb_getport_async(struct rpc_task + task->tk_pid, __func__); + return; + } +- rpc_put_task(child); + +- task->tk_xprt->stat.bind_count++; ++ xprt->stat.bind_count++; ++ rpc_put_task(child); + return; + + bailout_release_client: diff --git a/queue-2.6.27/usb-fix-char-device-disconnect-handling.patch b/queue-2.6.27/usb-fix-char-device-disconnect-handling.patch new file mode 100644 index 00000000000..530225ae559 --- /dev/null +++ b/queue-2.6.27/usb-fix-char-device-disconnect-handling.patch @@ -0,0 +1,124 @@ +From 501950d846218ed80a776d2aae5aed9c8b92e778 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Tue, 13 Jan 2009 11:33:42 -0500 +Subject: USB: fix char-device disconnect handling + +From: Alan Stern + +commit 501950d846218ed80a776d2aae5aed9c8b92e778 upstream. + +This patch (as1198) fixes a conceptual bug: Somewhere along the line +we managed to confuse USB class devices with USB char devices. As a +result, the code to send a disconnect signal to userspace would not be +built if both CONFIG_USB_DEVICE_CLASS and CONFIG_USB_DEVICEFS were +disabled. + +The usb_fs_classdev_common_remove() routine has been renamed to +usbdev_remove() and it is now called whenever any USB device is +removed, not just when a class device is unregistered. The notifier +registration and unregistration calls are no longer conditionally +compiled. And since the common removal code will always be called as +part of the char device interface, there's no need to call it again as +part of the usbfs interface; thus the invocation of +usb_fs_classdev_common_remove() has been taken out of +usbfs_remove_device(). + +Signed-off-by: Alan Stern +Reported-by: Alon Bar-Lev +Tested-by: Alon Bar-Lev +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/devio.c | 20 ++++++++++++-------- + drivers/usb/core/inode.c | 1 - + drivers/usb/core/usb.h | 1 - + 3 files changed, 12 insertions(+), 10 deletions(-) + +--- a/drivers/usb/core/devio.c ++++ b/drivers/usb/core/devio.c +@@ -1700,7 +1700,7 @@ const struct file_operations usbdev_file + .release = usbdev_release, + }; + +-void usb_fs_classdev_common_remove(struct usb_device *udev) ++static void usbdev_remove(struct usb_device *udev) + { + struct dev_state *ps; + struct siginfo sinfo; +@@ -1742,10 +1742,15 @@ static void usb_classdev_remove(struct u + { + if (dev->usb_classdev) + device_unregister(dev->usb_classdev); +- usb_fs_classdev_common_remove(dev); + } + +-static int usb_classdev_notify(struct notifier_block *self, ++#else ++#define usb_classdev_add(dev) 0 ++#define usb_classdev_remove(dev) do {} while (0) ++ ++#endif ++ ++static int usbdev_notify(struct notifier_block *self, + unsigned long action, void *dev) + { + switch (action) { +@@ -1755,15 +1760,15 @@ static int usb_classdev_notify(struct no + break; + case USB_DEVICE_REMOVE: + usb_classdev_remove(dev); ++ usbdev_remove(dev); + break; + } + return NOTIFY_OK; + } + + static struct notifier_block usbdev_nb = { +- .notifier_call = usb_classdev_notify, ++ .notifier_call = usbdev_notify, + }; +-#endif + + static struct cdev usb_device_cdev; + +@@ -1797,9 +1802,8 @@ int __init usb_devio_init(void) + * to /sys/dev + */ + usb_classdev_class->dev_kobj = NULL; +- +- usb_register_notify(&usbdev_nb); + #endif ++ usb_register_notify(&usbdev_nb); + out: + return retval; + +@@ -1810,8 +1814,8 @@ error_cdev: + + void usb_devio_cleanup(void) + { +-#ifdef CONFIG_USB_DEVICE_CLASS + usb_unregister_notify(&usbdev_nb); ++#ifdef CONFIG_USB_DEVICE_CLASS + class_destroy(usb_classdev_class); + #endif + cdev_del(&usb_device_cdev); +--- a/drivers/usb/core/inode.c ++++ b/drivers/usb/core/inode.c +@@ -716,7 +716,6 @@ static void usbfs_remove_device(struct u + fs_remove_file (dev->usbfs_dentry); + dev->usbfs_dentry = NULL; + } +- usb_fs_classdev_common_remove(dev); + } + + static int usbfs_notify(struct notifier_block *self, unsigned long action, void *dev) +--- a/drivers/usb/core/usb.h ++++ b/drivers/usb/core/usb.h +@@ -145,7 +145,6 @@ extern struct usb_driver usbfs_driver; + extern const struct file_operations usbfs_devices_fops; + extern const struct file_operations usbdev_file_operations; + extern void usbfs_conn_disc_event(void); +-extern void usb_fs_classdev_common_remove(struct usb_device *udev); + + extern int usb_devio_init(void); + extern void usb_devio_cleanup(void); diff --git a/queue-2.6.27/usb-storage-add-unusual-devs-entry.patch b/queue-2.6.27/usb-storage-add-unusual-devs-entry.patch new file mode 100644 index 00000000000..d2682369e12 --- /dev/null +++ b/queue-2.6.27/usb-storage-add-unusual-devs-entry.patch @@ -0,0 +1,33 @@ +From b90de8aea36ae6fe8050a6e91b031369c4f251b2 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Wed, 14 Jan 2009 16:17:19 +0100 +Subject: USB: storage: add unusual devs entry + +From: Oliver Neukum + +commit b90de8aea36ae6fe8050a6e91b031369c4f251b2 upstream. + +This adds an unusual devs entry for 2116:0320 + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/unusual_devs.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/usb/storage/unusual_devs.h ++++ b/drivers/usb/storage/unusual_devs.h +@@ -2047,6 +2047,12 @@ UNUSUAL_DEV( 0x19d2, 0x2000, 0x0000, 0x + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_DEVICE), + ++UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001, ++ "ST", ++ "2A", ++ US_SC_DEVICE, US_PR_DEVICE, NULL, ++ US_FL_FIX_CAPACITY), ++ + /* patch submitted by Davide Perini + * and Renato Perini + */ diff --git a/queue-2.6.27/usb-usbmon-implement-compat_ioctl.patch b/queue-2.6.27/usb-usbmon-implement-compat_ioctl.patch new file mode 100644 index 00000000000..c49faf28c87 --- /dev/null +++ b/queue-2.6.27/usb-usbmon-implement-compat_ioctl.patch @@ -0,0 +1,175 @@ +From 7abce6bedc118eb39fe177c2c26be5d008505c14 Mon Sep 17 00:00:00 2001 +From: Pete Zaitcev +Date: Sat, 20 Dec 2008 12:56:08 -0700 +Subject: USB: usbmon: Implement compat_ioctl + +From: Pete Zaitcev + +commit 7abce6bedc118eb39fe177c2c26be5d008505c14 upstream. + +Running a 32-bit usbmon(8) on 2.6.28-rc9 produces the following: +ioctl32(usbmon:28563): Unknown cmd fd(3) cmd(400c9206){t:ffffff92;sz:12} arg(ffd3f458) on /dev/usbmon0 + +It happens because the compatibility mode was implemented for 2.6.18 +and not updated for the fsops.compat_ioctl API. + +This patch relocates the pieces from under #ifdef CONFIG_COMPAT into +compat_ioctl with no other changes except one new whitespace. + +Signed-off-by: Pete Zaitcev +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/mon/mon_bin.c | 105 ++++++++++++++++++++++++++++------------------ + 1 file changed, 66 insertions(+), 39 deletions(-) + +--- a/drivers/usb/mon/mon_bin.c ++++ b/drivers/usb/mon/mon_bin.c +@@ -37,6 +37,7 @@ + #define MON_IOCX_GET _IOW(MON_IOC_MAGIC, 6, struct mon_bin_get) + #define MON_IOCX_MFETCH _IOWR(MON_IOC_MAGIC, 7, struct mon_bin_mfetch) + #define MON_IOCH_MFLUSH _IO(MON_IOC_MAGIC, 8) ++ + #ifdef CONFIG_COMPAT + #define MON_IOCX_GET32 _IOW(MON_IOC_MAGIC, 6, struct mon_bin_get32) + #define MON_IOCX_MFETCH32 _IOWR(MON_IOC_MAGIC, 7, struct mon_bin_mfetch32) +@@ -921,21 +922,6 @@ static int mon_bin_ioctl(struct inode *i + } + break; + +-#ifdef CONFIG_COMPAT +- case MON_IOCX_GET32: { +- struct mon_bin_get32 getb; +- +- if (copy_from_user(&getb, (void __user *)arg, +- sizeof(struct mon_bin_get32))) +- return -EFAULT; +- +- ret = mon_bin_get_event(file, rp, +- compat_ptr(getb.hdr32), compat_ptr(getb.data32), +- getb.alloc32); +- } +- break; +-#endif +- + case MON_IOCX_MFETCH: + { + struct mon_bin_mfetch mfetch; +@@ -962,7 +948,57 @@ static int mon_bin_ioctl(struct inode *i + } + break; + ++ case MON_IOCG_STATS: { ++ struct mon_bin_stats __user *sp; ++ unsigned int nevents; ++ unsigned int ndropped; ++ ++ spin_lock_irqsave(&rp->b_lock, flags); ++ ndropped = rp->cnt_lost; ++ rp->cnt_lost = 0; ++ spin_unlock_irqrestore(&rp->b_lock, flags); ++ nevents = mon_bin_queued(rp); ++ ++ sp = (struct mon_bin_stats __user *)arg; ++ if (put_user(rp->cnt_lost, &sp->dropped)) ++ return -EFAULT; ++ if (put_user(nevents, &sp->queued)) ++ return -EFAULT; ++ ++ } ++ break; ++ ++ default: ++ return -ENOTTY; ++ } ++ ++ return ret; ++} ++ + #ifdef CONFIG_COMPAT ++static long mon_bin_compat_ioctl(struct file *file, ++ unsigned int cmd, unsigned long arg) ++{ ++ struct mon_reader_bin *rp = file->private_data; ++ int ret; ++ ++ switch (cmd) { ++ ++ case MON_IOCX_GET32: { ++ struct mon_bin_get32 getb; ++ ++ if (copy_from_user(&getb, (void __user *)arg, ++ sizeof(struct mon_bin_get32))) ++ return -EFAULT; ++ ++ ret = mon_bin_get_event(file, rp, ++ compat_ptr(getb.hdr32), compat_ptr(getb.data32), ++ getb.alloc32); ++ if (ret < 0) ++ return ret; ++ } ++ return 0; ++ + case MON_IOCX_MFETCH32: + { + struct mon_bin_mfetch32 mfetch; +@@ -986,37 +1022,25 @@ static int mon_bin_ioctl(struct inode *i + return ret; + if (put_user(ret, &uptr->nfetch32)) + return -EFAULT; +- ret = 0; + } +- break; +-#endif +- +- case MON_IOCG_STATS: { +- struct mon_bin_stats __user *sp; +- unsigned int nevents; +- unsigned int ndropped; +- +- spin_lock_irqsave(&rp->b_lock, flags); +- ndropped = rp->cnt_lost; +- rp->cnt_lost = 0; +- spin_unlock_irqrestore(&rp->b_lock, flags); +- nevents = mon_bin_queued(rp); ++ return 0; + +- sp = (struct mon_bin_stats __user *)arg; +- if (put_user(rp->cnt_lost, &sp->dropped)) +- return -EFAULT; +- if (put_user(nevents, &sp->queued)) +- return -EFAULT; ++ case MON_IOCG_STATS: ++ return mon_bin_ioctl(NULL, file, cmd, ++ (unsigned long) compat_ptr(arg)); + +- } +- break; ++ case MON_IOCQ_URB_LEN: ++ case MON_IOCQ_RING_SIZE: ++ case MON_IOCT_RING_SIZE: ++ case MON_IOCH_MFLUSH: ++ return mon_bin_ioctl(NULL, file, cmd, arg); + + default: +- return -ENOTTY; ++ ; + } +- +- return ret; ++ return -ENOTTY; + } ++#endif /* CONFIG_COMPAT */ + + static unsigned int + mon_bin_poll(struct file *file, struct poll_table_struct *wait) +@@ -1094,6 +1118,9 @@ static const struct file_operations mon_ + /* .write = mon_text_write, */ + .poll = mon_bin_poll, + .ioctl = mon_bin_ioctl, ++#ifdef CONFIG_COMPAT ++ .compat_ioctl = mon_bin_compat_ioctl, ++#endif + .release = mon_bin_release, + .mmap = mon_bin_mmap, + };