linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ 00/71] 3.0.59-stable review
@ 2013-01-15 22:53 Greg Kroah-Hartman
  2013-01-15 22:53 ` [ 01/71] powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build Greg Kroah-Hartman
                   ` (72 more replies)
  0 siblings, 73 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:53 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, torvalds, akpm, alan

This is the start of the stable review cycle for the 3.0.59 release.
There are 71 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Thu Jan 17 22:53:26 UTC 2013.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.59-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 3.0.59-rc1

Ian Abbott <abbotti@mev.co.uk>
    staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC

Ian Abbott <abbotti@mev.co.uk>
    staging: comedi: don't hijack hardware device private data

Daniel Vetter <daniel.vetter@ffwll.ch>
    Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13"

Alexander Graf <agraf@suse.de>
    KVM: PPC: 44x: fix DCR read/write

Woodhouse, David <david.woodhouse@intel.com>
    intel-iommu: Free old page tables before creating superpage

Benjamin Marzinski <bmarzins@redhat.com>
    GFS2: Test bufdata with buffer locked and gfs2_log_lock held

Sarah Sharp <sarah.a.sharp@linux.intel.com>
    xhci: Handle HS bulk/ctrl endpoints that don't NAK.

Oliver Neukum <oliver@neukum.org>
    USB: hub: handle claim of enabled remote wakeup after reset

Sarah Sharp <sarah.a.sharp@linux.intel.com>
    USB: Increase reset timeout.

Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    usb: gadget: dummy: fix enumeration with g_multi

Denis N Ladin <denladin@gmail.com>
    USB: cdc-acm: Add support for "PSC Scanning, Magellan 800i"

Tomasz Mloduchowski <q@qdot.me>
    usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added

Bjørn Mork <bjorn@mork.no>
    USB: option: add Telekom Speedstick LTE II

Quentin.Li <snowmanli88@163.com>
    USB: option: Add new MEDIATEK PID support

Bjørn Mork <bjorn@mork.no>
    USB: option: blacklist network interface on ZTE MF880

Dzianis Kahanovich <mahatma@bspu.unibel.by>
    USB: option: add Nexpring NP10T terminal id

Johannes Berg <johannes.berg@intel.com>
    mac80211: use del_timer_sync for final sta cleanup timer deletion

Jerome Glisse <jglisse@redhat.com>
    radeon/kms: force rn50 chip to always report connected on analog output

Samuel Thibault <samuel.thibault@ens-lyon.org>
    staging: speakup: avoid out-of-range access in synth_add()

Nickolai Zeldovich <nickolai@csail.mit.edu>
    staging: speakup: avoid out-of-range access in synth_init()

Larry Finger <Larry.Finger@lwfinger.net>
    staging: r8712u: Add new device ID

Ian Abbott <abbotti@mev.co.uk>
    staging: comedi: comedi_test: fix race when cancelling command

Ian Abbott <abbotti@mev.co.uk>
    staging: comedi: prevent auto-unconfig of manually configured devices

Mike Dunn <mikedunn@newsguy.com>
    ALSA: pxa27x: fix ac97 cold reset

Mark Brown <broonie@opensource.wolfsonmicro.com>
    ASoC: wm2000: Fix sense of speech clarity enable

Eric Wong <normalperson@yhbt.net>
    epoll: prevent missed events on EPOLL_CTL_MOD

Eric Dumazet <eric.dumazet@gmail.com>
    rtnetlink: fix rtnl_calcit() and rtnl_dump_ifinfo()

Greg Rose <gregory.v.rose@intel.com>
    rtnetlink: Fix problem with buffer allocation

Greg Rose <gregory.v.rose@intel.com>
    rtnetlink: Compute and store minimum ifinfo dump size

Zhang Rui <rui.zhang@intel.com>
    ACPI : do not use Lid and Sleep button for S5 wakeup

Andre Przywara <andre.przywara@amd.com>
    x86, amd: Disable way access filter on Piledriver CPUs

David Rientjes <rientjes@google.com>
    thp, memcg: split hugepage for memcg oom on cow

Namjae Jeon <namjae.jeon@samsung.com>
    udf: don't increment lenExtents while writing to a hole

Namjae Jeon <namjae.jeon@samsung.com>
    udf: fix memory leak while allocating blocks during write

Ed L. Cashin <ecashin@coraid.com>
    aoe: do not call bdi_init after blk_alloc_queue

Theodore Ts'o <tytso@mit.edu>
    ext4: lock i_mutex when truncating orphan inodes

Michael Tokarev <mjt@tls.msk.ru>
    ext4: do not try to write superblock on ro remount w/o journal

Jan Kara <jack@suse.cz>
    jbd2: fix assertion failure in jbd2_journal_flush()

Forrest Liu <forrestl@synology.com>
    ext4: fix extent tree corruption caused by hole punch

Lothar Waßmann <LW@KARO-electronics.de>
    video: mxsfb: fix crash when unblanking the display

Malcolm Priestley <tvboxspy@gmail.com>
    staging: vt6656: 64bit fixes: vCommandTimerWait change calculation of timer.

Malcolm Priestley <tvboxspy@gmail.com>
    staging: vt6656: 64bit fixes: key.c/h change unsigned long to u32

Malcolm Priestley <tvboxspy@gmail.com>
    staging: vt6656: 64 bit fixes: fix long warning messages.

Malcolm Priestley <tvboxspy@gmail.com>
    staging: vt6656: 64 bit fixes : correct all type sizes

Malcolm Priestley <tvboxspy@gmail.com>
    staging: vt6656: 64 bit fixes: use u32 for QWORD definition.

Malcolm Priestley <tvboxspy@gmail.com>
    staging: vt6656: [BUG] out of bound array reference in RFbSetPower.

Alasdair G Kergon <agk@redhat.com>
    dm ioctl: prevent unsafe change to dm_ioctl data_size

Steven Rostedt <srostedt@redhat.com>
    ring-buffer: Fix race between integrity check and readers

Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
    RDMA/nes: Fix for terminate timer crash

Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
    RDMA/nes: Fix for crash when registering zero length MR for CQ

Paulo Zanoni <paulo.r.zanoni@intel.com>
    drm/i915: make the panel fitter work on pipes B and C on IVB

Dan Williams <dcbw@redhat.com>
    i2400m: add Intel 6150 device IDs

Alexey Khoroshilov <khoroshilov@ispras.ru>
    jffs2: hold erase_completion_lock on exit

Trond Myklebust <Trond.Myklebust@netapp.com>
    SUNRPC: Ensure we release the socket write lock if the rpc_task exits early

Trond Myklebust <Trond.Myklebust@netapp.com>
    SUNRPC: Ensure that we free the rpc_task after cleanups are done

Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
    ext4: fix memory leak in ext4_xattr_set_acl()'s error path

Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
    mfd: Only unregister platform devices allocated by the mfd core

Yi Zou <yi.zou@intel.com>
    target/tcm_fc: fix the lockdep warning due to inconsistent lock state

Xiaotian Feng <xtfeng@gmail.com>
    libata: fix Null pointer dereference on disk error

Aaron Lu <aaron.lu@intel.com>
    libata: set dma_mode to 0xff in reset

Mikael Pettersson <mikpe@it.uu.se>
    sata_promise: fix hardreset lockdep error

David Jeffery <djeffery@redhat.com>
    SCSI: qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically.

Xi Wang <xi.wang@gmail.com>
    SCSI: mvsas: fix undefined bit shift

Stephan Gatzka <stephan.gatzka@gmail.com>
    firewire: net: Fix handling of fragmented multicast/broadcast packets.

Gabor Juhos <juhosg@openwrt.org>
    ath9k: ar9003: fix OTP register offsets for AR9340

Felix Fietkau <nbd@openwrt.org>
    Revert "ath9k_hw: Update AR9003 high_power tx gain table"

Laura Abbott <lauraa@codeaurora.org>
    mm: use aligned zone start for pfn_to_bitidx calculation

Jason Liu <r64343@freescale.com>
    mm: compaction: fix echo 1 > compact_memory return error issue

Sebastian Ott <sebott@linux.vnet.ibm.com>
    s390/cio: fix pgid reserved check

Shan Hai <shan.hai@windriver.com>
    powerpc/vdso: Remove redundant locking in update_vsyscall_tz()

Anton Blanchard <anton@samba.org>
    powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build


-------------

Diffstat:

 Makefile                                           |   4 +-
 arch/powerpc/kernel/head_64.S                      |   2 +-
 arch/powerpc/kernel/time.c                         |   5 -
 arch/powerpc/kvm/44x_emulate.c                     |   2 +
 arch/x86/kernel/cpu/amd.c                          |  14 ++
 drivers/acpi/scan.c                                |   7 +-
 drivers/ata/libata-core.c                          |   1 +
 drivers/ata/libata-eh.c                            |   1 +
 drivers/ata/libata-scsi.c                          |   6 +-
 drivers/ata/sata_promise.c                         |  15 +-
 drivers/block/aoe/aoe.h                            |   2 +-
 drivers/block/aoe/aoeblk.c                         |   5 -
 drivers/firewire/net.c                             |  13 +-
 drivers/gpu/drm/i915/i915_reg.h                    |   2 +
 drivers/gpu/drm/i915/intel_display.c               |   6 +-
 drivers/gpu/drm/i915/intel_lvds.c                  |   8 -
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c    |   8 +
 drivers/infiniband/core/netlink.c                  |   2 +-
 drivers/infiniband/hw/nes/nes.h                    |   1 +
 drivers/infiniband/hw/nes/nes_hw.c                 |   9 +-
 drivers/infiniband/hw/nes/nes_verbs.c              |   9 +-
 drivers/md/dm-ioctl.c                              |   8 +
 drivers/mfd/mfd-core.c                             |  15 +-
 drivers/net/wimax/i2400m/i2400m-usb.h              |   3 +
 drivers/net/wimax/i2400m/usb.c                     |   6 +
 .../net/wireless/ath/ath9k/ar9003_2p2_initvals.h   | 172 ++++++++++-----------
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h     |   6 +-
 drivers/pci/intel-iommu.c                          |  11 +-
 drivers/s390/cio/device_pgid.c                     |  10 +-
 drivers/scsi/mvsas/mv_94xx.h                       |  14 +-
 drivers/scsi/mvsas/mv_sas.h                        |   2 +-
 drivers/scsi/qla2xxx/qla_os.c                      |   4 +-
 drivers/staging/comedi/Kconfig                     |   1 +
 drivers/staging/comedi/comedi_fops.c               |  21 +++
 drivers/staging/comedi/comedidev.h                 |   1 +
 drivers/staging/comedi/drivers.c                   |  34 ++--
 drivers/staging/comedi/drivers/comedi_test.c       |   2 +-
 drivers/staging/comedi/internal.h                  |   1 +
 drivers/staging/rtl8712/usb_intf.c                 |   2 +
 drivers/staging/speakup/synth.c                    |   4 +-
 drivers/staging/vt6656/dpc.c                       |   4 +-
 drivers/staging/vt6656/key.c                       |  53 +++++--
 drivers/staging/vt6656/key.h                       |   8 +-
 drivers/staging/vt6656/mac.c                       |   6 +-
 drivers/staging/vt6656/rf.c                        |   3 +
 drivers/staging/vt6656/rxtx.c                      |  18 ++-
 drivers/staging/vt6656/ttype.h                     |  16 +-
 drivers/staging/vt6656/wcmd.c                      |  20 +--
 drivers/staging/vt6656/wpa2.h                      |   4 +-
 drivers/target/tcm_fc/tfc_sess.c                   |   2 +-
 drivers/usb/class/cdc-acm.c                        |   3 +
 drivers/usb/core/hub.c                             |  12 +-
 drivers/usb/gadget/dummy_hcd.c                     |   9 +-
 drivers/usb/host/xhci-mem.c                        |   2 +
 drivers/usb/serial/ftdi_sio.c                      |   2 +
 drivers/usb/serial/ftdi_sio_ids.h                  |   6 +
 drivers/usb/serial/option.c                        |  18 ++-
 drivers/video/mxsfb.c                              |   3 +-
 fs/eventpoll.c                                     |  22 ++-
 fs/ext4/acl.c                                      |   6 +-
 fs/ext4/extents.c                                  |  22 ++-
 fs/ext4/super.c                                    |   4 +-
 fs/gfs2/lops.c                                     |  18 +--
 fs/gfs2/trans.c                                    |   8 +
 fs/jbd2/transaction.c                              |   3 +-
 fs/jffs2/nodemgmt.c                                |   6 +-
 fs/udf/inode.c                                     |  11 +-
 include/linux/if_link.h                            |   1 +
 include/linux/netlink.h                            |   6 +-
 include/linux/rtnetlink.h                          |   3 +
 include/net/rtnetlink.h                            |   7 +-
 kernel/trace/ring_buffer.c                         |   2 +
 mm/compaction.c                                    |   6 +-
 mm/huge_memory.c                                   |   3 +
 mm/memory.c                                        |  18 ++-
 mm/page_alloc.c                                    |   2 +-
 net/bridge/br_netlink.c                            |  15 +-
 net/core/fib_rules.c                               |   6 +-
 net/core/neighbour.c                               |  11 +-
 net/core/rtnetlink.c                               | 127 ++++++++++++---
 net/dcb/dcbnl.c                                    |   4 +-
 net/decnet/dn_dev.c                                |   6 +-
 net/decnet/dn_fib.c                                |   4 +-
 net/decnet/dn_route.c                              |   5 +-
 net/ipv4/devinet.c                                 |   6 +-
 net/ipv4/fib_frontend.c                            |   6 +-
 net/ipv4/inet_diag.c                               |   2 +-
 net/ipv4/ipmr.c                                    |   3 +-
 net/ipv4/route.c                                   |   2 +-
 net/ipv6/addrconf.c                                |  16 +-
 net/ipv6/addrlabel.c                               |   9 +-
 net/ipv6/ip6_fib.c                                 |   3 +-
 net/ipv6/ip6mr.c                                   |   3 +-
 net/ipv6/route.c                                   |   6 +-
 net/mac80211/sta_info.c                            |   2 +-
 net/netfilter/ipset/ip_set_core.c                  |   2 +-
 net/netfilter/nf_conntrack_netlink.c               |   4 +-
 net/netlink/af_netlink.c                           |  17 +-
 net/netlink/genetlink.c                            |   2 +-
 net/phonet/pn_netlink.c                            |  13 +-
 net/sched/act_api.c                                |   7 +-
 net/sched/cls_api.c                                |   6 +-
 net/sched/sch_api.c                                |  12 +-
 net/sunrpc/sched.c                                 |  30 +++-
 net/sunrpc/xprt.c                                  |  12 +-
 net/xfrm/xfrm_user.c                               |   3 +-
 sound/arm/pxa2xx-ac97-lib.c                        |   8 +-
 sound/soc/codecs/wm2000.c                          |   4 +-
 108 files changed, 742 insertions(+), 390 deletions(-)



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 01/71] powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
@ 2013-01-15 22:53 ` Greg Kroah-Hartman
  2013-01-15 22:53 ` [ 02/71] powerpc/vdso: Remove redundant locking in update_vsyscall_tz() Greg Kroah-Hartman
                   ` (71 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Anton Blanchard, Benjamin Herrenschmidt

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Anton Blanchard <anton@samba.org>

commit 11ee7e99f35ecb15f59b21da6a82d96d2cd3fcc8 upstream.

If we build a kernel with CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n,
the kernel fails when we run at a non zero offset. It turns out
we were incorrectly wrapping some of the relocatable kernel code
with CONFIG_CRASH_DUMP.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/head_64.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -425,7 +425,7 @@ _STATIC(__after_prom_start)
 	tovirt(r6,r6)			/* on booke, we already run at PAGE_OFFSET */
 #endif
 
-#ifdef CONFIG_CRASH_DUMP
+#ifdef CONFIG_RELOCATABLE
 /*
  * Check if the kernel has to be running as relocatable kernel based on the
  * variable __run_at_load, if it is set the kernel is treated as relocatable



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 02/71] powerpc/vdso: Remove redundant locking in update_vsyscall_tz()
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
  2013-01-15 22:53 ` [ 01/71] powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build Greg Kroah-Hartman
