2.6.35.12 longterm review
Subsystems (95)
PATCH 153/275 x86 quirk: Fix polarity for IRQ0 pin2 override on SB800 systems
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Herrmann <[email protected]>
commit 7f74f8f28a2bd9db9404f7d364e2097a0c42cc12 upstream.
On some SB800 systems polarity for IOAPIC pin2 is wrongly specified as low active by BIOS. This caused system hangs after resume from S3 when HPET was used in one-shot mode on such systems because a timer interrupt was missed (HPET signal is high active).
For more details see:
http://marc.info/?l=linux-kernel&m=129623757413868
LKML-Reference: <[email protected]>
--- arch/x86/include/asm/acpi.h | 1 + arch/x86/kernel/acpi/boot.c | 14 ++++++++++---- arch/x86/kernel/early-quirks.c | 16 +++++++--------- 3 files changed, 18 insertions(+), 13 deletions(-)
arch/x86/include/asm/acpi.h +1 -0
@@ -88,6 +88,7 @@extern int acpi_pci_disabled;extern int acpi_skip_timer_override;extern int acpi_use_timer_override; +extern int acpi_fix_pin2_polarity;extern u8 acpi_sci_flags;extern int acpi_sci_override_gsi;
arch/x86/kernel/acpi/boot.c +10 -4
@@ -72,6 +72,7 @@int acpi_sci_override_gsi__initdata ;int acpi_skip_timer_override__initdata ;int acpi_use_timer_override__initdata ; +int acpi_fix_pin2_polarity__initdata ;#ifdef CONFIG_X86_LOCAL_APIC static u64 acpi_lapic_addr__initdata =APIC_DEFAULT_PHYS_BASE ;
@@ -410,10 +411,15 @@return 0 ; } -if (acpi_skip_timer_override && - intsrc->source_irq ==0 && intsrc->global_irq ==2 ) { -printk (PREFIX "BIOS IRQ0 pin2 override ignored.\n" ); -return 0 ; +if (intsrc->source_irq ==0 && intsrc->global_irq ==2 ) { +if (acpi_skip_timer_override) { +printk (PREFIX "BIOS IRQ0 pin2 override ignored.\n" ); +return 0 ; + } +if (acpi_fix_pin2_polarity && (intsrc->inti_flags &ACPI_MADT_POLARITY_MASK )) { + intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK ; +printk (PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n" ); + } } mp_override_legacy_irq(intsrc->source_irq,
arch/x86/kernel/early-quirks.c +7 -9
@@ -145,15 +145,10 @@static u32 __init ati_sbx00_rev (int num,int slot,int func) { -u32 old, d; +u32 d; - d =read_pci_config (num, slot, func,0x70 ); - old = d; - d &= ~(1 <<8 ); -write_pci_config (num, slot, func,0x70 , d); d =read_pci_config (num, slot, func,0x8 ); d &=0xff ; -write_pci_config (num, slot, func,0x70 , old);return d; }
@@ -162,13 +157,16 @@ {u32 d, rev; -if (acpi_use_timer_override) -return ; - rev =ati_sbx00_rev (num, slot, func); +if (rev >=0x40 ) + acpi_fix_pin2_polarity =1 ; +if (rev >0x13 )return ; +if (acpi_use_timer_override) +return ; +/* check for IRQ0 interrupt swap */ d =read_pci_config (num, slot, func,0x64 );if (!(d & (1 <<14 )))
PATCH 152/275 md: correctly handle probe of an 'mdp' device.
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit 8f5f02c460b7ca74ce55ce126ce0c1e58a3f923d upstream.
'mdp' devices are md devices with preallocated device numbers for partitions. As such it is possible to mknod and open a partition before opening the whole device.
this causes md_probe() to be called with a device number of a partition, which in-turn calls mddev_find with such a number.
However mddev_find expects the number of a 'whole device' and does the wrong thing with partition numbers.
So add code to mddev_find to remove the 'partition' part of a device number and just work with the 'whole device'.
This patch addresses https://bugzilla.kernel.org/show_bug.cgi?id=28652
--- drivers/md/md.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/md/md.c +3 -0
@@ -441,6 +441,9 @@ {mddev_t *mddev, *new =NULL ; +if (unit &&MAJOR (unit) !=MD_MAJOR ) + unit &= ~((1 <<MdpMinorShift)-1 ); + retry:spin_lock (&all_mddevs_lock);
PATCH 151/275 ldm: corrupted partition table can cause kernel oops
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Timo Warns <[email protected]>
commit 294f6cf48666825d23c9372ef37631232746e40d upstream.
The kernel automatically evaluates partition tables of storage devices. The code for evaluating LDM partitions (in fs/partitions/ldm.c) contains a bug that causes a kernel oops on certain corrupted LDM partitions. A kernel subsystem seems to crash, because, after the oops, the kernel no longer recognizes newly connected storage devices.
The patch changes ldm_parse_vmdb() to Validate the value of vblk_size.
--- fs/partitions/ldm.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/partitions/ldm.c +5 -0
@@ -251,6 +251,11 @@ } vm->vblk_size =get_unaligned_be32 (data +0x08 ); +if (vm->vblk_size ==0 ) { +ldm_error ("Illegal VBLK size" ); +return false; + } + vm->vblk_offset =get_unaligned_be32 (data +0x0C ); vm->last_vblk_seq =get_unaligned_be32 (data +0x04 );
PATCH 149/275 staging: usbip: vhci: use urb->dev->portnum to find port
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Max Vozeler <[email protected]>
commit 01446ef5af4e8802369bf4d257806e24345a9371 upstream.
The access to pending_port was racy when two devices were being attached at the same time.
--- drivers/staging/usbip/vhci.h | 3 --- drivers/staging/usbip/vhci_hcd.c | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/staging/usbip/vhci.h +0 -3
@@ -100,9 +100,6 @@* But, the index of this array begins from 0. */ struct vhci_device vdev[VHCI_NPORTS ]; - -/* vhci_device which has not been assiged its address yet */ -int pending_port; };
drivers/staging/usbip/vhci_hcd.c +1 -3
@@ -138,8 +138,6 @@* the_controller->vdev[rhport].ud.status = VDEV_CONNECT; * spin_unlock(&the_controller->vdev[rhport].ud.lock); */ - the_controller->pending_port = rhport; -spin_unlock_irqrestore (&the_controller->lock, flags);usb_hcd_poll_rh_status (vhci_to_hcd (the_controller));
@@ -575,7 +573,7 @@return urb->status; } - vdev =port_to_vdev (the_controller->pending_port); + vdev =port_to_vdev (urb->dev->portnum-1 );/* refuse enqueue for dead connection */ spin_lock (&vdev->ud.lock);
PATCH 139/275 genirq: Disable the SHIRQ_DEBUG call in request_threaded_irq for now
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 6d83f94db95cfe65d2a6359cccdf61cf087c2598 upstream.
With CONFIG_SHIRQ_DEBUG=y we call a newly installed interrupt handler in request_threaded_irq().
The original implementation (commit a304e1b8) called the handler _BEFORE_ it was installed, but that caused problems with handlers calling disable_irq_nosync(). See commit 377bf1e4.
It's braindead in the first place to call disable_irq_nosync in shared handlers, but ....
Moving this call after we installed the handler looks innocent, but it is very subtle broken on SMP.
Interrupt handlers rely on the fact, that the irq core prevents reentrancy.
Now this debug call violates that promise because we run the handler w/o the IRQ_INPROGRESS protection - which we cannot apply here because that would result in a possibly forever masked interrupt line.
A concurrent real hardware interrupt on a different CPU results in handler reentrancy and can lead to complete wreckage, which was unfortunately observed in reality and took a fricking long time to debug.
Leave the code here for now. We want this debug feature, but that's not easy to fix. We really should get rid of those disable_irq_nosync() abusers and remove that function completely.
--- kernel/irq/manage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/manage.c +1 -1
@@ -1093,7 +1093,7 @@if (retval)kfree (action); -#ifdef CONFIG_DEBUG_SHIRQ +#ifdef CONFIG_DEBUG_SHIRQ_FIXME if (!retval && (irqflags &IRQF_SHARED )) {/* * It's a shared IRQ -- the driver ought to be prepared for it
PATCH 148/275 staging: usbip: vhci: refuse to enqueue for dead connections
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Max Vozeler <[email protected]>
commit 6d212153a838354078cc7d96f9bb23b7d1fd3d1b upstream.
There can be requests to enqueue URBs while we are shutting down a connection.
--- drivers/staging/usbip/vhci_hcd.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/staging/usbip/vhci_hcd.c +13 -2
@@ -559,6 +559,7 @@struct device *dev = &urb->dev->dev;int ret =0 ;unsigned long flags; +struct vhci_device *vdev;usbip_dbg_vhci_hc ("enter, usb_hcd %p urb %p mem_flags %d\n" , hcd, urb, mem_flags);
@@ -574,6 +575,18 @@return urb->status; } + vdev =port_to_vdev (the_controller->pending_port); + +/* refuse enqueue for dead connection */ +spin_lock (&vdev->ud.lock); +if (vdev->ud.status ==VDEV_ST_NULL || vdev->ud.status ==VDEV_ST_ERROR ) { +usbip_uerr ("enqueue for inactive port %d\n" , vdev->rhport); +spin_unlock (&vdev->ud.lock); +spin_unlock_irqrestore (&the_controller->lock, flags); +return -ENODEV ; + } +spin_unlock (&vdev->ud.lock); + ret =usb_hcd_link_urb_to_ep (hcd, urb);if (ret) goto no_need_unlink;
@@ -592,8 +605,6 @@__u8 type =usb_pipetype (urb->pipe);struct usb_ctrlrequest *ctrlreq = (struct usb_ctrlrequest *) urb->setup_packet; -struct vhci_device *vdev = -port_to_vdev (the_controller->pending_port);if (type !=PIPE_CONTROL || !ctrlreq) {dev_err (dev,"invalid request to devnum 0\n" );
PATCH 147/275 staging: usbip: vhci: give back URBs from in-flight unlink requests
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Max Vozeler <[email protected]>
commit b92a5e23737172c52656a090977408a80d7f06d1 upstream.
If we never received a RET_UNLINK because the TCP connection broke the pending URBs still need to be unlinked and given back.
Previously processes would be stuck trying to kill the URB even after the device was detached.
--- drivers/staging/usbip/vhci.h | 3 +++ drivers/staging/usbip/vhci_hcd.c | 24 +++++++++++++++++++++++- drivers/staging/usbip/vhci_rx.c | 15 +++++++++------ 3 files changed, 35 insertions(+), 7 deletions(-)
drivers/staging/usbip/vhci.h +3 -0
@@ -119,6 +119,9 @@void vhci_rx_loop (struct usbip_task *ut);void vhci_tx_loop (struct usbip_task *ut); +struct urb *pickup_urb_and_free_priv (struct vhci_device *vdev, +__u32 seqnum); +#define hardware (&the_controller->pdev.dev)static inline struct vhci_device *port_to_vdev (__u32 port)
drivers/staging/usbip/vhci_hcd.c +23 -1
@@ -808,7 +808,6 @@return 0 ; } -static void vhci_device_unlink_cleanup (struct vhci_device *vdev) {struct vhci_unlink *unlink, *tmp;
@@ -816,11 +815,34 @@spin_lock (&vdev->priv_lock);list_for_each_entry_safe (unlink, tmp, &vdev->unlink_tx, list) { +usbip_uinfo ("unlink cleanup tx %lu\n" , unlink->unlink_seqnum);list_del (&unlink->list);kfree (unlink); }list_for_each_entry_safe (unlink, tmp, &vdev->unlink_rx, list) { +struct urb *urb; + +/* give back URB of unanswered unlink request */ +usbip_uinfo ("unlink cleanup rx %lu\n" , unlink->unlink_seqnum); + + urb =pickup_urb_and_free_priv (vdev, unlink->unlink_seqnum); +if (!urb) { +usbip_uinfo ("the urb (seqnum %lu) was already given back\n" , + unlink->unlink_seqnum); +list_del (&unlink->list); +kfree (unlink); +continue ; + } + + urb->status = -ENODEV ; + +spin_lock (&the_controller->lock); +usb_hcd_unlink_urb_from_ep (vhci_to_hcd (the_controller), urb); +spin_unlock (&the_controller->lock); + +usb_hcd_giveback_urb (vhci_to_hcd (the_controller), urb, urb->status); +list_del (&unlink->list);kfree (unlink); }
drivers/staging/usbip/vhci_rx.c +9 -6
@@ -23,16 +23,14 @@#include "vhci.h" -/* get URB from transmitted urb queue */ -static struct urb *pickup_urb_and_free_priv (struct vhci_device *vdev, +/* get URB from transmitted urb queue. caller must hold vdev->priv_lock */ +struct urb *pickup_urb_and_free_priv (struct vhci_device *vdev,__u32 seqnum) {struct vhci_priv *priv, *tmp;struct urb *urb =NULL ;int status; -spin_lock (&vdev->priv_lock); -list_for_each_entry_safe (priv, tmp, &vdev->priv_rx, list) {if (priv->seqnum == seqnum) { urb = priv->urb;
@@ -63,8 +61,6 @@ } } -spin_unlock (&vdev->priv_lock); -return urb; }
@@ -74,9 +70,11 @@struct usbip_device *ud = &vdev->ud;struct urb *urb; +spin_lock (&vdev->priv_lock); urb =pickup_urb_and_free_priv (vdev, pdu->base.seqnum); +spin_unlock (&vdev->priv_lock);if (!urb) { usbip_uerr("cannot find a urb of seqnum %u\n",
@@ -161,7 +159,12 @@return ; } +spin_lock (&vdev->priv_lock); + urb =pickup_urb_and_free_priv (vdev, unlink->unlink_seqnum); + +spin_unlock (&vdev->priv_lock); +if (!urb) {/* * I get the result of a unlink request. But, it seems that I
PATCH 146/275 staging: usbip: vhci: update reference count for usb_device
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Max Vozeler <[email protected]>
commit 7606ee8aa33287dd3e6eb44c78541b87a413a325 upstream.
This fixes an oops observed when reading status during removal of a device:
[ 1706.648285] general protection fault: 0000 [#1] SMP [ 1706.648294] last sysfs file: /sys/devices/platform/vhci_hcd/status [ 1706.648297] CPU 1 [ 1706.648300] Modules linked in: binfmt_misc microcode fuse loop vhci_hcd(N) usbip(N) usbcore usbip_common_mod(N) rtc_core rtc_lib joydev dm_mirror dm_region_hash dm_log linear dm_snapshot xennet dm_mod ext3 mbcache jbd processor thermal_sys hwmon xenblk cdrom [ 1706.648324] Supported: Yes [ 1706.648327] Pid: 10422, comm: usbip Tainted: G N 2.6.32.12-0.7-xen #1 [ 1706.648330] RIP: e030:[<ffffffff801b10d5>] [<ffffffff801b10d5>] strnlen+0x5/0x40 [ 1706.648340] RSP: e02b:ffff8800a994dd30 EFLAGS: 00010286 [ 1706.648343] RAX: ffffffff80481ec1 RBX: 0000000000000000 RCX: 0000000000000002 [ 1706.648347] RDX: 00200d1d4f1c001c RSI: ffffffffffffffff RDI: 00200d1d4f1c001c [ 1706.648350] RBP: ffff880129a1c0aa R08: ffffffffa01901c4 R09: 0000000000000006 [ 1706.648353] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8800a9a1c0ab [ 1706.648357] R13: 00200d1d4f1c001c R14: 00000000ffffffff R15: ffff880129a1c0aa [ 1706.648363] FS: 00007f2f2e9ca700(0000) GS:ffff880001018000(0000) knlGS:0000000000000000 [ 1706.648367] CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1706.648370] CR2: 000000000071b048 CR3: 00000000b4b68000 CR4: 0000000000002660 [ 1706.648374] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1706.648378] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 1706.648381] Process usbip (pid: 10422, threadinfo ffff8800a994c000, task ffff88007b170200) [ 1706.648385] Stack: [ 1706.648387] ffffffff801b28c9 0000000000000002 ffffffffa01901c4 ffff8800a9a1c0ab [ 1706.648391] <0> ffffffffa01901c6 ffff8800a994de08 ffffffff801b339b 0000000000000004 [ 1706.648397] <0> 0000000affffffff ffffffffffffffff 00000000000067c0 0000000000000000 [ 1706.648404] Call Trace: [ 1706.648413] [<ffffffff801b28c9>] string+0x39/0xe0 [ 1706.648419] [<ffffffff801b339b>] vsnprintf+0x1eb/0x620 [ 1706.648423] [<ffffffff801b3813>] sprintf+0x43/0x50 [ 1706.648429] [<ffffffffa018d719>] show_status+0x1b9/0x220 [vhci_hcd] [ 1706.648438] [<ffffffff8024a2b7>] dev_attr_show+0x27/0x60 [ 1706.648445] [<ffffffff80144821>] sysfs_read_file+0x101/0x1d0 [ 1706.648451] [<ffffffff800da4a7>] vfs_read+0xc7/0x130 [ 1706.648457] [<ffffffff800da613>] sys_read+0x53/0xa0 [ 1706.648462] [<ffffffff80007458>] system_call_fastpath+0x16/0x1b [ 1706.648468] [<00007f2f2de40f30>] 0x7f2f2de40f30 [ 1706.648470] Code: 66 0f 1f 44 00 00 48 83 c2 01 80 3a 00 75 f7 48 89 d0 48 29 f8 f3 c3 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 48 85 f6 74 29 <80> 3f 00 74 24 48 8d 56 ff 48 89 f8 eb 0e 0f 1f 44 00 00 48 83 [ 1706.648507] RIP [<ffffffff801b10d5>] strnlen+0x5/0x40 [ 1706.648511] RSP <ffff8800a994dd30> [ 1706.649575] ---[ end trace b4eb72bf2e149593 ]---
--- drivers/staging/usbip/vhci_hcd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/staging/usbip/vhci_hcd.c +10 -3
@@ -607,7 +607,9 @@dev_info (dev,"SetAddress Request (%d) to port %d\n" , ctrlreq->wValue, vdev->rhport); - vdev->udev = urb->dev; +if (vdev->udev) +usb_put_dev (vdev->udev); + vdev->udev =usb_get_dev (urb->dev);spin_lock (&vdev->ud.lock); vdev->ud.status =VDEV_ST_USED ;
@@ -627,8 +629,9 @@"Get_Descriptor to device 0 " "(get max pipe size)\n"); -/* FIXME: reference count? (usb_get_dev()) */ - vdev->udev = urb->dev; +if (vdev->udev) +usb_put_dev (vdev->udev); + vdev->udev =usb_get_dev (urb->dev); goto out;default :
@@ -887,6 +890,10 @@ vdev->speed =0 ; vdev->devid =0 ; +if (vdev->udev) +usb_put_dev (vdev->udev); + vdev->udev =NULL ; + ud->tcp_socket =NULL ; ud->status =VDEV_ST_NULL ;
PATCH 145/275 sierra: add new ID for Airprime/Sierra USB IP modem
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jon Thomas <[email protected]>
commit e1dc5157c574e7249dc1cd072fde2e48b3011533 upstream.
I picked up a new Sierra usb 308 (At&t Shockwave) on 2/2011 and the vendor code is 0x0f3d
Looking up vendor and product id's I see:
0f3d Airprime, Incorporated
0112 CDMA 1xEVDO PC Card, PC 5220
Sierra and Airprime are somehow related and I'm guessing the At&t usb 308 might be have some common hardware with the AirPrime SL809x.
--- drivers/usb/serial/sierra.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/serial/sierra.c +3 -1
@@ -302,7 +302,9 @@ .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist }, { USB_DEVICE(0x413C, 0x08133) }, /* Dell Computer Corp. Wireless 5720 VZW Mobile Broadband (EVDO Rev-A) Minicard GPS Port */ - + { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ + .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist + }, { } };MODULE_DEVICE_TABLE (usb, id_table);
PATCH 144/275 p54pci: update receive dma buffers before and after processing
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Christian Lamparter <[email protected]>
commit 0bf719dfdecc5552155cbec78e49fa06e531e35c upstream.
Documentation/DMA-API-HOWTO.txt states:
"DMA transfers need to be synced properly in order for the cpu and device to see the most uptodate and correct copy of the DMA buffer."
--- drivers/net/wireless/p54/p54pci.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/wireless/p54/p54pci.c +9 -5
@@ -199,6 +199,7 @@while (i != idx) {u16 len;struct sk_buff *skb; +dma_addr_t dma_addr; desc = &ring[i]; len =le16_to_cpu (desc->len); skb = rx_buf[i];
@@ -216,17 +217,20 @@ len = priv->common.rx_mtu; } + dma_addr =le32_to_cpu (desc->host_addr); +pci_dma_sync_single_for_cpu (priv->pdev, dma_addr, + priv->common.rx_mtu +32 ,PCI_DMA_FROMDEVICE );skb_put (skb, len);if (p54_rx (dev, skb)) { -pci_unmap_single (priv->pdev, -le32_to_cpu (desc->host_addr), - priv->common.rx_mtu +32 , -PCI_DMA_FROMDEVICE ); +pci_unmap_single (priv->pdev, dma_addr, + priv->common.rx_mtu +32 ,PCI_DMA_FROMDEVICE ); rx_buf[i] =NULL ; - desc->host_addr =0 ; + desc->host_addr =cpu_to_le32 (0 ); }else {skb_trim (skb,0 ); +pci_dma_sync_single_for_device (priv->pdev, dma_addr, + priv->common.rx_mtu +32 ,PCI_DMA_FROMDEVICE ); desc->len =cpu_to_le16 (priv->common.rx_mtu +32 ); }
PATCH 143/275 USB: Add quirk for Samsung Android phone modem
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Szmigiero <[email protected]>
commit 72a012ce0a02c6c616676a24b40ff81d1aaeafda upstream.
My Galaxy Spica needs this quirk when in modem mode, otherwise it causes endless USB bus resets and is unusable in this mode.
Unfortunately Samsung decided to reuse ID of its old CDMA phone SGH-I500 for the modem part.
That's why in addition to this patch the visor driver must be prevented from binding to SPH-I500 ID, so ACM driver can do that.
--- drivers/usb/core/quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/core/quirks.c +4 -0
@@ -48,6 +48,10 @@ { USB_DEVICE(0x04b4, 0x0526), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, + /* Samsung Android phone modem - ID conflict with SPH-I500 */ + { USB_DEVICE(0x04e8, 0x6601), .driver_info = + USB_QUIRK_CONFIG_INTF_STRINGS }, + /* Roland SC-8820 */ { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
PATCH 142/275 USB: Add Samsung SGH-I500/Android modem ID switch to visor driver
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Szmigiero <[email protected]>
commit acb52cb1613e1d3c8a8c650717cc51965c60d7d4 upstream.
[USB]Add Samsung SGH-I500/Android modem ID switch to visor driver
Samsung decided to reuse USB ID of its old CDMA phone SGH-I500 for the modem part of some of their Android phones. At least Galaxy Spica is affected.
This modem needs ACM driver and does not work with visor driver which binds the conflicting ID for SGH-I500.
Because SGH-I500 is pretty an old hardware its best to add switch to visor
driver in cause somebody still wants to use that phone with Linux.
Note that this is needed only when using the Android phone as modem, not in USB storage or ADB mode.
--- drivers/usb/serial/visor.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/usb/serial/visor.c +12 -0
@@ -27,6 +27,7 @@#include <linux/uaccess.h> #include <linux/usb.h> #include <linux/usb/serial.h> +#include <linux/usb/cdc.h> #include "visor.h" /*
@@ -479,6 +480,17 @@dbg ("%s" , __func__); +/* +* some Samsung Android phones in modem mode have the same ID +* as SPH-I500, but they are ACM devices, so dont bind to them +*/ +if (id->idVendor ==SAMSUNG_VENDOR_ID && + id->idProduct ==SAMSUNG_SPH_I500_ID && + serial->dev->descriptor.bDeviceClass ==USB_CLASS_COMM && + serial->dev->descriptor.bDeviceSubClass == +USB_CDC_SUBCLASS_ACM ) +return -ENODEV ; +if (serial->dev->actconfig->desc.bConfigurationValue !=1 ) {dev_err (&serial->dev->dev,"active config #%d != 1 ??\n" , serial->dev->actconfig->desc.bConfigurationValue);
PATCH 141/275 USB: add quirks entry for Keytouch QWERTY Panel
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 3c18e30f87ac5466bddbb05cf955605efd7db025 upstream.
This patch (as1448) adds a quirks entry for the Keytouch QWERTY Panel firmware, used in the IEC 60945 keyboard. This device crashes during enumeration when the computer asks for its configuration string descriptor.
--- drivers/usb/core/quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/core/quirks.c +4 -0
@@ -68,6 +68,10 @@/* M-Systems Flash Disk Pioneers */ { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Keytouch QWERTY Panel keyboard */ + { USB_DEVICE(0x0926, 0x3333), .driver_info = + USB_QUIRK_CONFIG_INTF_STRINGS }, + /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
PATCH 140/275 usb: musb: omap2430: fix kernel panic on reboot
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit b193b412e62b134adf69af286c7e7f8e99259350 upstream.
Cancel idle timer in musb_platform_exit.
The idle timer could trigger after clock had been disabled leading to kernel panic when MUSB_DEVCTL is accessed in musb_do_idle on 2.6.37.
The fault below is no longer triggered on 2.6.38-rc4 (clock is disabled later, and only if compiled as a module, and the offending memory access has moved) but the timer should be cancelled nonetheless.
Rebooting... musb_hdrc musb_hdrc: remove, state 4
usb usb1: USB disconnect, address 1musb_hdrc musb_hdrc: USB bus 1 deregistered
Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0ab060
Internal error: : 1028 [#1] PREEMPT last sysfs file: /sys/kernel/uevent_seqnum Modules linked in: CPU: 0 Not tainted (2.6.37+ #6) PC is at musb_do_idle+0x24/0x138 LR is at musb_do_idle+0x18/0x138 pc : [<c02377d8>] lr : [<c02377cc>] psr: 80000193
sp : cf2bdd80 ip : cf2bdd80 fp : c048a20c
r10: c048a60c r9 : c048a40c r8 : cf85e110
r7 : cf2bc000 r6 : 40000113 r5 : c0489800 r4 : cf85e110 r3 : 00000004 r2 : 00000006 r1 : fa0ab000 r0 : cf8a7000
Flags: Nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5387d Table: 8faac019 DAC: 00000015 Process reboot (pid: 769, stack limit = 0xcf2bc2f0)
Stack: (0xcf2bdd80 to 0xcf2be000)
dd80: 00000103 c0489800 c02377b4 c005fa34 00000555 c0071a8c c04a3858 cf2bdda8
dda0: 00000555 c048a00c cf2bdda8 cf2bdda8 1838beb0 00000103 00000004 cf2bc000
ddc0: 00000001 00000001 c04896c8 0000000a 00000000 c005ac14 00000001 c003f32c
dde0: 00000000 00000025 00000000 cf2bc000 00000002 00000001 cf2bc000 00000000
de00: 00000001 c005ad08 cf2bc000 c002e07c c03ec039 ffffffff fa200000 c0033608
de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
de60: 60000013 ffffffff c0033c04 00000000 01234567 fee1dead 00000000 c006627c
de80: 00000001 c00662c8 28121969 c00663ec cfa38c40 cf9f6a00 cf2bded0 cf9f6a0c
dea0: 00000000 cf92f000 00008914 c02cd284 c04a55c8 c028b398 c00715c0 becf24a8
dec0: 30687465 00000000 00000000 00000000 00000002 1301a8c0 00000000 00000000
dee0: 00000002 1301a8c0 00000000 00000000 c0450494 cf527920 00011f10 cf2bdf08
df00: 00011f10 cf2bdf10 00011f10 cf2bdf18 c00f0b44 c004f7e8 cf2bdf18 cf2bdf18
df20: 00011f10 cf2bdf30 00011f10 cf2bdf38 cf401300 cf486100 00000008 c00d2b28
df40: 00011f10 cf401300 00200200 c00d3388 00011f10 cfb63a88 cfb63a80 c00c2f08
df60: 00000000 00000000 cfb63a80 00000000 cf0a3480 00000006 c0033c04 cfb63a80
df80: 00000000 c00c0104 00000003 cf0a3480 cfb63a80 00000000 00000001 00000004
dfa0: 00000058 c0033a80 00000000 00000001 fee1dead 28121969 01234567 00000000
dfc0: 00000000 00000001 00000004 00000058 00000001 00000001 00000000 00000001
dfe0: 4024d200 becf2cb0 00009210 4024d218 60000010 fee1dead 00000000 00000000 [<c02377d8>] (musb_do_idle+0x24/0x138) from [<c005fa34>] (run_timer_softirq+0x1a8/0x26) [<c005fa34>] (run_timer_softirq+0x1a8/0x26c) from [<c005ac14>] (__do_softirq+0x88/0x13) [<c005ac14>] (__do_softirq+0x88/0x138) from [<c005ad08>] (irq_exit+0x44/0x98) [<c005ad08>] (irq_exit+0x44/0x98) from [<c002e07c>] (asm_do_IRQ+0x7c/0xa0) [<c002e07c>] (asm_do_IRQ+0x7c/0xa0) from [<c0033608>] (__irq_svc+0x48/0xa8)
Exception stack(0xcf2bde20 to 0xcf2bde68)
de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
de60: 60000013 ffffffff
[<c0033608>] (__irq_svc+0x48/0xa8) from [<c004f7d8>] (sub_preempt_count+0x0/0xb8)
Code: ebf86030 e5940098 e594108c e5902010 (e5d13060)
---[ end trace 3689c0d808f9bf7c ]--- Kernel panic - not syncing: Fatal exception in interrupt
--- drivers/usb/musb/omap2430.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/musb/omap2430.c +1 -0
@@ -323,6 +323,7 @@int musb_platform_exit (struct musb *musb) { +del_timer_sync (&musb_idle_timer);musb_platform_suspend (musb);
PATCH 138/275 platform: x86: tc1100-wmi: world-writable sysfs wireless and jogdial files
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Vasiliy Kulikov <[email protected]>
commit 8a6a142c1286797978e4db266d22875a5f424897 upstream.
Don't allow everybody to change WMI settings.
--- drivers/platform/x86/tc1100-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/tc1100-wmi.c +1 -1
@@ -162,7 +162,7 @@return -EINVAL ; \return count; \ } \ -static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, \ show_bool_##value, set_bool_##value);show_set_bool (wireless,TC1100_INSTANCE_WIRELESS );
PATCH 130/275 ALSA: HDA: Add position_fix quirk for an Asus device
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: David Henningsson <[email protected]>
commit b540afc2b3d6e4cd1d1f137ef6d9e9c78d67fecd upstream.
The bug reporter claims that position_fix=1 is needed for his microphone to work. The controller PCI vendor-id is [1002:4383] (rev 40).
--- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2300,6 +2300,7 @@SND_PCI_QUIRK (0x1043 ,0x813d ,"ASUS P5AD2" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1043 ,0x81b3 ,"ASUS" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1043 ,0x81e7 ,"ASUS M2V" ,POS_FIX_LPIB ), +SND_PCI_QUIRK (0x1043 ,0x8410 ,"ASUS" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x104d ,0x9069 ,"Sony VPCS11V9E" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1106 ,0x3288 ,"ASUS M2V-MX SE" ,POS_FIX_LPIB ), SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba A100-259", POS_FIX_LPIB),
PATCH 129/275 fs/partitions: Validate map_count in Mac partition tables
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Timo Warns <[email protected]>
commit fa7ea87a057958a8b7926c1a60a3ca6d696328ed upstream.
Validate number of blocks in map and remove redundant variable.
--- fs/partitions/mac.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
fs/partitions/mac.c +9 -8
@@ -29,10 +29,9 @@int mac_partition (struct parsed_partitions *state) { -int slot =1 ;Sector sect;unsigned char *data; -int blk, blocks_in_map; +int slot, blocks_in_map;unsigned secsize;#ifdef CONFIG_PPC_PMAC int found_root =0 ;
@@ -59,10 +58,14 @@put_dev_sector (sect);return 0 ;/* not a MacOS disk */ } -printk (" [mac]" ); blocks_in_map =be32_to_cpu (part->map_count); -for (blk =1 ; blk <= blocks_in_map; ++blk) { -int pos = blk * secsize; +if (blocks_in_map <0 || blocks_in_map >=DISK_MAX_PARTS ) { +put_dev_sector (sect); +return 0 ; + } +printk (" [mac]" ); +for (slot =1 ; slot <= blocks_in_map; ++slot) { +int pos = slot * secsize;put_dev_sector (sect); data =read_part_sector (state, pos/512 , §);if (!data)
@@ -113,13 +116,11 @@ }if (goodness > found_root_goodness) { - found_root = blk; + found_root = slot; found_root_goodness = goodness; } }#endif /* CONFIG_PPC_PMAC */ - - ++slot; }#ifdef CONFIG_PPC_PMAC if (found_root_goodness)
PATCH 128/275 PM / Hibernate: Return error code when alloc_image_page() fails
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit 2e725a065b0153f0c449318da1923a120477633d upstream.
Currently we return 0 in swsusp_alloc() when alloc_image_page() fails. Fix that. Also remove unneeded "error" variable since the only useful value of error is -ENOMEM.
[rjw: Fixed up the changelog and changed subject.]
--- kernel/power/snapshot.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
kernel/power/snapshot.c +2 -5
@@ -1512,11 +1512,8 @@ swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm, unsigned int nr_pages, unsigned int nr_highmem) { - int error = 0; - if (nr_highmem > 0) { - error =get_highmem_buffer (PG_ANY ); -if (error) + if (get_highmem_buffer(PG_ANY)) goto err_out;if (nr_highmem > alloc_highmem) { nr_highmem -= alloc_highmem;
@@ -1539,7 +1536,7 @@ err_out:swsusp_free (); -return error; +return -ENOMEM ; } asmlinkage int swsusp_save(void)
PATCH 127/275 s390: remove task_show_regs
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Martin Schwidefsky <[email protected]>
commit 261cd298a8c363d7985e3482946edb4bfedacf98 upstream.
task_show_regs used to be a debugging aid in the early bringup days of Linux on s390. /proc/<pid>/status is a world readable file, it is not a good idea to show the registers of a process. The only correct fix is to remove task_show_regs.
--- arch/s390/include/asm/processor.h | 5 ----- arch/s390/kernel/traps.c | 37 ------------------------------------- fs/proc/array.c | 3 --- 3 files changed, 45 deletions(-)
arch/s390/include/asm/processor.h +0 -5
@@ -150,11 +150,6 @@*/ extern unsigned long thread_saved_pc (struct task_struct *t); -/* -* Print register of task into buffer. Used in fs/proc/array.c. -*/ -extern void task_show_regs (struct seq_file *m,struct task_struct *task); -extern void show_code (struct pt_regs *regs);unsigned long get_wchan (struct task_struct *p);
arch/s390/kernel/traps.c +0 -37
@@ -237,43 +237,6 @@show_last_breaking_event (regs); } -/* This is called from fs/proc/array.c */ -void task_show_regs (struct seq_file *m,struct task_struct *task) -{ -struct pt_regs *regs; - - regs =task_pt_regs (task); -seq_printf (m,"task: %p, ksp: %p\n" , - task, (void *)task->thread.ksp); -seq_printf (m,"User PSW : %p %p\n" , - (void *) regs->psw.mask, (void *)regs->psw.addr); - -seq_printf (m,"User GPRS: " FOURLONG , - regs->gprs[0 ], regs->gprs[1 ], - regs->gprs[2 ], regs->gprs[3 ]); -seq_printf (m," " FOURLONG , - regs->gprs[4 ], regs->gprs[5 ], - regs->gprs[6 ], regs->gprs[7 ]); -seq_printf (m," " FOURLONG , - regs->gprs[8 ], regs->gprs[9 ], - regs->gprs[10 ], regs->gprs[11 ]); -seq_printf (m," " FOURLONG , - regs->gprs[12 ], regs->gprs[13 ], - regs->gprs[14 ], regs->gprs[15 ]); -seq_printf (m,"User ACRS: %08x %08x %08x %08x\n" , - task->thread.acrs[0 ], task->thread.acrs[1 ], - task->thread.acrs[2 ], task->thread.acrs[3 ]); -seq_printf (m," %08x %08x %08x %08x\n" , - task->thread.acrs[4 ], task->thread.acrs[5 ], - task->thread.acrs[6 ], task->thread.acrs[7 ]); -seq_printf (m," %08x %08x %08x %08x\n" , - task->thread.acrs[8 ], task->thread.acrs[9 ], - task->thread.acrs[10 ], task->thread.acrs[11 ]); -seq_printf (m," %08x %08x %08x %08x\n" , - task->thread.acrs[12 ], task->thread.acrs[13 ], - task->thread.acrs[14 ], task->thread.acrs[15 ]); -} -static DEFINE_SPINLOCK (die_lock);void die (const char * str,struct pt_regs * regs,long err)
fs/proc/array.c +0 -3
@@ -353,9 +353,6 @@task_cap (m, task);task_cpus_allowed (m, task);cpuset_task_status_allowed (m, task); -#if defined(CONFIG_S390 ) -task_show_regs (m, task); -#endif task_context_switch_counts (m, task);return 0 ; }
PATCH 126/275 nfsd: correctly handle return value from nfsd_map_name_to_*
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit 47c85291d3dd1a51501555000b90f8e281a0458e upstream.
These functions return an nfs status, not a host_err. So don't try to convert before returning.
This is a regression introduced by 3c726023402a2f3b28f49b9d90ebf9e71151157d; I fixed up two of the callers, but missed these two.
--- fs/nfsd/nfs4xdr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/nfsd/nfs4xdr.c +4 -4
@@ -316,8 +316,8 @@READ_BUF (dummy32); len += (XDR_QUADLEN (dummy32) <<2 );READMEM (buf, dummy32); -if ((host_err =nfsd_map_name_to_uid (argp->rqstp, buf, dummy32, &iattr->ia_uid))) - goto out_nfserr; +if ((status =nfsd_map_name_to_uid (argp->rqstp, buf, dummy32, &iattr->ia_uid))) +return status; iattr->ia_valid |=ATTR_UID ; }if (bmval[1 ] &FATTR4_WORD1_OWNER_GROUP ) {
@@ -327,8 +327,8 @@READ_BUF (dummy32); len += (XDR_QUADLEN (dummy32) <<2 );READMEM (buf, dummy32); -if ((host_err =nfsd_map_name_to_gid (argp->rqstp, buf, dummy32, &iattr->ia_gid))) - goto out_nfserr; +if ((status =nfsd_map_name_to_gid (argp->rqstp, buf, dummy32, &iattr->ia_gid))) +return status; iattr->ia_valid |=ATTR_GID ; }if (bmval[1 ] &FATTR4_WORD1_TIME_ACCESS_SET ) {
PATCH 125/275 scsi_dh_alua: Add IBM Power Virtual SCSI ALUA device to dev list
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Brian King <[email protected]>
commit 22963a37b3437a25812cc856afa5a84ad4a3f541 upstream.
Adds IBM Power Virtual SCSI ALUA devices to the ALUA device handler.
--- drivers/scsi/device_handler/scsi_dh_alua.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/device_handler/scsi_dh_alua.c +1 -0
@@ -721,6 +721,7 @@ {"NETAPP", "LUN"}, {"AIX", "NVDISK"}, {"NETAPP", "LUN"}, + {"AIX", "NVDISK"}, {NULL, NULL} };
PATCH 124/275 scsi_dh_alua: add netapp to dev list
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Mike Christie <[email protected]>
commit cd4a8814d44672bd2c8f04a472121bfbe193809c upstream.
Newer Netapp target software supports ALUA, so this patch adds them to the scsi_dev_alua dev list.
--- drivers/scsi/device_handler/scsi_dh_alua.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/device_handler/scsi_dh_alua.c +1 -0
@@ -720,6 +720,7 @@ {"Intel", "Multi-Flex"}, {"NETAPP", "LUN"}, {"AIX", "NVDISK"}, + {"NETAPP", "LUN"}, {NULL, NULL} };
PATCH 120/275 CRED: Fix BUG() upon security_cred_alloc_blank() failure
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
commit 2edeaa34a6e3f2c43b667f6c4f7b27944b811695 upstream.
In cred_alloc_blank() since 2.6.32, abort_creds(new) is called with new->security == NULL and new->magic == 0 when security_cred_alloc_blank() returns an error. As a result, BUG() will be triggered if SELinux is enabled or CONFIG_DEBUG_CREDENTIALS=y.
If CONFIG_DEBUG_CREDENTIALS=y, BUG() is called from __invalid_creds() because cred->magic == 0. Failing that, BUG() is called from selinux_cred_free() because selinux_cred_free() is not expecting cred->security == NULL. This does not affect smack_cred_free(), tomoyo_cred_free() or apparmor_cred_free().
Fix these bugs by
(1) Set new->magic before calling security_cred_alloc_blank().
(2) Handle null cred->security in creds_are_invalid() and selinux_cred_free().
--- kernel/cred.c | 12 ++++++++---- security/selinux/hooks.c | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-)
kernel/cred.c +8 -4
@@ -256,13 +256,13 @@#endif atomic_set (&new->usage,1 ); +#ifdef CONFIG_DEBUG_CREDENTIALS + new->magic =CRED_MAGIC ; +#endif if (security_cred_alloc_blank (new,GFP_KERNEL ) <0 ) goto error; -#ifdef CONFIG_DEBUG_CREDENTIALS - new->magic =CRED_MAGIC ; -#endif return new; error:
@@ -754,7 +754,11 @@if (cred->magic !=CRED_MAGIC )return true;#ifdef CONFIG_SECURITY_SELINUX -if (selinux_is_enabled ()) { +/* +* cred->security == NULL if security_cred_alloc_blank() or +* security_prepare_creds() returned an error. +*/ +if (selinux_is_enabled () && cred->security) {if ((unsigned long ) cred->security <PAGE_SIZE )return true; if ((*(u32 *)cred->security & 0xffffff00) ==
security/selinux/hooks.c +5 -1
@@ -3234,7 +3234,11 @@ {struct task_security_struct *tsec = cred->security; -BUG_ON ((unsigned long ) cred->security <PAGE_SIZE ); +/* +* cred->security == NULL if security_cred_alloc_blank() or +* security_prepare_creds() returned an error. +*/ +BUG_ON (cred->security && (unsigned long ) cred->security <PAGE_SIZE ); cred->security = (void *)0x7UL ;kfree (tsec); }
PATCH 119/275 CRED: Fix kernel panic upon security_file_alloc() failure.
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
commit 78d2978874e4e10e97dfd4fd79db45bdc0748550 upstream.
In get_empty_filp() since 2.6.29, file_free(f) is called with f->f_cred == NULL when security_file_alloc() returned an error. As a result, kernel will panic() due to put_cred(NULL) call within RCU callback.
Fix this bug by assigning f->f_cred before calling security_file_alloc().
--- fs/file_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/file_table.c +1 -1
@@ -123,13 +123,13 @@ goto fail;percpu_counter_inc (&nr_files); + f->f_cred =get_cred (cred);if (security_file_alloc (f)) goto fail_sec;INIT_LIST_HEAD (&f->f_u.fu_list);atomic_long_set (&f->f_count,1 );rwlock_init (&f->f_owner.lock); - f->f_cred =get_cred (cred);spin_lock_init (&f->f_lock);eventpoll_init_file (f);/* f->f_version: 0 */
PATCH 122/275 NFS: fix the return value of nfs_file_fsync()
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: J. R. Okajima <[email protected]>
commit 0702099bd86c33c2dcdbd3963433a61f3f503901 upstream.
By the commit af7fa16 2010-08-03 NFS: Fix up the fsync code close(2) became returning the non-zero value even if it went well. nfs_file_fsync() should return 0 when "status" is positive.
--- fs/nfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/file.c +1 -1
@@ -222,7 +222,7 @@ have_error |=test_bit (NFS_CONTEXT_ERROR_WRITE , &ctx->flags);if (have_error) ret =xchg (&ctx->error,0 ); -if (!ret) +if (!ret && status <0 ) ret = status;return ret; }
PATCH 116/275 x86/pvclock: Zero last_value on resume
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jeremy Fitzhardinge <[email protected]>
commit e7a3481c0246c8e45e79c629efd63b168e91fcda upstream.
If the guest domain has been suspend/resumed or migrated, then the system clock backing the pvclock clocksource may revert to a smaller value (ie, can be non-monotonic across the migration/save-restore).
Make sure we zero last_value in that case so that the domain continues to see clock updates.
--- arch/x86/include/asm/pvclock.h | 1 + arch/x86/kernel/pvclock.c | 5 +++++ arch/x86/xen/time.c | 2 ++ 3 files changed, 8 insertions(+)
arch/x86/include/asm/pvclock.h +1 -0
@@ -11,5 +11,6 @@void pvclock_read_wallclock (struct pvclock_wall_clock *wall,struct pvclock_vcpu_time_info *vcpu,struct timespec *ts); +void pvclock_resume (void );#endif /* _ASM_X86_PVCLOCK_H */
arch/x86/kernel/pvclock.c +5 -0
@@ -120,6 +120,11 @@static atomic64_t last_value =ATOMIC64_INIT (0 ); +void pvclock_resume (void ) +{ +atomic64_set (&last_value,0 ); +} +cycle_t pvclock_clocksource_read (struct pvclock_vcpu_time_info *src) {struct pvclock_shadow_time shadow;
arch/x86/xen/time.c +2 -0
@@ -425,6 +425,8 @@ {int cpu; +pvclock_resume (); +if (xen_clockevent != &xen_vcpuop_clockevent)return ;
PATCH 114/275 ocfs2_connection_find() returns pointer to bad structure
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: dann frazier <[email protected]>
commit 226291aa4641fa13cb5dec3bcb3379faa83009e2 upstream.
If ocfs2_live_connection_list is empty, ocfs2_connection_find() will return a pointer to the LIST_HEAD, cast as a ocfs2_live_connection. This can cause an oops when ocfs2_control_send_down() dereferences c->oc_conn:
Call Trace: [<ffffffffa00c2a3c>] ocfs2_control_message+0x28c/0x2b0 [ocfs2_stack_user] [<ffffffffa00c2a95>] ocfs2_control_write+0x35/0xb0 [ocfs2_stack_user] [<ffffffff81143a88>] vfs_write+0xb8/0x1a0 [<ffffffff8155cc13>] ? do_page_fault+0x153/0x3b0 [<ffffffff811442f1>] sys_write+0x51/0x80 [<ffffffff810121b2>] system_call_fastpath+0x16/0x1b
Fix by explicitly returning NULL if no match is found.
--- fs/ocfs2/stack_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/stack_user.c +1 -1
@@ -191,7 +191,7 @@return c; } -return c; +return NULL ; }/*
PATCH 111/275 mptfusion: mptctl_release is required in mptctl.c
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Kashyap, Desai <[email protected]>
commit 84857c8bf83e8aa87afc57d2956ba01f11d82386 upstream.
Added missing release callback for file_operations mptctl_fops. Without release callback there will be never freed. It remains on mptctl's eent list even after the file is closed and released.
Relavent RHEL bugzilla is 660871
--- drivers/message/fusion/mptctl.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/message/fusion/mptctl.c +8 -0
@@ -588,6 +588,13 @@ }static int +mptctl_release (struct inode *inode,struct file *filep) +{ +fasync_helper (-1 , filep,0 , &async_queue); +return 0 ; +} + +static int mptctl_fasync (int fd,struct file *filep,int mode) {MPT_ADAPTER *ioc;
@@ -2796,6 +2803,7 @@ .llseek = no_llseek, .fasync = mptctl_fasync, .unlocked_ioctl = mptctl_ioctl, + .release = mptctl_release,#ifdef CONFIG_COMPAT .compat_ioctl = compat_mpctl_ioctl,#endif
PATCH 110/275 NFSD: memory corruption due to writing beyond the stat array
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Khorenko <[email protected]>
commit 3aa6e0aa8ab3e64bbfba092c64d42fd1d006b124 upstream.
If nfsd fails to find an exported via NFS file in the readahead cache, it should increment corresponding nfsdstats counter (ra_depth[10]), but due to a bug it may instead write to ra_depth[11], corrupting the following field.
In a kernel with NFSDv4 compiled in the corruption takes the form of an increment of a counter of the number of NFSv4 operation 0's received; since there is no operation 0, this is harmless.
In a kernel with NFSDv4 disabled it corrupts whatever happens to be in the memory beyond nfsdstats.
--- fs/nfsd/vfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/vfs.c +1 -1
@@ -819,7 +819,7 @@if (ra->p_count ==0 ) frap = rap; } - depth = nfsdstats.ra_size*11 /10 ; + depth = nfsdstats.ra_size;if (!frap) {spin_unlock (&rab->pb_lock);return NULL ;
PATCH 102/275 x86: Add IRQ_TIME_ACCOUNTING
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: e82b8e4ea4f3dffe6e7939f90e78da675fcc450e upstream
This patch adds IRQ_TIME_ACCOUNTING option on x86 and runtime enables it when TSC is enabled.
This change just enables fine grained irq time accounting, isn't used yet. Following patches use it for different purposes.
LKML-Reference: <[email protected]>
--- Documentation/kernel-parameters.txt | 4 ++++ arch/x86/Kconfig | 11 +++++++++++ arch/x86/kernel/tsc.c | 8 ++++++++ 3 files changed, 23 insertions(+)
Documentation/kernel-parameters.txt +4 -0
@@ -2672,6 +2672,10 @@ disables clocksource verification at runtime. Used to enable high-resolution timer mode on older hardware, and in virtualized environment. + [x86] noirqtime: Do not use TSC to do irq accounting. + Used to run time disable IRQ_TIME_ACCOUNTING on any + platforms where RDTSC is slow and this accounting + can add overhead. turbografx.map[2|3]= [HW,JOY] TurboGraFX parallel port interface
arch/x86/Kconfig +11 -0
@@ -797,6 +797,17 @@ making when dealing with multi-core CPU chips at a cost of slightly increased overhead in some places. If unsure say N here. +config IRQ_TIME_ACCOUNTING + bool "Fine granularity task level IRQ time accounting" + default n + ---help--- + Select this option to enable fine granularity task irq time + accounting. This is done by reading a timestamp on each + transitions between softirq and hardirq state, so there can be a + small performance impact. + + If in doubt, say N here. + source "kernel/Kconfig.preempt" config X86_UP_APIC
arch/x86/kernel/tsc.c +8 -0
@@ -104,10 +104,14 @@__setup ("notsc" , notsc_setup); +static int no_sched_irq_time; +static int __init tsc_setup (char *str) {if (!strcmp (str,"reliable" )) tsc_clocksource_reliable =1 ; +if (!strncmp (str,"noirqtime" ,9 )) + no_sched_irq_time =1 ;return 1 ; }
@@ -802,6 +806,7 @@if (!tsc_unstable) { tsc_unstable =1 ; sched_clock_stable =0 ; +disable_sched_clock_irqtime ();printk (KERN_INFO "Marking TSC unstable due to %s\n" , reason);/* Change only the rating, when not registered */ if (clocksource_tsc.mult)
@@ -990,6 +995,9 @@/* now allow native_sched_clock() to use rdtsc */ tsc_disabled =0 ; +if (!no_sched_irq_time) +enable_sched_clock_irqtime (); + lpj = ((u64 )tsc_khz *1000 );do_div (lpj,HZ ); lpj_fine = lpj;
PATCH 118/275 bonding/vlan: Avoid mangled NAs on slaves without VLAN tag insertion
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
This is related to commit f88a4a9b65a6f3422b81be995535d0e69df11bb8 upstream, but the bug cannot be properly fixed without the other changes to VLAN tagging in 2.6.37.
bond_na_send() attempts to insert a VLAN tag in between building and sending packets of the respective formats. If the slave does not implement hardware VLAN tag insertion then vlan_put_tag() will mangle the network-layer header because the Ethernet header is not present at this point (unlike in bond_arp_send()).
--- drivers/net/bonding/bond_ipv6.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/bonding/bond_ipv6.c +8 -1
@@ -70,6 +70,13 @@ };struct sk_buff *skb; +/* The Ethernet header is built in ndisc_send_skb(), not +* ndisc_build_skb(), so we cannot insert a VLAN tag. Only an +* out-of-line tag inserted by the hardware will work. +*/ +if (vlan_id && !(slave_dev->features &NETIF_F_HW_VLAN_TX )) +return ; + icmp6h.icmp6_router = router; icmp6h.icmp6_solicited =0 ; icmp6h.icmp6_override =1 ;
@@ -88,7 +95,7 @@ }if (vlan_id) { - skb =vlan_put_tag (skb, vlan_id); + skb =__vlan_hwaccel_put_tag (skb, vlan_id);if (!skb) {pr_err ("failed to insert VLAN tag\n" );return ;
PATCH 115/275 OHCI: work around for nVidia shutdown problem
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 3df7169e73fc1d71a39cffeacc969f6840cdf52b upstream.
This patch (as1417) fixes a problem affecting some (or all) nVidia chipsets. When the computer is shut down, the OHCI controllers continue to power the USB buses and evidently they drive a Reset signal out all their ports. This prevents attached devices from going to low power. Mouse LEDs stay on, for example, which is disconcerting for users and a drain on laptop batteries.
The fix involves leaving each OHCI controller in the OPERATIONAL state during system shutdown rather than putting it in the RESET state. Although this nominally means the controller is running, in fact it's not doing very much since all the schedules are all disabled. However there is ongoing DMA to the Host Controller Communications Area, so the patch also disables the bus-master capability of all PCI USB controllers after the shutdown routine runs.
The fix is applied only to nVidia-based PCI OHCI controllers, so it shouldn't cause problems on systems using other hardware. As an added safety measure, in case the kernel encounters one of these running controllers during boot, the patch changes quirk_usb_handoff_ohci() (which runs early on during PCI discovery) to reset the controller before anything bad can happen.
--- drivers/usb/core/hcd-pci.c | 4 +++- drivers/usb/host/ohci-hcd.c | 9 ++++++++- drivers/usb/host/ohci-pci.c | 18 ++++++++++++++++++ drivers/usb/host/ohci.h | 1 + drivers/usb/host/pci-quirks.c | 18 +++++++++++------- 5 files changed, 41 insertions(+), 9 deletions(-)
drivers/usb/core/hcd-pci.c +3 -1
@@ -317,8 +317,10 @@if (!hcd)return ; -if (hcd->driver->shutdown) +if (hcd->driver->shutdown) { hcd->driver->shutdown (hcd); +pci_disable_device (dev); + } }EXPORT_SYMBOL_GPL (usb_hcd_pci_shutdown);
drivers/usb/host/ohci-hcd.c +8 -1
@@ -398,7 +398,14 @@ ohci =hcd_to_ohci (hcd);ohci_writel (ohci,OHCI_INTR_MIE , &ohci->regs->intrdisable); -ohci_usb_reset (ohci); + ohci->hc_control =ohci_readl (ohci, &ohci->regs->control); + +/* If the SHUTDOWN quirk is set, don't put the controller in RESET */ + ohci->hc_control &= (ohci->flags &OHCI_QUIRK_SHUTDOWN ? +OHCI_CTRL_RWC |OHCI_CTRL_HCFS : +OHCI_CTRL_RWC ); +ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); +/* flush the writes */ (void )ohci_readl (ohci, &ohci->regs->control); }
drivers/usb/host/ohci-pci.c +18 -0
@@ -201,6 +201,20 @@return 0 ; } +/* nVidia controllers continue to drive Reset signalling on the bus +* even after system shutdown, wasting power. This flag tells the +* shutdown routine to leave the controller OPERATIONAL instead of RESET. +*/ +static int ohci_quirk_nvidia_shutdown (struct usb_hcd *hcd) +{ +struct ohci_hcd *ohci =hcd_to_ohci (hcd); + + ohci->flags |=OHCI_QUIRK_SHUTDOWN ; +ohci_dbg (ohci,"enabled nVidia shutdown quirk\n" ); + +return 0 ; +} +/* * The hardware normally enables the A-link power management feature, which * lets the system lower the power consumption in idle states.
@@ -332,6 +346,10 @@ PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399), .driver_data = (unsigned long )ohci_quirk_amd700, }, + { +PCI_DEVICE (PCI_VENDOR_ID_NVIDIA ,PCI_ANY_ID ), + .driver_data = (unsigned long) ohci_quirk_nvidia_shutdown, + },/* FIXME for some of the early AMD 760 southbridges, OHCI * won't work at all. blacklist them.
drivers/usb/host/ohci.h +1 -0
@@ -403,6 +403,7 @@#define OHCI_QUIRK_HUB_POWER 0x100/* distrust firmware power/oc setup */ #define OHCI_QUIRK_AMD_ISO 0x200/* ISO transfers*/ #define OHCI_QUIRK_AMD_PREFETCH 0x400/* pre-fetch for ISO transfer */ +#define OHCI_QUIRK_SHUTDOWN 0x800/* nVidia power bug */ // there are also chip quirks/bugs in init logic struct work_struct nec_work;/* Worker for NEC quirk */
drivers/usb/host/pci-quirks.c +11 -7
@@ -169,6 +169,7 @@static void __devinit quirk_usb_handoff_ohci (struct pci_dev *pdev) {void __iomem *base; +u32 control;if (!mmio_resource_enabled (pdev,0 ))return ;
@@ -177,10 +178,14 @@if (base ==NULL )return ; + control =readl (base +OHCI_CONTROL ); +/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ -#ifndef __hppa__ -{ -u32 control =readl (base +OHCI_CONTROL ); +#ifdef __hppa__ +#define OHCI_CTRL_MASK (OHCI_CTRL_RWC | OHCI_CTRL_IR) +#else +#define OHCI_CTRL_MASK OHCI_CTRL_RWC +if (control &OHCI_CTRL_IR ) {int wait_time =500 ;/* arbitrary; 5 seconds */ writel (OHCI_INTR_OC , base +OHCI_INTRENABLE );
@@ -194,13 +199,12 @@dev_warn (&pdev->dev,"OHCI: BIOS handoff failed" " (BIOS bug?) %08x\n" , readl(base + OHCI_CONTROL)); - -/* reset controller, preserving RWC */ - writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL); } -}#endif +/* reset controller, preserving RWC (and possibly IR) */ +writel (control &OHCI_CTRL_MASK , base +OHCI_CONTROL ); +/* * disable interrupts */
PATCH 109/275 kernel/user.c: add lock release annotation on free_user()
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
commit 571428be550fbe37160596995e96ad398873fcbd upstream.
free_user() releases uidhash_lock but was missing annotation. Add it. This removes following sparse warnings:
include/linux/spinlock.h:339:9: warning: context imbalance in 'free_user' - unexpected unlock kernel/user.c:120:6: warning: context imbalance in 'free_uid' - wrong count at exit
--- kernel/user.c | 1 + 1 file changed, 1 insertion(+)
kernel/user.c +1 -0
@@ -91,6 +91,7 @@* upon function exit. */ static void free_user (struct user_struct *up,unsigned long flags) + __releases(&uidhash_lock) {uid_hash_remove (up);spin_unlock_irqrestore (&uidhash_lock, flags);
PATCH 108/275 sched: Use group weight, idle cpu metrics to fix imbalances during idle
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: aae6d3ddd8b90f5b2c8d79a2b914d1706d124193 upstream
Currently we consider a sched domain to be well balanced when the imbalance is less than the domain's imablance_pct. As the number of cores and threads are increasing, current values of imbalance_pct (for example 25% for a NUMA domain) are not enough to detect imbalances like:
a) On a WSM-EP system (two sockets, each having 6 cores and 12 logical threads), 24 cpu-hogging tasks get scheduled as 13 on one socket and 11 on another socket. Leading to an idle HT cpu.
b) On a hypothetial 2 socket NHM-EX system (each socket having 8 cores and 16 logical threads), 16 cpu-hogging tasks can get scheduled as 9 on one socket and 7 on another socket. Leaving one core in a socket idle whereas in another socket we have a core having both its HT siblings busy.
While this issue can be fixed by decreasing the domain's imbalance_pct (by making it a function of number of logical cpus in the domain), it can potentially cause more task migrations across sched groups in an overloaded case.
Fix this by using imbalance_pct only during newly_idle and busy load balancing. And during idle load balancing, check if there is an imbalance in number of idle cpu's across the busiest and this sched_group or if the busiest group has more tasks than its weight that the idle cpu in this_group can pull.
LKML-Reference: <[email protected]>
--- include/linux/sched.h | 1 + kernel/sched.c | 2 ++ kernel/sched_fair.c | 34 +++++++++++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 3 deletions(-)
include/linux/sched.h +1 -0
@@ -856,6 +856,7 @@* single CPU. */ unsigned int cpu_power; +unsigned int group_weight;/* * The CPUs this group covers.
kernel/sched_fair.c +31 -3
@@ -2036,13 +2036,16 @@unsigned long this_load_per_task;unsigned long this_nr_running;unsigned long this_has_capacity; +unsigned int this_idle_cpus;/* Statistics of the busiest group */ +unsigned int busiest_idle_cpus;unsigned long max_load;unsigned long busiest_load_per_task;unsigned long busiest_nr_running;unsigned long busiest_group_capacity;unsigned long busiest_has_capacity; +unsigned int busiest_group_weight;int group_imb;/* Is there imbalance in this sd */ #if defined(CONFIG_SCHED_MC ) || defined(CONFIG_SCHED_SMT )
@@ -2064,6 +2067,8 @@unsigned long sum_nr_running;/* Nr tasks running in the group */ unsigned long sum_weighted_load;/* Weighted load of group's tasks */ unsigned long group_capacity; +unsigned long idle_cpus; +unsigned long group_weight;int group_imb;/* Is there an imbalance in the group ? */ int group_has_capacity;/* Is there extra capacity in the group? */ };
@@ -2404,7 +2409,8 @@ sgs->group_load += load; sgs->sum_nr_running += rq->nr_running; sgs->sum_weighted_load +=weighted_cpuload (i); - +if (idle_cpu (i)) + sgs->idle_cpus++; }/*
@@ -2440,6 +2446,7 @@ sgs->group_imb =1 ; sgs->group_capacity =DIV_ROUND_CLOSEST (group->cpu_power,SCHED_LOAD_SCALE ); + sgs->group_weight = group->group_weight;if (sgs->group_capacity > sgs->sum_nr_running) sgs->group_has_capacity =1 ;
@@ -2505,13 +2512,16 @@ sds->this_nr_running = sgs.sum_nr_running; sds->this_load_per_task = sgs.sum_weighted_load; sds->this_has_capacity = sgs.group_has_capacity; + sds->this_idle_cpus = sgs.idle_cpus; }else if (sgs.avg_load > sds->max_load && (sgs.sum_nr_running > sgs.group_capacity || sgs.group_imb)) { sds->max_load = sgs.avg_load; sds->busiest = group; sds->busiest_nr_running = sgs.sum_nr_running; + sds->busiest_idle_cpus = sgs.idle_cpus; sds->busiest_group_capacity = sgs.group_capacity; + sds->busiest_group_weight = sgs.group_weight; sds->busiest_load_per_task = sgs.sum_weighted_load; sds->busiest_has_capacity = sgs.group_has_capacity; sds->group_imb = sgs.group_imb;
@@ -2736,8 +2746,26 @@if (sds.this_load >= sds.avg_load) goto out_balanced; -if (100 * sds.max_load <= sd->imbalance_pct * sds.this_load) - goto out_balanced; +/* +* In the CPU_NEWLY_IDLE, use imbalance_pct to be conservative. +* And to check for busy balance use !idle_cpu instead of +* CPU_NOT_IDLE. This is because HT siblings will use CPU_NOT_IDLE +* even when they are idle. +*/ +if (idle ==CPU_NEWLY_IDLE || !idle_cpu (this_cpu)) { +if (100 * sds.max_load <= sd->imbalance_pct * sds.this_load) + goto out_balanced; + }else { +/* +* This cpu is idle. If the busiest group load doesn't +* have more tasks than the number of available cpu's and +* there is no imbalance between this and busiest group +* wrt to idle cpu's, it is balanced. +*/ +if ((sds.this_idle_cpus <= sds.busiest_idle_cpus +1 ) && + sds.busiest_nr_running <= sds.busiest_group_weight) + goto out_balanced; + } force_balance:/* Looks like there is an imbalance. Compute it */
kernel/sched.c +2 -0
@@ -6839,6 +6839,8 @@if (cpu !=group_first_cpu (sd->groups))return ; + sd->groups->group_weight =cpumask_weight (sched_group_cpus (sd->groups)); + child = sd->child; sd->groups->cpu_power =0 ;
PATCH 107/275 sched, cgroup: Fixup broken cgroup movement
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: b2b5ce022acf5e9f52f7b78c5579994fdde191d4 upstream
Dima noticed that we fail to correct the ->vruntime of sleeping tasks when we move them between cgroups.
LKML-Reference: <1287150604.29097.1513.camel@twins>
--- include/linux/sched.h | 2 +- kernel/sched.c | 8 ++++---- kernel/sched_fair.c | 25 +++++++++++++++++++------ 3 files changed, 24 insertions(+), 11 deletions(-)
include/linux/sched.h +1 -1
@@ -1076,7 +1076,7 @@ struct task_struct *task);#ifdef CONFIG_FAIR_GROUP_SCHED -void (*moved_group) (struct task_struct *p,int on_rq); +void (*task_move_group) (struct task_struct *p,int on_rq);#endif };
kernel/sched.c +4 -4
@@ -8332,12 +8332,12 @@if (unlikely (running)) tsk->sched_class->put_prev_task (rq, tsk); -set_task_rq (tsk,task_cpu (tsk)); -#ifdef CONFIG_FAIR_GROUP_SCHED -if (tsk->sched_class->moved_group) - tsk->sched_class->moved_group (tsk, on_rq); +if (tsk->sched_class->task_move_group) + tsk->sched_class->task_move_group (tsk, on_rq); + else#endif +set_task_rq (tsk,task_cpu (tsk));if (unlikely (running)) tsk->sched_class->set_curr_task (rq);
kernel/sched_fair.c +19 -6
@@ -3657,13 +3657,26 @@ }#ifdef CONFIG_FAIR_GROUP_SCHED -static void moved_group_fair (struct task_struct *p,int on_rq) +static void task_move_group_fair (struct task_struct *p,int on_rq) { -struct cfs_rq *cfs_rq =task_cfs_rq (p); - -update_curr (cfs_rq); +/* +* If the task was not on the rq at the time of this cgroup movement +* it must have been asleep, sleeping tasks keep their ->vruntime +* absolute on their old rq until wakeup (needed for the fair sleeper +* bonus in place_entity()). +* +* If it was on the rq, we've just 'preempted' it, which does convert +* ->vruntime to a relative base. +* +* Make sure both cases convert their relative position when migrating +* to another cgroup's rq. This does somewhat interfere with the +* fair sleeper stuff for the first placement, but who cares. +*/ +if (!on_rq) + p->se.vruntime -=cfs_rq_of (&p->se)->min_vruntime; +set_task_rq (p,task_cpu (p));if (!on_rq) -place_entity (cfs_rq, &p->se,1 ); + p->se.vruntime +=cfs_rq_of (&p->se)->min_vruntime; }#endif
@@ -3715,7 +3728,7 @@ .get_rr_interval = get_rr_interval_fair, #ifdef CONFIG_FAIR_GROUP_SCHED - .moved_group = moved_group_fair, + .task_move_group = task_move_group_fair,#endif };
PATCH 105/275 sched: Call tick_check_idle before __irq_enter
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: d267f87fb8179c6dba03d08b91952e81bc3723c7 upstream
When CPU is idle and on first interrupt, irq_enter calls tick_check_idle() to notify interruption from idle. But, there is a problem if this call is done after __irq_enter, as all routines in __irq_enter may find stale time due to yet to be done tick_check_idle.
Specifically, trace calls in __irq_enter when they use global clock and also account_system_vtime change in this patch as it wants to use sched_clock_cpu() to do proper irq timing.
But, tick_check_idle was moved after __irq_enter intentionally to prevent problem of unneeded ksoftirqd wakeups by the commit ee5f80a:
irq: call __irq_enter() before calling the tick_idle_check
Impact: avoid spurious ksoftirqd wakeups
Moving tick_check_idle() before __irq_enter and wrapping it with local_bh_enable/disable would solve both the problems.
LKML-Reference: <[email protected]>
--- kernel/sched.c | 2 +- kernel/softirq.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-)
kernel/sched.c +1 -1
@@ -1884,8 +1884,8 @@local_irq_save (flags); - now =sched_clock (); cpu =smp_processor_id (); + now =sched_clock_cpu (cpu); delta = now -per_cpu (irq_start_time, cpu);per_cpu (irq_start_time, cpu) = now;/*
kernel/softirq.c +9 -3
@@ -296,10 +296,16 @@rcu_irq_enter ();if (idle_cpu (cpu) && !in_interrupt ()) { -__irq_enter (); +/* +* Prevent raise_softirq from needlessly waking up ksoftirqd +* here, as softirq will be serviced on return from interrupt. +*/ +local_bh_disable ();tick_check_idle (cpu); - }else -__irq_enter (); +_local_bh_enable (); + } + +__irq_enter (); }#ifdef __ARCH_IRQ_EXIT_IRQS_DISABLED
PATCH 104/275 sched: Remove irq time from available CPU power
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: aa483808516ca5cacfa0e5849691f64fec25828e upstream
The idea was suggested by Peter Zijlstra here:
http://marc.info/?l=linux-kernel&m=127476934517534&w=2
irq time is technically not available to the tasks running on the CPU. This patch removes irq time from CPU power piggybacking on sched_rt_avg_update().
Tested this by keeping CPU X busy with a network intensive task having 75% oa a single CPU irq processing (hard+soft) on a 4-way system. And start seven cycle soakers on the system. Without this change, there will be two tasks on each CPU. With this change, there is a single task on irq busy CPU X and remaining 7 tasks are spread around among other 3 CPUs.
LKML-Reference: <[email protected]>
--- kernel/sched.c | 18 ++++++++++++++++++ kernel/sched_fair.c | 7 ++++++- kernel/sched_features.h | 5 +++++ 3 files changed, 29 insertions(+), 1 deletion(-)
kernel/sched.c +18 -0
@@ -519,6 +519,10 @@u64 avg_idle;#endif +#ifdef CONFIG_IRQ_TIME_ACCOUNTING +u64 prev_irq_time; +#endif +/* calc_load related fields */ unsigned long calc_load_update;long calc_load_active;
@@ -643,6 +647,7 @@#endif /* CONFIG_CGROUP_SCHED */ static u64 irq_time_cpu (int cpu); +static void sched_irq_time_avg_update (struct rq *rq,u64 irq_time);inline void update_rq_clock (struct rq *rq) {
@@ -654,6 +659,8 @@ irq_time =irq_time_cpu (cpu);if (rq->clock - irq_time > rq->clock_task) rq->clock_task = rq->clock - irq_time; + +sched_irq_time_avg_update (rq, irq_time); }/*
@@ -1895,6 +1902,15 @@ local_irq_restore(flags); } +static void sched_irq_time_avg_update (struct rq *rq,u64 curr_irq_time) +{ +if (sched_clock_irqtime &&sched_feat (NONIRQ_POWER )) { +u64 delta_irq = curr_irq_time - rq->prev_irq_time; + rq->prev_irq_time = curr_irq_time; +sched_rt_avg_update (rq, delta_irq); + } +} +#else static u64 irq_time_cpu (int cpu)
@@ -1902,6 +1918,8 @@ return 0; } +static void sched_irq_time_avg_update (struct rq *rq,u64 curr_irq_time) { } +#endif #include "sched_stats.h"
kernel/sched_features.h +5 -0
@@ -61,3 +61,8 @@* release the lock. Decreases scheduling overhead. */ SCHED_FEAT (OWNER_SPIN ,1 ) + +/* +* Decrement CPU power based on irq activity + */ +SCHED_FEAT (NONIRQ_POWER ,1 )
kernel/sched_fair.c +6 -1
@@ -2276,8 +2276,13 @@u64 total, available; total =sched_avg_period () + (rq->clock - rq->age_stamp); - available = total - rq->rt_avg; +if (unlikely (total < rq->rt_avg)) { +/* Ensures that power won't end up being negative */ + available =0 ; + }else { + available = total - rq->rt_avg; + }if (unlikely ((s64 )total <SCHED_LOAD_SCALE )) total =SCHED_LOAD_SCALE ;
PATCH 103/275 sched: Do not account irq time to current task
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: 305e6835e05513406fa12820e40e4a8ecb63743c upstream
Scheduler accounts both softirq and interrupt processing times to the currently running task. This means, if the interrupt processing was for some other task in the system, then the current task ends up being penalized as it gets shorter runtime than otherwise.
Change sched task accounting to acoount only actual task time from currently running task. Now update_curr(), modifies the delta_exec to depend on rq->clock_task.
Note that this change only handles CONFIG_IRQ_TIME_ACCOUNTING case. We can extend this to CONFIG_VIRT_CPU_ACCOUNTING with minimal effort. But, thats for later.
This change will impact scheduling behavior in interrupt heavy conditions.
Tested on a 4-way system with eth0 handled by CPU 2 and a network heavy task (nc) running on CPU 3 (and no RSS/RFS). With that I have CPU 2 spending 75%+ of its time in irq processing. CPU 3 spending around 35% time running nc task.
Now, if I run another CPU intensive task on CPU 2, without this change /proc/<pid>/schedstat shows 100% of time accounted to this task. With this change, it rightly shows less than 25% accounted to this task as remaining time is actually spent on irq processing.
LKML-Reference: <[email protected]>
--- kernel/sched.c | 38 +++++++++++++++++++++++++++++++++++++- kernel/sched_fair.c | 6 +++--- kernel/sched_rt.c | 8 ++++---- 3 files changed, 44 insertions(+), 8 deletions(-)
kernel/sched.c +37 -1
@@ -491,6 +491,7 @@struct mm_struct *prev_mm;u64 clock; +u64 clock_task;atomic_t nr_iowait;
@@ -641,10 +642,18 @@#endif /* CONFIG_CGROUP_SCHED */ +static u64 irq_time_cpu (int cpu); +inline void update_rq_clock (struct rq *rq) { +int cpu =cpu_of (rq); +u64 irq_time; +if (!rq->skip_clock_update) rq->clock =sched_clock_cpu (cpu_of (rq)); + irq_time =irq_time_cpu (cpu); +if (rq->clock - irq_time > rq->clock_task) + rq->clock_task = rq->clock - irq_time; }/*
@@ -1821,6 +1830,18 @@#ifdef CONFIG_IRQ_TIME_ACCOUNTING +/* +* There are no locks covering percpu hardirq/softirq time. +* They are only modified in account_system_vtime, on corresponding CPU +* with interrupts disabled. So, writes are safe. +* They are read and saved off onto struct rq in update_rq_clock(). +* This may result in other CPU reading this CPU's irq time and can +* race with irq/account_system_vtime on this CPU. We would either get old +* or new value (or semi updated value on 32 bit) with a side effect of +* accounting a slice of irq time to wrong task when irq is in progress +* while we read rq->clock. That is a worthy compromise in place of having +* locks on each irq in account_system_time. +*/ static DEFINE_PER_CPU(u64, cpu_hardirq_time); static DEFINE_PER_CPU(u64, cpu_softirq_time);
@@ -1837,6 +1858,14 @@ sched_clock_irqtime =0 ; } +static u64 irq_time_cpu (int cpu) +{ +if (!sched_clock_irqtime) +return 0 ; + +return per_cpu (cpu_softirq_time, cpu) +per_cpu (cpu_hardirq_time, cpu); +} +void account_system_vtime (struct task_struct *curr) {unsigned long flags;
@@ -1866,6 +1895,13 @@ local_irq_restore(flags); } +#else + +static u64 irq_time_cpu (int cpu) +{ +return 0 ; +} +#endif #include "sched_stats.h"
@@ -3263,7 +3299,7 @@if (task_current (rq, p)) {update_rq_clock (rq); - ns = rq->clock - p->se.exec_start; + ns = rq->clock_task - p->se.exec_start;if ((s64 )ns <0 ) ns =0 ; }
kernel/sched_fair.c +3 -3
@@ -519,7 +519,7 @@static void update_curr (struct cfs_rq *cfs_rq) {struct sched_entity *curr = cfs_rq->curr; -u64 now =rq_of (cfs_rq)->clock; +u64 now =rq_of (cfs_rq)->clock_task;unsigned long delta_exec;if (unlikely (!curr))
@@ -602,7 +602,7 @@/* * We are starting a new run period: */ - se->exec_start =rq_of (cfs_rq)->clock; + se->exec_start =rq_of (cfs_rq)->clock_task; }/**************************************************
@@ -1803,7 +1803,7 @@* 2) too many balance attempts have failed. */ - tsk_cache_hot =task_hot (p, rq->clock, sd); + tsk_cache_hot =task_hot (p, rq->clock_task, sd);if (!tsk_cache_hot || sd->nr_balance_failed > sd->cache_nice_tries) {#ifdef CONFIG_SCHEDSTATS
kernel/sched_rt.c +4 -4
@@ -609,7 +609,7 @@if (!task_has_rt_policy (curr))return ; - delta_exec = rq->clock - curr->se.exec_start; + delta_exec = rq->clock_task - curr->se.exec_start;if (unlikely ((s64 )delta_exec <0 )) delta_exec =0 ;
@@ -618,7 +618,7 @@ curr->se.sum_exec_runtime += delta_exec;account_group_exec_runtime (curr, delta_exec); - curr->se.exec_start = rq->clock; + curr->se.exec_start = rq->clock_task;cpuacct_charge (curr, delta_exec);sched_rt_avg_update (rq, delta_exec);
@@ -1075,7 +1075,7 @@ }while (rt_rq); p =rt_task_of (rt_se); - p->se.exec_start = rq->clock; + p->se.exec_start = rq->clock_task;return p; }
@@ -1716,7 +1716,7 @@ {struct task_struct *p = rq->curr; - p->se.exec_start = rq->clock; + p->se.exec_start = rq->clock_task;/* The running task is never eligible for pushing */ dequeue_pushable_task (rq, p);
PATCH 99/275 sched: Remove unused PF_ALIGNWARN flag
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: 637bbdc5b83615ef9f45f50399d1c7f27473c713 upstream
PF_ALIGNWARN is not implemented and it is for 486 as the comment.
It is not likely someone will implement this flag feature. So here remove this flag and leave the valuable 0x00000001 for future use.
LKML-Reference: <20100913121903.GB22238@darkstar>
--- include/linux/sched.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/sched.h +0 -2
@@ -1685,8 +1685,6 @@/* * Per process flags */ -#define PF_ALIGNWARN 0x00000001/* Print alignment warning msgs */ -/* Not implemented yet, only for 486*/ #define PF_STARTING 0x00000002/* being created */ #define PF_EXITING 0x00000004/* getting shut down */ #define PF_EXITPIDONE 0x00000008/* pi exit done on shut down */
PATCH 101/275 sched: Add IRQ_TIME_ACCOUNTING, finer accounting of irq time
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: b52bfee445d315549d41eacf2fa7c156e7d153d5 upstream
s390/powerpc/ia64 have support for CONFIG_VIRT_CPU_ACCOUNTING which does the fine granularity accounting of user, system, hardirq, softirq times. Adding that option on archs like x86 will be challenging however, given the state of TSC reliability on various platforms and also the overhead it will add in syscall entry exit.
Instead, add a lighter variant that only does finer accounting of hardirq and softirq times, providing precise irq times (instead of timer tick based samples). This accounting is added with a new config option CONFIG_IRQ_TIME_ACCOUNTING so that there won't be any overhead for users not interested in paying the perf penalty.
This accounting is based on sched_clock, with the code being generic. So, other archs may find it useful as well.
This patch just adds the core logic and does not enable this logic yet.
LKML-Reference: <[email protected]>
--- include/linux/hardirq.h | 2 - include/linux/sched.h | 13 ++++++++++++ kernel/sched.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-)
include/linux/hardirq.h +1 -1
@@ -137,7 +137,7 @@struct task_struct ; -#ifndef CONFIG_VIRT_CPU_ACCOUNTING +#if !defined(CONFIG_VIRT_CPU_ACCOUNTING ) && !defined(CONFIG_IRQ_TIME_ACCOUNTING )static inline void account_system_vtime (struct task_struct *tsk) { }
include/linux/sched.h +13 -0
@@ -1823,6 +1823,19 @@*/ extern unsigned long long cpu_clock (int cpu); +#ifdef CONFIG_IRQ_TIME_ACCOUNTING +/* +* An i/f to runtime opt-in for irq time accounting based off of sched_clock. +* The reason for this explicit opt-in is not to have perf penalty with +* slow sched_clocks. +*/ +extern void enable_sched_clock_irqtime (void ); +extern void disable_sched_clock_irqtime (void ); +#else +static inline void enable_sched_clock_irqtime (void ) {} +static inline void disable_sched_clock_irqtime (void ) {} +#endif +extern unsigned long long task_sched_runtime (struct task_struct *task);extern unsigned long long thread_group_sched_runtime (struct task_struct *task);
kernel/sched.c +49 -0
55 lines not on this page · raw message
PATCH 96/275 sched: Drop group_capacity to 1 only if local group has extra capacity
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: 75dd321d79d495a0ee579e6249ebc38ddbb2667f upstream
When SD_PREFER_SIBLING is set on a sched domain, drop group_capacity to 1 only if the local group has extra capacity. The extra check prevents the case where you always pull from the heaviest group when it is already under-utilized (possible with a large weight task outweighs the tasks on the system).
For example, consider a 16-cpu quad-core quad-socket machine with MC and NUMA scheduling domains. Let's say we spawn 15 nice0 tasks and one nice-15 task, and each task is running on one core. In this case, we observe the following events when balancing at the NUMA domain:
- find_busiest_group() will always pick the sched group containing the niced task to be the busiest group.
- find_busiest_queue() will then always pick one of the cpus running the nice0 task (never picks the cpu with the nice -15 task since weighted_cpuload > imbalance).
- The load balancer fails to migrate the task since it is the running task and increments sd->nr_balance_failed.
- It repeats the above steps a few more times until sd->nr_balance_failed > 5, at which point it kicks off the active load balancer, wakes up the migration thread and kicks the nice 0 task off the cpu.
The load balancer doesn't stop until we kick out all nice 0 tasks from the sched group, leaving you with 3 idle cpus and one cpu running the nice -15 task.
When balancing at the NUMA domain, we drop sgs.group_capacity to 1 if the child domain (in this case MC) has SD_PREFER_SIBLING set. Subsequent load checks are not relevant because the niced task has a very large weight.
In this patch, we add an extra condition to the "if(prefer_sibling)" check in update_sd_lb_stats(). We drop the capacity of a group only if the local group has extra capacity, ie. nr_running < group_capacity. This patch preserves the original intent of the prefer_siblings check (to spread tasks across the system in low utilization scenarios) and fixes the case above.
It helps in the following ways:
- In low utilization cases (where nr_tasks << nr_cpus), we still drop group_capacity down to 1 if we prefer siblings.
- On very busy systems (where nr_tasks >> nr_cpus), sgs.nr_running will most likely be > sgs.group_capacity.
- When balancing large weight tasks, if the local group does not have extra capacity, we do not pick the group with the niced task as the busiest group. This prevents failed balances, active migration and the under-utilization described above.
LKML-Reference: <[email protected]>
--- kernel/sched_fair.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
kernel/sched_fair.c +7 -2
@@ -2484,9 +2484,14 @@/* * In case the child domain prefers tasks go to siblings * first, lower the group capacity to one so that we'll try -* and move all the excess tasks away. +* and move all the excess tasks away. We lower the capacity +* of a group only if the local group has the capacity to fit +* these excess tasks, i.e. nr_running < group_capacity. The +* extra check prevents the case where you always pull from the +* heaviest group when it is already under-utilized (possible +* with a large weight task outweighs the tasks on the system). */ -if (prefer_sibling) +if (prefer_sibling && !local_group && sds->this_has_capacity) sgs.group_capacity =min (sgs.group_capacity,1UL );if (local_group) {
PATCH 95/275 sched: Force balancing on newidle balance if local group has capacity
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: fab476228ba37907ad75216d0fd9732ada9c119e upstream
This patch forces a load balance on a newly idle cpu when the local group has extra capacity and the busiest group does not have any. It improves system utilization when balancing tasks with a large weight differential.
Under certain situations, such as a niced down task (i.e. nice = -15) in the presence of nr_cpus NICE0 tasks, the niced task lands on a sched group and kicks away other tasks because of its large weight. This leads to sub-optimal utilization of the machine. Even though the sched group has capacity, it does not pull tasks because sds.this_load >> sds.max_load, and f_b_g() returns NULL.
With this patch, if the local group has extra capacity, we shortcut the checks in f_b_g() and try to pull a task over. A sched group has extra capacity if the group capacity is greater than the number of running tasks in that group.
Thanks to Mike Galbraith for discussions leading to this patch and for the insight to reuse SD_NEWIDLE_BALANCE.
LKML-Reference: <[email protected]>
--- kernel/sched_fair.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-)
kernel/sched_fair.c +25 -3
@@ -1765,6 +1765,10 @@set_task_cpu (p, this_cpu);activate_task (this_rq, p,0 );check_preempt_curr (this_rq, p,0 ); + +/* re-arm NEWIDLE balancing when moving tasks */ + src_rq->avg_idle = this_rq->avg_idle =2 *sysctl_sched_migration_cost; + this_rq->idle_stamp =0 ; }/*
@@ -2031,12 +2035,14 @@unsigned long this_load;unsigned long this_load_per_task;unsigned long this_nr_running; +unsigned long this_has_capacity;/* Statistics of the busiest group */ unsigned long max_load;unsigned long busiest_load_per_task;unsigned long busiest_nr_running;unsigned long busiest_group_capacity; +unsigned long busiest_has_capacity;int group_imb;/* Is there imbalance in this sd */ #if defined(CONFIG_SCHED_MC ) || defined(CONFIG_SCHED_SMT )
@@ -2059,6 +2065,7 @@unsigned long sum_weighted_load;/* Weighted load of group's tasks */ unsigned long group_capacity;int group_imb;/* Is there an imbalance in the group ? */ +int group_has_capacity;/* Is there extra capacity in the group? */ };/**
@@ -2428,6 +2435,9 @@ sgs->group_imb =1 ; sgs->group_capacity =DIV_ROUND_CLOSEST (group->cpu_power,SCHED_LOAD_SCALE ); + +if (sgs->group_capacity > sgs->sum_nr_running) + sgs->group_has_capacity =1 ; }/**
@@ -2484,6 +2494,7 @@ sds->this = group; sds->this_nr_running = sgs.sum_nr_running; sds->this_load_per_task = sgs.sum_weighted_load; + sds->this_has_capacity = sgs.group_has_capacity; }else if (sgs.avg_load > sds->max_load && (sgs.sum_nr_running > sgs.group_capacity || sgs.group_imb)) {
@@ -2492,6 +2503,7 @@ sds->busiest_nr_running = sgs.sum_nr_running; sds->busiest_group_capacity = sgs.group_capacity; sds->busiest_load_per_task = sgs.sum_weighted_load; + sds->busiest_has_capacity = sgs.group_has_capacity; sds->group_imb = sgs.group_imb; }
@@ -2637,6 +2649,7 @@return fix_small_imbalance (sds, this_cpu, imbalance); } +/******* find_busiest_group() helpers end here *********************/ /**
@@ -2688,6 +2701,11 @@* 4) This group is more busy than the avg busieness at this * sched_domain. * 5) The imbalance is within the specified limit. +* +* Note: when doing newidle balance, if the local group has excess +* capacity (i.e. nr_running < group_capacity) and the busiest group +* does not have any capacity, we force a load balance to pull tasks +* to the local group. In this case, we skip past checks 3, 4 and 5. */ if (!(*balance)) goto ret;
@@ -2695,6 +2713,11 @@if (!sds.busiest || sds.busiest_nr_running ==0 ) goto out_balanced; +/* SD_BALANCE_NEWIDLE trumps SMP nice when underutilized */ +if (idle ==CPU_NEWLY_IDLE && sds.this_has_capacity && + !sds.busiest_has_capacity) + goto force_balance; +if (sds.this_load >= sds.max_load) goto out_balanced;
@@ -2706,6 +2729,7 @@if (100 * sds.max_load <= sd->imbalance_pct * sds.this_load) goto out_balanced; +force_balance:/* Looks like there is an imbalance. Compute it */ calculate_imbalance (&sds, this_cpu, imbalance);return sds.busiest;
@@ -3024,10 +3048,8 @@ interval =msecs_to_jiffies (sd->balance_interval);if (time_after (next_balance, sd->last_balance + interval)) next_balance = sd->last_balance + interval; -if (pulled_task) { - this_rq->idle_stamp =0 ; +if (pulled_task)break ; - } }raw_spin_lock (&this_rq->lock);
PATCH 94/275 sched: Set group_imb only a task can be pulled from the busiest cpu
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: 2582f0eba54066b5e98ff2b27ef0cfa833b59f54 upstream
When cycling through sched groups to determine the busiest group, set group_imb only if the busiest cpu has more than 1 runnable task. This patch fixes the case where two cpus in a group have one runnable task each, but there is a large weight differential between these two tasks. The load balancer is unable to migrate any task from this group, and hence do not consider this group to be imbalanced.
LKML-Reference: <[email protected]>
--- kernel/sched_fair.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
kernel/sched_fair.c +7 -5
@@ -2352,7 +2352,7 @@ int local_group, const struct cpumask *cpus, int *balance, struct sg_lb_stats *sgs) { - unsigned long load, max_cpu_load, min_cpu_load; + unsigned long load, max_cpu_load, min_cpu_load, max_nr_running;int i;unsigned int balance_cpu =-1 , first_idle_cpu =0 ;unsigned long avg_load_per_task =0 ;
@@ -2363,6 +2363,7 @@/* Tally up the load of all CPUs in the group */ max_cpu_load =0 ; min_cpu_load = ~0UL ; + max_nr_running =0 ;for_each_cpu_and (i,sched_group_cpus (group), cpus) {struct rq *rq =cpu_rq (i);
@@ -2380,8 +2381,10 @@ load =target_load (i, load_idx); }else { load =source_load (i, load_idx); -if (load > max_cpu_load) +if (load > max_cpu_load) { max_cpu_load = load; + max_nr_running = rq->nr_running; + }if (min_cpu_load > load) min_cpu_load = load; }
@@ -2421,11 +2424,10 @@if (sgs->sum_nr_running) avg_load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running; -if ((max_cpu_load - min_cpu_load) >2 *avg_load_per_task) +if ((max_cpu_load - min_cpu_load) >2 *avg_load_per_task && max_nr_running >1 ) sgs->group_imb =1 ; - sgs->group_capacity = -DIV_ROUND_CLOSEST (group->cpu_power,SCHED_LOAD_SCALE ); + sgs->group_capacity =DIV_ROUND_CLOSEST (group->cpu_power,SCHED_LOAD_SCALE ); }/**
PATCH 93/275 sched: Do not consider SCHED_IDLE tasks to be cache hot
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: ef8002f6848236de5adc613063ebeabddea8a6fb upstream
This patch adds a check in task_hot to return if the task has SCHED_IDLE policy. SCHED_IDLE tasks have very low weight, and when run with regular workloads, are typically scheduled many milliseconds apart. There is no need to consider these tasks hot for load balancing.
LKML-Reference: <[email protected]>
--- kernel/sched.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/sched.c +3 -0
@@ -1972,6 +1972,9 @@if (p->sched_class != &fair_sched_class)return 0 ; +if (unlikely (p->policy ==SCHED_IDLE )) +return 0 ; +/* * Buddy candidates are cache hot: */
PATCH 91/275 sched: Give CPU bound RT tasks preference
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From:: Steven Rostedt <[email protected]>
Commit: b3bc211cfe7d5fe94b310480d78e00bea96fbf2a upstream
If a high priority task is waking up on a CPU that is running a lower priority task that is bound to a CPU, see if we can move the high RT task to another CPU first. Note, if all other CPUs are running higher priority tasks than the CPU bounded current task, then it will be preempted regardless.
LKML-Reference: <[email protected]>
--- kernel/sched_rt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
kernel/sched_rt.c +5 -3
@@ -971,7 +971,8 @@* For equal prio tasks, we just let the scheduler sort it out. */ if (unlikely (rt_task (rq->curr)) && - rq->curr->prio < p->prio && + (rq->curr->rt.nr_cpus_allowed <2 || + rq->curr->prio < p->prio) && (p->rt.nr_cpus_allowed >1 )) {int cpu =find_lowest_rq (p);
@@ -1491,9 +1492,10 @@if (!task_running (rq, p) && !test_tsk_need_resched (rq->curr) &&has_pushable_tasks (rq) && + p->rt.nr_cpus_allowed >1 &&rt_task (rq->curr) && - rq->curr->prio < p->prio && - p->rt.nr_cpus_allowed >1 ) + (rq->curr->rt.nr_cpus_allowed <2 || + rq->curr->prio < p->prio))push_rt_tasks (rq); }
PATCH 90/275 sched: Try not to migrate higher priority RT tasks
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Commit: 43fa5460fe60dea5c610490a1d263415419c60f6 upstream
When first working on the RT scheduler design, we concentrated on keeping all CPUs running RT tasks instead of having multiple RT tasks on a single CPU waiting for the migration thread to move them. Instead we take a more proactive stance and push or pull RT tasks from one CPU to another on wakeup or scheduling.
When an RT task wakes up on a CPU that is running another RT task, instead of preempting it and killing the cache of the running RT task, we look to see if we can migrate the RT task that is waking up, even if the RT task waking up is of higher priority.
This may sound a bit odd, but RT tasks should be limited in migration by the user anyway. But in practice, people do not do this, which causes high prio RT tasks to bounce around the CPUs. This becomes even worse when we have priority inheritance, because a high prio task can block on a lower prio task and boost its priority. When the lower prio task wakes up the high prio task, if it happens to be on the same CPU it will migrate off of it.
But in reality, the above does not happen much either, because the wake up of the lower prio task, which has already been boosted, if it was on the same CPU as the higher prio task, it would then migrate off of it. But anyway, we do not want to migrate them either.
To examine the scheduling, I created a test program and examined it under kernelshark. The test program created CPU * 2 threads, where each thread had a different priority. The program takes different options. The options used in this change log was to have priority inheritance mutexes or not.
All threads did the following loop:
static void grab_lock(long id, int iter, int l)
{
ftrace_write("thread %ld iter %d, taking lock %d\n",
id, iter, l);
pthread_mutex_lock(&locks[l]);
ftrace_write("thread %ld iter %d, took lock %d\n",
id, iter, l);
busy_loop(nr_tasks - id);
ftrace_write("thread %ld iter %d, unlock lock %d\n",
id, iter, l);
pthread_mutex_unlock(&locks[l]);
}void *start_task(void *id)
{
[...]
while (!done) {
for (l = 0; l < nr_locks; l++) {
grab_lock(id, i, l);
ftrace_write("thread %ld iter %d sleeping\n",
id, i);
ms_sleep(id);
}
i++;
}
[...]
}The busy_loop(ms) keeps the CPU spinning for ms milliseconds. The ms_sleep(ms) sleeps for ms milliseconds. The ftrace_write() writes to the ftrace buffer to help analyze via ftrace.
The higher the id, the higher the prio, the shorter it does the busy loop, but the longer it spins. This is usually the case with RT tasks, the lower priority tasks usually run longer than higher priority tasks.
At the end of the test, it records the number of loops each thread took, as well as the number of voluntary preemptions, non-voluntary preemptions, and number of migrations each thread took, taking the information from /proc/$$/sched and /proc/$$/status.
Running this on a 4 CPU processor, the results without changes to the kernel looked like this:
Task vol nonvol migrated iterations
---- --- ------ -------- ----------
0: 53 3220 1470 98 1: 562 773 724 98 2: 752 933 1375 98 3: 749 39 697 98 4: 758 5 515 98 5: 764 2 679 99 6: 761 2 535 99 7: 757 3 346 99
total: 5156 4977 6341 787
Each thread regardless of priority migrated a few hundred times. The higher priority tasks, were a little better but still took quite an impact.
By letting higher priority tasks bump the lower prio task from the CPU, things changed a bit:
Task vol nonvol migrated iterations ---- --- ------ -------- ---------- 0: 37 2835 1937 98 1: 666 1821 1865 98 2: 654 1003 1385 98 3: 664 635 973 99 4: 698 197 352 99 5: 703 101 159 99 6: 708 1 75 99 7: 713 1 2 99
total: 4843 6594 6748 789
The total # of migrations did not change (several runs showed the difference all within the noise). But we now see a dramatic improvement to the higher priority tasks. (kernelshark showed that the watchdog timer bumped the highest priority task to give it the 2 count. This was actually consistent with every run).
Notice that the # of iterations did not change either.
The above was with priority inheritance mutexes. That is, when the higher prority task blocked on a lower priority task, the lower priority task would inherit the higher priority task (which shows why task 6 was bumped so many times). When not using priority inheritance mutexes, the current kernel shows this:
Task vol nonvol migrated iterations ---- --- ------ -------- ---------- 0: 56 3101 1892 95 1: 594 713 937 95 2: 625 188 618 95 3: 628 4 491 96 4: 640 7 468 96 5: 631 2 501 96 6: 641 1 466 96 7: 643 2 497 96
total: 4458 4018 5870 765
Not much changed with or without priority inheritance mutexes. But if we let the high priority task bump lower priority tasks on wakeup we see:
Task vol nonvol migrated iterations ---- --- ------ -------- ---------- 0: 115 3439 2782 98 1: 633 1354 1583 99 2: 652 919 1218 99 3: 645 713 934 99 4: 690 3 3 99 5: 694 1 4 99 6: 720 3 4 99 7: 747 0 1 100
Which shows a even bigger change. The big difference between task 3 and task 4 is because we have only 4 CPUs on the machine, causing the 4 highest prio tasks to always have preference.
Although I did not measure cache misses, and I'm sure there would be little to measure since the test was not data intensive, I could imagine large improvements for higher priority tasks when dealing with lower priority tasks. Thus, I'm satisfied with making the change and agreeing with what Gregory Haskins argued a few years ago when we first had this discussion.
One final note. All tasks in the above tests were RT tasks. Any RT task will always preempt a non RT task that is running on the CPU the RT task wants to run on.
LKML-Reference: <[email protected]>
--- kernel/sched_rt.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
kernel/sched_rt.c +12 -10
@@ -960,18 +960,18 @@* runqueue. Otherwise simply start this RT task * on its current runqueue. * -* We want to avoid overloading runqueues. Even if -* the RT task is of higher priority than the current RT task. -* RT tasks behave differently than other tasks. If -* one gets preempted, we try to push it off to another queue. -* So trying to keep a preempting RT task on the same -* cache hot CPU will force the running RT task to -* a cold CPU. So we waste all the cache for the lower -* RT task in hopes of saving some of a RT task -* that is just being woken and probably will have -* cold cache anyway. +* We want to avoid overloading runqueues. If the woken +* task is a higher priority, then it will stay on this CPU +* and the lower prio task should be moved to another CPU. +* Even though this will probably make the lower prio task +* lose its cache, we do not want to bounce a higher task +* around just because it gave up its CPU, perhaps for a +* lock? +* +* For equal prio tasks, we just let the scheduler sort it out. */ if (unlikely (rt_task (rq->curr)) && + rq->curr->prio < p->prio && (p->rt.nr_cpus_allowed >1 )) {int cpu =find_lowest_rq (p);
@@ -1491,6 +1491,8 @@if (!task_running (rq, p) && !test_tsk_need_resched (rq->curr) &&has_pushable_tasks (rq) && +rt_task (rq->curr) && + rq->curr->prio < p->prio && p->rt.nr_cpus_allowed >1 )push_rt_tasks (rq); }
PATCH 87/275 usb: Realloc xHCI structures after a hub is verified.
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Sarah Sharp <[email protected]>
commit 653a39d1f61bdc9f277766736d21d2e9be0391cb upstream.
When there's an xHCI host power loss after a suspend from memory, the USB core attempts to reset and verify the USB devices that are attached to the system. The xHCI driver has to reallocate those devices, since the hardware lost all knowledge of them during the power loss.
When a hub is plugged in, and the host loses power, the xHCI hardware structures are not updated to say the device is a hub. This is usually done in hub_configure() when the USB hub is detected. That function is skipped during a reset and verify by the USB core, since the core restores the old configuration and alternate settings, and the hub driver has no idea this happened. This bug makes the xHCI host controller reject the enumeration of low speed devices under the resumed hub.
Therefore, make the USB core re-setup the internal xHCI hub device information by calling update_hub_device() when hub_activate() is called for a hub reset resume. After a host power loss, all devices under the roothub get a reset-resume or a disconnect.
This patch should be queued for the 2.6.37 stable tree.
--- drivers/usb/core/hub.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/usb/core/hub.c +21 -0
@@ -677,6 +677,8 @@static void hub_activate (struct usb_hub *hub,enum hub_activation_type type) {struct usb_device *hdev = hub->hdev; +struct usb_hcd *hcd; +int ret;int port1;int status;bool need_debounce_delay = false;
@@ -715,6 +717,25 @@usb_autopm_get_interface_no_resume (to_usb_interface (hub->intfdev));return ;/* Continues at init2: below */ + }else if (type ==HUB_RESET_RESUME ) { +/* The internal host controller state for the hub device +* may be gone after a host power loss on system resume. +* Update the device's info so the HW knows it's a hub. +*/ + hcd =bus_to_hcd (hdev->bus); +if (hcd->driver->update_hub_device) { + ret = hcd->driver->update_hub_device (hcd, hdev, + &hub->tt,GFP_NOIO ); +if (ret <0 ) { +dev_err (hub->intfdev,"Host not " +"accepting hub info " +"update.\n" ); +dev_err (hub->intfdev,"LS/FS devices " +"and hubs may not work " +"under this hub\n." ); + } + } +hub_power_on (hub, true); }else {hub_power_on (hub, true); }
PATCH 85/275 drm/i915: Add dependency on CONFIG_TMPFS
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit f7ab9b407b3bc83161c2aa74c992ba4782e87c9c upstream.
Without tmpfs, shmem_readpage() is not compiled in causing an OOPS as soon as we try to allocate some swappable pages for GEM.
Jan 19 22:52:26 harlie kernel: Modules linked in: i915(+) drm_kms_helper cfbcopyarea video backlight cfbimgblt cfbfillrect Jan 19 22:52:26 harlie kernel: Jan 19 22:52:26 harlie kernel: Pid: 1125, comm: modprobe Not tainted 2.6.37Harlie #10 To be filled by O.E.M./To be filled by O.E.M. Jan 19 22:52:26 harlie kernel: EIP: 0060:[<00000000>] EFLAGS: 00010246 CPU: 3 Jan 19 22:52:26 harlie kernel: EIP is at 0x0 Jan 19 22:52:26 harlie kernel: EAX: 00000000 EBX: f7b7d000 ECX: f3383100 EDX: f7b7d000 Jan 19 22:52:26 harlie kernel: ESI: f1456118 EDI: 00000000 EBP: f2303c98 ESP: f2303c7c Jan 19 22:52:26 harlie kernel: DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 Jan 19 22:52:26 harlie kernel: Process modprobe (pid: 1125, ti=f2302000 task=f259cd80 task.ti=f2302000) Jan 19 22:52:26 harlie kernel: Stack: Jan 19 22:52:26 harlie udevd-work[1072]: '/sbin/modprobe -b pci:v00008086d00000046sv00000000sd00000000bc03sc00i00' unexpected exit with status 0x0009 Jan 19 22:52:26 harlie kernel: c1074061 000000d0 f2f42b80 00000000 000a13d2 f2d5dcc0 00000001 f2303cac Jan 19 22:52:26 harlie kernel: c107416f 00000000 000a13d2 00000000 f2303cd4 f8d620ed f2cee620 00001000 Jan 19 22:52:26 harlie kernel: 00000000 000a13d2 f1456118 f2d5dcc0 f1a40000 00001000 f2303d04 f8d637ab Jan 19 22:52:26 harlie kernel: Call Trace: Jan 19 22:52:26 harlie kernel: [<c1074061>] ? do_read_cache_page+0x71/0x160 Jan 19 22:52:26 harlie kernel: [<c107416f>] ? read_cache_page_gfp+0x1f/0x30 Jan 19 22:52:26 harlie kernel: [<f8d620ed>] ? i915_gem_object_get_pages+0xad/0x1d0 [i915] Jan 19 22:52:26 harlie kernel: [<f8d637ab>] ? i915_gem_object_bind_to_gtt+0xeb/0x2d0 [i915] Jan 19 22:52:26 harlie kernel: [<f8d65961>] ? i915_gem_object_pin+0x151/0x190 [i915] Jan 19 22:52:26 harlie kernel: [<c11e16ed>] ? drm_gem_object_init+0x3d/0x60 Jan 19 22:52:26 harlie kernel: [<f8d65aa5>] ? i915_gem_init_ringbuffer+0x105/0x1e0 [i915] Jan 19 22:52:26 harlie kernel: [<f8d571b7>] ? i915_driver_load+0x667/0x1160 [i915]
--- drivers/gpu/drm/Kconfig | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/Kconfig +3 -0
@@ -96,7 +96,10 @@ config DRM_I915 tristate "i915 driver" depends on AGP_INTEL + # we need shmfs for the swappable backing store, and in particular + # the shmem_readpage() which depends upon tmpfs select SHMEM + select TMPFS select DRM_KMS_HELPER select FB_CFB_FILLRECT select FB_CFB_COPYAREA
PATCH 84/275 drm/i915/lvds: Add AOpen i915GMm-HFS to the list of false-positive LVDS
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Knut Petersen <[email protected]>
commit 22ab70d3262ddb6e69b3c246a34e2967ba5eb1e8 upstream.
--- drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_lvds.c +8 -0
@@ -811,6 +811,14 @@ }, { .callback = intel_no_lvds_dmi_callback, + .ident = "AOpen i915GMm-HFS", + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"AOpen" ), + DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), + }, + }, + { + .callback = intel_no_lvds_dmi_callback, .ident = "Aopen i945GTt-VFA", .matches = { DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"),
PATCH 83/275 drm/radeon/kms: fix s/r issues with bios scratch regs
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 87364760de5d631390c478fcbac8db1b926e0adf upstream.
The accelerate mode bit gets checked by certain atom command tables to set up some register state. It needs to be clear when setting modes and set when not.
Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- drivers/gpu/drm/radeon/radeon_atombios.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/radeon_atombios.c +6 -3
@@ -2125,7 +2125,7 @@ bios_2_scratch &= ~ATOM_S2_VRI_BRIGHT_ENABLE ;/* tell the bios not to handle mode switching */ - bios_6_scratch |= (ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH |ATOM_S6_ACC_MODE ); + bios_6_scratch |=ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH ;if (rdev->family >=CHIP_R600 ) {WREG32 (R600_BIOS_2_SCRATCH , bios_2_scratch);
@@ -2176,10 +2176,13 @@else bios_6_scratch =RREG32 (RADEON_BIOS_6_SCRATCH ); -if (lock) +if (lock) { bios_6_scratch |=ATOM_S6_CRITICAL_STATE ; -else + bios_6_scratch &= ~ATOM_S6_ACC_MODE ; + }else { bios_6_scratch &= ~ATOM_S6_CRITICAL_STATE ; + bios_6_scratch |=ATOM_S6_ACC_MODE ; + }if (rdev->family >=CHIP_R600 )WREG32 (R600_BIOS_6_SCRATCH , bios_6_scratch);
PATCH 74/275 SELinux: define permissions for DCB netlink messages
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Eric Paris <[email protected]>
commit 350e4f31e0eaf56dfc3b328d24a11bdf42a41fb8 upstream.
Commit 2f90b865 added two new netlink message types to the netlink route socket. SELinux has hooks to define if netlink messages are allowed to be sent or received, but it did not know about these two new message types. By default we allow such actions so noone likely noticed. This patch adds the proper definitions and thus proper permissions enforcement.
--- security/selinux/nlmsgtab.c | 2 ++ 1 file changed, 2 insertions(+)
security/selinux/nlmsgtab.c +2 -0
@@ -65,6 +65,8 @@ { RTM_NEWADDRLABEL, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, { RTM_DELADDRLABEL, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, { RTM_GETADDRLABEL, NETLINK_ROUTE_SOCKET__NLMSG_READ }, + { RTM_GETDCB, NETLINK_ROUTE_SOCKET__NLMSG_READ }, + { RTM_SETDCB, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, }; static struct nlmsg_perm nlmsg_firewall_perms[] =
PATCH 80/275 drm/radeon/kms: make the mac rv630 quirk generic
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit be23da8ad219650517cbbb7acbeaeb235667113a upstream.
Seems some other boards do this as well.
--- drivers/gpu/drm/radeon/radeon_atombios.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/gpu/drm/radeon/radeon_atombios.c +5 -9
@@ -289,15 +289,11 @@ *line_mux =0x90 ; } -/* mac rv630 */ -if ((dev->pdev->device ==0x9588 ) && - (dev->pdev->subsystem_vendor ==0x106b ) && - (dev->pdev->subsystem_device ==0x00a6 )) { -if ((supported_device ==ATOM_DEVICE_TV1_SUPPORT ) && - (*connector_type ==DRM_MODE_CONNECTOR_DVII )) { - *connector_type = DRM_MODE_CONNECTOR_9PinDIN; - *line_mux =CONNECTOR_7PIN_DIN_ENUM_ID1 ; - } +/* mac rv630, rv730, others */ +if ((supported_device ==ATOM_DEVICE_TV1_SUPPORT ) && + (*connector_type ==DRM_MODE_CONNECTOR_DVII )) { + *connector_type = DRM_MODE_CONNECTOR_9PinDIN; + *line_mux =CONNECTOR_7PIN_DIN_ENUM_ID1 ; }/* ASUS HD 3600 XT board lists the DVI port as HDMI */
PATCH 68/275 kernel/smp.c: fix smp_call_function_many() SMP race
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit 6dc19899958e420a931274b94019e267e2396d3e upstream.
I noticed a failure where we hit the following WARN_ON in generic_smp_call_function_interrupt:
if (!cpumask_test_and_clear_cpu(cpu, data->cpumask))
continue;
data->csd.func(data->csd.info);
refs = atomic_dec_return(&data->refs);
WARN_ON(refs < 0); <-------------------------We atomically tested and cleared our bit in the cpumask, and yet the number of cpus left (ie refs) was 0. How can this be?
It turns out commit 54fdade1c3332391948ec43530c02c4794a38172 ("generic-ipi: make struct call_function_data lockless") is at fault. It removes locking from smp_call_function_many and in doing so creates a rather complicated race.
The problem comes about because:
- The smp_call_function_many interrupt handler walks call_function.queue without any locking.
- We reuse a percpu data structure in smp_call_function_many.
- We do not wait for any RCU grace period before starting the next smp_call_function_many.
Imagine a scenario where CPU A does two smp_call_functions back to back, and CPU B does an smp_call_function in between. We concentrate on how CPU C handles the calls:
CPU A CPU B CPU C CPU D
smp_call_function
smp_call_function_interrupt
walks
call_function.queue sees data from CPU A on list
smp_call_function
smp_call_function_interrupt
walks
call_function.queue sees
(stale) CPU A on list
smp_call_function int clears last ref on A list_del_rcu, unlocksmp_call_function reuses
percpu *data A
data->cpumask sees and clears bit in cpumask might be using old or new fn! decrements refs below 0
set data->refs (too late!)
The important thing to note is since the interrupt handler walks a potentially stale call_function.queue without any locking, then another cpu can view the percpu *data structure at any time, even when the owner is in the process of initialising it.
The following test case hits the WARN_ON 100% of the time on my PowerPC box (having 128 threads does help :)
#include <linux/module.h>
#include <linux/init.h>
#define ITERATIONS 100
static void do_nothing_ipi(void *dummy)
{
}
static void do_ipis(struct work_struct *dummy)
{
int i;
for (i = 0; i < ITERATIONS; i++)
smp_call_function(do_nothing_ipi, NULL, 1);
printk(KERN_DEBUG "cpu %d finished\n", smp_processor_id());
}static struct work_struct work[NR_CPUS];
static int __init testcase_init(void)
{
int cpu;
for_each_online_cpu(cpu) {
INIT_WORK(&work[cpu], do_ipis);
schedule_work_on(cpu, &work[cpu]);
}
return 0;
}static void __exit testcase_exit(void)
{
}
module_init(testcase_init)module_exit(testcase_exit)MODULE_LICENSE("GPL");MODULE_AUTHOR("Anton Blanchard");
I tried to fix it by ordering the read and the write of ->cpumask and ->refs. In doing so I missed a critical case but Paul McKenney was able to spot my bug thankfully :) To ensure we arent viewing previous iterations the interrupt handler needs to read ->refs then ->cpumask then ->refs _again_.
Thanks to Milton Miller and Paul McKenney for helping to debug this issue.
--- kernel/smp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
kernel/smp.c +28 -0
@@ -194,6 +194,24 @@list_for_each_entry_rcu (data, &call_function.queue, csd.list) {int refs; +/* +* Since we walk the list without any locks, we might +* see an entry that was completed, removed from the +* list and is in the process of being reused. +* +* We must check that the cpu is in the cpumask before +* checking the refs, and both must be set before +* executing the callback on this cpu. +*/ + +if (!cpumask_test_cpu (cpu, data->cpumask)) +continue ; + +smp_rmb (); + +if (atomic_read (&data->refs) ==0 ) +continue ; +if (!cpumask_test_and_clear_cpu (cpu, data->cpumask))continue ;
@@ -442,11 +460,21 @@ data = &__get_cpu_var (cfd_data);csd_lock (&data->csd); +BUG_ON (atomic_read (&data->refs) || !cpumask_empty (data->cpumask)); data->csd.func = func; data->csd.info = info;cpumask_and (data->cpumask, mask, cpu_online_mask);cpumask_clear_cpu (this_cpu, data->cpumask); + +/* +* To ensure the interrupt handler gets an complete view +* we order the cpumask and refs writes and order the read +* of them in the interrupt handler. In addition we may +* only clear our own cpu bit from the mask. +*/ +smp_wmb (); +atomic_set (&data->refs,cpumask_weight (data->cpumask));raw_spin_lock_irqsave (&call_function.lock, flags);
Re: [PATCH] [232/275] nfsd: wrong index used in inner loop
In reply to Andi KleenQuoted 9 lines · Andi Kleen
2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Mi Jinlong <[email protected]>commit
5a02ab7c3c4580f94d13c683721039855b67cda6upstream.We must not use dummy for index.
After the first index, READ32(dummy) will change dummy!!!!
This is also in patch 180/275 (this one is 232/275).
/mjt
PATCH 79/275 drm/radeon/kms: add quirk for Mac Radeon HD 2600 card
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit f598aa7593427ffe3a61e7767c34bd695a5e7ed0 upstream.
--- drivers/gpu/drm/radeon/radeon_atombios.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/radeon/radeon_atombios.c +11 -0
@@ -289,6 +289,17 @@ *line_mux =0x90 ; } +/* mac rv630 */ +if ((dev->pdev->device ==0x9588 ) && + (dev->pdev->subsystem_vendor ==0x106b ) && + (dev->pdev->subsystem_device ==0x00a6 )) { +if ((supported_device ==ATOM_DEVICE_TV1_SUPPORT ) && + (*connector_type ==DRM_MODE_CONNECTOR_DVII )) { + *connector_type = DRM_MODE_CONNECTOR_9PinDIN; + *line_mux =CONNECTOR_7PIN_DIN_ENUM_ID1 ; + } + } +/* ASUS HD 3600 XT board lists the DVI port as HDMI */ if ((dev->pdev->device == 0x9598) && (dev->pdev->subsystem_vendor == 0x1043) &&
PATCH 77/275 dm: dont take i_mutex to change device size
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <[email protected]>
commit c217649bf2d60ac119afd71d938278cffd55962b upstream.
No longer needlessly hold md->bdev->bd_inode->i_mutex when changing the size of a DM device. This additional locking is unnecessary because i_size_write() is already protected by the existing critical section in dm_swap_table(). DM already has a reference on md->bdev so the associated bd_inode may be changed without lifetime concerns.
A negative side-effect of having held md->bdev->bd_inode->i_mutex was that a concurrent DM device resize and flush (via fsync) would deadlock. Dropping md->bdev->bd_inode->i_mutex eliminates this potential for deadlock. The following reproducer no longer deadlocks:
https://www.redhat.com/archives/dm-devel/2009-July/msg00284.html
--- drivers/md/dm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/md/dm.c +3 -2
@@ -2040,13 +2040,14 @@wake_up (&md->eventq); } +/* +* Protected by md->suspend_lock obtained by dm_swap_table(). +*/ static void __set_size (struct mapped_device *md,sector_t size) {set_capacity (md->disk, size); -mutex_lock (&md->bdev->bd_inode->i_mutex);i_size_write (md->bdev->bd_inode, (loff_t )size <<SECTOR_SHIFT ); -mutex_unlock (&md->bdev->bd_inode->i_mutex); }/*
PATCH 76/275 ieee80211: correct IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK macro
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Amitkumar Karwar <[email protected]>
commit 8d661f1e462d50bd83de87ee628aaf820ce3c66c upstream.
It is defined in include/linux/ieee80211.h. As per IEEE spec. bit6 to bit15 in block ack parameter represents buffer size. So the bitmask should be 0xFFC0.
--- include/linux/ieee80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/ieee80211.h +1 -1
@@ -959,7 +959,7 @@/* block-ack parameters */ #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002#define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C -#define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0 +#define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0#define IEEE80211_DELBA_PARAM_TID_MASK 0xF000#define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800
PATCH 73/275 tpm_tis: Use timeouts returned from TPM
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Berger <[email protected]>
commit 9b29050f8f75916f974a2d231ae5d3cd59792296 upstream.
The current TPM TIS driver in git discards the timeout values returned from the TPM. The check of the response packet needs to consider that the return_code field is 0 on success and the size of the expected packet is equivalent to the header size + u32 length indicator for the TPM_GetCapability() result + 3 timeout indicators of type u32.
I am also adding a sysfs entry 'timeouts' showing the timeouts that are being used.
--- drivers/char/tpm/tpm.c | 18 ++++++++++++++++-- drivers/char/tpm/tpm.h | 2 ++ drivers/char/tpm/tpm_tis.c | 4 +++- 3 files changed, 21 insertions(+), 3 deletions(-)
drivers/char/tpm/tpm.c +16 -2
@@ -567,9 +567,11 @@if (rc)return ; -if (be32_to_cpu (tpm_cmd.header.out.return_code) - !=3 *sizeof (u32)) +if (be32_to_cpu (tpm_cmd.header.out.return_code) !=0 || +be32_to_cpu (tpm_cmd.header.out.length) + !=sizeof (tpm_cmd.header.out) +sizeof (u32) +3 *sizeof (u32))return ; + duration_cap = &tpm_cmd.params.getcap_out.cap.duration; chip->vendor.duration[TPM_SHORT ] =usecs_to_jiffies (be32_to_cpu (duration_cap->tpm_short));
@@ -913,6 +915,18 @@ }EXPORT_SYMBOL_GPL (tpm_show_caps_1_2); +ssize_t tpm_show_timeouts (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct tpm_chip *chip =dev_get_drvdata (dev); + +return sprintf (buf,"%d %d %d\n" , +jiffies_to_usecs (chip->vendor.duration[TPM_SHORT ]), +jiffies_to_usecs (chip->vendor.duration[TPM_MEDIUM ]), +jiffies_to_usecs (chip->vendor.duration[TPM_LONG ])); +} +EXPORT_SYMBOL_GPL (tpm_show_timeouts); +ssize_t tpm_store_cancel (struct device *dev,struct device_attribute *attr,const char *buf,size_t count) {
drivers/char/tpm/tpm.h +2 -0
@@ -56,6 +56,8 @@ char *);extern ssize_t tpm_show_temp_deactivated (struct device *,struct device_attribute *attr,char *); +extern ssize_t tpm_show_timeouts (struct device *, +struct device_attribute *attr,char *);struct tpm_chip ;
drivers/char/tpm/tpm_tis.c +3 -1
@@ -355,6 +355,7 @@ NULL); static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); +static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL);static struct attribute *tis_attrs[] = { &dev_attr_pubek.attr,
@@ -364,7 +365,8 @@ &dev_attr_owned.attr, &dev_attr_temp_deactivated.attr, &dev_attr_caps.attr, - &dev_attr_cancel.attr, NULL, + &dev_attr_cancel.attr, + &dev_attr_timeouts.attr, NULL, }; static struct attribute_group tis_attr_grp = {
PATCH 72/275 TPM: Long default timeout fix
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Rajiv Andrade <[email protected]>
commit c4ff4b829ef9e6353c0b133b7adb564a68054979 upstream.
If duration variable value is 0 at this point, it's because chip->vendor.duration wasn't filled by tpm_get_timeouts() yet. This patch sets then the lowest timeout just to give enough time for tpm_get_timeouts() to further succeed.
This fix avoids long boot times in case another entity attempts to send commands to the TPM when the TPM isn't accessible.
--- drivers/char/tpm/tpm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/char/tpm/tpm.c +6 -4
@@ -354,12 +354,14 @@ tpm_protected_ordinal_duration[ordinal &TPM_PROTECTED_ORDINAL_MASK ]; -if (duration_idx !=TPM_UNDEFINED ) +if (duration_idx !=TPM_UNDEFINED ) { duration = chip->vendor.duration[duration_idx]; -if (duration <=0 ) +/* if duration is 0, it's because chip->vendor.duration wasn't */ +/* filled yet, so we set the lowest timeout just to give enough */ +/* time for tpm_get_timeouts() to succeed */ +return (duration <=0 ?HZ : duration); + }else return 2 *60 *HZ ; -else -return duration; }EXPORT_SYMBOL_GPL (tpm_calc_ordinal_duration);
PATCH 71/275 pata_mpc52xx: inherit from ata_bmdma_port_ops
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit 77c5fd19075d299fe820bb59bb21b0b113676e20 upstream.
pata_mpc52xx supports BMDMA but inherits ata_sff_port_ops which triggers BUG_ON() when a DMA command is issued. Fix it.
--- drivers/ata/pata_mpc52xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/pata_mpc52xx.c +1 -1
@@ -610,7 +610,7 @@ };static struct ata_port_operations mpc52xx_ata_port_ops = { - .inherits = &ata_sff_port_ops, + .inherits = &ata_bmdma_port_ops, .sff_dev_select = mpc52xx_ata_dev_select, .set_piomode = mpc52xx_ata_set_piomode, .set_dmamode = mpc52xx_ata_set_dmamode,
PATCH 70/275 md: fix regression with re-adding devices to arrays with no metadata
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit bf572541ab44240163eaa2d486b06f306a31d45a upstream.
Commit 1a855a0606 (2.6.37-rc4) fixed a problem where devices were re-added when they shouldn't be but caused a regression in a less common case that means sometimes devices cannot be re-added when they should be.
In particular, when re-adding a device to an array without metadata we should always access the device, but after the above commit we didn't.
This patch sets the In_sync flag in that case so that the re-add succeeds.
This patch is suitable for any -stable kernel to which 1a855a0606 was applied.
--- drivers/md/md.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/md/md.c +3 -2
@@ -5109,9 +5109,10 @@/* set saved_raid_disk if appropriate */ if (!mddev->persistent) {if (info->state & (1 <<MD_DISK_SYNC ) && - info->raid_disk < mddev->raid_disks) + info->raid_disk < mddev->raid_disks) { rdev->raid_disk = info->raid_disk; -else +set_bit (In_sync, &rdev->flags); + }else rdev->raid_disk =-1 ; }else super_types[mddev->major_version].
PATCH 67/275 parisc : Remove broken line wrapping handling pdc_iodc_print()
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Guy Martin <[email protected]>
commit fbea668498e93bb38ac9226c7af9120a25957375 upstream.
Remove the broken line wrapping handling in pdc_iodc_print(). It is broken in 3 ways :
- It doesn't keep track of the current screen position, it just assumes that the new buffer will be printed at the begining of the screen.
- It doesn't take in account that non printable characters won't increase the current position on the screen.
- And last but not least, it triggers a kernel panic if a backspace is the first char in the provided buffer :
Backtrace: [<0000000040128ec4>] pdc_console_write+0x44/0x78 [<0000000040128f18>] pdc_console_tty_write+0x20/0x38 [<000000004032f1ac>] n_tty_write+0x2a4/0x550 [<000000004032b158>] tty_write+0x1e0/0x2d8 [<00000000401bb420>] vfs_write+0xb8/0x188 [<00000000401bb630>] sys_write+0x68/0xb8 [<0000000040104eb8>] syscall_exit+0x0/0x14
Most terminals handle the line wrapping just fine. I've confirmed that it works correctly on a C8000 with both vga and serial output.
--- arch/parisc/kernel/firmware.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
arch/parisc/kernel/firmware.c +1 -12
@@ -1126,15 +1126,13 @@unsigned int i;unsigned long flags; -for (i =0 ; i < count && i <79 ;) { +for (i =0 ; i < count;) {switch (str[i]) {case '\n' : iodc_dbuf[i+0 ] ='\r' ; iodc_dbuf[i+1 ] ='\n' ; i +=2 ; goto print; -case '\b' :/* BS */ - i--;/* overwrite last */ default : iodc_dbuf[i] = str[i]; i++;
@@ -1142,15 +1140,6 @@ } } -/* if we're at the end of line, and not already inserting a newline, -* insert one anyway. iodc console doesn't claim to support >79 char -* lines. don't account for this in the return value. -*/ -if (i ==79 && iodc_dbuf[i-1 ] !='\n' ) { - iodc_dbuf[i+0 ] ='\r' ; - iodc_dbuf[i+1 ] ='\n' ; - } - print:spin_lock_irqsave (&pdc_lock, flags); real32_call(PAGE0->mem_cons.iodc_io,
PATCH 66/275 powerpc: Fix some 6xx/7xxx CPU setup functions
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Herrenschmidt <[email protected]>
commit 1f1936ff3febf38d582177ea319eaa278f32c91f upstream.
Some of those functions try to adjust the CPU features, for example to remove NAP support on some revisions. However, they seem to use r5 as an index into the CPU table entry, which might have been right a long time ago but no longer is. r4 is the right register to use.
This probably caused some off behaviours on some PowerMac variants using 750cx or 7455 processor revisions.
--- arch/powerpc/kernel/cpu_setup_6xx.S | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-)
arch/powerpc/kernel/cpu_setup_6xx.S +20 -20
@@ -18,7 +18,7 @@ #include <asm/mmu.h> _GLOBAL(__setup_cpu_603) - mflr r4 + mflr r5 BEGIN_MMU_FTR_SECTION li r10,0 mtspr SPRN_SPRG_603_LRU,r10 /* init SW LRU tracking */
@@ -27,60 +27,60 @@ bl __init_fpu_registers END_FTR_SECTION_IFCLR(CPU_FTR_FPU_UNAVAILABLE) bl setup_common_caches - mtlr r4 + mtlr r5 blr _GLOBAL(__setup_cpu_604) - mflr r4 + mflr r5 bl setup_common_caches bl setup_604_hid0 - mtlr r4 + mtlr r5 blr _GLOBAL(__setup_cpu_750) - mflr r4 + mflr r5 bl __init_fpu_registers bl setup_common_caches bl setup_750_7400_hid0 - mtlr r4 + mtlr r5 blr _GLOBAL(__setup_cpu_750cx) - mflr r4 + mflr r5 bl __init_fpu_registers bl setup_common_caches bl setup_750_7400_hid0 bl setup_750cx - mtlr r4 + mtlr r5 blr _GLOBAL(__setup_cpu_750fx) - mflr r4 + mflr r5 bl __init_fpu_registers bl setup_common_caches bl setup_750_7400_hid0 bl setup_750fx - mtlr r4 + mtlr r5 blr _GLOBAL(__setup_cpu_7400) - mflr r4 + mflr r5 bl __init_fpu_registers bl setup_7400_workarounds bl setup_common_caches bl setup_750_7400_hid0 - mtlr r4 + mtlr r5 blr _GLOBAL(__setup_cpu_7410) - mflr r4 + mflr r5 bl __init_fpu_registers bl setup_7410_workarounds bl setup_common_caches bl setup_750_7400_hid0 li r3,0 mtspr SPRN_L2CR2,r3 - mtlr r4 + mtlr r5 blr _GLOBAL(__setup_cpu_745x) - mflr r4 + mflr r5 bl setup_common_caches bl setup_745x_specifics - mtlr r4 + mtlr r5 blr /* Enable caches for 603's, 604, 750 & 7400 */
@@ -194,10 +194,10 @@ cror 4*cr0+eq,4*cr0+eq,4*cr1+eq cror 4*cr0+eq,4*cr0+eq,4*cr2+eq bnelr - lwz r6,CPU_SPEC_FEATURES(r5) + lwz r6,CPU_SPEC_FEATURES(r4) li r7,CPU_FTR_CAN_NAP andc r6,r6,r7 - stw r6,CPU_SPEC_FEATURES(r5) + stw r6,CPU_SPEC_FEATURES(r4) blr /* 750fx specific
@@ -225,12 +225,12 @@ andis. r11,r11,L3CR_L3E@h beq 1f END_FTR_SECTION_IFSET(CPU_FTR_L3CR) - lwz r6,CPU_SPEC_FEATURES(r5) + lwz r6,CPU_SPEC_FEATURES(r4) andi. r0,r6,CPU_FTR_L3_DISABLE_NAP beq 1f li r7,CPU_FTR_CAN_NAP andc r6,r6,r7 - stw r6,CPU_SPEC_FEATURES(r5) + stw r6,CPU_SPEC_FEATURES(r4) 1: mfspr r11,SPRN_HID0
PATCH 63/275 fix jiffy calculations in calibrate_delay_direct to handle overflow
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Tim Deegan <[email protected]>
commit 70a062286b9dfcbd24d2e11601aecfead5cf709a upstream.
Fixes a hang when booting as dom0 under Xen, when jiffies can be quite large by the time the kernel init gets this far.
--- init/calibrate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
init/calibrate.c +3 -3
@@ -66,7 +66,7 @@ pre_start =0 ;read_current_timer (&start); start_jiffies = jiffies; -while (jiffies <= (start_jiffies +1 )) { +while (time_before_eq (jiffies, start_jiffies +1 )) { pre_start = start;read_current_timer (&start); }
@@ -74,8 +74,8 @@ pre_end =0 ; end = post_start; -while (jiffies <= - (start_jiffies +1 +DELAY_CALIBRATION_TICKS )) { +while (time_before_eq (jiffies, start_jiffies +1 + +DELAY_CALIBRATION_TICKS )) { pre_end = end;read_current_timer (&end); }
PATCH 61/275 ptrace: use safer wake up on ptrace_detach()
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit 01e05e9a90b8f4c3997ae0537e87720eb475e532 upstream.
The wake_up_process() call in ptrace_detach() is spurious and not interlocked with the tracee state. IOW, the tracee could be running or sleeping in any place in the kernel by the time wake_up_process() is called. This can lead to the tracee waking up unexpectedly which can be dangerous.
The wake_up is spurious and should be removed but for now reduce its toxicity by only waking up if the tracee is in TRACED or STOPPED state.
This bug can possibly be used as an attack vector. I don't think it will take too much effort to come up with an attack which triggers oops somewhere. Most sleeps are wrapped in condition test loops and should be safe but we have quite a number of places where sleep and wakeup conditions are expected to be interlocked. Although the window of opportunity is tiny, ptrace can be used by non-privileged users and with some loading the window can definitely be extended and exploited.
--- kernel/ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/ptrace.c +1 -1
@@ -313,7 +313,7 @@ child->exit_code = data; dead =__ptrace_detach (current, child);if (!child->exit_state) -wake_up_process (child); +wake_up_state (child,TASK_TRACED |TASK_STOPPED ); }write_unlock_irq (&tasklist_lock);
PATCH 57/275 ds2760_battery: Fix calculation of time_to_empty_now
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Sven Neumann <[email protected]>
commit 86af95039b69a90db15294eb1f9c147f1df0a8ea upstream.
A check against division by zero was modified in commit b0525b48. Since this change time_to_empty_now is always reported as zero while the battery is discharging and as a negative value while the battery is charging. This is because current is negative while the battery is discharging.
Fix the check introduced by commit b0525b48 so that time_to_empty_now is reported correctly during discharge and as zero while charging.
--- drivers/power/ds2760_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/ds2760_battery.c +1 -1
@@ -212,7 +212,7 @@if (di->rem_capacity >100 ) di->rem_capacity =100 ; -if (di->current_uA >=100L ) +if (di->current_uA <-100L ) di->life_sec = -((di->accum_current_uAh - di->empty_uAh) *36L ) / (di->current_uA /100L );else
PATCH 56/275 virtio: remove virtio-pci root device
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Milton Miller <[email protected]>
commit 8b3bb3ecf1934ac4a7005ad9017de1127e2fbd2f upstream.
We sometimes need to map between the virtio device and the given pci device. One such use is OS installer that gets the boot pci device from BIOS and needs to find the relevant block device. Since it can't, installation fails.
Instead of creating a top-level devices/virtio-pci directory, create each device under the corresponding pci device node. Symlinks to all virtio-pci devices can be found under the pci driver link in bus/pci/drivers/virtio-pci/devices, and all virtio devices under drivers/bus/virtio/devices.
--- drivers/virtio/virtio_pci.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-)
drivers/virtio/virtio_pci.c +2 -18
@@ -96,11 +96,6 @@MODULE_DEVICE_TABLE (pci, virtio_pci_id_table); -/* A PCI device has it's own struct device and so does a virtio device so -* we create a place for the virtio devices to show up in sysfs. I think it -* would make more sense for virtio to not insist on having it's own device. */ -static struct device *virtio_pci_root; -/* Convert a generic virtio device to our structure */ static struct virtio_pci_device *to_vp_device (struct virtio_device *vdev) {
@@ -629,7 +624,7 @@if (vp_dev ==NULL )return -ENOMEM ; - vp_dev->vdev.dev.parent = virtio_pci_root; + vp_dev->vdev.dev.parent = &pci_dev->dev; vp_dev->vdev.dev.release = virtio_pci_release_dev; vp_dev->vdev.config = &virtio_pci_config_ops; vp_dev->pci_dev = pci_dev;
@@ -717,17 +712,7 @@static int __init virtio_pci_init (void ) { -int err; - - virtio_pci_root =root_device_register ("virtio-pci" ); -if (IS_ERR (virtio_pci_root)) -return PTR_ERR (virtio_pci_root); - - err =pci_register_driver (&virtio_pci_driver); -if (err) -root_device_unregister (virtio_pci_root); - -return err; +return pci_register_driver (&virtio_pci_driver); }module_init (virtio_pci_init);
@@ -735,7 +720,6 @@ static void __exit virtio_pci_exit(void) {pci_unregister_driver (&virtio_pci_driver); -root_device_unregister (virtio_pci_root); }module_exit (virtio_pci_exit);
PATCH 54/275 rapidio: fix hang on RapidIO doorbell queue full condition
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Taranowski <[email protected]>
commit 12a4dc43911785f51a596f771ae0701b18d436f1 upstream.
In fsl_rio_dbell_handler() the code currently simply acknowledges the QFI queue full interrupt, but does nothing to resolve the queue full condition. Instead, it jumps to the end of the isr. When a queue full condition occurs, the isr is then re-entered immediately and continually, forever.
The fix is to just fall through and read out current doorbell entries.
--- arch/powerpc/sysdev/fsl_rio.c | 1 - 1 file changed, 1 deletion(-)
arch/powerpc/sysdev/fsl_rio.c +0 -1
@@ -952,7 +952,6 @@if (dsr &DOORBELL_DSR_QFI ) {pr_info ("RIO: doorbell queue full\n" );out_be32 (&priv->msg_regs->dsr,DOORBELL_DSR_QFI ); - goto out; }/* XXX Need to check/dispatch until queue empty */
PATCH 52/275 rtc-cmos: fix suspend/resume
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Paul Fox <[email protected]>
commit 2fb08e6ca9f00d1aedb3964983e9c8f84b36b807 upstream.
rtc-cmos was setting suspend/resume hooks at the device_driver level. However, the platform bus code (drivers/base/platform.c) only looks for resume hooks at the dev_pm_ops level, or within the platform_driver.
Switch rtc_cmos to use dev_pm_ops so that suspend/resume code is executed again.
Paul said:
: The user visible symptom in our (XO laptop) case was that rtcwake would : fail to wake the laptop. The RTC alarm would expire, but the wakeup : wasn't unmasked.
:
: As for severity, the impact may have been reduced because if I recall : correctly, the bug only affected platforms with CONFIG_PNP disabled.
--- drivers/rtc/rtc-cmos.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/rtc/rtc-cmos.c +9 -7
@@ -36,6 +36,7 @@#include <linux/platform_device.h> #include <linux/mod_devicetable.h> #include <linux/log2.h> +#include <linux/pm.h> /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */ #include <asm-generic/rtc.h>
@@ -850,7 +851,7 @@#ifdef CONFIG_PM -static int cmos_suspend (struct device *dev,pm_message_t mesg) +static int cmos_suspend (struct device *dev) {struct cmos_rtc *cmos =dev_get_drvdata (dev);unsigned char tmp;
@@ -898,7 +899,7 @@*/ static inline int cmos_poweroff (struct device *dev) { -return cmos_suspend (dev,PMSG_HIBERNATE ); +return cmos_suspend (dev); }static int cmos_resume (struct device *dev)
@@ -945,9 +946,9 @@return 0 ; } +static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume); +#else -#define cmos_suspend NULL -#define cmos_resume NULLstatic inline int cmos_poweroff (struct device *dev) {
@@ -1083,7 +1084,7 @@static int cmos_pnp_suspend (struct pnp_dev *pnp,pm_message_t mesg) { -return cmos_suspend (&pnp->dev, mesg); +return cmos_suspend (&pnp->dev); }static int cmos_pnp_resume (struct pnp_dev *pnp)
@@ -1163,8 +1164,9 @@ .shutdown = cmos_platform_shutdown, .driver = { .name = (char *) driver_name, - .suspend = cmos_suspend, - .resume = cmos_resume, +#ifdef CONFIG_PM + .pm = &cmos_pm_ops, +#endif } };
PATCH 51/275 NFS: Fix "kernel BUG at fs/aio.c:554!"
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
commit 839f7ad6932d95f4d5ae7267b95c574714ff3d5b upstream.
Nick Piggin reports:
Quoted 16 lines
I'm getting use after frees in aio code in NFS
[ 2703.396766] Call Trace: [ 2703.396858] [<ffffffff8100b057>] ? native_sched_clock+0x27/0x80 [ 2703.396959] [<ffffffff8108509e>] ? put_lock_stats+0xe/0x40 [ 2703.397058] [<ffffffff81088348>] ? lock_release_holdtime+0xa8/0x140 [ 2703.397159] [<ffffffff8108a2a5>] lock_acquire+0x95/0x1b0 [ 2703.397260] [<ffffffff811627db>] ? aio_put_req+0x2b/0x60 [ 2703.397361] [<ffffffff81039701>] ? get_parent_ip+0x11/0x50 [ 2703.397464] [<ffffffff81612a31>] _raw_spin_lock_irq+0x41/0x80 [ 2703.397564] [<ffffffff811627db>] ? aio_put_req+0x2b/0x60 [ 2703.397662] [<ffffffff811627db>] aio_put_req+0x2b/0x60 [ 2703.397761] [<ffffffff811647fe>] do_io_submit+0x2be/0x7c0 [ 2703.397895] [<ffffffff81164d0b>] sys_io_submit+0xb/0x10 [ 2703.397995] [<ffffffff8100307b>] system_call_fastpath+0x16/0x1b
Quoted 3 lines
Adding some tracing, it is due to nfs completing the request then returning something other than
-EIOCBQUEUED, soaio.calso completes the request.
To address this, prevent the NFS direct I/O engine from completing async iocbs when the forward path returns an error without starting any I/O.
This fix appears to survive ^C during both "xfstest no. 208" and "fsx -Z."
It's likely this bug has existed for a very long while, as we are seeing very similar symptoms in OEL 5. Copying stable.
--- fs/nfs/direct.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-)
fs/nfs/direct.c +20 -14
@@ -402,15 +402,18 @@ pos += vec->iov_len; } +/* +* If no bytes were started, return the error, and let the +* generic layer handle the completion. +*/ +if (requested_bytes ==0 ) { +nfs_direct_req_release (dreq); +return result <0 ? result : -EIO ; + } +if (put_dreq (dreq))nfs_direct_complete (dreq); - -if (requested_bytes !=0 ) -return 0 ; - -if (result <0 ) -return result; -return -EIO ; +return 0 ; } static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov,
@@ -830,15 +833,18 @@ pos += vec->iov_len; } +/* +* If no bytes were started, return the error, and let the +* generic layer handle the completion. +*/ +if (requested_bytes ==0 ) { +nfs_direct_req_release (dreq); +return result <0 ? result : -EIO ; + } +if (put_dreq (dreq))nfs_direct_write_complete (dreq, dreq->inode); - -if (requested_bytes !=0 ) -return 0 ; - -if (result <0 ) -return result; -return -EIO ; +return 0 ; } static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,
PATCH 50/275 ASoC: Blackfin AC97: fix build error after multi-component update
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Mike Frysinger <[email protected]>
commit e9c2048915048d605fd76539ddd96f00d593e1eb upstream.
We need to tweak how we query the active capture/playback state after the recent overhauls of common code.
--- sound/soc/blackfin/bf5xx-ac97.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/blackfin/bf5xx-ac97.c +2 -2
@@ -261,9 +261,9 @@pr_debug ("%s : sport %d\n" , __func__, dai->id);if (!dai->active)return 0 ; -if (dai->capture.active) +if (dai->capture_active)sport_rx_stop (sport); -if (dai->playback.active) +if (dai->playback_active)sport_tx_stop (sport);return 0 ; }
PATCH 49/275 ASoC: WM8990: msleep() takes milliseconds not jiffies
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Dimitris Papastamos <[email protected]>
commit 7ebcf5d6021a696680ee77d9162a2edec2d671dd upstream.
--- sound/soc/codecs/wm8990.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
sound/soc/codecs/wm8990.c +5 -5
@@ -1185,7 +1185,7 @@ WM8990_VMIDTOG);/* Delay to allow output caps to discharge */ -msleep (msecs_to_jiffies (300 )); +msleep (300 );/* Disable VMIDTOG */ snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST |
@@ -1197,17 +1197,17 @@/* Enable outputs */ snd_soc_write (codec,WM8990_POWER_MANAGEMENT_1 ,0x1b00 ); -msleep (msecs_to_jiffies (50 )); +msleep (50 );/* Enable VMID at 2x50k */ snd_soc_write (codec,WM8990_POWER_MANAGEMENT_1 ,0x1f02 ); -msleep (msecs_to_jiffies (100 )); +msleep (100 );/* Enable VREF */ snd_soc_write (codec,WM8990_POWER_MANAGEMENT_1 ,0x1f03 ); -msleep (msecs_to_jiffies (600 )); +msleep (600 );/* Enable BUFIOEN */ snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST |
@@ -1252,7 +1252,7 @@/* Disable VMID */ snd_soc_write (codec,WM8990_POWER_MANAGEMENT_1 ,0x1f01 ); -msleep (msecs_to_jiffies (300 )); +msleep (300 );/* Enable all output discharge bits */ snd_soc_write(codec, WM8990_ANTIPOP1, WM8990_DIS_LLINE |
PATCH 47/275 input: bcm5974: Add support for MacBookAir3
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Edgar (gimli) Hucek <[email protected]>
commit 6021afcf19d8c6f5db6d11cadcfb6a22d0c28a48 upstream.
This patch adds support for the MacBookAir3,1 and MacBookAir3,2 models.
--- drivers/input/mouse/bcm5974.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
drivers/input/mouse/bcm5974.c +40 -0
@@ -55,6 +55,14 @@#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238 +/* MacbookAir3,2 (unibody), aka wellspring5 */ +#define USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI 0x023f +#define USB_DEVICE_ID_APPLE_WELLSPRING4_ISO 0x0240 +#define USB_DEVICE_ID_APPLE_WELLSPRING4_JIS 0x0241 +/* MacbookAir3,1 (unibody), aka wellspring4 */ +#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI 0x0242 +#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO 0x0243 +#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS 0x0244#define BCM5974_DEVICE (prod) { \ .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \
@@ -80,6 +88,14 @@BCM5974_DEVICE (USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI ),BCM5974_DEVICE (USB_DEVICE_ID_APPLE_WELLSPRING3_ISO ),BCM5974_DEVICE (USB_DEVICE_ID_APPLE_WELLSPRING3_JIS ), +/* MacbookAir3,2 */ +BCM5974_DEVICE (USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI ), +BCM5974_DEVICE (USB_DEVICE_ID_APPLE_WELLSPRING4_ISO ), +BCM5974_DEVICE (USB_DEVICE_ID_APPLE_WELLSPRING4_JIS ), +/* MacbookAir3,1 */ +BCM5974_DEVICE (USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI ), +BCM5974_DEVICE (USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO ), + BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS), /* Terminating entry */ {} };
@@ -234,6 +250,30 @@ { DIM_X, DIM_X / SN_COORD, -4460, 5166 }, { DIM_Y, DIM_Y / SN_COORD, -75, 6700 } }, + { +USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI , +USB_DEVICE_ID_APPLE_WELLSPRING4_ISO , +USB_DEVICE_ID_APPLE_WELLSPRING4_JIS , +HAS_INTEGRATED_BUTTON , +0x84 ,sizeof (struct bt_data ), +0x81 ,TYPE2 ,FINGER_TYPE2 ,FINGER_TYPE2 +SIZEOF_ALL_FINGERS , + { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, + { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, + { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, + { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } + }, + { +USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI , +USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO , +USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS , +HAS_INTEGRATED_BUTTON , +0x84 ,sizeof (struct bt_data ), +0x81 ,TYPE2 ,FINGER_TYPE2 ,FINGER_TYPE2 +SIZEOF_ALL_FINGERS , + { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, + { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, + { DIM_X, DIM_X / SN_COORD, -4616, 5112 }, + { DIM_Y, DIM_Y / SN_COORD, -142, 5234 } + }, {} };
Re: [PATCH] [232/275] nfsd: wrong index used in inner loop
In reply to Michael Tokarev31.03.2011 01:56, Michael Tokarev пишет:
Quoted 6 lines
Quoted 5 lines · Andi Kleen
2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Mi Jinlong <[email protected]>
Quoted 6 lines
Quoted 4 lines
commit
5a02ab7c3c4580f94d13c683721039855b67cda6upstream.We must not use dummy for index.
After the first index, READ32(dummy) will change dummy!!!!This is also in patch 180/275 (this one is 232/275).
Doh, so this 232/275 basically reverts that 180 and makes other change down the line, but keeps the subject intact. Especially useful that the two patches are so far away from each other (more than 50 patches in-between). Confusing :)
So both are actually needed, apparently.
Thanks!
/mjt
PATCH 46/275 ALSA: hda - Fix memory leaks in conexant jack arrays
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 70f7db11c45a313b23922cacf248c613c3b2144c upstream.
The Conexant codec driver adds the jack arrays in init callback which may be called also in each PM resume. This results in the addition of new jack element at each time.
The fix is to check whether the requested jack is already present in the array.
Reference: Novell bug 668929
https://bugzilla.novell.com/show_bug.cgi?id=668929
--- sound/pci/hda/patch_conexant.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
sound/pci/hda/patch_conexant.c +7 -1
@@ -391,10 +391,16 @@struct conexant_spec *spec;struct conexant_jack *jack;const char *name; -int err; +int i, err; spec = codec->spec;snd_array_init (&spec->jacks,sizeof (*jack),32 ); + + jack = spec->jacks.list; +for (i =0 ; i < spec->jacks.used; i++, jack++) +if (jack->nid == nid) +return 0 ;/* already present */ + jack =snd_array_new (&spec->jacks); name = (type ==SND_JACK_HEADPHONE ) ?"Headphone" :"Mic" ;
PATCH 42/275 radio-aimslab.c: Fix gcc 4.5+ bug
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Mauro Carvalho Chehab <[email protected]>
commit e3c92215198cb6aa00ad38db2780faa6b72e0a3f upstream.
gcc 4.5+ doesn't properly evaluate some inlined expressions. A previous patch were proposed by Andrew Morton using noinline. However, the entire inlined function is bogus, so let's just remove it and be happy.
--- drivers/media/radio/radio-aimslab.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-)
drivers/media/radio/radio-aimslab.c +6 -17
@@ -31,7 +31,6 @@#include <linux/module.h> /* Modules */ #include <linux/init.h> /* Initdata */ #include <linux/ioport.h> /* request_region */ -#include <linux/delay.h> /* udelay */ #include <linux/videodev2.h> /* kernel radio structs */ #include <linux/version.h> /* for KERNEL_VERSION MACRO */ #include <linux/io.h> /* outb, outb_p */
@@ -71,27 +70,17 @@/* local things */ -static void sleep_delay (long n) -{ -/* Sleep nicely for 'n' uS */ -int d = n /msecs_to_jiffies (1000 ); -if (!d) -udelay (n); -else -msleep (jiffies_to_msecs (d)); -} -static void rt_decvol (struct rtrack *rt) {outb (0x58 , rt->io);/* volume down + sigstr + on */ -sleep_delay (100000 ); +msleep (100 );outb (0xd8 , rt->io);/* volume steady + sigstr + on */ }static void rt_incvol (struct rtrack *rt) {outb (0x98 , rt->io);/* volume up + sigstr + on */ -sleep_delay (100000 ); +msleep (100 );outb (0xd8 , rt->io);/* volume steady + sigstr + on */ }
@@ -120,7 +109,7 @@if (vol ==0 ) {/* volume = 0 means mute the card */ outb (0x48 , rt->io);/* volume down but still "on" */ -sleep_delay (2000000 );/* make sure it's totally down */ +msleep (2000 );/* make sure it's totally down */ outb (0xd0 , rt->io);/* volume steady, off */ rt->curvol =0 ;/* track the volume state! */ mutex_unlock (&rt->lock);
@@ -155,7 +144,7 @@outb_p (128 +64 +16 +8 +1 , rt->io);/* on + wr-enable + data low */ outb_p (128 +64 +16 +8 +2 +1 , rt->io);/* clock */ } -sleep_delay (1000 ); +msleep (1 ); }static void send_1_byte (struct rtrack *rt)
@@ -169,7 +158,7 @@outb_p (128 +64 +16 +8 +4 +2 +1 , rt->io);/* clock */ } -sleep_delay (1000 ); +msleep (1 ); }static int rt_setfreq (struct rtrack *rt,unsigned long freq)
@@ -427,7 +416,7 @@/* this ensures that the volume is all the way down */ outb (0x48 , rt->io);/* volume down but still "on" */ -sleep_delay (2000000 );/* make sure it's totally down */ +msleep (2000 );/* make sure it's totally down */ outb (0xc0 , rt->io);/* steady volume, mute card */ return 0 ;
PATCH 41/275 mpt2sas: Kernel Panic during Large Topology discovery
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Kashyap, Desai <[email protected]>
commit 4224489f45b503f0a1f1cf310f76dc108f45689a upstream.
There was a configuration page timing out during the initial port enable at driver load time. The port enable would fail, and this would result in the driver unloading itself, meanwhile the driver was accessing freed memory in another context resulting in the panic. The fix is to prevent access to freed memory once the driver had issued the diag reset which woke up the sleeping port enable process. The routine _base_reset_handler was reorganized so the last sleeping process woken up was the port_enable.
--- drivers/scsi/mpt2sas/mpt2sas_base.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/scsi/mpt2sas/mpt2sas_base.c +11 -2
@@ -3736,6 +3736,8 @@static void _base_reset_handler (struct MPT2SAS_ADAPTER *ioc,int reset_phase) { +mpt2sas_scsih_reset_handler (ioc, reset_phase); +mpt2sas_ctl_reset_handler (ioc, reset_phase);switch (reset_phase) {case MPT2_IOC_PRE_RESET : dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: "
@@ -3766,8 +3768,6 @@ "MPT2_IOC_DONE_RESET\n", ioc->name, __func__));break ; } -mpt2sas_scsih_reset_handler (ioc, reset_phase); -mpt2sas_ctl_reset_handler (ioc, reset_phase); }/**
@@ -3821,6 +3821,7 @@ {int r;unsigned long flags; +u8 pe_complete = ioc->wait_for_port_enable_to_complete;dtmprintk (ioc,printk (MPT2SAS_DEBUG_FMT "%s: enter\n" , ioc->name, __func__));
@@ -3845,6 +3846,14 @@if (r) goto out;_base_reset_handler (ioc,MPT2_IOC_AFTER_RESET ); + +/* If this hard reset is called while port enable is active, then +* there is no reason to call make_ioc_operational +*/ +if (pe_complete) { + r = -EFAULT ; + goto out; + } r =_base_make_ioc_operational (ioc, sleep_flag);if (!r)_base_reset_handler (ioc,MPT2_IOC_DONE_RESET );
PATCH 38/275 libsas: fix runaway error handler problem
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: James Bottomley <[email protected]>
commit 9ee91f7fb550a4c82f82d9818e42493484c754af upstream.
libsas makes use of scsi_schedule_eh() but forgets to clear the host_eh_scheduled flag in its error handling routine. Because of this, the error handler thread never gets to sleep; it's constantly awake and trying to run the error routine leading to console spew and inability to run anything else (at least on a UP system). The fix is to clear the flag as we splice the work queue.
--- drivers/scsi/libsas/sas_scsi_host.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/libsas/sas_scsi_host.c +1 -0
@@ -649,6 +649,7 @@spin_lock_irqsave (shost->host_lock, flags);list_splice_init (&shost->eh_cmd_q, &eh_work_q); + shost->host_eh_scheduled =0 ;spin_unlock_irqrestore (shost->host_lock, flags);SAS_DPRINTK ("Enter %s\n" , __func__);
PATCH 40/275 mpt2sas: Correct resizing calculation for max_queue_depth
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Kashyap, Desai <[email protected]>
commit 11e1b961ab067ee3acaf723531da4d3f23e1d6f7 upstream.
The ioc->hba_queue_depth is not properly resized when the controller firmware reports that it supports more outstanding IO than what can be fit inside the reply descriptor pool depth. This is reproduced by setting the controller global credits larger than 30,000. The bug results in an incorrect sizing of the queues. The fix is to resize the queue_size by dividing queue_diff by two.
--- drivers/scsi/mpt2sas/mpt2sas_base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/mpt2sas/mpt2sas_base.c +3 -3
@@ -2050,9 +2050,9 @@/* adjust hba_queue_depth, reply_free_queue_depth, * and queue_size */ - ioc->hba_queue_depth -= queue_diff; - ioc->reply_free_queue_depth -= queue_diff; - queue_size -= queue_diff; + ioc->hba_queue_depth -= (queue_diff /2 ); + ioc->reply_free_queue_depth -= (queue_diff /2 ); + queue_size = facts->MaxReplyDescriptorPostQueueDepth; } ioc->reply_post_queue_depth = queue_size;
PATCH 36/275 ath9k: Fix bug in delimiter padding computation
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Vasanthakumar Thiagarajan <[email protected]>
commit 39ec2997c374b528cdbf65099b6d6b8593a67f7f upstream.
There is a roundng error in delimiter padding computation which causes severe throughput drop with some of AR9003.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +2 -2
@@ -174,8 +174,8 @@/* returns delimiter padding required given the packet length */ #define ATH_AGGR_GET_NDELIM (_len) \ - (((((_len) + ATH_AGGR_DELIM_SZ) < ATH_AGGR_MINPLEN) ? \ - (ATH_AGGR_MINPLEN - (_len) - ATH_AGGR_DELIM_SZ) : 0) >> 2) + (((_len) >= ATH_AGGR_MINPLEN) ? 0 : \ + DIV_ROUND_UP(ATH_AGGR_MINPLEN - (_len), ATH_AGGR_DELIM_SZ))#define BAW_WITHIN (_start, _bawsz, _seqno) \ ((((_seqno) - (_start)) & 4095) < (_bawsz))
PATCH 37/275 fix medium error problems with some arrays which can cause data corruption
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: James Bottomley <[email protected]>
commit a8733c7baf457b071528e385a0b7d4aaec79287c upstream.
Our current handling of medium error assumes that data is returned up to the bad sector. This assumption holds good for all disk devices, all DIF arrays and most ordinary arrays. However, an LSI array engine was recently discovered which reports a medium error without returning any data. This means that when we report good data up to the medium error, we've reported junk originally in the buffer as good. Worse, if the read consists of requested data plus a readahead, and the error occurs in readahead, we'll just strip off the readahead and report junk up to userspace as good data with no error.
The fix for this is to have the error position computation take into account the amount of data returned by the driver using the scsi residual data. Unfortunately, not every driver fills in this data, but for those who don't, it's set to zero, which means we'll think a full set of data was transferred and the behaviour will be identical to the prior behaviour of the code (believe the buffer up to the error sector). All modern drivers seem to set the residual, so that should fix up the LSI failure/corruption case.
--- drivers/scsi/sd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/scsi/sd.c +8 -1
@@ -1111,6 +1111,12 @@u64 end_lba =blk_rq_pos (scmd->request) + (scsi_bufflen (scmd) /512 );u64 bad_lba;int info_valid; +/* +* resid is optional but mostly filled in. When it's unused, +* its value is zero, so we assume the whole buffer transferred +*/ +unsigned int transferred =scsi_bufflen (scmd) -scsi_get_resid (scmd); +unsigned int good_bytes;if (!blk_fs_request (scmd->request))return 0 ;
@@ -1144,7 +1150,8 @@/* This computation should always be done in terms of * the resolution of the device's medium. */ -return (bad_lba - start_lba) * scmd->device->sector_size; + good_bytes = (bad_lba - start_lba) * scmd->device->sector_size; +return min (good_bytes, transferred); }/**
PATCH 28/275 USB: cdc-acm: Adding second ACM channel support for Nokia N8
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Arvid Ephraim Picciani <[email protected]>
commit 721d92fc6373dee15846216f9d178ec240ec0fd7 upstream.
This adds the N8 to the list of devices in cdc-acm, in order to get the secondary ACM device exposed.
In the spirit of:
http://kerneltrap.org/mailarchive/linux-usb/2010/9/4/6264554
--- drivers/usb/class/cdc-acm.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/class/cdc-acm.c +1 -0
@@ -1613,6 +1613,7 @@ { NOKIA_PCSUITE_ACM_INFO(0x0154), }, /* Nokia 5800 XpressMusic */ { NOKIA_PCSUITE_ACM_INFO(0x04ce), }, /* Nokia E90 */ { NOKIA_PCSUITE_ACM_INFO(0x01d4), }, /* Nokia E55 */ + { NOKIA_PCSUITE_ACM_INFO(0x0302), }, /* Nokia N8 */ { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) *//* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */
PATCH 39/275 mpt2sas: Fix device removal handshake for zoned devices
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Kashyap, Desai <[email protected]>
commit 4dc2757a2e9a9d1f2faee4fc6119276fc0061c16 upstream.
When zoning end devices, the driver is not sending device removal handshake alogrithm to firmware. This results in controller firmware not sending sas topology add events the next time the device is added. The fix is the driver should be doing the device removal handshake even though the PHYSTATUS_VACANT bit is set in the PhyStatus of the event data. The current design is avoiding the handshake when the VACANT bit is set in the phy status.
--- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 3 --- 1 file changed, 3 deletions(-)
drivers/scsi/mpt2sas/mpt2sas_scsih.c +0 -3
@@ -2759,9 +2759,6 @@u16 handle;for (i =0 ; i < event_data->NumEntries; i++) { -if (event_data->PHY[i].PhyStatus & -MPI2_EVENT_SAS_TOPO_PHYSTATUS_VACANT ) -continue ; handle =le16_to_cpu (event_data->PHY[i].AttachedDevHandle);if (!handle)continue ;
PATCH 23/275 USB: g_printer: fix bug in module parameter definitions
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit ad84e4a9efb7c8ed322bafb6ebdb9c3a49a3d3a8 upstream.
This patch (as1442) fixes a bug in g_printer: Module parameters should not be marked "__initdata" if they are accessible in sysfs (i.e., if the mode value in the module_param() macro is nonzero). Otherwise attempts to access the parameters will cause addressing violations.
Character-string module parameters must not be marked "__initdata" if the module can be unloaded, because the kernel needs to access the parameter variable at unload time in order to free the dynamically-allocated string.
--- drivers/usb/gadget/printer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/usb/gadget/printer.c +7 -7
@@ -130,31 +130,31 @@* parameters are in UTF-8 (superset of ASCII's 7 bit characters). */ -static ushort __initdata idVendor; +static ushort idVendor;module_param (idVendor, ushort,S_IRUGO );MODULE_PARM_DESC (idVendor,"USB Vendor ID" ); -static ushort __initdata idProduct; +static ushort idProduct;module_param (idProduct, ushort,S_IRUGO );MODULE_PARM_DESC (idProduct,"USB Product ID" ); -static ushort __initdata bcdDevice; +static ushort bcdDevice;module_param (bcdDevice, ushort,S_IRUGO );MODULE_PARM_DESC (bcdDevice,"USB Device version (BCD)" ); -static char *__initdata iManufacturer; +static char *iManufacturer;module_param (iManufacturer, charp,S_IRUGO );MODULE_PARM_DESC (iManufacturer,"USB Manufacturer string" ); -static char *__initdata iProduct; +static char *iProduct;module_param (iProduct, charp,S_IRUGO );MODULE_PARM_DESC (iProduct,"USB Product string" ); -static char *__initdata iSerialNum; +static char *iSerialNum;module_param (iSerialNum, charp,S_IRUGO );MODULE_PARM_DESC (iSerialNum,"1" ); -static char *__initdata iPNPstring; +static char *iPNPstring;module_param (iPNPstring, charp,S_IRUGO );MODULE_PARM_DESC (iPNPstring,"MFG:linux;MDL:g_printer;CLS:PRINTER;SN:1;" );
PATCH 15/275 USB: usb-storage: unusual_devs update for Cypress ATACB
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Richard Schütz <[email protected]>
commit cae41118f50ef0c431e13159df6d7dd8bbd54004 upstream.
New device ID added for unusual Cypress ATACB device.
--- drivers/usb/storage/unusual_cypress.h | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/storage/unusual_cypress.h +5 -0
@@ -31,4 +31,9 @@ "Cypress ISD-300LP", US_SC_CYP_ATACB, US_PR_DEVICE, NULL, 0), +UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x9999, + "Super Top", + "USB 2.0 SATA BRIDGE", + US_SC_CYP_ATACB, US_PR_DEVICE, NULL, 0), +#endif /* defined(CONFIG_USB_STORAGE_CYPRESS_ATACB) || ... */
PATCH 13/275 USB: CP210x Add two device IDs
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Craig Shelley <[email protected]>
commit faea63f7ccfddfb8fc19798799fcd38c58415172 upstream.
Device Ids added for IRZ Automation Teleport SG-10 GSM/GPRS Modem and DekTec DTA Plus VHF/UHF Booster/Attenuator.
--- drivers/usb/serial/cp210x.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/cp210x.c +2 -0
@@ -108,7 +108,9 @@ { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */ { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ + { USB_DEVICE(0x10C4, 0x83D8) }, /* DekTec DTA Plus VHF/UHF Booster/Attenuator */ { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ + { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */ { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
PATCH 35/275 iwlagn: enable only rfkill interrupt when device is down
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit 554d1d027b19265c4aa3f718b3126d2b86e09a08 upstream.
Since commit 6cd0b1cb872b3bf9fc5de4536404206ab74bafdd "iwlagn: fix hw-rfkill while the interface is down", we enable interrupts when device is not ready to receive them. However hardware, when it is in some inconsistent state, can generate other than rfkill interrupts and crash the system. I can reproduce crash with "kernel BUG at drivers/net/wireless/iwlwifi/iwl-agn.c:1010!" message, when forcing firmware restarts.
To fix only enable rfkill interrupt when down device and after probe. I checked patch on laptop with 5100 device, rfkill change is still passed to user space when device is down.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 9 +++++---- drivers/net/wireless/iwlwifi/iwl-helpers.h | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +5 -4
@@ -3112,9 +3112,10 @@flush_workqueue (priv->workqueue); -/* enable interrupts again in order to receive rfkill changes */ +/* User space software may expect getting rfkill changes +* even if interface is down */ iwl_write32 (priv,CSR_INT ,0xFFFFFFFF ); -iwl_enable_interrupts (priv); +iwl_enable_rfkill_int (priv);IWL_DEBUG_MAC80211 (priv,"leave\n" ); }
@@ -3832,14 +3833,14 @@* 8. Enable interrupts and read RFKILL state *********************************************/ -/* enable interrupts if needed: hw bug w/a */ +/* enable rfkill interrupt: hw bug w/a */ pci_read_config_word (priv->pci_dev,PCI_COMMAND , &pci_cmd);if (pci_cmd &PCI_COMMAND_INTX_DISABLE ) { pci_cmd &= ~PCI_COMMAND_INTX_DISABLE ;pci_write_config_word (priv->pci_dev,PCI_COMMAND , pci_cmd); } -iwl_enable_interrupts (priv); +iwl_enable_rfkill_int (priv);/* If platform's RF_KILL switch is NOT set to KILL */ if (iwl_read32 (priv,CSR_GP_CNTRL ) &CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW )
drivers/net/wireless/iwlwifi/iwl-helpers.h +6 -0
@@ -163,6 +163,12 @@IWL_DEBUG_ISR (priv,"Disabled interrupts\n" ); } +static inline void iwl_enable_rfkill_int (struct iwl_priv *priv) +{ +IWL_DEBUG_ISR (priv,"Enabling rfkill interrupt\n" ); +iwl_write32 (priv,CSR_INT_MASK ,CSR_INT_BIT_RF_KILL ); +} +static inline void iwl_enable_interrupts (struct iwl_priv *priv) {IWL_DEBUG_ISR (priv,"Enabling interrupts\n" );
PATCH 12/275 USB: serial: handle Data Carrier Detect changes
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Libor Pechacek <[email protected]>
commit d14fc1a74e846d7851f24fc9519fe87dc12a1231 upstream.
Alan's commit 335f8514f200e63d689113d29cb7253a5c282967 introduced .carrier_raised function in several drivers. That also means tty_port_block_til_ready can now suspend the process trying to open the serial port when Carrier Detect is low and put it into tty_port.open_wait queue. We need to wake up the process when Carrier Detect goes high and trigger TTY hangup when CD goes low.
Some of the devices do not report modem status line changes, or at least we don't understand the status message, so for those we remove .carrier_raised again.
--- drivers/usb/serial/ch341.c | 10 ++++++++++ drivers/usb/serial/cp210x.c | 11 ----------- drivers/usb/serial/digi_acceleport.c | 10 ---------- drivers/usb/serial/generic.c | 20 ++++++++++++++++++++ drivers/usb/serial/keyspan_pda.c | 17 ----------------- drivers/usb/serial/pl2303.c | 11 +++++++++++ drivers/usb/serial/spcp8x5.c | 5 ++++- include/linux/usb/serial.h | 3 +++ 8 files changed, 48 insertions(+), 39 deletions(-)
drivers/usb/serial/ch341.c +10 -0
@@ -486,12 +486,22 @@if (actual_length >=4 ) {struct ch341_private *priv =usb_get_serial_port_data (port);unsigned long flags; +u8 prev_line_status = priv->line_status;spin_lock_irqsave (&priv->lock, flags); priv->line_status = (~(data[2 ])) &CH341_BITS_MODEM_STAT ;if ((data[1 ] &CH341_MULT_STAT )) priv->multi_status_change =1 ;spin_unlock_irqrestore (&priv->lock, flags); + +if ((priv->line_status ^ prev_line_status) &CH341_BIT_DCD ) { +struct tty_struct *tty =tty_port_tty_get (&port->port); +if (tty) +usb_serial_handle_dcd_change (port, tty, + priv->line_status &CH341_BIT_DCD ); +tty_kref_put (tty); + } +wake_up_interruptible (&priv->delta_msr_wait); }
drivers/usb/serial/cp210x.c +0 -11
@@ -49,7 +49,6 @@static void cp210x_break_ctl (struct tty_struct *,int );static int cp210x_startup (struct usb_serial *);static void cp210x_dtr_rts (struct usb_serial_port *p,int on); -static int cp210x_carrier_raised (struct usb_serial_port *p);static int debug;
@@ -165,7 +164,6 @@ .tiocmset = cp210x_tiocmset, .attach = cp210x_startup, .dtr_rts = cp210x_dtr_rts, - .carrier_raised = cp210x_carrier_raised };/* Config request types */
@@ -764,15 +762,6 @@return result; } -static int cp210x_carrier_raised (struct usb_serial_port *p) -{ -unsigned int control; -cp210x_get_config (p,CP210X_GET_MDMSTS , &control,1 ); -if (control &CONTROL_DCD ) -return 1 ; -return 0 ; -} -static void cp210x_break_ctl (struct tty_struct *tty,int break_state) {struct usb_serial_port *port = tty->driver_data;
drivers/usb/serial/digi_acceleport.c +0 -10
@@ -455,7 +455,6 @@static int digi_chars_in_buffer (struct tty_struct *tty);static int digi_open (struct tty_struct *tty,struct usb_serial_port *port);static void digi_close (struct usb_serial_port *port); -static int digi_carrier_raised (struct usb_serial_port *port);static void digi_dtr_rts (struct usb_serial_port *port,int on);static int digi_startup_device (struct usb_serial *serial);static int digi_startup (struct usb_serial *serial);
@@ -511,7 +510,6 @@ .open = digi_open, .close = digi_close, .dtr_rts = digi_dtr_rts, - .carrier_raised = digi_carrier_raised, .write = digi_write, .write_room = digi_write_room, .write_bulk_callback = digi_write_bulk_callback,
@@ -1337,14 +1335,6 @@digi_set_modem_signals (port, on * (TIOCM_DTR |TIOCM_RTS ),1 ); } -static int digi_carrier_raised (struct usb_serial_port *port) -{ -struct digi_port *priv =usb_get_serial_port_data (port); -if (priv->dp_modem_signals &TIOCM_CD ) -return 1 ; -return 0 ; -} -static int digi_open (struct tty_struct *tty,struct usb_serial_port *port) {int ret;
drivers/usb/serial/generic.c +20 -0
@@ -481,6 +481,26 @@ }EXPORT_SYMBOL_GPL (usb_serial_handle_break); +/** +* usb_serial_handle_dcd_change - handle a change of carrier detect state +* @port: usb_serial_port structure for the open port +* @tty: tty_struct structure for the port +* @status: new carrier detect status, nonzero if active +*/ +void usb_serial_handle_dcd_change (struct usb_serial_port *usb_port, +struct tty_struct *tty,unsigned int status) +{ +struct tty_port *port = &usb_port->port; + +dbg ("%s - port %d, status %d" , __func__, usb_port->number, status); + +if (status) +wake_up_interruptible (&port->open_wait); +else if (tty && !C_CLOCAL (tty)) +tty_hangup (tty); +} +EXPORT_SYMBOL_GPL (usb_serial_handle_dcd_change); +int usb_serial_generic_resume (struct usb_serial *serial) {struct usb_serial_port *port;
drivers/usb/serial/keyspan_pda.c +0 -17
@@ -680,22 +680,6 @@ } } -static int keyspan_pda_carrier_raised (struct usb_serial_port *port) -{ -struct usb_serial *serial = port->serial; -unsigned char modembits; - -/* If we can read the modem status and the DCD is low then -carrier is not raised yet */ -if (keyspan_pda_get_modem_info (serial, &modembits) >=0 ) { -if (!(modembits & (1 >>6 ))) -return 0 ; - } -/* Carrier raised, or we failed (eg disconnected) so -progress accordingly */ -return 1 ; -} -static int keyspan_pda_open (struct tty_struct *tty,struct usb_serial_port *port)
@@ -882,7 +866,6 @@ .id_table = id_table_std, .num_ports = 1, .dtr_rts = keyspan_pda_dtr_rts, - .carrier_raised = keyspan_pda_carrier_raised, .open = keyspan_pda_open, .close = keyspan_pda_close, .write = keyspan_pda_write,
drivers/usb/serial/pl2303.c +11 -0
@@ -677,9 +677,11 @@ {struct pl2303_private *priv =usb_get_serial_port_data (port); +struct tty_struct *tty;unsigned long flags;u8 status_idx =UART_STATE ;u8 length =UART_STATE +1 ; +u8 prev_line_status;u16 idv, idp; idv =le16_to_cpu (port->serial->dev->descriptor.idVendor);
@@ -701,11 +703,20 @@/* Save off the uart status for others to look at */ spin_lock_irqsave (&priv->lock, flags); + prev_line_status = priv->line_status; priv->line_status = data[status_idx];spin_unlock_irqrestore (&priv->lock, flags);if (priv->line_status &UART_BREAK_ERROR )usb_serial_handle_break (port);wake_up_interruptible (&priv->delta_msr_wait); + + tty =tty_port_tty_get (&port->port); +if (!tty) +return ; +if ((priv->line_status ^ prev_line_status) &UART_DCD ) +usb_serial_handle_dcd_change (port, tty, + priv->line_status &UART_DCD ); +tty_kref_put (tty); }static void pl2303_read_int_callback (struct urb *urb)
drivers/usb/serial/spcp8x5.c +4 -1
@@ -133,7 +133,7 @@/* how come ??? */ #define UART_STATE 0x08 -#define UART_STATE_TRANSIENT_MASK 0x74 +#define UART_STATE_TRANSIENT_MASK 0x75#define UART_DCD 0x01#define UART_DSR 0x02#define UART_BREAK_ERROR 0x04
@@ -531,6 +531,9 @@tty_insert_flip_string_fixed_flag (tty, data, tty_flag, urb->actual_length);tty_flip_buffer_push (tty); +if (status &UART_DCD ) +usb_serial_handle_dcd_change (port, tty, + priv->line_status &MSR_STATUS_LINE_DCD );tty_kref_put (tty); }
include/linux/usb/serial.h +3 -0
@@ -346,6 +346,9 @@struct usb_serial_port *port, unsigned int ch);extern int usb_serial_handle_break (struct usb_serial_port *port); +extern void usb_serial_handle_dcd_change (struct usb_serial_port *usb_port, +struct tty_struct *tty, +unsigned int status);extern int usb_serial_bus_register (struct usb_serial_driver *device);
PATCH 34/275 staging: hv: Enable sending GARP packet after live migration
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Haiyang Zhang <[email protected]>
commit 7c161d0b900ea9bd9fc5ea5d3fa9916e9eb0dd88 upstream.
The hv_netvsc gets RNDIS_STATUS_MEDIA_CONNECT event after the VM is live migrated. Adding call to netif_notify_peers() for this event to send GARP (Gratuitous ARP) to notify network peers. Otherwise, the VM's network connection may stop after a live migration.
This patch should also be applied to stable kernel 2.6.32 and later.
--- drivers/staging/hv/netvsc_drv.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/hv/netvsc_drv.c +1 -0
@@ -249,6 +249,7 @@if (status ==1 ) {netif_carrier_on (net);netif_wake_queue (net); +netif_notify_peers (net); }else {netif_carrier_off (net);netif_stop_queue (net);
PATCH 11/275 hwmon: (via686a) Initialize fan_div values
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <[email protected]>
commit f790674d3f87df6390828ac21a7d1530f71b59c8 upstream.
Functions set_fan_min() and set_fan_div() assume that the fan_div values have already been read from the register. The driver currently doesn't initialize them at load time, they are only set when function via686a_update_device() is called. This means that set_fan_min() and set_fan_div() misbehave if, for example, "sensors -s" is called before any monitoring application (e.g. "sensors") is has been run.
Fix the problem by always initializing the fan_div values at device bind time.
--- drivers/hwmon/via686a.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/hwmon/via686a.c +11 -3
@@ -687,6 +687,13 @@return 0 ; } +static void via686a_update_fan_div (struct via686a_data *data) +{ +int reg =via686a_read_value (data,VIA686A_REG_FANDIV ); + data->fan_div[0 ] = (reg >>4 ) &0x03 ; + data->fan_div[1 ] = reg >>6 ; +} +static void __devinit via686a_init_device (struct via686a_data *data) {u8 reg;
@@ -700,6 +707,9 @@via686a_write_value (data,VIA686A_REG_TEMP_MODE , (reg & ~VIA686A_TEMP_MODE_MASK ) |VIA686A_TEMP_MODE_CONTINUOUS ); + +/* Pre-read fan clock divisor values */ +via686a_update_fan_div (data); }static struct via686a_data *via686a_update_device (struct device *dev)
@@ -751,9 +761,7 @@ (via686a_read_value (data,VIA686A_REG_TEMP_LOW23 ) &0xc0 ) >>6 ; - i =via686a_read_value (data,VIA686A_REG_FANDIV ); - data->fan_div[0 ] = (i >>4 ) &0x03 ; - data->fan_div[1 ] = i >>6 ; +via686a_update_fan_div (data); data->alarms =via686a_read_value (data, VIA686A_REG_ALARM1) |
PATCH 33/275 Staging: hv: fix sysfs symlink on hv block device
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Ky Srinivasan <[email protected]>
commit 268eff909afaca93188d2d14554cbf824f6a0e41 upstream.
The block device does not create the proper symlink in sysfs because we forgot to set up the gendisk structure properly. This patch fixes the issue.
--- drivers/staging/hv/blkvsc_drv.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/hv/blkvsc_drv.c +1 -0
@@ -378,6 +378,7 @@ blkdev->gd->first_minor =0 ; blkdev->gd->fops = &block_ops; blkdev->gd->private_data = blkdev; + blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device);sprintf (blkdev->gd->disk_name,"hd%c" ,'a' + devnum);blkvsc_do_inquiry (blkdev);
PATCH 32/275 staging: comedi: ni_labpc: Use shared IRQ for PCMCIA card
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
commit d1ce318496f5943d2cc5e20171fc383a59a1421f upstream.
The ni_labpc driver module only requests a shared IRQ for PCI devices, requesting a non-shared IRQ for non-PCI devices.
As this module is also used by the ni_labpc_cs module for certain National Instruments PCMCIA cards, it also needs to request a shared IRQ for PCMCIA devices, otherwise you get a IRQ mismatch with the CardBus controller.
--- drivers/staging/comedi/drivers/ni_labpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/comedi/drivers/ni_labpc.c +2 -1
@@ -571,7 +571,8 @@/* grab our IRQ */ if (irq) { isr_flags =0 ; -if (thisboard->bustype == pci_bustype) +if (thisboard->bustype == pci_bustype + || thisboard->bustype == pcmcia_bustype) isr_flags |=IRQF_SHARED ;if (request_irq (irq, labpc_interrupt, isr_flags, driver_labpc.driver_name, dev)) {
PATCH 29/275 USB: ftdi_sio: Add VID=0x0647, PID=0x0100 for Acton Research spectrograph
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Michael Williamson <[email protected]>
commit 28fe2eb0162a1d23370dd99ff7d0e35632b1ee91 upstream.
Add the USB Vendor ID and Product ID for a Acton Research Corp. spectrograph device with a FTDI chip for serial I/O.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 7 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -620,6 +620,7 @@ { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, + { USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) }, { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) },
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -518,6 +518,12 @@#define RATOC_PRODUCT_ID_USB60F 0xb020/* +* Acton Research Corp. +*/ +#define ACTON_VID 0x0647/* Vendor ID */ +#define ACTON_SPECTRAPRO_PID 0x0100 + +/* * Contec products (http://www.contec.com) * Submitted by Daniel Sangorrin */
PATCH 20/275 USB: adding USB support for Cinterion's HC2x, EU3 and PH8 products
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Nicolaus Colberg <[email protected]>
commit aa52b3a92918039b273fc9d1994bd34227c40269 upstream.
/drivers/usb/serial/option.c: Adding support for Cinterion's HC25, HC28, HC28J, EU3-E, EU3-P and PH8 by correcting/adding Cinterion's and Siemens' Vendor IDs as well as Product IDs and USB_DEVICE tuples
--- drivers/usb/serial/option.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/usb/serial/option.c +21 -2
@@ -362,7 +362,16 @@#define HAIER_VENDOR_ID 0x201e#define HAIER_PRODUCT_CE100 0x2009 -#define CINTERION_VENDOR_ID 0x0681 +/* Cinterion (formerly Siemens) products */ +#define SIEMENS_VENDOR_ID 0x0681 +#define CINTERION_VENDOR_ID 0x1e2d +#define CINTERION_PRODUCT_HC25_MDM 0x0047 +#define CINTERION_PRODUCT_HC25_MDMNET 0x0040 +#define CINTERION_PRODUCT_HC28_MDM 0x004C +#define CINTERION_PRODUCT_HC28_MDMNET 0x004A/* same for HC28J */ +#define CINTERION_PRODUCT_EU3_E 0x0051 +#define CINTERION_PRODUCT_EU3_P 0x0052 +#define CINTERION_PRODUCT_PH8 0x0053/* Olivetti products */ #define OLIVETTI_VENDOR_ID 0x0b3c
@@ -912,7 +921,17 @@ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, - { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) }, +/* Cinterion */ + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) }, + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ { } /* Terminating entry */
PATCH 27/275 USB: ftdi_sio: add ST Micro Connect Lite uart support
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
commit 6ec2f46c4b4abf48c88c0ae7c476f347b97e1105 upstream.
on ST Micro Connect Lite we have 4 port
Part A and B for the JTAG
Port C Uart
Port D for PIO
--- drivers/usb/serial/ftdi_sio.c | 26 ++++++++++++++++++++++++++ drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 32 insertions(+)
drivers/usb/serial/ftdi_sio.c +26 -0
@@ -99,6 +99,7 @@static int ftdi_jtag_probe (struct usb_serial *serial);static int ftdi_mtxorb_hack_setup (struct usb_serial *serial);static int ftdi_NDI_device_setup (struct usb_serial *serial); +static int ftdi_stmclite_probe (struct usb_serial *serial);static void ftdi_USB_UIRT_setup (struct ftdi_private *priv);static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv);
@@ -122,6 +123,10 @@ .port_probe = ftdi_HE_TIRA1_setup, }; +static struct ftdi_sio_quirk ftdi_stmclite_quirk = { + .probe = ftdi_stmclite_probe, +}; +/* * The 8U232AM has the same API as the sio except for: * - it can support MUCH higher baudrates; up to:
@@ -809,6 +814,8 @@ { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(ST_VID, ST_STMCLT1030_PID), + .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, { }, /* Optional parameter entry */ { } /* Terminating entry */ };
@@ -1690,6 +1697,25 @@ }/* +* First and second port on STMCLiteadaptors is reserved for JTAG interface +* and the forth port for pio +*/ +static int ftdi_stmclite_probe (struct usb_serial *serial) +{ +struct usb_device *udev = serial->dev; +struct usb_interface *interface = serial->interface; + +dbg ("%s" , __func__); + +if (interface == udev->actconfig->interface[2 ]) +return 0 ; + +dev_info (&udev->dev,"Ignoring serial port reserved for JTAG\n" ); + +return -ENODEV ; +} + +/* * The Matrix Orbital VK204-25-USB has an invalid IN endpoint. * We have to correct it if we want to read from it. */
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -1034,6 +1034,12 @@#define WHT_PID 0x0004/* Wireless Handheld Terminal */ /* +* STMicroelectonics +*/ +#define ST_VID 0x0483 +#define ST_STMCLT1030_PID 0x3747/* ST Micro Connect Lite STMCLT1030 */ + +/* * Papouch products (http://www.papouch.com/) * Submitted by Folkert van Heusden */
PATCH 7/275 staging: usbip: remove double giveback of URB
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?M=C3=A1rton=20N=C3=A9meth?= <[email protected]>
commit 7571f089d7522a95c103558faf313c7af8856ceb upstream.
In the vhci_urb_dequeue() function the TCP connection is checked twice. Each time when the TCP connection is closed the URB is unlinked and given back. Remove the second attempt of unlinking and giving back of the URB completely.
This patch fixes the bug described at https://bugzilla.kernel.org/show_bug.cgi?id=24872 .
--- drivers/staging/usbip/vhci_hcd.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/staging/usbip/vhci_hcd.c +0 -14
@@ -799,20 +799,6 @@spin_unlock_irqrestore (&vdev->priv_lock, flags2); } - -if (!vdev->ud.tcp_socket) { -/* tcp connection is closed */ -usbip_uinfo ("vhci_hcd: vhci_urb_dequeue() gives back urb %p\n" , - urb); - -usb_hcd_unlink_urb_from_ep (hcd, urb); - -spin_unlock_irqrestore (&the_controller->lock, flags); -usb_hcd_giveback_urb (vhci_to_hcd (the_controller), urb, - urb->status); -spin_lock_irqsave (&the_controller->lock, flags); - } -spin_unlock_irqrestore (&the_controller->lock, flags);usbip_dbg_vhci_hc ("leave\n" );
PATCH 6/275 Fix cred leak in AF_NETLINK
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
Patch cab9e9848b9a8283b0504a2d7c435a9f5ba026de to the 2.6.35.y stable tree stored a ref to the current cred struct in struct scm_cookie. This was fine with AF_UNIX as that calls scm_destroy() from its packet sending functions, but AF_NETLINK, which also uses scm_send(), does not call scm_destroy() - meaning that the copied credentials leak each time SCM data is sent over a netlink socket.
This can be triggered quite simply on a Fedora 13 or 14 userspace with the 2.6.35.11 kernel (or something based off of that) by calling:
#!/bin/bash
for ((i=0; i<100; i++))
do
su - -c /bin/true
cut -d: -f1 /proc/slabinfo | grep 'cred\|key\|task_struct' cat /proc/keys | wc -l
done
This leaks the session key that pam_keyinit creates for 'su -', which appears in /proc/keys as being revoked (has the R flag set against it) afterward su is called.
Furthermore, if CONFIG_SLAB=y, then the cred and key slab object usage counts can be viewed and seen to increase. The key slab increases by one object per loop, and this can be seen after the system has had a couple of minutes to stand after the script above has been run on it.
If the system is working correctly, the key and cred counts should return to roughly what they were before.
---
net/netlink/af_netlink.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
net/netlink/af_netlink.c +10 -4
@@ -1330,12 +1330,16 @@return err;if (msg->msg_namelen) { -if (addr->nl_family !=AF_NETLINK ) -return -EINVAL ; +if (addr->nl_family !=AF_NETLINK ) { + err = -EINVAL ; + goto out; + } dst_pid = addr->nl_pid; dst_group =ffs (addr->nl_groups); -if (dst_group && !netlink_capable (sock,NL_NONROOT_SEND )) -return -EPERM ; +if (dst_group && !netlink_capable (sock,NL_NONROOT_SEND )) { + err = -EPERM ; + goto out; + } }else { dst_pid = nlk->dst_pid; dst_group = nlk->dst_group;
@@ -1387,6 +1391,8 @@ err =netlink_unicast (sk, skb, dst_pid, msg->msg_flags&MSG_DONTWAIT ); out: +scm_destroy (siocb->scm); + siocb->scm =NULL ;return err; }
PATCH 5/275 thinkpad-acpi: avoid keymap pitfall
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Henrique de Moraes Holschuh <[email protected]>
[ upstream commit fc6e756894b703952fd277a1f98a5d93e7ba847a ]
Change the code so that it will use the correct size for keymap entries. Do it in a way that makes it harder to screw it up in the future.
--- drivers/platform/x86/thinkpad_acpi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +3 -2
@@ -3093,7 +3093,8 @@ TPACPI_Q_IBM('1', 'D', TPACPI_HK_Q_INIMASK), /* X22, X23, X24 */ }; -typedef u16 tpacpi_keymap_t [TPACPI_HOTKEY_MAP_LEN ]; +typedef u16 tpacpi_keymap_entry_t ; +typedef tpacpi_keymap_entry_t tpacpi_keymap_t [TPACPI_HOTKEY_MAP_LEN ];static int __init hotkey_init (struct ibm_init_struct *iibm) {
@@ -3230,7 +3231,7 @@ };#define TPACPI_HOTKEY_MAP_SIZE sizeof(tpacpi_keymap_t) -#define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(tpacpi_keymap_t[0]) +#define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(tpacpi_keymap_entry_t)int res, i;int status;
PATCH 24/275 USB: io_edgeport: fix the reported firmware major and minor
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit 271c1150b4f8e1685e5a8cbf76e329ec894481da upstream.
The major and minor number saved in the product_info structure were copied from the address instead of the data, causing an inconsistency in the reported versions during firmware loading:
usb 4-1: firmware: requesting edgeport/down.fw /usr/src/linux/drivers/usb/serial/io_edgeport.c: downloading firmware version (930) 1.16.4 [..]
/usr/src/linux/drivers/usb/serial/io_edgeport.c: edge_startup - time 3 4328191260
/usr/src/linux/drivers/usb/serial/io_edgeport.c: FirmwareMajorVersion 0.0.4
This can cause some confusion whether firmware loaded successfully or not.
--- drivers/usb/serial/io_edgeport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/serial/io_edgeport.c +2 -2
@@ -2894,8 +2894,8 @@dbg ("%s %d.%d.%d" , fw_info, rec->data[0 ], rec->data[1 ], build); - edge_serial->product_info.FirmwareMajorVersion = fw->data[0 ]; - edge_serial->product_info.FirmwareMinorVersion = fw->data[1 ]; + edge_serial->product_info.FirmwareMajorVersion = rec->data[0 ]; + edge_serial->product_info.FirmwareMinorVersion = rec->data[1 ]; edge_serial->product_info.FirmwareBuildNumber =cpu_to_le16 (build); for (rec = ihex_next_binrec(rec); rec;
PATCH 22/275 USB: EHCI: fix DMA deallocation bug
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit f75593ceaa08e6d27aec1a5de31cded19e850dd1 upstream.
This patch (as1440) fixes a bug in ehci-hcd. ehci->periodic_size is used to compute the size in a dma_alloc_coherent() call, but then it gets changed later on. As a result, the corresponding call to dma_free_coherent() passes a different size from the original allocation. Fix the problem by adjusting ehci->periodic_size before carrying out any of the memory allocations.
--- drivers/usb/host/ehci-hcd.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/usb/host/ehci-hcd.c +12 -7
@@ -544,6 +544,8 @@ ehci->iaa_watchdog.function = ehci_iaa_watchdog; ehci->iaa_watchdog.data = (unsigned long ) ehci; + hcc_params =ehci_readl (ehci, &ehci->caps->hcc_params); +/* * hw default: 1K periodic list heads, one per frame. * periodic_size can shrink by USBCMD update if hcc_params allows.
@@ -551,11 +553,20 @@ ehci->periodic_size =DEFAULT_I_TDPS ;INIT_LIST_HEAD (&ehci->cached_itd_list);INIT_LIST_HEAD (&ehci->cached_sitd_list); + +if (HCC_PGM_FRAMELISTLEN (hcc_params)) { +/* periodic schedule size can be smaller than default */ +switch (EHCI_TUNE_FLS ) { +case 0 : ehci->periodic_size =1024 ;break ; +case 1 : ehci->periodic_size =512 ;break ; +case 2 : ehci->periodic_size =256 ;break ; +default :BUG (); + } + }if ((retval =ehci_mem_init (ehci,GFP_KERNEL )) <0 )return retval;/* controllers may cache some of the periodic schedule ... */ - hcc_params =ehci_readl (ehci, &ehci->caps->hcc_params);if (HCC_ISOC_CACHE (hcc_params))// full frame cache ehci->i_thresh =2 +8 ;else // N microframes cached
@@ -604,12 +615,6 @@/* periodic schedule size can be smaller than default */ temp &= ~(3 <<2 ); temp |= (EHCI_TUNE_FLS <<2 ); -switch (EHCI_TUNE_FLS ) { -case 0 : ehci->periodic_size =1024 ;break ; -case 1 : ehci->periodic_size =512 ;break ; -case 2 : ehci->periodic_size =256 ;break ; -default :BUG (); - } } ehci->command = temp;
PATCH 21/275 USB: EHCI: ASPM quirk of ISOC on AMD Hudson
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alex He <[email protected]>
commit baab93afc2844b68d57b0dcca5e1d34c5d7cf411 upstream.
AMD Hudson also needs the same ASPM quirk as SB800
--- drivers/usb/host/ehci-pci.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-)
drivers/usb/host/ehci-pci.c +20 -13
@@ -41,28 +41,35 @@return 0 ; } -static int ehci_quirk_amd_SB800 (struct ehci_hcd *ehci) +static int ehci_quirk_amd_hudson (struct ehci_hcd *ehci) {struct pci_dev *amd_smbus_dev;u8 rev =0 ; amd_smbus_dev =pci_get_device (PCI_VENDOR_ID_ATI ,0x4385 ,NULL ); -if (!amd_smbus_dev) -return 0 ; - -pci_read_config_byte (amd_smbus_dev,PCI_REVISION_ID , &rev); -if (rev <0x40 ) { -pci_dev_put (amd_smbus_dev); - amd_smbus_dev =NULL ; -return 0 ; +if (amd_smbus_dev) { +pci_read_config_byte (amd_smbus_dev,PCI_REVISION_ID , &rev); +if (rev <0x40 ) { +pci_dev_put (amd_smbus_dev); + amd_smbus_dev =NULL ; +return 0 ; + } + }else { + amd_smbus_dev =pci_get_device (PCI_VENDOR_ID_AMD ,0x780b ,NULL ); +if (!amd_smbus_dev) +return 0 ; +pci_read_config_byte (amd_smbus_dev,PCI_REVISION_ID , &rev); +if (rev <0x11 || rev >0x18 ) { +pci_dev_put (amd_smbus_dev); + amd_smbus_dev =NULL ; +return 0 ; + } }if (!amd_nb_dev) amd_nb_dev =pci_get_device (PCI_VENDOR_ID_AMD ,0x1510 ,NULL ); -if (!amd_nb_dev) -ehci_err (ehci,"QUIRK: unable to get AMD NB device\n" ); -ehci_info (ehci,"QUIRK: Enable AMD SB800 L1 fix\n" ); +ehci_info (ehci,"QUIRK: Enable exception for AMD Hudson ASPM\n" );pci_dev_put (amd_smbus_dev); amd_smbus_dev =NULL ;
@@ -128,7 +135,7 @@/* cache this readonly data; minimize chip reads */ ehci->hcs_params =ehci_readl (ehci, &ehci->caps->hcs_params); -if (ehci_quirk_amd_SB800 (ehci)) +if (ehci_quirk_amd_hudson (ehci)) ehci->amd_l1_fix =1 ; retval =ehci_halt (ehci);
PATCH 16/275 USB: usb-storage: unusual_devs update for TrekStor DataStation maxi g.u external hard drive enclosure
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Richard=20Sch=C3=BCtz?= <[email protected]>
commit 7e1e7bd9dbd469267b6e6de1bf8d71a7d65ce86a upstream.
The TrekStor DataStation maxi g.u external hard drive enclosure uses a JMicron USB to SATA chip which needs the US_FL_IGNORE_RESIDUE flag to work properly.
--- drivers/usb/storage/unusual_devs.h | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/usb/storage/unusual_devs.h +9 -0
@@ -1866,6 +1866,15 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_BAD_SENSE ), +/* Patch by Richard Sch�tz <[email protected]> +* This external hard drive enclosure uses a JMicron chip which +* needs the US_FL_IGNORE_RESIDUE flag to work properly. */ +UNUSUAL_DEV (0x1e68 ,0x001b ,0x0000 ,0x0000 , +"TrekStor GmbH & Co. KG" , +"DataStation maxi g.u" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +US_FL_IGNORE_RESIDUE |US_FL_SANE_SENSE ), + UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001, "ST", "2A",
PATCH 3/275 thinkpad-acpi: add support for model-specific keymaps
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Henrique de Moraes Holschuh <[email protected]>
[ upstream commit d1e14dca6a18aa40394316c872993ae3bc7e311a ]
Use the quirks engine to select model-specific keymaps, which makes it much easier to extend should we need it.
Keycodes are based on the tables at
http://www.thinkwiki.org/wiki/Default_meanings_of_special_keys.
--- drivers/platform/x86/thinkpad_acpi.c | 60 ++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 18 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +42 -18
@@ -3093,6 +3093,8 @@ TPACPI_Q_IBM('1', 'D', TPACPI_HK_Q_INIMASK), /* X22, X23, X24 */ }; +typedef u16 tpacpi_keymap_t [TPACPI_HOTKEY_MAP_LEN ]; +static int __init hotkey_init (struct ibm_init_struct *iibm) {/* Requirements for changing the default keymaps:
@@ -3124,9 +3126,17 @@* If the above is too much to ask, don't change the keymap. * Ask the thinkpad-acpi maintainer to do it, instead. */ -static u16 ibm_keycode_map[TPACPI_HOTKEY_MAP_LEN ]__initdata = { + +enum keymap_index { +TPACPI_KEYMAP_IBM_GENERIC =0 , +TPACPI_KEYMAP_LENOVO_GENERIC , + }; + +static const tpacpi_keymap_t tpacpi_keymaps[]__initconst = { +/* Generic keymap for IBM ThinkPads */ + [TPACPI_KEYMAP_IBM_GENERIC ] = {/* Scan Codes 0x00 to 0x0B: ACPI HKEY FN+F1..F12 */ -KEY_FN_F1 ,KEY_FN_F2 ,KEY_COFFEE ,KEY_SLEEP , +KEY_FN_F1 ,KEY_BATTERY ,KEY_COFFEE ,KEY_SLEEP ,KEY_WLAN ,KEY_FN_F6 ,KEY_SWITCHVIDEOMODE ,KEY_FN_F8 ,KEY_FN_F9 ,KEY_FN_F10 ,KEY_FN_F11 ,KEY_SUSPEND ,
@@ -3157,8 +3167,10 @@/* (assignments unknown, please report if found) */ KEY_UNKNOWN ,KEY_UNKNOWN ,KEY_UNKNOWN ,KEY_UNKNOWN , KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, - }; -static u16 lenovo_keycode_map[TPACPI_HOTKEY_MAP_LEN ]__initdata = { + }, + +/* Generic keymap for Lenovo ThinkPads */ + [TPACPI_KEYMAP_LENOVO_GENERIC] = {/* Scan Codes 0x00 to 0x0B: ACPI HKEY FN+F1..F12 */ KEY_FN_F1 ,KEY_COFFEE ,KEY_BATTERY ,KEY_SLEEP , KEY_WLAN, KEY_FN_F6, KEY_SWITCHVIDEOMODE, KEY_FN_F8,
@@ -3200,10 +3212,25 @@/* (assignments unknown, please report if found) */ KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, + }, }; -#define TPACPI_HOTKEY_MAP_SIZE sizeof(ibm_keycode_map) -#define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(ibm_keycode_map[0]) +static const struct tpacpi_quirk tpacpi_keymap_qtable[]__initconst = { +/* Generic maps (fallback) */ + { + .vendor =PCI_VENDOR_ID_IBM , + .bios =TPACPI_MATCH_ANY , .ec =TPACPI_MATCH_ANY , + .quirks =TPACPI_KEYMAP_IBM_GENERIC , + }, + { + .vendor =PCI_VENDOR_ID_LENOVO , + .bios =TPACPI_MATCH_ANY , .ec =TPACPI_MATCH_ANY , + .quirks =TPACPI_KEYMAP_LENOVO_GENERIC , + }, + }; + +#define TPACPI_HOTKEY_MAP_SIZE sizeof(tpacpi_keymap_t) +#define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(tpacpi_keymap_t[0])int res, i;int status;
@@ -3212,6 +3239,7 @@bool tabletsw_state = false;unsigned long quirks; +unsigned long keymap_id;vdbg_printk (TPACPI_DBG_INIT |TPACPI_DBG_HKEY ,"initializing hotkey subdriver\n" );
@@ -3352,7 +3380,6 @@ goto err_exit;/* Set up key map */ - hotkey_keycode_map =kmalloc (TPACPI_HOTKEY_MAP_SIZE ,GFP_KERNEL );if (!hotkey_keycode_map) {
@@ -3362,17 +3389,14 @@ goto err_exit; } -if (tpacpi_is_lenovo ()) { -dbg_printk (TPACPI_DBG_INIT |TPACPI_DBG_HKEY , -"using Lenovo default hot key map\n" ); -memcpy (hotkey_keycode_map, &lenovo_keycode_map, -TPACPI_HOTKEY_MAP_SIZE ); - }else { -dbg_printk (TPACPI_DBG_INIT |TPACPI_DBG_HKEY , -"using IBM default hot key map\n" ); -memcpy (hotkey_keycode_map, &ibm_keycode_map, -TPACPI_HOTKEY_MAP_SIZE ); - } + keymap_id =tpacpi_check_quirks (tpacpi_keymap_qtable, +ARRAY_SIZE (tpacpi_keymap_qtable)); +BUG_ON (keymap_id >=ARRAY_SIZE (tpacpi_keymaps)); +dbg_printk (TPACPI_DBG_INIT |TPACPI_DBG_HKEY , +"using keymap number %lu\n" , keymap_id); + +memcpy (hotkey_keycode_map, &tpacpi_keymaps[keymap_id], +TPACPI_HOTKEY_MAP_SIZE );input_set_capability (tpacpi_inputdev,EV_MSC ,MSC_SCAN ); tpacpi_inputdev->keycodesize =TPACPI_HOTKEY_MAP_TYPESIZE ;
PATCH 2/275 thinkpad-acpi: lock down size of hotkey keymap
In reply to Andi Kleen2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Henrique de Moraes Holschuh <[email protected]>
[ upstream commit 34a656d22f5539f613b93e7a1d14b4bd53592505 ]
Use a safer coding style for the hotkey keymap. This does not fix any problems, as the current code is correct. But it might help avoid mistakes in the future.
--- drivers/platform/x86/thinkpad_acpi.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +15 -4
@@ -1911,6 +1911,17 @@TP_ACPI_HOTKEYSCAN_VOLUMEDOWN ,TP_ACPI_HOTKEYSCAN_MUTE ,TP_ACPI_HOTKEYSCAN_THINKPAD , +TP_ACPI_HOTKEYSCAN_UNK1 , +TP_ACPI_HOTKEYSCAN_UNK2 , +TP_ACPI_HOTKEYSCAN_UNK3 , +TP_ACPI_HOTKEYSCAN_UNK4 , +TP_ACPI_HOTKEYSCAN_UNK5 , +TP_ACPI_HOTKEYSCAN_UNK6 , +TP_ACPI_HOTKEYSCAN_UNK7 , +TP_ACPI_HOTKEYSCAN_UNK8 , + +/* Hotkey keymap size */ +TPACPI_HOTKEY_MAP_LEN }; enum { /* Keys/events available through NVRAM polling */
@@ -3113,7 +3124,7 @@* If the above is too much to ask, don't change the keymap. * Ask the thinkpad-acpi maintainer to do it, instead. */ -static u16 ibm_keycode_map[]__initdata = { +static u16 ibm_keycode_map[TPACPI_HOTKEY_MAP_LEN ]__initdata = {/* Scan Codes 0x00 to 0x0B: ACPI HKEY FN+F1..F12 */ KEY_FN_F1 ,KEY_FN_F2 ,KEY_COFFEE ,KEY_SLEEP ,KEY_WLAN ,KEY_FN_F6 ,KEY_SWITCHVIDEOMODE ,KEY_FN_F8 ,
@@ -3147,7 +3158,7 @@KEY_UNKNOWN ,KEY_UNKNOWN ,KEY_UNKNOWN ,KEY_UNKNOWN , KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, }; -static u16 lenovo_keycode_map[]__initdata = { +static u16 lenovo_keycode_map[TPACPI_HOTKEY_MAP_LEN ]__initdata = {/* Scan Codes 0x00 to 0x0B: ACPI HKEY FN+F1..F12 */ KEY_FN_F1 ,KEY_COFFEE ,KEY_BATTERY ,KEY_SLEEP , KEY_WLAN, KEY_FN_F6, KEY_SWITCHVIDEOMODE, KEY_FN_F8,
@@ -3191,7 +3202,6 @@ KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, }; -#define TPACPI_HOTKEY_MAP_LEN ARRAY_SIZE(ibm_keycode_map)#define TPACPI_HOTKEY_MAP_SIZE sizeof(ibm_keycode_map)#define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(ibm_keycode_map[0])
@@ -3469,7 +3479,8 @@ *send_acpi_ev = true; *ignore_acpi_ev = false; -if (scancode >0 && scancode <0x21 ) { +/* HKEY event 0x1001 is scancode 0x00 */ +if (scancode >0 && scancode <=TPACPI_HOTKEY_MAP_LEN ) { scancode--;if (!(hotkey_source_mask & (1 << scancode))) {tpacpi_input_send_key_masked (scancode);
Re: [PATCH] [232/275] nfsd: wrong index used in inner loop
In reply to Michael TokarevQuoted 7 lines
Doh, so this 232/275 basically reverts that 180 and makes other change down the line, but keeps the subject intact. Especially useful that the two patches are so far away from each other (more than 50 patches in-between). Confusing :)
So both are actually needed, apparently.
Sorry about that -- i ended up grabbing those from .32 and since there were multiple releases in sequence it ended up this way.
I can collapse the two patches.
Are the leftover hunks after that good?
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
Re: [PATCH] [226/275] Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code
In reply to Oleg NesterovQuoted 6 lines
If stable needs this change, then it probably needs
Relax si_code check in rt_sigqueueinfo and rt_tgsigqueueinfo commit 243b422af9ea9af4ead07a8ad54c90d4f9b6081aas well.
Added thanks.
BTW I think Greg would need that too for .32.
-Andi
Re: [PATCH] [226/275] Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code
Quoted 10 lines · Andi Kleen
Quoted 6 lines
If stable needs this change, then it probably needs
Relax
si_codecheck inrt_sigqueueinfoandrt_tgsigqueueinfocommit243b422af9ea9af4ead07a8ad54c90d4f9b6081aas well.
Added thanks.
BTW I think Greg would need that too for .32.
He has it already I think (thanks to Oleg).
Julien
Re: [PATCH] [225/275] x86: Cleanup highmap after brk is concluded
In reply to Andi KleenQuoted 15 lines · Andi Kleen
2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Yinghai Lu<[email protected]>commit
e5f15b45ddf3afa2bbbb10c7ea34fb32b6de0a0eupstream.Now
cleanup_highmapactually is in two steps: one is early inhead64.cand only clears above_end; a second one is ininit_memory_mapping()and tries to clean from_brk_endto_end.
It should check if those boundaries arePMD_SIZEaligned but currently does not.
Alsoinit_memory_mapping()is called several times for numa or memory hotplug, so we really should not handle initial kernel mappings there.
Quoted 4 lines
This patch moves
cleanup_highmap()down after_brk_endis settled so we can do everything in one step.
Also we honormax_pfn_mappedin the implementation ofcleanup_highmap.
gentoo guys reported this one cause resume freeze.
Re: [PATCH] [225/275] x86: Cleanup highmap after brk is concluded
Quoted 3 lines · Yinghai Lu
gentoo guys reported this one cause resume freeze.
thanks. dropped.
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
Re: [PATCH] [115/275] OHCI: work around for nVidia shutdown problem
In reply to Andi KleenHello,
please see comment 33 in LP bug tracker:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/42149
Maybe there are problem with this patch on new nvidia HW.
2011/3/30 Andi Kleen <[email protected]>:
Quoted 176 lines
2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>commit
3df7169e73fc1d71a39cffeacc969f6840cdf52bupstream.This patch (as1417) fixes a problem affecting some (or all) nVidia chipsets. When the computer is shut down, the OHCI controllers continue to power the USB buses and evidently they drive a Reset signal out all their ports. This prevents attached devices from going to low power. Mouse LEDs stay on, for example, which is disconcerting for users and a drain on laptop batteries.
The fix involves leaving each OHCI controller in the OPERATIONAL state during system shutdown rather than putting it in the RESET state. Although this nominally means the controller is running, in fact it's not doing very much since all the schedules are all disabled. However there is ongoing DMA to the Host Controller Communications Area, so the patch also disables the bus-master capability of all PCI USB controllers after the shutdown routine runs.
The fix is applied only to nVidia-based PCI OHCI controllers, so it shouldn't cause problems on systems using other hardware. As an added safety measure, in case the kernel encounters one of these running controllers during boot, the patch changes
quirk_usb_handoff_ohci()(which runs early on during PCI discovery) to reset the controller before anything bad can happen.Reported-by Pali Rohár <[email protected]>Signed-off-by Alan Stern <[email protected]>Signed-off-by Andi Kleen <[email protected]>CC David Brownell <[email protected]>Tested-by Pali Rohár <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>---
drivers/usb/core/hcd-pci.c | 4 +++-drivers/usb/host/ohci-hcd.c| 9 ++++++++-drivers/usb/host/ohci-pci.c| 18 ++++++++++++++++++drivers/usb/host/ohci.h| 1 +drivers/usb/host/pci-quirks.c| 18 +++++++++++-------5 files changed, 41 insertions(+), 9 deletions(-)Index:
linux-2.6.35.y/drivers/usb/core/hcd-pci.c
===================================================================drivers/usb/core/hcd-pci.c 2011-03-29 23:03:00.575285450 -0700 renamed from drivers/usb/core/hcd-pci.c 2011-03-29 22:51:22.609144656 -0700 +3
-1@@ -317,8 +317,10 @@ if (!hcd) return; - if (hcd->driver->shutdown) + if (hcd->driver->shutdown) { hcd->driver->shutdown(hcd); + pci_disable_device(dev); + } } EXPORT_SYMBOL_GPL(usb_hcd_pci_shutdown);Index:
linux-2.6.35.y/drivers/usb/host/ohci-hcd.c
===================================================================drivers/usb/host/ohci-hcd.c 2011-03-29 23:03:00.576285425 -0700 renamed from drivers/usb/host/ohci-hcd.c 2011-03-29 22:51:22.609144656 -0700 +8
-1@@ -398,7 +398,14 @@ ohci = hcd_to_ohci (hcd); ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); - ohci_usb_reset (ohci); + ohci->hc_control = ohci_readl(ohci, &ohci->regs->control); + + /* If the SHUTDOWN quirk is set, don't put the controller in RESET */ + ohci->hc_control &= (ohci->flags & OHCI_QUIRK_SHUTDOWN ? + OHCI_CTRL_RWC | OHCI_CTRL_HCFS : + OHCI_CTRL_RWC); + ohci_writel(ohci, ohci->hc_control, &ohci->regs->control); + /* flush the writes */ (void) ohci_readl (ohci, &ohci->regs->control); }Index:
linux-2.6.35.y/drivers/usb/host/ohci-pci.c
===================================================================drivers/usb/host/ohci-pci.c 2011-03-29 23:03:00.577285400 -0700 renamed from drivers/usb/host/ohci-pci.c 2011-03-29 22:51:22.609144656 -0700 +18
-0@@ -201,6 +201,20 @@ return 0; } +/* nVidia controllers continue to drive Reset signalling on the bus + * even after system shutdown, wasting power. This flag tells the + * shutdown routine to leave the controller OPERATIONAL instead of RESET. + */ +static int ohci_quirk_nvidia_shutdown(struct usb_hcd *hcd) +{ + struct ohci_hcd *ohci = hcd_to_ohci(hcd); + + ohci->flags |= OHCI_QUIRK_SHUTDOWN; + ohci_dbg(ohci, "enabled nVidia shutdown quirk\n"); + + return 0; +} + /* * The hardware normally enables the A-link power management feature, which * lets the system lower the power consumption in idle states.@@ -332,6 +346,10 @@ PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399), .driver_data = (unsigned long)ohci_quirk_amd700, }, + { + PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID), + .driver_data = (unsigned long) ohci_quirk_nvidia_shutdown, + }, /* FIXME for some of the early AMD 760 southbridges, OHCI * won't work at all. blacklist them.Index:
linux-2.6.35.y/drivers/usb/host/ohci.h
===================================================================drivers/usb/host/ohci.h 2011-03-29 23:03:00.578285374 -0700 renamed from drivers/usb/host/ohci.h 2011-03-29 22:51:22.610144631 -0700 +1
-0@@ -403,6 +403,7 @@ #define OHCI_QUIRK_HUB_POWER 0x100 /* distrust firmware power/oc setup */ #define OHCI_QUIRK_AMD_ISO 0x200 /* ISO transfers*/ #define OHCI_QUIRK_AMD_PREFETCH 0x400 /* pre-fetch for ISO transfer */ +#define OHCI_QUIRK_SHUTDOWN 0x800 /* nVidia power bug */ // there are also chip quirks/bugs in init logicstruct
work_structnec_work; /* Worker for NEC quirk */
Index:linux-2.6.35.y/drivers/usb/host/pci-quirks.c
===================================================================drivers/usb/host/pci-quirks.c 2011-03-29 23:03:00.579285348 -0700 renamed from drivers/usb/host/pci-quirks.c 2011-03-29 22:51:22.610144631 -0700 +8
-3@@ -169,6 +169,7 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) { void __iomem *base; + u32 control; if (!mmio_resource_enabled(pdev, 0)) return;@@ -177,10 +178,14 @@ if (base == NULL) return; + control = readl(base + OHCI_CONTROL); + /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ -#ifndef __hppa__ -{ - u32 control = readl(base + OHCI_CONTROL); +#ifdef __hppa__ +#define OHCI_CTRL_MASK (OHCI_CTRL_RWC | OHCI_CTRL_IR) +#else +#define OHCI_CTRL_MASK OHCI_CTRL_RWC + if (control & OHCI_CTRL_IR) {int
wait_time= 500; /* arbitrary; 5 seconds */writel(OHCI_INTR_OC, base + OHCI_INTRENABLE);drivers/usb/host/pci-quirks.c 2011-03-29 23:03:00.579285348 -0700 renamed from drivers/usb/host/pci-quirks.c 2011-03-29 22:51:22.610144631 -0700 +0
-0@@ -194,13 +199,12 @@dev_warn(&pdev->dev, "OHCI: BIOS handoff failed" " (BIOS bug?) %08x\n",
readl(base + OHCI_CONTROL)); -
- /* reset controller, preserving RWC */
-writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL); }
-}
#endif+ /* reset controller, preserving RWC (and possibly IR) */
+writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL); +
/*
* disable interrupts
*/
Signature · 2 lines
Pali Rohár [email protected]
Re: [PATCH] [115/275] OHCI: work around for nVidia shutdown problem
Quoted 4 lines · Pali Rohár
Hello,
please see comment 33 in LP bug tracker:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/42149
Alan? Should I include http://marc.info/?l=linux-usb&m=130142049527638&w=2
too or drop this patch?
-Andi
Re: [PATCH] [232/275] nfsd: wrong index used in inner loop
In reply to Andi KleenQuoted 10 lines · Andi Kleen
Quoted 7 lines
Doh, so this 232/275 basically reverts that 180 and makes other change down the line, but keeps the subject intact. Especially useful that the two patches are so far away from each other (more than 50 patches in-between). Confusing :)
So both are actually needed, apparently.
Sorry about that -- i ended up grabbing those from .32 and since there were multiple releases in sequence it ended up this way.
It's definitely not your fault -- second patch should be named differently (since it does something else) but it's not.
Quoted 1 line
I can collapse the two patches.
Just be careful they don't end in the same _file_. In the gregkh's stable-queue repository each patch is keept in a separate file named after the subject line, so that means just that - the same file.
Quoted 1 line
Are the leftover hunks after that good?
I remember original discussion when first patch has been posted (was fun to read the original code), but I missed second half of it. So I re-read it and found the second part now, all is ok with it and with the resulting two- patch solution, except of the possible "patch name" clash, which may only when organizing patches in a plain directory.
Anyway, that's a good story I think, and the conclusion is - please name your patches correctly :)
Thank you!
/mjt
Alan Stern
maintainerRe: [PATCH] [115/275] OHCI: work around for nVidia shutdown problem
In reply to Andi KleenQuoted 8 lines · Andi Kleen
Quoted 4 lines · Pali Roh�r
Hello,
please see comment 33 in LP bug tracker:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/42149Alan? Should I include http://marc.info/?l=linux-usb&m=130142049527638&w=2
too or drop this patch?
For now I think it should be dropped. There is a fix for the problem in that comment, but so far only one person has tested it (in fact, only one person has reported having the problem). For details, see the thread starting here:
http://marc.info/?l=linux-kernel&m=130132879827993&w=2
When the fix is approved and goes into the other stable kernels, then you can merge both patches.
Alan Stern
Quoted 11 lines · Andi Kleen
This is the start of the longterm review cycle for the 2.6.35.12 release. There are a large number of 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. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
The full quilt queue can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/longterm/longterm-queue-2.6.35Responses should be made within 48 hours.
Can you include in this series also the following upstream patch?:
commit 7a89e4c "USB: serial: option: Apply OPTION_BLACKLIST_SENDSETUP also for ZTE MF626"
It affects also .35, I thought it was going in in this .35 update too as it's Cc: stable, but if it's already queued for the next .35 update then please disregard this.
Quoted 8 lines
-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 2 lines
[]'s Herton
Re: [PATCH] [115/275] OHCI: work around for nVidia shutdown problem
In reply to Alan SternQuoted 10 lines
For now I think it should be dropped. There is a fix for the problem in that comment, but so far only one person has tested it (in fact, only one person has reported having the problem). For details, see the thread starting here:
http://marc.info/?l=linux-kernel&m=130132879827993&w=2When the fix is approved and goes into the other stable kernels, then you can merge both patches.
Dropped for now. Thanks.
-Andi
Quoted 7 lines
Can you include in this series also the following upstream patch?:
commit 7a89e4c "USB: serial: option: ApplyOPTION_BLACKLIST_SENDSETUPalso for ZTE MF626"It affects also .35, I thought it was going in in this .35 update too as it's Cc: stable, but if it's already queued for the next .35 update then please disregard this.
It's not queued yet, but I should pick it up with the next update. For this one it's too late.
Thanks,
-Andi
Re: [PATCH] [232/275] nfsd: wrong index used in inner loop
In reply to Michael TokarevQuoted 32 lines · Michael Tokarev
Quoted 10 lines · Andi Kleen
Quoted 7 lines
Doh, so this 232/275 basically reverts that 180 and makes other change down the line, but keeps the subject intact. Especially useful that the two patches are so far away from each other (more than 50 patches in-between). Confusing :)
So both are actually needed, apparently.
Sorry about that -- i ended up grabbing those from .32 and since there were multiple releases in sequence it ended up this way.
It's definitely not your fault -- second patch should be named differently (since it does something else) but it's not.
Quoted 1 line
I can collapse the two patches.
Just be careful they don't end in the same _file_. In the gregkh's stable-queue repository each patch is keept in a separate file named after the subject line, so that means just that - the same file.
Quoted 1 line
Are the leftover hunks after that good?
I remember original discussion when first patch has been posted (was fun to read the original code), but I missed second half of it. So I re-read it and found the second part now, all is ok with it and with the resulting two- patch solution, except of the possible "patch name" clash, which may only when organizing patches in a plain directory.
Quoted 2 lines
Anyway, that's a good story I think, and the conclusion is - please name your patches correctly :)
Apologies, my fault--thanks for sorting it out.
--b.
Alan Stern
maintainerRe: [PATCH] [115/275] OHCI: work around for nVidia shutdown problem
In reply to Andi KleenQuoted 8 lines · Andi Kleen
Quoted 4 lines · Pali Roh�r
Hello,
please see comment 33 in LP bug tracker:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/42149Alan? Should I include http://marc.info/?l=linux-usb&m=130142049527638&w=2
too or drop this patch?
I think it has been long enough, and no more complaints have shown up. That fix is in the mainstream kernel as commit 2b7aaf503d56216b847c8265421d2a7d9b42df3e. It should be safe to add the two changes in your longterm stable tree.
Alan Stern