2.6.32.13-stable review
Subsystems (61)
cover 2.6.32.13-stable review
This is the start of the stable review cycle for the 2.6.32.13 release. There are 98 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 us 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.
Responses should be made by Wed, May 12, 2010, 22:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.32.13-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Documentation/kernel-parameters.txt | 5 +- Makefile | 2 +- arch/arm/mach-pxa/include/mach/colibri.h | 1 + arch/mips/include/asm/mach-sibyte/war.h | 6 +- arch/mips/sibyte/sb1250/setup.c | 15 +++ arch/parisc/kernel/pci.c | 7 +- arch/powerpc/mm/fsl_booke_mmu.c | 5 - arch/x86/Kconfig | 9 +- arch/x86/kernel/acpi/sleep.c | 2 + arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 3 +- arch/x86/kernel/cpu/intel.c | 21 ++++ arch/x86/kernel/cpu/intel_cacheinfo.c | 13 +- arch/x86/kernel/k8.c | 14 +++ arch/x86/kernel/pci-gart_64.c | 2 +- arch/x86/kernel/process_64.c | 5 +- arch/x86/kvm/x86.c | 12 -- block/blk-timeout.c | 12 +- crypto/async_tx/async_raid6_recov.c | 21 ++-- drivers/Makefile | 2 +- drivers/acpi/power_meter.c | 2 +- drivers/acpi/sleep.c | 173 +++++++++++++++++++++++++++-- drivers/ata/libata-eh.c | 5 + drivers/char/agp/Kconfig | 2 +- drivers/cpuidle/governors/menu.c | 9 +- drivers/edac/edac_mce_amd.c | 5 +- drivers/gpu/drm/i915/i915_gem.c | 6 + drivers/gpu/drm/i915/i915_gem_tiling.c | 22 ++-- drivers/gpu/drm/i915/i915_reg.h | 2 +- drivers/i2c/i2c-core.c | 26 +++-- drivers/md/md.c | 10 ++- drivers/md/raid5.c | 54 ++++----- drivers/media/dvb/ttpci/budget.c | 3 - drivers/net/bnx2.c | 6 +- drivers/net/r8169.c | 13 ++- drivers/net/tg3.c | 1 + drivers/net/usb/dm9601.c | 2 +- drivers/net/wireless/p54/p54pci.c | 10 ++- drivers/net/wireless/p54/p54usb.c | 1 + drivers/net/wireless/p54/txrx.c | 2 +- drivers/pci/pci.c | 6 +- drivers/scsi/libiscsi.c | 2 +- drivers/scsi/libsas/sas_ata.c | 4 + drivers/scsi/libsas/sas_scsi_host.c | 4 + drivers/scsi/qla2xxx/qla_isr.c | 120 ++++++++++----------- drivers/scsi/scsi_debug.c | 3 +- drivers/scsi/scsi_error.c | 15 +++- drivers/scsi/scsi_lib.c | 10 ++- drivers/scsi/sd.c | 1 + drivers/serial/8250_pnp.c | 2 + drivers/staging/hv/Hv.c | 2 +- drivers/staging/hv/RndisFilter.c | 1 + drivers/staging/hv/netvsc_drv.c | 3 +- drivers/staging/usbip/usbip_event.c | 3 + drivers/usb/core/driver.c | 32 +++++- drivers/usb/core/generic.c | 2 +- drivers/usb/core/inode.c | 4 +- drivers/usb/host/ehci-hcd.c | 1 + drivers/usb/host/ehci-mem.c | 2 +- drivers/usb/host/ehci-sched.c | 38 +++++-- drivers/usb/host/ehci.h | 5 +- drivers/usb/host/ohci-hub.c | 2 +- drivers/usb/host/xhci-mem.c | 65 +++++++++++ drivers/usb/host/xhci.h | 4 + drivers/usb/serial/sierra.c | 1 + drivers/w1/slaves/w1_therm.c | 5 +- fs/ext4/extents.c | 9 +- fs/jfs/resize.c | 6 +- fs/nfs/client.c | 2 + fs/nfs/dir.c | 2 + fs/nfsd/nfs4xdr.c | 8 +- fs/ocfs2/buffer_head_io.c | 2 + fs/ocfs2/dlm/dlmfs.c | 2 +- fs/ocfs2/inode.c | 1 + fs/ocfs2/refcounttree.c | 3 + fs/proc/base.c | 2 +- fs/reiserfs/dir.c | 2 - fs/reiserfs/xattr.c | 19 +--- fs/xfs/linux-2.6/xfs_super.c | 5 + fs/xfs/linux-2.6/xfs_sync.c | 107 +++++++++++++++++- fs/xfs/linux-2.6/xfs_sync.h | 7 +- fs/xfs/quota/xfs_qm_syscalls.c | 3 +- fs/xfs/xfs_ag.h | 1 + fs/xfs/xfs_mount.h | 1 + include/linux/acpi.h | 1 + include/linux/ata.h | 4 +- include/linux/poison.h | 25 ++++- include/linux/syscalls.h | 6 +- include/trace/ftrace.h | 3 +- init/initramfs.c | 3 +- kernel/cred.c | 2 - kernel/perf_event.c | 2 +- kernel/trace/trace.h | 3 +- lib/flex_array.c | 2 +- mm/hugetlb.c | 5 +- mm/memcontrol.c | 4 +- net/dccp/probe.c | 3 +- net/mac80211/agg-tx.c | 1 - security/inode.c | 4 +- security/keys/request_key.c | 9 ++- sound/pci/hda/hda_intel.c | 1 + sound/pci/hda/patch_conexant.c | 10 +- sound/pci/hda/patch_realtek.c | 2 +- sound/pci/hda/patch_sigmatel.c | 6 + sound/pci/maestro3.c | 9 ++ 104 files changed, 843 insertions(+), 292 deletions(-)
PATCH 1/98 USB: EHCI: defer reclamation of siTDs
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit 0e5f231bc16ff9910882fa5b9d64d80e7691cfab upstream.
This patch (as1369) fixes a problem in ehci-hcd. Some controllers occasionally run into trouble when the driver reclaims siTDs too quickly. This can happen while streaming audio; it causes the controller to crash.
The patch changes siTD reclamation to work the same way as iTD
reclamation: Completed siTDs are stored on a list and not reused until at least one frame has passed.
--- drivers/usb/host/ehci-hcd.c | 1 + drivers/usb/host/ehci-mem.c | 2 +- drivers/usb/host/ehci-sched.c | 38 ++++++++++++++++++++++++++++++-------- drivers/usb/host/ehci.h | 5 +++-- 4 files changed, 35 insertions(+), 11 deletions(-)
drivers/usb/host/ehci-hcd.c +1 -0
@@ -543,6 +543,7 @@ static int ehci_init(struct usb_hcd *hcd*/ ehci->periodic_size =DEFAULT_I_TDPS ;INIT_LIST_HEAD (&ehci->cached_itd_list); +INIT_LIST_HEAD (&ehci->cached_sitd_list);if ((retval =ehci_mem_init (ehci,GFP_KERNEL )) <0 )return retval;
drivers/usb/host/ehci-mem.c +1 -1
@@ -136,7 +136,7 @@ static inline void qh_put (struct ehci_qstatic void ehci_mem_cleanup (struct ehci_hcd *ehci) { -free_cached_itd_list (ehci); +free_cached_lists (ehci);if (ehci->async)qh_put (ehci->async); ehci->async =NULL ;
drivers/usb/host/ehci-sched.c +30 -8
@@ -2127,13 +2127,27 @@ sitd_complete ( (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); }iso_stream_put (ehci, stream); -/* OK to recycle this SITD now that its completion callback ran. */ + done: sitd->urb =NULL ; - sitd->stream =NULL ; -list_move (&sitd->sitd_list, &stream->free_list); -iso_stream_put (ehci, stream); - +if (ehci->clock_frame != sitd->frame) { +/* OK to recycle this SITD now. */ + sitd->stream =NULL ; +list_move (&sitd->sitd_list, &stream->free_list); +iso_stream_put (ehci, stream); + }else { +/* HW might remember this SITD, so we can't recycle it yet. +* Move it to a safe place until a new frame starts. +*/ +list_move (&sitd->sitd_list, &ehci->cached_sitd_list); +if (stream->refcount ==2 ) { +/* If iso_stream_put() were called here, stream +* would be freed. Instead, just prevent reuse. +*/ + stream->ep->hcpriv =NULL ; + stream->ep =NULL ; + } + }return retval; }
@@ -2199,9 +2213,10 @@ done:/*-------------------------------------------------------------------------*/ -static void free_cached_itd_list (struct ehci_hcd *ehci) +static void free_cached_lists (struct ehci_hcd *ehci) {struct ehci_itd *itd, *n; +struct ehci_sitd *sitd, *sn;list_for_each_entry_safe (itd, n, &ehci->cached_itd_list, itd_list) {struct ehci_iso_stream *stream = itd->stream;
@@ -2209,6 +2224,13 @@ static void free_cached_itd_list(structlist_move (&itd->itd_list, &stream->free_list);iso_stream_put (ehci, stream); } + +list_for_each_entry_safe (sitd, sn, &ehci->cached_sitd_list, sitd_list) { +struct ehci_iso_stream *stream = sitd->stream; + sitd->stream =NULL ; +list_move (&sitd->sitd_list, &stream->free_list); +iso_stream_put (ehci, stream); + } }/*-------------------------------------------------------------------------*/
@@ -2235,7 +2257,7 @@ scan_periodic (struct ehci_hcd *ehci) clock_frame =-1 ; }if (ehci->clock_frame != clock_frame) { -free_cached_itd_list (ehci); +free_cached_lists (ehci); ehci->clock_frame = clock_frame; } clock %= mod;
@@ -2398,7 +2420,7 @@ restart: clock = now; clock_frame = clock >>3 ;if (ehci->clock_frame != clock_frame) { -free_cached_itd_list (ehci); +free_cached_lists (ehci); ehci->clock_frame = clock_frame; } }else {
drivers/usb/host/ehci.h +3 -2
@@ -87,8 +87,9 @@ struct ehci_hcd { /* one per controlleint next_uframe;/* scan periodic, start here */ unsigned periodic_sched;/* periodic activity count */ -/* list of itds completed while clock_frame was still active */ +/* list of itds & sitds completed while clock_frame was still active */ struct list_head cached_itd_list; +struct list_head cached_sitd_list;unsigned clock_frame;/* per root hub port */
@@ -195,7 +196,7 @@ timer_action_done (struct ehci_hcd *ehciclear_bit (action, &ehci->actions); } -static void free_cached_itd_list (struct ehci_hcd *ehci); +static void free_cached_lists (struct ehci_hcd *ehci);/*-------------------------------------------------------------------------*/
PATCH 2/98 p54usb: Add usbid for Corega CG-WLUSB2GT.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Shimada Hirofumi <[email protected]>
commit 15a69a81731d337a3d9db51692ff8704c1114f43 upstream.
--- drivers/net/wireless/p54/p54usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/p54/p54usb.c +1 -0
@@ -36,6 +36,7 @@ static struct usb_device_id p54u_table[]/* Version 1 devices (pci chip + net2280) */ {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */ + {USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */ {USB_DEVICE(0x083a, 0x4501)}, /* Accton 802.11g WN4501 USB */ {USB_DEVICE(0x083a, 0x4502)}, /* Siemens Gigaset USB Adapter */ {USB_DEVICE(0x083a, 0x5501)}, /* Phillips CPWUA054 */
PATCH 3/98 md/raid5: allow for more than 2^31 chunks.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit 35f2a591192d0a5d9f7fc696869c76f0b8e49c3d upstream.
With many large drives and small chunk sizes it is possible to create a RAID5 with more than 2^31 chunks. Make sure this works.
--- drivers/md/raid5.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
drivers/md/raid5.c +7 -12
@@ -1649,8 +1649,8 @@ static sector_t raid5_compute_sector(rai int previous, int *dd_idx, struct stripe_head *sh) { - long stripe; -unsigned long chunk_number; + sector_t stripe; +sector_t chunk_number;unsigned int chunk_offset;int pd_idx, qd_idx;int ddf_layout =0 ;
@@ -1670,17 +1670,12 @@ static sector_t raid5_compute_sector(rai*/ chunk_offset =sector_div (r_sector, sectors_per_chunk); chunk_number = r_sector; -BUG_ON (r_sector != chunk_number);/* * Compute the stripe number */ - stripe = chunk_number / data_disks; - -/* -* Compute the data disk and parity disk indexes inside the stripe -*/ - *dd_idx = chunk_number % data_disks; + stripe = chunk_number; + *dd_idx =sector_div (stripe, data_disks);/* * Select the parity disk based on the user selected algorithm.
@@ -1869,14 +1864,14 @@ static sector_t compute_blocknr(struct s : conf->algorithm;sector_t stripe;int chunk_offset; -int chunk_number, dummy1, dd_idx = i; +sector_t chunk_number; +int dummy1, dd_idx = i;sector_t r_sector;struct stripe_head sh2; chunk_offset =sector_div (new_sector, sectors_per_chunk); stripe = new_sector; -BUG_ON (new_sector != stripe);if (i == sh->pd_idx)return 0 ;
@@ -1969,7 +1964,7 @@ static sector_t compute_blocknr(struct s } chunk_number = stripe * data_disks + i; - r_sector = (sector_t )chunk_number * sectors_per_chunk + chunk_offset; + r_sector = chunk_number * sectors_per_chunk + chunk_offset; check =raid5_compute_sector (conf, r_sector, previous, &dummy1, &sh2);
PATCH 4/98 md/raid5: fix previous patch.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit 6e3b96ed610e5a1838e62ddae9fa0c3463f235fa upstream.
Previous patch changes stripe and chunk_number to sector_t but mistakenly did not update all of the divisions to use sector_dev().
This patch changes all the those divisions (actually the '%' operator) to sector_div.
--- drivers/md/raid5.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-)
drivers/md/raid5.c +18 -17
@@ -1649,7 +1649,7 @@ static sector_t raid5_compute_sector(rai int previous, int *dd_idx, struct stripe_head *sh) { - sector_t stripe; + sector_t stripe, stripe2;sector_t chunk_number;unsigned int chunk_offset;int pd_idx, qd_idx;
@@ -1676,7 +1676,7 @@ static sector_t raid5_compute_sector(rai*/ stripe = chunk_number; *dd_idx =sector_div (stripe, data_disks); - + stripe2 = stripe;/* * Select the parity disk based on the user selected algorithm. */
@@ -1688,21 +1688,21 @@ static sector_t raid5_compute_sector(raicase 5 :switch (algorithm) {case ALGORITHM_LEFT_ASYMMETRIC : - pd_idx = data_disks - stripe % raid_disks; + pd_idx = data_disks -sector_div (stripe2, raid_disks);if (*dd_idx >= pd_idx) (*dd_idx)++;break ;case ALGORITHM_RIGHT_ASYMMETRIC : - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks);if (*dd_idx >= pd_idx) (*dd_idx)++;break ;case ALGORITHM_LEFT_SYMMETRIC : - pd_idx = data_disks - stripe % raid_disks; + pd_idx = data_disks -sector_div (stripe2, raid_disks); *dd_idx = (pd_idx +1 + *dd_idx) % raid_disks;break ;case ALGORITHM_RIGHT_SYMMETRIC : - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks); *dd_idx = (pd_idx +1 + *dd_idx) % raid_disks;break ;case ALGORITHM_PARITY_0 :
@@ -1722,7 +1722,7 @@ static sector_t raid5_compute_sector(raiswitch (algorithm) {case ALGORITHM_LEFT_ASYMMETRIC : - pd_idx = raid_disks -1 - (stripe % raid_disks); + pd_idx = raid_disks -1 -sector_div (stripe2, raid_disks); qd_idx = pd_idx +1 ;if (pd_idx == raid_disks-1 ) { (*dd_idx)++;/* Q D D D P */
@@ -1731,7 +1731,7 @@ static sector_t raid5_compute_sector(rai (*dd_idx) +=2 ;/* D D P Q D */ break ;case ALGORITHM_RIGHT_ASYMMETRIC : - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks); qd_idx = pd_idx +1 ;if (pd_idx == raid_disks-1 ) { (*dd_idx)++;/* Q D D D P */
@@ -1740,12 +1740,12 @@ static sector_t raid5_compute_sector(rai (*dd_idx) +=2 ;/* D D P Q D */ break ;case ALGORITHM_LEFT_SYMMETRIC : - pd_idx = raid_disks -1 - (stripe % raid_disks); + pd_idx = raid_disks -1 -sector_div (stripe2, raid_disks); qd_idx = (pd_idx +1 ) % raid_disks; *dd_idx = (pd_idx +2 + *dd_idx) % raid_disks;break ;case ALGORITHM_RIGHT_SYMMETRIC : - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks); qd_idx = (pd_idx +1 ) % raid_disks; *dd_idx = (pd_idx +2 + *dd_idx) % raid_disks;break ;
@@ -1764,7 +1764,7 @@ static sector_t raid5_compute_sector(rai/* Exactly the same as RIGHT_ASYMMETRIC, but or * of blocks for computing Q is different. */ - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks); qd_idx = pd_idx +1 ;if (pd_idx == raid_disks-1 ) { (*dd_idx)++;/* Q D D D P */
@@ -1779,7 +1779,8 @@ static sector_t raid5_compute_sector(rai* D D D P Q rather than * Q D D D P */ - pd_idx = raid_disks -1 - ((stripe +1 ) % raid_disks); + stripe2 +=1 ; + pd_idx = raid_disks -1 -sector_div (stripe2, raid_disks); qd_idx = pd_idx +1 ;if (pd_idx == raid_disks-1 ) { (*dd_idx)++;/* Q D D D P */
@@ -1791,7 +1792,7 @@ static sector_t raid5_compute_sector(raicase ALGORITHM_ROTATING_N_CONTINUE :/* Same as left_symmetric but Q is before P */ - pd_idx = raid_disks -1 - (stripe % raid_disks); + pd_idx = raid_disks -1 -sector_div (stripe2, raid_disks); qd_idx = (pd_idx + raid_disks -1 ) % raid_disks; *dd_idx = (pd_idx +1 + *dd_idx) % raid_disks; ddf_layout =1 ;
@@ -1799,27 +1800,27 @@ static sector_t raid5_compute_sector(raicase ALGORITHM_LEFT_ASYMMETRIC_6 :/* RAID5 left_asymmetric, with Q on last device */ - pd_idx = data_disks - stripe % (raid_disks-1 ); + pd_idx = data_disks -sector_div (stripe2, raid_disks-1 );if (*dd_idx >= pd_idx) (*dd_idx)++; qd_idx = raid_disks -1 ;break ;case ALGORITHM_RIGHT_ASYMMETRIC_6 : - pd_idx = stripe % (raid_disks-1 ); + pd_idx =sector_div (stripe2, raid_disks-1 );if (*dd_idx >= pd_idx) (*dd_idx)++; qd_idx = raid_disks -1 ;break ;case ALGORITHM_LEFT_SYMMETRIC_6 : - pd_idx = data_disks - stripe % (raid_disks-1 ); + pd_idx = data_disks -sector_div (stripe2, raid_disks-1 ); *dd_idx = (pd_idx +1 + *dd_idx) % (raid_disks-1 ); qd_idx = raid_disks -1 ;break ;case ALGORITHM_RIGHT_SYMMETRIC_6 : - pd_idx = stripe % (raid_disks-1 ); + pd_idx =sector_div (stripe2, raid_disks-1 ); *dd_idx = (pd_idx +1 + *dd_idx) % (raid_disks-1 ); qd_idx = raid_disks -1 ;break ;
PATCH 5/98 libata: fix locking around blk_abort_request()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit fa41efdae7de61191a7bda3a00e88ef69afb5bb9 upstream.
blk_abort_request() expectes queue lock to be held by the caller. Grab it before calling the function.
Lack of this synchronization led to infinite loop on corrupt q->timeout_list.
--- drivers/ata/libata-eh.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/ata/libata-eh.c +4 -0
@@ -870,6 +870,8 @@ static void ata_eh_set_pending(struct atvoid ata_qc_schedule_eh (struct ata_queued_cmd *qc) {struct ata_port *ap = qc->ap; +struct request_queue *q = qc->scsicmd->device->request_queue; +unsigned long flags;WARN_ON (!ap->ops->error_handler);
@@ -881,7 +883,9 @@ void ata_qc_schedule_eh(struct ata_queue* Note that ATA_QCFLAG_FAILED is unconditionally set after * this function completes. */ +spin_lock_irqsave (q->queue_lock, flags);blk_abort_request (qc->scsicmd->request); +spin_unlock_irqrestore (q->queue_lock, flags); }/**
PATCH 6/98 libata: ensure NCQ error result taskfile is fully initialized
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
before returning it via qc->result_tf.
From: Jeff Garzik <[email protected]>
commit a09bf4cd53b8ab000197ef81f15d50f29ecf973c upstream.
--- drivers/ata/libata-eh.c | 1 + 1 file changed, 1 insertion(+)
drivers/ata/libata-eh.c +1 -0
@@ -1619,6 +1619,7 @@ void ata_eh_analyze_ncq_error(struct ata }/* okay, this error is ours */ +memset (&tf,0 ,sizeof (tf)); rc =ata_eh_read_log_10h (dev, &tag, &tf);if (rc) { ata_link_printk(link, KERN_ERR, "failed to read log page 10h "
PATCH 7/98 w1: w1 temp: fix negative termperature calculation
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ian Dall <[email protected]>
commit 9a6a1ecd9e9b5d046a236da2f7eb6b6812f04229 upstream.
Fix regression caused by commit 507e2fbaaacb6f164b4125b87c5002f95143174b ("w1: w1 temp calculation overflow fix") whereby negative temperatures for the DS18B20 are not converted properly.
When the temperature exceeds 32767 milli-degrees the temperature overflows to -32768 millidegrees. These are both well within the -55 - +125 degree range for the sensor.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=12646
--- drivers/w1/slaves/w1_therm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/w1/slaves/w1_therm.c +2 -3
@@ -115,9 +115,8 @@ static struct w1_therm_family_converterstatic inline int w1_DS18B20_convert_temp (u8 rom[9 ]) { -int t = ((s16 )rom[1 ] <<8 ) | rom[0 ]; - t = t*1000 /16 ; -return t; +s16 t =le16_to_cpup ((__le16 *)rom); +return t*1000 /16 ; }static inline int w1_DS18S20_convert_temp (u8 rom[9 ])
PATCH 8/98 memcg: fix prepare migration
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrea Arcangeli <[email protected]>
commit 93d5c9be1ddd57d4063ce463c9ac2be1e5ee14f1 upstream.
If a signal is pending (task being killed by sigkill) __mem_cgroup_try_charge will write NULL into &mem, and css_put will oops on null pointer dereference.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000010 IP: [<ffffffff810fc6cc>] mem_cgroup_prepare_migration+0x7c/0xc0 PGD a5d89067 PUD a5d8a067 PMD 0 Oops: 0000 [#1] SMP last sysfs file: /sys/devices/platform/microcode/firmware/microcode/loading CPU 0 Modules linked in: nfs lockd nfs_acl auth_rpcgss sunrpc acpi_cpufreq pcspkr sg [last unloaded: microcode]
Pid: 5299, comm: largepages Tainted: G W 2.6.34-rc3 #3 Penryn1600SLI-110dB/To Be Filled By O.E.M.
RIP: 0010:[<ffffffff810fc6cc>] [<ffffffff810fc6cc>] mem_cgroup_prepare_migration+0x7c/0xc0
--- mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/memcontrol.c +2 -2
@@ -2008,12 +2008,12 @@ int mem_cgroup_prepare_migration(struct }unlock_page_cgroup (pc); + *ptr = mem;if (mem) { - ret =__mem_cgroup_try_charge (NULL ,GFP_KERNEL , &mem, false, + ret =__mem_cgroup_try_charge (NULL ,GFP_KERNEL , ptr, false, page);css_put (&mem->css); } - *ptr = mem;return ret; }
PATCH 9/98 mac80211: remove bogus TX agg state assignment
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Berg <[email protected]>
commit b4bb5c3fd9333024044362df67e23e96158489ed upstream.
When the addba timer expires but has no work to do, it should not affect the state machine. If it does, TX will not see the successfully established and we can also crash trying to re-establish the session.
--- net/mac80211/agg-tx.c | 1 - 1 file changed, 1 deletion(-)
net/mac80211/agg-tx.c +0 -1
@@ -181,7 +181,6 @@ static void sta_addba_resp_timer_expired HT_AGG_STATE_REQ_STOP_BA_MSK)) != HT_ADDBA_REQUESTED_MSK) {spin_unlock_bh (&sta->lock); - *state =HT_AGG_STATE_IDLE ;#ifdef CONFIG_MAC80211_HT_DEBUG printk(KERN_DEBUG "timer expired on tid %d but we are not " "(or no longer) expecting addBA response there",
PATCH 10/98 flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Changli Gao <[email protected]>
commit e59464c735db19619cde2aa331609adb02005f5b upstream.
memset() is called with the wrong address and the kernel panics.
--- lib/flex_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/flex_array.c +1 -1
@@ -99,7 +99,7 @@ struct flex_array *flex_array_alloc(int ret->element_size = element_size; ret->total_nr_elements = total;if (elements_fit_in_base (ret) && !(flags & __GFP_ZERO)) -memset (ret->parts[0 ],FLEX_ARRAY_FREE , +memset (&ret->parts[0 ],FLEX_ARRAY_FREE ,FLEX_ARRAY_BASE_BYTES_LEFT );return ret; }
PATCH 11/98 core, x86: make LIST_POISON less deadly
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Avi Kivity <[email protected]>
commit a29815a333c6c6e677294bbe5958e771d0aad3fd upstream.
The list macros use LIST_POISON1 and LIST_POISON2 as undereferencable pointers in order to trap erronous use of freed list_heads. Unfortunately userspace can arrange for those pointers to actually be dereferencable, potentially turning an oops to an expolit.
To avoid this allow architectures (currently x86_64 only) to override the default values for these pointers with truly-undereferencable values. This is easy on x86_64 as the virtual address space is large and contains areas that cannot be mapped.
Other 64-bit architectures will likely find similar unmapped ranges.
[ingo: switch to 0xdead000000000000 as the unmapped area] [ingo: add comments, cleanup]
[jaswinder: eliminate sparse warnings]
--- arch/x86/Kconfig | 5 +++++ include/linux/poison.h | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-)
arch/x86/Kconfig +5 -0
@@ -1236,6 +1236,11 @@ config ARCH_MEMORY_PROBE def_bool X86_64 depends on MEMORY_HOTPLUG +config ILLEGAL_POINTER_VALUE + hex + default 0 if X86_32 + default 0xdead000000000000 if X86_64 + source "mm/Kconfig" config HIGHPTE
include/linux/poison.h +14 -2
@@ -2,13 +2,25 @@#define _LINUX_POISON_H/********** include/linux/list.h **********/ + +/* +* Architectures might want to move the poison pointer offset +* into some well-recognized area such as 0xdead000000000000, +* that is also not mappable by user-space exploits: +*/ +#ifdef CONFIG_ILLEGAL_POINTER_VALUE +# define POISON_POINTER_DELTA _AC(CONFIG_ILLEGAL_POINTER_VALUE, UL) +#else +# define POISON_POINTER_DELTA 0 +#endif +/* * These are non-NULL pointers that will result in page faults * under normal circumstances, used to verify that nobody uses * non-initialized list entries. */ -#define LIST_POISON1 ((void *) 0x00100100) -#define LIST_POISON2 ((void *) 0x00200200) +#define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA) +#define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA)/********** include/linux/timer.h **********/ /*
PATCH 12/98 hugetlb: fix infinite loop in get_futex_key() when backed by huge pages
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit 23be7468e8802a2ac1de6ee3eecb3ec7f14dc703 upstream.
If a futex key happens to be located within a huge page mapped MAP_PRIVATE, get_futex_key() can go into an infinite loop waiting for a page->mapping that will never exist.
See https://bugzilla.redhat.com/show_bug.cgi?id=552257 for more details about the problem.
This patch makes page->mapping a poisoned value that includes PAGE_MAPPING_ANON mapped MAP_PRIVATE. This is enough for futex to continue but because of PAGE_MAPPING_ANON, the poisoned value is not dereferenced or used by futex. No other part of the VM should be dereferencing the page->mapping of a hugetlbfs page as its page cache is not on the LRU.
This patch fixes the problem with the test case described in the bugzilla.
--- include/linux/poison.h | 9 +++++++++ mm/hugetlb.c | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-)
include/linux/poison.h +9 -0
@@ -48,6 +48,15 @@#define POISON_FREE 0x6b/* for use-after-free poisoning */ #define POISON_END 0xa5/* end-byte of poisoning */ +/********** mm/hugetlb.c **********/ +/* +* Private mappings of hugetlb pages use this poisoned value for +* page->mapping. The core VM should not be doing anything with this mapping +* but futex requires the existence of some page->mapping value even though it +* is unused if PAGE_MAPPING_ANON is set. +*/ +#define HUGETLB_POISON ((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON)) +/********** arch/$ARCH/mm/init.c **********/ #define POISON_FREE_INITMEM 0xcc
mm/hugetlb.c +4 -1
@@ -545,6 +545,7 @@ static void free_huge_page(struct page * mapping = (struct address_space *)page_private (page);set_page_private (page,0 ); + page->mapping =NULL ;BUG_ON (page_count (page));INIT_LIST_HEAD (&page->lru);
@@ -2095,8 +2096,10 @@ retry:spin_lock (&inode->i_lock); inode->i_blocks +=blocks_per_huge_page (h);spin_unlock (&inode->i_lock); - }else + }else {lock_page (page); + page->mapping =HUGETLB_POISON ; + } }/*
PATCH 13/98 reiserfs: fix permissions on .reiserfs_priv
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Mahoney <[email protected]>
commit cac36f707119b792b2396aed371d6b5cdc194890 upstream.
Commit 677c9b2e393a0cd203bd54e9c18b012b2c73305a ("reiserfs: remove privroot hiding in lookup") removed the magic from the lookup code to hide the .reiserfs_priv directory since it was getting loaded at mount-time instead. The intent was that the entry would be hidden from the user via a poisoned d_compare, but this was faulty.
This introduced a security issue where unprivileged users could access and modify extended attributes or ACLs belonging to other users, including root.
This patch resolves the issue by properly hiding .reiserfs_priv. This was the intent of the xattr poisoning code, but it appears to have never worked as expected. This is fixed by using d_revalidate instead of d_compare.
This patch makes -oexpose_privroot a no-op. I'm fine leaving it this way. The effort involved in working out the corner cases wrt permissions and caching outweigh the benefit of the feature.
--- fs/reiserfs/dir.c | 2 -- fs/reiserfs/xattr.c | 17 ++++------------- 2 files changed, 4 insertions(+), 15 deletions(-)
fs/reiserfs/dir.c +0 -2
@@ -45,8 +45,6 @@ static inline bool is_privroot_deh(struc struct reiserfs_de_head *deh) {struct dentry *privroot =REISERFS_SB (dir->d_sb)->priv_root; -if (reiserfs_expose_privroot (dir->d_sb)) -return 0 ;return (dir == dir->d_parent && privroot->d_inode && deh->deh_objectid ==INODE_PKEY (privroot->d_inode)->k_objectid); }
fs/reiserfs/xattr.c +4 -13
@@ -952,21 +952,13 @@ int reiserfs_permission(struct inode *inreturn generic_permission (inode, mask,NULL ); } -/* This will catch lookups from the fs root to .reiserfs_priv */ -static int -xattr_lookup_poison (struct dentry *dentry,struct qstr *q1,struct qstr *name) +static int xattr_hide_revalidate (struct dentry *dentry,struct nameidata *nd) { -struct dentry *priv_root =REISERFS_SB (dentry->d_sb)->priv_root; - if (container_of(q1, struct dentry, d_name) == priv_root) -return -ENOENT ; -if (q1->len == name->len && - !memcmp (q1->name, name->name, name->len)) -return 0 ; -return 1 ; +return -EPERM ; }static const struct dentry_operations xattr_lookup_poison_ops = { - .d_compare = xattr_lookup_poison, + .d_revalidate = xattr_hide_revalidate, };int reiserfs_lookup_privroot (struct super_block *s)
@@ -980,8 +972,7 @@ int reiserfs_lookup_privroot(struct supe strlen(PRIVROOT_NAME));if (!IS_ERR (dentry)) {REISERFS_SB (s)->priv_root = dentry; -if (!reiserfs_expose_privroot (s)) - s->s_root->d_op = &xattr_lookup_poison_ops; + dentry->d_op = &xattr_lookup_poison_ops;if (dentry->d_inode) dentry->d_inode->i_flags |=S_PRIVATE ; }else
PATCH 14/98 reiserfs: fix corruption during shrinking of xattrs
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Mahoney <[email protected]>
commit fb2162df74bb19552db3d988fd11c787cf5fad56 upstream.
Commit 48b32a3553a54740d236b79a90f20147a25875e3 ("reiserfs: use generic xattr handlers") introduced a problem that causes corruption when extended attributes are replaced with a smaller value.
The issue is that the reiserfs_setattr to shrink the xattr file was moved from before the write to after the write.
The root issue has always been in the reiserfs xattr code, but was papered over by the fact that in the shrink case, the file would just be expanded again while the xattr was written.
The end result is that the last 8 bytes of xattr data are lost.
This patch fixes it to use new_size.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=14826
--- fs/reiserfs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/reiserfs/xattr.c +1 -1
@@ -536,7 +536,7 @@ reiserfs_xattr_set_handle(struct reiserfif (!err && new_size <i_size_read (dentry->d_inode)) {struct iattr newattrs = { .ia_ctime =current_fs_time (inode->i_sb), - .ia_size = buffer_size, + .ia_size = new_size, .ia_valid =ATTR_SIZE |ATTR_CTIME , };mutex_lock_nested (&dentry->d_inode->i_mutex,I_MUTEX_XATTR );
PATCH 15/98 nfsd4: bug in read_buf
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Neil Brown <[email protected]>
commit 2bc3c1179c781b359d4f2f3439cb3df72afc17fc upstream.
When read_buf is called to move over to the next page in the pagelist of an NFSv4 request, it sets argp->end to essentially a random number, certainly not an address within the page which argp->p now points to. So subsequent calls to READ_BUF will think there is much more than a page of spare space (the cast to u32 ensures an unsigned comparison) so we can expect to fall off the end of the second page.
We never encountered thsi in testing because typically the only operations which use more than two pages are write-like operations, which have their own decoding logic. Something like a getattr after a write may cross a page boundary, but it would be very unusual for it to cross another boundary after that.
--- fs/nfsd/nfs4xdr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/nfsd/nfs4xdr.c +4 -4
@@ -168,10 +168,10 @@ static __be32 *read_buf(struct nfsd4_com argp->p =page_address (argp->pagelist[0 ]); argp->pagelist++;if (argp->pagelen <PAGE_SIZE ) { - argp->end = p + (argp->pagelen>>2 ); + argp->end = argp->p + (argp->pagelen>>2 ); argp->pagelen =0 ; }else { - argp->end = p + (PAGE_SIZE >>2 ); + argp->end = argp->p + (PAGE_SIZE >>2 ); argp->pagelen -=PAGE_SIZE ; }memcpy (((char *)p)+avail, argp->p, (nbytes - avail));
@@ -1433,10 +1433,10 @@ nfsd4_decode_compound(struct nfsd4_compo argp->p =page_address (argp->pagelist[0 ]); argp->pagelist++;if (argp->pagelen <PAGE_SIZE ) { - argp->end = p + (argp->pagelen>>2 ); + argp->end = argp->p + (argp->pagelen>>2 ); argp->pagelen =0 ; }else { - argp->end = p + (PAGE_SIZE >>2 ); + argp->end = argp->p + (PAGE_SIZE >>2 ); argp->pagelen -=PAGE_SIZE ; } }
PATCH 16/98 keys: the request_key() syscall should link an existing key to the dest keyring
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Howells <[email protected]>
commit 03449cd9eaa4fa3a7faa4a59474bafe2e90bd143 upstream.
The request_key() system call and request_key_and_link() should make a link from an existing key to the destination keyring (if supplied), not just from a new key to the destination keyring.
This can be tested by:
ring=keyctl newring fred @s
keyctl request2 user debug:a a
keyctl request user debug:a $ring
keyctl list $ring
If it says:
keyring is empty
then it didn't work. If it shows something like:
1 key in keyring: 1070462727: --alswrv 0 0 user: debug:a
then it did.
request_key() system call is meant to recursively search all your keyrings for the key you desire, and, optionally, if it doesn't exist, call out to userspace to create one for you.
If request_key() finds or creates a key, it should, optionally, create a link to that key from the destination keyring specified.
Therefore, if, after a successful call to request_key() with a desination keyring specified, you see the destination keyring empty, the code didn't work correctly.
If you see the found key in the keyring, then it did - which is what the patch is required for.
--- security/keys/request_key.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
security/keys/request_key.c +8 -1
@@ -336,8 +336,10 @@ static int construct_alloc_key(struct ke key_already_present:mutex_unlock (&key_construction_mutex); -if (dest_keyring) +if (dest_keyring) { +__key_link (dest_keyring,key_ref_to_ptr (key_ref));up_write (&dest_keyring->sem); + }mutex_unlock (&user->cons_lock);key_put (key); *_key = key =key_ref_to_ptr (key_ref);
@@ -428,6 +430,11 @@ struct key *request_key_and_link(structif (!IS_ERR (key_ref)) { key =key_ref_to_ptr (key_ref); +if (dest_keyring) { +construct_get_dest_keyring (&dest_keyring); +key_link (dest_keyring, key); +key_put (dest_keyring); + } }else if (PTR_ERR (key_ref) != -EAGAIN ) { key =ERR_CAST (key_ref); }else {
PATCH 17/98 staging: usbip: Fix deadlock
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Lescouet <[email protected]>
commit d01f42a22ef381ba973958e977209ac9a8667d57 upstream.
When detaching a port from the client side (usbip --detach 0), the event thread, on the server side, is going to deadlock. The "eh" server thread is getting USBIP_EH_RESET event and calls:
-> stub_device_reset() -> usb_reset_device()
the USB framework is then calling back _in the same "eh" thread_ :
-> stub_disconnect() -> usbip_stop_eh() -> wait_for_completion()
the "eh" thread is being asleep forever, waiting for its own completion. This patch checks if "eh" is the current thread, in usbip_stop_eh().
--- drivers/staging/usbip/usbip_event.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/staging/usbip/usbip_event.c +3 -0
@@ -117,6 +117,9 @@ void usbip_stop_eh(struct usbip_device * {struct usbip_task *eh = &ud->eh; +if (eh->thread == current) +return ;/* do not wait for myself */ +wait_for_completion (&eh->thread_done);usbip_dbg_eh ("usbip_eh has finished\n" ); }
PATCH 18/98 USB: fix remote wakeup settings during system sleep
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
This is a backport of commit 5f677f1d45b2bf08085bbba7394392dfa586fa8e. Some of the functionality had to be removed, but it should still fix the webcam problem.
This patch (as1363b) changes the way USB remote wakeup is handled during system sleeps. It won't be enabled unless an interface driver specifically needs it. Also, it won't be enabled during the FREEZE or QUIESCE phases of hibernation, when the system doesn't respond to wakeup events anyway.
This will fix problems people have reported with certain USB webcams that generate wakeup requests when they shouldn't, and as a result cause system suspends to fail. See
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/515109
--- drivers/usb/core/driver.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)
drivers/usb/core/driver.c +30 -2
@@ -1175,9 +1175,8 @@ static int usb_suspend_both(struct usb_d udev->state == USB_STATE_SUSPENDED) goto done; - udev->do_remote_wakeup =device_may_wakeup (&udev->dev); -if (msg.event &PM_EVENT_AUTO ) { + udev->do_remote_wakeup =device_may_wakeup (&udev->dev); status =autosuspend_check (udev,0 );if (status <0 ) goto done;
@@ -1742,6 +1741,34 @@ int usb_external_resume_device(struct usreturn status; } +static void choose_wakeup (struct usb_device *udev,pm_message_t msg) +{ +int w, i; +struct usb_interface *intf; + +/* Remote wakeup is needed only when we actually go to sleep. +* For things like FREEZE and QUIESCE, if the device is already +* autosuspended then its current wakeup setting is okay. +*/ +if (msg.event ==PM_EVENT_FREEZE || msg.event ==PM_EVENT_QUIESCE ) { + udev->do_remote_wakeup =0 ; +return ; + } + +/* If remote wakeup is permitted, see whether any interface drivers +* actually want it. +*/ + w =0 ; +if (device_may_wakeup (&udev->dev) && udev->actconfig) { +for (i =0 ; i < udev->actconfig->desc.bNumInterfaces; i++) { + intf = udev->actconfig->interface[i]; + w |= intf->needs_remote_wakeup; + } + } + + udev->do_remote_wakeup = w; +} +int usb_suspend (struct device *dev,pm_message_t msg) {struct usb_device *udev;
@@ -1761,6 +1788,7 @@ int usb_suspend(struct device *dev, pm_m } udev->skip_sys_resume =0 ; +choose_wakeup (udev, msg);return usb_external_suspend_device (udev, msg); }
PATCH 19/98 USB: Add id for HP ev2210 a.k.a Sierra MC5725 miniPCI-e Cell Modem.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: William Lightning <[email protected]>
commit cfbaa39347b34837f26e01fe8f4f8dbbae60b520 upstream.
--- drivers/usb/serial/sierra.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/sierra.c +1 -0
@@ -195,6 +195,7 @@ static const struct sierra_iface_info distatic struct usb_device_id id_table [] = { {USB_DEVICE (0x0F3D ,0x0112 ) },/* Airprime/Sierra PC 5220 */ {USB_DEVICE (0x03F0 ,0x1B1D ) },/* HP ev2200 a.k.a MC5720 */ + {USB_DEVICE (0x03F0 ,0x211D ) },/* HP ev2210 a.k.a MC5725 */ {USB_DEVICE (0x03F0 ,0x1E1D ) },/* HP hs2300 a.k.a MC8775 */ {USB_DEVICE (0x1199 ,0x0017 ) },/* Sierra Wireless EM5625 */
PATCH 20/98 USB: fix testing the wrong variable in fs_create_by_name()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit fa7fe7af146a7b613e36a311eefbbfb5555325d1 upstream.
There is a typo here. We should be testing "*dentry" which was just assigned instead of "dentry". This could result in dereferencing an ERR_PTR inside either usbfs_mkdir() or usbfs_create().
--- drivers/usb/core/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/core/inode.c +2 -2
@@ -515,13 +515,13 @@ static int fs_create_by_name (const char *dentry =NULL ;mutex_lock (&parent->d_inode->i_mutex); *dentry =lookup_one_len (name, parent,strlen (name)); -if (!IS_ERR (dentry)) { +if (!IS_ERR (*dentry)) {if ((mode &S_IFMT ) ==S_IFDIR ) error =usbfs_mkdir (parent->d_inode, *dentry, mode);else error =usbfs_create (parent->d_inode, *dentry, mode); }else - error =PTR_ERR (dentry); + error =PTR_ERR (*dentry);mutex_unlock (&parent->d_inode->i_mutex);return error;
PATCH 21/98 USB: dont choose configs with no interfaces
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit 62f9cfa3ece58268b3e92ca59c23b175f86205aa upstream.
This patch (as1372) fixes a bug in the routine that chooses the default configuration to install when a new USB device is detected. The algorithm is supposed to look for a config whose first interface is for a non-vendor-specific class. But the way it's currently written, it will also accept a config with no interfaces at all, which is not very useful. (Believe it or not, such things do exist.)
--- drivers/usb/core/generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/core/generic.c +1 -1
@@ -120,7 +120,7 @@ int usb_choose_configuration(struct usb_* than a vendor-specific driver. */ else if (udev->descriptor.bDeviceClass != USB_CLASS_VENDOR_SPEC && - (!desc || desc->bInterfaceClass != + (desc && desc->bInterfaceClass !=USB_CLASS_VENDOR_SPEC )) { best = c;break ;
PATCH 22/98 USB: OHCI: dont look at the root hub to get the number of ports
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit fcf7d2141f4a363a4a8454c4a0f26bb69e766c5f upstream.
This patch (as1371) fixes a small bug in ohci-hcd. The HCD already knows how many ports the controller has; there's no need to go looking at the root hub's usb_device structure to find out. Especially since the root hub's maxchild value is set correctly only while the root hub is bound to the hub driver.
--- drivers/usb/host/ohci-hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-hub.c +1 -1
@@ -697,7 +697,7 @@ static int ohci_hub_control (u16 wLength ) {struct ohci_hcd *ohci =hcd_to_ohci (hcd); -int ports =hcd_to_bus (hcd)->root_hub->maxchild; +int ports = ohci->num_ports;u32 temp;int retval =0 ;
PATCH 23/98 USB: xhci: properly set the "Mult" field of the endpoint context.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sarah Sharp <[email protected]>
commit 1cf62246c0e394021e494e0a8f1013e80db1a1a9 upstream.
A SuperSpeed interrupt or isochronous endpoint can define the number of "burst transactions" it can handle in a service interval. This is indicated by the "Mult" bits in the bmAttributes of the SuperSpeed Endpoint Companion Descriptor. For example, if it has a max packet size of 1024, a max burst of 11, and a mult of 3, the host may send 33 1024-byte packets in one service interval.
We must tell the xHCI host controller the number of multiple service opportunities (mults) the device can handle when the endpoint is installed. We do that by setting the Mult field of the Endpoint Context before a configure endpoint command is sent down. The Mult field is invalid for control or bulk SuperSpeed endpoints.
--- drivers/usb/host/xhci-mem.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/usb/host/xhci-mem.c +14 -0
@@ -496,6 +496,19 @@ static inline unsigned int xhci_get_endpreturn EP_INTERVAL (interval); } +/* The "Mult" field in the endpoint context is only set for SuperSpeed devices. +* High speed endpoint descriptors can define "the number of additional +* transaction opportunities per microframe", but that goes in the Max Burst +* endpoint context field. +*/ +static inline u32 xhci_get_endpoint_mult (struct usb_device *udev, +struct usb_host_endpoint *ep) +{ +if (udev->speed !=USB_SPEED_SUPER || !ep->ss_ep_comp) +return 0 ; +return ep->ss_ep_comp->desc.bmAttributes; +} +static inline u32 xhci_get_endpoint_type (struct usb_device *udev,struct usb_host_endpoint *ep) {
@@ -550,6 +563,7 @@ int xhci_endpoint_init(struct xhci_hcd * ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; ep_ctx->ep_info =xhci_get_endpoint_interval (udev, ep); + ep_ctx->ep_info |=EP_MULT (xhci_get_endpoint_mult (udev, ep));/* FIXME dig Mult and streams info out of ep companion desc */
PATCH 24/98 USB: xhci: properly set endpoint context fields for periodic eps.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sarah Sharp <[email protected]>
commit 9238f25d5d32a435277eb234ec82bacdd5daed41 upstream.
For periodic endpoints, we must let the xHCI hardware know the maximum payload an endpoint can transfer in one service interval. The xHCI specification refers to this as the Maximum Endpoint Service Interval Time Payload (Max ESIT Payload). This is used by the hardware for bandwidth management and scheduling of packets.
For SuperSpeed endpoints, the maximum is calculated by multiplying the max packet size by the number of bursts and the number of opportunities to transfer within a service interval (the Mult field of the SuperSpeed Endpoint companion descriptor). Devices advertise this in the wBytesPerInterval field of their SuperSpeed Endpoint Companion Descriptor.
For high speed devices, this is taken by multiplying the max packet size by the "number of additional transaction opportunities per microframe" (the high bits of the wMaxPacketSize field in the endpoint descriptor).
For FS/LS devices, this is just the max packet size.
The other thing we must set in the endpoint context is the Average TRB Length. This is supposed to be the average of the total bytes in the transfer descriptor (TD), divided by the number of transfer request blocks (TRBs) it takes to describe the TD. This gives the host controller an indication of whether the driver will be enqueuing a scatter gather list with many entries comprised of small buffers, or one contiguous buffer.
It also takes into account the number of extra TRBs you need for every TD. This includes No-op TRBs and Link TRBs used to link ring segments together. Some drivers may choose to chain an Event Data TRB on the end of every TD, thus increasing the average number of TRBs per TD. The Linux xHCI driver does not use Event Data TRBs.
In theory, if there was an API to allow drivers to state what their bandwidth requirements are, we could set this field accurately. For now, we set it to the same number as the Max ESIT payload.
The Average TRB Length should also be set for bulk and control endpoints, but I have no idea how to guess what it should be.
--- drivers/usb/host/xhci-mem.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/host/xhci.h | 4 +++ 2 files changed, 55 insertions(+)
drivers/usb/host/xhci-mem.c +51 -0
@@ -539,6 +539,36 @@ static inline u32 xhci_get_endpoint_typereturn type; } +/* Return the maximum endpoint service interval time (ESIT) payload. +* Basically, this is the maxpacket size, multiplied by the burst size +* and mult size. +*/ +static inline u32 xhci_get_max_esit_payload (struct xhci_hcd *xhci, +struct usb_device *udev, +struct usb_host_endpoint *ep) +{ +int max_burst; +int max_packet; + +/* Only applies for interrupt or isochronous endpoints */ +if (usb_endpoint_xfer_control (&ep->desc) || +usb_endpoint_xfer_bulk (&ep->desc)) +return 0 ; + +if (udev->speed ==USB_SPEED_SUPER ) { +if (ep->ss_ep_comp) +return ep->ss_ep_comp->desc.wBytesPerInterval; +xhci_warn (xhci,"WARN no SS endpoint companion descriptor.\n" ); +/* Assume no bursts, no multiple opportunities to send. */ +return ep->desc.wMaxPacketSize; + } + + max_packet = ep->desc.wMaxPacketSize &0x3ff ; + max_burst = (ep->desc.wMaxPacketSize &0x1800 ) >>11 ; +/* A 0 in max burst means 1 transfer per ESIT */ +return max_packet * (max_burst +1 ); +} + int xhci_endpoint_init(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, struct usb_device *udev,
@@ -550,6 +580,7 @@ int xhci_endpoint_init(struct xhci_hcd *struct xhci_ring *ep_ring;unsigned int max_packet;unsigned int max_burst; +u32 max_esit_payload; ep_index =xhci_get_endpoint_index (&ep->desc); ep_ctx =xhci_get_ep_ctx (xhci, virt_dev->in_ctx, ep_index);
@@ -609,6 +640,26 @@ int xhci_endpoint_init(struct xhci_hcd *default :BUG (); } + max_esit_payload =xhci_get_max_esit_payload (xhci, udev, ep); + ep_ctx->tx_info =MAX_ESIT_PAYLOAD_FOR_EP (max_esit_payload); + +/* +* XXX no idea how to calculate the average TRB buffer length for bulk +* endpoints, as the driver gives us no clue how big each scatter gather +* list entry (or buffer) is going to be. +* +* For isochronous and interrupt endpoints, we set it to the max +* available, until we have new API in the USB core to allow drivers to +* declare how much bandwidth they actually need. +* +* Normally, it would be calculated by taking the total of the buffer +* lengths in the TD and then dividing by the number of TRBs in a TD, +* including link TRBs, No-op TRBs, and Event data TRBs. Since we don't +* use Event Data TRBs, and we don't chain in a link TRB on short +* transfers, we're basically dividing by 1. +*/ + ep_ctx->tx_info |=AVG_TRB_LENGTH_FOR_EP (max_esit_payload); +/* FIXME Debug endpoint context */ return 0 ; }
drivers/usb/host/xhci.h +4 -0
@@ -609,6 +609,10 @@ struct xhci_ep_ctx {#define MAX_PACKET_MASK (0xffff << 16)#define MAX_PACKET_DECODED (p) (((p) >> 16) & 0xffff) +/* tx_info bitmasks */ +#define AVG_TRB_LENGTH_FOR_EP (p) ((p) & 0xffff) +#define MAX_ESIT_PAYLOAD_FOR_EP (p) (((p) & 0xffff) << 16) +/** * struct xhci_input_control_context
PATCH 25/98 procfs: fix tid fdinfo
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jerome Marchand <[email protected]>
commit 3835541dd481091c4dbf5ef83c08aed12e50fd61 upstream.
Correct the file_operations struct in fdinfo entry of tid_base_stuff[].
Presently /proc/*/task/*/fdinfo contains symlinks to opened files like /proc/*/fd/.
--- fs/proc/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/base.c +1 -1
@@ -2844,7 +2844,7 @@ out_no_task:*/ static const struct pid_entry tid_base_stuff[] = {DIR ("fd" ,S_IRUSR |S_IXUSR , proc_fd_inode_operations, proc_fd_operations), -DIR ("fdinfo" ,S_IRUSR |S_IXUSR , proc_fdinfo_inode_operations, proc_fd_operations), +DIR ("fdinfo" ,S_IRUSR |S_IXUSR , proc_fdinfo_inode_operations, proc_fdinfo_operations),REG ("environ" ,S_IRUSR , proc_environ_operations),INF ("auxv" ,S_IRUSR , proc_pid_auxv),ONE ("status" ,S_IRUGO , proc_pid_status),
PATCH 26/98 ocfs2: Update VFS inodes id info after reflink.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tao Ma <[email protected]>
commit c21a534e2f24968cf74976a4e721ac194db30ded upstream.
In reflink we update the id info on the disk but forgot to update the corresponding information in the VFS inode. Update them accordingly when we want to preserve the attributes.
--- fs/ocfs2/refcounttree.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ocfs2/refcounttree.c +3 -0
@@ -3995,6 +3995,9 @@ static int ocfs2_complete_reflink(struct di->i_attr = s_di->i_attr;if (preserve) { + t_inode->i_uid = s_inode->i_uid; + t_inode->i_gid = s_inode->i_gid; + t_inode->i_mode = s_inode->i_mode; di->i_uid = s_di->i_uid; di->i_gid = s_di->i_gid; di->i_mode = s_di->i_mode;
PATCH 27/98 ocfs2: potential ERR_PTR dereference on error paths
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit 0350cb078f5035716ebdad4ad4709d02fe466a8a upstream.
If "handle" is non null at the end of the function then we assume it's a valid pointer and pass it to ocfs2_commit_trans();
--- fs/ocfs2/inode.c | 1 + 1 file changed, 1 insertion(+)
fs/ocfs2/inode.c +1 -0
@@ -559,6 +559,7 @@ static int ocfs2_truncate_for_delete(str handle =ocfs2_start_trans (osb,OCFS2_INODE_UPDATE_CREDITS );if (IS_ERR (handle)) { status =PTR_ERR (handle); + handle =NULL ;mlog_errno (status); goto out; }
PATCH 28/98 ocfs2: Compute metaecc for superblocks during online resize.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Joel Becker <[email protected]>
commit a42ab8e1a37257da37e0f018e707bf365ac24531 upstream.
Online resize writes out the new superblock and its backups directly. The metaecc data wasn't being recomputed. Let's do that directly.
--- fs/ocfs2/buffer_head_io.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ocfs2/buffer_head_io.c +2 -0
@@ -407,6 +407,7 @@ int ocfs2_write_super_or_backup(struct o struct buffer_head *bh) {int ret =0 ; +struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;mlog_entry_void ();
@@ -426,6 +427,7 @@ int ocfs2_write_super_or_backup(struct oget_bh (bh);/* for end_buffer_write_sync() */ bh->b_end_io = end_buffer_write_sync; +ocfs2_compute_meta_ecc (osb->sb, bh->b_data, &di->i_check);submit_bh (WRITE , bh);wait_on_buffer (bh);
PATCH 29/98 ocfs2_dlmfs: Fix math error when reading LVB.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Joel Becker <[email protected]>
commit a36d515c7a2dfacebcf41729f6812dbc424ebcf0 upstream.
When asked for a partial read of the LVB in a dlmfs file, we can accidentally calculate a negative count.
--- fs/ocfs2/dlm/dlmfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/dlm/dlmfs.c +1 -1
@@ -205,7 +205,7 @@ static ssize_t dlmfs_file_read(struct fiif ((count + *ppos) >i_size_read (inode)) readlen =i_size_read (inode) - *ppos;else - readlen = count - *ppos; + readlen = count; lvb_buf =kmalloc (readlen,GFP_NOFS );if (!lvb_buf)
PATCH 30/98 powernow-k8: Fix frequency reporting
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Langsdorf <[email protected]>
commit b810e94c9d8e3fff6741b66cd5a6f099a7887871 upstream.
With F10, model 10, all valid frequencies are in the ACPI _PST table.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/cpufreq/powernow-k8.c +2 -1
@@ -929,7 +929,8 @@ static int fill_powernow_table_pstate(st powernow_table[i].index = index;/* Frequency may be rounded for these */ -if (boot_cpu_data.x86 ==0x10 || boot_cpu_data.x86 ==0x11 ) { +if ((boot_cpu_data.x86 ==0x10 && boot_cpu_data.x86_model <10 ) + || boot_cpu_data.x86 ==0x11 ) { powernow_table[i].frequency =freq_from_fid_did (lo &0x3f , (lo >>6 ) &7 ); }else
PATCH 31/98 nfs d_revalidate() is too trigger-happy with d_drop()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Al Viro <[email protected]>
commit d9e80b7de91db05c1c4d2e5ebbfd70b3b3ba0e0f upstream.
If dentry found stale happens to be a root of disconnected tree, we can't d_drop() it; its d_hash is actually part of s_anon and d_drop() would simply hide it from shrink_dcache_for_umount(), leading to all sorts of fun, including busy inodes on umount and oopsen after that.
Bug had been there since at least 2006 (commit c636eb already has it), so it's definitely -stable fodder.
--- fs/nfs/dir.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/dir.c +2 -0
@@ -837,6 +837,8 @@ out_zap_parent:/* If we have submounts, don't unhash ! */ if (have_submounts (dentry)) goto out_valid; +if (dentry->d_flags &DCACHE_DISCONNECTED ) + goto out_valid;shrink_dcache_parent (dentry); }d_drop (dentry);
PATCH 32/98 NFS: rsize and wsize settings ignored on v4 mounts
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Chuck Lever <[email protected]>
commit 356e76b855bdbfd8d1c5e75bcf0c6bf0dfe83496 upstream.
NFSv4 mounts ignore the rsize and wsize mount options, and always use the default transfer size for both. This seems to be because all NFSv4 mounts are now cloned, and the cloning logic doesn't copy the rsize and wsize settings from the parent nfs_server.
I tested Fedora's 2.6.32.11-99 and it seems to have this problem as well, so I'm guessing that .33, .32, and perhaps older kernels have this issue as well.
--- fs/nfs/client.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/client.c +2 -0
@@ -965,6 +965,8 @@ out_error:static void nfs_server_copy_userdata (struct nfs_server *target,struct nfs_server *source) { target->flags = source->flags; + target->rsize = source->rsize; + target->wsize = source->wsize; target->acregmin = source->acregmin; target->acregmax = source->acregmax; target->acdirmin = source->acdirmin;
PATCH 33/98 Staging: hv: Fix a bug affecting IPv6
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Haiyang Zhang <[email protected]>
commit 95beae90aa4afce57fb28e6f8238b78217bd7c98 upstream.
Fix a bug affecting IPv6
Added the multicast flag for proper IPv6 function.
--- drivers/staging/hv/RndisFilter.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/hv/RndisFilter.c +1 -0
@@ -756,6 +756,7 @@ static int RndisFilterOpenDevice(struct ret =RndisFilterSetPacketFilter (Device,NDIS_PACKET_TYPE_BROADCAST | +NDIS_PACKET_TYPE_ALL_MULTICAST |NDIS_PACKET_TYPE_DIRECTED );if (ret ==0 ) Device->State =RNDIS_DEV_DATAINITIALIZED ;
PATCH 34/98 Staging: hv: Fix up memory leak on HvCleanup
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Cyrill Gorcunov <[email protected]>
commit fa8ad0257ea256381126ecf447694622216c600f upstream.
Don't assign NULL too early
--- drivers/staging/hv/Hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/hv/Hv.c +1 -1
@@ -306,9 +306,9 @@ void HvCleanup(void)DPRINT_ENTER (VMBUS );if (gHvContext.SignalEventBuffer) { +kfree (gHvContext.SignalEventBuffer); gHvContext.SignalEventBuffer =NULL ; gHvContext.SignalEventParam =NULL ; -kfree (gHvContext.SignalEventBuffer); }if (gHvContext.GuestId ==HV_LINUX_GUEST_ID ) {
PATCH 35/98 Staging: hv: name network device ethX rather than sethX
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stephen Hemminger <[email protected]>
commit 546d9e101e7a71e6202f47a13ddcd9b8fb05a52e upstream.
This patch makes the HyperV network device use the same naming scheme as other virtual drivers (Xen, KVM). In an ideal world, userspace tools would not care what the name is, but some users and applications do care. Vyatta CLI is one of the tools that does depend on what the name is.
--- drivers/staging/hv/netvsc_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/hv/netvsc_drv.c +1 -2
@@ -413,8 +413,7 @@ static int netvsc_probe(struct device *dif (!net_drv_obj->Base.OnDeviceAdd)return -1 ; - net =alloc_netdev (sizeof (struct net_device_context ),"seth%d" , - ether_setup); + net =alloc_etherdev (sizeof (struct net_device_context ));if (!net)return -1 ;
PATCH 36/98 i2c: Fix probing of FSC hardware monitoring chips
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit b1d4b390ea4bb480e65974ce522a04022608a8df upstream.
Some FSC hardware monitoring chips (Syleus at least) doesn't like quick writes we typically use to probe for I2C chips. Use a regular byte read instead for the address they live at (0x73). These are the only known chips living at this address on PC systems.
For clarity, this fix should not be needed for kernels 2.6.30 and later, as we started instantiating the hwmon devices explicitly based on DMI data. Still, this fix is valuable in the following two cases:
* Support for recent FSC chips on older kernels. The DMI-based device instantiation is more difficult to backport than the device support itself.
* Case where the DMI-based device instantiation fails, whatever the reason. We fall back to probing in that case, so it should work.
This fixes kernel bug #15634:
https://bugzilla.kernel.org/show_bug.cgi?id=15634
--- drivers/i2c/i2c-core.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/i2c/i2c-core.c +17 -7
@@ -1202,14 +1202,24 @@ static int i2c_detect_address(struct i2c/* Make sure there is something at this address, unless forced */ if (kind <0 ) { -if (i2c_smbus_xfer (adapter, addr,0 ,0 ,0 , -I2C_SMBUS_QUICK ,NULL ) <0 ) -return 0 ; +if (addr ==0x73 && (adapter->class &I2C_CLASS_HWMON )) { +/* Special probe for FSC hwmon chips */ +union i2c_smbus_data dummy; -/* prevent 24RF08 corruption */ -if ((addr & ~0x0f ) ==0x50 ) -i2c_smbus_xfer (adapter, addr,0 ,0 ,0 , -I2C_SMBUS_QUICK ,NULL ); +if (i2c_smbus_xfer (adapter, addr,0 ,I2C_SMBUS_READ ,0 , +I2C_SMBUS_BYTE_DATA , &dummy) <0 ) +return 0 ; + }else { +if (i2c_smbus_xfer (adapter, addr,0 ,I2C_SMBUS_WRITE ,0 , +I2C_SMBUS_QUICK ,NULL ) <0 ) +return 0 ; + +/* Prevent 24RF08 corruption */ +if ((addr & ~0x0f ) ==0x50 ) +i2c_smbus_xfer (adapter, addr,0 , +I2C_SMBUS_WRITE ,0 , +I2C_SMBUS_QUICK ,NULL ); + } }/* Finally call the custom detection function */
PATCH 37/98 perf: Fix resource leak in failure path of perf_event_open()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 048c852051d2bd5da54a4488bc1f16b0fc74c695 upstream.
perf_event_open() kfrees event after init failure which doesn't release all resources allocated by perf_event_alloc(). Use free_event() instead.
LKML-Reference: <[email protected]>
--- kernel/perf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/perf_event.c +1 -1
@@ -4609,7 +4609,7 @@ err_fput_free_put_context: err_free_put_context:if (err <0 ) -kfree (event); +free_event (event); err_put_context:if (err <0 )
PATCH 38/98 raid6: fix recovery performance regression
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Williams <[email protected]>
commit 5157b4aa5b7de8787b6318e61bcc285031bb9088 upstream.
The raid6 recovery code should immediately drop back to the optimized synchronous path when a p+q dma resource is not available. Otherwise we run the non-optimized/multi-pass async code in sync mode.
Verified with raid6test (NDISKS=255)
Applies to kernels >= 2.6.32.
--- crypto/async_tx/async_raid6_recov.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
crypto/async_tx/async_raid6_recov.c +13 -8
@@ -324,6 +324,7 @@ struct dma_async_tx_descriptor * async_raid6_2data_recov(int disks, size_t bytes, int faila, int failb, struct page **blocks, struct async_submit_ctl *submit) { + void *scribble = submit->scribble;int non_zero_srcs, i;BUG_ON (faila == failb);
@@ -332,11 +333,13 @@ async_raid6_2data_recov(int disks, size_pr_debug ("%s: disks: %d len: %zu\n" , __func__, disks, bytes); -/* we need to preserve the contents of 'blocks' for the async -* case, so punt to synchronous if a scribble buffer is not available +/* if a dma resource is not available or a scribble buffer is not +* available punt to the synchronous path. In the 'dma not +* available' case be sure to use the scribble buffer to +* preserve the content of 'blocks' as the caller intended. */ -if (!submit->scribble) { -void **ptrs = (void **) blocks; +if (!async_dma_find_channel (DMA_PQ ) || !scribble) { +void **ptrs = scribble ? scribble : (void **) blocks;async_tx_quiesce (&submit->depend_tx);for (i =0 ; i < disks; i++)
@@ -406,11 +409,13 @@ async_raid6_datap_recov(int disks, size_pr_debug ("%s: disks: %d len: %zu\n" , __func__, disks, bytes); -/* we need to preserve the contents of 'blocks' for the async -* case, so punt to synchronous if a scribble buffer is not available +/* if a dma resource is not available or a scribble buffer is not +* available punt to the synchronous path. In the 'dma not +* available' case be sure to use the scribble buffer to +* preserve the content of 'blocks' as the caller intended. */ -if (!scribble) { -void **ptrs = (void **) blocks; +if (!async_dma_find_channel (DMA_PQ ) || !scribble) { +void **ptrs = scribble ? scribble : (void **) blocks;async_tx_quiesce (&submit->depend_tx);for (i =0 ; i < disks; i++)
PATCH 39/98 serial: 8250_pnp - add Fujitsu Wacom device
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ping Cheng <[email protected]>
commit d9901660b53b92f0f3551c06588b8be38224b245 upstream.
Add Fujitsu Wacom 1FGT Tablet PC device
--- drivers/serial/8250_pnp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/serial/8250_pnp.c +2 -0
@@ -348,6 +348,8 @@ static const struct pnp_device_id pnp_de { "FUJ02E6", 0 },/* Fujitsu Wacom 2FGT Tablet PC device */ { "FUJ02E7", 0 }, +/* Fujitsu Wacom 1FGT Tablet PC device */ + { "FUJ02E9", 0 },/* * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in * disguise)
PATCH 40/98 block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Richard Kennedy <[email protected]>
commit a534dbe96e9929c7245924d8252d89048c23d569 upstream.
blk_rq_timed_out_timer() relied on blk_add_timer() never returning a timer value of zero, but commit 7838c15b8dd18e78a523513749e5b54bda07b0cb removed the code that bumped this value when it was zero. Therefore when jiffies is near wrap we could get unlucky & not set the timeout value correctly.
This patch uses a flag to indicate that the timeout value was set and so handles jiffies wrap correctly, and it keeps all the logic in one function so should be easier to maintain in the future.
--- block/blk-timeout.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
block/blk-timeout.c +5 -7
@@ -109,6 +109,7 @@ void blk_rq_timed_out_timer(unsigned lonstruct request_queue *q = (struct request_queue *) data;unsigned long flags, next =0 ;struct request *rq, *tmp; +int next_set =0 ;spin_lock_irqsave (q->queue_lock, flags);
@@ -122,16 +123,13 @@ void blk_rq_timed_out_timer(unsigned lonif (blk_mark_rq_complete (rq))continue ;blk_rq_timed_out (rq); - }else if (!next ||time_after (next, rq->deadline)) + }else if (!next_set ||time_after (next, rq->deadline)) { next = rq->deadline; + next_set =1 ; + } } -/* -* next can never be 0 here with the list non-empty, since we always -* bump ->deadline to 1 so we can detect if the timer was ever added -* or not. See comment in blk_add_timer() -*/ -if (next) +if (next_set)mod_timer (&q->timeout,round_jiffies_up (next));spin_unlock_irqrestore (q->queue_lock, flags);
PATCH 41/98 dm9601: fix phy/eeprom write routine
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Korsgaard <[email protected]>
commit e9162ab1610531d6ea6c1833daeb2613e44275e8 upstream.
Use correct bit positions in DM_SHARED_CTRL register for writes.
Michael Planes recently encountered a 'KY-RS9600 USB-LAN converter', which came with a driver CD containing a Linux driver. This driver turns out to be a copy of dm9601.c with symbols renamed and my copyright stripped. That aside, it did contain 1 functional change in dm_write_shared_word(), and after checking the datasheet the original value was indeed wrong (read versus write bits).
On Michaels HW, this change bumps receive speed from ~30KB/s to ~900KB/s. On other devices the difference is less spectacular, but still significant (~30%).
--- drivers/net/usb/dm9601.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/dm9601.c +1 -1
@@ -238,7 +238,7 @@ static int dm_write_shared_word(struct u goto out;dm_write_reg (dev,DM_SHARED_ADDR , phy ? (reg |0x40 ) : reg); -dm_write_reg (dev,DM_SHARED_CTRL , phy ?0x1c :0x14 ); +dm_write_reg (dev,DM_SHARED_CTRL , phy ?0x1a :0x12 );for (i =0 ; i <DM_TIMEOUT ; i++) {u8 tmp;
PATCH 42/98 p54pci: fix bugs in p54p_check_tx_ring
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans de Goede <[email protected]>
commit 0250ececdf6813457c98719e2d33b3684881fde0 upstream.
Hans de Goede identified a bug in p54p_check_tx_ring:
there are two ring indices. 1 => tx data and 3 => tx management. But the old code had a constant "1" and this resulted in spurious dma unmapping failures.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=583623
--- drivers/net/wireless/p54/p54pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/p54/p54pci.c +1 -1
@@ -237,7 +237,7 @@ static void p54p_check_tx_ring(struct ieu32 idx, i; i = (*index) % ring_limit; - (*index) = idx =le32_to_cpu (ring_control->device_idx[1 ]); + (*index) = idx =le32_to_cpu (ring_control->device_idx[ring_index]); idx %= ring_limit;while (i != idx) {
PATCH 43/98 edac, mce: Fix wrong mask and macro usage
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Borislav Petkov <[email protected]>
commit 35d824b28fc5544d1eb7c1e3db15a1740df8ec4b upstream.
Correct two mishaps which prevented reporting error type (CECC vs UECC) and extended error description.
--- drivers/edac/edac_mce_amd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/edac/edac_mce_amd.c +2 -3
@@ -295,7 +295,6 @@ wrong_ls_mce:void amd_decode_nb_mce (int node_id,struct err_regs *regs,int handle_errors) {u32 ec =ERROR_CODE (regs->nbsl); -u32 xec =EXT_ERROR_CODE (regs->nbsl);if (!handle_errors)return ;
@@ -319,7 +318,7 @@ void amd_decode_nb_mce(int node_id, strupr_cont ("\n" ); } -pr_emerg ("%s.\n" ,EXT_ERR_MSG (xec)); +pr_emerg ("%s.\n" ,EXT_ERR_MSG (regs->nbsl));if (BUS_ERROR (ec) && nb_bus_decoder)nb_bus_decoder (node_id, regs);
@@ -382,7 +381,7 @@ static void amd_decode_mce(struct mce *m ((m->status & MCI_STATUS_PCC) ? "yes" : "no"));/* do the two bits[14:13] together */ - ecc = m->status & (3ULL <<45 ); + ecc = (m->status >>45 ) &0x3 ;if (ecc)pr_cont (", %sECC Error" , ((ecc ==2 ) ?"C" :"U" ));
PATCH 44/98 x86-64: Clear a 64-bit FS/GS base on fork if selector is nonzero
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: H. Peter Anvin <[email protected]>
commit 7ce5a2b9bb2e92902230e3121d8c3047fab9cb47 upstream.
When we do a thread switch, we clear the outgoing FS/GS base if the corresponding selector is nonzero. This is taken by __switch_to() as an entry invariant; it does not verify that it is true on entry. However, copy_thread() doesn't enforce this constraint, which can result in inconsistent results after fork().
Make copy_thread() match the behavior of __switch_to().
LKML-Reference: <[email protected]>
--- arch/x86/kernel/process_64.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/x86/kernel/process_64.c +2 -3
@@ -295,11 +295,10 @@ int copy_thread(unsigned long clone_flagset_tsk_thread_flag (p,TIF_FORK ); - p->thread.fs = me->thread.fs; - p->thread.gs = me->thread.gs; -savesegment (gs, p->thread.gsindex); + p->thread.gs = p->thread.gsindex ?0 : me->thread.gs;savesegment (fs, p->thread.fsindex); + p->thread.fs = p->thread.fsindex ?0 : me->thread.fs;savesegment (es, p->thread.es);savesegment (ds, p->thread.ds);
PATCH 45/98 x86: Disable large pages on CPUs with Atom erratum AAE44
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: H. Peter Anvin <[email protected]>
commit 7a0fc404ae663776e96db43879a0fa24fec1fa3a upstream.
Atom erratum AAE44/AAF40/AAG38/AAH41:
"If software clears the PS (page size) bit in a present PDE (page directory entry), that will cause linear addresses mapped through this PDE to use 4-KByte pages instead of using a large page after old TLB entries are invalidated. Due to this erratum, if a code fetch uses this PDE before the TLB entry for the large page is invalidated then it may fetch from a different physical address than specified by either the old large page translation or the new 4-KByte page translation. This erratum may also cause speculative code fetches from incorrect addresses."
[http://download.intel.com/design/processor/specupdt/319536.pdf]
Where as commit 211b3d03c7400f48a781977a50104c9d12f4e229 seems to workaround errata AAH41 (mixed 4K TLBs) it reduces the window of opportunity for the bug to occur and does not totally remove it. This patch disables mixed 4K/4MB page tables totally avoiding the page splitting and not tripping this processor issue.
This is based on an original patch by Colin King.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/intel.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/x86/kernel/cpu/intel.c +21 -0
@@ -47,6 +47,27 @@ static void __cpuinit early_init_intel(s (c->x86 == 0x6 && c->x86_model >= 0x0e))set_cpu_cap (c,X86_FEATURE_CONSTANT_TSC ); +/* +* Atom erratum AAE44/AAF40/AAG38/AAH41: +* +* A race condition between speculative fetches and invalidating +* a large page. This is worked around in microcode, but we +* need the microcode to have already been loaded... so if it is +* not, recommend a BIOS update and disable large pages. +*/ +if (c->x86 ==6 && c->x86_model ==0x1c && c->x86_mask <=2 ) { +u32 ucode, junk; + +wrmsr (MSR_IA32_UCODE_REV ,0 ,0 ); +sync_core (); +rdmsr (MSR_IA32_UCODE_REV , junk, ucode); + +if (ucode <0x20e ) { +printk (KERN_WARNING "Atom PSE erratum detected, BIOS microcode update recommended\n" ); +clear_cpu_cap (c,X86_FEATURE_PSE ); + } + } +#ifdef CONFIG_X86_64 set_cpu_cap (c,X86_FEATURE_SYSENTER32 );#else
PATCH 46/98 x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Borislav Petkov <[email protected]>
commit 0e152cd7c16832bd5cadee0c2e41d9959bc9b6f9 upstream.
de957628ce7c84764ff41331111036b3ae5bad0f changed setting of the x86_init.iommu.iommu_init function ptr only when GART IOMMU is found.
One side effect of it is that num_k8_northbridges
is not initialized anymore if not explicitly
called. This resulted in uninitialized pointers in <arch/x86/kernel/cpu/intel_cacheinfo.c:amd_calc_l3_indices()>, for example, which uses the num_k8_northbridges thing through node_to_k8_nb_misc().
Fix that through an initcall that runs right after the PCI subsystem and does all the scanning. Then, remove initialization in gart_iommu_init() which is a rootfs_initcall and we're running before that.
What is more, since num_k8_northbridges is being used in other places beside GART IOMMU, include it whenever we add AMD CPU support. The previous dependency chain in kconfig contained
K8_NB depends on AGP_AMD64|GART_IOMMU
which was clearly incorrect. The more natural way in terms of hardware dependency should be
AGP_AMD64|GART_IOMMU depends on K8_NB depends on CPU_SUP_AMD && PCI. Make it so Number One!
LKML-Reference: <20100312144303.GA29262@aftab>
--- arch/x86/Kconfig | 4 ++-- arch/x86/kernel/k8.c | 14 ++++++++++++++ arch/x86/kernel/pci-gart_64.c | 2 +- drivers/char/agp/Kconfig | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-)
arch/x86/Kconfig +2 -2
@@ -622,7 +622,7 @@ config GART_IOMMU bool "GART IOMMU support" if EMBEDDED default y select SWIOTLB - depends on X86_64 && PCI + depends on X86_64 && PCI && K8_NB ---help--- Support for full DMA access of devices with 32bit memory access only on systems with more than 3GB. This is usually needed for USB,
@@ -2027,7 +2027,7 @@ endif # X86_32 config K8_NB def_bool y - depends on AGP_AMD64 || (X86_64 && (GART_IOMMU || (PCI && NUMA))) + depends on CPU_SUP_AMD && PCI source "drivers/pcmcia/Kconfig"
arch/x86/kernel/k8.c +14 -0
@@ -121,3 +121,17 @@ void k8_flush_garts(void) }EXPORT_SYMBOL_GPL (k8_flush_garts); +static __init int init_k8_nbs (void ) +{ +int err =0 ; + + err =cache_k8_northbridges (); + +if (err <0 ) +printk (KERN_NOTICE "K8 NB: Cannot enumerate AMD northbridges.\n" ); + +return err; +} + +/* This has to go after the PCI subsystem */ +fs_initcall (init_k8_nbs);
arch/x86/kernel/pci-gart_64.c +1 -1
@@ -720,7 +720,7 @@ void __init gart_iommu_init(void)unsigned long scratch;long i; -if (cache_k8_northbridges () <0 || num_k8_northbridges ==0 ) +if (num_k8_northbridges ==0 )return ;#ifndef CONFIG_AGP_AMD64
drivers/char/agp/Kconfig +1 -1
@@ -57,7 +57,7 @@ config AGP_AMD config AGP_AMD64 tristate "AMD Opteron/Athlon64 on-CPU GART support" if !GART_IOMMU - depends on AGP && X86 + depends on AGP && X86 && K8_NB default y if GART_IOMMU help This option gives you AGP support for the GLX component of
PATCH 47/98 x86, AMD: Fix stale cpuid4_info shared_map data in shared_cpu_map cpumasks
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Prarit Bhargava <[email protected]>
commit ebb682f522411abbe358059a256a8672ec0bd55b upstream.
The per_cpu cpuid4_info shared_map can contain stale data when CPUs are added and removed.
The stale data can lead to a NULL pointer derefernce panic on a remove of a CPU that has had siblings previously removed.
This patch resolves the panic by verifying a cpu is actually online before adding it to the shared_cpu_map, only examining cpus that are part of the same lower level cache, and by updating other siblings lowest level cache maps when a cpu is added.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/intel_cacheinfo.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/intel_cacheinfo.c +7 -6
@@ -647,18 +647,19 @@ static void __cpuinit cache_shared_cpu_m {struct _cpuid4_info *this_leaf, *sibling_leaf;unsigned long num_threads_sharing; -int index_msb, i; +int index_msb, i, sibling;struct cpuinfo_x86 *c = &cpu_data (cpu);if ((index ==3 ) && (c->x86_vendor ==X86_VENDOR_AMD )) { -struct cpuinfo_x86 *d; -for_each_online_cpu (i) { +for_each_cpu (i, c->llc_shared_map) {if (!per_cpu (cpuid4_info, i))continue ; - d = &cpu_data (i); this_leaf =CPUID4_INFO_IDX (i, index); -cpumask_copy (to_cpumask (this_leaf->shared_cpu_map), - d->llc_shared_map); +for_each_cpu (sibling, c->llc_shared_map) { +if (!cpu_online (sibling)) +continue ; +set_bit (sibling, this_leaf->shared_cpu_map); + } }return ; }
PATCH 48/98 ALSA: hda: Use LPIB quirk for DG965OT board version AAD63733-203
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 0e0280dc2b0c7395a880d25544b47f3e3e3f79db upstream.
The OR has verified with 2.6.32.11 and the latest alsa-driver stable daily snapshot that position_fix=1 is necessary for the external mic to work and for PulseAudio not to crash constantly.
This patch is necessary also for 2.6.32.11 and 2.6.33.2.
--- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2236,6 +2236,7 @@ static struct snd_pci_quirk position_fixSND_PCI_QUIRK (0x1462 ,0x1002 ,"MSI Wind U115" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1565 ,0x820f ,"Biostar Microtech" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1565 ,0x8218 ,"Biostar Microtech" ,POS_FIX_LPIB ), +SND_PCI_QUIRK (0x8086 ,0x2503 ,"DG965OT AAD63733-203" ,POS_FIX_LPIB ), SND_PCI_QUIRK(0x8086, 0xd601, "eMachines T5212", POS_FIX_LPIB), {} };
PATCH 49/98 ALSA: hda - Add PCI quirk for HP dv6-1110ax.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kunal Gangakhedkar <[email protected]>
commit e3d2530a6cea80987f77b75d8784a00f3aaf22ff upstream.
Adding this PCI quirk fixes the board config detection.
This also fixes jack sensing by using "hp_detect=1" via properly detected board config.
--- sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_sigmatel.c +2 -0
@@ -1712,6 +1712,8 @@ static struct snd_pci_quirk stac92hd71bx "HP HDX", STAC_HP_HDX), /* HDX16 */SND_PCI_QUIRK_MASK (PCI_VENDOR_ID_HP ,0xfff0 ,0x3620 ,"HP dv6" ,STAC_HP_DV5 ), +SND_PCI_QUIRK (PCI_VENDOR_ID_HP ,0x3061 , +"HP dv6" ,STAC_HP_DV5 ),/* HP dv6-1110ax */ SND_PCI_QUIRK_MASK (PCI_VENDOR_ID_HP ,0xfff0 ,0x7010 ,"HP" ,STAC_HP_DV5 ), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
PATCH 50/98 ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio XPS 1645
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit aac78daf8f37256283f56820ae858add7139c56c upstream.
The OR has verified that the dell-m6 model quirk is necessary for audio to be audible by default on the Dell Studio XPS 1645.
This change is necessary for 2.6.32.11 and 2.6.33.2 alike.
--- sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_sigmatel.c +2 -0
@@ -1592,6 +1592,8 @@ static struct snd_pci_quirk stac92hd73xx "Dell Studio 1555", STAC_DELL_M6_DMIC), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02bd, "Dell Studio 1557", STAC_DELL_M6_DMIC), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe, + "Dell Studio XPS 1645", STAC_DELL_M6_BOTH), {}/* terminator */ };
PATCH 51/98 ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdc upstream.
The OR has verified that the dell-m6 model quirk is necessary for audio to be audible by default on the Dell Studio XPS 1645.
This change is necessary for 2.6.32.11 and 2.6.33.2 alike.
--- sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_sigmatel.c +2 -0
@@ -1594,6 +1594,8 @@ static struct snd_pci_quirk stac92hd73xx "Dell Studio 1557", STAC_DELL_M6_DMIC), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe, "Dell Studio XPS 1645", STAC_DELL_M6_BOTH), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413, + "Dell Studio 1558", STAC_DELL_M6_BOTH), {}/* terminator */ };
Re: [51/98] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
Hi again.
Quoted 4 lines · Greg KH
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
Quoted 8 lines
From: Daniel T Chen<[email protected]>
commit
5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdcupstream.The OR has verified that the dell-m6 model quirk is necessary for audio to be audible by default on the Dell Studio XPS 1645.
My previous comment (commit message doesn't match code) applies here too.
Regards,
Nigel
Quoted 31 lines
This change is necessary for 2.6.32.11 and 2.6.33.2 alike.
Reported-by Andy Ross<[email protected]>Tested-by Andy Ross<[email protected]>Signed-off-by Daniel T Chen<[email protected]>Signed-off-by Takashi Iwai<[email protected]>Signed-off-by Greg Kroah-Hartman<[email protected]>--- sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)sound/pci/hda/patch_sigmatel.c +2
-1@@ -1594,6 +1594,8 @@ static struct snd_pci_quirk stac92hd73xx "Dell Studio 1557", STAC_DELL_M6_DMIC), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe, "Dell Studio XPS 1645", STAC_DELL_M6_BOTH), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413, + "Dell Studio 1558", STAC_DELL_M6_BOTH), {}/* terminator */ }; --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/
PATCH 52/98 ALSA: hda: Use ALC880_F1734 quirk for Fujitsu Siemens AMILO Xi 1526
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 3353541fe533350a22a03e2fb7dc085b35912575 upstream.
The OR has verified that the existing model quirk, ALC880_UNIWILL, is insufficient for audible playback and capture by default. Instead, the ALC880_F1734 model quirk needs to be used.
This change is necessary for both 2.6.32.11 and 2.6.33.2.
--- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +1 -1
@@ -3971,7 +3971,7 @@ static struct snd_pci_quirk alc880_cfg_tSND_PCI_QUIRK (0x1695 ,0x4012 ,"EPox EP-5LDA" ,ALC880_5ST_DIG ),SND_PCI_QUIRK (0x1734 ,0x107c ,"FSC F1734" ,ALC880_F1734 ),SND_PCI_QUIRK (0x1734 ,0x1094 ,"FSC Amilo M1451G" ,ALC880_FUJITSU ), -SND_PCI_QUIRK (0x1734 ,0x10ac ,"FSC" ,ALC880_UNIWILL ), +SND_PCI_QUIRK (0x1734 ,0x10ac ,"FSC AMILO Xi 1526" ,ALC880_F1734 ),SND_PCI_QUIRK (0x1734 ,0x10b0 ,"Fujitsu" ,ALC880_FUJITSU ),SND_PCI_QUIRK (0x1854 ,0x0018 ,"LG LW20" ,ALC880_LG_LW ), SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
PATCH 53/98 ALSA: snd-meastro3: Add amp_gpio quirk for Compaq EVO N600C
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans de Goede <[email protected]>
commit 7efbfd1ae98ef9efe06352e2a1ad83e8c14ceeb1 upstream.
Without this quirk sound stops working after suspend resume. With this quirk, one still needs to manually unmute the master volume control after a suspend / / resume cycle. That is fixed in another patch in this set.
Note that this patch was submitted to the alsa bug tracker a long time ago:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4319
--- sound/pci/maestro3.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/maestro3.c +1 -0
@@ -884,6 +884,7 @@ static struct pci_device_id snd_m3_ids[]MODULE_DEVICE_TABLE (pci, snd_m3_ids);static struct snd_pci_quirk m3_amp_quirk_list[]__devinitdata = { +SND_PCI_QUIRK (0x0E11 ,0x0094 ,"Compaq Evo N600c" ,0x0c ),SND_PCI_QUIRK (0x10f7 ,0x833e ,"Panasonic CF-28" ,0x0d ),SND_PCI_QUIRK (0x10f7 ,0x833d ,"Panasonic CF-72" ,0x0d ),SND_PCI_QUIRK (0x1033 ,0x80f1 ,"NEC LM800J/7" ,0x03 ),
PATCH 54/98 ALSA: snd-meastro3: Ignore spurious HV interrupts during suspend / resume
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans de Goede <[email protected]>
commit 715aa675338ce6e1a3b4f77cf87ea611f93058a8 upstream.
Ignore spurious HV interrupts during suspend / resume, this avoids mistaking them for a mute button press. This is not very pretty but it seems the only way to fix the master volume control gets muted after suspend issue I'm seeing. Note that the es1968 driver is doing exactly the same.
--- sound/pci/maestro3.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/pci/maestro3.c +8 -0
@@ -849,6 +849,7 @@ struct snd_m3 {struct snd_kcontrol *master_switch;struct snd_kcontrol *master_volume;struct tasklet_struct hwvol_tq; +unsigned int in_suspend;#ifdef CONFIG_PM u16 *suspend_mem;
@@ -1614,6 +1615,11 @@ static void snd_m3_update_hw_volume(unsioutb (0x88 , chip->iobase +SHADOW_MIX_REG_MASTER );outb (0x88 , chip->iobase +HW_VOL_COUNTER_MASTER ); +/* Ignore spurious HV interrupts during suspend / resume, this avoids +mistaking them for a mute button press. */ +if (chip->in_suspend) +return ; +if (!chip->master_switch || !chip->master_volume)return ;
@@ -2425,6 +2431,7 @@ static int m3_suspend(struct pci_dev *pcif (chip->suspend_mem ==NULL )return 0 ; + chip->in_suspend =1 ;snd_power_change_state (card, SNDRV_CTL_POWER_D3hot);snd_pcm_suspend_all (chip->pcm);snd_ac97_suspend (chip->ac97);
@@ -2498,6 +2505,7 @@ static int m3_resume(struct pci_dev *pcisnd_m3_hv_init (chip);snd_power_change_state (card,SNDRV_CTL_POWER_D0 ); + chip->in_suspend =0 ; return 0; }#endif /* CONFIG_PM */
PATCH 55/98 ALSA: hda: Fix max PCM level to 0 dB for Fujitsu-Siemens laptops using CX20549 (Venice)
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 0b587fc4d35afb1bc0fc3d890084bb14c78372dc upstream.
Cristian reported that these models have really bad sound above 6 dB and proposed the original patch. I've updated the comment to reflect this change.
--- sound/pci/hda/patch_conexant.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
sound/pci/hda/patch_conexant.c +4 -3
@@ -1175,9 +1175,10 @@ static int patch_cxt5045(struct hda_codeswitch (codec->subsystem_id >>16 ) {case 0x103c : -/* HP laptop has a really bad sound over 0dB on NID 0x17. -* Fix max PCM level to 0 dB -* (originall it has 0x2b steps with 0dB offset 0x14) +case 0x1734 : +/* HP & Fujitsu-Siemens laptops have really bad sound over 0dB +* on NID 0x17. Fix max PCM level to 0 dB +* (originally it has 0x2b steps with 0dB offset 0x14) */ snd_hda_override_amp_caps(codec, 0x17, HDA_INPUT, (0x14 << AC_AMPCAP_OFFSET_SHIFT) |
PATCH 56/98 ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice)
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 8f0f5ff6777104084b4b2e1ae079541c2a6ed6d9 upstream.
The OR's hardware distorts at PCM 100% because it does not correspond to 0 dB. Fix this in patch_cxt5045() for all Packard Bell models.
--- sound/pci/hda/patch_conexant.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/pci/hda/patch_conexant.c +3 -2
@@ -1175,9 +1175,10 @@ static int patch_cxt5045(struct hda_codeswitch (codec->subsystem_id >>16 ) {case 0x103c : +case 0x1631 :case 0x1734 : -/* HP & Fujitsu-Siemens laptops have really bad sound over 0dB -* on NID 0x17. Fix max PCM level to 0 dB +/* HP, Packard Bell, & Fujitsu-Siemens laptops have really bad +* sound over 0dB on NID 0x17. Fix max PCM level to 0 dB * (originally it has 0x2b steps with 0dB offset 0x14) */ snd_hda_override_amp_caps(codec, 0x17, HDA_INPUT,
PATCH 57/98 ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite Pro T130-15F
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 4442dd4613fe3795b4c8a5f42fc96b7ffb90d01a upstream.
The OR verified that using the olpc-xo-1_5 model quirk allows the headphones to be audible when inserted into the jack. Capture was also verified to work correctly.
--- sound/pci/hda/patch_conexant.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_conexant.c +1 -0
@@ -2350,6 +2350,7 @@ static struct snd_pci_quirk cxt5066_cfg_SND_PCI_QUIRK (0x1028 ,0x02f5 ,"Dell" ,CXT5066_DELL_LAPTOP ),SND_PCI_QUIRK (0x152d ,0x0833 ,"OLPC XO-1.5" ,CXT5066_OLPC_XO_1_5 ), + SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), {} };
PATCH 58/98 ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite P500-PSPGSC-01800T
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit c53666813813a0ea3d0391e1911eefc05a5e6b4f upstream.
The OR verified that using the olpc-xo-1_5 model quirk allows the headphones to be audible when inserted into the jack. Capture was also verified to work correctly.
--- sound/pci/hda/patch_conexant.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_conexant.c +1 -0
@@ -2350,6 +2350,7 @@ static struct snd_pci_quirk cxt5066_cfg_SND_PCI_QUIRK (0x1028 ,0x02f5 ,"Dell" ,CXT5066_DELL_LAPTOP ),SND_PCI_QUIRK (0x152d ,0x0833 ,"OLPC XO-1.5" ,CXT5066_OLPC_XO_1_5 ), +SND_PCI_QUIRK (0x1179 ,0xff50 ,"Toshiba Satellite P500-PSPGSC-01800T" ,CXT5066_OLPC_XO_1_5 ), SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), {} };
PATCH 59/98 libata: Fix accesses at LBA28 boundary (old bug, but nasty) (v2)
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Lord <[email protected]>
commit 45c4d015a92f72ec47acd0c7557abdc0c8a6499d upstream.
Most drives from Seagate, Hitachi, and possibly other brands, do not allow LBA28 access to sector number 0x0fffffff (2^28 - 1). So instead use LBA48 for such accesses.
This bug could bite a lot of systems, especially when the user has taken care to align partitions to 4KB boundaries. On misaligned systems, it is less likely to be encountered, since a 4KB read would end at 0x10000000 rather than at 0x0fffffff.
--- include/linux/ata.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/ata.h +2 -2
@@ -1000,8 +1000,8 @@ static inline int ata_ok(u8 status)static inline int lba_28_ok (u64 block,u32 n_block) { -/* check the ending block number */ -return ((block + n_block) < ((u64 )1 <<28 )) && (n_block <=256 ); +/* check the ending block number: must be LESS THAN 0x0fffffff */ +return ((block + n_block) < ((1 <<28 ) -1 )) && (n_block <=256 ); }static inline int lba_48_ok (u64 block,u32 n_block)
PATCH 60/98 ext4: correctly calculate number of blocks for fiemap
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Leonard Michlmayr <[email protected]>
commit aca92ff6f57c000d1b4523e383c8bd6b8269b8b1 upstream.
ext4_fiemap() rounds the length of the requested range down to blocksize, which is is not the true number of blocks that cover the requested region. This problem is especially impressive if the user requests only the first byte of a file: not a single extent will be reported.
We fix this by calculating the last block of the region and then subtract to find the number of blocks in the extents.
--- fs/ext4/extents.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
fs/ext4/extents.c +7 -2
@@ -3711,7 +3711,6 @@ int ext4_fiemap(struct inode *inode, str __u64 start, __u64 len) {ext4_lblk_t start_blk; -ext4_lblk_t len_blks;int error =0 ;/* fallback to generic here if not in extents fmt */
@@ -3725,8 +3724,14 @@ int ext4_fiemap(struct inode *inode, strif (fieinfo->fi_flags &FIEMAP_FLAG_XATTR ) { error =ext4_xattr_fiemap (inode, fieinfo); }else { +ext4_lblk_t len_blks; +__u64 last_blk; + start_blk = start >> inode->i_sb->s_blocksize_bits; - len_blks = len >> inode->i_sb->s_blocksize_bits; + last_blk = (start + len -1 ) >> inode->i_sb->s_blocksize_bits; +if (last_blk >=EXT_MAX_BLOCK ) + last_blk =EXT_MAX_BLOCK -1 ; + len_blks = ((ext4_lblk_t ) last_blk) - start_blk +1 ;/* * Walk the extent tree gathering extent information.
PATCH 61/98 initramfs: handle unrecognised decompressor when unpacking
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Phillip Lougher <[email protected]>
commit df37bd156dcb4f5441beaf5bde444adac974e9a0 upstream.
The unpack routine fails to handle the decompress_method() returning unrecognised decompressor (compress_name == NULL). This results in the routine looping eventually oopsing on an out of bounds memory access.
Note this bug is usually hidden, only triggering on trailing junk after one or more correct compressed blocks. The case of the compressed archive being complete junk is (by accident?) caught by the if (state != Reset) check because state is initialised to Start, but not updated due to the decompressor not having been called. Obviously if the junk is trailing a correctly decompressed buffer, state == Reset from the previous call to the decompressor.
--- init/initramfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
init/initramfs.c +2 -1
@@ -455,7 +455,8 @@ static char * __init unpack_to_rootfs(ch compress_name); message = msg_buf; } - } + }else +error ("junk in compressed archive" );if (state != Reset)error ("junk in compressed archive" ); this_header = saved_offset + my_inptr;
PATCH 62/98 drm/i915: fix tiling limits for i915 class hw v2
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel Vetter <[email protected]>
commit c36a2a6de59e4a141a68b7575de837d3b0bd96b3 upstream.
Current code is definitely crap: Largest pitch allowed spills into the TILING_Y bit of the fence registers ... :(
I've rewritten the limits check under the assumption that 3rd gen hw has a 3d pitch limit of 8kb (like 2nd gen). This is supported by an otherwise totally misleading XXX comment.
This bug mostly resulted in tiling-corrupted pixmaps because the kernel allowed too wide buffers to be tiled. Bug brought to the light by the xf86-video-intel 2.11 release because that unconditionally enabled tiling for pixmaps, relying on the kernel to check things. Tiling for the framebuffer was not affected because the ddx does some additional checks there ensure the buffer is within hw-limits.
v2: Instead of computing the value that would be written into the hw fence registers and then checking the limits simply check whether the stride is above the 8kb limit. To better document the hw, add some WARN_ONs in i915_write_fence_reg like I've done for the i830 case (using the right limits).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27449
--- drivers/gpu/drm/i915/i915_gem.c | 6 ++++++ drivers/gpu/drm/i915/i915_gem_tiling.c | 22 +++++++++------------- drivers/gpu/drm/i915/i915_reg.h | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +6 -0
@@ -2334,6 +2334,12 @@ static void i915_write_fence_reg(struct pitch_val = obj_priv->stride / tile_width; pitch_val =ffs (pitch_val) -1 ; +if (obj_priv->tiling_mode ==I915_TILING_Y && +HAS_128_BYTE_Y_TILING (dev)) +WARN_ON (pitch_val >I830_FENCE_MAX_PITCH_VAL ); +else +WARN_ON (pitch_val >I915_FENCE_MAX_PITCH_VAL ); + val = obj_priv->gtt_offset;if (obj_priv->tiling_mode ==I915_TILING_Y ) val |=1 <<I830_FENCE_TILING_Y_SHIFT ;
drivers/gpu/drm/i915/i915_gem_tiling.c +9 -13
@@ -353,21 +353,17 @@ i915_tiling_ok(struct drm_device *dev, i* reg, so dont bother to check the size */ if (stride /128 >I965_FENCE_MAX_PITCH_VAL )return false; - }else if (IS_I9XX (dev)) { -uint32_t pitch_val =ffs (stride / tile_width) -1 ; - -/* XXX: For Y tiling, FENCE_MAX_PITCH_VAL is actually 6 (8KB) -* instead of 4 (2KB) on 945s. -*/ -if (pitch_val >I915_FENCE_MAX_PITCH_VAL || - size > (I830_FENCE_MAX_SIZE_VAL <<20 )) + }else if (IS_I9XX (dev) ||IS_I8XX (dev)) { +if (stride >8192 )return false; - }else { -uint32_t pitch_val =ffs (stride / tile_width) -1 ; -if (pitch_val >I830_FENCE_MAX_PITCH_VAL || - size > (I830_FENCE_MAX_SIZE_VAL <<19 )) -return false; +if (IS_I9XX (dev)) { +if (size >I830_FENCE_MAX_SIZE_VAL <<20 ) +return false; + }else { +if (size >I830_FENCE_MAX_SIZE_VAL <<19 ) +return false; + } }/* 965+ just needs multiples of tile width */
drivers/gpu/drm/i915/i915_reg.h +1 -1
@@ -214,7 +214,7 @@#define I830_FENCE_SIZE_BITS (size) ((ffs((size) >> 19) - 1) << 8)#define I830_FENCE_PITCH_SHIFT 4#define I830_FENCE_REG_VALID (1<<0) -#define I915_FENCE_MAX_PITCH_VAL 0x10 +#define I915_FENCE_MAX_PITCH_VAL 4#define I830_FENCE_MAX_PITCH_VAL 6#define I830_FENCE_MAX_SIZE_VAL (1<<8)
PATCH 63/98 CRED: Fix a race in creds_are_invalid() in credentials debugging
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Howells <[email protected]>
commit e134d200d57d43b171dcb0b55c178a1a0c7db14a upstream.
creds_are_invalid() reads both cred->usage and cred->subscribers and then compares them to make sure the number of processes subscribed to a cred struct never exceeds the refcount of that cred struct.
The problem is that this can cause a race with both copy_creds() and exit_creds() as the two counters, whilst they are of atomic_t type, are only atomic with respect to themselves, and not atomic with respect to each other.
This means that if creds_are_invalid() can read the values on one CPU whilst they're being modified on another CPU, and so can observe an evolving state in which the subscribers count now is greater than the usage count a moment before.
Switching the order in which the counts are read cannot help, so the thing to do is to remove that particular check.
I had considered rechecking the values to see if they're in flux if the test fails, but I can't guarantee they won't appear the same, even if they've changed several times in the meantime.
Note that this can only happen if CONFIG_DEBUG_CREDENTIALS is enabled.
The problem is only likely to occur with multithreaded programs, and can be tested by the tst-eintr1 program from glibc's "make check". The symptoms look like:
CRED: Invalid credentials
CRED: At include/linux/cred.h:240
CRED: Specified credentials: ffff88003dda5878 [real][eff]
CRED: ->magic=43736564, put_addr=(null)
CRED: ->usage=766, subscr=766
CRED: ->*uid = { 0,0,0,0 }
CRED: ->*gid = { 0,0,0,0 }
CRED: ->security is ffff88003d72f538
CRED: ->security {359, 359}
------------[ cut here ]------------
kernel BUG at kernel/cred.c:850!
...
RIP: 0010:[<ffffffff81049889>] [<ffffffff81049889>] __invalid_creds+0x4e/0x52
...
Call Trace:
[<ffffffff8104a37b>] copy_creds+0x6b/0x23fNote the ->usage=766 and subscr=766. The values appear the same because they've been re-read since the check was made.
--- kernel/cred.c | 2 -- 1 file changed, 2 deletions(-)
kernel/cred.c +0 -2
@@ -786,8 +786,6 @@ bool creds_are_invalid(const struct cred {if (cred->magic !=CRED_MAGIC )return true; -if (atomic_read (&cred->usage) <atomic_read (&cred->subscribers)) -return true;#ifdef CONFIG_SECURITY_SELINUX if (selinux_is_enabled ()) {if ((unsigned long ) cred->security <PAGE_SIZE )
PATCH 64/98 jfs: fix diAllocExt error in resizing filesystem
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bill Pemberton <[email protected]>
commit 2b0b39517d1af5294128dbc2fd7ed39c8effa540 upstream.
Resizing the filesystem would result in an diAllocExt error in some instances because changes in bmp->db_agsize would not get noticed if goto extendBmap was called.
--- fs/jfs/resize.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/jfs/resize.c +5 -1
@@ -81,6 +81,7 @@ int jfs_extendfs(struct super_block *sb,struct inode *iplist[1 ];struct jfs_superblock *j_sb, *j_sb2;uint old_agsize; +int agsizechanged =0 ;struct buffer_head *bh, *bh2;/* If the volume hasn't grown, get out now */
@@ -333,6 +334,9 @@ int jfs_extendfs(struct super_block *sb,*/ if ((rc =dbExtendFS (ipbmap, XAddress, nblocks))) goto error_out; + + agsizechanged |= (bmp->db_agsize != old_agsize); +/* * the map now has extended to cover additional nblocks: * dn_mapsize = oldMapsize + nblocks;
@@ -432,7 +436,7 @@ int jfs_extendfs(struct super_block *sb,* will correctly identify the new ag); */ /* if new AG size the same as old AG size, done! */ -if (bmp->db_agsize != old_agsize) { +if (agsizechanged) {if ((rc =diExtendFS (ipimap, ipbmap))) goto error_out;
PATCH 65/98 ACPI: introduce kernel parameter acpi_sleep=sci_force_enable
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhang Rui <[email protected]>
commit d7f0eea9e431e1b8b0742a74db1a9490730b2a25 upstream.
Introduce kernel parameter acpi_sleep=sci_force_enable
some laptop requires SCI_EN being set directly on resume, or else they hung somewhere in the resume code path.
We already have a blacklist for these laptops but we still need this option, especially when debugging some suspend/resume problems, in case there are systems that need this workaround and are not yet in the blacklist.
--- Documentation/kernel-parameters.txt | 5 ++++- arch/x86/kernel/acpi/sleep.c | 2 ++ drivers/acpi/sleep.c | 29 +++++++++++++++++------------ include/linux/acpi.h | 1 + 4 files changed, 24 insertions(+), 13 deletions(-)
Documentation/kernel-parameters.txt +4 -1
@@ -241,7 +241,7 @@ and is between 256 and 4096 characters. acpi_sleep= [HW,ACPI] Sleep options Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, - old_ordering, s4_nonvs } + old_ordering, s4_nonvs, sci_force_enable } See Documentation/power/video.txt for information on s3_bios and s3_mode. s3_beep is for debugging; it makes the PC's speaker beep
@@ -254,6 +254,9 @@ and is between 256 and 4096 characters. of _PTS is used by default). s4_nonvs prevents the kernel from saving/restoring the ACPI NVS memory during hibernation. + sci_force_enable causes the kernel to set SCI_EN directly + on resume from S1/S3 (which is against the ACPI spec, + but some broken systems don't work without it). acpi_use_timer_override [HW,ACPI] Use timer override. For some broken Nvidia NF5 boards
arch/x86/kernel/acpi/sleep.c +2 -0
@@ -162,6 +162,8 @@ static int __init acpi_sleep_setup(char#endif if (strncmp (str,"old_ordering" ,12 ) ==0 )acpi_old_suspend_ordering (); +if (strncmp (str,"sci_force_enable" ,16 ) ==0 ) +acpi_set_sci_en_on_resume (); str =strchr (str,',' );if (str !=NULL ) str +=strspn (str,", \t" );
drivers/acpi/sleep.c +17 -12
@@ -81,6 +81,23 @@ static int acpi_sleep_prepare(u32 acpi_s#ifdef CONFIG_ACPI_SLEEP static u32 acpi_target_sleep_state =ACPI_STATE_S0 ;/* +* According to the ACPI specification the BIOS should make sure that ACPI is +* enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still, +* some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI +* on such systems during resume. Unfortunately that doesn't help in +* particularly pathological cases in which SCI_EN has to be set directly on +* resume, although the specification states very clearly that this flag is +* owned by the hardware. The set_sci_en_on_resume variable will be set in such +* cases. +*/ +static bool set_sci_en_on_resume; + +void __init acpi_set_sci_en_on_resume (void ) +{ + set_sci_en_on_resume = true; +} + +/* * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the * user to request that behavior by using the 'acpi_old_suspend_ordering' * kernel command line option that causes the following variable to be set.
@@ -170,18 +187,6 @@ static void acpi_pm_end(void)#endif /* CONFIG_ACPI_SLEEP */ #ifdef CONFIG_SUSPEND -/* -* According to the ACPI specification the BIOS should make sure that ACPI is -* enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still, -* some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI -* on such systems during resume. Unfortunately that doesn't help in -* particularly pathological cases in which SCI_EN has to be set directly on -* resume, although the specification states very clearly that this flag is -* owned by the hardware. The set_sci_en_on_resume variable will be set in such -* cases. -*/ -static bool set_sci_en_on_resume; -extern void do_suspend_lowlevel (void ); static u32 acpi_suspend_states[] = {
include/linux/acpi.h +1 -0
@@ -251,6 +251,7 @@ int acpi_check_mem_region(resource_size_void __init acpi_no_s4_hw_signature (void );void __init acpi_old_suspend_ordering (void );void __init acpi_s4_no_nvs (void ); +void __init acpi_set_sci_en_on_resume (void );#endif /* CONFIG_PM_SLEEP */ struct acpi_osc_context {
PATCH 66/98 p54pci: rx frame length check
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Lamparter <[email protected]>
commit f5300e04df78feae8107c1846dd3a9e27c071b2f upstream.
A long time ago, a user reported several crashes due to data corruptions which are likely the result of a not-100%-supported, or faulty? PCI bridge.
( http://patchwork.kernel.org/patch/53004/ )
This patch fixes entry #1.
"1. p54p_check_rx_ring - skb_over_panic: Under a ping flood or just left running for a bit would panic with a skb_over_panic." As described in the mail: The invalid frame length causes skb_put to bailout and trigger a crash.
Note:
Simply dropping the frame is problematic, because if its content contains a tx feedback we would lose some portion of the device memory space.... And the driver/mac80211 should handle all other invalid data.
--- drivers/net/wireless/p54/p54pci.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/wireless/p54/p54pci.c +8 -0
@@ -205,6 +205,14 @@ static void p54p_check_rx_ring(struct ie i %= ring_limit;continue ; } + +if (unlikely (len > priv->common.rx_mtu)) { +if (net_ratelimit ()) +dev_err (&priv->pdev->dev,"rx'd frame size " +"exceeds length threshold.\n" ); + + len = priv->common.rx_mtu; + }skb_put (skb, len);if (p54_rx (dev, skb)) {
PATCH 67/98 drivers/net/wireless/p54/txrx.c Fix off by one error
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Darren Jenkins <[email protected]>
commit 088ea189c4c75cdf211146faa4b341a0f7476be6 upstream.
fix off by one error in the queue size check of p54_tx_qos_accounting_alloc()
Coverity CID: 13314
--- drivers/net/wireless/p54/txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/p54/txrx.c +1 -1
@@ -186,7 +186,7 @@ static int p54_tx_qos_accounting_alloc(sstruct ieee80211_tx_queue_stats *queue;unsigned long flags; -if (WARN_ON (p54_queue >P54_QUEUE_NUM )) +if (WARN_ON (p54_queue >=P54_QUEUE_NUM ))return -EINVAL ; queue = &priv->tx_stats[p54_queue];
PATCH 68/98 dccp_probe: Fix module load dependencies between dccp and dccp_probe
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Neil Horman <[email protected]>
commit 38ff3e6bb987ec583268da8eb22628293095d43b upstream.
This was just recently reported to me. When built as modules, the dccp_probe module has a silent dependency on the dccp module. This stems from the fact that the module_init routine of dccp_probe registers a jprobe on the dccp_sendmsg symbol. Since the symbol is only referenced as a text string (the .symbol_name field in the jprobe struct) rather than the address of the symbol itself, depmod never picks this dependency up, and so if you load the dccp_probe module without the dccp module loaded, the register_jprobe call fails with an -EINVAL, and the whole module load fails.
The fix is pretty easy, we can just wrap the register_jprobe call in a try_then_request_module call, which forces the dependency to get satisfied prior to the probe registration.
--- net/dccp/probe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/dccp/probe.c +2 -1
@@ -164,7 +164,8 @@ static __init int dccpprobe_init(void)if (!proc_net_fops_create (&init_net, procname,S_IRUSR , &dccpprobe_fops)) goto err0; - ret =register_jprobe (&dccp_send_probe); + ret =try_then_request_module ((register_jprobe (&dccp_send_probe) ==0 ), +"dccp" );if (ret) goto err1;
PATCH 69/98 KVM: remove unused load_segment_descriptor_to_kvm_desct
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Marcelo Tosatti <[email protected]>
Commit 78ce64a384 in v2.6.32.12 introduced a warning due to unused load_segment_descriptor_to_kvm_desct helper, which has been opencoded by this commit.
On upstream, the helper was removed as part of a different commit.
Remove the now unused function.
--- arch/x86/kvm/x86.c | 12 ------------ 1 file changed, 12 deletions(-)
arch/x86/kvm/x86.c +0 -12
@@ -4155,18 +4155,6 @@ static u16 get_segment_selector(struct kreturn kvm_seg.selector; } -static int load_segment_descriptor_to_kvm_desct (struct kvm_vcpu *vcpu, -u16 selector, -struct kvm_segment *kvm_seg) -{ -struct desc_struct seg_desc; - -if (load_guest_segment_descriptor (vcpu, selector, &seg_desc)) -return 1 ; -seg_desct_to_kvm_desct (&seg_desc, selector, kvm_seg); -return 0 ; -} -static int kvm_load_realmode_segment (struct kvm_vcpu *vcpu,u16 selector,int seg) {struct kvm_segment segvar = {
PATCH 70/98 kgdb: dont needlessly skip PAGE_USER test for Fsl booke
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wufei <[email protected]>
commit 56151e753468e34aeb322af4b0309ab727c97d2e upstream.
The bypassing of this test is a leftover from 2.4 vintage kernels, and is no longer appropriate, or even used by KGDB. Currently KGDB uses probe_kernel_write() for all access to memory via the KGDB core, so it can simply be deleted.
This fixes CVE-2010-1446.
--- arch/powerpc/mm/fsl_booke_mmu.c | 5 ----- 1 file changed, 5 deletions(-)
arch/powerpc/mm/fsl_booke_mmu.c +0 -5
@@ -131,15 +131,10 @@ void settlbcam(int index, unsigned longTLBCAM [index].MAS3 = (phys &PAGE_MASK ) |MAS3_SX |MAS3_SR ;TLBCAM [index].MAS3 |= ((flags & _PAGE_RW) ?MAS3_SW :0 ); -#ifndef CONFIG_KGDB /* want user access for breakpoints */ if (flags & _PAGE_USER) {TLBCAM [index].MAS3 |=MAS3_UX |MAS3_UR ;TLBCAM [index].MAS3 |= ((flags & _PAGE_RW) ?MAS3_UW :0 ); } -#else -TLBCAM [index].MAS3 |=MAS3_UX |MAS3_UR ; -TLBCAM [index].MAS3 |= ((flags & _PAGE_RW) ?MAS3_UW :0 ); -#endif tlbcam_addrs[index].start = virt; tlbcam_addrs[index].limit = virt + size -1 ;
PATCH 71/98 r8169: use correct barrier between cacheable and non-cacheable memory
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Dillow <[email protected]>
commit 4c020a961a812ffae9846b917304cea504c3a733 upstream.
r8169 needs certain writes to be visible to other CPUs or the NIC before touching the hardware, but was using smp_wmb() which is only required to order cacheable memory access. Switch to wmb() which is required to order both cacheable and non-cacheable memory.
Noticed by Catalin Marinas and Paul Mackerras.
--- drivers/net/r8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/r8169.c +2 -2
@@ -4316,7 +4316,7 @@ static netdev_tx_t rtl8169_start_xmit(st tp->cur_tx += frags +1 ; -smp_wmb (); +wmb ();RTL_W8 (TxPoll,NPQ );/* set polling bit */
@@ -4676,7 +4676,7 @@ static int rtl8169_poll(struct napi_stru* until it does. */ tp->intr_mask =0xffff ; -smp_wmb (); +wmb ();RTL_W16 (IntrMask, tp->intr_event); }
PATCH 72/98 r8169: fix broken register writes
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Francois Romieu <[email protected]>
commit 78f1cd02457252e1ffbc6caa44a17424a45286b8 upstream.
This is quite similar to b39fe41f481d20c201012e4483e76c203802dda7 though said registers are not even documented as 64-bit registers
- as opposed to the initial TxDescStartAddress ones - but as single bytes which must be combined into 32 bits at the MMIO read/write level before being merged into a 64 bit logical entity.
Credits go to Ben Hutchings <[email protected]> for the MAR registers (aka "multicast is broken for ages on ARM) and to Timo Teräs <[email protected]> for the MAC registers.
--- drivers/net/r8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/r8169.c +2 -2
@@ -2832,8 +2832,8 @@ static void rtl_rar_set(struct rtl8169_pspin_lock_irq (&tp->lock);RTL_W8 (Cfg9346, Cfg9346_Unlock); -RTL_W32 (MAC0 , low);RTL_W32 (MAC4 , high); +RTL_W32 (MAC0 , low);RTL_W8 (Cfg9346, Cfg9346_Lock);spin_unlock_irq (&tp->lock);
@@ -4814,8 +4814,8 @@ static void rtl_set_rx_mode(struct net_d mc_filter[1 ] =swab32 (data); } -RTL_W32 (MAR0 +0 , mc_filter[0 ]);RTL_W32 (MAR0 +4 , mc_filter[1 ]); +RTL_W32 (MAR0 +0 , mc_filter[0 ]);RTL_W32 (RxConfig, tmp);
PATCH 73/98 r8169: more broken register writes workaround
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <[email protected]>
commit 908ba2bfd22253f26fa910cd855e4ccffb1467d0 upstream.
78f1cd02457252e1ffbc6caa44a17424a45286b8 ("fix broken register writes") does not work for Al Viro's r8169 (XID 18000000).
--- drivers/net/r8169.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/r8169.c +5 -0
@@ -2832,8 +2832,13 @@ static void rtl_rar_set(struct rtl8169_pspin_lock_irq (&tp->lock);RTL_W8 (Cfg9346, Cfg9346_Unlock); +RTL_W32 (MAC4 , high); +RTL_R32 (MAC4 ); +RTL_W32 (MAC0 , low); +RTL_R32 (MAC0 ); +RTL_W8 (Cfg9346, Cfg9346_Lock);spin_unlock_irq (&tp->lock);
PATCH 74/98 PCI: Ensure we re-enable devices on resume
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Matthew Garrett <[email protected]>
commit cc2893b6af5265baa1d68b17b136cffca9e40cfa upstream.
If the firmware puts a device back into D0 state at resume time, we'll update its state in resume_noirq and thus skip the platform resume code. Calling that code twice should be safe and we ought to avoid getting to that point anyway, so remove the check and also allow the platform pci code to be called for D0.
Fixes USB not being powered after resume on recent Lenovo machines.
--- drivers/pci/pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/pci/pci.c +1 -5
@@ -601,7 +601,7 @@ static void __pci_start_power_transition*/ int __pci_complete_power_transition (struct pci_dev *dev,pci_power_t state) { -return state >PCI_D0 ? +return state >=PCI_D0 ?pci_platform_power_transition (dev, state) : -EINVAL ; }EXPORT_SYMBOL_GPL (__pci_complete_power_transition);
@@ -638,10 +638,6 @@ int pci_set_power_state(struct pci_dev **/ return 0 ; -/* Check if we're already there */ -if (dev->current_state == state) -return 0 ; -__pci_start_power_transition (dev, state);/* This device is quirked not to be put into D3, so
PATCH 75/98 skip sense logging for some ATA PASS-THROUGH cdbs
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Douglas Gilbert <[email protected]>
commit e7efe5932b1d3916c79326a4221693ea90a900e2 upstream.
Further to the lsml thread titled:
"does scsi_io_completion need to dump sense data for ata pass through (ck_cond =
1) ?"
This is a patch to skip logging when the sense data is associated with a SENSE_KEY of "RECOVERED_ERROR" and the additional sense code is "ATA PASS-THROUGH INFORMATION AVAILABLE". This only occurs with the SAT ATA PASS-THROUGH commands when CK_COND=1 (in the cdb). It indicates that the sense data contains ATA registers.
Smartmontools uses such commands on ATA disks connected via SAT. Periodic checks such as those done by smartd cause nuisance entries into logs that are:
- neither errors nor warnings
- pointless unless the cdb that caused them are also logged
--- drivers/scsi/scsi_lib.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/scsi/scsi_lib.c +8 -2
@@ -773,8 +773,14 @@ void scsi_io_completion(struct scsi_cmnd* we already took a copy of the original into rq->errors which * is what gets returned to the user */ -if (sense_valid && sshdr.sense_key ==RECOVERED_ERROR ) { -if (!(req->cmd_flags &REQ_QUIET )) +if (sense_valid && (sshdr.sense_key ==RECOVERED_ERROR )) { +/* if ATA PASS-THROUGH INFORMATION AVAILABLE skip +* print since caller wants ATA registers. Only occurs on +* SCSI ATA PASS_THROUGH commands when CK_COND=1 +*/ +if ((sshdr.asc ==0x0 ) && (sshdr.ascq ==0x1d )) + ; +else if (!(req->cmd_flags &REQ_QUIET ))scsi_print_sense ("" , cmd); result =0 ;/* BLOCK_PC may have set error */
PATCH 76/98 tg3: Fix INTx fallback when MSI fails
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andre Detsch <[email protected]>
commit dc8bf1b1a6edfc92465526de19772061302f0929 upstream.
tg3: Fix INTx fallback when MSI fails
MSI setup changes the value of irq_vec in struct tg3 *tp. This attribute must be taken into account and restored before we try to do a new request_irq for INTx fallback.
In powerpc, the original code was leading to an EINVAL return within request_irq, because the driver was trying to use the disabled MSI virtual irq number instead of tp->pdev->irq.
--- drivers/net/tg3.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/tg3.c +1 -0
@@ -8168,6 +8168,7 @@ static int tg3_test_msi(struct tg3 *tp)pci_disable_msi (tp->pdev); tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI ; + tp->napi[0 ].irq_vec = tp->pdev->irq; err =tg3_request_irq (tp,0 );if (err)
PATCH 77/98 xfs: add a shrinker to background inode reclaim
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dave Chinner <[email protected]>
commit 9bf729c0af67897ea8498ce17c29b0683f7f2028 upstream
On low memory boxes or those with highmem, kernel can OOM before the background reclaims inodes via xfssyncd. Add a shrinker to run inode reclaim so that it inode reclaim is expedited when memory is low.
This is more complex than it needs to be because the VM folk don't want a context added to the shrinker infrastructure. Hence we need to add a global list of XFS mount structures so the shrinker can traverse them.
--- fs/xfs/linux-2.6/xfs_super.c | 5 + fs/xfs/linux-2.6/xfs_sync.c | 107 ++++++++++++++++++++++++++++++++++++++--- fs/xfs/linux-2.6/xfs_sync.h | 7 ++ fs/xfs/quota/xfs_qm_syscalls.c | 3 - fs/xfs/xfs_ag.h | 1 fs/xfs/xfs_mount.h | 1 6 files changed, 115 insertions(+), 9 deletions(-)
fs/xfs/linux-2.6/xfs_super.c +5 -0
@@ -1164,6 +1164,7 @@ xfs_fs_put_super(xfs_unmountfs (mp);xfs_freesb (mp); +xfs_inode_shrinker_unregister (mp);xfs_icsb_destroy_counters (mp);xfs_close_devices (mp);xfs_dmops_put (mp);
@@ -1555,6 +1556,8 @@ xfs_fs_fill_super(if (error) goto fail_vnrele; +xfs_inode_shrinker_register (mp); +kfree (mtpt);xfs_itrace_exit (XFS_I (sb->s_root->d_inode));
@@ -1894,6 +1897,7 @@ init_xfs_fs(void) goto out_cleanup_procfs;vfs_initquota (); +xfs_inode_shrinker_init (); error =register_filesystem (&xfs_fs_type);if (error)
@@ -1923,6 +1927,7 @@ exit_xfs_fs(void) {vfs_exitquota ();unregister_filesystem (&xfs_fs_type); +xfs_inode_shrinker_destroy ();xfs_sysctl_unregister ();xfs_cleanup_procfs ();xfs_buf_terminate ();
fs/xfs/linux-2.6/xfs_sync.c +100 -7
168 lines not on this page · raw message
fs/xfs/linux-2.6/xfs_sync.h +6 -1
@@ -54,6 +54,11 @@ void __xfs_inode_clear_reclaim_tag(strucint xfs_sync_inode_valid (struct xfs_inode *ip,struct xfs_perag *pag);int xfs_inode_ag_iterator (struct xfs_mount *mp,int (*execute)(struct xfs_inode *ip,struct xfs_perag *pag,int flags), -int flags,int tag,int write_lock); +int flags,int tag,int write_lock,int *nr_to_scan); + +void xfs_inode_shrinker_init (void ); +void xfs_inode_shrinker_destroy (void ); +void xfs_inode_shrinker_register (struct xfs_mount *mp); +void xfs_inode_shrinker_unregister (struct xfs_mount *mp);#endif
fs/xfs/quota/xfs_qm_syscalls.c +2 -1
@@ -893,7 +893,8 @@ xfs_qm_dqrele_all_inodes( uint flags) {ASSERT (mp->m_quotainfo); -xfs_inode_ag_iterator (mp, xfs_dqrele_inode, flags,XFS_ICI_NO_TAG ,0 ); +xfs_inode_ag_iterator (mp, xfs_dqrele_inode, flags, +XFS_ICI_NO_TAG ,0 ,NULL ); }/*------------------------------------------------------------------------*/
fs/xfs/xfs_ag.h +1 -0
@@ -215,6 +215,7 @@ typedef struct xfs_peragint pag_ici_init;/* incore inode cache initialised */ rwlock_t pag_ici_lock;/* incore inode lock */ struct radix_tree_root pag_ici_root;/* incore inode cache root */ +int pag_ici_reclaimable;/* reclaimable inodes */ #endif } xfs_perag_t;
fs/xfs/xfs_mount.h +1 -0
@@ -243,6 +243,7 @@ typedef struct xfs_mount {wait_queue_head_t m_wait_single_sync_task;__int64_t m_update_flags;/* sb flags we need to update on the next remount,rw */ +struct list_head m_mplist;/* inode shrinker mount list */ } xfs_mount_t;/*
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [77/98] xfs: add a shrinker to background inode reclaim
Quoted 1 line · Greg KH
2.6.32-stable review patch. If anyone has any objections, please let us know.
Quoted 10 lines
------------------
From: Dave Chinner <[email protected]>
commit
9bf729c0af67897ea8498ce17c29b0683f7f2028upstreamOn low memory boxes or those with highmem, kernel can OOM before the background reclaims inodes via xfssyncd. Add a shrinker to run inode reclaim so that it inode reclaim is expedited when memory is low.
...
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [77/98] xfs: add a shrinker to background inode reclaim
Quoted 4 lines · Alex Elder
Quoted 1 line · Greg KH
2.6.32-stable review patch. If anyone has any objections, please let us know.
Acked-by Alex Elder <[email protected]>
Thanks, I've added your ack for both the .32 and .33 versions of this patch.
greg k-h
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 78/98 parisc: Set PCI CLS early in boot.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Carlos O'Donell <[email protected]>
commit 5fd4514bb351b5ecb0da3692fff70741e5ed200c upstream.
Set the PCI CLS early in the boot process to prevent device failures. In pcibios_set_master use the new pci_cache_line_size instead of a hard-coded value.
--- arch/parisc/kernel/pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
arch/parisc/kernel/pci.c +5 -2
@@ -18,7 +18,6 @@#include <asm/io.h> #include <asm/system.h> -#include <asm/cache.h> /* for L1_CACHE_BYTES */ #include <asm/superio.h> #define DEBUG_RESOURCES 0
@@ -123,6 +122,10 @@ static int __init pcibios_init(void) }else {printk (KERN_WARNING "pci_bios != NULL but init() is!\n" ); } + +/* Set the CLS for PCI as early as possible. */ + pci_cache_line_size = pci_dfl_cache_line_size; +return 0 ; }
@@ -171,7 +174,7 @@ void pcibios_set_master(struct pci_dev *** upper byte is PCI_LATENCY_TIMER. */ pci_write_config_word (dev,PCI_CACHE_LINE_SIZE , - (0x80 <<8 ) | (L1_CACHE_BYTES /sizeof (u32))); + (0x80 <<8 ) | pci_cache_line_size); }
PATCH 79/98 qla2xxx: Properly handle UNDERRUN completion statuses.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lalit Chandivade <[email protected]>
commit 0f00a206ccb1dc644b6770ef25f185610fee6962 upstream.
Correct issues where the lower scsi-status would be improperly cleared, instead, allow the midlayer to process the status after the proper residual-count checks are performed. Finally, validate firmware status flags prior to assigning values from the FCP_RSP frame.
--- drivers/scsi/qla2xxx/qla_isr.c | 120 +++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 63 deletions(-)
drivers/scsi/qla2xxx/qla_isr.c +57 -63
@@ -1347,16 +1347,22 @@ qla2x00_status_entry(scsi_qla_host_t *vh sense_len = rsp_info_len = resid_len = fw_resid_len =0 ;if (IS_FWI2_CAPABLE (ha)) { - sense_len =le32_to_cpu (sts24->sense_len); - rsp_info_len =le32_to_cpu (sts24->rsp_data_len); - resid_len =le32_to_cpu (sts24->rsp_residual_count); - fw_resid_len =le32_to_cpu (sts24->residual_len); +if (scsi_status &SS_SENSE_LEN_VALID ) + sense_len =le32_to_cpu (sts24->sense_len); +if (scsi_status &SS_RESPONSE_INFO_LEN_VALID ) + rsp_info_len =le32_to_cpu (sts24->rsp_data_len); +if (scsi_status & (SS_RESIDUAL_UNDER |SS_RESIDUAL_OVER )) + resid_len =le32_to_cpu (sts24->rsp_residual_count); +if (comp_status ==CS_DATA_UNDERRUN ) + fw_resid_len =le32_to_cpu (sts24->residual_len); rsp_info = sts24->data; sense_data = sts24->data;host_to_fcp_swap (sts24->data,sizeof (sts24->data)); }else { - sense_len =le16_to_cpu (sts->req_sense_length); - rsp_info_len =le16_to_cpu (sts->rsp_info_len); +if (scsi_status &SS_SENSE_LEN_VALID ) + sense_len =le16_to_cpu (sts->req_sense_length); +if (scsi_status &SS_RESPONSE_INFO_LEN_VALID ) + rsp_info_len =le16_to_cpu (sts->rsp_info_len); resid_len =le32_to_cpu (sts->residual_length); rsp_info = sts->rsp_info; sense_data = sts->req_sense_data;
@@ -1443,38 +1449,62 @@ qla2x00_status_entry(scsi_qla_host_t *vhbreak ;case CS_DATA_UNDERRUN : - resid = resid_len; +DEBUG2 (printk (KERN_INFO +"scsi(%ld:%d:%d) UNDERRUN status detected 0x%x-0x%x. " +"resid=0x%x fw_resid=0x%x cdb=0x%x os_underflow=0x%x\n" , + vha->host_no, cp->device->id, cp->device->lun, comp_status, + scsi_status, resid_len, fw_resid_len, cp->cmnd[0 ], + cp->underflow)); +/* Use F/W calculated residual length. */ -if (IS_FWI2_CAPABLE (ha)) { -if (!(scsi_status &SS_RESIDUAL_UNDER )) { - lscsi_status =0 ; - }else if (resid != fw_resid_len) { - scsi_status &= ~SS_RESIDUAL_UNDER ; - lscsi_status =0 ; + resid =IS_FWI2_CAPABLE (ha) ? fw_resid_len : resid_len; +scsi_set_resid (cp, resid); +if (scsi_status &SS_RESIDUAL_UNDER ) { +if (IS_FWI2_CAPABLE (ha) && fw_resid_len != resid_len) { +DEBUG2 (printk ( +"scsi(%ld:%d:%d:%d) Dropped frame(s) " +"detected (%x of %x bytes)...residual " +"length mismatch...retrying command.\n" , + vha->host_no, cp->device->channel, + cp->device->id, cp->device->lun, resid, +scsi_bufflen (cp))); + + cp->result =DID_ERROR <<16 | lscsi_status; +break ; } - resid = fw_resid_len; - } -if (scsi_status &SS_RESIDUAL_UNDER ) { -scsi_set_resid (cp, resid); - }else { -DEBUG2 (printk (KERN_INFO -"scsi(%ld:%d:%d) UNDERRUN status detected " -"0x%x-0x%x. resid=0x%x fw_resid=0x%x cdb=0x%x " -"os_underflow=0x%x\n" , vha->host_no, - cp->device->id, cp->device->lun, comp_status, - scsi_status, resid_len, resid, cp->cmnd[0 ], - cp->underflow)); +if (!lscsi_status && + ((unsigned )(scsi_bufflen (cp) - resid) < + cp->underflow)) { +qla_printk (KERN_INFO , ha, +"scsi(%ld:%d:%d:%d): Mid-layer underflow " +"detected (%x of %x bytes)...returning " +"error status.\n" , vha->host_no, + cp->device->channel, cp->device->id, + cp->device->lun, resid,scsi_bufflen (cp)); + cp->result =DID_ERROR <<16 ; +break ; + } + }else if (!lscsi_status) { +DEBUG2 (printk ( +"scsi(%ld:%d:%d:%d) Dropped frame(s) detected " +"(%x of %x bytes)...firmware reported underrun..." +"retrying command.\n" , vha->host_no, + cp->device->channel, cp->device->id, + cp->device->lun, resid,scsi_bufflen (cp))); + + cp->result =DID_ERROR <<16 ; +break ; } + cp->result =DID_OK <<16 | lscsi_status; +/* * Check to see if SCSI Status is non zero. If so report SCSI * Status. */ if (lscsi_status !=0 ) { - cp->result =DID_OK <<16 | lscsi_status; -if (lscsi_status ==SAM_STAT_TASK_SET_FULL ) { DEBUG2(printk(KERN_INFO "scsi(%ld): QUEUE FULL status detected "
@@ -1501,42 +1531,6 @@ qla2x00_status_entry(scsi_qla_host_t *vhbreak ;qla2x00_handle_sense (sp, sense_data, sense_len, rsp); - }else { -/* -* If RISC reports underrun and target does not report -* it then we must have a lost frame, so tell upper -* layer to retry it by reporting an error. -*/ -if (!(scsi_status &SS_RESIDUAL_UNDER )) { -DEBUG2 (printk ("scsi(%ld:%d:%d:%d) Dropped " -"frame(s) detected (%x of %x bytes)..." -"retrying command.\n" , - vha->host_no, cp->device->channel, - cp->device->id, cp->device->lun, resid, -scsi_bufflen (cp))); - -scsi_set_resid (cp, resid); - cp->result =DID_ERROR <<16 ; -break ; - } - -/* Handle mid-layer underflow */ -if ((unsigned )(scsi_bufflen (cp) - resid) < - cp->underflow) { -qla_printk (KERN_INFO , ha, -"scsi(%ld:%d:%d:%d): Mid-layer underflow " -"detected (%x of %x bytes)...returning " -"error status.\n" , vha->host_no, - cp->device->channel, cp->device->id, - cp->device->lun, resid, -scsi_bufflen (cp)); - - cp->result =DID_ERROR <<16 ; -break ; - } - -/* Everybody online, looking good... */ - cp->result =DID_OK <<16 ; }break ;
PATCH 80/98 bnx2: Fix lost MSI-X problem on 5709 NICs.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael Chan <[email protected]>
commit c441b8d2cb2194b05550a558d6d95d8944e56a84 upstream.
It has been reported that under certain heavy traffic conditions in MSI-X mode, the driver can lose an MSI-X vector causing all packets in the associated rx/tx ring pair to be dropped. The problem is caused by the chip dropping the write to unmask the MSI-X vector by the kernel (when migrating the IRQ for example).
This can be prevented by increasing the GRC timeout value for these register read and write operations.
Thanks to Dell for helping us debug this problem.
--- drivers/net/bnx2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/bnx2.c +5 -1
@@ -4752,8 +4752,12 @@ bnx2_reset_chip(struct bnx2 *bp, u32 res rc =bnx2_alloc_bad_rbuf (bp); } -if (bp->flags &BNX2_FLAG_USING_MSIX ) +if (bp->flags &BNX2_FLAG_USING_MSIX ) {bnx2_setup_msix_tbl (bp); +/* Prevent MSIX table reads and write from timing out */ +REG_WR (bp,BNX2_MISC_ECO_HW_CTL , +BNX2_MISC_ECO_HW_CTL_LARGE_GRC_TMOUT_EN ); + }return rc; }
PATCH 81/98 tracing: Fix ftrace_event_call alignment for use with gcc 4.5
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Mahoney <[email protected]>
commit 86c38a31aa7f2dd6e74a262710bf8ebf7455acc5 upstream.
GCC 4.5 introduces behavior that forces the alignment of structures to
use the largest possible value. The default value is 32 bytes, so if some structures are defined with a 4-byte alignment and others aren't declared with an alignment constraint at all - it will align at 32-bytes.
For things like the ftrace events, this results in a non-standard array. When initializing the ftrace subsystem, we traverse the _ftrace_events section and call the initialization callback for each event. When the structures are misaligned, we could be treating another part of the structure (or the zeroed out space between them) as a function pointer.
This patch forces the alignment for all the ftrace_event_call structures to 4 bytes.
Without this patch, the kernel fails to boot very early when built with gcc 4.5.
It's trivial to check the alignment of the members of the array, so it might be worthwhile to add something to the build system to do that automatically. Unfortunately, that only covers this case. I've asked one of the gcc developers about adding a warning when this condition is seen.
LKML-Reference: <[email protected]>
--- include/linux/syscalls.h | 6 ++++-- include/trace/ftrace.h | 3 ++- kernel/trace/trace.h | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-)
include/linux/syscalls.h +4 -2
@@ -153,7 +153,8 @@ static void prof_sysexit_disable_##sname#define __SC_STR_TDECL6 (t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__)#define SYSCALL_TRACE_ENTER_EVENT (sname) \ - static struct ftrace_event_call event_enter_##sname; \ + static struct ftrace_event_call \ + __attribute__((__aligned__(4))) event_enter_##sname; \ struct trace_event enter_syscall_print_##sname = { \ .trace = print_syscall_enter, \ }; \
@@ -189,7 +190,8 @@ static void prof_sysexit_disable_##sname }#define SYSCALL_TRACE_EXIT_EVENT (sname) \ - static struct ftrace_event_call event_exit_##sname; \ + static struct ftrace_event_call \ + __attribute__((__aligned__(4))) event_exit_##sname; \ struct trace_event exit_syscall_print_##sname = { \ .trace = print_syscall_exit, \ }; \
include/trace/ftrace.h +2 -1
@@ -43,7 +43,8 @@tstruct \ char __data[0]; \ }; \ - static struct ftrace_event_call event_##name + static struct ftrace_event_call \ + __attribute__((__aligned__(4))) event_##name#undef __cpparg #define __cpparg(arg...) arg
kernel/trace/trace.h +2 -1
@@ -746,7 +746,8 @@ extern const char *__stop___trace_bprint#undef FTRACE_ENTRY#define FTRACE_ENTRY (call, struct_name, id, tstruct, print) \ - extern struct ftrace_event_call event_##call; + extern struct ftrace_event_call \ + __attribute__((__aligned__(4))) event_##call;#undef FTRACE_ENTRY_DUP#define FTRACE_ENTRY_DUP (call, struct_name, id, tstruct, print) \ FTRACE_ENTRY(call, struct_name, id, PARAMS(tstruct), PARAMS(print))
PATCH 82/98 security: testing the wrong variable in create_by_name()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit b338cc8207eae46640a8d534738fda7b5e48511d upstream.
There is a typo here. We should be testing "*dentry" instead of "dentry". If "*dentry" is an ERR_PTR, it gets dereferenced in either mkdir() or create() which would cause an OOPs.
--- security/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/inode.c +2 -2
@@ -168,13 +168,13 @@ static int create_by_name(const char *namutex_lock (&parent->d_inode->i_mutex); *dentry =lookup_one_len (name, parent,strlen (name)); -if (!IS_ERR (dentry)) { +if (!IS_ERR (*dentry)) {if ((mode &S_IFMT ) ==S_IFDIR ) error =mkdir (parent->d_inode, *dentry, mode);else error =create (parent->d_inode, *dentry, mode); }else - error =PTR_ERR (dentry); + error =PTR_ERR (*dentry);mutex_unlock (&parent->d_inode->i_mutex);return error;
PATCH 83/98 md: restore ability of spare drives to spin down.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit 1176568de7e066c0be9e46c37503b9fd4730edcf upstream.
Some time ago we stopped the clean/active metadata updates from being written to a 'spare' device in most cases so that it could spin down and say spun down. Device failure/removal etc are still recorded on spares.
However commit 51d5668cb2e3fd1827a55 broke this 50% of the time, depending on whether the event count is even or odd. The change log entry said:
This means that the alignment between 'odd/even' and
'clean/dirty' might take a little longer to attain,
how ever the code makes no attempt to create that alignment, so it could take arbitrarily long.
So when we find that clean/dirty is not aligned with odd/even, force a second metadata-update immediately. There are already cases where a second metadata-update is needed immediately (e.g. when a device fails during the metadata update). We just piggy-back on that.
--- drivers/md/md.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/md/md.c +8 -2
@@ -2011,12 +2011,18 @@ repeat:if (!mddev->in_sync || mddev->recovery_cp != MaxSector) {/* not clean */ /* .. if the array isn't clean, an 'even' event must also go * to spares. */ -if ((mddev->events&1 )==0 ) +if ((mddev->events&1 )==0 ) { nospares =0 ; + sync_req =2 ;/* force a second update to get the +* even/odd in sync */ + } }else {/* otherwise an 'odd' event must go to spares */ -if ((mddev->events&1 )) +if ((mddev->events&1 )) { nospares =0 ; + sync_req =2 ;/* force a second update to get the +* even/odd in sync */ + } } }
PATCH 84/98 virtio: initialize earlier
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stijn Tintel <[email protected]>
commit e2dbe06c271f3bb2a495627980aad3d1d8ccef2a upstream.
Move initialization of the virtio framework before the initialization of mtd, so that block2mtd can be used on virtio-based block devices.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=15644
--- drivers/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/Makefile +1 -1
@@ -17,6 +17,7 @@ obj-$(CONFIG_SFI) += sfi/ obj-$(CONFIG_PNP) += pnp/ obj-$(CONFIG_ARM_AMBA) += amba/ +obj-$(CONFIG_VIRTIO) += virtio/ obj-$(CONFIG_XEN) += xen/ # regulators early, since some subsystems rely on them to initialize
@@ -106,7 +107,6 @@ obj-$(CONFIG_HID) += hid/ obj-$(CONFIG_PPC_PS3) += ps3/ obj-$(CONFIG_OF) += of/ obj-$(CONFIG_SSB) += ssb/ -obj-$(CONFIG_VIRTIO) += virtio/ obj-$(CONFIG_VLYNQ) += vlynq/ obj-$(CONFIG_STAGING) += staging/ obj-y += platform/
PATCH 85/98 md/raid6: Fix raid-6 read-error correction in degraded state
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Gabriele A. Trombetti <[email protected]>
commit 87aa63000c484bfb9909989316f615240dfee018 upstream.
Fix: Raid-6 was not trying to correct a read-error when in singly-degraded state and was instead dropping one more device, going to doubly-degraded state. This patch fixes this behaviour.
--- drivers/md/raid5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid5.c +1 -1
@@ -1526,7 +1526,7 @@ static void raid5_end_read_request(strucclear_bit (R5_UPTODATE , &sh->dev[i].flags);atomic_inc (&rdev->read_errors); -if (conf->mddev->degraded) +if (conf->mddev->degraded >= conf->max_degraded) printk_rl(KERN_WARNING "raid5:%s: read error not correctable " "(sector %llu on %s).\n",
PATCH 86/98 V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference"
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bjørn Mork <[email protected]>
commit 6f550dc08369ee0bc6402963c377e65f0f2e3b71 upstream.
Never call dvb_frontend_detach if we failed to attach a frontend. This fixes the following oops, which will be triggered by a missing stv090x module:
[ 8.172997] DVB: registering new adapter (TT-Budget S2-1600 PCI) [ 8.209018] adapter has MAC addr = 00:d0:5c:cc:a7:29 [ 8.328665] Intel ICH 0000:00:1f.5: PCI INT B -> GSI 17 (level, low) -> IRQ 17 [ 8.328753] Intel ICH 0000:00:1f.5: setting latency timer to 64 [ 8.562047] DVB: Unable to find symbol stv090x_attach() [ 8.562117] BUG: unable to handle kernel NULL pointer dereference at 000000ac [ 8.562239] IP: [<e08b04a3>] dvb_frontend_detach+0x4/0x67 [dvb_core]
Ref http://bugs.debian.org/575207
--- drivers/media/dvb/ttpci/budget.c | 3 --- 1 file changed, 3 deletions(-)
drivers/media/dvb/ttpci/budget.c +0 -3
@@ -643,9 +643,6 @@ static void frontend_init(struct budget &budget->i2c_adap, &tt1600_isl6423_config); - }else { -dvb_frontend_detach (budget->dvb_frontend); - budget->dvb_frontend =NULL ; } }break ;
PATCH 87/98 ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Chiang <[email protected]>
commit 07bedca29b0973f36a6b6db36936deed367164ed upstream.
Multiple Lenovo ThinkPad models with Intel Core i5/i7 CPUs can successfully suspend/resume once, and then hang on the second s/r cycle.
We got confirmation that this was due to a BIOS defect. The BIOS did not properly set SCI_EN coming out of S3. The BIOS guys hinted that The Other Leading OS ignores the fact that hardware owns the bit and sets it manually.
In any case, an existing DMI table exists for machines where this defect is a known problem. Lenovo promise to fix their BIOS, but for folks who either won't or can't upgrade their BIOS, allow Linux to workaround the issue.
https://bugzilla.kernel.org/show_bug.cgi?id=15407
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/532374
Confirmed by numerous testers in the launchpad bug that using acpi_sleep=sci_force_enable fixes the issue. We add the machines to acpisleep_dmi_table[] to automatically enable this workaround.
--- drivers/acpi/sleep.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+)
drivers/acpi/sleep.c +120 -0
@@ -450,6 +450,126 @@ static struct dmi_system_id __initdata a }, }, { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad W510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad W510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad W510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), + }, + }, + { .callback = init_old_suspend_ordering, .ident = "Panasonic CF51-2L", .matches = {
Re: [87/98] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
* Greg KH <[email protected]>:
Quoted 8 lines
From: Alex Chiang <[email protected]>
commit
07bedca29b0973f36a6b6db36936deed367164edupstream.Multiple Lenovo ThinkPad models with Intel Core i5/i7 CPUs can successfully suspend/resume once, and then hang on the second s/r cycle.
My comment on the same version of this patch for the .33-stable tree applies here too.
Thanks,
/ac
PATCH 88/98 power_meter: acpi_device_class "power_meter_resource" too long
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit 18262714ca0fb65c290b8ea1807b2b02bb52d0e3 upstream.
acpi_device_class can only be 19 characters and a NULL terminator.
The current code has a buffer overflow in acpi_power_meter_add():
strcpy(acpi_device_class(device), ACPI_POWER_METER_CLASS);
--- drivers/acpi/power_meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/power_meter.c +1 -1
@@ -34,7 +34,7 @@#define ACPI_POWER_METER_NAME "power_meter"ACPI_MODULE_NAME (ACPI_POWER_METER_NAME );#define ACPI_POWER_METER_DEVICE_NAME "Power Meter" -#define ACPI_POWER_METER_CLASS "power_meter_resource" +#define ACPI_POWER_METER_CLASS "pwr_meter_resource"#define NUM_SENSORS 17
PATCH 89/98 ACPI: sleep: init_set_sci_en_on_resume for Dell Studio 155x
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kamal Mostafa <[email protected]>
commit ea5bc73f4f56449b2d450068d492bcd17a675d7a upstream.
Add Dell Studio models (1558, 1557, 1555) to the 'set_sci_en_on_resume' list to fix hang on resume.
--- drivers/acpi/sleep.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/acpi/sleep.c +24 -0
@@ -578,6 +578,30 @@ static struct dmi_system_id __initdata a DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), }, }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Dell Studio 1558", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1558"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Dell Studio 1557", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1557"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Dell Studio 1555", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1555"), + }, + }, {}, };#endif /* CONFIG_SUSPEND */
PATCH 90/98 cpuidle: Fix incorrect optimization
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Arjan van de Ven <[email protected]>
commit 1c6fe0364fa7bf28248488753ee0afb6b759cd04 upstream.
commit 672917dcc78 ("cpuidle: menu governor: reduce latency on exit") added an optimization, where the analysis on the past idle period moved from the end of idle, to the beginning of the new idle.
Unfortunately, this optimization had a bug where it zeroed one key variable for new use, that is needed for the analysis. The fix is simple, zero the variable after doing the work from the previous idle.
During the audit of the code that found this issue, another issue was also found; the ->measured_us data structure member is never set, a local variable is always used instead.
--- drivers/cpuidle/governors/menu.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/cpuidle/governors/menu.c +4 -5
@@ -101,7 +101,6 @@ struct menu_device {unsigned int expected_us;u64 predicted_us; -unsigned int measured_us;unsigned int exit_us;unsigned int bucket;u64 correction_factor[BUCKETS ];
@@ -187,14 +186,14 @@ static int menu_select(struct cpuidle_deint i;int multiplier; - data->last_state_idx =0 ; - data->exit_us =0 ; -if (data->needs_update) {menu_update (dev); data->needs_update =0 ; } + data->last_state_idx =0 ; + data->exit_us =0 ; +/* Special case when user has set very strict latency requirement */ if (unlikely (latency_req ==0 ))return 0 ;
@@ -294,7 +293,7 @@ static void menu_update(struct cpuidle_d new_factor = data->correction_factor[data->bucket] * (DECAY -1 ) /DECAY ; -if (data->expected_us >0 && data->measured_us <MAX_INTERESTING ) +if (data->expected_us >0 && measured_us <MAX_INTERESTING ) new_factor +=RESOLUTION * measured_us / data->expected_us;else /*
PATCH 91/98 pxa/colibri: fix missing #include <mach/mfp.h> in colibri.h
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jakob Viketoft <[email protected]>
commit ccb8d8d070b8f25f0163da5c9ceacf63a5169540 upstream.
The use of mfp_cfg_t causes build errors without including <mach/mfp.h>.
--- arch/arm/mach-pxa/include/mach/colibri.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-pxa/include/mach/colibri.h +1 -0
@@ -2,6 +2,7 @@#define _COLIBRI_H_#include <net/ax88796.h> +#include <mach/mfp.h> /* * common settings for all modules
PATCH 92/98 SCSI: fix locking around blk_abort_request()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 70b25f890ce9f0520c64075ce9225a5b020a513e upstream.
blk_abort_request() expects queue lock to be held by the caller. Grab it before calling the function.
Lack of this synchronization led to infinite loop on corrupt q->timeout_list.
--- drivers/scsi/libsas/sas_ata.c | 4 ++++ drivers/scsi/libsas/sas_scsi_host.c | 4 ++++ 2 files changed, 8 insertions(+)
drivers/scsi/libsas/sas_ata.c +4 -0
@@ -394,11 +394,15 @@ int sas_ata_init_host_and_port(struct dovoid sas_ata_task_abort (struct sas_task *task) {struct ata_queued_cmd *qc = task->uldd_task; +struct request_queue *q = qc->scsicmd->device->request_queue;struct completion *waiting; +unsigned long flags;/* Bounce SCSI-initiated commands to the SCSI EH */ if (qc->scsicmd) { +spin_lock_irqsave (q->queue_lock, flags);blk_abort_request (qc->scsicmd->request); +spin_unlock_irqrestore (q->queue_lock, flags);scsi_schedule_eh (qc->scsicmd->device->host);return ; }
drivers/scsi/libsas/sas_scsi_host.c +4 -0
@@ -1025,6 +1025,8 @@ int __sas_task_abort(struct sas_task *tavoid sas_task_abort (struct sas_task *task) {struct scsi_cmnd *sc = task->uldd_task; +struct request_queue *q = sc->device->request_queue; +unsigned long flags;/* Escape for libsas internal commands */ if (!sc) {
@@ -1039,7 +1041,9 @@ void sas_task_abort(struct sas_task *tasreturn ; } +spin_lock_irqsave (q->queue_lock, flags);blk_abort_request (sc->request); +spin_unlock_irqrestore (q->queue_lock, flags);scsi_schedule_eh (sc->device->host); }
PATCH 93/98 SCSI: libiscsi: regression: fix header digest errors
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mike Christie <[email protected]>
commit 96b1f96dcab87756c0a1e7ba76bc5dc2add82b88 upstream.
This fixes a regression introduced with this commit:
commit d3305f3407fa3e9452079ec6cc8379067456e4aa
Author: Mike Christie <[email protected]> Date: Thu Aug 20 15:10:58 2009 -0500
[SCSI] libiscsi: don't increment cmdsn if cmd is not sent
in 2.6.32.
When I moved the hdr->cmdsn after init_task, I added a bug when header digests are used. The problem is that the LLD may calculate the header digest in init_task, so if we then set the cmdsn after the init_task call we change what the digest will be calculated by the target.
--- drivers/scsi/libiscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libiscsi.c +1 -1
@@ -384,12 +384,12 @@ static int iscsi_prep_scsi_cmd_pdu(strucWARN_ON (hdrlength >=256 ); hdr->hlength = hdrlength &0xFF ; + hdr->cmdsn = task->cmdsn =cpu_to_be32 (session->cmdsn);if (session->tt->init_task && session->tt->init_task (task))return -EIO ; task->state =ISCSI_TASK_RUNNING ; - hdr->cmdsn = task->cmdsn =cpu_to_be32 (session->cmdsn); session->cmdsn++; conn->scsicmd_pdus_cnt++;
PATCH 94/98 scsi_debug: virtual_gb ignores sector_size
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Douglas Gilbert <[email protected]>
commit 5447ed6c968e7270b656afa273c2b79d15d82edd upstream.
In the scsi_debug driver, the virtual_gb option ignores the sector_size, implicitly assuming that is 512 bytes. So if 'virtual_gb=1 sector_size=4096' the result is an 8 GB (virtual) disk.
--- drivers/scsi/scsi_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/scsi_debug.c +2 -1
@@ -914,7 +914,8 @@ static int resp_start_stop(struct scsi_cstatic sector_t get_sdebug_capacity (void ) {if (scsi_debug_virtual_gb >0 ) -return 2048 *1024 * (sector_t )scsi_debug_virtual_gb; +return (sector_t )scsi_debug_virtual_gb * + (1073741824 / scsi_debug_sector_size);else return sdebug_store_sectors; }
PATCH 95/98 Enable retries for SYNCRONIZE_CACHE commands to fix I/O error
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hannes Reinecke <[email protected]>
commit c213e1407be6b04b144794399a91472e0ef92aec upstream.
Some arrays are giving I/O errors with ext3 filesystems when SYNCHRONIZE_CACHE gets a UNIT_ATTENTION. What is happening is that these commands have no retries, so the UNIT_ATTENTION causes the barrier to fail. We should be enable retries here to clear any transient error and allow the barrier to succeed.
--- drivers/scsi/sd.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/sd.c +1 -0
@@ -971,6 +971,7 @@ static void sd_prepare_flush(struct requ { rq->cmd_type =REQ_TYPE_BLOCK_PC ; rq->timeout =SD_TIMEOUT ; + rq->retries =SD_MAX_RETRIES ; rq->cmd[0 ] =SYNCHRONIZE_CACHE ; rq->cmd_len =10 ; }
PATCH 96/98 SCSI: Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 I/O error
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: James Bottomley <[email protected]>
commit 77a4229719e511a0d38d9c355317ae1469adeb54 upstream.
There's nastyness in the way we currently handle barriers (and discards): They're effectively filesystem commands, but they get processed as BLOCK_PC commands. Unfortunately BLOCK_PC commands are taken by SCSI to be SG_IO commands and the issuer expects to see and handle any returned errors, however trivial. This leads to a huge problem, because the block layer doesn't expect this to happen and any trivially retryable error on a barrier causes an immediate I/O error to the filesystem.
The only real way to hack around this is to take the usual class of offending errors (unit attentions) and make them all retryable in the case of a REQ_HARDBARRIER. A correct fix would involve a rework of the entire block and SCSI submit system, and so is out of scope for a quick fix.
--- drivers/scsi/scsi_error.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/scsi/scsi_error.c +14 -1
@@ -301,7 +301,20 @@ static int scsi_check_sense(struct scsi_if (scmd->device->allow_restart && (sshdr.asc ==0x04 ) && (sshdr.ascq ==0x02 ))return FAILED ; -return SUCCESS ; + +if (blk_barrier_rq (scmd->request)) +/* +* barrier requests should always retry on UA +* otherwise block will get a spurious error +*/ +return NEEDS_RETRY ; +else +/* +* for normal (non barrier) commands, pass the +* UA upwards for a determination in the +* completion functions +*/ +return SUCCESS ;/* these three are not supported */ case COPY_ABORTED :
PATCH 97/98 MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
(cherry picked from commit e65c7f33d75e977350ca350573d93c517ec02776)
Previously it was unconditionally used on all Sibyte family SOCs. The M3 bug has to be handled in the TLB exception handler which is extremly performance sensitive, so this modification is expected to deliver around 2-3% performance improvment. This is important as required changes to the M3 workaround will make it more costly.
--- arch/mips/include/asm/mach-sibyte/war.h | 6 +++++- arch/mips/sibyte/sb1250/setup.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-)
arch/mips/include/asm/mach-sibyte/war.h +5 -1
@@ -16,7 +16,11 @@#if defined(CONFIG_SB1_PASS_1_WORKAROUNDS ) || \ defined(CONFIG_SB1_PASS_2_WORKAROUNDS ) -#define BCM1250_M3_WAR 1 +#ifndef __ASSEMBLY__ +extern int sb1250_m3_workaround_needed (void ); +#endif + +#define BCM1250_M3_WAR sb1250_m3_workaround_needed()#define SIBYTE_1956_WAR 1#else
arch/mips/sibyte/sb1250/setup.c +15 -0
@@ -87,6 +87,21 @@ static int __init setup_bcm1250(void)return ret; } +int sb1250_m3_workaround_needed (void ) +{ +switch (soc_type) { +case K_SYS_SOC_TYPE_BCM1250 : +case K_SYS_SOC_TYPE_BCM1250_ALT : +case K_SYS_SOC_TYPE_BCM1250_ALT2 : +case K_SYS_SOC_TYPE_BCM1125 : +case K_SYS_SOC_TYPE_BCM1125H : +return soc_pass <K_SYS_REVISION_BCM1250_C0 ; + +default : +return 0 ; + } +} +static int __init setup_bcm112x (void ) {int ret =0 ;
PATCH 98/98 MIPS: uasm: Add OR instruction.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
(cherry picked from commit 9c6befe8c744fa2f03cab36dead503c77950c3b8)
This is needed for the fix of the M3 workaround.
arch/mips/include/asm/uasm.h +1 -0
@@ -84,6 +84,7 @@ Ip_u2s3u1(_lw);Ip_u1u2u3 (_mfc0);Ip_u1u2u3 (_mtc0);Ip_u2u1u3 (_ori); +Ip_u3u1u2 (_or);Ip_u2s3u1 (_pref);Ip_0 (_rfe);Ip_u2s3u1 (_sc);
arch/mips/mm/uasm.c +3 -1
@@ -61,7 +61,7 @@ enum opcode { insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, insn_drotr, insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, - insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, + insn_mtc0, insn_or, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw, insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori, insn_dins };
@@ -116,6 +116,7 @@ static struct insn insn_table[] __cpuinitdata = { { insn_lw, M(lw_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, { insn_mfc0, M(cop0_op, mfc_op, 0, 0, 0, 0), RT | RD | SET}, { insn_mtc0, M(cop0_op, mtc_op, 0, 0, 0, 0), RT | RD | SET}, + { insn_or, M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD }, { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, { insn_pref, M(pref_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, { insn_rfe, M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0 },
@@ -370,6 +371,7 @@ I_u2s3u1(_lw) I_u1u2u3(_mfc0) I_u1u2u3(_mtc0) I_u2u1u3(_ori) +I_u3u1u2(_or) I_u2s3u1(_pref) I_0(_rfe) I_u2s3u1(_sc)
Signature · 1 line
1.6.6.1
Re: [Stable-review] [98/98] MIPS: uasm: Add OR instruction.
That seems to fail to apply to a 2.6.32.12 tree
Stefan
Quoted 50 lines · Greg KH
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
(cherry picked from commit
9c6befe8c744fa2f03cab36dead503c77950c3b8)This is needed for the fix of the M3 workaround.
Signed-off-by Ralf Baechle <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>arch/mips/include/asm/uasm.h +1
-0@@ -84,6 +84,7 @@ Ip_u2s3u1(_lw);Ip_u1u2u3 (_mfc0);Ip_u1u2u3 (_mtc0);Ip_u2u1u3 (_ori); +Ip_u3u1u2 (_or);Ip_u2s3u1 (_pref);Ip_0 (_rfe);Ip_u2s3u1 (_sc);arch/mips/mm/uasm.c +3
-1@@ -61,7 +61,7 @@ enum opcode { insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, insn_drotr, insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, - insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, + insn_mtc0, insn_or, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw, insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori, insn_dins };@@ -116,6 +116,7 @@ static struct insn insn_table[] __cpuinitdata = { { insn_lw, M(lw_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, { insn_mfc0, M(cop0_op, mfc_op, 0, 0, 0, 0), RT | RD | SET}, { insn_mtc0, M(cop0_op, mtc_op, 0, 0, 0, 0), RT | RD | SET}, + { insn_or, M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD }, { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, { insn_pref, M(pref_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, { insn_rfe, M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0 },@@ -370,6 +371,7 @@ I_u2s3u1(_lw) I_u1u2u3(_mfc0) I_u1u2u3(_mtc0) I_u2u1u3(_ori) +I_u3u1u2(_or) I_u2s3u1(_pref) I_0(_rfe) I_u2s3u1(_sc)
Re: [Stable-review] [98/98] MIPS: uasm: Add OR instruction.
Attached a quick backport on it.
Quoted 1 line
From
b0d6c56422165599c14e8cc10070f0ffbcf858abMon Sep 17 00:00:00 2001
From: Ralf Baechle <[email protected]>
Date: Fri, 23 Apr 2010 02:56:39 +0100
Subject: [PATCH] MIPS: uasm: Add OR instruction.
(cherry picked from commit 9c6befe8c744fa2f03cab36dead503c77950c3b8)
This is needed for the fix of the M3 workaround.
--- arch/mips/mm/uasm.c | 4 +++- arch/mips/mm/uasm.h | 1 + 2 files changed, 4 insertions(+), 1 deletions(-)
arch/mips/mm/uasm.c +3 -1
@@ -62,7 +62,7 @@ enum opcode { insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, - insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, + insn_mtc0, insn_or, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw, insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori };
@@ -116,6 +116,7 @@ static struct insn insn_table[] __cpuinitdata = { { insn_lw, M(lw_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, { insn_mfc0, M(cop0_op, mfc_op, 0, 0, 0, 0), RT | RD | SET}, { insn_mtc0, M(cop0_op, mtc_op, 0, 0, 0, 0), RT | RD | SET}, + { insn_or, M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD }, { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, { insn_pref, M(pref_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, { insn_rfe, M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0 },
@@ -362,6 +363,7 @@ I_u2s3u1(_lw) I_u1u2u3(_mfc0) I_u1u2u3(_mtc0) I_u2u1u3(_ori) +I_u3u1u2(_or) I_u2s3u1(_pref) I_0(_rfe) I_u2s3u1(_sc)
arch/mips/mm/uasm.h +1 -0
@@ -78,6 +78,7 @@ Ip_u2s3u1(_lw);Ip_u1u2u3 (_mfc0);Ip_u1u2u3 (_mtc0);Ip_u2u1u3 (_ori); +Ip_u3u1u2 (_or);Ip_u2s3u1 (_pref);Ip_0 (_rfe);Ip_u2s3u1 (_sc);
Signature · 1 line
1.7.0.4
Re: [Stable-review] [98/98] MIPS: uasm: Add OR instruction.
In reply to Stefan BaderQuoted 1 line · Stefan Bader
That seems to fail to apply to a 2.6.32.12 tree
Doh, you are right, I tried, and it failed. I'll just drop it for now, as it wasn't applied to the .33 tree either.
It didn't show up in the patch on kernel.org either.
Sorry about that.
greg k-h