@ 2013-01-15 22:53 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 03/71] s390/cio: fix pgid reserved check Greg Kroah-Hartman
                   ` (70 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Shan Hai, Benjamin Herrenschmidt

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Shan Hai <shan.hai@windriver.com>

commit ce73ec6db47af84d1466402781ae0872a9e7873c upstream.

The locking in update_vsyscall_tz() is not only unnecessary because the vdso
code copies the data unproteced in __kernel_gettimeofday() but also
introduces a hard to reproduce race condition between update_vsyscall()
and update_vsyscall_tz(), which causes user space process to loop
forever in vdso code.

The following patch removes the locking from update_vsyscall_tz().

Locking is not only unnecessary because the vdso code copies the data
unprotected in __kernel_gettimeofday() but also erroneous because updating
the tb_update_count is not atomic and introduces a hard to reproduce race
condition between update_vsyscall() and update_vsyscall_tz(), which further
causes user space process to loop forever in vdso code.

The below scenario describes the race condition,
x==0	Boot CPU			other CPU
	proc_P: x==0
	    timer interrupt
		update_vsyscall
x==1		    x++;sync		settimeofday
					    update_vsyscall_tz
x==2						x++;sync
x==3		    sync;x++
						sync;x++
	proc_P: x==3 (loops until x becomes even)

Because the ++ operator would be implemented as three instructions and not
atomic on powerpc.

A similar change was made for x86 in commit 6c260d58634
("x86: vdso: Remove bogus locking in update_vsyscall_tz")

Signed-off-by: Shan Hai <shan.hai@windriver.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/time.c |    5 -----
 1 file changed, 5 deletions(-)

--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -859,13 +859,8 @@ void update_vsyscall(struct timespec *wa
 
 void update_vsyscall_tz(void)
 {
-	/* Make userspace gettimeofday spin until we're done. */
-	++vdso_data->tb_update_count;
-	smp_mb();
 	vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
 	vdso_data->tz_dsttime = sys_tz.tz_dsttime;
-	smp_mb();
-	++vdso_data->tb_update_count;
 }
 
 static void __init clocksource_init(void)



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 03/71] s390/cio: fix pgid reserved check
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
  2013-01-15 22:53 ` [ 01/71] powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build Greg Kroah-Hartman
  2013-01-15 22:53 ` [ 02/71] powerpc/vdso: Remove redundant locking in update_vsyscall_tz() Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 04/71] mm: compaction: fix echo 1 > compact_memory return error issue Greg Kroah-Hartman
                   ` (69 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Peter Oberparleiter, Sebastian Ott,
	Martin Schwidefsky

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sebastian Ott <sebott@linux.vnet.ibm.com>

commit d99e79ec5574fc556c988f613ed6175f6de66f4a upstream.

The check to whom a device is reserved is done by checking the path
state of the affected channel paths. If it turns out that one path is
flagged as reserved by someone else the whole device is marked as such.

However the meaning of the RESVD_ELSE bit is that the addressed device
is reserved to a different pathgroup (and not reserved to a different
LPAR). If we do this test on a path which is currently not a member of
the pathgroup we could erroneously mark the device as reserved to
someone else.

To fix this collect the reserved state for all potential members of the
pathgroup and only mark the device as reserved if all of those potential
members have the RESVD_ELSE bit set.

Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/s390/cio/device_pgid.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/s390/cio/device_pgid.c
+++ b/drivers/s390/cio/device_pgid.c
@@ -234,7 +234,7 @@ static int pgid_cmp(struct pgid *p1, str
  * Determine pathgroup state from PGID data.
  */
 static void pgid_analyze(struct ccw_device *cdev, struct pgid **p,
-			 int *mismatch, int *reserved, u8 *reset)
+			 int *mismatch, u8 *reserved, u8 *reset)
 {
 	struct pgid *pgid = &cdev->private->pgid[0];
 	struct pgid *first = NULL;
@@ -248,7 +248,7 @@ static void pgid_analyze(struct ccw_devi
 		if ((cdev->private->pgid_valid_mask & lpm) == 0)
 			continue;
 		if (pgid->inf.ps.state2 == SNID_STATE2_RESVD_ELSE)
-			*reserved = 1;
+			*reserved |= lpm;
 		if (pgid_is_reset(pgid)) {
 			*reset |= lpm;
 			continue;
@@ -316,14 +316,14 @@ static void snid_done(struct ccw_device
 	struct subchannel *sch = to_subchannel(cdev->dev.parent);
 	struct pgid *pgid;
 	int mismatch = 0;
-	int reserved = 0;
+	u8 reserved = 0;
 	u8 reset = 0;
 	u8 donepm;
 
 	if (rc)
 		goto out;
 	pgid_analyze(cdev, &pgid, &mismatch, &reserved, &reset);
-	if (reserved)
+	if (reserved == cdev->private->pgid_valid_mask)
 		rc = -EUSERS;
 	else if (mismatch)
 		rc = -EOPNOTSUPP;
@@ -336,7 +336,7 @@ static void snid_done(struct ccw_device
 	}
 out:
 	CIO_MSG_EVENT(2, "snid: device 0.%x.%04x: rc=%d pvm=%02x vpm=%02x "
-		      "todo=%02x mism=%d rsvd=%d reset=%02x\n", id->ssid,
+		      "todo=%02x mism=%d rsvd=%02x reset=%02x\n", id->ssid,
 		      id->devno, rc, cdev->private->pgid_valid_mask, sch->vpm,
 		      cdev->private->pgid_todo_mask, mismatch, reserved, reset);
 	switch (rc) {



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 04/71] mm: compaction: fix echo 1 > compact_memory return error issue
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2013-01-15 22:54 ` [ 03/71] s390/cio: fix pgid reserved check Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 05/71] mm: use aligned zone start for pfn_to_bitidx calculation Greg Kroah-Hartman
                   ` (68 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Jason Liu, David Rientjes, Mel Gorman,
	Rik van Riel, Minchan Kim, KAMEZAWA Hiroyuki, Andrew Morton,
	Linus Torvalds

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jason Liu <r64343@freescale.com>

commit 7964c06d66c76507d8b6b662bffea770c29ef0ce upstream.

when run the folloing command under shell, it will return error

  sh/$ echo 1 > /proc/sys/vm/compact_memory
  sh/$ sh: write error: Bad address

After strace, I found the following log:

  ...
  write(1, "1\n", 2)               = 3
  write(1, "", 4294967295)         = -1 EFAULT (Bad address)
  write(2, "echo: write error: Bad address\n", 31echo: write error: Bad address
  ) = 31

This tells system return 3(COMPACT_COMPLETE) after write data to
compact_memory.

The fix is to make the system just return 0 instead 3(COMPACT_COMPLETE)
from sysctl_compaction_handler after compaction_nodes finished.

Signed-off-by: Jason Liu <r64343@freescale.com>
Suggested-by: David Rientjes <rientjes@google.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/compaction.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -714,14 +714,12 @@ static int compact_node(int nid)
 }
 
 /* Compact all nodes in the system */
-static int compact_nodes(void)
+static void compact_nodes(void)
 {
 	int nid;
 
 	for_each_online_node(nid)
 		compact_node(nid);
-
-	return COMPACT_COMPLETE;
 }
 
 /* The written value is actually unused, all memory is compacted */
@@ -732,7 +730,7 @@ int sysctl_compaction_handler(struct ctl
 			void __user *buffer, size_t *length, loff_t *ppos)
 {
 	if (write)
-		return compact_nodes();
+		compact_nodes();
 
 	return 0;
 }



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 05/71] mm: use aligned zone start for pfn_to_bitidx calculation
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2013-01-15 22:54 ` [ 04/71] mm: compaction: fix echo 1 > compact_memory return error issue Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 06/71] Revert "ath9k_hw: Update AR9003 high_power tx gain table" Greg Kroah-Hartman
                   ` (67 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Laura Abbott, Mel Gorman, Andrew Morton,
	Linus Torvalds

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Laura Abbott <lauraa@codeaurora.org>

commit c060f943d0929f3e429c5d9522290584f6281d6e upstream.

The current calculation in pfn_to_bitidx assumes that (pfn -
zone->zone_start_pfn) >> pageblock_order will return the same bit for
all pfn in a pageblock.  If zone_start_pfn is not aligned to
pageblock_nr_pages, this may not always be correct.

Consider the following with pageblock order = 10, zone start 2MB:

  pfn     | pfn - zone start | (pfn - zone start) >> page block order
  ----------------------------------------------------------------
  0x26000 | 0x25e00	   |  0x97
  0x26100 | 0x25f00	   |  0x97
  0x26200 | 0x26000	   |  0x98
  0x26300 | 0x26100	   |  0x98

This means that calling {get,set}_pageblock_migratetype on a single page
will not set the migratetype for the full block.  Fix this by rounding
down zone_start_pfn when doing the bitidx calculation.

For our use case, the effects of this bug were mostly tied to the fact
that CMA allocations would either take a long time or fail to happen.
Depending on the driver using CMA, this could result in anything from
visual glitches to application failures.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5492,7 +5492,7 @@ static inline int pfn_to_bitidx(struct z
 	pfn &= (PAGES_PER_SECTION-1);
 	return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS;
 #else
-	pfn = pfn - zone->zone_start_pfn;
+	pfn = pfn - round_down(zone->zone_start_pfn, pageblock_nr_pages);
 	return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS;
 #endif /* CONFIG_SPARSEMEM */
 }



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 06/71] Revert "ath9k_hw: Update AR9003 high_power tx gain table"
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2013-01-15 22:54 ` [ 05/71] mm: use aligned zone start for pfn_to_bitidx calculation Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 07/71] ath9k: ar9003: fix OTP register offsets for AR9340 Greg Kroah-Hartman
                   ` (66 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Felix Fietkau, John W. Linville,
	rmanohar

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Felix Fietkau <nbd@openwrt.org>

commit 9c170e068636deb3e3f96114034bb711675f0faa upstream.

This reverts commit f74b9d365ddd33a375802b064f96a5d0e99af7c0.

Turns out reverting commit a240dc7b3c7463bd60cf0a9b2a90f52f78aae0fd
"ath9k_hw: Updated AR9003 tx gain table for 5GHz" was not enough to
bring the tx power back to normal levels on devices like the
Buffalo WZR-HP-G450H, this one needs to be reverted as well.

This revert improves tx power by ~10 db on that device

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: rmanohar@qca.qualcomm.com
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h |  172 +++++++++----------
 1 file changed, 86 insertions(+), 86 deletions(-)

--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
@@ -34,98 +34,98 @@ static const u32 ar9300_2p2_radio_postam
 
 static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p2[][5] = {
 	/* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-	{0x0000a2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
-	{0x0000a2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
-	{0x0000a2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
+	{0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
+	{0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
+	{0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
 	{0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-	{0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
-	{0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-	{0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
-	{0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
-	{0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
-	{0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
-	{0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
-	{0x0000a518, 0x21002220, 0x21002220, 0x16000402, 0x16000402},
-	{0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404},
-	{0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
-	{0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
-	{0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
-	{0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
-	{0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
-	{0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
-	{0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
-	{0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
-	{0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
-	{0x0000a544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861},
-	{0x0000a548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81},
-	{0x0000a54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83},
-	{0x0000a550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84},
-	{0x0000a554, 0x61022892, 0x61022892, 0x4e001ce3, 0x4e001ce3},
-	{0x0000a558, 0x65024890, 0x65024890, 0x52001ce5, 0x52001ce5},
-	{0x0000a55c, 0x69024892, 0x69024892, 0x56001ce9, 0x56001ce9},
-	{0x0000a560, 0x6e024c92, 0x6e024c92, 0x5a001ceb, 0x5a001ceb},
-	{0x0000a564, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-	{0x0000a568, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-	{0x0000a56c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-	{0x0000a570, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-	{0x0000a574, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-	{0x0000a578, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-	{0x0000a57c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-	{0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
-	{0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
-	{0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
-	{0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
-	{0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202},
-	{0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400},
-	{0x0000a598, 0x21802220, 0x21802220, 0x16800402, 0x16800402},
-	{0x0000a59c, 0x27802223, 0x27802223, 0x19800404, 0x19800404},
-	{0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603},
-	{0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02},
-	{0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04},
-	{0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20},
-	{0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20},
-	{0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22},
-	{0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24},
-	{0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640},
-	{0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660},
-	{0x0000a5c4, 0x52822470, 0x52822470, 0x3f801861, 0x3f801861},
-	{0x0000a5c8, 0x55822490, 0x55822490, 0x43801a81, 0x43801a81},
-	{0x0000a5cc, 0x59822492, 0x59822492, 0x47801a83, 0x47801a83},
-	{0x0000a5d0, 0x5d822692, 0x5d822692, 0x4a801c84, 0x4a801c84},
-	{0x0000a5d4, 0x61822892, 0x61822892, 0x4e801ce3, 0x4e801ce3},
-	{0x0000a5d8, 0x65824890, 0x65824890, 0x52801ce5, 0x52801ce5},
-	{0x0000a5dc, 0x69824892, 0x69824892, 0x56801ce9, 0x56801ce9},
-	{0x0000a5e0, 0x6e824c92, 0x6e824c92, 0x5a801ceb, 0x5a801ceb},
-	{0x0000a5e4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-	{0x0000a5e8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-	{0x0000a5ec, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-	{0x0000a5f0, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-	{0x0000a5f4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-	{0x0000a5f8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-	{0x0000a5fc, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
+	{0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9},
+	{0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
+	{0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002},
+	{0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004},
+	{0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200},
+	{0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202},
+	{0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400},
+	{0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402},
+	{0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404},
+	{0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603},
+	{0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02},
+	{0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04},
+	{0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20},
+	{0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20},
+	{0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22},
+	{0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24},
+	{0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640},
+	{0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660},
+	{0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861},
+	{0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81},
+	{0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
+	{0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84},
+	{0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3},
+	{0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5},
+	{0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9},
+	{0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb},
+	{0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
+	{0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
+	{0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
+	{0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
+	{0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
+	{0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
+	{0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
+	{0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000},
+	{0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002},
+	{0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004},
+	{0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200},
+	{0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202},
+	{0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400},
+	{0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402},
+	{0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404},
+	{0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603},
+	{0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02},
+	{0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04},
+	{0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20},
+	{0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20},
+	{0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22},
+	{0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24},
+	{0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640},
+	{0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660},
+	{0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861},
+	{0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81},
+	{0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83},
+	{0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84},
+	{0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3},
+	{0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5},
+	{0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9},
+	{0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb},
+	{0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
+	{0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
+	{0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
+	{0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
+	{0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
+	{0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
+	{0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
 	{0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
 	{0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
 	{0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
 	{0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-	{0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-	{0x0000a614, 0x02004000, 0x02004000, 0x01404000, 0x01404000},
-	{0x0000a618, 0x02004801, 0x02004801, 0x01404501, 0x01404501},
-	{0x0000a61c, 0x02808a02, 0x02808a02, 0x02008501, 0x02008501},
-	{0x0000a620, 0x0380ce03, 0x0380ce03, 0x0280ca03, 0x0280ca03},
-	{0x0000a624, 0x04411104, 0x04411104, 0x03010c04, 0x03010c04},
-	{0x0000a628, 0x04411104, 0x04411104, 0x04014c04, 0x04014c04},
-	{0x0000a62c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-	{0x0000a630, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-	{0x0000a634, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-	{0x0000a638, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-	{0x0000a63c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-	{0x0000b2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
-	{0x0000b2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
-	{0x0000b2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
+	{0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
+	{0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
+	{0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
+	{0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
+	{0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
+	{0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
+	{0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
+	{0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+	{0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+	{0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+	{0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+	{0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+	{0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
+	{0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
+	{0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
 	{0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-	{0x0000c2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
-	{0x0000c2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
-	{0x0000c2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
+	{0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
+	{0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
+	{0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
 	{0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
 	{0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
 	{0x00016048, 0x62480001, 0x62480001, 0x62480001, 0x62480001},



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 07/71] ath9k: ar9003: fix OTP register offsets for AR9340
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2013-01-15 22:54 ` [ 06/71] Revert "ath9k_hw: Update AR9003 high_power tx gain table" Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 08/71] firewire: net: Fix handling of fragmented multicast/broadcast packets Greg Kroah-Hartman
                   ` (65 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Gabor Juhos, John W. Linville

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gabor Juhos <juhosg@openwrt.org>

commit b3cd8021379306c0be6932e4d3b4b01efc681769 upstream.

Trying to access the OTP memory on the AR9340
causes a data bus error like this:

  Data bus error, epc == 86e84164, ra == 86e84164
  Oops[#1]:
  Cpu 0
  $ 0   : 00000000 00000061 deadc0de 00000000
  $ 4   : b8115f18 00015f18 00000007 00000004
  $ 8   : 00000001 7c7c3c7c 7c7c7c7c 7c7c7c7c
  $12   : 7c7c3c7c 001f0041 00000000 7c7c7c3c
  $16   : 86ee0000 00015f18 00000000 00000007
  $20   : 00000004 00000064 00000004 86d71c44
  $24   : 00000000 86e6ca00
  $28   : 86d70000 86d71b20 86ece0c0 86e84164
  Hi    : 00000000
  Lo    : 00000064
  epc   : 86e84164 ath9k_hw_wait+0x58/0xb0 [ath9k_hw]
      Tainted: G           O
  ra    : 86e84164 ath9k_hw_wait+0x58/0xb0 [ath9k_hw]
  Status: 1100d403    KERNEL EXL IE
  Cause : 4080801c
  PrId  : 0001974c (MIPS 74Kc)
  Modules linked in: ath9k(O+) ath9k_common(O) ath9k_hw(O) ath(O) ar934x_nfc
  mac80211(O) usbcore usb_common scsi_mod nls_base nand nand_ecc nand_ids
  crc_ccitt cfg80211(O) compat(O) arc4 aes_generic crypto_blkcipher cryptomgr
  aead crypto_hash crypto_algapi ledtrig_timer ledtrig_default_on leds_gpio
  Process insmod (pid: 459, threadinfo=86d70000, task=87942140, tls=779ac440)
  Stack : 802fb500 000200da 804db150 804e0000 87816130 86ee0000 00010000 86d71b88
          86d71bc0 00000004 00000003 86e9fcd0 80305300 0002c0d0 86e74c50 800b4c20
          000003e8 00000001 00000000 86ee0000 000003ff 86e9fd64 80305300 80123938
          fffffffc 00000004 000058bc 00000000 86ea0000 86ee0000 000001ff 878d6000
          99999999 86e9fdc0 86ee0fcc 86e9e664 0000c0d0 86ee0000 0000700000007000
          ...
  Call Trace:
  [<86e84164>] ath9k_hw_wait+0x58/0xb0 [ath9k_hw]
  [<86e9fcd0>] ath9k_hw_setup_statusring+0x16b8/0x1c7c [ath9k_hw]

  Code: 0000a812  0040f809  00000000 <00531024> 1054000b  24020001  0c05b5dc  2404000a  26520001

The cause of the error is that the OTP register
offsets are different on the AR9340 than the
actually used values.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
@@ -69,13 +69,13 @@
 #define AR9300_BASE_ADDR 0x3ff
 #define AR9300_BASE_ADDR_512 0x1ff
 
-#define AR9300_OTP_BASE			0x14000
-#define AR9300_OTP_STATUS		0x15f18
+#define AR9300_OTP_BASE			(AR_SREV_9340(ah) ? 0x30000 : 0x14000)
+#define AR9300_OTP_STATUS		(AR_SREV_9340(ah) ? 0x30018 : 0x15f18)
 #define AR9300_OTP_STATUS_TYPE		0x7
 #define AR9300_OTP_STATUS_VALID		0x4
 #define AR9300_OTP_STATUS_ACCESS_BUSY	0x2
 #define AR9300_OTP_STATUS_SM_BUSY	0x1
-#define AR9300_OTP_READ_DATA		0x15f1c
+#define AR9300_OTP_READ_DATA		(AR_SREV_9340(ah) ? 0x3001c : 0x15f1c)
 
 enum targetPowerHTRates {
 	HT_TARGET_RATE_0_8_16,



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 08/71] firewire: net: Fix handling of fragmented multicast/broadcast packets.
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2013-01-15 22:54 ` [ 07/71] ath9k: ar9003: fix OTP register offsets for AR9340 Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 09/71] SCSI: mvsas: fix undefined bit shift Greg Kroah-Hartman
                   ` (64 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Stephan Gatzka, Stefan Richter

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stephan Gatzka <stephan.gatzka@gmail.com>

commit 9d2373420900a39f5212a3b289331aa3535b1000 upstream.

This patch fixes both the transmit and receive portion of sending
fragmented mutlicast and broadcast packets.

The transmit section was broken because the offset for INTFRAG and
LASTFRAG packets were just miscalculated by IEEE1394_GASP_HDR_SIZE (which
was reserved with skb_push() in fwnet_send_packet).

The receive section was broken because in fwnet_incoming_packet is a call
to fwnet_peer_find_by_node_id(). Called with generation == -1 it will
not find a peer and the partial datagrams are associated to a peer.

[Stefan R:  The fix to use context->card->generation is not perfect.
It relies on the IR tasklet which processes packets from the prior bus
generation to run before the self-ID-complete worklet which sets the
current card generation.  Alas, there is no simple way of a race-free
implementation.  Let's do it this way for now.]

Signed-off-by: Stephan Gatzka <stephan.gatzka@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/firewire/net.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -863,8 +863,8 @@ static void fwnet_receive_broadcast(stru
 	if (specifier_id == IANA_SPECIFIER_ID && ver == RFC2734_SW_VERSION) {
 		buf_ptr += 2;
 		length -= IEEE1394_GASP_HDR_SIZE;
-		fwnet_incoming_packet(dev, buf_ptr, length,
-				      source_node_id, -1, true);
+		fwnet_incoming_packet(dev, buf_ptr, length, source_node_id,
+				      context->card->generation, true);
 	}
 
 	packet.payload_length = dev->rcv_buffer_size;
@@ -959,7 +959,12 @@ static void fwnet_transmit_packet_done(s
 			break;
 		}
 
-		skb_pull(skb, ptask->max_payload);
+		if (ptask->dest_node == IEEE1394_ALL_NODES) {
+			skb_pull(skb,
+				 ptask->max_payload + IEEE1394_GASP_HDR_SIZE);
+		} else {
+			skb_pull(skb, ptask->max_payload);
+		}
 		if (ptask->outstanding_pkts > 1) {
 			fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_INTFRAG,
 					  dg_size, fg_off, datagram_label);
@@ -1062,7 +1067,7 @@ static int fwnet_send_packet(struct fwne
 		smp_rmb();
 		node_id = dev->card->node_id;
 
-		p = skb_push(ptask->skb, 8);
+		p = skb_push(ptask->skb, IEEE1394_GASP_HDR_SIZE);
 		put_unaligned_be32(node_id << 16 | IANA_SPECIFIER_ID >> 8, p);
 		put_unaligned_be32((IANA_SPECIFIER_ID & 0xff) << 24
 						| RFC2734_SW_VERSION, &p[4]);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 09/71] SCSI: mvsas: fix undefined bit shift
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2013-01-15 22:54 ` [ 08/71] firewire: net: Fix handling of fragmented multicast/broadcast packets Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 10/71] SCSI: qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically Greg Kroah-Hartman
                   ` (63 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Xi Wang, Xiangliang Yu, James Bottomley

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Xi Wang <xi.wang@gmail.com>

commit beecadea1b8d67f591b13f7099559f32f3fd601d upstream.

The macro bit(n) is defined as ((u32)1 << n), and thus it doesn't work
with n >= 32, such as in mvs_94xx_assign_reg_set():

	if (i >= 32) {
		mvi->sata_reg_set |= bit(i);
		...
	}

The shift ((u32)1 << n) with n >= 32 also leads to undefined behavior.
The result varies depending on the architecture.

This patch changes bit(n) to do a 64-bit shift.  It also simplifies
mv_ffc64() using __ffs64(), since invoking ffz() with ~0 is undefined.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Xiangliang Yu <yuxiangl@marvell.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/mvsas/mv_94xx.h |   14 ++------------
 drivers/scsi/mvsas/mv_sas.h  |    2 +-
 2 files changed, 3 insertions(+), 13 deletions(-)

--- a/drivers/scsi/mvsas/mv_94xx.h
+++ b/drivers/scsi/mvsas/mv_94xx.h
@@ -193,21 +193,11 @@ struct mvs_prd {
 #define SPI_ADDR_VLD_94XX         	(1U << 1)
 #define SPI_CTRL_SpiStart_94XX     	(1U << 0)
 
-#define mv_ffc(x)   ffz(x)
-
 static inline int
 mv_ffc64(u64 v)
 {
-	int i;
-	i = mv_ffc((u32)v);
-	if (i >= 0)
-		return i;
-	i = mv_ffc((u32)(v>>32));
-
-	if (i != 0)
-		return 32 + i;
-
-	return -1;
+	u64 x = ~v;
+	return x ? __ffs64(x) : -1;
 }
 
 #define r_reg_set_enable(i) \
--- a/drivers/scsi/mvsas/mv_sas.h
+++ b/drivers/scsi/mvsas/mv_sas.h
@@ -73,7 +73,7 @@ extern struct kmem_cache *mvs_task_list_
 #define DEV_IS_EXPANDER(type)	\
 	((type == EDGE_DEV) || (type == FANOUT_DEV))
 
-#define bit(n) ((u32)1 << n)
+#define bit(n) ((u64)1 << n)
 
 #define for_each_phy(__lseq_mask, __mc, __lseq)			\
 	for ((__mc) = (__lseq_mask), (__lseq) = 0;		\



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 10/71] SCSI: qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically.
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2013-01-15 22:54 ` [ 09/71] SCSI: mvsas: fix undefined bit shift Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 11/71] sata_promise: fix hardreset lockdep error Greg Kroah-Hartman
                   ` (62 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, David Jeffery, Chad Dupuis,
	Saurav Kashyap, James Bottomley

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Jeffery <djeffery@redhat.com>

commit a394aac88506159e047630fc90dc2242568382d8 upstream.

When the qla2xxx driver loses access to multiple, remote ports, there is a race
condition which can occur which will keep the request stuck on a scsi request
queue indefinitely.

This bad state occurred do to a race condition with how the FCPORT_UPDATE_NEEDED
bit is set in qla2x00_schedule_rport_del(), and how it is cleared in
qla2x00_do_dpc().  The problem port has its drport pointer set, but it has never
been processed by the driver to inform the fc transport that the port has been
lost.  qla2x00_schedule_rport_del() sets drport, and then sets the
FCPORT_UPDATE_NEEDED bit.  In qla2x00_do_dpc(), the port lists are walked and
any drport pointer is handled and the fc transport informed of the port loss,
then the FCPORT_UPDATE_NEEDED bit is cleared.  This leaves a race where the
dpc thread is processing one port removal, another port removal is marked
with a call to qla2x00_schedule_rport_del(), and the dpc thread clears the
bit for both removals, even though only the first removal was actually
handled.  Until another event occurs to set FCPORT_UPDATE_NEEDED, the later
port removal is never finished and qla2xxx stays in a bad state which causes
requests to become stuck on request queues.

This patch updates the driver to test and clear FCPORT_UPDATE_NEEDED
atomically.  This ensures the port state changes are processed and not lost.

Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/qla2xxx/qla_os.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3406,9 +3406,9 @@ qla2x00_do_dpc(void *data)
 			    base_vha->host_no));
 		}
 
-		if (test_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags)) {
+		if (test_and_clear_bit(FCPORT_UPDATE_NEEDED,
+		    &base_vha->dpc_flags)) {
 			qla2x00_update_fcports(base_vha);
-			clear_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags);
 		}
 
 		if (test_bit(ISP_QUIESCE_NEEDED, &base_vha->dpc_flags)) {



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 11/71] sata_promise: fix hardreset lockdep error
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2013-01-15 22:54 ` [ 10/71] SCSI: qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 12/71] libata: set dma_mode to 0xff in reset Greg Kroah-Hartman
                   ` (61 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Mikael Pettersson, Adko Branil,
	Jeff Garzik

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mikael Pettersson <mikpe@it.uu.se>

commit 3100d49d3cd236443faae9d81137c81b22d36003 upstream.

sata_promise's pdc_hard_reset_port() needs to serialize because it
flips a port-specific bit in controller register that's shared by
all ports. The code takes the ata host lock for this, but that's
broken because an interrupt may arrive on our irq during the hard
reset sequence, and that too will take the ata host lock. With
lockdep enabled a big nasty warning is seen.

Fixed by adding private state to the ata host structure, containing
a second lock used only for serializing the hard reset sequences.
This eliminated the lockdep warnings both on my test rig and on
the original reporter's machine.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Tested-by: Adko Branil <adkobranil@yahoo.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/ata/sata_promise.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -147,6 +147,10 @@ struct pdc_port_priv {
 	dma_addr_t		pkt_dma;
 };
 
+struct pdc_host_priv {
+	spinlock_t hard_reset_lock;
+};
+
 static int pdc_sata_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
 static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
 static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
@@ -801,9 +805,10 @@ static void pdc_hard_reset_port(struct a
 	void __iomem *host_mmio = ap->host->iomap[PDC_MMIO_BAR];
 	void __iomem *pcictl_b1_mmio = host_mmio + PDC_PCI_CTL + 1;
 	unsigned int ata_no = pdc_ata_port_to_ata_no(ap);
+	struct pdc_host_priv *hpriv = ap->host->private_data;
 	u8 tmp;
 
-	spin_lock(&ap->host->lock);
+	spin_lock(&hpriv->hard_reset_lock);
 
 	tmp = readb(pcictl_b1_mmio);
 	tmp &= ~(0x10 << ata_no);
@@ -814,7 +819,7 @@ static void pdc_hard_reset_port(struct a
 	writeb(tmp, pcictl_b1_mmio);
 	readb(pcictl_b1_mmio); /* flush */
 
-	spin_unlock(&ap->host->lock);
+	spin_unlock(&hpriv->hard_reset_lock);
 }
 
 static int pdc_sata_hardreset(struct ata_link *link, unsigned int *class,
@@ -1183,6 +1188,7 @@ static int pdc_ata_init_one(struct pci_d
 	const struct ata_port_info *pi = &pdc_port_info[ent->driver_data];
 	const struct ata_port_info *ppi[PDC_MAX_PORTS];
 	struct ata_host *host;
+	struct pdc_host_priv *hpriv;
 	void __iomem *host_mmio;
 	int n_ports, i, rc;
 	int is_sataii_tx4;
@@ -1220,6 +1226,11 @@ static int pdc_ata_init_one(struct pci_d
 		dev_printk(KERN_ERR, &pdev->dev, "failed to allocate host\n");
 		return -ENOMEM;
 	}
+	hpriv = devm_kzalloc(&pdev->dev, sizeof *hpriv, GFP_KERNEL);
+	if (!hpriv)
+		return -ENOMEM;
+	spin_lock_init(&hpriv->hard_reset_lock);
+	host->private_data = hpriv;
 	host->iomap = pcim_iomap_table(pdev);
 
 	is_sataii_tx4 = pdc_is_sataii_tx4(pi->flags);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 12/71] libata: set dma_mode to 0xff in reset
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2013-01-15 22:54 ` [ 11/71] sata_promise: fix hardreset lockdep error Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 13/71] libata: fix Null pointer dereference on disk error Greg Kroah-Hartman
                   ` (60 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Phillip Wood, Aaron Lu, Szymon Janc,
	Dutra Julio, Alan Cox, Jeff Garzik

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Aaron Lu <aaron.lu@intel.com>

commit 5416912af75de9cba5d1c75b99a7888b0bbbd2fb upstream.

ata_device->dma_mode's initial value is zero, which is not a valid dma
mode, but ata_dma_enabled will return true for this value. This patch
sets dma_mode to 0xff in reset function, so that ata_dma_enabled will
not return true for this case, or it will cause problem for pata_acpi.

The corrsponding bugzilla page is at:
https://bugzilla.kernel.org/show_bug.cgi?id=49151

Reported-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Tested-by: Szymon Janc <szymon@janc.net.pl>
Tested-by: Dutra Julio <dutra.julio@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/ata/libata-core.c |    1 +
 drivers/ata/libata-eh.c   |    1 +
 2 files changed, 2 insertions(+)

--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2543,6 +2543,7 @@ int ata_bus_probe(struct ata_port *ap)
 		 * bus as we may be talking too fast.
 		 */
 		dev->pio_mode = XFER_PIO_0;
+		dev->dma_mode = 0xff;
 
 		/* If the controller has a pio mode setup function
 		 * then use it to set the chipset to rights. Don't
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2602,6 +2602,7 @@ int ata_eh_reset(struct ata_link *link,
 		 * bus as we may be talking too fast.
 		 */
 		dev->pio_mode = XFER_PIO_0;
+		dev->dma_mode = 0xff;
 
 		/* If the controller has a pio mode setup function
 		 * then use it to set the chipset to rights. Don't



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 13/71] libata: fix Null pointer dereference on disk error
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2013-01-15 22:54 ` [ 12/71] libata: set dma_mode to 0xff in reset Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 14/71] target/tcm_fc: fix the lockdep warning due to inconsistent lock state Greg Kroah-Hartman
                   ` (59 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Xiaotian Feng, James Bottomley,
	Jeff Garzik

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Xiaotian Feng <xtfeng@gmail.com>

commit 26cd4d65deba587f3cf2329b6869ce02bcbe68ec upstream.

Following oops were observed when disk error happened:

[ 4272.896937] sd 0:0:0:0: [sda] Unhandled error code
[ 4272.896939] sd 0:0:0:0: [sda] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ 4272.896942] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 5a de a7 00 00 08 00
[ 4272.896951] end_request: I/O error, dev sda, sector 5955239
[ 4291.574947] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 4291.658305] IP: [] ahci_activity_show+0x1/0x40
[ 4291.730090] PGD 76dbbc067 PUD 6c4fba067 PMD 0
[ 4291.783408] Oops: 0000 [#1] SMP
[ 4291.822100] last sysfs file: /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/sw_activity
[ 4291.934235] CPU 9
[ 4291.958301] Pid: 27942, comm: hwinfo ......

ata_scsi_find_dev could return NULL, so ata_scsi_activity_{show,store} should check if atadev is NULL.

Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com>
Cc: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/ata/libata-scsi.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -308,7 +308,8 @@ ata_scsi_activity_show(struct device *de
 	struct ata_port *ap = ata_shost_to_port(sdev->host);
 	struct ata_device *atadev = ata_scsi_find_dev(ap, sdev);
 
-	if (ap->ops->sw_activity_show && (ap->flags & ATA_FLAG_SW_ACTIVITY))
+	if (atadev && ap->ops->sw_activity_show &&
+	    (ap->flags & ATA_FLAG_SW_ACTIVITY))
 		return ap->ops->sw_activity_show(atadev, buf);
 	return -EINVAL;
 }
@@ -323,7 +324,8 @@ ata_scsi_activity_store(struct device *d
 	enum sw_activity val;
 	int rc;
 
-	if (ap->ops->sw_activity_store && (ap->flags & ATA_FLAG_SW_ACTIVITY)) {
+	if (atadev && ap->ops->sw_activity_store &&
+	    (ap->flags & ATA_FLAG_SW_ACTIVITY)) {
 		val = simple_strtoul(buf, NULL, 0);
 		switch (val) {
 		case OFF: case BLINK_ON: case BLINK_OFF:



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 14/71] target/tcm_fc: fix the lockdep warning due to inconsistent lock state
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2013-01-15 22:54 ` [ 13/71] libata: fix Null pointer dereference on disk error Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 15/71] mfd: Only unregister platform devices allocated by the mfd core Greg Kroah-Hartman
                   ` (58 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Yi Zou, Open-FCoE,
	Nicholas A. Bellinger, Nicholas Bellinger

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yi Zou <yi.zou@intel.com>

commit 9f4ad44b264f8bb61ffdd607148215566568430d upstream.

The lockdep warning below is in theory correct but it will be in really weird
rare situation that ends up that deadlock since the tcm fc session is hashed
based the rport id. Nonetheless, the complaining below is about rcu callback
that does the transport_deregister_session() is happening in softirq, where
transport_register_session() that happens earlier is not. This triggers the
lockdep warning below. So, just fix this to make lockdep happy by disabling
the soft irq before calling transport_register_session() in ft_prli.

BTW, this was found in FCoE VN2VN over two VMs, couple of create and destroy
would get this triggered.

v1: was enforcing register to be in softirq context which was not righ. See,
http://www.spinics.net/lists/target-devel/msg03614.html

v2: following comments from Roland&Nick (thanks), it seems we don't have to
do transport_deregister_session() in rcu callback, so move it into ft_sess_free()
but still do kfree() of the corresponding ft_sess struct in rcu callback to
make sure the ft_sess is not freed till the rcu callback.

...
[ 1328.370592] scsi2 : FCoE Driver
[ 1328.383429] fcoe: No FDMI support.
[ 1328.384509] host2: libfc: Link up on port (000000)
[ 1328.934229] host2: Assigned Port ID 00a292
[ 1357.232132] host2: rport 00a393: Remove port
[ 1357.232568] host2: rport 00a393: Port sending LOGO from Ready state
[ 1357.233692] host2: rport 00a393: Delete port
[ 1357.234472] host2: rport 00a393: work event 3
[ 1357.234969] host2: rport 00a393: callback ev 3
[ 1357.235979] host2: rport 00a393: Received a LOGO response closed
[ 1357.236706] host2: rport 00a393: work delete
[ 1357.237481]
[ 1357.237631] =================================
[ 1357.238064] [ INFO: inconsistent lock state ]
[ 1357.238450] 3.7.0-rc7-yikvm+ #3 Tainted: G           O
[ 1357.238450] ---------------------------------
[ 1357.238450] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
[ 1357.238450] ksoftirqd/0/3 [HC0[0]:SC1[1]:HE0:SE0] takes:
[ 1357.238450]  (&(&se_tpg->session_lock)->rlock){+.?...}, at: [<ffffffffa01eacd4>] transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450] {SOFTIRQ-ON-W} state was registered at:
[ 1357.238450]   [<ffffffff810834f5>] mark_held_locks+0x6d/0x95
[ 1357.238450]   [<ffffffff8108364a>] trace_hardirqs_on_caller+0x12d/0x197
[ 1357.238450]   [<ffffffff810836c1>] trace_hardirqs_on+0xd/0xf
[ 1357.238450]   [<ffffffff8149caba>] _raw_spin_unlock_irq+0x2d/0x45
[ 1357.238450]   [<ffffffffa01e8d10>] __transport_register_session+0xb8/0x122 [target_core_mod]
[ 1357.238450]   [<ffffffffa01e8dbe>] transport_register_session+0x44/0x5a [target_core_mod]
[ 1357.238450]   [<ffffffffa018e32c>] ft_prli+0x1e3/0x275 [tcm_fc]
[ 1357.238450]   [<ffffffffa0160e8d>] fc_rport_recv_req+0x95e/0xdc5 [libfc]
[ 1357.238450]   [<ffffffffa015be88>] fc_lport_recv_els_req+0xc4/0xd5 [libfc]
[ 1357.238450]   [<ffffffffa015c778>] fc_lport_recv_req+0x12f/0x18f [libfc]
[ 1357.238450]   [<ffffffffa015a6d7>] fc_exch_recv+0x8ba/0x981 [libfc]
[ 1357.238450]   [<ffffffffa0176d7a>] fcoe_percpu_receive_thread+0x47a/0x4e2 [fcoe]
[ 1357.238450]   [<ffffffff810549f1>] kthread+0xb1/0xb9
[ 1357.238450]   [<ffffffff814a40ec>] ret_from_fork+0x7c/0xb0
[ 1357.238450] irq event stamp: 275411
[ 1357.238450] hardirqs last  enabled at (275410): [<ffffffff810bb6a0>] rcu_process_callbacks+0x229/0x42a
[ 1357.238450] hardirqs last disabled at (275411): [<ffffffff8149c2f7>] _raw_spin_lock_irqsave+0x22/0x8e
[ 1357.238450] softirqs last  enabled at (275394): [<ffffffff8103d669>] __do_softirq+0x246/0x26f
[ 1357.238450] softirqs last disabled at (275399): [<ffffffff8103d6bb>] run_ksoftirqd+0x29/0x62
[ 1357.238450]
[ 1357.238450] other info that might help us debug this:
[ 1357.238450]  Possible unsafe locking scenario:
[ 1357.238450]
[ 1357.238450]        CPU0
[ 1357.238450]        ----
[ 1357.238450]   lock(&(&se_tpg->session_lock)->rlock);
[ 1357.238450]   <Interrupt>
[ 1357.238450]     lock(&(&se_tpg->session_lock)->rlock);
[ 1357.238450]
[ 1357.238450]  *** DEADLOCK ***
[ 1357.238450]
[ 1357.238450] no locks held by ksoftirqd/0/3.
[ 1357.238450]
[ 1357.238450] stack backtrace:
[ 1357.238450] Pid: 3, comm: ksoftirqd/0 Tainted: G           O 3.7.0-rc7-yikvm+ #3
[ 1357.238450] Call Trace:
[ 1357.238450]  [<ffffffff8149399a>] print_usage_bug+0x1f5/0x206
[ 1357.238450]  [<ffffffff8100da59>] ? save_stack_trace+0x2c/0x49
[ 1357.238450]  [<ffffffff81082aae>] ? print_irq_inversion_bug.part.14+0x1ae/0x1ae
[ 1357.238450]  [<ffffffff81083336>] mark_lock+0x106/0x258
[ 1357.238450]  [<ffffffff81084e34>] __lock_acquire+0x2e7/0xe53
[ 1357.238450]  [<ffffffff8102903d>] ? pvclock_clocksource_read+0x48/0xb4
[ 1357.238450]  [<ffffffff810ba6a3>] ? rcu_process_gp_end+0xc0/0xc9
[ 1357.238450]  [<ffffffffa01eacd4>] ? transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [<ffffffff81085ef1>] lock_acquire+0x119/0x143
[ 1357.238450]  [<ffffffffa01eacd4>] ? transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [<ffffffff8149c329>] _raw_spin_lock_irqsave+0x54/0x8e
[ 1357.238450]  [<ffffffffa01eacd4>] ? transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [<ffffffffa01eacd4>] transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [<ffffffff810bb6a0>] ? rcu_process_callbacks+0x229/0x42a
[ 1357.238450]  [<ffffffffa018ddc5>] ft_sess_rcu_free+0x17/0x24 [tcm_fc]
[ 1357.238450]  [<ffffffffa018ddae>] ? ft_sess_free+0x1b/0x1b [tcm_fc]
[ 1357.238450]  [<ffffffff810bb6d7>] rcu_process_callbacks+0x260/0x42a
[ 1357.238450]  [<ffffffff8103d55d>] __do_softirq+0x13a/0x26f
[ 1357.238450]  [<ffffffff8149b34e>] ? __schedule+0x65f/0x68e
[ 1357.238450]  [<ffffffff8103d6bb>] run_ksoftirqd+0x29/0x62
[ 1357.238450]  [<ffffffff8105c83c>] smpboot_thread_fn+0x1a5/0x1aa
[ 1357.238450]  [<ffffffff8105c697>] ? smpboot_unregister_percpu_thread+0x47/0x47
[ 1357.238450]  [<ffffffff810549f1>] kthread+0xb1/0xb9
[ 1357.238450]  [<ffffffff8149b49d>] ? wait_for_common+0xbb/0x10a
[ 1357.238450]  [<ffffffff81054940>] ? __init_kthread_worker+0x59/0x59
[ 1357.238450]  [<ffffffff814a40ec>] ret_from_fork+0x7c/0xb0
[ 1357.238450]  [<ffffffff81054940>] ? __init_kthread_worker+0x59/0x59
[ 1417.440099]  rport-2:0-0: blocked FC remote port time out: removing rport

Signed-off-by: Yi Zou <yi.zou@intel.com>
Cc: Open-FCoE <devel@open-fcoe.org>
Cc: Nicholas A. Bellinger <nab@risingtidesystems.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/target/tcm_fc/tfc_sess.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/target/tcm_fc/tfc_sess.c
+++ b/drivers/target/tcm_fc/tfc_sess.c
@@ -468,7 +468,6 @@ static void ft_sess_rcu_free(struct rcu_
 {
 	struct ft_sess *sess = container_of(rcu, struct ft_sess, rcu);
 
-	transport_deregister_session(sess->se_sess);
 	kfree(sess);
 }
 
@@ -476,6 +475,7 @@ static void ft_sess_free(struct kref *kr
 {
 	struct ft_sess *sess = container_of(kref, struct ft_sess, kref);
 
+	transport_deregister_session(sess->se_sess);
 	call_rcu(&sess->rcu, ft_sess_rcu_free);
 }
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 15/71] mfd: Only unregister platform devices allocated by the mfd core
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2013-01-15 22:54 ` [ 14/71] target/tcm_fc: fix the lockdep warning due to inconsistent lock state Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 16/71] ext4: fix memory leak in ext4_xattr_set_acl()s error path Greg Kroah-Hartman
                   ` (57 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Charles Keepax, Peter Tyser, Mark Brown,
	Samuel Ortiz

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

commit b9fbb62eb61452d728c39b2e5020739c575aac53 upstream.

mfd_remove_devices would iterate over all devices sharing a parent with
an mfd device regardless of whether they were allocated by the mfd core
or not. This especially caused problems when the device structure was
not contained within a platform_device, because to_platform_device is
used on each device pointer.

This patch defines a device_type for mfd devices and checks this is
present from mfd_remove_devices_fn before processing the device.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Peter Tyser <ptyser@xes-inc.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mfd/mfd-core.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -18,6 +18,10 @@
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
 
+static struct device_type mfd_dev_type = {
+	.name	= "mfd_device",
+};
+
 int mfd_cell_enable(struct platform_device *pdev)
 {
 	const struct mfd_cell *cell = mfd_get_cell(pdev);
@@ -87,6 +91,7 @@ static int mfd_add_device(struct device
 		goto fail_device;
 
 	pdev->dev.parent = parent;
+	pdev->dev.type = &mfd_dev_type;
 
 	if (cell->pdata_size) {
 		ret = platform_device_add_data(pdev,
@@ -182,10 +187,16 @@ EXPORT_SYMBOL(mfd_add_devices);
 
 static int mfd_remove_devices_fn(struct device *dev, void *c)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	const struct mfd_cell *cell = mfd_get_cell(pdev);
+	struct platform_device *pdev;
+	const struct mfd_cell *cell;
 	atomic_t **usage_count = c;
 
+	if (dev->type != &mfd_dev_type)
+		return 0;
+
+	pdev = to_platform_device(dev);
+	cell = mfd_get_cell(pdev);
+
 	/* find the base address of usage_count pointers (for freeing) */
 	if (!*usage_count || (cell->usage_count < *usage_count))
 		*usage_count = cell->usage_count;



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 16/71] ext4: fix memory leak in ext4_xattr_set_acl()s error path
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2013-01-15 22:54 ` [ 15/71] mfd: Only unregister platform devices allocated by the mfd core Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 17/71] SUNRPC: Ensure that we free the rpc_task after cleanups are done Greg Kroah-Hartman
                   ` (56 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Lukas Czerner, Eugene Shatokhin,
	Theodore Tso

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>

commit 24ec19b0ae83a385ad9c55520716da671274b96c upstream.

In ext4_xattr_set_acl(), if ext4_journal_start() returns an error,
posix_acl_release() will not be called for 'acl' which may result in a
memory leak.

This patch fixes that.

Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/acl.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -450,8 +450,10 @@ ext4_xattr_set_acl(struct dentry *dentry
 
 retry:
 	handle = ext4_journal_start(inode, EXT4_DATA_TRANS_BLOCKS(inode->i_sb));
-	if (IS_ERR(handle))
-		return PTR_ERR(handle);
+	if (IS_ERR(handle)) {
+		error = PTR_ERR(handle);
+		goto release_and_out;
+	}
 	error = ext4_set_acl(handle, inode, type, acl);
 	ext4_journal_stop(handle);
 	if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 17/71] SUNRPC: Ensure that we free the rpc_task after cleanups are done
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2013-01-15 22:54 ` [ 16/71] ext4: fix memory leak in ext4_xattr_set_acl()s error path Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 18/71] SUNRPC: Ensure we release the socket write lock if the rpc_task exits early Greg Kroah-Hartman
                   ` (55 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Trond Myklebust, Weston Andros Adamson,
	Tejun Heo, Bruce Fields

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <Trond.Myklebust@netapp.com>

commit c6567ed1402c55e19b012e66a8398baec2a726f3 upstream.

This patch ensures that we free the rpc_task after the cleanup callbacks
are done in order to avoid a deadlock problem that can be triggered if
the callback needs to wait for another workqueue item to complete.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Weston Andros Adamson <dros@netapp.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Bruce Fields <bfields@fieldses.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/sched.c |   27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -844,16 +844,35 @@ struct rpc_task *rpc_new_task(const stru
 	return task;
 }
 
+/*
+ * rpc_free_task - release rpc task and perform cleanups
+ *
+ * Note that we free up the rpc_task _after_ rpc_release_calldata()
+ * in order to work around a workqueue dependency issue.
+ *
+ * Tejun Heo states:
+ * "Workqueue currently considers two work items to be the same if they're
+ * on the same address and won't execute them concurrently - ie. it
+ * makes a work item which is queued again while being executed wait
+ * for the previous execution to complete.
+ *
+ * If a work function frees the work item, and then waits for an event
+ * which should be performed by another work item and *that* work item
+ * recycles the freed work item, it can create a false dependency loop.
+ * There really is no reliable way to detect this short of verifying
+ * every memory free."
+ *
+ */
 static void rpc_free_task(struct rpc_task *task)
 {
-	const struct rpc_call_ops *tk_ops = task->tk_ops;
-	void *calldata = task->tk_calldata;
+	unsigned short tk_flags = task->tk_flags;
 
-	if (task->tk_flags & RPC_TASK_DYNAMIC) {
+	rpc_release_calldata(task->tk_ops, task->tk_calldata);
+
+	if (tk_flags & RPC_TASK_DYNAMIC) {
 		dprintk("RPC: %5u freeing task\n", task->tk_pid);
 		mempool_free(task, rpc_task_mempool);
 	}
-	rpc_release_calldata(tk_ops, calldata);
 }
 
 static void rpc_async_release(struct work_struct *work)



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 18/71] SUNRPC: Ensure we release the socket write lock if the rpc_task exits early
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2013-01-15 22:54 ` [ 17/71] SUNRPC: Ensure that we free the rpc_task after cleanups are done Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-17 15:14   ` Herton Ronaldo Krzesinski
  2013-01-15 22:54 ` [ 19/71] jffs2: hold erase_completion_lock on exit Greg Kroah-Hartman
                   ` (54 subsequent siblings)
  72 siblings, 1 reply; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Chris Perl, Trond Myklebust

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <Trond.Myklebust@netapp.com>

commit 87ed50036b866db2ec2ba16b2a7aec4a2b0b7c39 upstream.

If the rpc_task exits while holding the socket write lock before it has
allocated an rpc slot, then the usual mechanism for releasing the write
lock in xprt_release() is defeated.

The problem occurs if the call to xprt_lock_write() initially fails, so
that the rpc_task is put on the xprt->sending wait queue. If the task
exits after being assigned the lock by __xprt_lock_write_func, but
before it has retried the call to xprt_lock_and_alloc_slot(), then
it calls xprt_release() while holding the write lock, but will
immediately exit due to the test for task->tk_rqstp != NULL.

Reported-by: Chris Perl <chris.perl@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/sched.c |    3 +--
 net/sunrpc/xprt.c  |   12 ++++++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -882,8 +882,7 @@ static void rpc_async_release(struct wor
 
 static void rpc_release_resources_task(struct rpc_task *task)
 {
-	if (task->tk_rqstp)
-		xprt_release(task);
+	xprt_release(task);
 	if (task->tk_msg.rpc_cred) {
 		put_rpccred(task->tk_msg.rpc_cred);
 		task->tk_msg.rpc_cred = NULL;
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1040,10 +1040,18 @@ static void xprt_request_init(struct rpc
 void xprt_release(struct rpc_task *task)
 {
 	struct rpc_xprt	*xprt;
-	struct rpc_rqst	*req;
+	struct rpc_rqst	*req = task->tk_rqstp;
 
-	if (!(req = task->tk_rqstp))
+	if (req == NULL) {
+		if (task->tk_client) {
+			rcu_read_lock();
+			xprt = rcu_dereference(task->tk_client->cl_xprt);
+			if (xprt->snd_task == task)
+				xprt_release_write(xprt, task);
+			rcu_read_unlock();
+		}
 		return;
+	}
 
 	xprt = req->rq_xprt;
 	rpc_count_iostats(task);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 19/71] jffs2: hold erase_completion_lock on exit
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2013-01-15 22:54 ` [ 18/71] SUNRPC: Ensure we release the socket write lock if the rpc_task exits early Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 20/71] i2400m: add Intel 6150 device IDs Greg Kroah-Hartman
                   ` (53 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Alexey Khoroshilov, Artem Bityutskiy

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexey Khoroshilov <khoroshilov@ispras.ru>

commit 2cbba75a56ea78e6876b4e2547a882f10b3fe72b upstream.

Users of jffs2_do_reserve_space() expect they still held
erase_completion_lock after call to it. But there is a path
where jffs2_do_reserve_space() leaves erase_completion_lock unlocked.
The patch fixes it.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/jffs2/nodemgmt.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -355,14 +355,16 @@ static int jffs2_do_reserve_space(struct
 			spin_unlock(&c->erase_completion_lock);
 
 			ret = jffs2_prealloc_raw_node_refs(c, jeb, 1);
-			if (ret)
-				return ret;
+
 			/* Just lock it again and continue. Nothing much can change because
 			   we hold c->alloc_sem anyway. In fact, it's not entirely clear why
 			   we hold c->erase_completion_lock in the majority of this function...
 			   but that's a question for another (more caffeine-rich) day. */
 			spin_lock(&c->erase_completion_lock);
 
+			if (ret)
+				return ret;
+
 			waste = jeb->free_size;
 			jffs2_link_node_ref(c, jeb,
 					    (jeb->offset + c->sector_size - waste) | REF_OBSOLETE,



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 20/71] i2400m: add Intel 6150 device IDs
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2013-01-15 22:54 ` [ 19/71] jffs2: hold erase_completion_lock on exit Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 21/71] drm/i915: make the panel fitter work on pipes B and C on IVB Greg Kroah-Hartman
                   ` (52 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Dan Williams, David S. Miller

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Williams <dcbw@redhat.com>

commit 999a7c5776a0ed2133645fa7e008bec05bda9254 upstream.

Add device IDs for WiMAX function of Intel 6150 cards.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wimax/i2400m/i2400m-usb.h |    3 +++
 drivers/net/wimax/i2400m/usb.c        |    6 ++++++
 2 files changed, 9 insertions(+)

--- a/drivers/net/wimax/i2400m/i2400m-usb.h
+++ b/drivers/net/wimax/i2400m/i2400m-usb.h
@@ -152,6 +152,9 @@ enum {
 	/* Device IDs */
 	USB_DEVICE_ID_I6050 = 0x0186,
 	USB_DEVICE_ID_I6050_2 = 0x0188,
+	USB_DEVICE_ID_I6150 = 0x07d6,
+	USB_DEVICE_ID_I6150_2 = 0x07d7,
+	USB_DEVICE_ID_I6150_3 = 0x07d9,
 	USB_DEVICE_ID_I6250 = 0x0187,
 };
 
--- a/drivers/net/wimax/i2400m/usb.c
+++ b/drivers/net/wimax/i2400m/usb.c
@@ -491,6 +491,9 @@ int i2400mu_probe(struct usb_interface *
 	switch (id->idProduct) {
 	case USB_DEVICE_ID_I6050:
 	case USB_DEVICE_ID_I6050_2:
+	case USB_DEVICE_ID_I6150:
+	case USB_DEVICE_ID_I6150_2:
+	case USB_DEVICE_ID_I6150_3:
 	case USB_DEVICE_ID_I6250:
 		i2400mu->i6050 = 1;
 		break;
@@ -740,6 +743,9 @@ static
 struct usb_device_id i2400mu_id_table[] = {
 	{ USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) },
 	{ USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) },
+	{ USB_DEVICE(0x8087, USB_DEVICE_ID_I6150) },
+	{ USB_DEVICE(0x8087, USB_DEVICE_ID_I6150_2) },
+	{ USB_DEVICE(0x8087, USB_DEVICE_ID_I6150_3) },
 	{ USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) },
 	{ USB_DEVICE(0x8086, 0x0181) },
 	{ USB_DEVICE(0x8086, 0x1403) },



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 21/71] drm/i915: make the panel fitter work on pipes B and C on IVB
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2013-01-15 22:54 ` [ 20/71] i2400m: add Intel 6150 device IDs Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 22/71] RDMA/nes: Fix for crash when registering zero length MR for CQ Greg Kroah-Hartman
                   ` (51 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Paulo Zanoni, Damien Lespiau,
	Daniel Vetter

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

commit 13888d78c664a1f61d7b09d282f5916993827a40 upstream.

I actually found this problem on Haswell, but then discovered Ivy
Bridge also has it by reading the spec.

I don't have the hardware to test this.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/i915_reg.h      |    2 ++
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2754,6 +2754,8 @@
 #define _PFA_CTL_1               0x68080
 #define _PFB_CTL_1               0x68880
 #define  PF_ENABLE              (1<<31)
+#define  PF_PIPE_SEL_MASK_IVB	(3<<29)
+#define  PF_PIPE_SEL_IVB(pipe)	((pipe)<<29)
 #define  PF_FILTER_MASK		(3<<23)
 #define  PF_FILTER_PROGRAMMED	(0<<23)
 #define  PF_FILTER_MED_3x3	(1<<23)
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2696,7 +2696,11 @@ static void ironlake_crtc_enable(struct
 		 * as some pre-programmed values are broken,
 		 * e.g. x201.
 		 */
-		I915_WRITE(PF_CTL(pipe), PF_ENABLE | PF_FILTER_MED_3x3);
+		if (IS_IVYBRIDGE(dev))
+			I915_WRITE(PF_CTL(pipe), PF_ENABLE | PF_FILTER_MED_3x3 |
+						 PF_PIPE_SEL_IVB(pipe));
+		else
+			I915_WRITE(PF_CTL(pipe), PF_ENABLE | PF_FILTER_MED_3x3);
 		I915_WRITE(PF_WIN_POS(pipe), dev_priv->pch_pf_pos);
 		I915_WRITE(PF_WIN_SZ(pipe), dev_priv->pch_pf_size);
 	}



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 22/71] RDMA/nes: Fix for crash when registering zero length MR for CQ
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2013-01-15 22:54 ` [ 21/71] drm/i915: make the panel fitter work on pipes B and C on IVB Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 23/71] RDMA/nes: Fix for terminate timer crash Greg Kroah-Hartman
                   ` (50 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Tatyana Nikolova, Roland Dreier,
	CAI Qian

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>

commit 7d9c199a55200c9b9fcad08e150470d02fb385be upstream.

Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/infiniband/hw/nes/nes_verbs.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -2568,6 +2568,11 @@ static struct ib_mr *nes_reg_user_mr(str
 			return ibmr;
 		case IWNES_MEMREG_TYPE_QP:
 		case IWNES_MEMREG_TYPE_CQ:
+			if (!region->length) {
+				nes_debug(NES_DBG_MR, "Unable to register zero length region for CQ\n");
+				ib_umem_release(region);
+				return ERR_PTR(-EINVAL);
+			}
 			nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL);
 			if (!nespbl) {
 				nes_debug(NES_DBG_MR, "Unable to allocate PBL\n");



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 23/71] RDMA/nes: Fix for terminate timer crash
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (21 preceding siblings ...)
  2013-01-15 22:54 ` [ 22/71] RDMA/nes: Fix for crash when registering zero length MR for CQ Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 24/71] ring-buffer: Fix race between integrity check and readers Greg Kroah-Hartman
                   ` (49 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Tatyana Nikolova, Roland Dreier,
	CAI Qian

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>

commit 7bfcfa51c35cdd2d37e0d70fc11790642dd11fb3 upstream.

The terminate timer needs to be initialized just once.

Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/infiniband/hw/nes/nes.h       |    1 +
 drivers/infiniband/hw/nes/nes_hw.c    |    9 ++-------
 drivers/infiniband/hw/nes/nes_verbs.c |    4 +++-
 3 files changed, 6 insertions(+), 8 deletions(-)

--- a/drivers/infiniband/hw/nes/nes.h
+++ b/drivers/infiniband/hw/nes/nes.h
@@ -511,6 +511,7 @@ void nes_iwarp_ce_handler(struct nes_dev
 int nes_destroy_cqp(struct nes_device *);
 int nes_nic_cm_xmit(struct sk_buff *, struct net_device *);
 void nes_recheck_link_status(struct work_struct *work);
+void nes_terminate_timeout(unsigned long context);
 
 /* nes_nic.c */
 struct net_device *nes_netdev_init(struct nes_device *, void __iomem *);
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -75,7 +75,6 @@ static void nes_process_iwarp_aeqe(struc
 static void process_critical_error(struct nes_device *nesdev);
 static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number);
 static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode);
-static void nes_terminate_timeout(unsigned long context);
 static void nes_terminate_start_timer(struct nes_qp *nesqp);
 
 #ifdef CONFIG_INFINIBAND_NES_DEBUG
@@ -3496,7 +3495,7 @@ static void nes_terminate_received(struc
 }
 
 /* Timeout routine in case terminate fails to complete */
-static void nes_terminate_timeout(unsigned long context)
+void nes_terminate_timeout(unsigned long context)
 {
 	struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context;
 
@@ -3506,11 +3505,7 @@ static void nes_terminate_timeout(unsign
 /* Set a timer in case hw cannot complete the terminate sequence */
 static void nes_terminate_start_timer(struct nes_qp *nesqp)
 {
-	init_timer(&nesqp->terminate_timer);
-	nesqp->terminate_timer.function = nes_terminate_timeout;
-	nesqp->terminate_timer.expires = jiffies + HZ;
-	nesqp->terminate_timer.data = (unsigned long)nesqp;
-	add_timer(&nesqp->terminate_timer);
+	mod_timer(&nesqp->terminate_timer, (jiffies + HZ));
 }
 
 /**
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1414,6 +1414,9 @@ static struct ib_qp *nes_create_qp(struc
 	}
 
 	nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR);
+	init_timer(&nesqp->terminate_timer);
+	nesqp->terminate_timer.function = nes_terminate_timeout;
+	nesqp->terminate_timer.data = (unsigned long)nesqp;
 
 	/* update the QP table */
 	nesdev->nesadapter->qp_table[nesqp->hwqp.qp_id-NES_FIRST_QPN] = nesqp;
@@ -1423,7 +1426,6 @@ static struct ib_qp *nes_create_qp(struc
 	return &nesqp->ibqp;
 }
 
-
 /**
  * nes_clean_cq
  */



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 24/71] ring-buffer: Fix race between integrity check and readers
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (22 preceding siblings ...)
  2013-01-15 22:54 ` [ 23/71] RDMA/nes: Fix for terminate timer crash Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-17 20:02   ` Herton Ronaldo Krzesinski
  2013-01-15 22:54 ` [ 25/71] dm ioctl: prevent unsafe change to dm_ioctl data_size Greg Kroah-Hartman
                   ` (48 subsequent siblings)
  72 siblings, 1 reply; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Steven Rostedt

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Steven Rostedt <srostedt@redhat.com>

commit 9366c1ba13fbc41bdb57702e75ca4382f209c82f upstream.

The function rb_check_pages() was added to make sure the ring buffer's
pages were sane. This check is done when the ring buffer size is modified
as well as when the iterator is released (closing the "trace" file),
as that was considered a non fast path and a good place to do a sanity
check.

The problem is that the check does not have any locks around it.
If one process were to read the trace file, and another were to read
the raw binary file, the check could happen while the reader is reading
the file.

The issues with this is that the check requires to clear the HEAD page
before doing the full check and it restores it afterward. But readers
require the HEAD page to exist before it can read the buffer, otherwise
it gives a nasty warning and disables the buffer.

By adding the reader lock around the check, this keeps the race from
happening.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/trace/ring_buffer.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2926,6 +2926,8 @@ rb_get_reader_page(struct ring_buffer_pe
 	 * Splice the empty reader page into the list around the head.
 	 */
 	reader = rb_set_head_page(cpu_buffer);
+	if (!reader)
+		goto out;
 	cpu_buffer->reader_page->list.next = rb_list_head(reader->list.next);
 	cpu_buffer->reader_page->list.prev = reader->list.prev;
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 25/71] dm ioctl: prevent unsafe change to dm_ioctl data_size
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (23 preceding siblings ...)
  2013-01-15 22:54 ` [ 24/71] ring-buffer: Fix race between integrity check and readers Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 26/71] staging: vt6656: [BUG] out of bound array reference in RFbSetPower Greg Kroah-Hartman
                   ` (47 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Mikulas Patocka, Alasdair G Kergon

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alasdair G Kergon <agk@redhat.com>

commit e910d7ebecd1aac43125944a8641b6cb1a0dfabe upstream.

Abort dm ioctl processing if userspace changes the data_size parameter
after we validated it but before we finished copying the data buffer
from userspace.

The dm ioctl parameters are processed in the following sequence:
 1. ctl_ioctl() calls copy_params();
 2. copy_params() makes a first copy of the fixed-sized portion of the
    userspace parameters into the local variable "tmp";
 3. copy_params() then validates tmp.data_size and allocates a new
    structure big enough to hold the complete data and copies the whole
    userspace buffer there;
 4. ctl_ioctl() reads userspace data the second time and copies the whole
    buffer into the pointer "param";
 5. ctl_ioctl() reads param->data_size without any validation and stores it
    in the variable "input_param_size";
 6. "input_param_size" is further used as the authoritative size of the
    kernel buffer.

The problem is that userspace code could change the contents of user
memory between steps 2 and 4.  In particular, the data_size parameter
can be changed to an invalid value after the kernel has validated it.
This lets userspace force the kernel to access invalid kernel memory.

The fix is to ensure that the size has not changed at step 4.

This patch shouldn't have a security impact because CAP_SYS_ADMIN is
required to run this code, but it should be fixed anyway.

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/dm-ioctl.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1524,6 +1524,14 @@ static int copy_params(struct dm_ioctl _
 	if (copy_from_user(dmi, user, tmp.data_size))
 		goto bad;
 
+	/*
+	 * Abort if something changed the ioctl data while it was being copied.
+	 */
+	if (dmi->data_size != tmp.data_size) {
+		DMERR("rejecting ioctl: data size modified while processing parameters");
+		goto bad;
+	}
+
 	/* Wipe the user buffer so we do not return it to userspace */
 	if (secure_data && clear_user(user, tmp.data_size))
 		goto bad;



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 26/71] staging: vt6656: [BUG] out of bound array reference in RFbSetPower.
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (24 preceding siblings ...)
  2013-01-15 22:54 ` [ 25/71] dm ioctl: prevent unsafe change to dm_ioctl data_size Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 27/71] staging: vt6656: 64 bit fixes: use u32 for QWORD definition Greg Kroah-Hartman
                   ` (46 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Malcolm Priestley

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Malcolm Priestley <tvboxspy@gmail.com>

commit ab1dd9963137a1e122004d5378a581bf16ae9bc8 upstream.

Calling RFbSetPower with uCH zero value will cause out of bound array reference.

This causes 64 bit kernels to oops on boot.

Note: Driver does not function on 64 bit kernels and should be
blacklisted on them.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/vt6656/rf.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -769,6 +769,9 @@ BYTE    byPwr = pDevice->byCCKPwr;
         return TRUE;
     }
 
+	if (uCH == 0)
+		return -EINVAL;
+
     switch (uRATE) {
     case RATE_1M:
     case RATE_2M:



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 27/71] staging: vt6656: 64 bit fixes: use u32 for QWORD definition.
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (25 preceding siblings ...)
  2013-01-15 22:54 ` [ 26/71] staging: vt6656: [BUG] out of bound array reference in RFbSetPower Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 28/71] staging: vt6656: 64 bit fixes : correct all type sizes Greg Kroah-Hartman
                   ` (45 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Malcolm Priestley

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Malcolm Priestley <tvboxspy@gmail.com>

commit a552397d5e4ef0cc0bd3e9595d6acc9a3b381171 upstream.

Size of long issues replace with u32.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/vt6656/ttype.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/staging/vt6656/ttype.h
+++ b/drivers/staging/vt6656/ttype.h
@@ -29,6 +29,8 @@
 #ifndef __TTYPE_H__
 #define __TTYPE_H__
 
+#include <linux/types.h>
+
 /******* Common definitions and typedefs ***********************************/
 
 typedef int             BOOL;
@@ -51,8 +53,8 @@ typedef unsigned long   DWORD;
 // which is NOT really a floating point number.
 typedef union tagUQuadWord {
     struct {
-        DWORD   dwLowDword;
-        DWORD   dwHighDword;
+	u32 dwLowDword;
+	u32 dwHighDword;
     } u;
     double      DoNotUseThisField;
 } UQuadWord;



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 28/71] staging: vt6656: 64 bit fixes : correct all type sizes
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (26 preceding siblings ...)
  2013-01-15 22:54 ` [ 27/71] staging: vt6656: 64 bit fixes: use u32 for QWORD definition Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 29/71] staging: vt6656: 64 bit fixes: fix long warning messages Greg Kroah-Hartman
                   ` (44 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Malcolm Priestley

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Malcolm Priestley <tvboxspy@gmail.com>

commit 7730492855a2f9c828599bcd8d62760f96d319e4 upstream.

After this patch all BYTE/WORD/DWORD types can be replaced with the appropriate u sizes.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/vt6656/ttype.h |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/staging/vt6656/ttype.h
+++ b/drivers/staging/vt6656/ttype.h
@@ -44,9 +44,9 @@ typedef int             BOOL;
 
 /****** Simple typedefs  ***************************************************/
 
-typedef unsigned char   BYTE;           //  8-bit
-typedef unsigned short  WORD;           // 16-bit
-typedef unsigned long   DWORD;          // 32-bit
+typedef u8 BYTE;
+typedef u16 WORD;
+typedef u32 DWORD;
 
 // QWORD is for those situation that we want
 // an 8-byte-aligned 8 byte long structure
@@ -62,8 +62,8 @@ typedef UQuadWord       QWORD;
 
 /****** Common pointer types ***********************************************/
 
-typedef unsigned long   ULONG_PTR;      // 32-bit
-typedef unsigned long   DWORD_PTR;      // 32-bit
+typedef u32 ULONG_PTR;
+typedef u32 DWORD_PTR;
 
 // boolean pointer
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 29/71] staging: vt6656: 64 bit fixes: fix long warning messages.
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (27 preceding siblings ...)
  2013-01-15 22:54 ` [ 28/71] staging: vt6656: 64 bit fixes : correct all type sizes Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 30/71] staging: vt6656: 64bit fixes: key.c/h change unsigned long to u32 Greg Kroah-Hartman
                   ` (43 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Malcolm Priestley

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Malcolm Priestley <tvboxspy@gmail.com>

commit b4dc03af5513774277c9c36b12a25cd3f25f4404 upstream.

Fixes long warning messages from patch
[PATCH 08/14] staging: vt6656: 64 bit fixes : correct all type sizes

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/vt6656/dpc.c  |    4 +--
 drivers/staging/vt6656/key.c  |   47 +++++++++++++++++++++++++++++-------------
 drivers/staging/vt6656/mac.c  |    6 +++--
 drivers/staging/vt6656/rxtx.c |   18 ++++++++++------
 4 files changed, 51 insertions(+), 24 deletions(-)

--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -1256,7 +1256,7 @@ static BOOL s_bHandleRxEncryption (
 
         PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc
         *pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4));
-        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %lx\n",*pdwRxTSC47_16);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16);
         if (byDecMode == KEY_CTL_TKIP) {
             *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV));
         } else {
@@ -1367,7 +1367,7 @@ static BOOL s_bHostWepRxEncryption (
 
         PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc
         *pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4));
-        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %lx\n",*pdwRxTSC47_16);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16);
 
         if (byDecMode == KEY_CTL_TKIP) {
             *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV));
--- a/drivers/staging/vt6656/key.c
+++ b/drivers/staging/vt6656/key.c
@@ -235,7 +235,8 @@ BOOL KeybSetKey(
     PSKeyItem   pKey;
     unsigned int        uKeyIdx;
 
-    DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetKey: %lX\n", dwKeyIndex);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+		"Enter KeybSetKey: %X\n", dwKeyIndex);
 
     j = (MAX_KEY_TABLE-1);
     for (i=0;i<(MAX_KEY_TABLE-1);i++) {
@@ -261,7 +262,9 @@ BOOL KeybSetKey(
                 if ((dwKeyIndex & TRANSMIT_KEY) != 0)  {
                     // Group transmit key
                     pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex;
-                    DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i);
+			DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+				"Group transmit key(R)[%X]: %d\n",
+					pTable->KeyTable[i].dwGTKeyIndex, i);
                 }
                 pTable->KeyTable[i].wKeyCtl &= 0xFF0F;          // clear group key control filed
                 pTable->KeyTable[i].wKeyCtl |= (byKeyDecMode << 4);
@@ -302,9 +305,12 @@ BOOL KeybSetKey(
             }
             DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n");
 
-            DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16);
-            DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0);
-            DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex);
+		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %x\n ",
+			pKey->dwTSC47_16);
+		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ",
+			pKey->wTSC15_0);
+		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %x\n ",
+			pKey->dwKeyIndex);
 
             return (TRUE);
         }
@@ -326,7 +332,9 @@ BOOL KeybSetKey(
             if ((dwKeyIndex & TRANSMIT_KEY) != 0)  {
                 // Group transmit key
                 pTable->KeyTable[j].dwGTKeyIndex = dwKeyIndex;
-                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(N)[%lX]: %d\n", pTable->KeyTable[j].dwGTKeyIndex, j);
+		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+			"Group transmit key(N)[%X]: %d\n",
+				pTable->KeyTable[j].dwGTKeyIndex, j);
             }
             pTable->KeyTable[j].wKeyCtl &= 0xFF0F;          // clear group key control filed
             pTable->KeyTable[j].wKeyCtl |= (byKeyDecMode << 4);
@@ -367,9 +375,11 @@ BOOL KeybSetKey(
         }
         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n");
 
-        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %x\n ",
+		pKey->dwTSC47_16);
         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0);
-        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %x\n ",
+		pKey->dwKeyIndex);
 
         return (TRUE);
     }
@@ -597,7 +607,8 @@ BOOL KeybGetTransmitKey(PSKeyManagement
                             DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%x ", pTable->KeyTable[i].abyBSSID[ii]);
                         }
                         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n");
-                        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex);
+			DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"dwGTKeyIndex: %X\n",
+				pTable->KeyTable[i].dwGTKeyIndex);
 
                     return (TRUE);
                 }
@@ -693,7 +704,10 @@ BOOL KeybSetDefaultKey(
     if ((dwKeyIndex & TRANSMIT_KEY) != 0)  {
         // Group transmit key
         pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex = dwKeyIndex;
-        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex, MAX_KEY_TABLE-1);
+		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+		"Group transmit key(R)[%X]: %d\n",
+		pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex,
+		MAX_KEY_TABLE-1);
 
     }
     pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl &= 0x7F00;          // clear all key control filed
@@ -744,9 +758,11 @@ BOOL KeybSetDefaultKey(
     }
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n");
 
-    DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n", pKey->dwTSC47_16);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %x\n",
+		pKey->dwTSC47_16);
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n", pKey->wTSC15_0);
-    DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n", pKey->dwKeyIndex);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %x\n",
+		pKey->dwKeyIndex);
 
     return (TRUE);
 }
