2.6.32.5 review
Subsystems (31)
cover 2.6.32.5 review
This is the start of the stable review cycle for the 2.6.32.5 release. There are 30 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 Saturday, January 23, 2010 00: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.5-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +- arch/powerpc/kernel/pci-common.c | 13 +++++++++ arch/sparc/kernel/nmi.c | 3 +- arch/sparc/kernel/perf_event.c | 11 +++++++ arch/x86/kernel/apic/apic_flat_64.c | 5 +++ arch/x86/kernel/apic/x2apic_uv_x.c | 15 +++++----- arch/x86/kernel/cpu/mcheck/therm_throt.c | 5 ++- drivers/edac/i5000_edac.c | 8 +++++- drivers/gpu/drm/i915/i915_irq.c | 43 ++++++++++++----------------- drivers/hid/hid-apple.c | 7 +++++ drivers/hid/hid-core.c | 3 ++ drivers/hid/hid-ids.h | 3 ++ drivers/i2c/busses/i2c-pca-isa.c | 4 +- drivers/i2c/busses/i2c-pca-platform.c | 4 +- drivers/i2c/i2c-core.c | 5 ++- drivers/input/mouse/psmouse-base.c | 28 ++++++++++--------- drivers/media/video/gspca/sn9c20x.c | 2 +- drivers/mfd/wm8350-core.c | 3 +- drivers/pci/pci.c | 5 +++ drivers/pcmcia/cardbus.c | 2 +- drivers/platform/x86/asus-laptop.c | 8 +++++ drivers/scsi/megaraid/megaraid_sas.c | 2 +- drivers/serial/8250_pnp.c | 2 + drivers/video/s3c-fb.c | 14 +++++---- fs/notify/inotify/inotify_fsnotify.c | 2 +- fs/notify/inotify/inotify_user.c | 4 +- fs/reiserfs/inode.c | 17 +++++++++-- include/linux/blkdev.h | 11 ++++++- include/linux/mfd/wm8350/pmic.h | 28 +++++++++--------- include/linux/pci.h | 3 ++ kernel/futex.c | 27 ++++++++---------- kernel/sched.c | 6 ---- kernel/sched_clock.c | 23 ++++++++++----- mm/memcontrol.c | 11 +++----- mm/page_alloc.c | 2 +- mm/truncate.c | 30 +++++++++----------- sound/pci/hda/patch_realtek.c | 2 + 37 files changed, 221 insertions(+), 142 deletions(-)
PATCH 1/30 inotify: do not reuse watch descriptors
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Paris <[email protected]>
commit 9e572cc9877ee6c43af60778f6b8d5ba0692d935 upstream.
Since commit 7e790dd5fc937bc8d2400c30a05e32a9e9eef276 ("inotify: fix error paths in inotify_update_watch") inotify changed the manor in which it gave watch descriptors back to userspace. Previous to this commit inotify acted like the following:
inotify_add_watch(X, Y, Z) = 1 inotify_rm_watch(X, 1); inotify_add_watch(X, Y, Z) = 2
but after this patch inotify would return watch descriptors like so:
inotify_add_watch(X, Y, Z) = 1 inotify_rm_watch(X, 1); inotify_add_watch(X, Y, Z) = 1
which I saw as equivalent to opening an fd where
open(file) = 1; close(1); open(file) = 1;
seemed perfectly reasonable. The issue is that quite a bit of userspace apparently relies on the behavior in which watch descriptors will not be quickly reused. KDE relies on it, I know some selinux packages rely on it, and I have heard complaints from other random sources such as debian bug 558981.
Although the man page implies what we do is ok, we broke userspace so this patch almost reverts us to the old behavior. It is still slightly racey and I have patches that would fix that, but they are rather large and this will fix it for all real world cases. The race is as follows:
- task1 creates a watch and blocks in idr_new_watch() before it updates the hint.
- task2 creates a watch and updates the hint.
- task1 updates the hint with it's older wd
- task removes the watch created by task2
- task adds a new watch and will reuse the wd originally given to task2
it requires moving some locking around the hint (last_wd) but this should solve it for the real world and be -stable safe.
As a side effect this patch papers over a bug in the lib/idr code which is causing a large number WARN's to pop on people's system and many reports in kerneloops.org. I'm working on the root cause of that idr bug seperately but this should make inotify immune to that issue.
--- fs/notify/inotify/inotify_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/notify/inotify/inotify_user.c +2 -2
@@ -558,7 +558,7 @@ retry:spin_lock (&group->inotify_data.idr_lock); ret =idr_get_new_above (&group->inotify_data.idr, &tmp_ientry->fsn_entry, - group->inotify_data.last_wd, + group->inotify_data.last_wd+1 , &tmp_ientry->wd);spin_unlock (&group->inotify_data.idr_lock);if (ret) {
@@ -638,7 +638,7 @@ static struct fsnotify_group *inotify_nespin_lock_init (&group->inotify_data.idr_lock);idr_init (&group->inotify_data.idr); - group->inotify_data.last_wd =1 ; + group->inotify_data.last_wd =0 ; group->inotify_data.user = user; group->inotify_data.fa =NULL ;
PATCH 2/30 inotify: only warn once for inotify problems
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Paris <[email protected]>
commit 976ae32be45a736acd49215a7e4771ff91f161c3 upstream.
inotify will WARN() if it finds that the idr and the fsnotify internals somehow got out of sync. It was only supposed to do this once but due to this stupid bug it would warn every single time a problem was detected.
--- fs/notify/inotify/inotify_fsnotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/notify/inotify/inotify_fsnotify.c +1 -1
@@ -121,7 +121,7 @@ static int idr_callback(int id, void *p,if (warned)return 0 ; - warned = false; + warned = true; entry = p; ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);
PATCH 3/30 revert "drivers/video/s3c-fb.c: fix clock setting for Samsung SoC Framebuffer"
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <[email protected]>
commit eb29a5cc0b601c458bae9df2f6c3696d75c2d383 upstream.
Fix divide by zero and broken output. Commit 600ce1a0fa ("fix clock setting for Samsung SoC Framebuffer") introduced a mandatory refresh parameter to the platform data for the S3C framebuffer but did not introduce any validation code, causing existing platforms (none of which have refresh set) to divide by zero whenever the framebuffer is configured, generating warnings and unusable output.
Ben Dooks noted several problems with the patch:
- The platform data supplies the pixclk directly and should already have taken care of the refresh rate.
- The addition of a window ID parameter doesn't help since only the root framebuffer can control the pixclk.
- pixclk is specified in picoseconds (rather than Hz) as the patch assumed.
and suggests reverting the commit so do that. Without fixing this no mainline user of the driver will produce output.
--- drivers/video/s3c-fb.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/video/s3c-fb.c +8 -6
@@ -211,21 +211,23 @@ static int s3c_fb_check_var(struct fb_va/** * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock. -* @id: window id. * @sfb: The hardware state. * @pixclock: The pixel clock wanted, in picoseconds. * * Given the specified pixel clock, work out the necessary divider to get * close to the output frequency. */ -static int s3c_fb_calc_pixclk (unsigned char id,struct s3c_fb *sfb,unsigned int pixclk) +static int s3c_fb_calc_pixclk (struct s3c_fb *sfb,unsigned int pixclk) { -struct s3c_fb_pd_win *win = sfb->pdata->win[id];unsigned long clk =clk_get_rate (sfb->bus_clk); +unsigned long long tmp;unsigned int result; - pixclk *= win->win_mode.refresh; - result = clk / pixclk; + tmp = (unsigned long long )clk; + tmp *= pixclk; + +do_div (tmp,1000000000UL ); + result = (unsigned int )tmp /1000 ;dev_dbg (sfb->dev,"pixclk=%u, clk=%lu, div=%d (%lu)\n" , pixclk, clk, result, clk / result);
@@ -301,7 +303,7 @@ static int s3c_fb_set_par(struct fb_info/* use window 0 as the basis for the lcd output timings */ if (win_no ==0 ) { - clkdiv =s3c_fb_calc_pixclk (win_no, sfb, var->pixclock); + clkdiv =s3c_fb_calc_pixclk (sfb, var->pixclock); data = sfb->pdata->vidcon0; data &= ~(VIDCON0_CLKVAL_F_MASK |VIDCON0_CLKDIR );
PATCH 4/30 memcg: ensure list is empty at rmdir
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daisuke Nishimura <[email protected]>
commit fce66477578d081f19aef5ea218664ff7758c33a upstream.
Current mem_cgroup_force_empty() only ensures mem->res.usage == 0 on success. But this doesn't guarantee memcg's LRU is really empty, because there are some cases in which !PageCgrupUsed pages exist on memcg's LRU.
For example:
- Pages can be uncharged by its owner process while they are on LRU.
- race between mem_cgroup_add_lru_list() and __mem_cgroup_uncharge_common().
So there can be a case in which the usage is zero but some of the LRUs are not empty.
OTOH, mem_cgroup_del_lru_list(), which can be called asynchronously with rmdir, accesses the mem_cgroup, so this access can cause a problem if it races with rmdir because the mem_cgroup might have been freed by rmdir.
Actually, I saw a bug which seems to be caused by this race.
[1530745.949906] BUG: unable to handle kernel NULL pointer dereference at 0000000000000230 [1530745.950651] IP: [<ffffffff810fbc11>] mem_cgroup_del_lru_list+0x30/0x80 [1530745.950651] PGD 3863de067 PUD 3862c7067 PMD 0 [1530745.950651] Oops: 0002 [#1] SMP [1530745.950651] last sysfs file: /sys/devices/system/cpu/cpu7/cache/index1/shared_cpu_map [1530745.950651] CPU 3 [1530745.950651] Modules linked in: configs ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp nfsd nfs_acl auth_rpcgss exportfs autofs4 hidp rfcomm l2cap crc16 bluetooth lockd sunrpc ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp bnx2i cnic uio ipv6 cxgb3i cxgb3 mdio libiscsi_tcp libiscsi scsi_transport_iscsi dm_mirror dm_multipath scsi_dh video output sbs sbshc battery ac lp kvm_intel kvm sg ide_cd_mod cdrom serio_raw tpm_tis tpm tpm_bios acpi_memhotplug button parport_pc parport rtc_cmos rtc_core rtc_lib e1000 i2c_i801 i2c_core pcspkr dm_region_hash dm_log dm_mod ata_piix libata shpchp megaraid_mbox sd_mod scsi_mod megaraid_mm ext3 jbd uhci_hcd ohci_hcd ehci_hcd [last unloaded: freq_table] [1530745.950651] Pid: 19653, comm: shmem_test_02 Tainted: G M 2.6.32-mm1-00701-g2b04386 #3 Express5800/140Rd-4 [N8100-1065] [1530745.950651] RIP: 0010:[<ffffffff810fbc11>] [<ffffffff810fbc11>] mem_cgroup_del_lru_list+0x30/0x80 [1530745.950651] RSP: 0018:ffff8803863ddcb8 EFLAGS: 00010002 [1530745.950651] RAX: 00000000000001e0 RBX: ffff8803abc02238 RCX: 00000000000001e0 [1530745.950651] RDX: 0000000000000000 RSI: ffff88038611a000 RDI: ffff8803abc02238 [1530745.950651] RBP: ffff8803863ddcc8 R08: 0000000000000002 R09: ffff8803a04c8643 [1530745.950651] R10: 0000000000000000 R11: ffffffff810c7333 R12: 0000000000000000 [1530745.950651] R13: ffff880000017f00 R14: 0000000000000092 R15: ffff8800179d0310 [1530745.950651] FS: 0000000000000000(0000) GS:ffff880017800000(0000) knlGS:0000000000000000 [1530745.950651] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [1530745.950651] CR2: 0000000000000230 CR3: 0000000379d87000 CR4: 00000000000006e0 [1530745.950651] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [1530745.950651] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [1530745.950651] Process shmem_test_02 (pid: 19653, threadinfo ffff8803863dc000, task ffff88038612a8a0) [1530745.950651] Stack: [1530745.950651] ffffea00040c2fe8 0000000000000000 ffff8803863ddd98 ffffffff810c739a [1530745.950651] <0> 00000000863ddd18 000000000000000c 0000000000000000 0000000000000000 [1530745.950651] <0> 0000000000000002 0000000000000000 ffff8803863ddd68 0000000000000046 [1530745.950651] Call Trace: [1530745.950651] [<ffffffff810c739a>] release_pages+0x142/0x1e7 [1530745.950651] [<ffffffff810c778f>] ? pagevec_move_tail+0x6e/0x112 [1530745.950651] [<ffffffff810c781e>] pagevec_move_tail+0xfd/0x112 [1530745.950651] [<ffffffff810c78a9>] lru_add_drain+0x76/0x94 [1530745.950651] [<ffffffff810dba0c>] exit_mmap+0x6e/0x145 [1530745.950651] [<ffffffff8103f52d>] mmput+0x5e/0xcf [1530745.950651] [<ffffffff81043ea8>] exit_mm+0x11c/0x129 [1530745.950651] [<ffffffff8108fb29>] ? audit_free+0x196/0x1c9 [1530745.950651] [<ffffffff81045353>] do_exit+0x1f5/0x6b7 [1530745.950651] [<ffffffff8106133f>] ? up_read+0x2b/0x2f [1530745.950651] [<ffffffff8137d187>] ? lockdep_sys_exit_thunk+0x35/0x67 [1530745.950651] [<ffffffff81045898>] do_group_exit+0x83/0xb0 [1530745.950651] [<ffffffff810458dc>] sys_exit_group+0x17/0x1b [1530745.950651] [<ffffffff81002c1b>] system_call_fastpath+0x16/0x1b [1530745.950651] Code: 54 53 0f 1f 44 00 00 83 3d cc 29 7c 00 00 41 89 f4 75 63 eb 4e 48 83 7b 08 00 75 04 0f 0b eb fe 48 89 df e8 18 f3 ff ff 44 89 e2 <48> ff 4c d0 50 48 8b 05 2b 2d 7c 00 48 39 43 08 74 39 48 8b 4b [1530745.950651] RIP [<ffffffff810fbc11>] mem_cgroup_del_lru_list+0x30/0x80 [1530745.950651] RSP <ffff8803863ddcb8> [1530745.950651] CR2: 0000000000000230 [1530745.950651] ---[ end trace c3419c1bb8acc34f ]--- [1530745.950651] Fixing recursive fault but reboot is needed!
The problem here is pages on LRU may contain pointer to stale memcg. To make res->usage to be 0, all pages on memcg must be uncharged or moved to another(parent) memcg. Moved page_cgroup have already removed from original LRU, but uncharged page_cgroup contains pointer to memcg withou PCG_USED bit. (This asynchronous LRU work is for improving performance.) If PCG_USED bit is not set, page_cgroup will never be added to memcg's LRU. So, about pages not on LRU, they never access stale pointer. Then, what we have to take care of is page_cgroup _on_ LRU list. This patch fixes this problem by making mem_cgroup_force_empty() visit all LRUs before exiting its loop and guarantee there are no pages on its LRU.
--- mm/memcontrol.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
mm/memcontrol.c +4 -7
@@ -2381,7 +2381,7 @@ static int mem_cgroup_force_empty(structif (free_all) goto try_to_free; move_account: -while (mem->res.usage >0 ) { + do { ret = -EBUSY; if (cgroup_task_count(cgrp) || !list_empty(&cgrp->children)) goto out;
@@ -2408,8 +2408,8 @@ move_account:if (ret == -ENOMEM ) goto try_to_free;cond_resched (); - } - ret =0 ; +/* "ret" should also be checked to ensure all lists are empty. */ + }while (mem->res.usage >0 || ret); out:css_put (&mem->css);return ret;
@@ -2442,10 +2442,7 @@ try_to_free: }lru_add_drain ();/* try move_account...there may be some *locked* pages. */ -if (mem->res.usage) - goto move_account; - ret =0 ; - goto out; + goto move_account; }int mem_cgroup_force_empty_write (struct cgroup *cont,unsigned int event)
PATCH 5/30 drm/i915: remove loop in Ironlake interrupt handler
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zou Nan hai <[email protected]>
commit c7c85101afd0cb8ce497456d12ee1cad4aad152f upstream.
On Ironlake, there is an interrupt master control bit. With the bit disabled before clearing IIR, we do not need to handle extra interrupt in a loop. This patch removes the loop in Ironlake interrupt handler. It fixed irq lost issue on some Ironlake platforms.
--- drivers/gpu/drm/i915/i915_irq.c | 43 ++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 25 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +18 -25
@@ -255,7 +255,6 @@ irqreturn_t igdng_irq_handler(struct drmdrm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;int ret =IRQ_NONE ;u32 de_iir, gt_iir, de_ier; -u32 new_de_iir, new_gt_iir;struct drm_i915_master_private *master_priv;/* disable master interrupt before clearing iir */
@@ -266,35 +265,29 @@ irqreturn_t igdng_irq_handler(struct drm de_iir =I915_READ (DEIIR ); gt_iir =I915_READ (GTIIR ); -for (;;) { -if (de_iir ==0 && gt_iir ==0 ) -break ; - - ret =IRQ_HANDLED ; - -I915_WRITE (DEIIR , de_iir); - new_de_iir =I915_READ (DEIIR ); -I915_WRITE (GTIIR , gt_iir); - new_gt_iir =I915_READ (GTIIR ); +if (de_iir ==0 && gt_iir ==0 ) + goto done; -if (dev->primary->master) { - master_priv = dev->primary->master->driver_priv; -if (master_priv->sarea_priv) - master_priv->sarea_priv->last_dispatch = -READ_BREADCRUMB (dev_priv); - } + ret =IRQ_HANDLED ; -if (gt_iir >_USER_INTERRUPT ) { -u32 seqno =i915_get_gem_seqno (dev); - dev_priv->mm.irq_gem_seqno = seqno; -trace_i915_gem_request_complete (dev, seqno); -DRM_WAKEUP (&dev_priv->irq_queue); - } +if (dev->primary->master) { + master_priv = dev->primary->master->driver_priv; +if (master_priv->sarea_priv) + master_priv->sarea_priv->last_dispatch = +READ_BREADCRUMB (dev_priv); + } - de_iir = new_de_iir; - gt_iir = new_gt_iir; +if (gt_iir >_USER_INTERRUPT ) { +u32 seqno =i915_get_gem_seqno (dev); + dev_priv->mm.irq_gem_seqno = seqno; +trace_i915_gem_request_complete (dev, seqno); +DRM_WAKEUP (&dev_priv->irq_queue); } +I915_WRITE (GTIIR , gt_iir); +I915_WRITE (DEIIR , de_iir); + +done:I915_WRITE (DEIER , de_ier); (void )I915_READ (DEIER );
PATCH 6/30 block: Fix incorrect reporting of partition alignment
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: "Martin K. Petersen" <[email protected]>
commit 81744ee44ab2845c16ffd7d6f762f7b4a49a4750 upstream
queue_sector_alignment_offset returned the wrong value which caused partitions to report an incorrect alignment_offset. Since offset calculation is needed several places it has been split into a separate helper function.
--- include/linux/blkdev.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
include/linux/blkdev.h +9 -2
@@ -1114,11 +1114,18 @@ static inline int queue_alignment_offsetreturn q->limits.alignment_offset; } +static inline int queue_limit_alignment_offset (struct queue_limits *lim,sector_t offset) +{ +unsigned int granularity =max (lim->physical_block_size, lim->io_min); + + offset &= granularity -1 ; +return (granularity + lim->alignment_offset - offset) & (granularity -1 ); +} +static inline int queue_sector_alignment_offset (struct request_queue *q,sector_t sector) { -return ((sector <<9 ) - q->limits.alignment_offset) - & (q->limits.io_min -1 ); +return queue_limit_alignment_offset (&q->limits, sector <<9 ); }static inline int bdev_alignment_offset (struct block_device *bdev)
PATCH 7/30 x86, mce: Thermal monitoring depends on APIC being enabled
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 485a2e1973fd9f98c2c6776e66ac4721882b69e0 upstream.
Add check if APIC is not disabled since thermal monitoring depends on it. As only apic gets disabled we should not try to install "thermal monitor" vector, print out that thermal monitoring is enabled and etc...
Note that "Intel Correct Machine Check Interrupts" already has such a check.
Also I decided to not add cpu_has_apic check into mcheck_intel_therm_init since even if it'll call apic_read on disabled apic -- it's safe here and allow us to save a few code bytes.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/mcheck/therm_throt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/mcheck/therm_throt.c +3 -2
@@ -274,8 +274,9 @@ void intel_init_thermal(struct cpuinfo_xint tm2 =0 ;u32 l, h; -/* Thermal monitoring depends on ACPI and clock modulation*/ -if (!cpu_has (c,X86_FEATURE_ACPI ) || !cpu_has (c,X86_FEATURE_ACC )) +/* Thermal monitoring depends on APIC, ACPI and clock modulation */ +if (!cpu_has_apic || !cpu_has (c,X86_FEATURE_ACPI ) || + !cpu_has (c,X86_FEATURE_ACC ))return ;/*
PATCH 8/30 futexes: Remove rw parameter from get_futex_key()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 7485d0d3758e8e6491a5c9468114e74dc050785d upstream.
Currently, futexes have two problem:
A) The current futex code doesn't handle private file mappings properly.
get_futex_key() uses PageAnon() to distinguish file and anon, which can cause the following bad scenario:
1) thread-A call futex(private-mapping, FUTEX_WAIT), it sleeps on file mapping object.
2) thread-B writes a variable and it makes it cow.
3) thread-B calls futex(private-mapping, FUTEX_WAKE), it wakes up blocked thread on the anonymous page. (but it's nothing)
B) Current futex code doesn't handle zero page properly.
Read mode get_user_pages() can return zero page, but current futex code doesn't handle it at all. Then, zero page makes infinite loop internally.
The solution is to use write mode get_user_page() always for page lookup. It prevents the lookup of both file page of private mappings and zero page.
Performance concerns:
Probaly very little, because glibc always initialize variables for futex before to call futex(). It means glibc users never see the overhead of this patch.
Compatibility concerns:
This patch has few compatibility issues. After this patch, FUTEX_WAIT require writable access to futex variables (read-only mappings makes EFAULT). But practically it's not a problem, glibc always initalizes variables for futexes explicitly - nobody uses read-only mappings.
LKML-Reference: <[email protected]>
--- kernel/futex.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-)
kernel/futex.c +12 -15
@@ -203,8 +203,6 @@ static void drop_futex_key_refs(union fu* @uaddr: virtual address of the futex * @fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED * @key: address where result is stored. -* @rw: mapping needs to be read/write (values: VERIFY_READ, -* VERIFY_WRITE) * * Returns a negative error code or 0 * The key words are stored in *key on success.
@@ -216,7 +214,7 @@ static void drop_futex_key_refs(union fu* lock_page() might sleep, the caller should not hold a spinlock. */ static int -get_futex_key (u32 __user *uaddr,int fshared,union futex_key *key,int rw) +get_futex_key (u32 __user *uaddr,int fshared,union futex_key *key) {unsigned long address = (unsigned long )uaddr;struct mm_struct *mm = current->mm;
@@ -239,7 +237,7 @@ get_futex_key(u32 __user *uaddr, int fsh* but access_ok() should be faster than find_vma() */ if (!fshared) { -if (unlikely (!access_ok (rw, uaddr,sizeof (u32)))) +if (unlikely (!access_ok (VERIFY_WRITE , uaddr,sizeof (u32))))return -EFAULT ; key->private.mm = mm; key->private.address = address;
@@ -248,7 +246,7 @@ get_futex_key(u32 __user *uaddr, int fsh } again: - err =get_user_pages_fast (address,1 , rw ==VERIFY_WRITE , &page); + err =get_user_pages_fast (address,1 ,1 , &page);if (err <0 )return err;
@@ -867,7 +865,7 @@ static int futex_wake(u32 __user *uaddr,if (!bitset)return -EINVAL ; - ret =get_futex_key (uaddr, fshared, &key,VERIFY_READ ); + ret =get_futex_key (uaddr, fshared, &key);if (unlikely (ret !=0 )) goto out;
@@ -913,10 +911,10 @@ futex_wake_op(u32 __user *uaddr1, int fsint ret, op_ret; retry: - ret =get_futex_key (uaddr1, fshared, &key1,VERIFY_READ ); + ret =get_futex_key (uaddr1, fshared, &key1);if (unlikely (ret !=0 )) goto out; - ret =get_futex_key (uaddr2, fshared, &key2,VERIFY_WRITE ); + ret =get_futex_key (uaddr2, fshared, &key2);if (unlikely (ret !=0 )) goto out_put_key1;
@@ -1175,11 +1173,10 @@ retry: pi_state =NULL ; } - ret =get_futex_key (uaddr1, fshared, &key1,VERIFY_READ ); + ret =get_futex_key (uaddr1, fshared, &key1);if (unlikely (ret !=0 )) goto out; - ret =get_futex_key (uaddr2, fshared, &key2, - requeue_pi ?VERIFY_WRITE :VERIFY_READ ); + ret =get_futex_key (uaddr2, fshared, &key2);if (unlikely (ret !=0 )) goto out_put_key1;
@@ -1738,7 +1735,7 @@ static int futex_wait_setup(u32 __user **/ retry: q->key =FUTEX_KEY_INIT ; - ret =get_futex_key (uaddr, fshared, &q->key,VERIFY_READ ); + ret =get_futex_key (uaddr, fshared, &q->key);if (unlikely (ret !=0 ))return ret;
@@ -1904,7 +1901,7 @@ static int futex_lock_pi(u32 __user *uad q.requeue_pi_key =NULL ; retry: q.key =FUTEX_KEY_INIT ; - ret =get_futex_key (uaddr, fshared, &q.key,VERIFY_WRITE ); + ret =get_futex_key (uaddr, fshared, &q.key);if (unlikely (ret !=0 )) goto out;
@@ -2023,7 +2020,7 @@ retry:if ((uval &FUTEX_TID_MASK ) !=task_pid_vnr (current))return -EPERM ; - ret =get_futex_key (uaddr, fshared, &key,VERIFY_WRITE ); + ret =get_futex_key (uaddr, fshared, &key);if (unlikely (ret !=0 )) goto out;
@@ -2215,7 +2212,7 @@ static int futex_wait_requeue_pi(u32 __u rt_waiter.task =NULL ; key2 =FUTEX_KEY_INIT ; - ret =get_futex_key (uaddr2, fshared, &key2,VERIFY_WRITE ); + ret =get_futex_key (uaddr2, fshared, &key2);if (unlikely (ret !=0 )) goto out;
PATCH 9/30 page allocator: update NR_FREE_PAGES only when necessary
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 6ccf80eb15ccaca4d3f1ab5162b9ded5eecd9971 upstream.
commit f2260e6b (page allocator: update NR_FREE_PAGES only as necessary) made one minor regression. if __rmqueue() was failed, NR_FREE_PAGES stat go wrong. this patch fixes it.
--- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
@@ -1225,10 +1225,10 @@ again: }spin_lock_irqsave (&zone->lock, flags); page =__rmqueue (zone, order, migratetype); -__mod_zone_page_state (zone,NR_FREE_PAGES , -(1 << order));spin_unlock (&zone->lock);if (!page) goto failed; +__mod_zone_page_state (zone,NR_FREE_PAGES , -(1 << order)); }__count_zone_vm_events (PGALLOC , zone,1 << order);
PATCH 10/30 x86, apic: use physical mode for IBM summit platforms
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Suresh Siddha <[email protected]>
commit dfea91d5a7c795fd6f4e1a97489a98e4e767463e upstream.
Chris McDermott from IBM confirmed that hurricane chipset in IBM summit platforms doesn't support logical flat mode. Irrespective of the other things like apic_id's, total number of logical cpu's, Linux kernel should default to physical mode for this system.
The 32-bit kernel does so using the OEM checks for the IBM summit platform. Add a similar OEM platform check for the 64bit kernel too.
Otherwise the linux kernel boot can hang on this platform under certain bios/platform settings.
--- arch/x86/kernel/apic/apic_flat_64.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/x86/kernel/apic/apic_flat_64.c +5 -0
@@ -240,6 +240,11 @@ static int physflat_acpi_madt_oem_check(printk (KERN_DEBUG "system APIC only can use physical flat" ); return 1; } + +if (!strncmp (oem_id,"IBM" ,3 ) && !strncmp (oem_table_id,"EXA" ,3 )) { +printk (KERN_DEBUG "IBM Summit detected, will use apic physical" ); +return 1 ; + }#endif return 0 ;
PATCH 11/30 edac: i5000_edac critical fix panic out of bounds
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tamas Vincze <[email protected]>
commit 118f3e1afd5534c15f9701f33514186cfc841a27 upstream.
EDAC MC0: INTERNAL ERROR: channel-b out of range (4 >= 4)
Kernel panic - not syncing: EDAC MC0: Uncorrected Error (XEN) Domain 0 crashed: 'noreboot' set - not rebooting.
This happens because FERR_NF_FBD bit 28 is not updated on i5000. Due to that, both bits 28 and 29 may be equal to one, returning channel = 3. As this value is invalid, EDAC core generates the panic.
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=14568
--- drivers/edac/i5000_edac.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/edac/i5000_edac.c +7 -1
@@ -577,7 +577,13 @@ static void i5000_process_nonfatal_errordebugf0 ("\tUncorrected bits= 0x%x\n" , ue_errors); branch =EXTRACT_FBDCHAN_INDX (info->ferr_nf_fbd); - channel = branch; + +/* +* According with i5000 datasheet, bit 28 has no significance +* for errors M4Err-M12Err and M17Err-M21Err, on FERR_NF_FBD +*/ + channel = branch &2 ; + bank =NREC_BANK (info->nrecmema); rank =NREC_RANK (info->nrecmema); rdwr =NREC_RDWR (info->nrecmema);
PATCH 12/30 x86: SGI UV: Fix mapping of MMIO registers
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mike Travis <[email protected]>
commit fcfbb2b5facd65efa7284cc315225bfe3d1856c2 upstream.
This fixes the problem of the initialization code not correctly mapping the entire MMIO space on a UV system. A side effect is the map_high() interface needed to be changed to accommodate different address and size shifts.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/apic/x2apic_uv_x.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
arch/x86/kernel/apic/x2apic_uv_x.c +8 -7
@@ -364,13 +364,13 @@ static __init void get_lowmem_redirect(uenum map_type {map_wb, map_uc}; -static __init void map_high (char *id,unsigned long base,int shift, -int max_pnode,enum map_type map_type) +static __init void map_high (char *id,unsigned long base,int pshift, +int bshift,int max_pnode,enum map_type map_type) {unsigned long bytes, paddr; - paddr = base << shift; - bytes = (1UL << shift) * (max_pnode +1 ); + paddr = base << pshift; + bytes = (1UL << bshift) * (max_pnode +1 );printk (KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n" , id, paddr, paddr + bytes);if (map_type == map_uc)
@@ -386,7 +386,7 @@ static __init void map_gru_high(int max_ gru.v =uv_read_local_mmr (UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR );if (gru.s.enable) -map_high ("GRU" , gru.s.base, shift, max_pnode, map_wb); +map_high ("GRU" , gru.s.base, shift, shift, max_pnode, map_wb); }static __init void map_mmr_high (int max_pnode)
@@ -396,7 +396,7 @@ static __init void map_mmr_high(int max_ mmr.v =uv_read_local_mmr (UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR );if (mmr.s.enable) -map_high ("MMR" , mmr.s.base, shift, max_pnode, map_uc); +map_high ("MMR" , mmr.s.base, shift, shift, max_pnode, map_uc); }static __init void map_mmioh_high (int max_pnode)
@@ -406,7 +406,8 @@ static __init void map_mmioh_high(int ma mmioh.v =uv_read_local_mmr (UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR );if (mmioh.s.enable) -map_high ("MMIOH" , mmioh.s.base, shift, max_pnode, map_uc); +map_high ("MMIOH" , mmioh.s.base, shift, mmioh.s.m_io, + max_pnode, map_uc); }static __init void uv_rtc_init (void )
PATCH 13/30 mfd: WM835x GPIO direction register is not locked
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <[email protected]>
commit 8e6ba2dfa2d6c4691a83a63e211990a8bd7b788b upstream.
No need to set the security key when writing to it.
--- drivers/mfd/wm8350-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mfd/wm8350-core.c +1 -2
@@ -134,8 +134,7 @@ static inline int is_reg_locked(struct w wm8350->reg_cache[WM8350_SECURITY] == WM8350_UNLOCK_KEY)return 0 ; -if ((reg ==WM8350_GPIO_CONFIGURATION_I_O ) || - (reg >=WM8350_GPIO_FUNCTION_SELECT_1 && +if ((reg >=WM8350_GPIO_FUNCTION_SELECT_1 && reg <=WM8350_GPIO_FUNCTION_SELECT_4 ) || (reg >=WM8350_BATTERY_CHARGER_CONTROL_1 && reg <=WM8350_BATTERY_CHARGER_CONTROL_3 ))
PATCH 14/30 mfd: Correct WM835x ISINK ramp time defines
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <[email protected]>
commit 9dffe2a32b0deef52605d50527c0d240b15cabf7 upstream.
The constants used to specify ISINK ramp times for WM835x had the wrong shifts so that the on times applied to the off ramp and vice versa. The masks for the bitfields are correct.
--- include/linux/mfd/wm8350/pmic.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
include/linux/mfd/wm8350/pmic.h +14 -14
@@ -666,20 +666,20 @@#define WM8350_ISINK_FLASH_DUR_64MS (1 << 8)#define WM8350_ISINK_FLASH_DUR_96MS (2 << 8)#define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8) -#define WM8350_ISINK_FLASH_ON_INSTANT (0 << 4) -#define WM8350_ISINK_FLASH_ON_0_25S (1 << 4) -#define WM8350_ISINK_FLASH_ON_0_50S (2 << 4) -#define WM8350_ISINK_FLASH_ON_1_00S (3 << 4) -#define WM8350_ISINK_FLASH_ON_1_95S (1 << 4) -#define WM8350_ISINK_FLASH_ON_3_91S (2 << 4) -#define WM8350_ISINK_FLASH_ON_7_80S (3 << 4) -#define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 0) -#define WM8350_ISINK_FLASH_OFF_0_25S (1 << 0) -#define WM8350_ISINK_FLASH_OFF_0_50S (2 << 0) -#define WM8350_ISINK_FLASH_OFF_1_00S (3 << 0) -#define WM8350_ISINK_FLASH_OFF_1_95S (1 << 0) -#define WM8350_ISINK_FLASH_OFF_3_91S (2 << 0) -#define WM8350_ISINK_FLASH_OFF_7_80S (3 << 0) +#define WM8350_ISINK_FLASH_ON_INSTANT (0 << 0) +#define WM8350_ISINK_FLASH_ON_0_25S (1 << 0) +#define WM8350_ISINK_FLASH_ON_0_50S (2 << 0) +#define WM8350_ISINK_FLASH_ON_1_00S (3 << 0) +#define WM8350_ISINK_FLASH_ON_1_95S (1 << 0) +#define WM8350_ISINK_FLASH_ON_3_91S (2 << 0) +#define WM8350_ISINK_FLASH_ON_7_80S (3 << 0) +#define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 4) +#define WM8350_ISINK_FLASH_OFF_0_25S (1 << 4) +#define WM8350_ISINK_FLASH_OFF_0_50S (2 << 4) +#define WM8350_ISINK_FLASH_OFF_1_00S (3 << 4) +#define WM8350_ISINK_FLASH_OFF_1_95S (1 << 4) +#define WM8350_ISINK_FLASH_OFF_3_91S (2 << 4) +#define WM8350_ISINK_FLASH_OFF_7_80S (3 << 4)/* * Regulator Interrupts.
PATCH 15/30 ALSA: hda - Fix missing capture mixer for ALC861/660 codecs
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit c7a8eb103248a110cdbe0530d8c5ce987f099eee upstream.
The capture-related mixer elements are missing with ALC861/ALC660 codecs when quirks are present, due to missing call of set_capture_mixer().
Reference: Novell bnc#567340
http://bugzilla.novell.com/show_bug.cgi?id=567340
--- sound/pci/hda/patch_realtek.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_realtek.c +2 -0
@@ -14685,6 +14685,8 @@ static int patch_alc861(struct hda_codec spec->stream_digital_playback = &alc861_pcm_digital_playback; spec->stream_digital_capture = &alc861_pcm_digital_capture; +if (!spec->cap_mixer) +set_capture_mixer (codec);set_beep_amp (spec,0x23 ,0 ,HDA_OUTPUT ); spec->vmaster_nid =0x03 ;
PATCH 16/30 V4L/DVB (13868): gspca - sn9c20x: Fix test of unsigned.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Roel Kluin <[email protected]>
commit c60503c1db76bd46577cc7ff4fafa033b675e0e5 upstream.
--- drivers/media/video/gspca/sn9c20x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/video/gspca/sn9c20x.c +1 -1
@@ -2319,7 +2319,7 @@ static void do_autogain(struct gspca_dev } }if (avg_lum >MAX_AVG_LUM ) { -if (sd->gain -1 >=0 ) { +if (sd->gain >=1 ) { sd->gain--;set_gain (gspca_dev); }
PATCH 17/30 reiserfs: truncate blocks not used by a write
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jan Kara <[email protected]>
commit ec8e2f7466ca370f5e09000ca40a71759afc9ac8 upstream.
It can happen that write does not use all the blocks allocated in write_begin either because of some filesystem error (like ENOSPC) or because page with data to write has been removed from memory. We truncate these blocks so that we don't have dangling blocks beyond i_size.
--- fs/reiserfs/inode.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
fs/reiserfs/inode.c +14 -3
@@ -2531,6 +2531,12 @@ static int reiserfs_writepage(struct pagreturn reiserfs_write_full_page (page, wbc); } +static void reiserfs_truncate_failed_write (struct inode *inode) +{ +truncate_inode_pages (inode->i_mapping, inode->i_size); +reiserfs_truncate_file (inode,0 ); +} + static int reiserfs_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags,
@@ -2597,6 +2603,8 @@ static int reiserfs_write_begin(struct fif (ret) {unlock_page (page);page_cache_release (page); +/* Truncate allocated blocks */ +reiserfs_truncate_failed_write (inode); }return ret; }
@@ -2689,8 +2697,7 @@ static int reiserfs_write_end(struct fil** transaction tracking stuff when the size changes. So, we have ** to do the i_size updates here. */ - pos += copied; -if (pos > inode->i_size) { +if (pos + copied > inode->i_size) {struct reiserfs_transaction_handle myth;reiserfs_write_lock (inode->i_sb);/* If the file have grown beyond the border where it
@@ -2708,7 +2715,7 @@ static int reiserfs_write_end(struct fil goto journal_error; }reiserfs_update_inode_transaction (inode); - inode->i_size = pos; + inode->i_size = pos + copied;/* * this will just nest into our transaction. It's important * to use mark_inode_dirty so the inode gets pushed around on the
@@ -2735,6 +2742,10 @@ static int reiserfs_write_end(struct fil out:unlock_page (page);page_cache_release (page); + +if (pos + len > inode->i_size) +reiserfs_truncate_failed_write (inode); +return ret ==0 ? copied : ret; journal_error:
PATCH 18/30 HID: add device IDs for new model of Apple Wireless Keyboard
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Schuerer-Waldheim <[email protected]>
commit 23aeb61e7e1f02fb0f3b8f9e798e75537ca1731d upstream.
Added device IDs for the new model of the Apple Wireless Keyboard (November 2009).
--- drivers/hid/hid-apple.c | 7 +++++++ drivers/hid/hid-core.c | 3 +++ drivers/hid/hid-ids.h | 3 +++ 3 files changed, 13 insertions(+)
drivers/hid/hid-apple.c +7 -0
@@ -431,6 +431,13 @@ static const struct hid_device_id apple_ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), + .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | + APPLE_ISO_KEYBOARD }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS), + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
drivers/hid/hid-core.c +3 -0
@@ -1287,6 +1287,9 @@ static const struct hid_device_id hid_bl { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
drivers/hid/hid-ids.h +3 -0
@@ -88,6 +88,9 @@#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238 +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239 +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b#define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241
PATCH 19/30 PCI/cardbus: Add a fixup hook and fix powerpc
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Benjamin Herrenschmidt <[email protected]>
commit 2d1c861871d767153538a77c498752b36d4bb4b8 upstream
The cardbus code creates PCI devices without ever going through the necessary fixup bits and pieces that normal PCI devices go through.
There's in fact a commented out call to pcibios_fixup_bus() in there, it's commented because ... it doesn't work.
I could make pcibios_fixup_bus() do the right thing on powerpc easily but I felt it cleaner instead to provide a specific hook pci_fixup_cardbus for which a weak empty implementation is provided by the PCI core.
This fixes cardbus on powerbooks and probably all other PowerPC platforms which was broken completely for ever on some platforms and since 2.6.31 on others such as PowerBooks when we made the DMA ops mandatory (since those are setup by the fixups).
--- arch/powerpc/kernel/pci-common.c | 13 +++++++++++++ drivers/pci/pci.c | 5 +++++ drivers/pcmcia/cardbus.c | 2 +- include/linux/pci.h | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-)
arch/powerpc/kernel/pci-common.c +13 -0
@@ -1107,6 +1107,12 @@ void __devinit pcibios_setup_bus_deviceslist_for_each_entry (dev, &bus->devices, bus_list) {struct dev_archdata *sd = &dev->dev.archdata; +/* Cardbus can call us to add new devices to a bus, so ignore +* those who are already fully discovered +*/ +if (dev->is_added) +continue ; +/* Setup OF node pointer in archdata */ sd->of_node =pci_device_to_OF_node (dev);
@@ -1147,6 +1153,13 @@ void __devinit pcibios_fixup_bus(struct }EXPORT_SYMBOL (pcibios_fixup_bus); +void __devinit pci_fixup_cardbus (struct pci_bus *bus) +{ +/* Now fixup devices on that bus */ +pcibios_setup_bus_devices (bus); +} + +static int skip_isa_ioresource_align (struct pci_dev *dev) { if ((ppc_pci_flags & PPC_PCI_CAN_SKIP_ISA_ALIGN) &&
drivers/pci/pci.c +5 -0
@@ -2723,6 +2723,11 @@ int __attribute__ ((weak)) pci_ext_cfg_areturn 1 ; } +void __weak pci_fixup_cardbus (struct pci_bus *bus) +{ +} +EXPORT_SYMBOL (pci_fixup_cardbus); +static int __init pci_setup (char *str) {while (str) {
drivers/pcmcia/cardbus.c +1 -1
@@ -214,7 +214,7 @@ int __ref cb_alloc(struct pcmcia_socketunsigned int max, pass; s->functions =pci_scan_slot (bus,PCI_DEVFN (0 ,0 )); -// pcibios_fixup_bus(bus); +pci_fixup_cardbus (bus); max = bus->secondary;for (pass =0 ; pass <2 ; pass++)
include/linux/pci.h +3 -0
@@ -564,6 +564,9 @@ void pcibios_align_resource(void *, stru resource_size_t);void pcibios_update_irq (struct pci_dev *,int irq); +/* Weak but can be overriden by arch */ +void pci_fixup_cardbus (struct pci_bus *); +/* Generic PCI functions used internally */ extern struct pci_bus *pci_find_bus (int domain,int busnr);
PATCH 20/30 megaraid_sas: remove sysfs poll_mode_io world writeable permissions
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bryn M. Reeves <[email protected]>
commit bb7d3f24c71e528989501617651b669fbed798cb upstream.
/sys/bus/pci/drivers/megaraid_sas/poll_mode_io defaults to being world-writable, which seems bad (letting any user affect kernel driver behavior).
This turns off group and user write permissions, so that on typical production systems only root can write to it.
--- drivers/scsi/megaraid/megaraid_sas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas.c +1 -1
@@ -3451,7 +3451,7 @@ out:return retval; } -static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUGO, +static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUSR, megasas_sysfs_show_poll_mode_io, megasas_sysfs_set_poll_mode_io);
PATCH 21/30 Input: pmouse - move Sentelic probe down the list
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tai-hwa Liang <[email protected]>
commit 4a18b3ab6ed537b055e3fcfca64ab870b4f9acf0 upstream.
Sentelic probes confuse IBM trackpoints so they stop responding to TP_READ_ID command. See:
http://bugzilla.kernel.org/show_bug.cgi?id=14970
Let's move FSP detection lower so it is probed after trackpoint and others, just before we strat probing for Intellimouse Explorer.
--- drivers/input/mouse/psmouse-base.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/input/mouse/psmouse-base.c +15 -13
@@ -667,19 +667,6 @@ static int psmouse_extensions(struct psm max_proto =PSMOUSE_IMEX ; } -/* -* Try Finger Sensing Pad -*/ -if (max_proto >PSMOUSE_IMEX ) { -if (fsp_detect (psmouse, set_properties) ==0 ) { -if (!set_properties ||fsp_init (psmouse) ==0 ) -return PSMOUSE_FSP ; -/* -* Init failed, try basic relative protocols -*/ - max_proto =PSMOUSE_IMEX ; - } - }if (max_proto >PSMOUSE_IMEX ) {if (genius_detect (psmouse, set_properties) ==0 )
@@ -696,6 +683,21 @@ static int psmouse_extensions(struct psm }/* +* Try Finger Sensing Pad. We do it here because its probe upsets +* Trackpoint devices (causing TP_READ_ID command to time out). +*/ +if (max_proto >PSMOUSE_IMEX ) { +if (fsp_detect (psmouse, set_properties) ==0 ) { +if (!set_properties ||fsp_init (psmouse) ==0 ) +return PSMOUSE_FSP ; +/* +* Init failed, try basic relative protocols +*/ + max_proto =PSMOUSE_IMEX ; + } + } + +/* * Reset to defaults in case the device got confused by extended * protocol probes. Note that we follow up with full reset because * some mice put themselves to sleep when they see PSMOUSE_RESET_DIS.
PATCH 22/30 asus-laptop: add Lenovo SL hotkey support
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ike Panhc <[email protected]>
commit 14f8af311e7d3e4198cbaade84a34f86505dcb37 upstream.
Lenovo SL series laptop has a very similar DSDT with Asus laptops. We can easily have the extra ACPI function support with little modification in asus-laptop.c
Here is the hotkey enablement for Lenovo SL series laptop.
This patch will enable the following hotkey:
- Volumn Up
- Volumn Down
- Mute
- Screen Lock (Fn+F2)
- Battery Status (Fn+F3)
- WLAN switch (Fn+F5)
- Video output switch (Fn+F7)
- Touchpad switch (Fn+F8)
- Screen Magnifier (Fn+Space)
The following function of Lenovo SL laptop is still need to be enabled:
- Hotkey: KEY_SUSPEND (Fn+F4), KEY_SLEEP (Fn+F12), Dock Eject (Fn+F9)
- Rfkill for bluetooth and wlan
- LenovoCare LED
- Hwmon for fan speed
- Fingerprint scanner
- Active Protection System
--- drivers/platform/x86/asus-laptop.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/platform/x86/asus-laptop.c +8 -0
@@ -221,6 +221,7 @@ static struct asus_hotk *hotk;*/ static const struct acpi_device_id asus_device_ids[] = { {"ATK0100" ,0 }, + {"ATK0101" ,0 }, {"" ,0 }, };MODULE_DEVICE_TABLE (acpi, asus_device_ids);
@@ -293,6 +294,11 @@ struct key_entry {enum {KE_KEY ,KE_END };static struct key_entry asus_keymap[] = { + {KE_KEY ,0x02 ,KEY_SCREENLOCK }, + {KE_KEY ,0x05 ,KEY_WLAN }, + {KE_KEY ,0x08 ,BTN_TOUCH }, + {KE_KEY ,0x17 ,KEY_ZOOM }, + {KE_KEY ,0x1f ,KEY_BATTERY }, {KE_KEY ,0x30 ,KEY_VOLUMEUP }, {KE_KEY ,0x31 ,KEY_VOLUMEDOWN }, {KE_KEY ,0x32 ,KEY_MUTE },
@@ -312,6 +318,8 @@ static struct key_entry asus_keymap[] = {KE_KEY, 0x5F, KEY_WLAN}, {KE_KEY, 0x60, KEY_SWITCHVIDEOMODE}, {KE_KEY, 0x61, KEY_SWITCHVIDEOMODE}, + {KE_KEY, 0x62, KEY_SWITCHVIDEOMODE}, + {KE_KEY, 0x63, KEY_SWITCHVIDEOMODE}, {KE_KEY, 0x6B, BTN_TOUCH}, /* Lock Mouse */ {KE_KEY, 0x82, KEY_CAMERA}, {KE_KEY, 0x8A, KEY_PROG1},
PATCH 23/30 sched: Fix cpu_clock() in NMIs, on !CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Miller <[email protected]>
commit b9f8fcd55bbdb037e5332dbdb7b494f0b70861ac upstream.
Relax stable-sched-clock architectures to not save/disable/restore hardirqs in cpu_clock().
The background is that I was trying to resolve a sparc64 perf issue when I discovered this problem.
On sparc64 I implement pseudo NMIs by simply running the kernel at IRQ level 14 when local_irq_disable() is called, this allows performance counter events to still come in at IRQ level 15.
This doesn't work if any code in an NMI handler does local_irq_save() or local_irq_disable() since the "disable" will kick us back to cpu IRQ level 14 thus letting NMIs back in and we recurse.
The only path which that does that in the perf event IRQ handling path is the code supporting frequency based events. It uses cpu_clock().
cpu_clock() simply invokes sched_clock() with IRQs disabled.
And that's a fundamental bug all on it's own, particularly for the HAVE_UNSTABLE_SCHED_CLOCK case. NMIs can thus get into the sched_clock() code interrupting the local IRQ disable code sections of it.
Furthermore, for the not-HAVE_UNSTABLE_SCHED_CLOCK case, the IRQ disabling done by cpu_clock() is just pure overhead and completely unnecessary.
So the core problem is that sched_clock() is not NMI safe, but we are invoking it from NMI contexts in the perf events code (via cpu_clock()).
A less important issue is the overhead of IRQ disabling when it isn't necessary in cpu_clock().
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK architectures are not affected by this patch.
LKML-Reference: <[email protected]>
--- kernel/sched_clock.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
kernel/sched_clock.c +15 -8
@@ -236,6 +236,18 @@ void sched_clock_idle_wakeup_event(u64 d }EXPORT_SYMBOL_GPL (sched_clock_idle_wakeup_event); +unsigned long long cpu_clock (int cpu) +{ +unsigned long long clock; +unsigned long flags; + +local_irq_save (flags); + clock =sched_clock_cpu (cpu); +local_irq_restore (flags); + +return clock; +} +#else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */ void sched_clock_init (void )
@@ -251,17 +263,12 @@ u64 sched_clock_cpu(int cpu) return sched_clock(); } -#endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */ unsigned long long cpu_clock (int cpu) { -unsigned long long clock; -unsigned long flags; +return sched_clock_cpu (cpu); +} -local_irq_save (flags); - clock =sched_clock_cpu (cpu); -local_irq_restore (flags); +#endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */ -return clock; -}EXPORT_SYMBOL_GPL (cpu_clock);
PATCH 24/30 sparc64: Fix NMI programming when perf events are active.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit 8183e2b38480672a1f61d416812ac078ce94b67b ]
If perf events are active, we should not reset the %pcr to PCR_PIC_PRIV. That perf events code does the management.
--- arch/sparc/kernel/nmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/sparc/kernel/nmi.c +2 -1
@@ -96,7 +96,6 @@ notrace __kprobes void perfctr_irq(int iint cpu =smp_processor_id ();clear_softint (1 << irq); - pcr_ops->write (PCR_PIC_PRIV );local_cpu_data ().__nmi_count++;
@@ -105,6 +104,8 @@ notrace __kprobes void perfctr_irq(int iif (notify_die (DIE_NMI ,"nmi" , regs,0 ,pt_regs_trap_type (regs),SIGINT ) ==NOTIFY_STOP ) touched =1 ; +else + pcr_ops->write (PCR_PIC_PRIV ); sum =kstat_irqs_cpu (0 , cpu);if (__get_cpu_var (nmi_touch)) {
PATCH 25/30 sparc64: Fix Niagara2 perf event handling.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit e04ed38d4e0cd32141f723560efcc8252b0241e2 ]
For chips like Niagara2 that have true overflow indications in the %pcr (which we don't actually need and don't use) the interrupt signal persists until the overflow bits are cleared by an explicit %pcr write.
--- arch/sparc/kernel/perf_event.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/sparc/kernel/perf_event.c +11 -0
@@ -986,6 +986,17 @@ static int __kprobes perf_event_nmi_hand data.addr =0 ; cpuc = &__get_cpu_var (cpu_hw_events); + +/* If the PMU has the TOE IRQ enable bits, we need to do a +* dummy write to the %pcr to clear the overflow bits and thus +* the interrupt. +* +* Do this before we peek at the counters to determine +* overflow so we don't lose any events. +*/ +if (sparc_pmu->irq_bit) + pcr_ops->write (cpuc->pcr); +for (idx =0 ; idx <MAX_HWEVENTS ; idx++) {struct perf_event *event = cpuc->events[idx];struct hw_perf_event *hwc;
PATCH 26/30 i2c: Do not use device name after device_unregister
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
commit c556752109794a5ff199b80a1673336b4df8433a upstream.
dev_dbg outputs dev_name, which is released with device_unregister. This bug resulted in output like this:
i2c Xy2�0: adapter [SMBus I801 adapter at 1880] unregistered
The right output would be:
i2c i2c-0: adapter [SMBus I801 adapter at 1880] unregistered
--- drivers/i2c/i2c-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core.c +3 -2
@@ -801,6 +801,9 @@ int i2c_del_adapter(struct i2c_adapter * adap->dev.parent);#endif +/* device name is gone after device_unregister */ +dev_dbg (&adap->dev,"adapter [%s] unregistered\n" , adap->name); +/* clean up the sysfs representation */ init_completion (&adap->dev_released);device_unregister (&adap->dev);
@@ -813,8 +816,6 @@ int i2c_del_adapter(struct i2c_adapter *idr_remove (&i2c_adapter_idr, adap->nr);mutex_unlock (&core_lock); -dev_dbg (&adap->dev,"adapter [%s] unregistered\n" , adap->name); -/* Clear the device structure in case this adapter is ever going to be added again */ memset (&adap->dev,0 ,sizeof (adap->dev));
PATCH 27/30 i2c/pca: Dont use *_interruptible
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wolfram Sang <[email protected]>
commit 22f8b2695eda496026623020811cae34590ee3d7 upstream.
Unexpected signals can disturb the bus-handling and lock it up. Don't use interruptible in 'wait_event_*' and 'wake_*' as in commits dc1972d02747d2170fb1d78d114801f5ecb27506 (for cpm), 1ab082d7cbd0f34e39a5396cc6340c00bc5d66ef (for mpc), b7af349b175af45f9d87b3bf3f0a221e1831ed39 (for omap).
--- drivers/i2c/busses/i2c-pca-isa.c | 4 ++-- drivers/i2c/busses/i2c-pca-platform.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-pca-isa.c +2 -2
@@ -75,7 +75,7 @@ static int pca_isa_waitforcompletion(voiunsigned long timeout;if (irq >-1 ) { - ret =wait_event_interruptible_timeout (pca_wait, + ret =wait_event_timeout (pca_wait,pca_isa_readbyte (pd,I2C_PCA_CON ) &I2C_PCA_CON_SI , pca_isa_ops.timeout); }else {
@@ -96,7 +96,7 @@ static void pca_isa_resetchip(void *pd) }static irqreturn_t pca_handler (int this_irq,void *dev_id) { -wake_up_interruptible (&pca_wait); +wake_up (&pca_wait);return IRQ_HANDLED ; }
drivers/i2c/busses/i2c-pca-platform.c +2 -2
@@ -84,7 +84,7 @@ static int i2c_pca_pf_waitforcompletion(unsigned long timeout;if (i2c->irq) { - ret =wait_event_interruptible_timeout (i2c->wait, + ret =wait_event_timeout (i2c->wait, i2c->algo_data.read_byte (i2c,I2C_PCA_CON ) &I2C_PCA_CON_SI , i2c->adap.timeout); }else {
@@ -122,7 +122,7 @@ static irqreturn_t i2c_pca_pf_handler(inif ((i2c->algo_data.read_byte (i2c,I2C_PCA_CON ) &I2C_PCA_CON_SI ) ==0 )return IRQ_NONE ; -wake_up_interruptible (&i2c->wait); +wake_up (&i2c->wait);return IRQ_HANDLED ; }
PATCH 28/30 serial/8250_pnp: add a new Fujitsu Wacom Tablet PC device
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ping <[email protected]>
commit 3018aa4b1a46946dfd0ee73a533038f24e390539 upstream.
This is a new two finger touch Fujitsu Wacom Tablet PC.
--- drivers/serial/8250_pnp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/serial/8250_pnp.c +2 -0
@@ -354,6 +354,8 @@ static const struct pnp_device_id pnp_de { "FUJ02E5", 0 },/* Fujitsu P-series tablet PC device */ { "FUJ02E6", 0 }, +/* Fujitsu Wacom 2FGT Tablet PC device */ + { "FUJ02E7", 0 },/* * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in * disguise)
PATCH 29/30 sched: Fix task priority bug
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <[email protected]>
commit 57785df5ac53c70da9fb53696130f3c551bfe1f9 upstream.
83f9ac removed a call to effective_prio() in wake_up_new_task(), which leads to tasks running at MAX_PRIO.
This is caused by the idle thread being set to MAX_PRIO before forking off init. O(1) used that to make sure idle was always preempted, CFS uses check_preempt_curr_idle() for that so we can savely remove this bit of legacy code.
LKML-Reference: <1259754383.4003.610.camel@laptop>
--- kernel/sched.c | 6 ------ 1 file changed, 6 deletions(-)
kernel/sched.c +0 -6
@@ -3177,10 +3177,6 @@ static void pull_task(struct rq *src_rq,deactivate_task (src_rq, p,0 );set_task_cpu (p, this_cpu);activate_task (this_rq, p,0 ); -/* -* Note that idle threads have a prio of MAX_PRIO, for this test -* to be always true for them. -*/ check_preempt_curr (this_rq, p,0 ); }
@@ -6982,7 +6978,6 @@ void __cpuinit init_idle(struct task_str__sched_fork (idle); idle->se.exec_start =sched_clock (); - idle->prio = idle->normal_prio =MAX_PRIO ;cpumask_copy (&idle->cpus_allowed,cpumask_of (cpu));__set_task_cpu (idle, cpu);
@@ -7686,7 +7681,6 @@ migration_call(struct notifier_block *nfspin_lock_irq (&rq->lock);update_rq_clock (rq);deactivate_task (rq, rq->idle,0 ); - rq->idle->static_prio =MAX_PRIO ;__setscheduler (rq, rq->idle,SCHED_NORMAL ,0 ); rq->idle->sched_class = &idle_sched_class;migrate_dead_tasks (cpu);
PATCH 30/30 vfs: Fix vmtruncate() regression
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: OGAWA Hirofumi <[email protected]>
commit cedabed49b39b4319bccc059a63344b6232b619c upstream.
If __block_prepare_write() was failed in block_write_begin(), the allocated blocks can be outside of ->i_size.
But new truncate_pagecache() in vmtuncate() does nothing if new < old. It means the above usage is not working anymore.
So, this patch fixes it by removing "new < old" check. It would need more cleanup/change. But, now -rc and truncate working is in progress, so, this tried to fix it minimum change.
--- mm/truncate.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-)
mm/truncate.c +13 -15
@@ -516,22 +516,20 @@ EXPORT_SYMBOL_GPL(invalidate_inode_pages*/ void truncate_pagecache (struct inode *inode,loff_t old,loff_t new) { -if (new < old) { -struct address_space *mapping = inode->i_mapping; +struct address_space *mapping = inode->i_mapping; -/* -* unmap_mapping_range is called twice, first simply for -* efficiency so that truncate_inode_pages does fewer -* single-page unmaps. However after this first call, and -* before truncate_inode_pages finishes, it is possible for -* private pages to be COWed, which remain after -* truncate_inode_pages finishes, hence the second -* unmap_mapping_range call must be made for correctness. -*/ -unmap_mapping_range (mapping, new +PAGE_SIZE -1 ,0 ,1 ); -truncate_inode_pages (mapping, new); -unmap_mapping_range (mapping, new +PAGE_SIZE -1 ,0 ,1 ); - } +/* +* unmap_mapping_range is called twice, first simply for +* efficiency so that truncate_inode_pages does fewer +* single-page unmaps. However after this first call, and +* before truncate_inode_pages finishes, it is possible for +* private pages to be COWed, which remain after +* truncate_inode_pages finishes, hence the second +* unmap_mapping_range call must be made for correctness. +*/ +unmap_mapping_range (mapping, new +PAGE_SIZE -1 ,0 ,1 ); +truncate_inode_pages (mapping, new); +unmap_mapping_range (mapping, new +PAGE_SIZE -1 ,0 ,1 ); }EXPORT_SYMBOL (truncate_pagecache);