@@ -784,7 +800,8 @@ BOOL KeybSetAllGroupKey(
     PSKeyItem   pKey;
     unsigned int        uKeyIdx;
 
-    DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %X\n",
+		dwKeyIndex);
 
 
     if ((dwKeyIndex & PAIRWISE_KEY) != 0) {                  // Pairwise key
@@ -801,7 +818,9 @@ BOOL KeybSetAllGroupKey(
             if ((dwKeyIndex & TRANSMIT_KEY) != 0)  {
                 // Group transmit key
                 pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex;
-                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i);
+		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+			"Group transmit key(R)[%X]: %d\n",
+			pTable->KeyTable[i].dwGTKeyIndex, i);
 
             }
             pTable->KeyTable[i].wKeyCtl &= 0xFF0F;          // clear group key control filed
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -262,7 +262,8 @@ BYTE            pbyData[24];
     dwData1 <<= 16;
     dwData1 |= MAKEWORD(*(pbyAddr+4), *(pbyAddr+5));
 
-    DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %lX, KeyCtl:%X\n", wOffset, dwData1, wKeyCtl);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %X,"\
+		" KeyCtl:%X\n", wOffset, dwData1, wKeyCtl);
 
     //VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
     //VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
@@ -279,7 +280,8 @@ BYTE            pbyData[24];
     dwData2 <<= 8;
     dwData2 |= *(pbyAddr+0);
 
-    DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2. wOffset: %d, Data: %lX\n", wOffset, dwData2);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2. wOffset: %d, Data: %X\n",
+		wOffset, dwData2);
 
     //VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
     //VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -377,7 +377,8 @@ s_vFillTxKey (
         *(pbyIVHead+3) = (BYTE)(((pDevice->byKeyIndex << 6) & 0xc0) | 0x20); // 0x20 is ExtIV
         // Append IV&ExtIV after Mac Header
         *pdwExtIV = cpu_to_le32(pTransmitKey->dwTSC47_16);
-        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFillTxKey()---- pdwExtIV: %lx\n", *pdwExtIV);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFillTxKey()---- pdwExtIV: %x\n",
+		*pdwExtIV);
 
     } else if (pTransmitKey->byCipherSuite == KEY_CTL_CCMP) {
         pTransmitKey->wTSC15_0++;
@@ -1753,7 +1754,8 @@ s_bPacketToWirelessUsb(
         MIC_vAppend((PBYTE)&(psEthHeader->abyDstAddr[0]), 12);
         dwMIC_Priority = 0;
         MIC_vAppend((PBYTE)&dwMIC_Priority, 4);
-        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC KEY: %lX, %lX\n", dwMICKey0, dwMICKey1);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC KEY: %X, %X\n",
+		dwMICKey0, dwMICKey1);
 
         ///////////////////////////////////////////////////////////////////
 
@@ -2635,7 +2637,8 @@ vDMA0_tx_80211(PSDevice  pDevice, struct
             MIC_vAppend((PBYTE)&(sEthHeader.abyDstAddr[0]), 12);
             dwMIC_Priority = 0;
             MIC_vAppend((PBYTE)&dwMIC_Priority, 4);
-            DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"DMA0_tx_8021:MIC KEY: %lX, %lX\n", dwMICKey0, dwMICKey1);
+		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"DMA0_tx_8021:MIC KEY:"\
+			" %X, %X\n", dwMICKey0, dwMICKey1);
 
             uLength = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen;
 
@@ -2655,7 +2658,8 @@ vDMA0_tx_80211(PSDevice  pDevice, struct
 
             DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"uLength: %d, %d\n", uLength, cbFrameBodySize);
             DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"cbReqCount:%d, %d, %d, %d\n", cbReqCount, cbHeaderSize, uPadding, cbIVlen);
-            DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC:%lx, %lx\n", *pdwMIC_L, *pdwMIC_R);
+		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC:%x, %x\n",
+			*pdwMIC_L, *pdwMIC_R);
 
         }
 
@@ -3029,7 +3033,8 @@ int nsDMA_tx_packet(PSDevice pDevice, un
                         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"error: KEY is GTK!!~~\n");
                     }
                     else {
-                        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
+			DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%X]\n",
+				pTransmitKey->dwKeyIndex);
                         bNeedEncryption = TRUE;
                     }
                 }
@@ -3043,7 +3048,8 @@ int nsDMA_tx_packet(PSDevice pDevice, un
             if (pDevice->bEnableHostWEP) {
                 if ((uNodeIndex != 0) &&
                     (pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex & PAIRWISE_KEY)) {
-                    DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
+			DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%X]\n",
+				pTransmitKey->dwKeyIndex);
                     bNeedEncryption = TRUE;
                  }
              }



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 30/71] staging: vt6656: 64bit fixes: key.c/h change unsigned long to u32
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (28 preceding siblings ...)
  2013-01-15 22:54 ` [ 29/71] staging: vt6656: 64 bit fixes: fix long warning messages Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 31/71] staging: vt6656: 64bit fixes: vCommandTimerWait change calculation of timer Greg Kroah-Hartman
                   ` (42 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Malcolm Priestley

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Malcolm Priestley <tvboxspy@gmail.com>

commit c0d05b305b00c698b0a8c1b3d46c9380bce9db45 upstream.

Fixes long issues.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/vt6656/key.c |    6 +++---
 drivers/staging/vt6656/key.h |    8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/staging/vt6656/key.c
+++ b/drivers/staging/vt6656/key.c
@@ -223,7 +223,7 @@ BOOL KeybSetKey(
     PSKeyManagement pTable,
     PBYTE           pbyBSSID,
     DWORD           dwKeyIndex,
-    unsigned long           uKeyLength,
+	u32 uKeyLength,
     PQWORD          pKeyRSC,
     PBYTE           pbyKey,
     BYTE            byKeyDecMode
@@ -675,7 +675,7 @@ BOOL KeybSetDefaultKey(
     void *pDeviceHandler,
     PSKeyManagement pTable,
     DWORD           dwKeyIndex,
-    unsigned long           uKeyLength,
+	u32 uKeyLength,
     PQWORD          pKeyRSC,
     PBYTE           pbyKey,
     BYTE            byKeyDecMode
@@ -788,7 +788,7 @@ BOOL KeybSetAllGroupKey(
     void *pDeviceHandler,
     PSKeyManagement pTable,
     DWORD           dwKeyIndex,
-    unsigned long           uKeyLength,
+	u32 uKeyLength,
     PQWORD          pKeyRSC,
     PBYTE           pbyKey,
     BYTE            byKeyDecMode
--- a/drivers/staging/vt6656/key.h
+++ b/drivers/staging/vt6656/key.h
@@ -58,7 +58,7 @@
 typedef struct tagSKeyItem
 {
     BOOL        bKeyValid;
-    unsigned long       uKeyLength;
+	u32 uKeyLength;
     BYTE        abyKey[MAX_KEY_LEN];
     QWORD       KeyRSC;
     DWORD       dwTSC47_16;
@@ -107,7 +107,7 @@ BOOL KeybSetKey(
     PSKeyManagement pTable,
     PBYTE           pbyBSSID,
     DWORD           dwKeyIndex,
-    unsigned long           uKeyLength,
+	u32 uKeyLength,
     PQWORD          pKeyRSC,
     PBYTE           pbyKey,
     BYTE            byKeyDecMode
@@ -146,7 +146,7 @@ BOOL KeybSetDefaultKey(
     void *pDeviceHandler,
     PSKeyManagement pTable,
     DWORD           dwKeyIndex,
-    unsigned long           uKeyLength,
+	u32 uKeyLength,
     PQWORD          pKeyRSC,
     PBYTE           pbyKey,
     BYTE            byKeyDecMode
@@ -156,7 +156,7 @@ BOOL KeybSetAllGroupKey(
     void *pDeviceHandler,
     PSKeyManagement pTable,
     DWORD           dwKeyIndex,
-    unsigned long           uKeyLength,
+	u32 uKeyLength,
     PQWORD          pKeyRSC,
     PBYTE           pbyKey,
     BYTE            byKeyDecMode



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 31/71] staging: vt6656: 64bit fixes: vCommandTimerWait change calculation of timer.
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (29 preceding siblings ...)
  2013-01-15 22:54 ` [ 30/71] staging: vt6656: 64bit fixes: key.c/h change unsigned long to u32 Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 32/71] video: mxsfb: fix crash when unblanking the display Greg Kroah-Hartman
                   ` (41 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Malcolm Priestley

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Malcolm Priestley <tvboxspy@gmail.com>

commit 70e227790d4ee4590023d8041a3485f8053593fc upstream.

The timer appears to run too fast/race on 64 bit systems.

Using msecs_to_jiffies seems to cause a deadlock on 64 bit.

A calculation of (MSecond * HZ) / 1000 appears to run satisfactory.

Change BSSIDInfoCount to u32.

After this patch the driver can be successfully connect on little endian 64/32 bit systems.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/vt6656/wcmd.c |   20 +++++++++++---------
 drivers/staging/vt6656/wpa2.h |    4 ++--
 2 files changed, 13 insertions(+), 11 deletions(-)

--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -316,17 +316,19 @@ s_MgrMakeProbeRequest(
     return pTxPacket;
 }
 
-void vCommandTimerWait(void *hDeviceContext, unsigned int MSecond)
+void vCommandTimerWait(void *hDeviceContext, unsigned long MSecond)
 {
-    PSDevice        pDevice = (PSDevice)hDeviceContext;
+	PSDevice pDevice = (PSDevice)hDeviceContext;
 
-    init_timer(&pDevice->sTimerCommand);
-    pDevice->sTimerCommand.data = (unsigned long)pDevice;
-    pDevice->sTimerCommand.function = (TimerFunction)vRunCommand;
-    // RUN_AT :1 msec ~= (HZ/1024)
-    pDevice->sTimerCommand.expires = (unsigned int)RUN_AT((MSecond * HZ) >> 10);
-    add_timer(&pDevice->sTimerCommand);
-    return;
+	init_timer(&pDevice->sTimerCommand);
+
+	pDevice->sTimerCommand.data = (unsigned long)pDevice;
+	pDevice->sTimerCommand.function = (TimerFunction)vRunCommand;
+	pDevice->sTimerCommand.expires = RUN_AT((MSecond * HZ) / 1000);
+
+	add_timer(&pDevice->sTimerCommand);
+
+	return;
 }
 
 void vRunCommand(void *hDeviceContext)
--- a/drivers/staging/vt6656/wpa2.h
+++ b/drivers/staging/vt6656/wpa2.h
@@ -45,8 +45,8 @@ typedef struct tagsPMKIDInfo {
 } PMKIDInfo, *PPMKIDInfo;
 
 typedef struct tagSPMKIDCache {
-    unsigned long       BSSIDInfoCount;
-    PMKIDInfo   BSSIDInfo[MAX_PMKID_CACHE];
+	u32 BSSIDInfoCount;
+	PMKIDInfo BSSIDInfo[MAX_PMKID_CACHE];
 } SPMKIDCache, *PSPMKIDCache;
 
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 32/71] video: mxsfb: fix crash when unblanking the display
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (30 preceding siblings ...)
  2013-01-15 22:54 ` [ 31/71] staging: vt6656: 64bit fixes: vCommandTimerWait change calculation of timer Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 33/71] ext4: fix extent tree corruption caused by hole punch Greg Kroah-Hartman
                   ` (40 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Lothar Waßmann,
	Juergen Beisert, Lauri Hintsala, Shawn Guo

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lothar Waßmann <LW@KARO-electronics.de>

commit 6c1ecba8d84841277d68140ef485335d5be28485 upstream.

The VDCTRL4 register does not provide the MXS SET/CLR/TOGGLE feature.
The write in mxsfb_disable_controller() sets the data_cnt for the LCD
DMA to 0 which obviously means the max. count for the LCD DMA and
leads to overwriting arbitrary memory when the display is unblanked.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Juergen Beisert <jbe@pengutronix.de>
Tested-by: Lauri Hintsala <lauri.hintsala@bluegiga.net>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/video/mxsfb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -365,7 +365,8 @@ static void mxsfb_disable_controller(str
 		loop--;
 	}
 
-	writel(VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4 + REG_CLR);
+	reg = readl(host->base + LCDC_VDCTRL4);
+	writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4);
 
 	clk_disable(host->clk);
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 33/71] ext4: fix extent tree corruption caused by hole punch
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (31 preceding siblings ...)
  2013-01-15 22:54 ` [ 32/71] video: mxsfb: fix crash when unblanking the display Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 34/71] jbd2: fix assertion failure in jbd2_journal_flush() Greg Kroah-Hartman
                   ` (39 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Forrest Liu, Theodore Tso,
	Ashish Sangwan

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Forrest Liu <forrestl@synology.com>

commit c36575e663e302dbaa4d16b9c72d2c9a913a9aef upstream.

When depth of extent tree is greater than 1, logical start value of
interior node is not correctly updated in ext4_ext_rm_idx.

Signed-off-by: Forrest Liu <forrestl@synology.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Ashish Sangwan <ashishsangwan2@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/extents.c |   22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2140,13 +2140,14 @@ ext4_ext_in_cache(struct inode *inode, e
  * last index in the block only.
  */
 static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode,
-			struct ext4_ext_path *path)
+			struct ext4_ext_path *path, int depth)
 {
 	int err;
 	ext4_fsblk_t leaf;
 
 	/* free index block */
-	path--;
+	depth--;
+	path = path + depth;
 	leaf = ext4_idx_pblock(path->p_idx);
 	if (unlikely(path->p_hdr->eh_entries == 0)) {
 		EXT4_ERROR_INODE(inode, "path->p_hdr->eh_entries == 0");
@@ -2162,6 +2163,19 @@ static int ext4_ext_rm_idx(handle_t *han
 	ext_debug("index is empty, remove it, free block %llu\n", leaf);
 	ext4_free_blocks(handle, inode, NULL, leaf, 1,
 			 EXT4_FREE_BLOCKS_METADATA | EXT4_FREE_BLOCKS_FORGET);
+
+	while (--depth >= 0) {
+		if (path->p_idx != EXT_FIRST_INDEX(path->p_hdr))
+			break;
+		path--;
+		err = ext4_ext_get_access(handle, inode, path);
+		if (err)
+			break;
+		path->p_idx->ei_block = (path+1)->p_idx->ei_block;
+		err = ext4_ext_dirty(handle, inode, path);
+		if (err)
+			break;
+	}
 	return err;
 }
 
@@ -2509,7 +2523,7 @@ ext4_ext_rm_leaf(handle_t *handle, struc
 	/* if this leaf is free, then we should
 	 * remove it from index block above */
 	if (err == 0 && eh->eh_entries == 0 && path[depth].p_bh != NULL)
-		err = ext4_ext_rm_idx(handle, inode, path + depth);
+		err = ext4_ext_rm_idx(handle, inode, path, depth);
 
 out:
 	return err;
@@ -2639,7 +2653,7 @@ again:
 				/* index is empty, remove it;
 				 * handle must be already prepared by the
 				 * truncatei_leaf() */
-				err = ext4_ext_rm_idx(handle, inode, path + i);
+				err = ext4_ext_rm_idx(handle, inode, path, i);
 			}
 			/* root level has p_bh == NULL, brelse() eats this */
 			brelse(path[i].p_bh);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 34/71] jbd2: fix assertion failure in jbd2_journal_flush()
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (32 preceding siblings ...)
  2013-01-15 22:54 ` [ 33/71] ext4: fix extent tree corruption caused by hole punch Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 35/71] ext4: do not try to write superblock on ro remount w/o journal Greg Kroah-Hartman
                   ` (38 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Jan Kara, Theodore Tso

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jan Kara <jack@suse.cz>

commit d7961c7fa4d2e3c3f12be67e21ba8799b5a7238a upstream.

The following race is possible between start_this_handle() and someone
calling jbd2_journal_flush().

Process A                              Process B
start_this_handle().
  if (journal->j_barrier_count) # false
  if (!journal->j_running_transaction) { #true
    read_unlock(&journal->j_state_lock);
                                       jbd2_journal_lock_updates()
                                       jbd2_journal_flush()
                                         write_lock(&journal->j_state_lock);
                                         if (journal->j_running_transaction) {
                                           # false
                                         ... wait for committing trans ...
                                         write_unlock(&journal->j_state_lock);
    ...
    write_lock(&journal->j_state_lock);
    if (!journal->j_running_transaction) { # true
      jbd2_get_transaction(journal, new_transaction);
    write_unlock(&journal->j_state_lock);
    goto repeat; # eventually blocks on j_barrier_count > 0
                                         ...
                                         J_ASSERT(!journal->j_running_transaction);
                                           # fails

We fix the race by rechecking j_barrier_count after reacquiring j_state_lock
in exclusive mode.

Reported-by: yjwsignal@empal.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/jbd2/transaction.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -178,7 +178,8 @@ repeat:
 		if (!new_transaction)
 			goto alloc_transaction;
 		write_lock(&journal->j_state_lock);
-		if (!journal->j_running_transaction) {
+		if (!journal->j_running_transaction &&
+		    !journal->j_barrier_count) {
 			jbd2_get_transaction(journal, new_transaction);
 			new_transaction = NULL;
 		}



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 35/71] ext4: do not try to write superblock on ro remount w/o journal
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (33 preceding siblings ...)
  2013-01-15 22:54 ` [ 34/71] jbd2: fix assertion failure in jbd2_journal_flush() Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 36/71] ext4: lock i_mutex when truncating orphan inodes Greg Kroah-Hartman
                   ` (37 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Michael Tokarev, Theodore Tso

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Michael Tokarev <mjt@tls.msk.ru>

commit d096ad0f79a782935d2e06ae8fb235e8c5397775 upstream.

When a journal-less ext4 filesystem is mounted on a read-only block
device (blockdev --setro will do), each remount (for other, unrelated,
flags, like suid=>nosuid etc) results in a series of scary messages
from kernel telling about I/O errors on the device.

This is becauese of the following code ext4_remount():

       if (sbi->s_journal == NULL)
                ext4_commit_super(sb, 1);

at the end of remount procedure, which forces writing (flushing) of
a superblock regardless whenever it is dirty or not, if the filesystem
is readonly or not, and whenever the device itself is readonly or not.

We only need call ext4_commit_super when the file system had been
previously mounted read/write.

Thanks to Eric Sandeen for help in diagnosing this issue.

Signed-off-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4438,7 +4438,7 @@ static int ext4_remount(struct super_blo
 	}
 
 	ext4_setup_system_zone(sb);
-	if (sbi->s_journal == NULL)
+	if (sbi->s_journal == NULL && !(old_sb_flags & MS_RDONLY))
 		ext4_commit_super(sb, 1);
 
 #ifdef CONFIG_QUOTA



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 36/71] ext4: lock i_mutex when truncating orphan inodes
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (34 preceding siblings ...)
  2013-01-15 22:54 ` [ 35/71] ext4: do not try to write superblock on ro remount w/o journal Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-17 20:07   ` Herton Ronaldo Krzesinski
  2013-01-15 22:54 ` [ 37/71] aoe: do not call bdi_init after blk_alloc_queue Greg Kroah-Hartman
                   ` (36 subsequent siblings)
  72 siblings, 1 reply; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Alexander Beregalov, Theodore Tso,
	Zheng Liu

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Theodore Ts'o <tytso@mit.edu>

commit 721e3eba21e43532e438652dd8f1fcdfce3187e7 upstream.

Commit c278531d39 added a warning when ext4_flush_unwritten_io() is
called without i_mutex being taken.  It had previously not been taken
during orphan cleanup since races weren't possible at that point in
the mount process, but as a result of this c278531d39, we will now see
a kernel WARN_ON in this case.  Take the i_mutex in
ext4_orphan_cleanup() to suppress this warning.

Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/super.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2204,7 +2204,9 @@ static void ext4_orphan_cleanup(struct s
 				__func__, inode->i_ino, inode->i_size);
 			jbd_debug(2, "truncating inode %lu to %lld bytes\n",
 				  inode->i_ino, inode->i_size);
+			mutex_lock(&inode->i_mutex);
 			ext4_truncate(inode);
+			mutex_unlock(&inode->i_mutex);
 			nr_truncates++;
 		} else {
 			ext4_msg(sb, KERN_DEBUG,



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 37/71] aoe: do not call bdi_init after blk_alloc_queue
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (35 preceding siblings ...)
  2013-01-15 22:54 ` [ 36/71] ext4: lock i_mutex when truncating orphan inodes Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 38/71] udf: fix memory leak while allocating blocks during write Greg Kroah-Hartman
                   ` (35 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Josh Boyer, Ed Cashin

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ed Cashin <ecashin@coraid.com>

commit 0a41409c518083133e79015092585d68915865be upstream, but doesn't
apply, so this version is different for older kernels than 3.7.x

blk_alloc_queue has already done a bdi_init, so do not bdi_init
again in aoeblk_gdalloc.  The extra call causes list corruption
in the per-CPU backing dev info stats lists.

Affected users see console WARNINGs about list_del corruption on
percpu_counter_destroy when doing "rmmod aoe" or "aoeflush -a"
when AoE targets have been detected and initialized by the
system.

The patch below applies to v3.6.11, with its v47 aoe driver.  It
is expected to apply to all currently maintained stable kernels
except 3.7.y.  A related but different fix has been posted for
3.7.y.

References:

  RedHat bugzilla ticket with original report
  https://bugzilla.redhat.com/show_bug.cgi?id=853064

  LKML discussion of bug and fix
  http://thread.gmane.org/gmane.linux.kernel/1416336/focus=1416497

Reported-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/block/aoe/aoe.h    |    2 +-
 drivers/block/aoe/aoeblk.c |    5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

--- a/drivers/block/aoe/aoe.h
+++ b/drivers/block/aoe/aoe.h
@@ -1,5 +1,5 @@
 /* Copyright (c) 2007 Coraid, Inc.  See COPYING for GPL terms. */
-#define VERSION "47"
+#define VERSION "47q"
 #define AOE_MAJOR 152
 #define DEVICE_NAME "aoe"
 
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -277,8 +277,6 @@ aoeblk_gdalloc(void *vp)
 		goto err_mempool;
 	blk_queue_make_request(d->blkq, aoeblk_make_request);
 	d->blkq->backing_dev_info.name = "aoe";
-	if (bdi_init(&d->blkq->backing_dev_info))
-		goto err_blkq;
 	spin_lock_irqsave(&d->lock, flags);
 	gd->major = AOE_MAJOR;
 	gd->first_minor = d->sysminor * AOE_PARTITIONS;
@@ -299,9 +297,6 @@ aoeblk_gdalloc(void *vp)
 	aoedisk_add_sysfs(d);
 	return;
 
-err_blkq:
-	blk_cleanup_queue(d->blkq);
-	d->blkq = NULL;
 err_mempool:
 	mempool_destroy(d->bufpool);
 err_disk:



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 38/71] udf: fix memory leak while allocating blocks during write
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (36 preceding siblings ...)
  2013-01-15 22:54 ` [ 37/71] aoe: do not call bdi_init after blk_alloc_queue Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 39/71] udf: dont increment lenExtents while writing to a hole Greg Kroah-Hartman
                   ` (34 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Namjae Jeon, Ashish Sangwan, Jan Kara,
	Shuah Khan

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Namjae Jeon <namjae.jeon@samsung.com>

commit 2fb7d99d0de3fd8ae869f35ab682581d8455887a upstream.

Need to brelse the buffer_head stored in cur_epos and next_epos.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/udf/inode.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -738,6 +738,8 @@ static struct buffer_head *inode_getblk(
 				goal, err);
 		if (!newblocknum) {
 			brelse(prev_epos.bh);
+			brelse(cur_epos.bh);
+			brelse(next_epos.bh);
 			*err = -ENOSPC;
 			return NULL;
 		}
@@ -768,6 +770,8 @@ static struct buffer_head *inode_getblk(
 	udf_update_extents(inode, laarr, startnum, endnum, &prev_epos);
 
 	brelse(prev_epos.bh);
+	brelse(cur_epos.bh);
+	brelse(next_epos.bh);
 
 	newblock = udf_get_pblock(inode->i_sb, newblocknum,
 				iinfo->i_location.partitionReferenceNum, 0);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 39/71] udf: dont increment lenExtents while writing to a hole
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (37 preceding siblings ...)
  2013-01-15 22:54 ` [ 38/71] udf: fix memory leak while allocating blocks during write Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 40/71] thp, memcg: split hugepage for memcg oom on cow Greg Kroah-Hartman
                   ` (33 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Namjae Jeon, Ashish Sangwan, Jan Kara,
	Shuah Khan

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Namjae Jeon <namjae.jeon@samsung.com>

commit fb719c59bdb4fca86ee1fd1f42ab3735ca12b6b2 upstream.

Incrementing lenExtents even while writing to a hole is bad
for performance as calls to udf_discard_prealloc and
udf_truncate_tail_extent would not return from start if
isize != lenExtents

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/udf/inode.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -575,6 +575,7 @@ static struct buffer_head *inode_getblk(
 	struct udf_inode_info *iinfo = UDF_I(inode);
 	int goal = 0, pgoal = iinfo->i_location.logicalBlockNum;
 	int lastblock = 0;
+	bool isBeyondEOF;
 
 	prev_epos.offset = udf_file_entry_alloc_offset(inode);
 	prev_epos.block = iinfo->i_location;
@@ -653,7 +654,7 @@ static struct buffer_head *inode_getblk(
 	/* Are we beyond EOF? */
 	if (etype == -1) {
 		int ret;
-
+		isBeyondEOF = 1;
 		if (count) {
 			if (c)
 				laarr[0] = laarr[1];
@@ -696,6 +697,7 @@ static struct buffer_head *inode_getblk(
 		endnum = c + 1;
 		lastblock = 1;
 	} else {
+		isBeyondEOF = 0;
 		endnum = startnum = ((count > 2) ? 2 : count);
 
 		/* if the current extent is in position 0,
@@ -743,7 +745,8 @@ static struct buffer_head *inode_getblk(
 			*err = -ENOSPC;
 			return NULL;
 		}
-		iinfo->i_lenExtents += inode->i_sb->s_blocksize;
+		if (isBeyondEOF)
+			iinfo->i_lenExtents += inode->i_sb->s_blocksize;
 	}
 
 	/* if the extent the requsted block is located in contains multiple



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 40/71] thp, memcg: split hugepage for memcg oom on cow
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (38 preceding siblings ...)
  2013-01-15 22:54 ` [ 39/71] udf: dont increment lenExtents while writing to a hole Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 41/71] x86, amd: Disable way access filter on Piledriver CPUs Greg Kroah-Hartman
                   ` (32 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, David Rientjes, Andrea Arcangeli,
	Johannes Weiner, KAMEZAWA Hiroyuki, Michal Hocko, Andrew Morton,
	Linus Torvalds

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Rientjes <rientjes@google.com>

commit 1f1d06c34f7675026326cd9f39ff91e4555cf355 upstream.

On COW, a new hugepage is allocated and charged to the memcg.  If the
system is oom or the charge to the memcg fails, however, the fault
handler will return VM_FAULT_OOM which results in an oom kill.

Instead, it's possible to fallback to splitting the hugepage so that the
COW results only in an order-0 page being allocated and charged to the
memcg which has a higher liklihood to succeed.  This is expensive
because the hugepage must be split in the page fault handler, but it is
much better than unnecessarily oom killing a process.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/huge_memory.c |    3 +++
 mm/memory.c      |   18 +++++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -920,6 +920,8 @@ int do_huge_pmd_wp_page(struct mm_struct
 		count_vm_event(THP_FAULT_FALLBACK);
 		ret = do_huge_pmd_wp_page_fallback(mm, vma, address,
 						   pmd, orig_pmd, page, haddr);
+		if (ret & VM_FAULT_OOM)
+			split_huge_page(page);
 		put_page(page);
 		goto out;
 	}
@@ -927,6 +929,7 @@ int do_huge_pmd_wp_page(struct mm_struct
 
 	if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) {
 		put_page(new_page);
+		split_huge_page(page);
 		put_page(page);
 		ret |= VM_FAULT_OOM;
 		goto out;
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3470,6 +3470,7 @@ int handle_mm_fault(struct mm_struct *mm
 	if (unlikely(is_vm_hugetlb_page(vma)))
 		return hugetlb_fault(mm, vma, address, flags);
 
+retry:
 	pgd = pgd_offset(mm, address);
 	pud = pud_alloc(mm, pgd, address);
 	if (!pud)
@@ -3483,13 +3484,24 @@ int handle_mm_fault(struct mm_struct *mm
 							  pmd, flags);
 	} else {
 		pmd_t orig_pmd = *pmd;
+		int ret;
+
 		barrier();
 		if (pmd_trans_huge(orig_pmd)) {
 			if (flags & FAULT_FLAG_WRITE &&
 			    !pmd_write(orig_pmd) &&
-			    !pmd_trans_splitting(orig_pmd))
-				return do_huge_pmd_wp_page(mm, vma, address,
-							   pmd, orig_pmd);
+			    !pmd_trans_splitting(orig_pmd)) {
+				ret = do_huge_pmd_wp_page(mm, vma, address, pmd,
+							  orig_pmd);
+				/*
+				 * If COW results in an oom, the huge pmd will
+				 * have been split, so retry the fault on the
+				 * pte for a smaller charge.
+				 */
+				if (unlikely(ret & VM_FAULT_OOM))
+					goto retry;
+				return ret;
+			}
 			return 0;
 		}
 	}



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 41/71] x86, amd: Disable way access filter on Piledriver CPUs
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (39 preceding siblings ...)
  2013-01-15 22:54 ` [ 40/71] thp, memcg: split hugepage for memcg oom on cow Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 42/71] ACPI : do not use Lid and Sleep button for S5 wakeup Greg Kroah-Hartman
                   ` (31 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Andre Przywara, H. Peter Anvin,
	CAI Qian

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andre Przywara <andre.przywara@amd.com>

commit 2bbf0a1427c377350f001fbc6260995334739ad7 upstream.

The Way Access Filter in recent AMD CPUs may hurt the performance of
some workloads, caused by aliasing issues in the L1 cache.
This patch disables it on the affected CPUs.

The issue is similar to that one of last year:
http://lkml.indiana.edu/hypermail/linux/kernel/1107.3/00041.html
This new patch does not replace the old one, we just need another
quirk for newer CPUs.

The performance penalty without the patch depends on the
circumstances, but is a bit less than the last year's 3%.

The workloads affected would be those that access code from the same
physical page under different virtual addresses, so different
processes using the same libraries with ASLR or multiple instances of
PIE-binaries. The code needs to be accessed simultaneously from both
cores of the same compute unit.

More details can be found here:
http://developer.amd.com/Assets/SharedL1InstructionCacheonAMD15hCPU.pdf

CPUs affected are anything with the core known as Piledriver.
That includes the new parts of the AMD A-Series (aka Trinity) and the
just released new CPUs of the FX-Series (aka Vishera).
The model numbering is a bit odd here: FX CPUs have model 2,
A-Series has model 10h, with possible extensions to 1Fh. Hence the
range of model ids.

Signed-off-by: Andre Przywara <osp@andrep.de>
Link: http://lkml.kernel.org/r/1351700450-9277-1-git-send-email-osp@andrep.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/cpu/amd.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -568,6 +568,20 @@ static void __cpuinit init_amd(struct cp
 		}
 	}
 
+	/*
+	 * The way access filter has a performance penalty on some workloads.
+	 * Disable it on the affected CPUs.
+	 */
+	if ((c->x86 == 0x15) &&
+	    (c->x86_model >= 0x02) && (c->x86_model < 0x20)) {
+		u64 val;
+
+		if (!rdmsrl_safe(0xc0011021, &val) && !(val & 0x1E)) {
+			val |= 0x1E;
+			checking_wrmsrl(0xc0011021, val);
+		}
+	}
+
 	cpu_detect_cache_sizes(c);
 
 	/* Multi core CPU? */



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 42/71] ACPI : do not use Lid and Sleep button for S5 wakeup
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (40 preceding siblings ...)
  2013-01-15 22:54 ` [ 41/71] x86, amd: Disable way access filter on Piledriver CPUs Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 43/71] rtnetlink: Compute and store minimum ifinfo dump size Greg Kroah-Hartman
                   ` (30 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Zhang Rui, Rafael J. Wysocki,
	Joseph Salisbury

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhang Rui <rui.zhang@intel.com>

commit b7e383046c2c7c13ad928cd7407eafff758ddd4b upstream.

When system enters power off, the _PSW of Lid device is enabled.
But this may cause the system to reboot instead of power off.

A proper way to fix this is to always disable lid wakeup capability for S5.

References: https://bugzilla.kernel.org/show_bug.cgi?id=35262
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/scan.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -789,8 +789,8 @@ acpi_bus_extract_wakeup_device_power_pac
 static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
 {
 	struct acpi_device_id button_device_ids[] = {
-		{"PNP0C0D", 0},
 		{"PNP0C0C", 0},
+		{"PNP0C0D", 0},
 		{"PNP0C0E", 0},
 		{"", 0},
 	};
@@ -802,6 +802,11 @@ static void acpi_bus_set_run_wake_flags(
 	/* Power button, Lid switch always enable wakeup */
 	if (!acpi_match_device_ids(device, button_device_ids)) {
 		device->wakeup.flags.run_wake = 1;
+		if (!acpi_match_device_ids(device, &button_device_ids[1])) {
+			/* Do not use Lid/sleep button for S5 wakeup */
+			if (device->wakeup.sleep_state == ACPI_STATE_S5)
+				device->wakeup.sleep_state = ACPI_STATE_S4;
+		}
 		device_set_wakeup_capable(&device->dev, true);
 		return;
 	}



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 43/71] rtnetlink: Compute and store minimum ifinfo dump size
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (41 preceding siblings ...)
  2013-01-15 22:54 ` [ 42/71] ACPI : do not use Lid and Sleep button for S5 wakeup Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 44/71] rtnetlink: Fix problem with buffer allocation Greg Kroah-Hartman
                   ` (29 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Greg Rose, Jeff Kirsher, Ben Hutchings

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Greg Rose <gregory.v.rose@intel.com>

commit c7ac8679bec9397afe8918f788cbcef88c38da54 upstream.

The message size allocated for rtnl ifinfo dumps was limited to
a single page.  This is not enough for additional interface info
available with devices that support SR-IOV and caused a bug in
which VF info would not be displayed if more than approximately
40 VFs were created per interface.

Implement a new function pointer for the rtnl_register service that will
calculate the amount of data required for the ifinfo dump and allocate
enough data to satisfy the request.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/infiniband/core/netlink.c    |    2 -
 include/linux/netlink.h              |    6 ++-
 include/net/rtnetlink.h              |    7 ++--
 net/bridge/br_netlink.c              |   15 +++++---
 net/core/fib_rules.c                 |    6 +--
 net/core/neighbour.c                 |   11 +++---
 net/core/rtnetlink.c                 |   60 ++++++++++++++++++++++++++++-------
 net/dcb/dcbnl.c                      |    4 +-
 net/decnet/dn_dev.c                  |    6 +--
 net/decnet/dn_fib.c                  |    4 +-
 net/decnet/dn_route.c                |    5 +-
 net/ipv4/devinet.c                   |    6 +--
 net/ipv4/fib_frontend.c              |    6 +--
 net/ipv4/inet_diag.c                 |    2 -
 net/ipv4/ipmr.c                      |    3 +
 net/ipv4/route.c                     |    2 -
 net/ipv6/addrconf.c                  |   16 +++++----
 net/ipv6/addrlabel.c                 |    9 +++--
 net/ipv6/ip6_fib.c                   |    3 +
 net/ipv6/ip6mr.c                     |    3 +
 net/ipv6/route.c                     |    6 +--
 net/netfilter/ipset/ip_set_core.c    |    2 -
 net/netfilter/nf_conntrack_netlink.c |    4 +-
 net/netlink/af_netlink.c             |   17 ++++++---
 net/netlink/genetlink.c              |    2 -
 net/phonet/pn_netlink.c              |   13 ++++---
 net/sched/act_api.c                  |    7 ++--
 net/sched/cls_api.c                  |    6 +--
 net/sched/sch_api.c                  |   12 +++----
 net/xfrm/xfrm_user.c                 |    3 +
 30 files changed, 158 insertions(+), 90 deletions(-)

--- a/drivers/infiniband/core/netlink.c
+++ b/drivers/infiniband/core/netlink.c
@@ -148,7 +148,7 @@ static int ibnl_rcv_msg(struct sk_buff *
 				return -EINVAL;
 			return netlink_dump_start(nls, skb, nlh,
 						  client->cb_table[op].dump,
-						  NULL);
+						  NULL, 0);
 		}
 	}
 
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -221,7 +221,8 @@ struct netlink_callback {
 	int			(*dump)(struct sk_buff * skb,
 					struct netlink_callback *cb);
 	int			(*done)(struct netlink_callback *cb);
-	int			family;
+	u16			family;
+	u16			min_dump_alloc;
 	long			args[6];
 };
 
@@ -259,7 +260,8 @@ __nlmsg_put(struct sk_buff *skb, u32 pid
 extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
 			      const struct nlmsghdr *nlh,
 			      int (*dump)(struct sk_buff *skb, struct netlink_callback*),
-			      int (*done)(struct netlink_callback*));
+			      int (*done)(struct netlink_callback*),
+			      u16 min_dump_alloc);
 
 
 #define NL_NONROOT_RECV 0x1
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -6,11 +6,14 @@
 
 typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *);
 typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
+typedef u16 (*rtnl_calcit_func)(struct sk_buff *);
 
 extern int	__rtnl_register(int protocol, int msgtype,
-				rtnl_doit_func, rtnl_dumpit_func);
+				rtnl_doit_func, rtnl_dumpit_func,
+				rtnl_calcit_func);
 extern void	rtnl_register(int protocol, int msgtype,
-			      rtnl_doit_func, rtnl_dumpit_func);
+			      rtnl_doit_func, rtnl_dumpit_func,
+			      rtnl_calcit_func);
 extern int	rtnl_unregister(int protocol, int msgtype);
 extern void	rtnl_unregister_all(int protocol);
 
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -219,19 +219,24 @@ int __init br_netlink_init(void)
 	if (err < 0)
 		goto err1;
 
-	err = __rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL, br_dump_ifinfo);
+	err = __rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL,
+			      br_dump_ifinfo, NULL);
 	if (err)
 		goto err2;
-	err = __rtnl_register(PF_BRIDGE, RTM_SETLINK, br_rtm_setlink, NULL);
+	err = __rtnl_register(PF_BRIDGE, RTM_SETLINK,
+			      br_rtm_setlink, NULL, NULL);
 	if (err)
 		goto err3;
-	err = __rtnl_register(PF_BRIDGE, RTM_NEWNEIGH, br_fdb_add, NULL);
+	err = __rtnl_register(PF_BRIDGE, RTM_NEWNEIGH,
+			      br_fdb_add, NULL, NULL);
 	if (err)
 		goto err3;
-	err = __rtnl_register(PF_BRIDGE, RTM_DELNEIGH, br_fdb_delete, NULL);
+	err = __rtnl_register(PF_BRIDGE, RTM_DELNEIGH,
+			      br_fdb_delete, NULL, NULL);
 	if (err)
 		goto err3;
-	err = __rtnl_register(PF_BRIDGE, RTM_GETNEIGH, NULL, br_fdb_dump);
+	err = __rtnl_register(PF_BRIDGE, RTM_GETNEIGH,
+			      NULL, br_fdb_dump, NULL);
 	if (err)
 		goto err3;
 
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -740,9 +740,9 @@ static struct pernet_operations fib_rule
 static int __init fib_rules_init(void)
 {
 	int err;
-	rtnl_register(PF_UNSPEC, RTM_NEWRULE, fib_nl_newrule, NULL);
-	rtnl_register(PF_UNSPEC, RTM_DELRULE, fib_nl_delrule, NULL);
-	rtnl_register(PF_UNSPEC, RTM_GETRULE, NULL, fib_nl_dumprule);
+	rtnl_register(PF_UNSPEC, RTM_NEWRULE, fib_nl_newrule, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_DELRULE, fib_nl_delrule, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETRULE, NULL, fib_nl_dumprule, NULL);
 
 	err = register_pernet_subsys(&fib_rules_net_ops);
 	if (err < 0)
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2918,12 +2918,13 @@ EXPORT_SYMBOL(neigh_sysctl_unregister);
 
 static int __init neigh_init(void)
 {
-	rtnl_register(PF_UNSPEC, RTM_NEWNEIGH, neigh_add, NULL);
-	rtnl_register(PF_UNSPEC, RTM_DELNEIGH, neigh_delete, NULL);
-	rtnl_register(PF_UNSPEC, RTM_GETNEIGH, NULL, neigh_dump_info);
+	rtnl_register(PF_UNSPEC, RTM_NEWNEIGH, neigh_add, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_DELNEIGH, neigh_delete, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETNEIGH, NULL, neigh_dump_info, NULL);
 
-	rtnl_register(PF_UNSPEC, RTM_GETNEIGHTBL, NULL, neightbl_dump_info);
-	rtnl_register(PF_UNSPEC, RTM_SETNEIGHTBL, neightbl_set, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETNEIGHTBL, NULL, neightbl_dump_info,
+		      NULL);
+	rtnl_register(PF_UNSPEC, RTM_SETNEIGHTBL, neightbl_set, NULL, NULL);
 
 	return 0;
 }
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -56,9 +56,11 @@
 struct rtnl_link {
 	rtnl_doit_func		doit;
 	rtnl_dumpit_func	dumpit;
+	rtnl_calcit_func 	calcit;
 };
 
 static DEFINE_MUTEX(rtnl_mutex);
+static u16 min_ifinfo_dump_size;
 
 void rtnl_lock(void)
 {
@@ -144,12 +146,28 @@ static rtnl_dumpit_func rtnl_get_dumpit(
 	return tab ? tab[msgindex].dumpit : NULL;
 }
 
+static rtnl_calcit_func rtnl_get_calcit(int protocol, int msgindex)
+{
+	struct rtnl_link *tab;
+
+	if (protocol <= RTNL_FAMILY_MAX)
+		tab = rtnl_msg_handlers[protocol];
+	else
+		tab = NULL;
+
+	if (tab == NULL || tab[msgindex].calcit == NULL)
+		tab = rtnl_msg_handlers[PF_UNSPEC];
+
+	return tab ? tab[msgindex].calcit : NULL;
+}
+
 /**
  * __rtnl_register - Register a rtnetlink message type
  * @protocol: Protocol family or PF_UNSPEC
  * @msgtype: rtnetlink message type
  * @doit: Function pointer called for each request message
  * @dumpit: Function pointer called for each dump request (NLM_F_DUMP) message
+ * @calcit: Function pointer to calc size of dump message
  *
  * Registers the specified function pointers (at least one of them has
  * to be non-NULL) to be called whenever a request message for the
@@ -162,7 +180,8 @@ static rtnl_dumpit_func rtnl_get_dumpit(
  * Returns 0 on success or a negative error code.
  */
 int __rtnl_register(int protocol, int msgtype,
-		    rtnl_doit_func doit, rtnl_dumpit_func dumpit)
+		    rtnl_doit_func doit, rtnl_dumpit_func dumpit,
+		    rtnl_calcit_func calcit)
 {
 	struct rtnl_link *tab;
 	int msgindex;
@@ -185,6 +204,9 @@ int __rtnl_register(int protocol, int ms
 	if (dumpit)
 		tab[msgindex].dumpit = dumpit;
 
+	if (calcit)
+		tab[msgindex].calcit = calcit;
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(__rtnl_register);
@@ -199,9 +221,10 @@ EXPORT_SYMBOL_GPL(__rtnl_register);
  * of memory implies no sense in continuing.
  */
 void rtnl_register(int protocol, int msgtype,
-		   rtnl_doit_func doit, rtnl_dumpit_func dumpit)
+		   rtnl_doit_func doit, rtnl_dumpit_func dumpit,
+		   rtnl_calcit_func calcit)
 {
-	if (__rtnl_register(protocol, msgtype, doit, dumpit) < 0)
+	if (__rtnl_register(protocol, msgtype, doit, dumpit, calcit) < 0)
 		panic("Unable to register rtnetlink message handler, "
 		      "protocol = %d, message type = %d\n",
 		      protocol, msgtype);
@@ -1825,6 +1848,11 @@ static int rtnl_getlink(struct sk_buff *
 	return err;
 }
 
+static u16 rtnl_calcit(struct sk_buff *skb)
+{
+	return min_ifinfo_dump_size;
+}
+
 static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
 {
 	int idx;
@@ -1854,11 +1882,14 @@ void rtmsg_ifinfo(int type, struct net_d
 	struct net *net = dev_net(dev);
 	struct sk_buff *skb;
 	int err = -ENOBUFS;
+	size_t if_info_size;
 
-	skb = nlmsg_new(if_nlmsg_size(dev), GFP_KERNEL);
+	skb = nlmsg_new((if_info_size = if_nlmsg_size(dev)), GFP_KERNEL);
 	if (skb == NULL)
 		goto errout;
 
+	min_ifinfo_dump_size = max_t(u16, if_info_size, min_ifinfo_dump_size);
+
 	err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0);
 	if (err < 0) {
 		/* -EMSGSIZE implies BUG in if_nlmsg_size() */
@@ -1909,14 +1940,20 @@ static int rtnetlink_rcv_msg(struct sk_b
 	if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) {
 		struct sock *rtnl;
 		rtnl_dumpit_func dumpit;
+		rtnl_calcit_func calcit;
+		u16 min_dump_alloc = 0;
 
 		dumpit = rtnl_get_dumpit(family, type);
 		if (dumpit == NULL)
 			return -EOPNOTSUPP;
+		calcit = rtnl_get_calcit(family, type);
+		if (calcit)
+			min_dump_alloc = calcit(skb);
 
 		__rtnl_unlock();
 		rtnl = net->rtnl;
-		err = netlink_dump_start(rtnl, skb, nlh, dumpit, NULL);
+		err = netlink_dump_start(rtnl, skb, nlh, dumpit,
+					 NULL, min_dump_alloc);
 		rtnl_lock();
 		return err;
 	}
@@ -2026,12 +2063,13 @@ void __init rtnetlink_init(void)
 	netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV);
 	register_netdevice_notifier(&rtnetlink_dev_notifier);
 
-	rtnl_register(PF_UNSPEC, RTM_GETLINK, rtnl_getlink, rtnl_dump_ifinfo);
-	rtnl_register(PF_UNSPEC, RTM_SETLINK, rtnl_setlink, NULL);
-	rtnl_register(PF_UNSPEC, RTM_NEWLINK, rtnl_newlink, NULL);
-	rtnl_register(PF_UNSPEC, RTM_DELLINK, rtnl_dellink, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETLINK, rtnl_getlink,
+		      rtnl_dump_ifinfo, rtnl_calcit);
+	rtnl_register(PF_UNSPEC, RTM_SETLINK, rtnl_setlink, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_NEWLINK, rtnl_newlink, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_DELLINK, rtnl_dellink, NULL, NULL);
 
-	rtnl_register(PF_UNSPEC, RTM_GETADDR, NULL, rtnl_dump_all);
-	rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all);
+	rtnl_register(PF_UNSPEC, RTM_GETADDR, NULL, rtnl_dump_all, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all, NULL);
 }
 
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1819,8 +1819,8 @@ static int __init dcbnl_init(void)
 {
 	INIT_LIST_HEAD(&dcb_app_list);
 
-	rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL);
-	rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL, NULL);
 
 	return 0;
 }
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -1414,9 +1414,9 @@ void __init dn_dev_init(void)
 
 	dn_dev_devices_on();
 
-	rtnl_register(PF_DECnet, RTM_NEWADDR, dn_nl_newaddr, NULL);
-	rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL);
-	rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr);
+	rtnl_register(PF_DECnet, RTM_NEWADDR, dn_nl_newaddr, NULL, NULL);
+	rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL, NULL);
+	rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr, NULL);
 
 	proc_net_fops_create(&init_net, "decnet_dev", S_IRUGO, &dn_dev_seq_fops);
 
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -763,8 +763,8 @@ void __init dn_fib_init(void)
 
 	register_dnaddr_notifier(&dn_fib_dnaddr_notifier);
 
-	rtnl_register(PF_DECnet, RTM_NEWROUTE, dn_fib_rtm_newroute, NULL);
-	rtnl_register(PF_DECnet, RTM_DELROUTE, dn_fib_rtm_delroute, NULL);
+	rtnl_register(PF_DECnet, RTM_NEWROUTE, dn_fib_rtm_newroute, NULL, NULL);
+	rtnl_register(PF_DECnet, RTM_DELROUTE, dn_fib_rtm_delroute, NULL, NULL);
 }
 
 
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1843,10 +1843,11 @@ void __init dn_route_init(void)
 	proc_net_fops_create(&init_net, "decnet_cache", S_IRUGO, &dn_rt_cache_seq_fops);
 
 #ifdef CONFIG_DECNET_ROUTER
-	rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute, dn_fib_dump);
+	rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute,
+		      dn_fib_dump, NULL);
 #else
 	rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute,
-		      dn_cache_dump);
+		      dn_cache_dump, NULL);
 #endif
 }
 
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1838,8 +1838,8 @@ void __init devinet_init(void)
 
 	rtnl_af_register(&inet_af_ops);
 
-	rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL);
-	rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL);
-	rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr);
+	rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL, NULL);
+	rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL, NULL);
+	rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr, NULL);
 }
 
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1124,9 +1124,9 @@ static struct pernet_operations fib_net_
 
 void __init ip_fib_init(void)
 {
-	rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL);
-	rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL);
-	rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib);
+	rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL, NULL);
+	rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL, NULL);
+	rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib, NULL);
 
 	register_pernet_subsys(&fib_net_ops);
 	register_netdevice_notifier(&fib_netdev_notifier);
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -869,7 +869,7 @@ static int inet_diag_rcv_msg(struct sk_b
 		}
 
 		return netlink_dump_start(idiagnl, skb, nlh,
-					  inet_diag_dump, NULL);
+					  inet_diag_dump, NULL, 0);
 	}
 
 	return inet_diag_get_exact(skb, nlh);
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -2554,7 +2554,8 @@ int __init ip_mr_init(void)
 		goto add_proto_fail;
 	}
 #endif
-	rtnl_register(RTNL_FAMILY_IPMR, RTM_GETROUTE, NULL, ipmr_rtm_dumproute);
+	rtnl_register(RTNL_FAMILY_IPMR, RTM_GETROUTE,
+		      NULL, ipmr_rtm_dumproute, NULL);
 	return 0;
 
 #ifdef CONFIG_IP_PIMSM_V2
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -3454,7 +3454,7 @@ int __init ip_rt_init(void)
 	xfrm_init();
 	xfrm4_init(ip_rt_max_size);
 #endif
-	rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL);
+	rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL, NULL);
 
 #ifdef CONFIG_SYSCTL
 	register_pernet_subsys(&sysctl_route_ops);
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4694,16 +4694,20 @@ int __init addrconf_init(void)
 	if (err < 0)
 		goto errout_af;
 
-	err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo);
+	err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo,
+			      NULL);
 	if (err < 0)
 		goto errout;
 
 	/* Only the first call to __rtnl_register can fail */
-	__rtnl_register(PF_INET6, RTM_NEWADDR, inet6_rtm_newaddr, NULL);
-	__rtnl_register(PF_INET6, RTM_DELADDR, inet6_rtm_deladdr, NULL);
-	__rtnl_register(PF_INET6, RTM_GETADDR, inet6_rtm_getaddr, inet6_dump_ifaddr);
-	__rtnl_register(PF_INET6, RTM_GETMULTICAST, NULL, inet6_dump_ifmcaddr);
-	__rtnl_register(PF_INET6, RTM_GETANYCAST, NULL, inet6_dump_ifacaddr);
+	__rtnl_register(PF_INET6, RTM_NEWADDR, inet6_rtm_newaddr, NULL, NULL);
+	__rtnl_register(PF_INET6, RTM_DELADDR, inet6_rtm_deladdr, NULL, NULL);
+	__rtnl_register(PF_INET6, RTM_GETADDR, inet6_rtm_getaddr,
+			inet6_dump_ifaddr, NULL);
+	__rtnl_register(PF_INET6, RTM_GETMULTICAST, NULL,
+			inet6_dump_ifmcaddr, NULL);
+	__rtnl_register(PF_INET6, RTM_GETANYCAST, NULL,
+			inet6_dump_ifacaddr, NULL);
 
 	ipv6_addr_label_rtnl_register();
 
--- a/net/ipv6/addrlabel.c
+++ b/net/ipv6/addrlabel.c
@@ -592,8 +592,11 @@ out:
 
 void __init ipv6_addr_label_rtnl_register(void)
 {
-	__rtnl_register(PF_INET6, RTM_NEWADDRLABEL, ip6addrlbl_newdel, NULL);
-	__rtnl_register(PF_INET6, RTM_DELADDRLABEL, ip6addrlbl_newdel, NULL);
-	__rtnl_register(PF_INET6, RTM_GETADDRLABEL, ip6addrlbl_get, ip6addrlbl_dump);
+	__rtnl_register(PF_INET6, RTM_NEWADDRLABEL, ip6addrlbl_newdel,
+			NULL, NULL);
+	__rtnl_register(PF_INET6, RTM_DELADDRLABEL, ip6addrlbl_newdel,
+			NULL, NULL);
+	__rtnl_register(PF_INET6, RTM_GETADDRLABEL, ip6addrlbl_get,
+			ip6addrlbl_dump, NULL);
 }
 
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1586,7 +1586,8 @@ int __init fib6_init(void)
 	if (ret)
 		goto out_kmem_cache_create;
 
-	ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib);
+	ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib,
+			      NULL);
 	if (ret)
 		goto out_unregister_subsys;
 out:
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1356,7 +1356,8 @@ int __init ip6_mr_init(void)
 		goto add_proto_fail;
 	}
 #endif
-	rtnl_register(RTNL_FAMILY_IP6MR, RTM_GETROUTE, NULL, ip6mr_rtm_dumproute);
+	rtnl_register(RTNL_FAMILY_IP6MR, RTM_GETROUTE, NULL,
+		      ip6mr_rtm_dumproute, NULL);
 	return 0;
 #ifdef CONFIG_IPV6_PIMSM_V2
 add_proto_fail:
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2956,9 +2956,9 @@ int __init ip6_route_init(void)
 		goto fib6_rules_init;
 
 	ret = -ENOBUFS;
-	if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL) ||
-	    __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL) ||
-	    __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL))
+	if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) ||
+	    __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) ||
+	    __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL))
 		goto out_register_late_subsys;
 
 	ret = register_netdevice_notifier(&ip6_route_dev_notifier);
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -1120,7 +1120,7 @@ ip_set_dump(struct sock *ctnl, struct sk
 
 	return netlink_dump_start(ctnl, skb, nlh,
 				  ip_set_dump_start,
-				  ip_set_dump_done);
+				  ip_set_dump_done, 0);
 }
 
 /* Add, del and test */
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -970,7 +970,7 @@ ctnetlink_get_conntrack(struct sock *ctn
 
 	if (nlh->nlmsg_flags & NLM_F_DUMP)
 		return netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table,
-					  ctnetlink_done);
+					  ctnetlink_done, 0);
 
 	err = ctnetlink_parse_zone(cda[CTA_ZONE], &zone);
 	if (err < 0)
@@ -1840,7 +1840,7 @@ ctnetlink_get_expect(struct sock *ctnl,
 	if (nlh->nlmsg_flags & NLM_F_DUMP) {
 		return netlink_dump_start(ctnl, skb, nlh,
 					  ctnetlink_exp_dump_table,
-					  ctnetlink_exp_done);
+					  ctnetlink_exp_done, 0);
 	}
 
 	err = ctnetlink_parse_zone(cda[CTA_EXPECT_ZONE], &zone);
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1677,13 +1677,10 @@ static int netlink_dump(struct sock *sk)
 {
 	struct netlink_sock *nlk = nlk_sk(sk);
 	struct netlink_callback *cb;
-	struct sk_buff *skb;
+	struct sk_buff *skb = NULL;
 	struct nlmsghdr *nlh;
 	int len, err = -ENOBUFS;
-
-	skb = sock_rmalloc(sk, NLMSG_GOODSIZE, 0, GFP_KERNEL);
-	if (!skb)
-		goto errout;
+	int alloc_size;
 
 	mutex_lock(nlk->cb_mutex);
 
@@ -1693,6 +1690,12 @@ static int netlink_dump(struct sock *sk)
 		goto errout_skb;
 	}
 
+	alloc_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE);
+
+	skb = sock_rmalloc(sk, alloc_size, 0, GFP_KERNEL);
+	if (!skb)
+		goto errout;
+
 	len = cb->dump(skb, cb);
 
 	if (len > 0) {
@@ -1735,7 +1738,8 @@ int netlink_dump_start(struct sock *ssk,
 		       const struct nlmsghdr *nlh,
 		       int (*dump)(struct sk_buff *skb,
 				   struct netlink_callback *),
-		       int (*done)(struct netlink_callback *))
+		       int (*done)(struct netlink_callback *),
+		       u16 min_dump_alloc)
 {
 	struct netlink_callback *cb;
 	struct sock *sk;
@@ -1749,6 +1753,7 @@ int netlink_dump_start(struct sock *ssk,
 	cb->dump = dump;
 	cb->done = done;
 	cb->nlh = nlh;
+	cb->min_dump_alloc = min_dump_alloc;
 	atomic_inc(&skb->users);
 	cb->skb = skb;
 
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -525,7 +525,7 @@ static int genl_rcv_msg(struct sk_buff *
 
 		genl_unlock();
 		err = netlink_dump_start(net->genl_sock, skb, nlh,
-					 ops->dumpit, ops->done);
+					 ops->dumpit, ops->done, 0);
 		genl_lock();
 		return err;
 	}
--- a/net/phonet/pn_netlink.c
+++ b/net/phonet/pn_netlink.c
@@ -289,15 +289,16 @@ out:
 
 int __init phonet_netlink_register(void)
 {
-	int err = __rtnl_register(PF_PHONET, RTM_NEWADDR, addr_doit, NULL);
+	int err = __rtnl_register(PF_PHONET, RTM_NEWADDR, addr_doit,
+				  NULL, NULL);
 	if (err)
 		return err;
 
 	/* Further __rtnl_register() cannot fail */
-	__rtnl_register(PF_PHONET, RTM_DELADDR, addr_doit, NULL);
-	__rtnl_register(PF_PHONET, RTM_GETADDR, NULL, getaddr_dumpit);
-	__rtnl_register(PF_PHONET, RTM_NEWROUTE, route_doit, NULL);
-	__rtnl_register(PF_PHONET, RTM_DELROUTE, route_doit, NULL);
-	__rtnl_register(PF_PHONET, RTM_GETROUTE, NULL, route_dumpit);
+	__rtnl_register(PF_PHONET, RTM_DELADDR, addr_doit, NULL, NULL);
+	__rtnl_register(PF_PHONET, RTM_GETADDR, NULL, getaddr_dumpit, NULL);
+	__rtnl_register(PF_PHONET, RTM_NEWROUTE, route_doit, NULL, NULL);
+	__rtnl_register(PF_PHONET, RTM_DELROUTE, route_doit, NULL, NULL);
+	__rtnl_register(PF_PHONET, RTM_GETROUTE, NULL, route_dumpit, NULL);
 	return 0;
 }
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -1115,9 +1115,10 @@ nlmsg_failure:
 
 static int __init tc_action_init(void)
 {
-	rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL);
-	rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL);
-	rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action);
+	rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action,
+		      NULL);
 
 	return 0;
 }
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -610,10 +610,10 @@ EXPORT_SYMBOL(tcf_exts_dump_stats);
 
 static int __init tc_filter_init(void)
 {
-	rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_ctl_tfilter, NULL);
-	rtnl_register(PF_UNSPEC, RTM_DELTFILTER, tc_ctl_tfilter, NULL);
+	rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_ctl_tfilter, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_DELTFILTER, tc_ctl_tfilter, NULL, NULL);
 	rtnl_register(PF_UNSPEC, RTM_GETTFILTER, tc_ctl_tfilter,
-						 tc_dump_tfilter);
+		      tc_dump_tfilter, NULL);
 
 	return 0;
 }
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1792,12 +1792,12 @@ static int __init pktsched_init(void)
 	register_qdisc(&pfifo_head_drop_qdisc_ops);
 	register_qdisc(&mq_qdisc_ops);
 
-	rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL);
-	rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL);
-	rtnl_register(PF_UNSPEC, RTM_GETQDISC, tc_get_qdisc, tc_dump_qdisc);
-	rtnl_register(PF_UNSPEC, RTM_NEWTCLASS, tc_ctl_tclass, NULL);
-	rtnl_register(PF_UNSPEC, RTM_DELTCLASS, tc_ctl_tclass, NULL);
-	rtnl_register(PF_UNSPEC, RTM_GETTCLASS, tc_ctl_tclass, tc_dump_tclass);
+	rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETQDISC, tc_get_qdisc, tc_dump_qdisc, NULL);
+	rtnl_register(PF_UNSPEC, RTM_NEWTCLASS, tc_ctl_tclass, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_DELTCLASS, tc_ctl_tclass, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETTCLASS, tc_ctl_tclass, tc_dump_tclass, NULL);
 
 	return 0;
 }
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2326,7 +2326,8 @@ static int xfrm_user_rcv_msg(struct sk_b
 		if (link->dump == NULL)
 			return -EINVAL;
 
-		return netlink_dump_start(net->xfrm.nlsk, skb, nlh, link->dump, link->done);
+		return netlink_dump_start(net->xfrm.nlsk, skb, nlh,
+					  link->dump, link->done, 0);
 	}
 
 	err = nlmsg_parse(nlh, xfrm_msg_min[type], attrs, XFRMA_MAX,



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 44/71] rtnetlink: Fix problem with buffer allocation
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (42 preceding siblings ...)
  2013-01-15 22:54 ` [ 43/71] rtnetlink: Compute and store minimum ifinfo dump size Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 45/71] rtnetlink: fix rtnl_calcit() and rtnl_dump_ifinfo() Greg Kroah-Hartman
                   ` (28 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Greg Rose, David S. Miller,
	Ben Hutchings

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Greg Rose <gregory.v.rose@intel.com>

commit 115c9b81928360d769a76c632bae62d15206a94a upstream.

Implement a new netlink attribute type IFLA_EXT_MASK.  The mask
is a 32 bit value that can be used to indicate to the kernel that
certain extended ifinfo values are requested by the user application.
At this time the only mask value defined is RTEXT_FILTER_VF to
indicate that the user wants the ifinfo dump to send information
about the VFs belonging to the interface.

This patch fixes a bug in which certain applications do not have
large enough buffers to accommodate the extra information returned
by the kernel with large numbers of SR-IOV virtual functions.
Those applications will not send the new netlink attribute with
the interface info dump request netlink messages so they will
not get unexpectedly large request buffers returned by the kernel.

Modifies the rtnl_calcit function to traverse the list of net
devices and compute the minimum buffer size that can hold the
info dumps of all matching devices based upon the filter passed
in via the new netlink attribute filter mask.  If no filter
mask is sent then the buffer allocation defaults to NLMSG_GOODSIZE.

With this change it is possible to add yet to be defined netlink
attributes to the dump request which should make it fairly extensible
in the future.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.0:
 - Adjust context
 - Drop the change in do_setlink() that reverts commit f18da1456581
   ('net: RTNETLINK adjusting values of min_ifinfo_dump_size'), which
   was never applied here]
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/if_link.h   |    1 
 include/linux/rtnetlink.h |    3 +
 include/net/rtnetlink.h   |    2 -
 net/core/rtnetlink.c      |   77 ++++++++++++++++++++++++++++++++++------------
 4 files changed, 63 insertions(+), 20 deletions(-)

--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -137,6 +137,7 @@ enum {
 	IFLA_AF_SPEC,
 	IFLA_GROUP,		/* Group the device belongs to */
 	IFLA_NET_NS_FD,
+	IFLA_EXT_MASK,		/* Extended info mask, VFs, etc */
 	__IFLA_MAX
 };
 
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -600,6 +600,9 @@ struct tcamsg {
 #define TCA_ACT_TAB 1 /* attr type must be >=1 */	
 #define TCAA_MAX 1
 
+/* New extended info filters for IFLA_EXT_MASK */
+#define RTEXT_FILTER_VF		(1 << 0)
+
 /* End of information exported to user level */
 
 #ifdef __KERNEL__
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -6,7 +6,7 @@
 
 typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *);
 typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
-typedef u16 (*rtnl_calcit_func)(struct sk_buff *);
+typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *);
 
 extern int	__rtnl_register(int protocol, int msgtype,
 				rtnl_doit_func, rtnl_dumpit_func,
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -60,7 +60,6 @@ struct rtnl_link {
 };
 
 static DEFINE_MUTEX(rtnl_mutex);
-static u16 min_ifinfo_dump_size;
 
 void rtnl_lock(void)
 {
@@ -727,10 +726,11 @@ static void copy_rtnl_link_stats64(void
 }
 
 /* All VF info */
-static inline int rtnl_vfinfo_size(const struct net_device *dev)
+static inline int rtnl_vfinfo_size(const struct net_device *dev,
+				   u32 ext_filter_mask)
 {
-	if (dev->dev.parent && dev_is_pci(dev->dev.parent)) {
-
+	if (dev->dev.parent && dev_is_pci(dev->dev.parent) &&
+	    (ext_filter_mask & RTEXT_FILTER_VF)) {
 		int num_vfs = dev_num_vf(dev->dev.parent);
 		size_t size = nla_total_size(sizeof(struct nlattr));
 		size += nla_total_size(num_vfs * sizeof(struct nlattr));
@@ -768,7 +768,8 @@ static size_t rtnl_port_size(const struc
 		return port_self_size;
 }
 
-static noinline size_t if_nlmsg_size(const struct net_device *dev)
+static noinline size_t if_nlmsg_size(const struct net_device *dev,
+				     u32 ext_filter_mask)
 {
 	return NLMSG_ALIGN(sizeof(struct ifinfomsg))
 	       + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */
@@ -786,8 +787,9 @@ static noinline size_t if_nlmsg_size(con
 	       + nla_total_size(4) /* IFLA_MASTER */
 	       + nla_total_size(1) /* IFLA_OPERSTATE */
 	       + nla_total_size(1) /* IFLA_LINKMODE */
-	       + nla_total_size(4) /* IFLA_NUM_VF */
-	       + rtnl_vfinfo_size(dev) /* IFLA_VFINFO_LIST */
+	       + nla_total_size(ext_filter_mask
+			        & RTEXT_FILTER_VF ? 4 : 0) /* IFLA_NUM_VF */
+	       + rtnl_vfinfo_size(dev, ext_filter_mask) /* IFLA_VFINFO_LIST */
 	       + rtnl_port_size(dev) /* IFLA_VF_PORTS + IFLA_PORT_SELF */
 	       + rtnl_link_get_size(dev) /* IFLA_LINKINFO */
 	       + rtnl_link_get_af_size(dev); /* IFLA_AF_SPEC */
@@ -870,7 +872,7 @@ static int rtnl_port_fill(struct sk_buff
 
 static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
 			    int type, u32 pid, u32 seq, u32 change,
-			    unsigned int flags)
+			    unsigned int flags, u32 ext_filter_mask)
 {
 	struct ifinfomsg *ifm;
 	struct nlmsghdr *nlh;
@@ -943,10 +945,11 @@ static int rtnl_fill_ifinfo(struct sk_bu
 		goto nla_put_failure;
 	copy_rtnl_link_stats64(nla_data(attr), stats);
 
-	if (dev->dev.parent)
+	if (dev->dev.parent && (ext_filter_mask & RTEXT_FILTER_VF))
 		NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent));
 
-	if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) {
+	if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent
+	    && (ext_filter_mask & RTEXT_FILTER_VF)) {
 		int i;
 
 		struct nlattr *vfinfo, *vf;
@@ -1033,11 +1036,20 @@ static int rtnl_dump_ifinfo(struct sk_bu
 	struct net_device *dev;
 	struct hlist_head *head;
 	struct hlist_node *node;
+	struct nlattr *tb[IFLA_MAX+1];
+	u32 ext_filter_mask = 0;
 
 	s_h = cb->args[0];
 	s_idx = cb->args[1];
 
 	rcu_read_lock();
+
+	nlmsg_parse(cb->nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
+		    ifla_policy);
+
+	if (tb[IFLA_EXT_MASK])
+		ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+
 	for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) {
 		idx = 0;
 		head = &net->dev_index_head[h];
@@ -1047,7 +1059,8 @@ static int rtnl_dump_ifinfo(struct sk_bu
 			if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
 					     NETLINK_CB(cb->skb).pid,
 					     cb->nlh->nlmsg_seq, 0,
-					     NLM_F_MULTI) <= 0)
+					     NLM_F_MULTI,
+					     ext_filter_mask) <= 0)
 				goto out;
 cont:
 			idx++;
@@ -1081,6 +1094,7 @@ const struct nla_policy ifla_policy[IFLA
 	[IFLA_VF_PORTS]		= { .type = NLA_NESTED },
 	[IFLA_PORT_SELF]	= { .type = NLA_NESTED },
 	[IFLA_AF_SPEC]		= { .type = NLA_NESTED },
+	[IFLA_EXT_MASK]		= { .type = NLA_U32 },
 };
 EXPORT_SYMBOL(ifla_policy);
 
@@ -1813,6 +1827,7 @@ static int rtnl_getlink(struct sk_buff *
 	struct net_device *dev = NULL;
 	struct sk_buff *nskb;
 	int err;
+	u32 ext_filter_mask = 0;
 
 	err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
 	if (err < 0)
@@ -1821,6 +1836,9 @@ static int rtnl_getlink(struct sk_buff *
 	if (tb[IFLA_IFNAME])
 		nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
 
+	if (tb[IFLA_EXT_MASK])
+		ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+
 	ifm = nlmsg_data(nlh);
 	if (ifm->ifi_index > 0)
 		dev = __dev_get_by_index(net, ifm->ifi_index);
@@ -1832,12 +1850,12 @@ static int rtnl_getlink(struct sk_buff *
 	if (dev == NULL)
 		return -ENODEV;
 
-	nskb = nlmsg_new(if_nlmsg_size(dev), GFP_KERNEL);
+	nskb = nlmsg_new(if_nlmsg_size(dev, ext_filter_mask), GFP_KERNEL);
 	if (nskb == NULL)
 		return -ENOBUFS;
 
 	err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).pid,
-			       nlh->nlmsg_seq, 0, 0);
+			       nlh->nlmsg_seq, 0, 0, ext_filter_mask);
 	if (err < 0) {
 		/* -EMSGSIZE implies BUG in if_nlmsg_size */
 		WARN_ON(err == -EMSGSIZE);
@@ -1848,8 +1866,31 @@ static int rtnl_getlink(struct sk_buff *
 	return err;
 }
 
-static u16 rtnl_calcit(struct sk_buff *skb)
+static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
 {
+	struct net *net = sock_net(skb->sk);
+	struct net_device *dev;
+	struct nlattr *tb[IFLA_MAX+1];
+	u32 ext_filter_mask = 0;
+	u16 min_ifinfo_dump_size = 0;
+
+	nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX, ifla_policy);
+
+	if (tb[IFLA_EXT_MASK])
+		ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+
+	if (!ext_filter_mask)
+		return NLMSG_GOODSIZE;
+	/*
+	 * traverse the list of net devices and compute the minimum
+	 * buffer size based upon the filter mask.
+	 */
+	list_for_each_entry(dev, &net->dev_base_head, dev_list) {
+		min_ifinfo_dump_size = max_t(u16, min_ifinfo_dump_size,
+					     if_nlmsg_size(dev,
+						           ext_filter_mask));
+	}
+
 	return min_ifinfo_dump_size;
 }
 
@@ -1884,13 +1925,11 @@ void rtmsg_ifinfo(int type, struct net_d
 	int err = -ENOBUFS;
 	size_t if_info_size;
 
-	skb = nlmsg_new((if_info_size = if_nlmsg_size(dev)), GFP_KERNEL);
+	skb = nlmsg_new((if_info_size = if_nlmsg_size(dev, 0)), GFP_KERNEL);
 	if (skb == NULL)
 		goto errout;
 
-	min_ifinfo_dump_size = max_t(u16, if_info_size, min_ifinfo_dump_size);
-
-	err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0);
+	err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0, 0);
 	if (err < 0) {
 		/* -EMSGSIZE implies BUG in if_nlmsg_size() */
 		WARN_ON(err == -EMSGSIZE);
@@ -1948,7 +1987,7 @@ static int rtnetlink_rcv_msg(struct sk_b
 			return -EOPNOTSUPP;
 		calcit = rtnl_get_calcit(family, type);
 		if (calcit)
-			min_dump_alloc = calcit(skb);
+			min_dump_alloc = calcit(skb, nlh);
 
 		__rtnl_unlock();
 		rtnl = net->rtnl;



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 45/71] rtnetlink: fix rtnl_calcit() and rtnl_dump_ifinfo()
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (43 preceding siblings ...)
  2013-01-15 22:54 ` [ 44/71] rtnetlink: Fix problem with buffer allocation Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 46/71] epoll: prevent missed events on EPOLL_CTL_MOD Greg Kroah-Hartman
                   ` (27 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Eric Dumazet, Greg Rose,
	David S. Miller, Ben Hutchings

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Eric Dumazet <eric.dumazet@gmail.com>

commit a4b64fbe482c7766f7925f03067fc637716bfa3f upstream.

nlmsg_parse() might return an error, so test its return value before
potential random memory accesses.

Errors introduced in commit 115c9b81928 (rtnetlink: Fix problem with
buffer allocation)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/rtnetlink.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1044,11 +1044,12 @@ static int rtnl_dump_ifinfo(struct sk_bu
 
 	rcu_read_lock();
 
-	nlmsg_parse(cb->nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
-		    ifla_policy);
+	if (nlmsg_parse(cb->nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
+			ifla_policy) >= 0) {
 
-	if (tb[IFLA_EXT_MASK])
-		ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+		if (tb[IFLA_EXT_MASK])
+			ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+	}
 
 	for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) {
 		idx = 0;
@@ -1874,10 +1875,11 @@ static u16 rtnl_calcit(struct sk_buff *s
 	u32 ext_filter_mask = 0;
 	u16 min_ifinfo_dump_size = 0;
 
-	nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX, ifla_policy);
-
-	if (tb[IFLA_EXT_MASK])
-		ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+	if (nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
+			ifla_policy) >= 0) {
+		if (tb[IFLA_EXT_MASK])
+			ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+	}
 
 	if (!ext_filter_mask)
 		return NLMSG_GOODSIZE;



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 46/71] epoll: prevent missed events on EPOLL_CTL_MOD
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (44 preceding siblings ...)
  2013-01-15 22:54 ` [ 45/71] rtnetlink: fix rtnl_calcit() and rtnl_dump_ifinfo() Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 47/71] ASoC: wm2000: Fix sense of speech clarity enable Greg Kroah-Hartman
                   ` (26 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Eric Wong, Hans Verkuil, Jiri Olsa,
	Jonathan Corbet, Al Viro, Davide Libenzi, Hans de Goede,
	Mauro Carvalho Chehab, David Miller, Eric Dumazet, Andrew Morton,
	Andreas Voellmy, Junchang(Jason) Wang, Linus Torvalds,
	Ben Hutchings, netdev, linux-fsdevel

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

commit 128dd1759d96ad36c379240f8b9463e8acfd37a1 upstream.

EPOLL_CTL_MOD sets the interest mask before calling f_op->poll() to
ensure events are not missed.  Since the modifications to the interest
mask are not protected by the same lock as ep_poll_callback, we need to
ensure the change is visible to other CPUs calling ep_poll_callback.

We also need to ensure f_op->poll() has an up-to-date view of past
events which occured before we modified the interest mask.  So this
barrier also pairs with the barrier in wq_has_sleeper().

This should guarantee either ep_poll_callback or f_op->poll() (or both)
will notice the readiness of a recently-ready/modified item.

This issue was encountered by Andreas Voellmy and Junchang(Jason) Wang in:
http://thread.gmane.org/gmane.linux.kernel/1408782/

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Voellmy <andreas.voellmy@yale.edu>
Tested-by: "Junchang(Jason) Wang" <junchang.wang@yale.edu>
Cc: netdev@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/eventpoll.c |   22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1197,10 +1197,30 @@ static int ep_modify(struct eventpoll *e
 	 * otherwise we might miss an event that happens between the
 	 * f_op->poll() call and the new event set registering.
 	 */
-	epi->event.events = event->events;
+	epi->event.events = event->events; /* need barrier below */
 	epi->event.data = event->data; /* protected by mtx */
 
 	/*
+	 * The following barrier has two effects:
+	 *
+	 * 1) Flush epi changes above to other CPUs.  This ensures
+	 *    we do not miss events from ep_poll_callback if an
+	 *    event occurs immediately after we call f_op->poll().
+	 *    We need this because we did not take ep->lock while
+	 *    changing epi above (but ep_poll_callback does take
+	 *    ep->lock).
+	 *
+	 * 2) We also need to ensure we do not miss _past_ events
+	 *    when calling f_op->poll().  This barrier also
+	 *    pairs with the barrier in wq_has_sleeper (see
+	 *    comments for wq_has_sleeper).
+	 *
+	 * This barrier will now guarantee ep_poll_callback or f_op->poll
+	 * (or both) will notice the readiness of an item.
+	 */
+	smp_mb();
+
+	/*
 	 * Get current event bits. We can safely use the file* here because
 	 * its usage count has been increased by the caller of this function.
 	 */



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 47/71] ASoC: wm2000: Fix sense of speech clarity enable
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (45 preceding siblings ...)
  2013-01-15 22:54 ` [ 46/71] epoll: prevent missed events on EPOLL_CTL_MOD Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 48/71] ALSA: pxa27x: fix ac97 cold reset Greg Kroah-Hartman
                   ` (25 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Mark Brown

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mark Brown <broonie@opensource.wolfsonmicro.com>

commit 267f8fa2e1eef0612b2007e1f1846bcbc35cc1fa upstream.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/codecs/wm2000.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -224,9 +224,9 @@ static int wm2000_power_up(struct i2c_cl
 
 	ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY);
 	if (wm2000->speech_clarity)
-		ret &= ~WM2000_SPEECH_CLARITY;
-	else
 		ret |= WM2000_SPEECH_CLARITY;
+	else
+		ret &= ~WM2000_SPEECH_CLARITY;
 	wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret);
 
 	wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 48/71] ALSA: pxa27x: fix ac97 cold reset
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (46 preceding siblings ...)
  2013-01-15 22:54 ` [ 47/71] ASoC: wm2000: Fix sense of speech clarity enable Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 49/71] staging: comedi: prevent auto-unconfig of manually configured devices Greg Kroah-Hartman
                   ` (24 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Mike Dunn, Igor Grinberg, Mark Brown

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mike Dunn <mikedunn@newsguy.com>

commit 41b645c8624df6ace020a8863ad1449d69140f7d upstream.

Cold reset on the pxa27x currently fails and

     pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)

appears in the kernel log.  Through trial-and-error (the pxa270 developer's
manual is mostly incoherent on the topic of ac97 reset), I got cold reset to
complete by setting the WARM_RST bit in the GCR register (and later noticed that
pxa3xx does this for cold reset as well).  Also, a timeout loop is needed to
wait for the reset to complete.

Tested on a palm treo 680 machine.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/arm/pxa2xx-ac97-lib.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -146,6 +146,8 @@ static inline void pxa_ac97_warm_pxa27x(
 
 static inline void pxa_ac97_cold_pxa27x(void)
 {
+	unsigned int timeout;
+
 	GCR &=  GCR_COLD_RST;  /* clear everything but nCRST */
 	GCR &= ~GCR_COLD_RST;  /* then assert nCRST */
 
@@ -155,8 +157,10 @@ static inline void pxa_ac97_cold_pxa27x(
 	clk_enable(ac97conf_clk);
 	udelay(5);
 	clk_disable(ac97conf_clk);
-	GCR = GCR_COLD_RST;
-	udelay(50);
+	GCR = GCR_COLD_RST | GCR_WARM_RST;
+	timeout = 100;     /* wait for the codec-ready bit to be set */
+	while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
+		mdelay(1);
 }
 #endif
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 49/71] staging: comedi: prevent auto-unconfig of manually configured devices
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (47 preceding siblings ...)
  2013-01-15 22:54 ` [ 48/71] ALSA: pxa27x: fix ac97 cold reset Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 50/71] staging: comedi: comedi_test: fix race when cancelling command Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Ian Abbott

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ian Abbott <abbotti@mev.co.uk>

commit 7d3135af399e92cf4c9bbc5f86b6c140aab3b88c upstream.

When a low-level comedi driver auto-configures a device, a `struct
comedi_dev_file_info` is allocated (as well as a `struct
comedi_device`) by `comedi_alloc_board_minor()`.  A pointer to the
hardware `struct device` is stored as a cookie in the `struct
comedi_dev_file_info`.  When the low-level comedi driver
auto-unconfigures the device, `comedi_auto_unconfig()` uses the cookie
to find the `struct comedi_dev_file_info` so it can detach the comedi
device from the driver, clean it up and free it.

A problem arises if the user manually unconfigures and reconfigures the
comedi device using the `COMEDI_DEVCONFIG` ioctl so that is no longer
associated with the original hardware device.  The problem is that the
cookie is not cleared, so that a call to `comedi_auto_unconfig()` from
the low-level driver will still find it, detach it, clean it up and free
it.

Stop this problem occurring by always clearing the `hardware_device`
cookie in the `struct comedi_dev_file_info` whenever the
`COMEDI_DEVCONFIG` ioctl call is successful.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/comedi_fops.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -138,6 +138,9 @@ static long comedi_unlocked_ioctl(struct
 	if (cmd == COMEDI_DEVCONFIG) {
 		rc = do_devconfig_ioctl(dev,
 					(struct comedi_devconfig __user *)arg);
+		if (rc == 0)
+			/* Evade comedi_auto_unconfig(). */
+			dev_file_info->hardware_device = NULL;
 		goto done;
 	}
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 50/71] staging: comedi: comedi_test: fix race when cancelling command
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (48 preceding siblings ...)
  2013-01-15 22:54 ` [ 49/71] staging: comedi: prevent auto-unconfig of manually configured devices Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 51/71] staging: r8712u: Add new device ID Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Ian Abbott, Éric Piel

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ian Abbott <abbotti@mev.co.uk>

commit c0729eeefdcd76db338f635162bf0739fd2c5f6f upstream.

Éric Piel reported a kernel oops in the "comedi_test" module.  It was a
NULL pointer dereference within `waveform_ai_interrupt()` (actually a
timer function) that sometimes occurred when a running asynchronous
command is cancelled (either by the `COMEDI_CANCEL` ioctl or by closing
the device file).

This seems to be a race between the caller of `waveform_ai_cancel()`
which on return from that function goes and tears down the running
command, and the timer function which uses the command.  In particular,
`async->cmd.chanlist` gets freed (and the pointer set to NULL) by
`do_become_nonbusy()` in "comedi_fops.c" but a previously scheduled
`waveform_ai_interrupt()` timer function will dereference that pointer
regardless, leading to the oops.

Fix it by replacing the `del_timer()` call in `waveform_ai_cancel()`
with `del_timer_sync()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reported-by: Éric Piel <piel@delmic.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/drivers/comedi_test.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/comedi/drivers/comedi_test.c
+++ b/drivers/staging/comedi/drivers/comedi_test.c
@@ -461,7 +461,7 @@ static int waveform_ai_cancel(struct com
 			      struct comedi_subdevice *s)
 {
 	devpriv->timer_running = 0;
-	del_timer(&devpriv->timer);
+	del_timer_sync(&devpriv->timer);
 	return 0;
 }
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 51/71] staging: r8712u: Add new device ID
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (49 preceding siblings ...)
  2013-01-15 22:54 ` [ 50/71] staging: comedi: comedi_test: fix race when cancelling command Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 52/71] staging: speakup: avoid out-of-range access in synth_init() Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Thomas Hartmann, Larry Finger

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Larry Finger <Larry.Finger@lwfinger.net>

commit da849a92d3bafaf24d770e971c2c9e5c3f60b5d1 upstream.

The ISY IWL 1000 USB WLAN stick with USB ID 050d:11f1 is a clone of
the Belkin F7D1101 V1 device.

Reported-by: Thomas Hartmann <hartmann@ict.tuwien.ac.at>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Thomas Hartmann <hartmann@ict.tuwien.ac.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/rtl8712/usb_intf.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -62,6 +62,8 @@ static struct usb_device_id rtl871x_usb_
 	{USB_DEVICE(0x0B05, 0x1791)}, /* 11n mode disable */
 	/* Belkin */
 	{USB_DEVICE(0x050D, 0x945A)},
+	/* ISY IWL - Belkin clone */
+	{USB_DEVICE(0x050D, 0x11F1)},
 	/* Corega */
 	{USB_DEVICE(0x07AA, 0x0047)},
 	/* D-Link */



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 52/71] staging: speakup: avoid out-of-range access in synth_init()
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (50 preceding siblings ...)
  2013-01-15 22:54 ` [ 51/71] staging: r8712u: Add new device ID Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 53/71] staging: speakup: avoid out-of-range access in synth_add() Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Nickolai Zeldovich, Samuel Thibault

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nickolai Zeldovich <nickolai@csail.mit.edu>

commit ae428655b826f2755a8101b27beda42a275ef8ad upstream.

Check that array index is in-bounds before accessing the synths[] array.

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/speakup/synth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -342,7 +342,7 @@ int synth_init(char *synth_name)
 
 	mutex_lock(&spk_mutex);
 	/* First, check if we already have it loaded. */
-	for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++)
+	for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++)
 		if (strcmp(synths[i]->name, synth_name) == 0)
 			synth = synths[i];
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 53/71] staging: speakup: avoid out-of-range access in synth_add()
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (51 preceding siblings ...)
  2013-01-15 22:54 ` [ 52/71] staging: speakup: avoid out-of-range access in synth_init() Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 54/71] radeon/kms: force rn50 chip to always report connected on analog output Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Samuel Thibault, Nickolai Zeldovich

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Samuel Thibault <samuel.thibault@ens-lyon.org>

commit 6102c48bd421074a33e102f2ebda3724e8d275f9 upstream.

Check that array index is in-bounds before accessing the synths[] array.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/speakup/synth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -423,7 +423,7 @@ int synth_add(struct spk_synth *in_synth
 	int i;
 	int status = 0;
 	mutex_lock(&spk_mutex);
-	for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++)
+	for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++)
 		/* synth_remove() is responsible for rotating the array down */
 		if (in_synth == synths[i]) {
 			mutex_unlock(&spk_mutex);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 54/71] radeon/kms: force rn50 chip to always report connected on analog output
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (52 preceding siblings ...)
  2013-01-15 22:54 ` [ 53/71] staging: speakup: avoid out-of-range access in synth_add() Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 55/71] mac80211: use del_timer_sync for final sta cleanup timer deletion Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Jerome Glisse, Alex Deucher

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jerome Glisse <jglisse@redhat.com>

commit 51861d4eebc2ddc25c77084343d060fa79f6e291 upstream.

Those rn50 chip are often connected to console remoting hw and load
detection often fails with those. Just don't try to load detect and
report connect.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -617,6 +617,14 @@ static enum drm_connector_status radeon_
 	enum drm_connector_status found = connector_status_disconnected;
 	bool color = true;
 
+	/* just don't bother on RN50 those chip are often connected to remoting
+	 * console hw and often we get failure to load detect those. So to make
+	 * everyone happy report the encoder as always connected.
+	 */
+	if (ASIC_IS_RN50(rdev)) {
+		return connector_status_connected;
+	}
+
 	/* save the regs we need */
 	vclk_ecp_cntl = RREG32_PLL(RADEON_VCLK_ECP_CNTL);
 	crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 55/71] mac80211: use del_timer_sync for final sta cleanup timer deletion
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (53 preceding siblings ...)
  2013-01-15 22:54 ` [ 54/71] radeon/kms: force rn50 chip to always report connected on analog output Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 56/71] USB: option: add Nexpring NP10T terminal id Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Ben Greear, Johannes Berg

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johannes Berg <johannes.berg@intel.com>

commit a56f992cdabc63f56b4b142885deebebf936ff76 upstream.

This is a very old bug, but there's nothing that prevents the
timer from running while the module is being removed when we
only do del_timer() instead of del_timer_sync().

The timer should normally not be running at this point, but
it's not clearly impossible (or we could just remove this.)

Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/mac80211/sta_info.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -793,7 +793,7 @@ void sta_info_init(struct ieee80211_loca
 
 void sta_info_stop(struct ieee80211_local *local)
 {
-	del_timer(&local->sta_cleanup);
+	del_timer_sync(&local->sta_cleanup);
 	sta_info_flush(local, NULL);
 }
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 56/71] USB: option: add Nexpring NP10T terminal id
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (54 preceding siblings ...)
  2013-01-15 22:54 ` [ 55/71] mac80211: use del_timer_sync for final sta cleanup timer deletion Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 57/71] USB: option: blacklist network interface on ZTE MF880 Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Denis Kaganovich

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dzianis Kahanovich <mahatma@bspu.unibel.by>

commit ad86e58661b38b279b7519d4e49c7a19dc1654bb upstream.

Hyundai Petatel Inc. Nexpring NP10T terminal (EV-DO rev.A USB modem) ID

Signed-off-by: Denis Kaganovich <mahatma@eu.by>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/option.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -441,6 +441,10 @@ static void option_instat_callback(struc
 #define CELLIENT_VENDOR_ID			0x2692
 #define CELLIENT_PRODUCT_MEN200			0x9005
 
+/* Hyundai Petatel Inc. products */
+#define PETATEL_VENDOR_ID			0x1ff4
+#define PETATEL_PRODUCT_NP10T			0x600e
+
 /* some devices interfaces need special handling due to a number of reasons */
 enum option_blacklist_reason {
 		OPTION_BLACKLIST_NONE = 0,
@@ -1295,6 +1299,7 @@ static const struct usb_device_id option
 	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) },
 	{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
+	{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) },
 	{ } /* Terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, option_ids);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 57/71] USB: option: blacklist network interface on ZTE MF880
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (55 preceding siblings ...)
  2013-01-15 22:54 ` [ 56/71] USB: option: add Nexpring NP10T terminal id Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 58/71] USB: option: Add new MEDIATEK PID support Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, BjÞrn Mork

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bjørn Mork <bjorn@mork.no>

commit fab38246f318edcd0dcb8fd3852a47cf8938878a upstream.

The driver description files gives these names to the vendor specific
functions on this modem:

 diag: VID_19D2&PID_0284&MI_00
 nmea: VID_19D2&PID_0284&MI_01
 at:   VID_19D2&PID_0284&MI_02
 mdm:  VID_19D2&PID_0284&MI_03
 net:  VID_19D2&PID_0284&MI_04

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/option.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -927,7 +927,8 @@ static const struct usb_device_id option
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
 	  .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) },
-	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff), /* ZTE MF880 */
+	  .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff),
 	  .driver_info = (kernel_ulong_t)&net_intf4_blacklist },



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 58/71] USB: option: Add new MEDIATEK PID support
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (56 preceding siblings ...)
  2013-01-15 22:54 ` [ 57/71] USB: option: blacklist network interface on ZTE MF880 Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 59/71] USB: option: add Telekom Speedstick LTE II Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Quentin.Li

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: "Quentin.Li" <snowmanli88@163.com>

commit 94a85b633829b946eef53fc1825d526312fb856f upstream.

In option.c, add some new MEDIATEK PIDs support for MEDIATEK new products. This
is a MEDIATEK inc. release patch.

Signed-off-by: Quentin.Li <snowmanli88@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/option.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -429,9 +429,12 @@ static void option_instat_callback(struc
 #define MEDIATEK_VENDOR_ID			0x0e8d
 #define MEDIATEK_PRODUCT_DC_1COM		0x00a0
 #define MEDIATEK_PRODUCT_DC_4COM		0x00a5
+#define MEDIATEK_PRODUCT_DC_4COM2		0x00a7
 #define MEDIATEK_PRODUCT_DC_5COM		0x00a4
 #define MEDIATEK_PRODUCT_7208_1COM		0x7101
 #define MEDIATEK_PRODUCT_7208_2COM		0x7102
+#define MEDIATEK_PRODUCT_7103_2COM		0x7103
+#define MEDIATEK_PRODUCT_7106_2COM		0x7106
 #define MEDIATEK_PRODUCT_FP_1COM		0x0003
 #define MEDIATEK_PRODUCT_FP_2COM		0x0023
 #define MEDIATEK_PRODUCT_FPDC_1COM		0x0043
@@ -1299,6 +1302,10 @@ static const struct usb_device_id option
 	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7103_2COM, 0xff, 0x00, 0x00) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7106_2COM, 0x02, 0x02, 0x01) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
 	{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
 	{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) },
 	{ } /* Terminating entry */



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 59/71] USB: option: add Telekom Speedstick LTE II
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (57 preceding siblings ...)
  2013-01-15 22:54 ` [ 58/71] USB: option: Add new MEDIATEK PID support Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 60/71] usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Thomas SchÀfer,
	BjÞrn Mork

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bjørn Mork <bjorn@mork.no>

commit 5ec0085440ef8c2cf50002b34d5a504ee12aa2bf upstream.

also known as Alcatel One Touch L100V LTE

The driver description files gives these names to the vendor specific
functions on this modem:

 Application1: VID_1BBB&PID_011E&MI_00
 Application2: VID_1BBB&PID_011E&MI_01
 Modem:        VID_1BBB&PID_011E&MI_03
 Ethernet:     VID_1BBB&PID_011E&MI_04

Reported-by: Thomas Schäfer <tschaefer@t-online.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/option.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -288,6 +288,7 @@ static void option_instat_callback(struc
 #define ALCATEL_VENDOR_ID			0x1bbb
 #define ALCATEL_PRODUCT_X060S_X200		0x0000
 #define ALCATEL_PRODUCT_X220_X500D		0x0017
+#define ALCATEL_PRODUCT_L100V			0x011e
 
 #define PIRELLI_VENDOR_ID			0x1266
 #define PIRELLI_PRODUCT_C100_1			0x1002
@@ -1198,6 +1199,8 @@ static const struct usb_device_id option
 	  .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist
 	},
 	{ USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) },
+	{ USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V),
+	  .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
 	{ USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
 	{ USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 60/71] usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (58 preceding siblings ...)
  2013-01-15 22:54 ` [ 59/71] USB: option: add Telekom Speedstick LTE II Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 61/71] USB: cdc-acm: Add support for "PSC Scanning, Magellan 800i" Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Tomasz Mloduchowski

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomasz Mloduchowski <q@qdot.me>

commit 8cf65dc386f3634a43312f436cc7a935476a40c4 upstream.

Simple fix to add support for Crucible Technologies COMET Caller ID
USB decoder - a device containing FTDI USB/Serial converter chip,
handling 1200bps CallerID messages decoded from the phone line -
adding correct USB PID is sufficient.

Tested to apply cleanly and work flawlessly against 3.6.9, 3.7.0-rc8
and 3.8.0-rc3 on both amd64 and x86 arches.

Signed-off-by: Tomasz Mloduchowski <q@qdot.me>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/ftdi_sio.c     |    2 ++
 drivers/usb/serial/ftdi_sio_ids.h |    6 ++++++
 2 files changed, 8 insertions(+)

--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -879,6 +879,8 @@ static struct usb_device_id id_table_com
 	{ USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID),
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
 	{ USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) },
+	/* Crucible Devices */
+	{ USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) },
 	{ },					/* Optional parameter entry */
 	{ }					/* Terminating entry */
 };
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -1259,3 +1259,9 @@
  * ATI command output: Cinterion MC55i
  */
 #define FTDI_CINTERION_MC55I_PID	0xA951
+
+/*
+ * Product: Comet Caller ID decoder
+ * Manufacturer: Crucible Technologies
+ */
+#define FTDI_CT_COMET_PID	0x8e08



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 61/71] USB: cdc-acm: Add support for "PSC Scanning, Magellan 800i"
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (59 preceding siblings ...)
  2013-01-15 22:54 ` [ 60/71] usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:54 ` [ 62/71] usb: gadget: dummy: fix enumeration with g_multi Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Denis N Ladin, Oliver Neukum

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Denis N Ladin <denladin@gmail.com>

commit 036915a7a402753c05b8d0529f5fd08805ab46d0 upstream.

Adding support "PSC Scanning, Magellan 800i" in cdc-acm

Very simple, but very necessary.
Suitable for all versions of the kernel > 2.6

Signed-off-by: Denis N Ladin <denladin@gmail.com>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/class/cdc-acm.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1509,6 +1509,9 @@ static const struct usb_device_id acm_id
 	{ USB_DEVICE(0x0572, 0x1340), /* Conexant CX93010-2x UCMxx */
 	.driver_info = NO_UNION_NORMAL,
 	},
+	{ USB_DEVICE(0x05f9, 0x4002), /* PSC Scanning, Magellan 800i */
+	.driver_info = NO_UNION_NORMAL,
+	},
 	{ USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */
 	.driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
 	},



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 62/71] usb: gadget: dummy: fix enumeration with g_multi
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (60 preceding siblings ...)
  2013-01-15 22:54 ` [ 61/71] USB: cdc-acm: Add support for "PSC Scanning, Magellan 800i" Greg Kroah-Hartman
@ 2013-01-15 22:54 ` Greg Kroah-Hartman
  2013-01-15 22:55 ` [ 63/71] USB: Increase reset timeout Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Sebastian Andrzej Siewior, Alan Stern,
	Felipe Balbi

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

commit 1d16638e3b9cc195bac18a8fcbca748f33c1bc24 upstream.

If we do have endpoints named like "ep-a" then bEndpointAddress is
counted internally by the gadget framework.

If we do have endpoints named like "ep-1" then bEndpointAddress is
assigned from the digit after "ep-".

If we do have both, then it is likely that after we used up the
"generic" endpoints we will use the digits and thus assign one
bEndpointAddress to multiple endpoints.

This theory can be proofed by using the completely enabled g_multi.
Without this patch, the mass storage won't enumerate and times out
because it shares endpoints with RNDIS.

This patch also adds fills up the endpoints list so we have in total
endpoints 1 to 15 in + out available while some of them are restricted
to certain types like BULK or ISO. Without this change the nokia gadget
won't load because the system does not provide enough (BULK) endpoints
but it did before ep-a - ep-f were removed.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/gadget/dummy_hcd.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -122,10 +122,7 @@ static const char ep0name [] = "ep0";
 static const char *const ep_name [] = {
 	ep0name,				/* everyone has ep0 */
 
-	/* act like a net2280: high speed, six configurable endpoints */
-	"ep-a", "ep-b", "ep-c", "ep-d", "ep-e", "ep-f",
-
-	/* or like pxa250: fifteen fixed function endpoints */
+	/* act like a pxa250: fifteen fixed function endpoints */
 	"ep1in-bulk", "ep2out-bulk", "ep3in-iso", "ep4out-iso", "ep5in-int",
 	"ep6in-bulk", "ep7out-bulk", "ep8in-iso", "ep9out-iso", "ep10in-int",
 	"ep11in-bulk", "ep12out-bulk", "ep13in-iso", "ep14out-iso",
@@ -133,6 +130,10 @@ static const char *const ep_name [] = {
 
 	/* or like sa1100: two fixed function endpoints */
 	"ep1out-bulk", "ep2in-bulk",
+
+	/* and now some generic EPs so we have enough in multi config */
+	"ep3out", "ep4in", "ep5out", "ep6out", "ep7in", "ep8out", "ep9in",
+	"ep10out", "ep11out", "ep12in", "ep13out", "ep14in", "ep15out",
 };
 #define DUMMY_ENDPOINTS	ARRAY_SIZE(ep_name)
 



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 63/71] USB: Increase reset timeout.
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (61 preceding siblings ...)
  2013-01-15 22:54 ` [ 62/71] usb: gadget: dummy: fix enumeration with g_multi Greg Kroah-Hartman
@ 2013-01-15 22:55 ` Greg Kroah-Hartman
  2013-01-15 22:55 ` [ 64/71] USB: hub: handle claim of enabled remote wakeup after reset Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:55 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Sarah Sharp, Alan Stern, John Covici

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sarah Sharp <sarah.a.sharp@linux.intel.com>

commit 77c7f072c87fa951e9a74805febf26466f31170c upstream.

John's NEC 0.96 xHCI host controller needs a longer timeout for a warm
reset to complete.  The logs show it takes 650ms to complete the warm
reset, so extend the hub reset timeout to 800ms to be on the safe side.

This commit should be backported to kernels as old as 3.2, that contain
the commit 75d7cf72ab9fa01dc70877aa5c68e8ef477229dc "usbcore: refine
warm reset logic".

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: John Covici <covici@ccs.covici.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/core/hub.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2050,7 +2050,7 @@ static unsigned hub_is_wusb(struct usb_h
 #define HUB_ROOT_RESET_TIME	50	/* times are in msec */
 #define HUB_SHORT_RESET_TIME	10
 #define HUB_LONG_RESET_TIME	200
-#define HUB_RESET_TIMEOUT	500
+#define HUB_RESET_TIMEOUT	800
 
 static int hub_port_wait_reset(struct usb_hub *hub, int port1,
 				struct usb_device *udev, unsigned int delay)



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 64/71] USB: hub: handle claim of enabled remote wakeup after reset
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (62 preceding siblings ...)
  2013-01-15 22:55 ` [ 63/71] USB: Increase reset timeout Greg Kroah-Hartman
@ 2013-01-15 22:55 ` Greg Kroah-Hartman
  2013-01-15 22:55 ` [ 65/71] xhci: Handle HS bulk/ctrl endpoints that dont NAK Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:55 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Oliver Neukum, Alan Stern

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Oliver Neukum <oliver@neukum.org>

commit 07e72b95f5038cc82304b9a4a2eb7f9fc391ea68 upstream.

Some touchscreens have buggy firmware which claims
remote wakeup to be enabled after a reset. They nevertheless
crash if the feature is cleared by the host.
Add a check for reset resume before checking for
an enabled remote wakeup feature. On compliant
devices the feature must be cleared after a reset anyway.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/core/hub.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2413,7 +2413,7 @@ int usb_port_suspend(struct usb_device *
 static int finish_port_resume(struct usb_device *udev)
 {
 	int	status = 0;
-	u16	devstatus;
+	u16	devstatus = 0;
 
 	/* caller owns the udev device lock */
 	dev_dbg(&udev->dev, "%s\n",
@@ -2458,7 +2458,13 @@ static int finish_port_resume(struct usb
 	if (status) {
 		dev_dbg(&udev->dev, "gone after usb resume? status %d\n",
 				status);
-	} else if (udev->actconfig) {
+	/*
+	 * There are a few quirky devices which violate the standard
+	 * by claiming to have remote wakeup enabled after a reset,
+	 * which crash if the feature is cleared, hence check for
+	 * udev->reset_resume
+	 */
+	} else if (udev->actconfig && !udev->reset_resume) {
 		le16_to_cpus(&devstatus);
 		if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) {
 			status = usb_control_msg(udev,



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 65/71] xhci: Handle HS bulk/ctrl endpoints that dont NAK.
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (63 preceding siblings ...)
  2013-01-15 22:55 ` [ 64/71] USB: hub: handle claim of enabled remote wakeup after reset Greg Kroah-Hartman
@ 2013-01-15 22:55 ` Greg Kroah-Hartman
  2013-01-15 22:55 ` [ 66/71] GFS2: Test bufdata with buffer locked and gfs2_log_lock held Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:55 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Vincent Pelletier, Alan Stern,
	Sarah Sharp

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sarah Sharp <sarah.a.sharp@linux.intel.com>

commit 55c1945edaac94c5338a3647bc2e85ff75d9cf36 upstream.

A high speed control or bulk endpoint may have bInterval set to zero,
which means it does not NAK.  If bInterval is non-zero, it means the
endpoint NAKs at a rate of 2^(bInterval - 1).

The xHCI code to compute the NAK interval does not handle the special
case of zero properly.  The current code unconditionally subtracts one
from bInterval and uses it as an exponent.  This causes a very large
bInterval to be used, and warning messages like these will be printed:

usb 1-1: ep 0x1 - rounding interval to 32768 microframes, ep desc says 0 microframes

This may cause the xHCI host hardware to reject the Configure Endpoint
command, which means the HS device will be unusable under xHCI ports.

This patch should be backported to kernels as old as 2.6.31, that contain
commit dfa49c4ad120a784ef1ff0717168aa79f55a483a "USB: xhci - fix math in
xhci_get_endpoint_interval()".

Reported-by: Vincent Pelletier <plr.vincent@gmail.com>
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/host/xhci-mem.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1026,6 +1026,8 @@ static unsigned int xhci_microframes_to_
 static unsigned int xhci_parse_microframe_interval(struct usb_device *udev,
 		struct usb_host_endpoint *ep)
 {
+	if (ep->desc.bInterval == 0)
+		return 0;
 	return xhci_microframes_to_exponent(udev, ep,
 			ep->desc.bInterval, 0, 15);
 }



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 66/71] GFS2: Test bufdata with buffer locked and gfs2_log_lock held
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (64 preceding siblings ...)
  2013-01-15 22:55 ` [ 65/71] xhci: Handle HS bulk/ctrl endpoints that dont NAK Greg Kroah-Hartman
@ 2013-01-15 22:55 ` Greg Kroah-Hartman
  2013-01-15 22:55 ` [ 67/71] intel-iommu: Free old page tables before creating superpage Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:55 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, Benjamin Marzinski, Steven Whitehouse,
	Ben Hutchings

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

commit 96e5d1d3adf56f1c7eeb07258f6a1a0a7ae9c489 upstream.

In gfs2_trans_add_bh(), gfs2 was testing if a there was a bd attached to the
buffer without having the gfs2_log_lock held. It was then assuming it would
stay attached for the rest of the function. However, without either the log
lock being held of the buffer locked, __gfs2_ail_flush() could detach bd at any
time.  This patch moves the locking before the test.  If there isn't a bd
already attached, gfs2 can safely allocate one and attach it before locking.
There is no way that the newly allocated bd could be on the ail list,
and thus no way for __gfs2_ail_flush() to detach it.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/gfs2/lops.c  |   18 ++++--------------
 fs/gfs2/trans.c |    8 ++++++++
 2 files changed, 12 insertions(+), 14 deletions(-)

--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -139,16 +139,14 @@ static void buf_lo_add(struct gfs2_sbd *
 	struct gfs2_meta_header *mh;
 	struct gfs2_trans *tr;
 
-	lock_buffer(bd->bd_bh);
-	gfs2_log_lock(sdp);
 	if (!list_empty(&bd->bd_list_tr))
-		goto out;
+		return;
 	tr = current->journal_info;
 	tr->tr_touched = 1;
 	tr->tr_num_buf++;
 	list_add(&bd->bd_list_tr, &tr->tr_list_buf);
 	if (!list_empty(&le->le_list))
-		goto out;
+		return;
 	set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
 	set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags);
 	gfs2_meta_check(sdp, bd->bd_bh);
@@ -159,9 +157,6 @@ static void buf_lo_add(struct gfs2_sbd *
 	sdp->sd_log_num_buf++;
 	list_add(&le->le_list, &sdp->sd_log_le_buf);
 	tr->tr_num_buf_new++;
-out:
-	gfs2_log_unlock(sdp);
-	unlock_buffer(bd->bd_bh);
 }
 
 static void buf_lo_before_commit(struct gfs2_sbd *sdp)
@@ -528,11 +523,9 @@ static void databuf_lo_add(struct gfs2_s
 	struct address_space *mapping = bd->bd_bh->b_page->mapping;
 	struct gfs2_inode *ip = GFS2_I(mapping->host);
 
-	lock_buffer(bd->bd_bh);
-	gfs2_log_lock(sdp);
 	if (tr) {
 		if (!list_empty(&bd->bd_list_tr))
-			goto out;
+			return;
 		tr->tr_touched = 1;
 		if (gfs2_is_jdata(ip)) {
 			tr->tr_num_buf++;
@@ -540,7 +533,7 @@ static void databuf_lo_add(struct gfs2_s
 		}
 	}
 	if (!list_empty(&le->le_list))
-		goto out;
+		return;
 
 	set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
 	set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags);
@@ -552,9 +545,6 @@ static void databuf_lo_add(struct gfs2_s
 	} else {
 		list_add_tail(&le->le_list, &sdp->sd_log_le_ordered);
 	}
-out:
-	gfs2_log_unlock(sdp);
-	unlock_buffer(bd->bd_bh);
 }
 
 static void gfs2_check_magic(struct buffer_head *bh)
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -145,14 +145,22 @@ void gfs2_trans_add_bh(struct gfs2_glock
 	struct gfs2_sbd *sdp = gl->gl_sbd;
 	struct gfs2_bufdata *bd;
 
+	lock_buffer(bh);
+	gfs2_log_lock(sdp);
 	bd = bh->b_private;
 	if (bd)
 		gfs2_assert(sdp, bd->bd_gl == gl);
 	else {
+		gfs2_log_unlock(sdp);
+		unlock_buffer(bh);
 		gfs2_attach_bufdata(gl, bh, meta);
 		bd = bh->b_private;
+		lock_buffer(bh);
+		gfs2_log_lock(sdp);
 	}
 	lops_add(sdp, &bd->bd_le);
+	gfs2_log_unlock(sdp);
+	unlock_buffer(bh);
 }
 
 void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 67/71] intel-iommu: Free old page tables before creating superpage
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (65 preceding siblings ...)
  2013-01-15 22:55 ` [ 66/71] GFS2: Test bufdata with buffer locked and gfs2_log_lock held Greg Kroah-Hartman
@ 2013-01-15 22:55 ` Greg Kroah-Hartman
  2013-01-15 22:55 ` [ 68/71] KVM: PPC: 44x: fix DCR read/write Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:55 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, David Woodhouse, Ravi Murty,
	Sudeep Dutt, Linus Torvalds, CAI Qian

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: "Woodhouse, David" <david.woodhouse@intel.com>

commit 6491d4d02893d9787ba67279595990217177b351 upstream.

The dma_pte_free_pagetable() function will only free a page table page
if it is asked to free the *entire* 2MiB range that it covers. So if a
page table page was used for one or more small mappings, it's likely to
end up still present in the page tables... but with no valid PTEs.

This was fine when we'd only be repopulating it with 4KiB PTEs anyway
but the same virtual address range can end up being reused for a
*large-page* mapping. And in that case were were trying to insert the
large page into the second-level page table, and getting a complaint
from the sanity check in __domain_mapping() because there was already a
corresponding entry. This was *relatively* harmless; it led to a memory
leak of the old page table page, but no other ill-effects.

Fix it by calling dma_pte_clear_range (hopefully redundant) and
dma_pte_free_pagetable() before setting up the new large page.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Ravi Murty <Ravi.Murty@intel.com>
Tested-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pci/intel-iommu.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -1793,10 +1793,17 @@ static int __domain_mapping(struct dmar_
 			if (!pte)
 				return -ENOMEM;
 			/* It is large page*/
-			if (largepage_lvl > 1)
+			if (largepage_lvl > 1) {
 				pteval |= DMA_PTE_LARGE_PAGE;
-			else
+				/* Ensure that old small page tables are removed to make room
+				   for superpage, if they exist. */
+				dma_pte_clear_range(domain, iov_pfn,
+						    iov_pfn + lvl_to_nr_pages(largepage_lvl) - 1);
+				dma_pte_free_pagetable(domain, iov_pfn,
+						       iov_pfn + lvl_to_nr_pages(largepage_lvl) - 1);
+			} else {
 				pteval &= ~(uint64_t)DMA_PTE_LARGE_PAGE;
+			}
 
 		}
 		/* We don't need lock here, nobody else



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 68/71] KVM: PPC: 44x: fix DCR read/write
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (66 preceding siblings ...)
  2013-01-15 22:55 ` [ 67/71] intel-iommu: Free old page tables before creating superpage Greg Kroah-Hartman
@ 2013-01-15 22:55 ` Greg Kroah-Hartman
  2013-01-15 22:55 ` [ 69/71] Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13" Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:55 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Alexander Graf, CAI Qian

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexander Graf <agraf@suse.de>

commit e43a028752fed049e4bd94ef895542f96d79fa74 upstream.

When remembering the direction of a DCR transaction, we should write
to the same variable that we interpret on later when doing vcpu_run
again.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kvm/44x_emulate.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/powerpc/kvm/44x_emulate.c
+++ b/arch/powerpc/kvm/44x_emulate.c
@@ -79,6 +79,7 @@ int kvmppc_core_emulate_op(struct kvm_ru
 				run->dcr.dcrn = dcrn;
 				run->dcr.data =  0;
 				run->dcr.is_write = 0;
+				vcpu->arch.dcr_is_write = 0;
 				vcpu->arch.io_gpr = rt;
 				vcpu->arch.dcr_needed = 1;
 				kvmppc_account_exit(vcpu, DCR_EXITS);
@@ -100,6 +101,7 @@ int kvmppc_core_emulate_op(struct kvm_ru
 				run->dcr.dcrn = dcrn;
 				run->dcr.data = kvmppc_get_gpr(vcpu, rs);
 				run->dcr.is_write = 1;
+				vcpu->arch.dcr_is_write = 1;
 				vcpu->arch.dcr_needed = 1;
 				kvmppc_account_exit(vcpu, DCR_EXITS);
 				emulated = EMULATE_DO_DCR;



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 69/71] Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13"
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (67 preceding siblings ...)
  2013-01-15 22:55 ` [ 68/71] KVM: PPC: 44x: fix DCR read/write Greg Kroah-Hartman
@ 2013-01-15 22:55 ` Greg Kroah-Hartman
  2013-01-15 22:55 ` [ 70/71] staging: comedi: dont hijack hardware device private data Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:55 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, alan, John Tapsell, Daniel Vetter,
	Luis Henriques

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit 48e858340dae43189a4e55647f6eac736766f828 upstream.

This reverts commit 9756fe38d10b2bf90c81dc4d2f17d5632e135364.

The bogus lvds output is actually a lvds->hdmi bridge, which we don't
really support. But unconditionally disabling it breaks some existing
setups.

Reported-by: John Tapsell <johnflux@gmail.com>
References: http://permalink.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/17237
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


---
 drivers/gpu/drm/i915/intel_lvds.c |    8 --------
 1 file changed, 8 deletions(-)

--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -753,14 +753,6 @@ static const struct dmi_system_id intel_
 	},
 	{
 		.callback = intel_no_lvds_dmi_callback,
-		.ident = "ZOTAC ZBOXSD-ID12/ID13",
-		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "ZOTAC"),
-			DMI_MATCH(DMI_BOARD_NAME, "ZBOXSD-ID12/ID13"),
-		},
-	},
-	{
-		.callback = intel_no_lvds_dmi_callback,
 		.ident = "Gigabyte GA-D525TUD",
 		.matches = {
 			DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."),



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 70/71] staging: comedi: dont hijack hardware device private data
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (68 preceding siblings ...)
  2013-01-15 22:55 ` [ 69/71] Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13" Greg Kroah-Hartman
@ 2013-01-15 22:55 ` Greg Kroah-Hartman
  2013-01-15 22:55 ` [ 71/71] staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:55 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Ian Abbott

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ian Abbott <abbotti@mev.co.uk>

commit c43435d7722134ed1fda58ce1025f41029bd58ad upstream.

comedi_auto_config() associates a Comedi minor device number with an
auto-configured hardware device and comedi_auto_unconfig() disassociates
it.  Currently, these use the hardware device's private data pointer to
point to some allocated storage holding the minor device number.  This
is a bit of a waste of the hardware device's private data pointer,
preventing it from being used for something more useful by the low-level
comedi device drivers.  For example, it would make more sense if
comedi_usb_auto_config() was passed a pointer to the struct
usb_interface instead of the struct usb_device, but this cannot be done
currently because the low-level comedi drivers already use the private
data pointer in the struct usb_interface for something more useful.

This patch stops the comedi core hijacking the hardware device's private
data pointer.  Instead, comedi_auto_config() stores a pointer to the
hardware device's struct device in the struct comedi_device_file_info
associated with the minor device number, and comedi_auto_unconfig()
calls new function comedi_find_board_minor() to recover the minor device
number associated with the hardware device.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/comedi_fops.c |   18 ++++++++++++++++++
 drivers/staging/comedi/comedidev.h   |    1 +
 drivers/staging/comedi/drivers.c     |   34 ++++++++++------------------------
 drivers/staging/comedi/internal.h    |    1 +
 4 files changed, 30 insertions(+), 24 deletions(-)

--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2210,6 +2210,7 @@ int comedi_alloc_board_minor(struct devi
 		kfree(info);
 		return -ENOMEM;
 	}
+	info->hardware_device = hardware_device;
 	comedi_device_init(info->device);
 	spin_lock_irqsave(&comedi_file_info_table_lock, flags);
 	for (i = 0; i < COMEDI_NUM_BOARD_MINORS; ++i) {
@@ -2299,6 +2300,23 @@ void comedi_free_board_minor(unsigned mi
 	}
 }
 
+int comedi_find_board_minor(struct device *hardware_device)
+{
+	int minor;
+	struct comedi_device_file_info *info;
+
+	for (minor = 0; minor < COMEDI_NUM_BOARD_MINORS; minor++) {
+		spin_lock(&comedi_file_info_table_lock);
+		info = comedi_file_info_table[minor];
+		if (info && info->hardware_device == hardware_device) {
+			spin_unlock(&comedi_file_info_table_lock);
+			return minor;
+		}
+		spin_unlock(&comedi_file_info_table_lock);
+	}
+	return -ENODEV;
+}
+
 int comedi_alloc_subdevice_minor(struct comedi_device *dev,
 				 struct comedi_subdevice *s)
 {
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -237,6 +237,7 @@ struct comedi_device_file_info {
 	struct comedi_device *device;
 	struct comedi_subdevice *read_subdevice;
 	struct comedi_subdevice *write_subdevice;
+	struct device *hardware_device;
 };
 
 #ifdef CONFIG_COMEDI_DEBUG
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -819,25 +819,14 @@ static int comedi_auto_config(struct dev
 	int minor;
 	struct comedi_device_file_info *dev_file_info;
 	int retval;
-	unsigned *private_data = NULL;
 
-	if (!comedi_autoconfig) {
-		dev_set_drvdata(hardware_device, NULL);
+	if (!comedi_autoconfig)
 		return 0;
-	}
 
 	minor = comedi_alloc_board_minor(hardware_device);
 	if (minor < 0)
 		return minor;
 
-	private_data = kmalloc(sizeof(unsigned), GFP_KERNEL);
-	if (private_data == NULL) {
-		retval = -ENOMEM;
-		goto cleanup;
-	}
-	*private_data = minor;
-	dev_set_drvdata(hardware_device, private_data);
-
 	dev_file_info = comedi_get_device_file_info(minor);
 
 	memset(&it, 0, sizeof(it));
@@ -850,25 +839,22 @@ static int comedi_auto_config(struct dev
 	retval = comedi_device_attach(dev_file_info->device, &it);
 	mutex_unlock(&dev_file_info->device->mutex);
 
-cleanup:
-	if (retval < 0) {
-		kfree(private_data);
+	if (retval < 0)
 		comedi_free_board_minor(minor);
-	}
 	return retval;
 }
 
 static void comedi_auto_unconfig(struct device *hardware_device)
 {
-	unsigned *minor = (unsigned *)dev_get_drvdata(hardware_device);
-	if (minor == NULL)
-		return;
-
-	BUG_ON(*minor >= COMEDI_NUM_BOARD_MINORS);
+	int minor;
 
-	comedi_free_board_minor(*minor);
-	dev_set_drvdata(hardware_device, NULL);
-	kfree(minor);
+	if (hardware_device == NULL)
+		return;
+	minor = comedi_find_board_minor(hardware_device);
+	if (minor < 0)
+		return;
+	BUG_ON(minor >= COMEDI_NUM_BOARD_MINORS);
+	comedi_free_board_minor(minor);
 }
 
 int comedi_pci_auto_config(struct pci_dev *pcidev, const char *board_name)
--- a/drivers/staging/comedi/internal.h
+++ b/drivers/staging/comedi/internal.h
@@ -7,6 +7,7 @@ int insn_inval(struct comedi_device *dev
 	       struct comedi_insn *insn, unsigned int *data);
 int comedi_alloc_board_minor(struct device *hardware_device);
 void comedi_free_board_minor(unsigned minor);
+int comedi_find_board_minor(struct device *hardware_device);
 void comedi_reset_async_buf(struct comedi_async *async);
 int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
 		     unsigned long new_size);



^ permalink raw reply	[flat|nested] 83+ messages in thread

* [ 71/71] staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (69 preceding siblings ...)
  2013-01-15 22:55 ` [ 70/71] staging: comedi: dont hijack hardware device private data Greg Kroah-Hartman
@ 2013-01-15 22:55 ` Greg Kroah-Hartman
  2013-01-15 23:49 ` [ 00/71] 3.0.59-stable review Peter Senna Tschudin
  2013-01-16  3:47 ` Shuah Khan
  72 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-15 22:55 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Ian Abbott

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ian Abbott <abbotti@mev.co.uk>

commit 34ffb33e09132401872fe79e95c30824ce194d23 upstream.

The 'ni_at_a2150' module links to `cfc_write_to_buffer` in the
'comedi_fc' module, so selecting 'COMEDI_NI_AT_A2150' in the kernel config
needs to also select 'COMEDI_FC'.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/Kconfig |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -424,6 +424,7 @@ config COMEDI_ADQ12B
 
 config COMEDI_NI_AT_A2150
 	tristate "NI AT-A2150 ISA card support"
+	select COMEDI_FC
 	depends on COMEDI_NI_COMMON
 	depends on VIRT_TO_BUS
 	default N



^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 00/71] 3.0.59-stable review
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (70 preceding siblings ...)
  2013-01-15 22:55 ` [ 71/71] staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC Greg Kroah-Hartman
@ 2013-01-15 23:49 ` Peter Senna Tschudin
  2013-01-16  0:06   ` Greg Kroah-Hartman
  2013-01-16  3:47 ` Shuah Khan
  72 siblings, 1 reply; 83+ messages in thread
From: Peter Senna Tschudin @ 2013-01-15 23:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, stable, Linus Torvalds, akpm, alan

3.0.59-rc1+ compile and run nicely with Fedora 17.

On Tue, Jan 15, 2013 at 8:53 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> This is the start of the stable review cycle for the 3.0.59 release.
> There are 71 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Jan 17 22:53:26 UTC 2013.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
>         kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.59-rc1.gz
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>
> -------------
> Pseudo-Shortlog of commits:
>
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>     Linux 3.0.59-rc1
>
> Ian Abbott <abbotti@mev.co.uk>
>     staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC
>
> Ian Abbott <abbotti@mev.co.uk>
>     staging: comedi: don't hijack hardware device private data
>
> Daniel Vetter <daniel.vetter@ffwll.ch>
>     Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13"
>
> Alexander Graf <agraf@suse.de>
>     KVM: PPC: 44x: fix DCR read/write
>
> Woodhouse, David <david.woodhouse@intel.com>
>     intel-iommu: Free old page tables before creating superpage
>
> Benjamin Marzinski <bmarzins@redhat.com>
>     GFS2: Test bufdata with buffer locked and gfs2_log_lock held
>
> Sarah Sharp <sarah.a.sharp@linux.intel.com>
>     xhci: Handle HS bulk/ctrl endpoints that don't NAK.
>
> Oliver Neukum <oliver@neukum.org>
>     USB: hub: handle claim of enabled remote wakeup after reset
>
> Sarah Sharp <sarah.a.sharp@linux.intel.com>
>     USB: Increase reset timeout.
>
> Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>     usb: gadget: dummy: fix enumeration with g_multi
>
> Denis N Ladin <denladin@gmail.com>
>     USB: cdc-acm: Add support for "PSC Scanning, Magellan 800i"
>
> Tomasz Mloduchowski <q@qdot.me>
>     usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added
>
> Bjørn Mork <bjorn@mork.no>
>     USB: option: add Telekom Speedstick LTE II
>
> Quentin.Li <snowmanli88@163.com>
>     USB: option: Add new MEDIATEK PID support
>
> Bjørn Mork <bjorn@mork.no>
>     USB: option: blacklist network interface on ZTE MF880
>
> Dzianis Kahanovich <mahatma@bspu.unibel.by>
>     USB: option: add Nexpring NP10T terminal id
>
> Johannes Berg <johannes.berg@intel.com>
>     mac80211: use del_timer_sync for final sta cleanup timer deletion
>
> Jerome Glisse <jglisse@redhat.com>
>     radeon/kms: force rn50 chip to always report connected on analog output
>
> Samuel Thibault <samuel.thibault@ens-lyon.org>
>     staging: speakup: avoid out-of-range access in synth_add()
>
> Nickolai Zeldovich <nickolai@csail.mit.edu>
>     staging: speakup: avoid out-of-range access in synth_init()
>
> Larry Finger <Larry.Finger@lwfinger.net>
>     staging: r8712u: Add new device ID
>
> Ian Abbott <abbotti@mev.co.uk>
>     staging: comedi: comedi_test: fix race when cancelling command
>
> Ian Abbott <abbotti@mev.co.uk>
>     staging: comedi: prevent auto-unconfig of manually configured devices
>
> Mike Dunn <mikedunn@newsguy.com>
>     ALSA: pxa27x: fix ac97 cold reset
>
> Mark Brown <broonie@opensource.wolfsonmicro.com>
>     ASoC: wm2000: Fix sense of speech clarity enable
>
> Eric Wong <normalperson@yhbt.net>
>     epoll: prevent missed events on EPOLL_CTL_MOD
>
> Eric Dumazet <eric.dumazet@gmail.com>
>     rtnetlink: fix rtnl_calcit() and rtnl_dump_ifinfo()
>
> Greg Rose <gregory.v.rose@intel.com>
>     rtnetlink: Fix problem with buffer allocation
>
> Greg Rose <gregory.v.rose@intel.com>
>     rtnetlink: Compute and store minimum ifinfo dump size
>
> Zhang Rui <rui.zhang@intel.com>
>     ACPI : do not use Lid and Sleep button for S5 wakeup
>
> Andre Przywara <andre.przywara@amd.com>
>     x86, amd: Disable way access filter on Piledriver CPUs
>
> David Rientjes <rientjes@google.com>
>     thp, memcg: split hugepage for memcg oom on cow
>
> Namjae Jeon <namjae.jeon@samsung.com>
>     udf: don't increment lenExtents while writing to a hole
>
> Namjae Jeon <namjae.jeon@samsung.com>
>     udf: fix memory leak while allocating blocks during write
>
> Ed L. Cashin <ecashin@coraid.com>
>     aoe: do not call bdi_init after blk_alloc_queue
>
> Theodore Ts'o <tytso@mit.edu>
>     ext4: lock i_mutex when truncating orphan inodes
>
> Michael Tokarev <mjt@tls.msk.ru>
>     ext4: do not try to write superblock on ro remount w/o journal
>
> Jan Kara <jack@suse.cz>
>     jbd2: fix assertion failure in jbd2_journal_flush()
>
> Forrest Liu <forrestl@synology.com>
>     ext4: fix extent tree corruption caused by hole punch
>
> Lothar Waßmann <LW@KARO-electronics.de>
>     video: mxsfb: fix crash when unblanking the display
>
> Malcolm Priestley <tvboxspy@gmail.com>
>     staging: vt6656: 64bit fixes: vCommandTimerWait change calculation of timer.
>
> Malcolm Priestley <tvboxspy@gmail.com>
>     staging: vt6656: 64bit fixes: key.c/h change unsigned long to u32
>
> Malcolm Priestley <tvboxspy@gmail.com>
>     staging: vt6656: 64 bit fixes: fix long warning messages.
>
> Malcolm Priestley <tvboxspy@gmail.com>
>     staging: vt6656: 64 bit fixes : correct all type sizes
>
> Malcolm Priestley <tvboxspy@gmail.com>
>     staging: vt6656: 64 bit fixes: use u32 for QWORD definition.
>
> Malcolm Priestley <tvboxspy@gmail.com>
>     staging: vt6656: [BUG] out of bound array reference in RFbSetPower.
>
> Alasdair G Kergon <agk@redhat.com>
>     dm ioctl: prevent unsafe change to dm_ioctl data_size
>
> Steven Rostedt <srostedt@redhat.com>
>     ring-buffer: Fix race between integrity check and readers
>
> Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
>     RDMA/nes: Fix for terminate timer crash
>
> Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
>     RDMA/nes: Fix for crash when registering zero length MR for CQ
>
> Paulo Zanoni <paulo.r.zanoni@intel.com>
>     drm/i915: make the panel fitter work on pipes B and C on IVB
>
> Dan Williams <dcbw@redhat.com>
>     i2400m: add Intel 6150 device IDs
>
> Alexey Khoroshilov <khoroshilov@ispras.ru>
>     jffs2: hold erase_completion_lock on exit
>
> Trond Myklebust <Trond.Myklebust@netapp.com>
>     SUNRPC: Ensure we release the socket write lock if the rpc_task exits early
>
> Trond Myklebust <Trond.Myklebust@netapp.com>
>     SUNRPC: Ensure that we free the rpc_task after cleanups are done
>
> Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
>     ext4: fix memory leak in ext4_xattr_set_acl()'s error path
>
> Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
>     mfd: Only unregister platform devices allocated by the mfd core
>
> Yi Zou <yi.zou@intel.com>
>     target/tcm_fc: fix the lockdep warning due to inconsistent lock state
>
> Xiaotian Feng <xtfeng@gmail.com>
>     libata: fix Null pointer dereference on disk error
>
> Aaron Lu <aaron.lu@intel.com>
>     libata: set dma_mode to 0xff in reset
>
> Mikael Pettersson <mikpe@it.uu.se>
>     sata_promise: fix hardreset lockdep error
>
> David Jeffery <djeffery@redhat.com>
>     SCSI: qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically.
>
> Xi Wang <xi.wang@gmail.com>
>     SCSI: mvsas: fix undefined bit shift
>
> Stephan Gatzka <stephan.gatzka@gmail.com>
>     firewire: net: Fix handling of fragmented multicast/broadcast packets.
>
> Gabor Juhos <juhosg@openwrt.org>
>     ath9k: ar9003: fix OTP register offsets for AR9340
>
> Felix Fietkau <nbd@openwrt.org>
>     Revert "ath9k_hw: Update AR9003 high_power tx gain table"
>
> Laura Abbott <lauraa@codeaurora.org>
>     mm: use aligned zone start for pfn_to_bitidx calculation
>
> Jason Liu <r64343@freescale.com>
>     mm: compaction: fix echo 1 > compact_memory return error issue
>
> Sebastian Ott <sebott@linux.vnet.ibm.com>
>     s390/cio: fix pgid reserved check
>
> Shan Hai <shan.hai@windriver.com>
>     powerpc/vdso: Remove redundant locking in update_vsyscall_tz()
>
> Anton Blanchard <anton@samba.org>
>     powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build
>
>
> -------------
>
> Diffstat:
>
>  Makefile                                           |   4 +-
>  arch/powerpc/kernel/head_64.S                      |   2 +-
>  arch/powerpc/kernel/time.c                         |   5 -
>  arch/powerpc/kvm/44x_emulate.c                     |   2 +
>  arch/x86/kernel/cpu/amd.c                          |  14 ++
>  drivers/acpi/scan.c                                |   7 +-
>  drivers/ata/libata-core.c                          |   1 +
>  drivers/ata/libata-eh.c                            |   1 +
>  drivers/ata/libata-scsi.c                          |   6 +-
>  drivers/ata/sata_promise.c                         |  15 +-
>  drivers/block/aoe/aoe.h                            |   2 +-
>  drivers/block/aoe/aoeblk.c                         |   5 -
>  drivers/firewire/net.c                             |  13 +-
>  drivers/gpu/drm/i915/i915_reg.h                    |   2 +
>  drivers/gpu/drm/i915/intel_display.c               |   6 +-
>  drivers/gpu/drm/i915/intel_lvds.c                  |   8 -
>  drivers/gpu/drm/radeon/radeon_legacy_encoders.c    |   8 +
>  drivers/infiniband/core/netlink.c                  |   2 +-
>  drivers/infiniband/hw/nes/nes.h                    |   1 +
>  drivers/infiniband/hw/nes/nes_hw.c                 |   9 +-
>  drivers/infiniband/hw/nes/nes_verbs.c              |   9 +-
>  drivers/md/dm-ioctl.c                              |   8 +
>  drivers/mfd/mfd-core.c                             |  15 +-
>  drivers/net/wimax/i2400m/i2400m-usb.h              |   3 +
>  drivers/net/wimax/i2400m/usb.c                     |   6 +
>  .../net/wireless/ath/ath9k/ar9003_2p2_initvals.h   | 172 ++++++++++-----------
>  drivers/net/wireless/ath/ath9k/ar9003_eeprom.h     |   6 +-
>  drivers/pci/intel-iommu.c                          |  11 +-
>  drivers/s390/cio/device_pgid.c                     |  10 +-
>  drivers/scsi/mvsas/mv_94xx.h                       |  14 +-
>  drivers/scsi/mvsas/mv_sas.h                        |   2 +-
>  drivers/scsi/qla2xxx/qla_os.c                      |   4 +-
>  drivers/staging/comedi/Kconfig                     |   1 +
>  drivers/staging/comedi/comedi_fops.c               |  21 +++
>  drivers/staging/comedi/comedidev.h                 |   1 +
>  drivers/staging/comedi/drivers.c                   |  34 ++--
>  drivers/staging/comedi/drivers/comedi_test.c       |   2 +-
>  drivers/staging/comedi/internal.h                  |   1 +
>  drivers/staging/rtl8712/usb_intf.c                 |   2 +
>  drivers/staging/speakup/synth.c                    |   4 +-
>  drivers/staging/vt6656/dpc.c                       |   4 +-
>  drivers/staging/vt6656/key.c                       |  53 +++++--
>  drivers/staging/vt6656/key.h                       |   8 +-
>  drivers/staging/vt6656/mac.c                       |   6 +-
>  drivers/staging/vt6656/rf.c                        |   3 +
>  drivers/staging/vt6656/rxtx.c                      |  18 ++-
>  drivers/staging/vt6656/ttype.h                     |  16 +-
>  drivers/staging/vt6656/wcmd.c                      |  20 +--
>  drivers/staging/vt6656/wpa2.h                      |   4 +-
>  drivers/target/tcm_fc/tfc_sess.c                   |   2 +-
>  drivers/usb/class/cdc-acm.c                        |   3 +
>  drivers/usb/core/hub.c                             |  12 +-
>  drivers/usb/gadget/dummy_hcd.c                     |   9 +-
>  drivers/usb/host/xhci-mem.c                        |   2 +
>  drivers/usb/serial/ftdi_sio.c                      |   2 +
>  drivers/usb/serial/ftdi_sio_ids.h                  |   6 +
>  drivers/usb/serial/option.c                        |  18 ++-
>  drivers/video/mxsfb.c                              |   3 +-
>  fs/eventpoll.c                                     |  22 ++-
>  fs/ext4/acl.c                                      |   6 +-
>  fs/ext4/extents.c                                  |  22 ++-
>  fs/ext4/super.c                                    |   4 +-
>  fs/gfs2/lops.c                                     |  18 +--
>  fs/gfs2/trans.c                                    |   8 +
>  fs/jbd2/transaction.c                              |   3 +-
>  fs/jffs2/nodemgmt.c                                |   6 +-
>  fs/udf/inode.c                                     |  11 +-
>  include/linux/if_link.h                            |   1 +
>  include/linux/netlink.h                            |   6 +-
>  include/linux/rtnetlink.h                          |   3 +
>  include/net/rtnetlink.h                            |   7 +-
>  kernel/trace/ring_buffer.c                         |   2 +
>  mm/compaction.c                                    |   6 +-
>  mm/huge_memory.c                                   |   3 +
>  mm/memory.c                                        |  18 ++-
>  mm/page_alloc.c                                    |   2 +-
>  net/bridge/br_netlink.c                            |  15 +-
>  net/core/fib_rules.c                               |   6 +-
>  net/core/neighbour.c                               |  11 +-
>  net/core/rtnetlink.c                               | 127 ++++++++++++---
>  net/dcb/dcbnl.c                                    |   4 +-
>  net/decnet/dn_dev.c                                |   6 +-
>  net/decnet/dn_fib.c                                |   4 +-
>  net/decnet/dn_route.c                              |   5 +-
>  net/ipv4/devinet.c                                 |   6 +-
>  net/ipv4/fib_frontend.c                            |   6 +-
>  net/ipv4/inet_diag.c                               |   2 +-
>  net/ipv4/ipmr.c                                    |   3 +-
>  net/ipv4/route.c                                   |   2 +-
>  net/ipv6/addrconf.c                                |  16 +-
>  net/ipv6/addrlabel.c                               |   9 +-
>  net/ipv6/ip6_fib.c                                 |   3 +-
>  net/ipv6/ip6mr.c                                   |   3 +-
>  net/ipv6/route.c                                   |   6 +-
>  net/mac80211/sta_info.c                            |   2 +-
>  net/netfilter/ipset/ip_set_core.c                  |   2 +-
>  net/netfilter/nf_conntrack_netlink.c               |   4 +-
>  net/netlink/af_netlink.c                           |  17 +-
>  net/netlink/genetlink.c                            |   2 +-
>  net/phonet/pn_netlink.c                            |  13 +-
>  net/sched/act_api.c                                |   7 +-
>  net/sched/cls_api.c                                |   6 +-
>  net/sched/sch_api.c                                |  12 +-
>  net/sunrpc/sched.c                                 |  30 +++-
>  net/sunrpc/xprt.c                                  |  12 +-
>  net/xfrm/xfrm_user.c                               |   3 +-
>  sound/arm/pxa2xx-ac97-lib.c                        |   8 +-
>  sound/soc/codecs/wm2000.c                          |   4 +-
>  108 files changed, 742 insertions(+), 390 deletions(-)
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Peter

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 00/71] 3.0.59-stable review
  2013-01-15 23:49 ` [ 00/71] 3.0.59-stable review Peter Senna Tschudin
@ 2013-01-16  0:06   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-16  0:06 UTC (permalink / raw)
  To: Peter Senna Tschudin; +Cc: linux-kernel, stable, Linus Torvalds, akpm, alan

On Tue, Jan 15, 2013 at 09:49:02PM -0200, Peter Senna Tschudin wrote:
> 3.0.59-rc1+ compile and run nicely with Fedora 17.

Thanks for testing all of these.

greg k-h

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 00/71] 3.0.59-stable review
  2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
                   ` (71 preceding siblings ...)
  2013-01-15 23:49 ` [ 00/71] 3.0.59-stable review Peter Senna Tschudin
@ 2013-01-16  3:47 ` Shuah Khan
  72 siblings, 0 replies; 83+ messages in thread
From: Shuah Khan @ 2013-01-16  3:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, stable, torvalds, akpm, alan

On Tue, Jan 15, 2013 at 3:53 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> This is the start of the stable review cycle for the 3.0.59 release.
> There are 71 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Jan 17 22:53:26 UTC 2013.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
>         kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.59-rc1.gz
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h

Patches applied cleanly to 3.0.y, 3.4.y, and 3.7.y.
Compiled and booted on the following systems:
HP EliteBook 6930p Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz
HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics

Cross-compile tests:
alpha: defconfig passed on all
arm: defconfig passed on all
arm64: not applicable to 3.0.y, 3.4.y. defconfig passed on 3.7.y
c6x: not applicable to 3.0.y, defconfig passed on 3.4.y, and 3.7.y.
mips: defconfig passed on all
mipsel: defconfig passed on all
powerpc: wii_defconfig passed on all
sh: defconfig passed on all
sparc: defconfig passed on all
tile: tilegx_defconfig passed on all

-- Shuah

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 18/71] SUNRPC: Ensure we release the socket write lock if the rpc_task exits early
  2013-01-15 22:54 ` [ 18/71] SUNRPC: Ensure we release the socket write lock if the rpc_task exits early Greg Kroah-Hartman
@ 2013-01-17 15:14   ` Herton Ronaldo Krzesinski
  2013-01-17 16:03     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 83+ messages in thread
From: Herton Ronaldo Krzesinski @ 2013-01-17 15:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, stable, alan, Chris Perl, Trond Myklebust

On Tue, Jan 15, 2013 at 02:54:15PM -0800, Greg Kroah-Hartman wrote:
> 3.0-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Trond Myklebust <Trond.Myklebust@netapp.com>
> 
> commit 87ed50036b866db2ec2ba16b2a7aec4a2b0b7c39 upstream.
> 
> If the rpc_task exits while holding the socket write lock before it has
> allocated an rpc slot, then the usual mechanism for releasing the write
> lock in xprt_release() is defeated.
> 
> The problem occurs if the call to xprt_lock_write() initially fails, so
> that the rpc_task is put on the xprt->sending wait queue. If the task
> exits after being assigned the lock by __xprt_lock_write_func, but
> before it has retried the call to xprt_lock_and_alloc_slot(), then
> it calls xprt_release() while holding the write lock, but will
> immediately exit due to the test for task->tk_rqstp != NULL.
> 
> Reported-by: Chris Perl <chris.perl@gmail.com>
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

This is marked only for kernel versions 3.1 and later, which looks
correct as it seems to address a problem starting with commit
43cedbf0e8dfb9c5610eb7985d5f21263e313802

-- 
[]'s
Herton

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 18/71] SUNRPC: Ensure we release the socket write lock if the rpc_task exits early
  2013-01-17 15:14   ` Herton Ronaldo Krzesinski
@ 2013-01-17 16:03     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-17 16:03 UTC (permalink / raw)
  To: Herton Ronaldo Krzesinski
  Cc: linux-kernel, stable, alan, Chris Perl, Trond Myklebust

On Thu, Jan 17, 2013 at 01:14:59PM -0200, Herton Ronaldo Krzesinski wrote:
> On Tue, Jan 15, 2013 at 02:54:15PM -0800, Greg Kroah-Hartman wrote:
> > 3.0-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Trond Myklebust <Trond.Myklebust@netapp.com>
> > 
> > commit 87ed50036b866db2ec2ba16b2a7aec4a2b0b7c39 upstream.
> > 
> > If the rpc_task exits while holding the socket write lock before it has
> > allocated an rpc slot, then the usual mechanism for releasing the write
> > lock in xprt_release() is defeated.
> > 
> > The problem occurs if the call to xprt_lock_write() initially fails, so
> > that the rpc_task is put on the xprt->sending wait queue. If the task
> > exits after being assigned the lock by __xprt_lock_write_func, but
> > before it has retried the call to xprt_lock_and_alloc_slot(), then
> > it calls xprt_release() while holding the write lock, but will
> > immediately exit due to the test for task->tk_rqstp != NULL.
> > 
> > Reported-by: Chris Perl <chris.perl@gmail.com>
> > Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> This is marked only for kernel versions 3.1 and later, which looks
> correct as it seems to address a problem starting with commit
> 43cedbf0e8dfb9c5610eb7985d5f21263e313802

Ah, good catch, I've now dropped it from the 3.0-stable queue, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 24/71] ring-buffer: Fix race between integrity check and readers
  2013-01-15 22:54 ` [ 24/71] ring-buffer: Fix race between integrity check and readers Greg Kroah-Hartman
@ 2013-01-17 20:02   ` Herton Ronaldo Krzesinski
  0 siblings, 0 replies; 83+ messages in thread
From: Herton Ronaldo Krzesinski @ 2013-01-17 20:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, stable, alan, Steven Rostedt

On Tue, Jan 15, 2013 at 02:54:21PM -0800, Greg Kroah-Hartman wrote:
> 3.0-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Steven Rostedt <srostedt@redhat.com>
> 
> commit 9366c1ba13fbc41bdb57702e75ca4382f209c82f upstream.
> 
> The function rb_check_pages() was added to make sure the ring buffer's
> pages were sane. This check is done when the ring buffer size is modified
> as well as when the iterator is released (closing the "trace" file),
> as that was considered a non fast path and a good place to do a sanity
> check.
> 
> The problem is that the check does not have any locks around it.
> If one process were to read the trace file, and another were to read
> the raw binary file, the check could happen while the reader is reading
> the file.
> 
> The issues with this is that the check requires to clear the HEAD page
> before doing the full check and it restores it afterward. But readers
> require the HEAD page to exist before it can read the buffer, otherwise
> it gives a nasty warning and disables the buffer.
> 
> By adding the reader lock around the check, this keeps the race from
> happening.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Too late now (and harmless), but the commit id and changelog are wrong, the
real commit for this backport is 54f7be5b831254199522523ccab4c3d954bbf576
(ring-buffer: Fix NULL pointer if rb_set_head_page() fails). The same
happened with the patch applied on 3.4 this cycle.

-- 
[]'s
Herton

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 36/71] ext4: lock i_mutex when truncating orphan inodes
  2013-01-15 22:54 ` [ 36/71] ext4: lock i_mutex when truncating orphan inodes Greg Kroah-Hartman
@ 2013-01-17 20:07   ` Herton Ronaldo Krzesinski
  2013-01-18  0:46     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 83+ messages in thread
From: Herton Ronaldo Krzesinski @ 2013-01-17 20:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, stable, alan, Alexander Beregalov, Theodore Tso,
	Zheng Liu

On Tue, Jan 15, 2013 at 02:54:33PM -0800, Greg Kroah-Hartman wrote:
> 3.0-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Theodore Ts'o <tytso@mit.edu>
> 
> commit 721e3eba21e43532e438652dd8f1fcdfce3187e7 upstream.
> 
> Commit c278531d39 added a warning when ext4_flush_unwritten_io() is
> called without i_mutex being taken.  It had previously not been taken
> during orphan cleanup since races weren't possible at that point in
> the mount process, but as a result of this c278531d39, we will now see
> a kernel WARN_ON in this case.  Take the i_mutex in
> ext4_orphan_cleanup() to suppress this warning.
> 
> Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

By the description and looking at commit c278531d39, this change isn't
needed for 3.0 or 3.4 kernels (anything <= 3.6), they don't contain
commit c278531d39.

> 
> ---
>  fs/ext4/super.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -2204,7 +2204,9 @@ static void ext4_orphan_cleanup(struct s
>  				__func__, inode->i_ino, inode->i_size);
>  			jbd_debug(2, "truncating inode %lu to %lld bytes\n",
>  				  inode->i_ino, inode->i_size);
> +			mutex_lock(&inode->i_mutex);
>  			ext4_truncate(inode);
> +			mutex_unlock(&inode->i_mutex);
>  			nr_truncates++;
>  		} else {
>  			ext4_msg(sb, KERN_DEBUG,
> 
> 

-- 
[]'s
Herton

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 36/71] ext4: lock i_mutex when truncating orphan inodes
  2013-01-17 20:07   ` Herton Ronaldo Krzesinski
@ 2013-01-18  0:46     ` Greg Kroah-Hartman
  2013-01-18  3:47       ` Herton Ronaldo Krzesinski
  0 siblings, 1 reply; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-18  0:46 UTC (permalink / raw)
  To: Herton Ronaldo Krzesinski
  Cc: linux-kernel, stable, alan, Alexander Beregalov, Theodore Tso,
	Zheng Liu

On Thu, Jan 17, 2013 at 06:07:11PM -0200, Herton Ronaldo Krzesinski wrote:
> On Tue, Jan 15, 2013 at 02:54:33PM -0800, Greg Kroah-Hartman wrote:
> > 3.0-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Theodore Ts'o <tytso@mit.edu>
> > 
> > commit 721e3eba21e43532e438652dd8f1fcdfce3187e7 upstream.
> > 
> > Commit c278531d39 added a warning when ext4_flush_unwritten_io() is
> > called without i_mutex being taken.  It had previously not been taken
> > during orphan cleanup since races weren't possible at that point in
> > the mount process, but as a result of this c278531d39, we will now see
> > a kernel WARN_ON in this case.  Take the i_mutex in
> > ext4_orphan_cleanup() to suppress this warning.
> > 
> > Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
> > Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> > Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> By the description and looking at commit c278531d39, this change isn't
> needed for 3.0 or 3.4 kernels (anything <= 3.6), they don't contain
> commit c278531d39.

Ah, good catch.  Should this be reverted from 3.0 and 3.4?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 36/71] ext4: lock i_mutex when truncating orphan inodes
  2013-01-18  0:46     ` Greg Kroah-Hartman
@ 2013-01-18  3:47       ` Herton Ronaldo Krzesinski
  2013-01-18  3:56         ` Theodore Ts'o
  0 siblings, 1 reply; 83+ messages in thread
From: Herton Ronaldo Krzesinski @ 2013-01-18  3:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, stable, alan, Alexander Beregalov, Theodore Tso,
	Zheng Liu

On Thu, Jan 17, 2013 at 04:46:16PM -0800, Greg Kroah-Hartman wrote:
> On Thu, Jan 17, 2013 at 06:07:11PM -0200, Herton Ronaldo Krzesinski wrote:
> > On Tue, Jan 15, 2013 at 02:54:33PM -0800, Greg Kroah-Hartman wrote:
> > > 3.0-stable review patch.  If anyone has any objections, please let me know.
> > > 
> > > ------------------
> > > 
> > > From: Theodore Ts'o <tytso@mit.edu>
> > > 
> > > commit 721e3eba21e43532e438652dd8f1fcdfce3187e7 upstream.
> > > 
> > > Commit c278531d39 added a warning when ext4_flush_unwritten_io() is
> > > called without i_mutex being taken.  It had previously not been taken
> > > during orphan cleanup since races weren't possible at that point in
> > > the mount process, but as a result of this c278531d39, we will now see
> > > a kernel WARN_ON in this case.  Take the i_mutex in
> > > ext4_orphan_cleanup() to suppress this warning.
> > > 
> > > Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
> > > Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> > > Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > By the description and looking at commit c278531d39, this change isn't
> > needed for 3.0 or 3.4 kernels (anything <= 3.6), they don't contain
> > commit c278531d39.
> 
> Ah, good catch.  Should this be reverted from 3.0 and 3.4?

I judge it as unecessary from what I saw so far, can ext4 developers
and/or people in Cc confirm? It should be harmless, only consequence is
an uneeded lock being taken now in 3.0/3.4

> 
> thanks,
> 
> greg k-h
> 

-- 
[]'s
Herton

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 36/71] ext4: lock i_mutex when truncating orphan inodes
  2013-01-18  3:47       ` Herton Ronaldo Krzesinski
@ 2013-01-18  3:56         ` Theodore Ts'o
  2013-01-18 21:27           ` Greg Kroah-Hartman
  0 siblings, 1 reply; 83+ messages in thread
From: Theodore Ts'o @ 2013-01-18  3:56 UTC (permalink / raw)
  To: Herton Ronaldo Krzesinski
  Cc: Greg Kroah-Hartman, linux-kernel, stable, alan,
	Alexander Beregalov, Zheng Liu

On Fri, Jan 18, 2013 at 01:47:48AM -0200, Herton Ronaldo Krzesinski wrote:
> > > By the description and looking at commit c278531d39, this change isn't
> > > needed for 3.0 or 3.4 kernels (anything <= 3.6), they don't contain
> > > commit c278531d39.
> > 
> > Ah, good catch.  Should this be reverted from 3.0 and 3.4?
> 
> I judge it as unecessary from what I saw so far, can ext4 developers
> and/or people in Cc confirm? It should be harmless, only consequence is
> an uneeded lock being taken now in 3.0/3.4

It's not worth it to revert it.  The lock is being taken in a
completely non-fastpath, as well as guaranteed-to-be non-contended
code path.

We're not requiring that the lock be taken in 3.0 and 3.4, but
arguably it's still a good idea to take it from a consistency point of
view.

						- Ted

^ permalink raw reply	[flat|nested] 83+ messages in thread

* Re: [ 36/71] ext4: lock i_mutex when truncating orphan inodes
  2013-01-18  3:56         ` Theodore Ts'o
@ 2013-01-18 21:27           ` Greg Kroah-Hartman
  0 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-18 21:27 UTC (permalink / raw)
  To: Theodore Ts'o, Herton Ronaldo Krzesinski, linux-kernel,
	stable, alan, Alexander Beregalov, Zheng Liu

On Thu, Jan 17, 2013 at 10:56:50PM -0500, Theodore Ts'o wrote:
> On Fri, Jan 18, 2013 at 01:47:48AM -0200, Herton Ronaldo Krzesinski wrote:
> > > > By the description and looking at commit c278531d39, this change isn't
> > > > needed for 3.0 or 3.4 kernels (anything <= 3.6), they don't contain
> > > > commit c278531d39.
> > > 
> > > Ah, good catch.  Should this be reverted from 3.0 and 3.4?
> > 
> > I judge it as unecessary from what I saw so far, can ext4 developers
> > and/or people in Cc confirm? It should be harmless, only consequence is
> > an uneeded lock being taken now in 3.0/3.4
> 
> It's not worth it to revert it.  The lock is being taken in a
> completely non-fastpath, as well as guaranteed-to-be non-contended
> code path.
> 
> We're not requiring that the lock be taken in 3.0 and 3.4, but
> arguably it's still a good idea to take it from a consistency point of
> view.

Thanks for letting me know, I'll just leave it for now.

greg k-h

^ permalink raw reply	[flat|nested] 83+ messages in thread

end of thread, other threads:[~2013-01-18 21:27 UTC | newest]

Thread overview: 83+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
2013-01-15 22:53 ` [ 01/71] powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build Greg Kroah-Hartman
2013-01-15 22:53 ` [ 02/71] powerpc/vdso: Remove redundant locking in update_vsyscall_tz() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 03/71] s390/cio: fix pgid reserved check Greg Kroah-Hartman
2013-01-15 22:54 ` [ 04/71] mm: compaction: fix echo 1 > compact_memory return error issue Greg Kroah-Hartman
2013-01-15 22:54 ` [ 05/71] mm: use aligned zone start for pfn_to_bitidx calculation Greg Kroah-Hartman
2013-01-15 22:54 ` [ 06/71] Revert "ath9k_hw: Update AR9003 high_power tx gain table" Greg Kroah-Hartman
2013-01-15 22:54 ` [ 07/71] ath9k: ar9003: fix OTP register offsets for AR9340 Greg Kroah-Hartman
2013-01-15 22:54 ` [ 08/71] firewire: net: Fix handling of fragmented multicast/broadcast packets Greg Kroah-Hartman
2013-01-15 22:54 ` [ 09/71] SCSI: mvsas: fix undefined bit shift Greg Kroah-Hartman
2013-01-15 22:54 ` [ 10/71] SCSI: qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically Greg Kroah-Hartman
2013-01-15 22:54 ` [ 11/71] sata_promise: fix hardreset lockdep error Greg Kroah-Hartman
2013-01-15 22:54 ` [ 12/71] libata: set dma_mode to 0xff in reset Greg Kroah-Hartman
2013-01-15 22:54 ` [ 13/71] libata: fix Null pointer dereference on disk error Greg Kroah-Hartman
2013-01-15 22:54 ` [ 14/71] target/tcm_fc: fix the lockdep warning due to inconsistent lock state Greg Kroah-Hartman
2013-01-15 22:54 ` [ 15/71] mfd: Only unregister platform devices allocated by the mfd core Greg Kroah-Hartman
2013-01-15 22:54 ` [ 16/71] ext4: fix memory leak in ext4_xattr_set_acl()s error path Greg Kroah-Hartman
2013-01-15 22:54 ` [ 17/71] SUNRPC: Ensure that we free the rpc_task after cleanups are done Greg Kroah-Hartman
2013-01-15 22:54 ` [ 18/71] SUNRPC: Ensure we release the socket write lock if the rpc_task exits early Greg Kroah-Hartman
2013-01-17 15:14   ` Herton Ronaldo Krzesinski
2013-01-17 16:03     ` Greg Kroah-Hartman
2013-01-15 22:54 ` [ 19/71] jffs2: hold erase_completion_lock on exit Greg Kroah-Hartman
2013-01-15 22:54 ` [ 20/71] i2400m: add Intel 6150 device IDs Greg Kroah-Hartman
2013-01-15 22:54 ` [ 21/71] drm/i915: make the panel fitter work on pipes B and C on IVB Greg Kroah-Hartman
2013-01-15 22:54 ` [ 22/71] RDMA/nes: Fix for crash when registering zero length MR for CQ Greg Kroah-Hartman
2013-01-15 22:54 ` [ 23/71] RDMA/nes: Fix for terminate timer crash Greg Kroah-Hartman
2013-01-15 22:54 ` [ 24/71] ring-buffer: Fix race between integrity check and readers Greg Kroah-Hartman
2013-01-17 20:02   ` Herton Ronaldo Krzesinski
2013-01-15 22:54 ` [ 25/71] dm ioctl: prevent unsafe change to dm_ioctl data_size Greg Kroah-Hartman
2013-01-15 22:54 ` [ 26/71] staging: vt6656: [BUG] out of bound array reference in RFbSetPower Greg Kroah-Hartman
2013-01-15 22:54 ` [ 27/71] staging: vt6656: 64 bit fixes: use u32 for QWORD definition Greg Kroah-Hartman
2013-01-15 22:54 ` [ 28/71] staging: vt6656: 64 bit fixes : correct all type sizes Greg Kroah-Hartman
2013-01-15 22:54 ` [ 29/71] staging: vt6656: 64 bit fixes: fix long warning messages Greg Kroah-Hartman
2013-01-15 22:54 ` [ 30/71] staging: vt6656: 64bit fixes: key.c/h change unsigned long to u32 Greg Kroah-Hartman
2013-01-15 22:54 ` [ 31/71] staging: vt6656: 64bit fixes: vCommandTimerWait change calculation of timer Greg Kroah-Hartman
2013-01-15 22:54 ` [ 32/71] video: mxsfb: fix crash when unblanking the display Greg Kroah-Hartman
2013-01-15 22:54 ` [ 33/71] ext4: fix extent tree corruption caused by hole punch Greg Kroah-Hartman
2013-01-15 22:54 ` [ 34/71] jbd2: fix assertion failure in jbd2_journal_flush() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 35/71] ext4: do not try to write superblock on ro remount w/o journal Greg Kroah-Hartman
2013-01-15 22:54 ` [ 36/71] ext4: lock i_mutex when truncating orphan inodes Greg Kroah-Hartman
2013-01-17 20:07   ` Herton Ronaldo Krzesinski
2013-01-18  0:46     ` Greg Kroah-Hartman
2013-01-18  3:47       ` Herton Ronaldo Krzesinski
2013-01-18  3:56         ` Theodore Ts'o
2013-01-18 21:27           ` Greg Kroah-Hartman
2013-01-15 22:54 ` [ 37/71] aoe: do not call bdi_init after blk_alloc_queue Greg Kroah-Hartman
2013-01-15 22:54 ` [ 38/71] udf: fix memory leak while allocating blocks during write Greg Kroah-Hartman
2013-01-15 22:54 ` [ 39/71] udf: dont increment lenExtents while writing to a hole Greg Kroah-Hartman
2013-01-15 22:54 ` [ 40/71] thp, memcg: split hugepage for memcg oom on cow Greg Kroah-Hartman
2013-01-15 22:54 ` [ 41/71] x86, amd: Disable way access filter on Piledriver CPUs Greg Kroah-Hartman
2013-01-15 22:54 ` [ 42/71] ACPI : do not use Lid and Sleep button for S5 wakeup Greg Kroah-Hartman
2013-01-15 22:54 ` [ 43/71] rtnetlink: Compute and store minimum ifinfo dump size Greg Kroah-Hartman
2013-01-15 22:54 ` [ 44/71] rtnetlink: Fix problem with buffer allocation Greg Kroah-Hartman
2013-01-15 22:54 ` [ 45/71] rtnetlink: fix rtnl_calcit() and rtnl_dump_ifinfo() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 46/71] epoll: prevent missed events on EPOLL_CTL_MOD Greg Kroah-Hartman
2013-01-15 22:54 ` [ 47/71] ASoC: wm2000: Fix sense of speech clarity enable Greg Kroah-Hartman
2013-01-15 22:54 ` [ 48/71] ALSA: pxa27x: fix ac97 cold reset Greg Kroah-Hartman
2013-01-15 22:54 ` [ 49/71] staging: comedi: prevent auto-unconfig of manually configured devices Greg Kroah-Hartman
2013-01-15 22:54 ` [ 50/71] staging: comedi: comedi_test: fix race when cancelling command Greg Kroah-Hartman
2013-01-15 22:54 ` [ 51/71] staging: r8712u: Add new device ID Greg Kroah-Hartman
2013-01-15 22:54 ` [ 52/71] staging: speakup: avoid out-of-range access in synth_init() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 53/71] staging: speakup: avoid out-of-range access in synth_add() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 54/71] radeon/kms: force rn50 chip to always report connected on analog output Greg Kroah-Hartman
2013-01-15 22:54 ` [ 55/71] mac80211: use del_timer_sync for final sta cleanup timer deletion Greg Kroah-Hartman
2013-01-15 22:54 ` [ 56/71] USB: option: add Nexpring NP10T terminal id Greg Kroah-Hartman
2013-01-15 22:54 ` [ 57/71] USB: option: blacklist network interface on ZTE MF880 Greg Kroah-Hartman
2013-01-15 22:54 ` [ 58/71] USB: option: Add new MEDIATEK PID support Greg Kroah-Hartman
2013-01-15 22:54 ` [ 59/71] USB: option: add Telekom Speedstick LTE II Greg Kroah-Hartman
2013-01-15 22:54 ` [ 60/71] usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added Greg Kroah-Hartman
2013-01-15 22:54 ` [ 61/71] USB: cdc-acm: Add support for "PSC Scanning, Magellan 800i" Greg Kroah-Hartman
2013-01-15 22:54 ` [ 62/71] usb: gadget: dummy: fix enumeration with g_multi Greg Kroah-Hartman
2013-01-15 22:55 ` [ 63/71] USB: Increase reset timeout Greg Kroah-Hartman
2013-01-15 22:55 ` [ 64/71] USB: hub: handle claim of enabled remote wakeup after reset Greg Kroah-Hartman
2013-01-15 22:55 ` [ 65/71] xhci: Handle HS bulk/ctrl endpoints that dont NAK Greg Kroah-Hartman
2013-01-15 22:55 ` [ 66/71] GFS2: Test bufdata with buffer locked and gfs2_log_lock held Greg Kroah-Hartman
2013-01-15 22:55 ` [ 67/71] intel-iommu: Free old page tables before creating superpage Greg Kroah-Hartman
2013-01-15 22:55 ` [ 68/71] KVM: PPC: 44x: fix DCR read/write Greg Kroah-Hartman
2013-01-15 22:55 ` [ 69/71] Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13" Greg Kroah-Hartman
2013-01-15 22:55 ` [ 70/71] staging: comedi: dont hijack hardware device private data Greg Kroah-Hartman
2013-01-15 22:55 ` [ 71/71] staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC Greg Kroah-Hartman
2013-01-15 23:49 ` [ 00/71] 3.0.59-stable review Peter Senna Tschudin
2013-01-16  0:06   ` Greg Kroah-Hartman
2013-01-16  3:47 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).