linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [3.5.y.z extended stable] Linux 3.5.7.30 stable review
@ 2014-02-07 11:21 Luis Henriques
  2014-02-07 11:21 ` [PATCH 3.5 01/88] ext4: fix deadlock when writing in ENOSPC conditions Luis Henriques
                   ` (87 more replies)
  0 siblings, 88 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:21 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Luis Henriques

This is the start of the review cycle for the Linux 3.5.7.30 stable kernel.

This version contains 88 new patches, summarized below.  The new patches are
posted as replies to this message and also available in this git branch:

http://kernel.ubuntu.com/git?p=ubuntu/linux.git;h=linux-3.5.y-review;a=shortlog

git://kernel.ubuntu.com/ubuntu/linux.git  linux-3.5.y-review

The review period for version 3.5.7.30 will be open for the next three days.
To report a problem, please reply to the relevant follow-up patch message.

For more information about the Linux 3.5.y.z extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .

 -Luis

--
 Documentation/filesystems/proc.txt                |   4 +-
 arch/alpha/lib/csum_partial_copy.c                |   9 +-
 arch/arm/mach-at91/sam9_smc.c                     |   2 +-
 arch/powerpc/kernel/cacheinfo.c                   |   3 +
 arch/powerpc/kvm/e500_tlb.c                       |   2 +-
 arch/s390/kvm/diag.c                              |   2 +-
 arch/x86/kernel/cpu/perf_event_amd_ibs.c          |  53 ++++++--
 arch/x86/platform/efi/efi.c                       |   2 +-
 arch/x86/xen/platform-pci-unplug.c                |  74 +++++++++++
 drivers/acpi/bus.c                                |   9 ++
 drivers/block/xen-blkfront.c                      |   4 +-
 drivers/edac/e752x_edac.c                         |   4 +-
 drivers/gpu/drm/cirrus/cirrus_mode.c              |   4 +-
 drivers/gpu/drm/radeon/evergreen_cs.c             |   5 +-
 drivers/gpu/drm/radeon/r600.c                     |  13 +-
 drivers/gpu/drm/radeon/r600_cs.c                  |   5 +-
 drivers/gpu/drm/radeon/r600d.h                    |   1 +
 drivers/gpu/drm/radeon/radeon_atombios.c          |   4 +
 drivers/gpu/drm/radeon/radeon_i2c.c               |   3 +
 drivers/gpu/drm/radeon/radeon_pm.c                |   6 +-
 drivers/hwmon/coretemp.c                          |   2 +-
 drivers/infiniband/hw/qib/qib_ud.c                |   9 +-
 drivers/input/misc/xen-kbdfront.c                 |   4 +
 drivers/iommu/intel-iommu.c                       |   2 +-
 drivers/md/dm-sysfs.c                             |  10 +-
 drivers/md/dm-thin.c                              |  17 +--
 drivers/md/dm.c                                   |  11 ++
 drivers/md/dm.h                                   |   2 +
 drivers/md/persistent-data/dm-space-map-common.c  |   6 +-
 drivers/md/raid10.c                               |  12 +-
 drivers/md/raid5.c                                |   5 +-
 drivers/media/dvb/frontends/dib8000.c             |  33 +++--
 drivers/mmc/host/atmel-mci.c                      |  13 +-
 drivers/mtd/nand/mxc_nand.c                       |   1 -
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c   |  13 +-
 drivers/net/ethernet/via/via-rhine.c              |   1 +
 drivers/net/wireless/b43/b43.h                    |   4 +-
 drivers/net/wireless/b43/main.c                   |  27 ++--
 drivers/net/wireless/b43/xmit.c                   |   4 +-
 drivers/net/wireless/b43legacy/main.c             |   1 +
 drivers/net/wireless/mwifiex/scan.c               |   4 +-
 drivers/net/wireless/rtlwifi/core.c               |  11 ++
 drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h |  14 +++
 drivers/net/wireless/rtlwifi/rtl8192cu/rf.c       |  29 +++--
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c       |  19 ++-
 drivers/net/wireless/rtlwifi/wifi.h               |   1 +
 drivers/net/xen-netfront.c                        |   2 +-
 drivers/parport/parport_pc.c                      |  10 +-
 drivers/pci/xen-pcifront.c                        |   4 +
 drivers/platform/x86/hp_accel.c                   |   1 +
 drivers/scsi/bfa/bfad.c                           |   6 +-
 drivers/spi/spi.c                                 |   4 +-
 drivers/staging/comedi/drivers/cb_pcidio.c        |  21 ++--
 drivers/staging/rtl8712/usb_intf.c                |   5 +
 drivers/staging/vt6656/baseband.c                 |   3 -
 drivers/target/iscsi/iscsi_target.c               |  34 +++--
 drivers/tty/serial/8250/8250.c                    |   4 +
 drivers/tty/serial/8250/8250_pci.c                |   4 +
 drivers/tty/serial/amba-pl011.c                   |   6 +
 drivers/tty/serial/atmel_serial.c                 |  20 +--
 drivers/usb/core/config.c                         |   7 --
 drivers/usb/core/hub.c                            |  40 ++----
 drivers/usb/host/xhci.c                           |   3 +
 drivers/usb/serial/cypress_m8.h                   |   2 +-
 drivers/usb/serial/ftdi_sio.c                     |  17 ++-
 drivers/usb/serial/option.c                       |  15 +++
 drivers/usb/storage/unusual_devs.h                |   7 ++
 drivers/video/xen-fbfront.c                       |   4 +
 drivers/xen/xenbus/xenbus_probe_frontend.c        |   2 +-
 fs/btrfs/extent-tree.c                            |   2 +-
 fs/dcache.c                                       |   7 +-
 fs/exofs/ore.c                                    |  37 ++++--
 fs/ext4/inode.c                                   |   6 -
 fs/fs-writeback.c                                 |  15 ++-
 fs/fuse/dev.c                                     |  22 +---
 fs/nfs/nfs4proc.c                                 |   4 +-
 fs/nfs/nfs4xdr.c                                  |  47 ++++---
 fs/nilfs2/segment.c                               |  10 +-
 fs/splice.c                                       |  18 +++
 include/linux/audit.h                             |   2 +-
 include/linux/hugetlb.h                           |   6 +
 include/linux/mm.h                                |   5 +-
 include/linux/pipe_fs_i.h                         |   2 +
 include/scsi/osd_ore.h                            |   1 +
 include/xen/platform_pci.h                        |  23 ++++
 lib/decompress_inflate.c                          |   2 +-
 mm/hugetlb.c                                      |  17 +++
 mm/memory-failure.c                               |  16 ++-
 mm/oom_kill.c                                     |   2 +-
 mm/page-writeback.c                               |  55 ++++-----
 mm/slub.c                                         |   8 +-
 mm/swap.c                                         | 143 +++++++++++++---------
 net/compat.c                                      |   9 +-
 net/core/skbuff.c                                 |  32 +----
 net/ipv4/inet_diag.c                              |   4 +-
 net/ipv4/ipmr.c                                   |   7 +-
 net/ipv6/ip6mr.c                                  |   7 +-
 net/sunrpc/clnt.c                                 |   8 +-
 security/selinux/ss/policydb.c                    |  14 ++-
 sound/pci/Kconfig                                 |  12 ++
 sound/pci/rme9652/rme9652.c                       |   2 +-
 sound/soc/codecs/adau1701.c                       |   2 +-
 tools/perf/util/session.c                         |   7 +-
 tools/power/x86/turbostat/turbostat.c             |  11 +-
 104 files changed, 836 insertions(+), 414 deletions(-)

AKASHI Takahiro (1):
      audit: correct a type mismatch in audit_syscall_exit()

Alex Deucher (3):
      drm/radeon: warn users when hw_i2c is enabled (v2)
      drm/radeon: set the full cache bit for fences on r7xx+
      drm/radeon/DCE4+: clear bios scratch dpms bit (v2)

Alex Williamson (1):
      intel-iommu: fix off-by-one in pagetable freeing

Alexandre Courbot (1):
      lib/decompressors: fix "no limit" output buffer length

Amitkumar Karwar (1):
      mwifiex: add missing endian conversion for fw_tsf

Andrea Arcangeli (1):
      mm: hugetlbfs: fix hugetlbfs optimization

Andreas Rohner (1):
      nilfs2: fix segctor bug that causes file system corruption

Andy Grover (1):
      target/iscsi: Fix network portal creation race

Aristeu Rozanski (1):
      e752x_edac: Fix pci_dev usage count

Boaz Harrosh (1):
      ore: Fix wrong math in allocation of per device BIO

Colin Leitner (1):
      USB: ftdi_sio: added CS5 quirk for broken smartcard readers

Daniel Santos (1):
      spidev: fix hang when transfer_one_message fails

Dave Young (1):
      x86/efi: Fix off-by-one bug in EFI Boot Services reservation

David Rientjes (1):
      mm, oom: base root bonus on current usage

Dongsheng Yang (1):
      perf kvm: Fix kvm report without guestmount.

Eric W. Biederman (1):
      vfs: In d_path don't call d_dname on a mount point

Hannes Frederic Sowa (1):
      net: avoid reference counter overflows on fib_rules in multicast forwarding

Heiko Carstens (1):
      KVM: s390: fix diagnose code extraction

Ian Abbott (1):
      staging: comedi: 8255_pci: fix for newer PCI-DIO48H

Ira Weiny (1):
      IB/qib: Fix QP check when looping back to/from QP1

Jack Pham (1):
      usb: xhci: Check for XHCI_PLAT in xhci_cleanup_msix()

Jan Kara (2):
      ext4: fix deadlock when writing in ENOSPC conditions
      writeback: Fix data corruption on NFS

Jean Delvare (1):
      hwmon: (coretemp) Fix truncated name of alarm attributes

Jean-Jacques Hiblot (1):
      ARM: at91: smc: bug fix in sam9_smc_cs_read()

Jianguo Wu (1):
      mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully

Joe Thornber (1):
      dm space map common: make sure new space is used during extend

Johan Hovold (1):
      USB: cypress_m8: fix ring-indicator detection and reporting

Johannes Weiner (1):
      mm/page-writeback.c: fix dirty_balance_reserve subtraction from dirtyable memory

Jon Medhurst (1):
      serial: amba-pl011: use port lock to guard control register access

Josh Triplett (1):
      turbostat: Use GCC's CPUID functions to support PIC

Konrad Rzeszutek Wilk (1):
      xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4).

Larry Finger (10):
      rtlwifi: rtl8192cu: Fix W=1 build warning
      rtlwifi: rtl8192cu: Add new firmware
      rtlwifi: Set the link state
      rtlwifi: rtl8192c: Add new definitions in the dm_common header
      rtlwifi: rtl8192cu: Fix some code in RF handling
      staging: r8712u: Set device type to wlan
      rtlwifi: rtl8192cu: Add new device ID
      b43: Fix lockdep splat
      b43: Fix unload oops if firmware is not available
      b43legacy: Fix unload oops if firmware is not available

Lars-Peter Clausen (1):
      ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant

Li Zefan (1):
      slub: Fix calculation of cpu slabs

Ludovic Desroches (1):
      mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA

Malcolm Priestley (1):
      staging: vt6656: [BUG] BBvUpdatePreEDThreshold Always set sensitivity on bScanning

Marek Olšák (1):
      drm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID

Marek Roszko (1):
      tty/serial: at91: Handle shutdown more safely

Mark Brown (1):
      ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API

Mauro Carvalho Chehab (1):
      [media] dib8000: make 32 bits read atomic

Michael Grzeschik (1):
      mtd: mxc_nand: remove duplicated ecc_stats counting

Michal Schmidt (1):
      bnx2x: fix DMA unmapping of TSO split BDs

Michel Dänzer (1):
      radeon/pm: Guard access to rdev->pm.power_state array

Mihai Caraman (1):
      KVM: PPC: e500: Fix bad address type in deliver_tlb_misss()

Mike Snitzer (1):
      dm thin: initialize dm_thin_new_mapping returned by get_next_mapping

Mikhail Zolotaryov (1):
      USB: Nokia 502 is an unusual device

Miklos Szeredi (1):
      fuse: fix pipe_buf_operations

Mikulas Patocka (3):
      mm: fix crash when using XFS on loopback
      dm: wait until embedded kobject is released before destroying a device
      alpha: fix broken network checksum

Neal Cardwell (1):
      inet_diag: fix inet_diag_dump_icsk() timewait socket state logic

NeilBrown (4):
      md/raid5: Fix possible confusion when multiple write errors occur.
      md/raid10: fix two bugs in handling of known-bad-blocks.
      md/raid10: fix bug when raid10 recovery fails to recover a block.
      md/raid5: fix long-standing problem with bitmap handling on write failure.

PaX Team (1):
      x86, x32: Correct invalid use of user timespec in the kernel

Paul Mackerras (1):
      powerpc: Make sure "cache" directory is removed when offlining cpu

Rahul Bedarkar (1):
      USB: serial: add support for iBall 3.5G connect usb modem

Richard Weinberger (1):
      net,via-rhine: Fix tx_timeout handling

Robert Richter (1):
      perf/x86/amd/ibs: Fix waking up from S3 for AMD family 10h

Sebastian Andrzej Siewior (1):
      parport: parport_pc: remove double PCI ID for NetMos

Stephen Warren (1):
      serial: 8250: enable UART_BUG_NOMSR for Tegra

Takashi Iwai (4):
      ALSA: rme9652: fix a missing comma in channel_map_9636_ds[]
      ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks
      hp_accel: Add a new PnP ID HPQ6007 for new HP laptops
      drm/cirrus: correct register values for 16bpp

Tetsuo Handa (1):
      SELinux: Fix memory leak upon loading policy

Thomas Pugliese (1):
      usb: core: get config and string descriptors for unauthorized devices

Trond Myklebust (1):
      NFSv4: OPEN must handle the NFS4ERR_IO return code correctly

Vijaya Mohan Guvva (1):
      [SCSI] bfa: Chinook quad port 16G FC HBA claim issue

Wang Shilong (1):
      Btrfs: handle EAGAIN case properly in btrfs_drop_snapshot()

Weston Andros Adamson (2):
      sunrpc: Fix infinite loop in RPC state machine
      nfs4.1: properly handle ENOTSUP in SECINFO_NO_NAME

Yegor Yefremov (1):
      serial: add support for 200 v3 series Titan card

ZHAO Gang (1):
      b43: fix the wrong assignment of status.freq in b43_rx()

张君 (1):
      usb: option: add new zte 3g modem pids to option driver

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

* [PATCH 3.5 01/88] ext4: fix deadlock when writing in ENOSPC conditions
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
@ 2014-02-07 11:21 ` Luis Henriques
  2014-02-07 11:21 ` [PATCH 3.5 02/88] writeback: Fix data corruption on NFS Luis Henriques
                   ` (86 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:21 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jan Kara, Theodore Ts'o, Kamal Mostafa, Luis Henriques

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

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

From: Jan Kara <jack@suse.cz>

commit 34cf865d54813aab3497838132fb1bbd293f4054 upstream.

Akira-san has been reporting rare deadlocks of his machine when running
xfstests test 269 on ext4 filesystem. The problem turned out to be in
ext4_da_reserve_metadata() and ext4_da_reserve_space() which called
ext4_should_retry_alloc() while holding i_data_sem. Since
ext4_should_retry_alloc() can force a transaction commit, this is a
lock ordering violation and leads to deadlocks.

Fix the problem by just removing the retry loops. These functions should
just report ENOSPC to the caller (e.g. ext4_da_write_begin()) and that
function must take care of retrying after dropping all necessary locks.

Reported-and-tested-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
[ kamal: backport to 3.8 (no ext4_da_reserve_metadata) ]
Cc: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/ext4/inode.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 8aacdda..efecfb7 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1175,7 +1175,6 @@ static int ext4_journalled_write_end(struct file *file,
  */
 static int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock)
 {
-	int retries = 0;
 	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
 	struct ext4_inode_info *ei = EXT4_I(inode);
 	unsigned int md_needed;
@@ -1197,7 +1196,6 @@ static int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock)
 	 * in order to allocate nrblocks
 	 * worse case is one extent per block
 	 */
-repeat:
 	spin_lock(&ei->i_block_reservation_lock);
 	/*
 	 * ext4_calc_metadata_amount() has side effects, which we have
@@ -1217,10 +1215,6 @@ repeat:
 		ei->i_da_metadata_calc_len = save_len;
 		ei->i_da_metadata_calc_last_lblock = save_last_lblock;
 		spin_unlock(&ei->i_block_reservation_lock);
-		if (ext4_should_retry_alloc(inode->i_sb, &retries)) {
-			yield();
-			goto repeat;
-		}
 		dquot_release_reservation_block(inode, EXT4_C2B(sbi, 1));
 		return -ENOSPC;
 	}
-- 
1.8.3.2


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

* [PATCH 3.5 02/88] writeback: Fix data corruption on NFS
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
  2014-02-07 11:21 ` [PATCH 3.5 01/88] ext4: fix deadlock when writing in ENOSPC conditions Luis Henriques
@ 2014-02-07 11:21 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 03/88] md/raid5: Fix possible confusion when multiple write errors occur Luis Henriques
                   ` (85 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:21 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Jan Kara, Luis Henriques

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

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

From: Jan Kara <jack@suse.cz>

commit f9b0e058cbd04ada76b13afffa7e1df830543c24 upstream.

Commit 4f8ad655dbc8 "writeback: Refactor writeback_single_inode()" added
a condition to skip clean inode. However this is wrong in WB_SYNC_ALL
mode because there we also want to wait for outstanding writeback on
possibly clean inode. This was causing occasional data corruption issues
on NFS because it uses sync_inode() to make sure all outstanding writes
are flushed to the server before truncating the inode and with
sync_inode() returning prematurely file was sometimes extended back
by an outstanding write after it was truncated.

So modify the test to also check for pages under writeback in
WB_SYNC_ALL mode.

Fixes: 4f8ad655dbc82cf05d2edc11e66b78a42d38bf93
Reported-and-tested-by: Dan Duval <dan.duval@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/fs-writeback.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index bf7e15d..554aeb7 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -523,13 +523,16 @@ writeback_single_inode(struct inode *inode, struct bdi_writeback *wb,
 	}
 	WARN_ON(inode->i_state & I_SYNC);
 	/*
-	 * Skip inode if it is clean. We don't want to mess with writeback
-	 * lists in this function since flusher thread may be doing for example
-	 * sync in parallel and if we move the inode, it could get skipped. So
-	 * here we make sure inode is on some writeback list and leave it there
-	 * unless we have completely cleaned the inode.
+	 * Skip inode if it is clean and we have no outstanding writeback in
+	 * WB_SYNC_ALL mode. We don't want to mess with writeback lists in this
+	 * function since flusher thread may be doing for example sync in
+	 * parallel and if we move the inode, it could get skipped. So here we
+	 * make sure inode is on some writeback list and leave it there unless
+	 * we have completely cleaned the inode.
 	 */
-	if (!(inode->i_state & I_DIRTY))
+	if (!(inode->i_state & I_DIRTY) &&
+	    (wbc->sync_mode != WB_SYNC_ALL ||
+	     !mapping_tagged(inode->i_mapping, PAGECACHE_TAG_WRITEBACK)))
 		goto out;
 	inode->i_state |= I_SYNC;
 	spin_unlock(&inode->i_lock);
-- 
1.8.3.2


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

* [PATCH 3.5 03/88] md/raid5: Fix possible confusion when multiple write errors occur.
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
  2014-02-07 11:21 ` [PATCH 3.5 01/88] ext4: fix deadlock when writing in ENOSPC conditions Luis Henriques
  2014-02-07 11:21 ` [PATCH 3.5 02/88] writeback: Fix data corruption on NFS Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 04/88] md/raid10: fix two bugs in handling of known-bad-blocks Luis Henriques
                   ` (84 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Luis Henriques

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

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

From: NeilBrown <neilb@suse.de>

commit 1cc03eb93245e63b0b7a7832165efdc52e25b4e6 upstream.

commit 5d8c71f9e5fbdd95650be00294d238e27a363b5c
    md: raid5 crash during degradation

Fixed a crash in an overly simplistic way which could leave
R5_WriteError or R5_MadeGood set in the stripe cache for devices
for which it is no longer relevant.
When those devices are removed and spares added the flags are still
set and can cause incorrect behaviour.

commit 14a75d3e07c784c004b4b44b34af996b8e4ac453
    md/raid5: preferentially read from replacement device if possible.

Fixed the same bug if a more effective way, so we can now revert
the original commit.

Reported-and-tested-by: Alexander Lyakas <alex.bolshoy@gmail.com>
Fixes: 5d8c71f9e5fbdd95650be00294d238e27a363b5c
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/raid5.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index ecf09ec..4ee5324 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3284,7 +3284,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
 			 */
 			set_bit(R5_Insync, &dev->flags);
 
-		if (rdev && test_bit(R5_WriteError, &dev->flags)) {
+		if (test_bit(R5_WriteError, &dev->flags)) {
 			/* This flag does not apply to '.replacement'
 			 * only to .rdev, so make sure to check that*/
 			struct md_rdev *rdev2 = rcu_dereference(
@@ -3297,7 +3297,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
 			} else
 				clear_bit(R5_WriteError, &dev->flags);
 		}
-		if (rdev && test_bit(R5_MadeGood, &dev->flags)) {
+		if (test_bit(R5_MadeGood, &dev->flags)) {
 			/* This flag does not apply to '.replacement'
 			 * only to .rdev, so make sure to check that*/
 			struct md_rdev *rdev2 = rcu_dereference(
-- 
1.8.3.2


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

* [PATCH 3.5 04/88] md/raid10: fix two bugs in handling of known-bad-blocks.
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (2 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 03/88] md/raid5: Fix possible confusion when multiple write errors occur Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 05/88] md/raid10: fix bug when raid10 recovery fails to recover a block Luis Henriques
                   ` (83 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Luis Henriques

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

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

From: NeilBrown <neilb@suse.de>

commit b50c259e25d9260b9108dc0c2964c26e5ecbe1c1 upstream.

If we discover a bad block when reading we split the request and
potentially read some of it from a different device.

The code path of this has two bugs in RAID10.
1/ we get a spin_lock with _irq, but unlock without _irq!!
2/ The calculation of 'sectors_handled' is wrong, as can be clearly
   seen by comparison with raid1.c

This leads to at least 2 warnings and a probable crash is a RAID10
ever had known bad blocks.

Fixes: 856e08e23762dfb92ffc68fd0a8d228f9e152160
Reported-by: Damian Nowak <spam@nowaker.net>
URL: https://bugzilla.kernel.org/show_bug.cgi?id=68181
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/raid10.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 2070e9c..a5229e4 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1203,7 +1203,7 @@ read_again:
 			/* Could not read all from this device, so we will
 			 * need another r10_bio.
 			 */
-			sectors_handled = (r10_bio->sectors + max_sectors
+			sectors_handled = (r10_bio->sector + max_sectors
 					   - bio->bi_sector);
 			r10_bio->sectors = max_sectors;
 			spin_lock_irq(&conf->device_lock);
@@ -1211,7 +1211,7 @@ read_again:
 				bio->bi_phys_segments = 2;
 			else
 				bio->bi_phys_segments++;
-			spin_unlock(&conf->device_lock);
+			spin_unlock_irq(&conf->device_lock);
 			/* Cannot call generic_make_request directly
 			 * as that will be queued in __generic_make_request
 			 * and subsequent mempool_alloc might block
-- 
1.8.3.2


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

* [PATCH 3.5 05/88] md/raid10: fix bug when raid10 recovery fails to recover a block.
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (3 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 04/88] md/raid10: fix two bugs in handling of known-bad-blocks Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 06/88] hwmon: (coretemp) Fix truncated name of alarm attributes Luis Henriques
                   ` (82 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Luis Henriques

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

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

From: NeilBrown <neilb@suse.de>

commit e8b849158508565e0cd6bc80061124afc5879160 upstream.

commit e875ecea266a543e643b19e44cf472f1412708f9
    md/raid10 record bad blocks as needed during recovery.

added code to the "cannot recover this block" path to record a bad
block rather than fail the whole recovery.
Unfortunately this new case was placed *after* r10bio was freed rather
than *before*, yet it still uses r10bio.
This is will crash with a null dereference.

So move the freeing of r10bio down where it is safe.

Fixes: e875ecea266a543e643b19e44cf472f1412708f9
Reported-by: Damian Nowak <spam@nowaker.net>
URL: https://bugzilla.kernel.org/show_bug.cgi?id=68181
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/raid10.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index a5229e4..92319b8 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3062,10 +3062,6 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
 			if (j == conf->copies) {
 				/* Cannot recover, so abort the recovery or
 				 * record a bad block */
-				put_buf(r10_bio);
-				if (rb2)
-					atomic_dec(&rb2->remaining);
-				r10_bio = rb2;
 				if (any_working) {
 					/* problem is that there are bad blocks
 					 * on other device(s)
@@ -3097,6 +3093,10 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
 					mirror->recovery_disabled
 						= mddev->recovery_disabled;
 				}
+				put_buf(r10_bio);
+				if (rb2)
+					atomic_dec(&rb2->remaining);
+				r10_bio = rb2;
 				break;
 			}
 		}
-- 
1.8.3.2


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

* [PATCH 3.5 06/88] hwmon: (coretemp) Fix truncated name of alarm attributes
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (4 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 05/88] md/raid10: fix bug when raid10 recovery fails to recover a block Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 07/88] nilfs2: fix segctor bug that causes file system corruption Luis Henriques
                   ` (81 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jean Delvare, Guenter Roeck, Luis Henriques

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

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

From: Jean Delvare <khali@linux-fr.org>

commit 3f9aec7610b39521c7c69d754de7265f6994c194 upstream.

When the core number exceeds 9, the size of the buffer storing the
alarm attribute name is insufficient and the attribute name is
truncated. This causes libsensors to skip these attributes as the
truncated name is not recognized.

Reported-by: Andreas Hollmann <hollmann@in.tum.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hwmon/coretemp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index fba26ee..8929be4 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -53,7 +53,7 @@ MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius");
 
 #define BASE_SYSFS_ATTR_NO	2	/* Sysfs Base attr no for coretemp */
 #define NUM_REAL_CORES		32	/* Number of Real cores per cpu */
-#define CORETEMP_NAME_LENGTH	17	/* String Length of attrs */
+#define CORETEMP_NAME_LENGTH	19	/* String Length of attrs */
 #define MAX_CORE_ATTRS		4	/* Maximum no of basic attrs */
 #define TOTAL_ATTRS		(MAX_CORE_ATTRS + 1)
 #define MAX_CORE_DATA		(NUM_REAL_CORES + BASE_SYSFS_ATTR_NO)
-- 
1.8.3.2


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

* [PATCH 3.5 07/88] nilfs2: fix segctor bug that causes file system corruption
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (5 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 06/88] hwmon: (coretemp) Fix truncated name of alarm attributes Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 08/88] mm: fix crash when using XFS on loopback Luis Henriques
                   ` (80 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andreas Rohner, Ryusuke Konishi, Andrew Morton, Linus Torvalds,
	Luis Henriques

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

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

From: Andreas Rohner <andreas.rohner@gmx.net>

commit 70f2fe3a26248724d8a5019681a869abdaf3e89a upstream.

There is a bug in the function nilfs_segctor_collect, which results in
active data being written to a segment, that is marked as clean.  It is
possible, that this segment is selected for a later segment
construction, whereby the old data is overwritten.

The problem shows itself with the following kernel log message:

  nilfs_sufile_do_cancel_free: segment 6533 must be clean

Usually a few hours later the file system gets corrupted:

  NILFS: bad btree node (blocknr=8748107): level = 0, flags = 0x0, nchildren = 0
  NILFS error (device sdc1): nilfs_bmap_last_key: broken bmap (inode number=114660)

The issue can be reproduced with a file system that is nearly full and
with the cleaner running, while some IO intensive task is running.
Although it is quite hard to reproduce.

This is what happens:

 1. The cleaner starts the segment construction
 2. nilfs_segctor_collect is called
 3. sc_stage is on NILFS_ST_SUFILE and segments are freed
 4. sc_stage is on NILFS_ST_DAT current segment is full
 5. nilfs_segctor_extend_segments is called, which
    allocates a new segment
 6. The new segment is one of the segments freed in step 3
 7. nilfs_sufile_cancel_freev is called and produces an error message
 8. Loop around and the collection starts again
 9. sc_stage is on NILFS_ST_SUFILE and segments are freed
    including the newly allocated segment, which will contain active
    data and can be allocated at a later time
10. A few hours later another segment construction allocates the
    segment and causes file system corruption

This can be prevented by simply reordering the statements.  If
nilfs_sufile_cancel_freev is called before nilfs_segctor_extend_segments
the freed segments are marked as dirty and cannot be allocated any more.

Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
Reviewed-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Andreas Rohner <andreas.rohner@gmx.net>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nilfs2/segment.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 8992b33..e0a5a18 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -1437,17 +1437,19 @@ static int nilfs_segctor_collect(struct nilfs_sc_info *sci,
 
 		nilfs_clear_logs(&sci->sc_segbufs);
 
-		err = nilfs_segctor_extend_segments(sci, nilfs, nadd);
-		if (unlikely(err))
-			return err;
-
 		if (sci->sc_stage.flags & NILFS_CF_SUFREED) {
 			err = nilfs_sufile_cancel_freev(nilfs->ns_sufile,
 							sci->sc_freesegs,
 							sci->sc_nfreesegs,
 							NULL);
 			WARN_ON(err); /* do not happen */
+			sci->sc_stage.flags &= ~NILFS_CF_SUFREED;
 		}
+
+		err = nilfs_segctor_extend_segments(sci, nilfs, nadd);
+		if (unlikely(err))
+			return err;
+
 		nadd = min_t(int, nadd << 1, SC_MAX_SEGDELTA);
 		sci->sc_stage = prev_stage;
 	}
-- 
1.8.3.2


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

* [PATCH 3.5 08/88] mm: fix crash when using XFS on loopback
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (6 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 07/88] nilfs2: fix segctor bug that causes file system corruption Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 09/88] vfs: In d_path don't call d_dname on a mount point Luis Henriques
                   ` (79 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mikulas Patocka, John David Anglin, Andi Kleen,
	Christoph Lameter, Helge Deller, Andrew Morton, Linus Torvalds,
	Luis Henriques

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

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

From: Mikulas Patocka <mpatocka@redhat.com>

commit 03e5ac2fc3bf6f4140db0371e8bb4243b24e3e02 upstream.

Commit 8456a648cf44 ("slab: use struct page for slab management") causes
a crash in the LVM2 testsuite on PA-RISC (the crashing test is
fsadm.sh).  The testsuite doesn't crash on 3.12, crashes on 3.13-rc1 and
later.

 Bad Address (null pointer deref?): Code=15 regs=000000413edd89a0 (Addr=000006202224647d)
 CPU: 3 PID: 24008 Comm: loop0 Not tainted 3.13.0-rc6 #5
 task: 00000001bf3c0048 ti: 000000413edd8000 task.ti: 000000413edd8000

      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
 PSW: 00001000000001101111100100001110 Not tainted
 r00-03  000000ff0806f90e 00000000405c8de0 000000004013e6c0 000000413edd83f0
 r04-07  00000000405a95e0 0000000000000200 00000001414735f0 00000001bf349e40
 r08-11  0000000010fe3d10 0000000000000001 00000040829c7778 000000413efd9000
 r12-15  0000000000000000 000000004060d800 0000000010fe3000 0000000010fe3000
 r16-19  000000413edd82a0 00000041078ddbc0 0000000000000010 0000000000000001
 r20-23  0008f3d0d83a8000 0000000000000000 00000040829c7778 0000000000000080
 r24-27  00000001bf349e40 00000001bf349e40 202d66202224640d 00000000405a95e0
 r28-31  202d662022246465 000000413edd88f0 000000413edd89a0 0000000000000001
 sr00-03  000000000532c000 0000000000000000 0000000000000000 000000000532c000
 sr04-07  0000000000000000 0000000000000000 0000000000000000 0000000000000000

 IASQ: 0000000000000000 0000000000000000 IAOQ: 00000000401fe42c 00000000401fe430
  IIR: 539c0030    ISR: 00000000202d6000  IOR: 000006202224647d
  CPU:        3   CR30: 000000413edd8000 CR31: 0000000000000000
  ORIG_R28: 00000000405a95e0
  IAOQ[0]: vma_interval_tree_iter_first+0x14/0x48
  IAOQ[1]: vma_interval_tree_iter_first+0x18/0x48
  RP(r2): flush_dcache_page+0x128/0x388
 Backtrace:
   flush_dcache_page+0x128/0x388
   lo_splice_actor+0x90/0x148 [loop]
   splice_from_pipe_feed+0xc0/0x1d0
   __splice_from_pipe+0xac/0xc0
   lo_direct_splice_actor+0x1c/0x70 [loop]
   splice_direct_to_actor+0xec/0x228
   lo_receive+0xe4/0x298 [loop]
   loop_thread+0x478/0x640 [loop]
   kthread+0x134/0x168
   end_fault_vector+0x20/0x28
   xfs_setsize_buftarg+0x0/0x90 [xfs]

 Kernel panic - not syncing: Bad Address (null pointer deref?)

Commit 8456a648cf44 changes the page structure so that the slab
subsystem reuses the page->mapping field.

The crash happens in the following way:
 * XFS allocates some memory from slab and issues a bio to read data
   into it.
 * the bio is sent to the loopback device.
 * lo_receive creates an actor and calls splice_direct_to_actor.
 * lo_splice_actor copies data to the target page.
 * lo_splice_actor calls flush_dcache_page because the page may be
   mapped by userspace.  In that case we need to flush the kernel cache.
 * flush_dcache_page asks for the list of userspace mappings, however
   that page->mapping field is reused by the slab subsystem for a
   different purpose.  This causes the crash.

Note that other architectures without coherent caches (sparc, arm, mips)
also call page_mapping from flush_dcache_page, so they may crash in the
same way.

This patch fixes this bug by testing if the page is a slab page in
page_mapping and returning NULL if it is.

The patch also fixes VM_BUG_ON(PageSlab(page)) that could happen in
earlier kernels in the same scenario on architectures without cache
coherence when CONFIG_DEBUG_VM is enabled - so it should be backported
to stable kernels.

In the old kernels, the function page_mapping is placed in
include/linux/mm.h, so you should modify the patch accordingly when
backporting it.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: John David Anglin <dave.anglin@bell.net>]
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Lameter <cl@linux.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Reviewed-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ luis: backported to 3.5:
  - file rename: mm/util.c -> include/linux/mm.h ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/mm.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 53eb728..23a80570 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -791,7 +791,10 @@ static inline struct address_space *page_mapping(struct page *page)
 {
 	struct address_space *mapping = page->mapping;
 
-	VM_BUG_ON(PageSlab(page));
+	/* This happens if someone calls flush_dcache_page on slab page */
+	if (unlikely(PageSlab(page)))
+		return NULL;
+
 	if (unlikely(PageSwapCache(page)))
 		mapping = &swapper_space;
 	else if ((unsigned long)mapping & PAGE_MAPPING_ANON)
-- 
1.8.3.2


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

* [PATCH 3.5 09/88] vfs: In d_path don't call d_dname on a mount point
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (7 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 08/88] mm: fix crash when using XFS on loopback Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 10/88] perf/x86/amd/ibs: Fix waking up from S3 for AMD family 10h Luis Henriques
                   ` (78 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Eric W. Biederman, Luis Henriques

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

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

From: "Eric W. Biederman" <ebiederm@xmission.com>

commit f48cfddc6729ef133933062320039808bafa6f45 upstream.

Aditya Kali (adityakali@google.com) wrote:
> Commit bf056bfa80596a5d14b26b17276a56a0dcb080e5:
> "proc: Fix the namespace inode permission checks." converted
> the namespace files into symlinks. The same commit changed
> the way namespace bind mounts appear in /proc/mounts:
>   $ mount --bind /proc/self/ns/ipc /mnt/ipc
> Originally:
>   $ cat /proc/mounts | grep ipc
>   proc /mnt/ipc proc rw,nosuid,nodev,noexec 0 0
>
> After commit bf056bfa80596a5d14b26b17276a56a0dcb080e5:
>   $ cat /proc/mounts | grep ipc
>   proc ipc:[4026531839] proc rw,nosuid,nodev,noexec 0 0
>
> This breaks userspace which expects the 2nd field in
> /proc/mounts to be a valid path.

The symlink /proc/<pid>/ns/{ipc,mnt,net,pid,user,uts} point to
dentries allocated with d_alloc_pseudo that we can mount, and
that have interesting names printed out with d_dname.

When these files are bind mounted /proc/mounts is not currently
displaying the mount point correctly because d_dname is called instead
of just displaying the path where the file is mounted.

Solve this by adding an explicit check to distinguish mounted pseudo
inodes and unmounted pseudo inodes.  Unmounted pseudo inodes always
use mount of their filesstem as the mnt_root  in their path making
these two cases easy to distinguish.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Reported-by: Aditya Kali <adityakali@google.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/dcache.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 9b36632..6269583 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2737,8 +2737,13 @@ char *d_path(const struct path *path, char *buf, int buflen)
 	 * thus don't need to be hashed.  They also don't need a name until a
 	 * user wants to identify the object in /proc/pid/fd/.  The little hack
 	 * below allows us to generate a name for these objects on demand:
+	 *
+	 * Some pseudo inodes are mountable.  When they are mounted
+	 * path->dentry == path->mnt->mnt_root.  In that case don't call d_dname
+	 * and instead have d_path return the mounted path.
 	 */
-	if (path->dentry->d_op && path->dentry->d_op->d_dname)
+	if (path->dentry->d_op && path->dentry->d_op->d_dname &&
+	    (!IS_ROOT(path->dentry) || path->dentry != path->mnt->mnt_root))
 		return path->dentry->d_op->d_dname(path->dentry, buf, buflen);
 
 	get_fs_root(current->fs, &root);
-- 
1.8.3.2


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

* [PATCH 3.5 10/88] perf/x86/amd/ibs: Fix waking up from S3 for AMD family 10h
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (8 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 09/88] vfs: In d_path don't call d_dname on a mount point Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 11/88] staging: comedi: 8255_pci: fix for newer PCI-DIO48H Luis Henriques
                   ` (77 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Robert Richter, Peter Zijlstra, Linus Torvalds, Ingo Molnar,
	Luis Henriques

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

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

From: Robert Richter <rric@kernel.org>

commit bee09ed91cacdbffdbcd3b05de8409c77ec9fcd6 upstream.

On AMD family 10h we see following error messages while waking up from
S3 for all non-boot CPUs leading to a failed IBS initialization:

 Enabling non-boot CPUs ...
 smpboot: Booting Node 0 Processor 1 APIC 0x1
 [Firmware Bug]: cpu 1, try to use APIC500 (LVT offset 0) for vector 0x400, but the register is already in use for vector 0xf9 on another cpu
 perf: IBS APIC setup failed on cpu #1
 process: Switch to broadcast mode on CPU1
 CPU1 is up
 ...
 ACPI: Waking up from system sleep state S3

Reason for this is that during suspend the LVT offset for the IBS
vector gets lost and needs to be reinialized while resuming.

The offset is read from the IBSCTL msr. On family 10h the offset needs
to be 1 as offset 0 is used for the MCE threshold interrupt, but
firmware assings it for IBS to 0 too. The kernel needs to reprogram
the vector. The msr is a readonly node msr, but a new value can be
written via pci config space access. The reinitialization is
implemented for family 10h in setup_ibs_ctl() which is forced during
IBS setup.

This patch fixes IBS setup after waking up from S3 by adding
resume/supend hooks for the boot cpu which does the offset
reinitialization.

Marking it as stable to let distros pick up this fix.

Signed-off-by: Robert Richter <rric@kernel.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1389797849-5565-1-git-send-email-rric.net@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kernel/cpu/perf_event_amd_ibs.c | 53 +++++++++++++++++++++++++++-----
 1 file changed, 45 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
index 4018f6e..6eea380 100644
--- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/ptrace.h>
+#include <linux/syscore_ops.h>
 
 #include <asm/apic.h>
 
@@ -777,6 +778,18 @@ out:
 	return ret;
 }
 
+static void ibs_eilvt_setup(void)
+{
+	/*
+	 * Force LVT offset assignment for family 10h: The offsets are
+	 * not assigned by the BIOS for this family, so the OS is
+	 * responsible for doing it. If the OS assignment fails, fall
+	 * back to BIOS settings and try to setup this.
+	 */
+	if (boot_cpu_data.x86 == 0x10)
+		force_ibs_eilvt_setup();
+}
+
 static inline int get_ibs_lvt_offset(void)
 {
 	u64 val;
@@ -812,6 +825,36 @@ static void clear_APIC_ibs(void *dummy)
 		setup_APIC_eilvt(offset, 0, APIC_EILVT_MSG_FIX, 1);
 }
 
+#ifdef CONFIG_PM
+
+static int perf_ibs_suspend(void)
+{
+	clear_APIC_ibs(NULL);
+	return 0;
+}
+
+static void perf_ibs_resume(void)
+{
+	ibs_eilvt_setup();
+	setup_APIC_ibs(NULL);
+}
+
+static struct syscore_ops perf_ibs_syscore_ops = {
+	.resume		= perf_ibs_resume,
+	.suspend	= perf_ibs_suspend,
+};
+
+static void perf_ibs_pm_init(void)
+{
+	register_syscore_ops(&perf_ibs_syscore_ops);
+}
+
+#else
+
+static inline void perf_ibs_pm_init(void) { }
+
+#endif
+
 static int __cpuinit
 perf_ibs_cpu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
 {
@@ -838,18 +881,12 @@ static __init int amd_ibs_init(void)
 	if (!caps)
 		return -ENODEV;	/* ibs not supported by the cpu */
 
-	/*
-	 * Force LVT offset assignment for family 10h: The offsets are
-	 * not assigned by the BIOS for this family, so the OS is
-	 * responsible for doing it. If the OS assignment fails, fall
-	 * back to BIOS settings and try to setup this.
-	 */
-	if (boot_cpu_data.x86 == 0x10)
-		force_ibs_eilvt_setup();
+	ibs_eilvt_setup();
 
 	if (!ibs_eilvt_valid())
 		goto out;
 
+	perf_ibs_pm_init();
 	get_online_cpus();
 	ibs_caps = caps;
 	/* make ibs_caps visible to other cpus: */
-- 
1.8.3.2


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

* [PATCH 3.5 11/88] staging: comedi: 8255_pci: fix for newer PCI-DIO48H
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (9 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 10/88] perf/x86/amd/ibs: Fix waking up from S3 for AMD family 10h Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 12/88] mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully Luis Henriques
                   ` (76 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ian Abbott, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit 0283f7a100882684ad32b768f9f1ad81658a0b92 upstream.

At some point, Measurement Computing / ComputerBoards redesigned the
PCI-DIO48H to use a PLX PCI interface chip instead of an AMCC chip.
This meant they had to put their hardware registers in the PCI BAR 2
region instead of PCI BAR 1.  Unfortunately, they kept the same PCI
device ID for the new design.  This means the driver recognizes the
newer cards, but doesn't work (and is likely to screw up the local
configuration registers of the PLX chip) because it's using the wrong
region.

Since  the PCI subvendor and subdevice IDs were both zero on the old
design, but are the same as the vendor and device on the new design, we
can tell the old design and new design apart easily enough.  Split the
existing entry for the PCI-DIO48H in `pci_8255_boards[]` into two new
entries, referenced by different entries in the PCI device ID table
`pci_8255_pci_table[]`.  Use the same board name for both entries.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Ian: Applies to 3.4.y and 3.5.y (Ubuntu Extended Stable).
  Note that other changes make this patch somewhat different to the
  upstream commit, but it fixes the same problem. ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/staging/comedi/drivers/cb_pcidio.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidio.c b/drivers/staging/comedi/drivers/cb_pcidio.c
index 713132c..d4f7fda 100644
--- a/drivers/staging/comedi/drivers/cb_pcidio.c
+++ b/drivers/staging/comedi/drivers/cb_pcidio.c
@@ -56,10 +56,6 @@ struct pcidio_board {
 	const char *name;	/*  name of the board */
 	int dev_id;
 	int n_8255;		/*  number of 8255 chips on board */
-
-	/*  indices of base address regions */
-	int pcicontroler_badrindex;
-	int dioregs_badrindex;
 };
 
 static const struct pcidio_board pcidio_boards[] = {
@@ -67,22 +63,16 @@ static const struct pcidio_board pcidio_boards[] = {
 	 .name = "pci-dio24",
 	 .dev_id = 0x0028,
 	 .n_8255 = 1,
-	 .pcicontroler_badrindex = 1,
-	 .dioregs_badrindex = 2,
 	 },
 	{
 	 .name = "pci-dio24h",
 	 .dev_id = 0x0014,
 	 .n_8255 = 1,
-	 .pcicontroler_badrindex = 1,
-	 .dioregs_badrindex = 2,
 	 },
 	{
 	 .name = "pci-dio48h",
 	 .dev_id = 0x000b,
 	 .n_8255 = 2,
-	 .pcicontroler_badrindex = 0,
-	 .dioregs_badrindex = 1,
 	 },
 };
 
@@ -173,10 +163,15 @@ found:
 	if (comedi_pci_enable(pcidev, thisboard->name))
 		return -EIO;
 
-	devpriv->dio_reg_base
-	    =
+	/*
+	 * Use PCI BAR 2 region if non-zero length, else use PCI BAR 1 region.
+	 * PCI BAR 1 is only used for older PCI-DIO48H boards.  At some point
+	 * the PCI-DIO48H was redesigned to use the same PCI interface chip
+	 * (and same PCI BAR region) as the other boards.
+	 */
+	devpriv->dio_reg_base =
 	    pci_resource_start(devpriv->pci_dev,
-			       pcidio_boards[index].dioregs_badrindex);
+			       (pci_resource_len(pcidev, 2) ? 2 : 1));
 
 /*
  * Allocate the subdevice structures.  alloc_subdevice() is a
-- 
1.8.3.2


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

* [PATCH 3.5 12/88] mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (10 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 11/88] staging: comedi: 8255_pci: fix for newer PCI-DIO48H Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 13/88] serial: amba-pl011: use port lock to guard control register access Luis Henriques
                   ` (75 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jianguo Wu, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Jianguo Wu <wujianguo@huawei.com>

commit a49ecbcd7b0d5a1cda7d60e03df402dd0ef76ac8 upstream.

After a successful hugetlb page migration by soft offline, the source
page will either be freed into hugepage_freelists or buddy(over-commit
page).  If page is in buddy, page_hstate(page) will be NULL.  It will
hit a NULL pointer dereference in dequeue_hwpoisoned_huge_page().

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
  IP: [<ffffffff81163761>] dequeue_hwpoisoned_huge_page+0x131/0x1d0
  PGD c23762067 PUD c24be2067 PMD 0
  Oops: 0000 [#1] SMP

So check PageHuge(page) after call migrate_pages() successfully.

Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
Tested-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[wujg: backport to 3.4:
 - adjust context
 - s/num_poisoned_pages/mce_bad_pages/]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/memory-failure.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 1bf1092..5eb3f727 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1447,10 +1447,18 @@ static int soft_offline_huge_page(struct page *page, int flags)
 		return ret;
 	}
 done:
-	if (!PageHWPoison(hpage))
-		atomic_long_add(1 << compound_trans_order(hpage), &mce_bad_pages);
-	set_page_hwpoison_huge_page(hpage);
-	dequeue_hwpoisoned_huge_page(hpage);
+	/* overcommit hugetlb page will be freed to buddy */
+	if (PageHuge(hpage)) {
+		if (!PageHWPoison(hpage))
+			atomic_long_add(1 << compound_trans_order(hpage),
+					&mce_bad_pages);
+		set_page_hwpoison_huge_page(hpage);
+		dequeue_hwpoisoned_huge_page(hpage);
+	} else {
+		SetPageHWPoison(page);
+		atomic_long_inc(&mce_bad_pages);
+	}
+
 	/* keep elevated page count for bad page */
 	return ret;
 }
-- 
1.8.3.2


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

* [PATCH 3.5 13/88] serial: amba-pl011: use port lock to guard control register access
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (11 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 12/88] mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 14/88] rtlwifi: rtl8192cu: Fix W=1 build warning Luis Henriques
                   ` (74 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jon Medhurst, Greg Kroah-Hartman, Luis Henriques

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

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

From: Jon Medhurst <tixy@linaro.org>

commit fe43390702a1b5741fdf217063b05c7612b38303 upstream.

When the pl011 is being used for a console, pl011_console_write forces
the control register (CR) to enable the UART for transmission and then
restores this to the original value afterwards. It does this while
holding the port lock.

Unfortunately, when the uart is started or shutdown - say in response to
userland using the serial device for a terminal - then this updates the
control register without any locking.

This means we can have

  pl011_console_write   Save CR
  pl011_startup         Initialise CR, e.g. enable receive
  pl011_console_write   Restore old CR with receive not enabled

this result is a serial port which doesn't respond to any input.

A similar race in reverse could happen when the device is shutdown.

We can fix these problems by taking the port lock when updating CR.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/tty/serial/amba-pl011.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index da8a37f..63b8217 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1353,6 +1353,8 @@ static int pl011_startup(struct uart_port *port)
 	/*
 	 * Provoke TX FIFO interrupt into asserting.
 	 */
+	spin_lock_irq(&uap->port.lock);
+
 	cr = UART01x_CR_UARTEN | UART011_CR_TXE | UART011_CR_LBE;
 	writew(cr, uap->port.membase + UART011_CR);
 	writew(0, uap->port.membase + UART011_FBRD);
@@ -1377,6 +1379,8 @@ static int pl011_startup(struct uart_port *port)
 	cr |= UART01x_CR_UARTEN | UART011_CR_RXE | UART011_CR_TXE;
 	writew(cr, uap->port.membase + UART011_CR);
 
+	spin_unlock_irq(&uap->port.lock);
+
 	/*
 	 * initialise the old status of the modem signals
 	 */
@@ -1457,11 +1461,13 @@ static void pl011_shutdown(struct uart_port *port)
 	 * it during startup().
 	 */
 	uap->autorts = false;
+	spin_lock_irq(&uap->port.lock);
 	cr = readw(uap->port.membase + UART011_CR);
 	uap->old_cr = cr;
 	cr &= UART011_CR_RTS | UART011_CR_DTR;
 	cr |= UART01x_CR_UARTEN | UART011_CR_TXE;
 	writew(cr, uap->port.membase + UART011_CR);
+	spin_unlock_irq(&uap->port.lock);
 
 	/*
 	 * disable break condition and fifos
-- 
1.8.3.2


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

* [PATCH 3.5 14/88] rtlwifi: rtl8192cu: Fix W=1 build warning
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (12 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 13/88] serial: amba-pl011: use port lock to guard control register access Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 15/88] rtlwifi: rtl8192cu: Add new firmware Luis Henriques
                   ` (73 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit 0b948341f398646b0d59d746800fbbf3656886e7 upstream.

When this driver is built with "make W=1", the following warning is output:

drivers/net/wireless/rtlwifi/rtl8192cu/sw.c:56:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 5212ad2..873754b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -76,7 +76,7 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
 				      GFP_KERNEL, hw, rtl_fw_cb);
 
 
-	return 0;
+	return err;
 }
 
 static void rtl92cu_deinit_sw_vars(struct ieee80211_hw *hw)
-- 
1.8.3.2


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

* [PATCH 3.5 15/88] rtlwifi: rtl8192cu: Add new firmware
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (13 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 14/88] rtlwifi: rtl8192cu: Fix W=1 build warning Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 16/88] rtlwifi: Set the link state Luis Henriques
                   ` (72 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit 62009b7f12793c932aaba0df946b04cb4a77d022 upstream.

Vendor driver rtl8188C_8192C_8192D_usb_linux_v3.4.2_3727.20120404 introduced
new firmware for these chips. The code try for the new file, and fall back to
the original firmware if the new file is not available.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/rtlwifi/core.c         | 10 ++++++++++
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 16 +++++++++++++---
 drivers/net/wireless/rtlwifi/wifi.h         |  1 +
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index 278e9f9..60bf47d 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -46,10 +46,20 @@ void rtl_fw_cb(const struct firmware *firmware, void *context)
 			 "Firmware callback routine entered!\n");
 	complete(&rtlpriv->firmware_loading_complete);
 	if (!firmware) {
+		if (rtlpriv->cfg->alt_fw_name) {
+			err = request_firmware(&firmware,
+					       rtlpriv->cfg->alt_fw_name,
+					       rtlpriv->io.dev);
+			pr_info("Loading alternative firmware %s\n",
+				rtlpriv->cfg->alt_fw_name);
+			if (!err)
+				goto found_alt;
+		}
 		pr_err("Firmware %s not available\n", rtlpriv->cfg->fw_name);
 		rtlpriv->max_fw_size = 0;
 		return;
 	}
+found_alt:
 	if (firmware->size > rtlpriv->max_fw_size) {
 		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
 			 "Firmware is too big!\n");
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 873754b..07ab292 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -49,6 +49,9 @@ MODULE_AUTHOR("Larry Finger	<Larry.Finger@lwfinger.net>");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Realtek 8192C/8188C 802.11n USB wireless");
 MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin");
+MODULE_FIRMWARE("rtlwifi/rtl8192cufw_A.bin");
+MODULE_FIRMWARE("rtlwifi/rtl8192cufw_B.bin");
+MODULE_FIRMWARE("rtlwifi/rtl8192cufw_TMSC.bin");
 
 static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
 {
@@ -68,14 +71,21 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
 			 "Can't alloc buffer for fw\n");
 		return 1;
 	}
-
+	if (IS_VENDOR_UMC_A_CUT(rtlpriv->rtlhal.version) &&
+	    !IS_92C_SERIAL(rtlpriv->rtlhal.version)) {
+		rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cufw_A.bin";
+	} else if (IS_81xxC_VENDOR_UMC_B_CUT(rtlpriv->rtlhal.version)) {
+		rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cufw_B.bin";
+	} else {
+		rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cufw_TMSC.bin";
+	}
+	/* provide name of alternative file */
+	rtlpriv->cfg->alt_fw_name = "rtlwifi/rtl8192cufw.bin";
 	pr_info("Loading firmware %s\n", rtlpriv->cfg->fw_name);
 	rtlpriv->max_fw_size = 0x4000;
 	err = request_firmware_nowait(THIS_MODULE, 1,
 				      rtlpriv->cfg->fw_name, rtlpriv->io.dev,
 				      GFP_KERNEL, hw, rtl_fw_cb);
-
-
 	return err;
 }
 
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index fa02202..2f08d08 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -1529,6 +1529,7 @@ struct rtl_hal_cfg {
 	bool write_readback;
 	char *name;
 	char *fw_name;
+	char *alt_fw_name;
 	struct rtl_hal_ops *ops;
 	struct rtl_mod_params *mod_params;
 	struct rtl_hal_usbint_cfg *usb_interface_cfg;
-- 
1.8.3.2


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

* [PATCH 3.5 16/88] rtlwifi: Set the link state
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (14 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 15/88] rtlwifi: rtl8192cu: Add new firmware Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 17/88] rtlwifi: rtl8192c: Add new definitions in the dm_common header Luis Henriques
                   ` (71 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit 619ce76f8bb850b57032501a39f26aa6c6731c70 upstream.

The present code fails to set the linked state when an interface is
added.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/rtlwifi/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index 60bf47d..e70333b 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -185,6 +185,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
 					rtlpriv->cfg->maps
 					[RTL_IBSS_INT_MASKS]);
 		}
+		mac->link_state = MAC80211_LINKED;
 		break;
 	case NL80211_IFTYPE_ADHOC:
 		RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
-- 
1.8.3.2


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

* [PATCH 3.5 17/88] rtlwifi: rtl8192c: Add new definitions in the dm_common header
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (15 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 16/88] rtlwifi: Set the link state Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 18/88] rtlwifi: rtl8192cu: Fix some code in RF handling Luis Henriques
                   ` (70 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit c908c74e005de780fddbe8cb6fcd44803f5d4b74 upstream.

Changes in the gain-control mechanism will require some changes in the header.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h
index 518e208..4f232a0 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h
@@ -91,6 +91,17 @@
 #define TX_POWER_NEAR_FIELD_THRESH_LVL2		74
 #define TX_POWER_NEAR_FIELD_THRESH_LVL1		67
 
+#define DYNAMIC_FUNC_DISABLE			0x0
+#define DYNAMIC_FUNC_DIG			BIT(0)
+#define DYNAMIC_FUNC_HP				BIT(1)
+#define DYNAMIC_FUNC_SS				BIT(2) /*Tx Power Tracking*/
+#define DYNAMIC_FUNC_BT				BIT(3)
+#define DYNAMIC_FUNC_ANT_DIV			BIT(4)
+
+#define	RSSI_CCK				0
+#define	RSSI_OFDM				1
+#define	RSSI_DEFAULT				2
+
 struct swat_t {
 	u8 failure_cnt;
 	u8 try_flag;
@@ -167,5 +178,8 @@ void rtl92c_phy_lc_calibrate(struct ieee80211_hw *hw);
 void rtl92c_phy_iq_calibrate(struct ieee80211_hw *hw, bool recovery);
 void rtl92c_dm_dynamic_txpower(struct ieee80211_hw *hw);
 void rtl92c_dm_bt_coexist(struct ieee80211_hw *hw);
+void dm_savepowerindex(struct ieee80211_hw *hw);
+void dm_writepowerindex(struct ieee80211_hw *hw, u8 value);
+void dm_restorepowerindex(struct ieee80211_hw *hw);
 
 #endif
-- 
1.8.3.2


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

* [PATCH 3.5 18/88] rtlwifi: rtl8192cu: Fix some code in RF handling
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (16 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 17/88] rtlwifi: rtl8192c: Add new definitions in the dm_common header Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 19/88] NFSv4: OPEN must handle the NFS4ERR_IO return code correctly Luis Henriques
                   ` (69 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit e9b0784bb9de3152e787ee779868c626b137fb3b upstream.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/rf.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
index 4763426..bbe9a78 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
@@ -85,17 +85,15 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
 	if (mac->act_scanning) {
 		tx_agc[RF90_PATH_A] = 0x3f3f3f3f;
 		tx_agc[RF90_PATH_B] = 0x3f3f3f3f;
-		if (turbo_scanoff) {
-			for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
-				tx_agc[idx1] = ppowerlevel[idx1] |
-				    (ppowerlevel[idx1] << 8) |
-				    (ppowerlevel[idx1] << 16) |
-				    (ppowerlevel[idx1] << 24);
-				if (rtlhal->interface == INTF_USB) {
-					if (tx_agc[idx1] > 0x20 &&
-					    rtlefuse->external_pa)
-						tx_agc[idx1] = 0x20;
-				}
+		for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
+			tx_agc[idx1] = ppowerlevel[idx1] |
+			    (ppowerlevel[idx1] << 8) |
+			    (ppowerlevel[idx1] << 16) |
+			    (ppowerlevel[idx1] << 24);
+			if (rtlhal->interface == INTF_USB) {
+				if (tx_agc[idx1] > 0x20 &&
+				    rtlefuse->external_pa)
+					tx_agc[idx1] = 0x20;
 			}
 		}
 	} else {
@@ -107,7 +105,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
 			   TXHIGHPWRLEVEL_LEVEL2) {
 			tx_agc[RF90_PATH_A] = 0x00000000;
 			tx_agc[RF90_PATH_B] = 0x00000000;
-		} else{
+		} else {
 			for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
 				tx_agc[idx1] = ppowerlevel[idx1] |
 				    (ppowerlevel[idx1] << 8) |
@@ -379,7 +377,12 @@ static void _rtl92c_write_ofdm_power_reg(struct ieee80211_hw *hw,
 			    regoffset == RTXAGC_B_MCS07_MCS04)
 				regoffset = 0xc98;
 			for (i = 0; i < 3; i++) {
-				writeVal = (writeVal > 6) ? (writeVal - 6) : 0;
+				if (i != 2)
+					writeVal = (writeVal > 8) ?
+						   (writeVal - 8) : 0;
+				else
+					writeVal = (writeVal > 6) ?
+						   (writeVal - 6) : 0;
 				rtl_write_byte(rtlpriv, (u32)(regoffset + i),
 					      (u8)writeVal);
 			}
-- 
1.8.3.2


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

* [PATCH 3.5 19/88] NFSv4: OPEN must handle the NFS4ERR_IO return code correctly
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (17 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 18/88] rtlwifi: rtl8192cu: Fix some code in RF handling Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 20/88] parport: parport_pc: remove double PCI ID for NetMos Luis Henriques
                   ` (68 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Luis Henriques

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

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

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

commit c7848f69ec4a8c03732cde5c949bd2aa711a9f4b upstream.

decode_op_hdr() cannot distinguish between an XDR decoding error and
the perfectly valid errorcode NFS4ERR_IO. This is normally not a
problem, but for the particular case of OPEN, we need to be able
to increment the NFSv4 open sequence id when the server returns
a valid response.

Reported-by: J Bruce Fields <bfields@fieldses.org>
Link: http://lkml.kernel.org/r/20131204210356.GA19452@fieldses.org
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfs/nfs4xdr.c | 47 +++++++++++++++++++++++++++++++----------------
 1 file changed, 31 insertions(+), 16 deletions(-)

diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index cfce99b..9e2d9a4 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3011,7 +3011,8 @@ out_overflow:
 	return -EIO;
 }
 
-static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected)
+static bool __decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected,
+		int *nfs_retval)
 {
 	__be32 *p;
 	uint32_t opnum;
@@ -3021,19 +3022,32 @@ static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected)
 	if (unlikely(!p))
 		goto out_overflow;
 	opnum = be32_to_cpup(p++);
-	if (opnum != expected) {
-		dprintk("nfs: Server returned operation"
-			" %d but we issued a request for %d\n",
-				opnum, expected);
-		return -EIO;
-	}
+	if (unlikely(opnum != expected))
+		goto out_bad_operation;
 	nfserr = be32_to_cpup(p);
-	if (nfserr != NFS_OK)
-		return nfs4_stat_to_errno(nfserr);
-	return 0;
+	if (nfserr == NFS_OK)
+		*nfs_retval = 0;
+	else
+		*nfs_retval = nfs4_stat_to_errno(nfserr);
+	return true;
+out_bad_operation:
+	dprintk("nfs: Server returned operation"
+		" %d but we issued a request for %d\n",
+			opnum, expected);
+	*nfs_retval = -EREMOTEIO;
+	return false;
 out_overflow:
 	print_overflow_msg(__func__, xdr);
-	return -EIO;
+	*nfs_retval = -EIO;
+	return false;
+}
+
+static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected)
+{
+	int retval;
+
+	__decode_op_hdr(xdr, expected, &retval);
+	return retval;
 }
 
 /* Dummy routine */
@@ -4848,11 +4862,12 @@ static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
 	uint32_t savewords, bmlen, i;
 	int status;
 
-	status = decode_op_hdr(xdr, OP_OPEN);
-	if (status != -EIO)
-		nfs_increment_open_seqid(status, res->seqid);
-	if (!status)
-		status = decode_stateid(xdr, &res->stateid);
+	if (!__decode_op_hdr(xdr, OP_OPEN, &status))
+		return status;
+	nfs_increment_open_seqid(status, res->seqid);
+	if (status)
+		return status;
+	status = decode_stateid(xdr, &res->stateid);
 	if (unlikely(status))
 		return status;
 
-- 
1.8.3.2


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

* [PATCH 3.5 20/88] parport: parport_pc: remove double PCI ID for NetMos
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (18 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 19/88] NFSv4: OPEN must handle the NFS4ERR_IO return code correctly Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 21/88] staging: vt6656: [BUG] BBvUpdatePreEDThreshold Always set sensitivity on bScanning Luis Henriques
                   ` (67 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Maximilian Attems, Sebastian Andrzej Siewior, Andrew Morton,
	Greg Kroah-Hartman, Luis Henriques

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

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

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

commit d6a484520c5572a4170fa915109ccfc0c38f5008 upstream.

In commit 85747f ("PATCH] parport: add NetMOS 9805 support") Max added
the PCI ID for NetMOS 9805 based on a Debian bug report from 2k4 which
was at the v2.4.26 time frame. The patch made into 2.6.14.
Shortly before that patch akpm merged commit 296d3c783b ("[PATCH] Support
NetMOS based PCI cards providing serial and parallel ports") which made
into v2.6.9-rc1.
Now we have two different entries for the same PCI id.
I have here the NetMos 9805 which claims to support SPP/EPP/ECP mode.
This patch takes Max's entry for titan_1284p1 (base != -1 specifies the
ioport for ECP mode) and replaces akpm's entry for netmos_9805 which
specified -1 (=none). Both share the same PCI-ID (my card has subsystem
0x1000 / 0x0020 so it should match PCI_ANY).

While here I also drop the entry for titan_1284p2 which is the same as
netmos_9815.

Cc: Maximilian Attems <maks@stro.at>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/parport/parport_pc.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 5abffe5..978bc77 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2599,8 +2599,6 @@ enum parport_pc_pci_cards {
 	syba_2p_epp,
 	syba_1p_ecp,
 	titan_010l,
-	titan_1284p1,
-	titan_1284p2,
 	avlab_1p,
 	avlab_2p,
 	oxsemi_952,
@@ -2659,8 +2657,6 @@ static struct parport_pc_pci {
 	/* syba_2p_epp AP138B */	{ 2, { { 0, 0x078 }, { 0, 0x178 }, } },
 	/* syba_1p_ecp W83787 */	{ 1, { { 0, 0x078 }, } },
 	/* titan_010l */		{ 1, { { 3, -1 }, } },
-	/* titan_1284p1 */              { 1, { { 0, 1 }, } },
-	/* titan_1284p2 */		{ 2, { { 0, 1 }, { 2, 3 }, } },
 	/* avlab_1p		*/	{ 1, { { 0, 1}, } },
 	/* avlab_2p		*/	{ 2, { { 0, 1}, { 2, 3 },} },
 	/* The Oxford Semi cards are unusual: 954 doesn't support ECP,
@@ -2676,8 +2672,8 @@ static struct parport_pc_pci {
 	/* netmos_9705 */               { 1, { { 0, -1 }, } },
 	/* netmos_9715 */               { 2, { { 0, 1 }, { 2, 3 },} },
 	/* netmos_9755 */               { 2, { { 0, 1 }, { 2, 3 },} },
-	/* netmos_9805 */               { 1, { { 0, -1 }, } },
-	/* netmos_9815 */               { 2, { { 0, -1 }, { 2, -1 }, } },
+	/* netmos_9805 */		{ 1, { { 0, 1 }, } },
+	/* netmos_9815 */		{ 2, { { 0, 1 }, { 2, 3 }, } },
 	/* netmos_9901 */               { 1, { { 0, -1 }, } },
 	/* netmos_9865 */               { 1, { { 0, -1 }, } },
 	/* quatech_sppxp100 */		{ 1, { { 0, 1 }, } },
@@ -2721,8 +2717,6 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_1p_ecp },
 	{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_010L,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, titan_010l },
-	{ 0x9710, 0x9805, 0x1000, 0x0010, 0, 0, titan_1284p1 },
-	{ 0x9710, 0x9815, 0x1000, 0x0020, 0, 0, titan_1284p2 },
 	/* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
 	/* AFAVLAB_TK9902 */
 	{ 0x14db, 0x2120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1p},
-- 
1.8.3.2


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

* [PATCH 3.5 21/88] staging: vt6656: [BUG] BBvUpdatePreEDThreshold Always set sensitivity on bScanning
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (19 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 20/88] parport: parport_pc: remove double PCI ID for NetMos Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 22/88] [SCSI] bfa: Chinook quad port 16G FC HBA claim issue Luis Henriques
                   ` (66 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Malcolm Priestley, Greg Kroah-Hartman, Luis Henriques

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

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

From: Malcolm Priestley <tvboxspy@gmail.com>

commit 8f248dae133668bfb8e9379b4b3f0571c858b24a upstream.

byBBPreEDIndex value is initially 0, this means that from
cold BBvUpdatePreEDThreshold is never set.

This means that sensitivity may be in an ambiguous state,
failing to scan any wireless points or at least distant ones.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/staging/vt6656/baseband.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 858e2a8..4034281 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -1634,7 +1634,6 @@ BBvUpdatePreEDThreshold(
 
             if( bScanning )
             {   // need Max sensitivity //RSSI -69, -70,....
-                if(pDevice->byBBPreEDIndex == 0) break;
                 pDevice->byBBPreEDIndex = 0;
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
@@ -1777,7 +1776,6 @@ BBvUpdatePreEDThreshold(
 
             if( bScanning )
             {   // need Max sensitivity  //RSSI -69, -70, ...
-                if(pDevice->byBBPreEDIndex == 0) break;
                 pDevice->byBBPreEDIndex = 0;
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x24); //CR206(0xCE)
@@ -1929,7 +1927,6 @@ BBvUpdatePreEDThreshold(
         case RF_VT3342A0: //RobertYu:20060627, testing table
             if( bScanning )
             {   // need Max sensitivity  //RSSI -67, -68, ...
-                if(pDevice->byBBPreEDIndex == 0) break;
                 pDevice->byBBPreEDIndex = 0;
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x38); //CR206(0xCE)
-- 
1.8.3.2


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

* [PATCH 3.5 22/88] [SCSI] bfa: Chinook quad port 16G FC HBA claim issue
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (20 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 21/88] staging: vt6656: [BUG] BBvUpdatePreEDThreshold Always set sensitivity on bScanning Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 23/88] usb: option: add new zte 3g modem pids to option driver Luis Henriques
                   ` (65 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vijaya Mohan Guvva, James Bottomley, Luis Henriques

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

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

From: Vijaya Mohan Guvva <vmohan@brocade.com>

commit dcaf9aed995c2b2a49fb86bbbcfa2f92c797ab5d upstream.

Bfa driver crash is observed while pushing the firmware on to chinook
quad port card due to uninitialized bfi_image_ct2 access which gets
initialized only for CT2 ASIC based cards after request_firmware().
For quard port chinook (CT2 ASIC based), bfi_image_ct2 is not getting
initialized as there is no check for chinook PCI device ID before
request_firmware and instead bfi_image_cb is initialized as it is the
default case for card type check.

This patch includes changes to read the right firmware for quad port chinook.

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/scsi/bfa/bfad.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 2e4b0be..d068873 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1598,7 +1598,7 @@ out:
 static u32 *
 bfad_load_fwimg(struct pci_dev *pdev)
 {
-	if (pdev->device == BFA_PCI_DEVICE_ID_CT2) {
+	if (bfa_asic_id_ct2(pdev->device)) {
 		if (bfi_image_ct2_size == 0)
 			bfad_read_firmware(pdev, &bfi_image_ct2,
 				&bfi_image_ct2_size, BFAD_FW_FILE_CT2);
@@ -1608,12 +1608,14 @@ bfad_load_fwimg(struct pci_dev *pdev)
 			bfad_read_firmware(pdev, &bfi_image_ct,
 				&bfi_image_ct_size, BFAD_FW_FILE_CT);
 		return bfi_image_ct;
-	} else {
+	} else if (bfa_asic_id_cb(pdev->device)) {
 		if (bfi_image_cb_size == 0)
 			bfad_read_firmware(pdev, &bfi_image_cb,
 				&bfi_image_cb_size, BFAD_FW_FILE_CB);
 		return bfi_image_cb;
 	}
+
+	return NULL;
 }
 
 static void
-- 
1.8.3.2


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

* [PATCH 3.5 23/88] usb: option: add new zte 3g modem pids to option driver
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (21 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 22/88] [SCSI] bfa: Chinook quad port 16G FC HBA claim issue Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 24/88] [media] dib8000: make 32 bits read atomic Luis Henriques
                   ` (64 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jun zhang, Greg Kroah-Hartman, Luis Henriques

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

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

From: =?UTF-8?q?=E5=BC=A0=E5=90=9B?= <zjn77777@163.com>

commit 4d90b819ae4c7ea8fd5e2bb7edc68c0f334be2e4 upstream.

Signed-off-by: Jun zhang <zhang.jun92@zte.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/option.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index aac4deb..94af767 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1461,6 +1461,17 @@ static const struct usb_device_id option_ids[] = {
 		.driver_info = (kernel_ulong_t)&net_intf3_blacklist },
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff),
 		.driver_info = (kernel_ulong_t)&net_intf3_blacklist },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xffe9, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8b, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8c, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8d, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8e, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8f, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff90, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff91, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff92, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff93, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff94, 0xff, 0xff, 0xff) },
 
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
-- 
1.8.3.2


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

* [PATCH 3.5 24/88] [media] dib8000: make 32 bits read atomic
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (22 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 23/88] usb: option: add new zte 3g modem pids to option driver Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 25/88] serial: add support for 200 v3 series Titan card Luis Henriques
                   ` (63 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Mauro Carvalho Chehab, Luis Henriques

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

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

From: Mauro Carvalho Chehab <m.chehab@samsung.com>

commit 5ac64ba12aca3bef18e61c866583155a3bbf81c4 upstream.

As the dvb-frontend kthread can be called anytime, it can race
with some get status ioctl. So, it seems better to avoid one to
race with the other while reading a 32 bits register.
I can't see any other reason for having a mutex there at I2C, except
to provide such kind of protection, as the I2C core already has a
mutex to protect I2C transfers.

Note: instead of this approach, it could eventually remove the dib8000
specific mutex for it, and either group the 4 ops into one xfer or
to manually control the I2C mutex. The main advantage of the current
approach is that the changes are smaller and more puntual.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
[ luis: backported to 3.5:
  - file rename: drivers/media/dvb-frontends/dib8000.c ->
    drivers/media/dvb/frontends/dib8000.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/media/dvb/frontends/dib8000.c | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/drivers/media/dvb/frontends/dib8000.c b/drivers/media/dvb/frontends/dib8000.c
index 9ca34f4..0b8c1bb 100644
--- a/drivers/media/dvb/frontends/dib8000.c
+++ b/drivers/media/dvb/frontends/dib8000.c
@@ -118,15 +118,10 @@ static u16 dib8000_i2c_read16(struct i2c_device *i2c, u16 reg)
 	return ret;
 }
 
-static u16 dib8000_read_word(struct dib8000_state *state, u16 reg)
+static u16 __dib8000_read_word(struct dib8000_state *state, u16 reg)
 {
 	u16 ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
-		dprintk("could not acquire lock");
-		return 0;
-	}
-
 	state->i2c_write_buffer[0] = reg >> 8;
 	state->i2c_write_buffer[1] = reg & 0xff;
 
@@ -144,6 +139,21 @@ static u16 dib8000_read_word(struct dib8000_state *state, u16 reg)
 		dprintk("i2c read error on %d", reg);
 
 	ret = (state->i2c_read_buffer[0] << 8) | state->i2c_read_buffer[1];
+
+	return ret;
+}
+
+static u16 dib8000_read_word(struct dib8000_state *state, u16 reg)
+{
+	u16 ret;
+
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+		dprintk("could not acquire lock");
+		return 0;
+	}
+
+	ret = __dib8000_read_word(state, reg);
+
 	mutex_unlock(&state->i2c_buffer_lock);
 
 	return ret;
@@ -153,8 +163,15 @@ static u32 dib8000_read32(struct dib8000_state *state, u16 reg)
 {
 	u16 rw[2];
 
-	rw[0] = dib8000_read_word(state, reg + 0);
-	rw[1] = dib8000_read_word(state, reg + 1);
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+		dprintk("could not acquire lock");
+		return 0;
+	}
+
+	rw[0] = __dib8000_read_word(state, reg + 0);
+	rw[1] = __dib8000_read_word(state, reg + 1);
+
+	mutex_unlock(&state->i2c_buffer_lock);
 
 	return ((rw[0] << 16) | (rw[1]));
 }
-- 
1.8.3.2


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

* [PATCH 3.5 25/88] serial: add support for 200 v3 series Titan card
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (23 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 24/88] [media] dib8000: make 32 bits read atomic Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 26/88] usb: xhci: Check for XHCI_PLAT in xhci_cleanup_msix() Luis Henriques
                   ` (62 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Yegor Yefremov, Greg Kroah-Hartman, Luis Henriques

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

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

From: Yegor Yefremov <yegorslists@googlemail.com>

commit 48c0247d7b7bf58abb85a39021099529df365c4d upstream.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/tty/serial/8250/8250_pci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 41c1db3..8e581dd 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1193,6 +1193,7 @@ pci_xr17c154_setup(struct serial_private *priv,
 #define PCI_DEVICE_ID_TITAN_800E	0xA014
 #define PCI_DEVICE_ID_TITAN_200EI	0xA016
 #define PCI_DEVICE_ID_TITAN_200EISI	0xA017
+#define PCI_DEVICE_ID_TITAN_200V3	0xA306
 #define PCI_DEVICE_ID_TITAN_400V3	0xA310
 #define PCI_DEVICE_ID_TITAN_410V3	0xA312
 #define PCI_DEVICE_ID_TITAN_800V3	0xA314
@@ -3529,6 +3530,9 @@ static struct pci_device_id serial_pci_tbl[] = {
 	{	PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EISI,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_oxsemi_2_4000000 },
+	{	PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200V3,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b0_bt_2_921600 },
 	{	PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400V3,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b0_4_921600 },
-- 
1.8.3.2


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

* [PATCH 3.5 26/88] usb: xhci: Check for XHCI_PLAT in xhci_cleanup_msix()
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (24 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 25/88] serial: add support for 200 v3 series Titan card Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 27/88] x86/efi: Fix off-by-one bug in EFI Boot Services reservation Luis Henriques
                   ` (61 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Jack Pham, Sarah Sharp, Luis Henriques

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

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

From: Jack Pham <jackp@codeaurora.org>

commit 9005355af23856c55a5538c9024355785424821b upstream.

If CONFIG_PCI is enabled, make sure xhci_cleanup_msix()
doesn't try to free a bogus PCI IRQ or dereference an invalid
pci_dev when the xHCI device is actually a platform_device.

This patch should be backported to kernels as old as 3.9, that
contain the commit 52fb61250a7a132b0cfb9f4a1060a1f3c49e5a25
"xhci-plat: Don't enable legacy PCI interrupts."

Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 8ef76d2..0d4c7e4 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -315,6 +315,9 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
 	struct usb_hcd *hcd = xhci_to_hcd(xhci);
 	struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
 
+	if (xhci->quirks & XHCI_PLAT)
+		return;
+
 	xhci_free_irq(xhci);
 
 	if (xhci->msix_entries) {
-- 
1.8.3.2


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

* [PATCH 3.5 27/88] x86/efi: Fix off-by-one bug in EFI Boot Services reservation
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (25 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 26/88] usb: xhci: Check for XHCI_PLAT in xhci_cleanup_msix() Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 28/88] perf kvm: Fix kvm report without guestmount Luis Henriques
                   ` (60 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dave Young, Matt Fleming, Luis Henriques

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

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

From: Dave Young <dyoung@redhat.com>

commit a7f84f03f660d93574ac88835d056c0d6468aebe upstream.

Current code check boot service region with kernel text region by:
start+size >= __pa_symbol(_text)
The end of the above region should be start + size - 1 instead.

I see this problem in ovmf + Fedora 19 grub boot:
text start: 1000000 md start: 800000 md size: 800000

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Borislav Petkov <bp@suse.de>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/platform/efi/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 46e5387..884a437 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -432,7 +432,7 @@ void __init efi_reserve_boot_services(void)
 		 * - Not within any part of the kernel
 		 * - Not the bios reserved area
 		*/
-		if ((start+size >= virt_to_phys(_text)
+		if ((start + size > virt_to_phys(_text)
 				&& start <= virt_to_phys(_end)) ||
 			!e820_all_mapped(start, start+size, E820_RAM) ||
 			memblock_is_region_reserved(start, size)) {
-- 
1.8.3.2


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

* [PATCH 3.5 28/88] perf kvm: Fix kvm report without guestmount.
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (26 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 27/88] x86/efi: Fix off-by-one bug in EFI Boot Services reservation Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 29/88] mtd: mxc_nand: remove duplicated ecc_stats counting Luis Henriques
                   ` (59 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dongsheng Yang, David Ahern, Arnaldo Carvalho de Melo, Luis Henriques

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

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

From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>

commit ad85ace07a05062ef6b59c35a5e80b6eaee1eee6 upstream.

Currently, if we use perf kvm --guestkallsyms --guestmodules report, we
can not get the perf information from perf data file. All sample are
shown as unknown.

Reproducing steps:
	# perf kvm --guestkallsyms /tmp/kallsyms --guestmodules /tmp/modules record -a sleep 1
	[ perf record: Woken up 1 times to write data ]
	[ perf record: Captured and wrote 0.624 MB perf.data.guest (~27260 samples) ]
	# perf kvm --guestkallsyms /tmp/kallsyms --guestmodules /tmp/modules report |grep %
	   100.00%  [guest/6471]  [unknown]         [g] 0xffffffff8164f330

This bug was introduced by 207b57926 (perf kvm: Fix regression with guest machine creation).
In original code, it uses perf_session__find_machine(), it means we deliver symbol to machine
which has the same pid, if no machine found, deliver it to *default* guest. But if we use
perf_session__findnew_machine() here, if no machine was found, new machine with pid will be built
and added. Then the default guest which with pid == 0 will never get a symbol.

And because the new machine initialized here has no kernel map created, the symbol delivered to
it will be marked as "unknown".

This patch here is to revert commit 207b57926 and fix the SEGFAULT bug in another way.

Verification steps:
	# ./perf kvm --guestkallsyms /home/kallsyms --guestmodules /home/modules record -a sleep 1
	[ perf record: Woken up 1 times to write data ]
	[ perf record: Captured and wrote 0.651 MB perf.data.guest (~28437 samples) ]
	# ./perf kvm --guestkallsyms /home/kallsyms --guestmodules /home/modules report |grep %
	    22.64%    :6471  [guest.kernel.kallsyms]  [g] update_rq_clock.part.70
	    19.99%    :6471  [guest.kernel.kallsyms]  [g] d_free
	    18.46%    :6471  [guest.kernel.kallsyms]  [g] bio_phys_segments
	    16.25%    :6471  [guest.kernel.kallsyms]  [g] dequeue_task
	    12.78%    :6471  [guest.kernel.kallsyms]  [g] __switch_to
	     7.91%    :6471  [guest.kernel.kallsyms]  [g] scheduler_tick
	     1.75%    :6471  [guest.kernel.kallsyms]  [g] native_apic_mem_write
	     0.21%    :6471  [guest.kernel.kallsyms]  [g] apic_timer_interrupt

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1387564907-3045-1-git-send-email-yangds.fnst@cn.fujitsu.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 tools/perf/util/session.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 56142d0..b21bc79 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -917,6 +917,7 @@ static struct machine *
 					       union perf_event *event)
 {
 	const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
+	struct machine *machine;
 
 	if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) {
 		u32 pid;
@@ -926,7 +927,11 @@ static struct machine *
 		else
 			pid = event->ip.pid;
 
-		return perf_session__findnew_machine(session, pid);
+		machine = perf_session__find_machine(session, pid);
+		if (!machine)
+			machine = perf_session__findnew_machine(session,
+						DEFAULT_GUEST_KERNEL_ID);
+		return machine;
 	}
 
 	return perf_session__find_host_machine(session);
-- 
1.8.3.2


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

* [PATCH 3.5 29/88] mtd: mxc_nand: remove duplicated ecc_stats counting
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (27 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 28/88] perf kvm: Fix kvm report without guestmount Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 30/88] xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4) Luis Henriques
                   ` (58 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michael Grzeschik, Brian Norris, Luis Henriques

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

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

From: Michael Grzeschik <m.grzeschik@pengutronix.de>

commit 0566477762f9e174e97af347ee9c865f908a5647 upstream.

The ecc_stats.corrected count variable will already be incremented in
the above framework-layer just after this callback.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mtd/nand/mxc_nand.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 6acc790..f4e275a 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -669,7 +669,6 @@ static int mxc_nand_correct_data_v2_v3(struct mtd_info *mtd, u_char *dat,
 		ecc_stat >>= 4;
 	} while (--no_subpages);
 
-	mtd->ecc_stats.corrected += ret;
 	pr_debug("%d Symbol Correctable RS-ECC Error\n", ret);
 
 	return ret;
-- 
1.8.3.2


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

* [PATCH 3.5 30/88] xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4).
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (28 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 29/88] mtd: mxc_nand: remove duplicated ecc_stats counting Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 31/88] USB: serial: add support for iBall 3.5G connect usb modem Luis Henriques
                   ` (57 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Konrad Rzeszutek Wilk, Luis Henriques

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

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

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

commit 51c71a3bbaca868043cc45b3ad3786dd48a90235 upstream.

The user has the option of disabling the platform driver:
00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)

which is used to unplug the emulated drivers (IDE, Realtek 8169, etc)
and allow the PV drivers to take over. If the user wishes
to disable that they can set:

  xen_platform_pci=0
  (in the guest config file)

or
  xen_emul_unplug=never
  (on the Linux command line)

except it does not work properly. The PV drivers still try to
load and since the Xen platform driver is not run - and it
has not initialized the grant tables, most of the PV drivers
stumble upon:

input: Xen Virtual Keyboard as /devices/virtual/input/input5
input: Xen Virtual Pointer as /devices/virtual/input/input6M
------------[ cut here ]------------
kernel BUG at /home/konrad/ssd/konrad/linux/drivers/xen/grant-table.c:1206!
invalid opcode: 0000 [#1] SMP
Modules linked in: xen_kbdfront(+) xenfs xen_privcmd
CPU: 6 PID: 1389 Comm: modprobe Not tainted 3.13.0-rc1upstream-00021-ga6c892b-dirty #1
Hardware name: Xen HVM domU, BIOS 4.4-unstable 11/26/2013
RIP: 0010:[<ffffffff813ddc40>]  [<ffffffff813ddc40>] get_free_entries+0x2e0/0x300
Call Trace:
 [<ffffffff8150d9a3>] ? evdev_connect+0x1e3/0x240
 [<ffffffff813ddd0e>] gnttab_grant_foreign_access+0x2e/0x70
 [<ffffffffa0010081>] xenkbd_connect_backend+0x41/0x290 [xen_kbdfront]
 [<ffffffffa0010a12>] xenkbd_probe+0x2f2/0x324 [xen_kbdfront]
 [<ffffffff813e5757>] xenbus_dev_probe+0x77/0x130
 [<ffffffff813e7217>] xenbus_frontend_dev_probe+0x47/0x50
 [<ffffffff8145e9a9>] driver_probe_device+0x89/0x230
 [<ffffffff8145ebeb>] __driver_attach+0x9b/0xa0
 [<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
 [<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
 [<ffffffff8145cf1c>] bus_for_each_dev+0x8c/0xb0
 [<ffffffff8145e7d9>] driver_attach+0x19/0x20
 [<ffffffff8145e260>] bus_add_driver+0x1a0/0x220
 [<ffffffff8145f1ff>] driver_register+0x5f/0xf0
 [<ffffffff813e55c5>] xenbus_register_driver_common+0x15/0x20
 [<ffffffff813e76b3>] xenbus_register_frontend+0x23/0x40
 [<ffffffffa0015000>] ? 0xffffffffa0014fff
 [<ffffffffa001502b>] xenkbd_init+0x2b/0x1000 [xen_kbdfront]
 [<ffffffff81002049>] do_one_initcall+0x49/0x170

.. snip..

which is hardly nice. This patch fixes this by having each
PV driver check for:
 - if running in PV, then it is fine to execute (as that is their
   native environment).
 - if running in HVM, check if user wanted 'xen_emul_unplug=never',
   in which case bail out and don't load any PV drivers.
 - if running in HVM, and if PCI device 5853:0001 (xen_platform_pci)
   does not exist, then bail out and not load PV drivers.
 - (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=ide-disks',
   then bail out for all PV devices _except_ the block one.
   Ditto for the network one ('nics').
 - (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=unnecessary'
   then load block PV driver, and also setup the legacy IDE paths.
   In (v3) make it actually load PV drivers.

Reported-by: Sander Eikelenboom <linux@eikelenboom.it
Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Reported-and-Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[v2: Add extra logic to handle the myrid ways 'xen_emul_unplug'
can be used per Ian and Stefano suggestion]
[v3: Make the unnecessary case work properly]
[v4: s/disks/ide-disks/ spotted by Fabio]
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> [for PCI parts]
[ luis: backported to 3.5:
  - adjusted context
  - dropped changes to drivers/char/tpm/xen-tpmfront.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/xen/platform-pci-unplug.c         | 74 ++++++++++++++++++++++++++++++
 drivers/block/xen-blkfront.c               |  4 +-
 drivers/input/misc/xen-kbdfront.c          |  4 ++
 drivers/net/xen-netfront.c                 |  2 +-
 drivers/pci/xen-pcifront.c                 |  4 ++
 drivers/video/xen-fbfront.c                |  4 ++
 drivers/xen/xenbus/xenbus_probe_frontend.c |  2 +-
 include/xen/platform_pci.h                 | 23 ++++++++++
 8 files changed, 113 insertions(+), 4 deletions(-)

diff --git a/arch/x86/xen/platform-pci-unplug.c b/arch/x86/xen/platform-pci-unplug.c
index ffcf261..2923f51 100644
--- a/arch/x86/xen/platform-pci-unplug.c
+++ b/arch/x86/xen/platform-pci-unplug.c
@@ -68,6 +68,80 @@ static int check_platform_magic(void)
 	return 0;
 }
 
+bool xen_has_pv_devices()
+{
+	if (!xen_domain())
+		return false;
+
+	/* PV domains always have them. */
+	if (xen_pv_domain())
+		return true;
+
+	/* And user has xen_platform_pci=0 set in guest config as
+	 * driver did not modify the value. */
+	if (xen_platform_pci_unplug == 0)
+		return false;
+
+	if (xen_platform_pci_unplug & XEN_UNPLUG_NEVER)
+		return false;
+
+	if (xen_platform_pci_unplug & XEN_UNPLUG_ALL)
+		return true;
+
+	/* This is an odd one - we are going to run legacy
+	 * and PV drivers at the same time. */
+	if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY)
+		return true;
+
+	/* And the caller has to follow with xen_pv_{disk,nic}_devices
+	 * to be certain which driver can load. */
+	return false;
+}
+EXPORT_SYMBOL_GPL(xen_has_pv_devices);
+
+static bool __xen_has_pv_device(int state)
+{
+	/* HVM domains might or might not */
+	if (xen_hvm_domain() && (xen_platform_pci_unplug & state))
+		return true;
+
+	return xen_has_pv_devices();
+}
+
+bool xen_has_pv_nic_devices(void)
+{
+	return __xen_has_pv_device(XEN_UNPLUG_ALL_NICS | XEN_UNPLUG_ALL);
+}
+EXPORT_SYMBOL_GPL(xen_has_pv_nic_devices);
+
+bool xen_has_pv_disk_devices(void)
+{
+	return __xen_has_pv_device(XEN_UNPLUG_ALL_IDE_DISKS |
+				   XEN_UNPLUG_AUX_IDE_DISKS | XEN_UNPLUG_ALL);
+}
+EXPORT_SYMBOL_GPL(xen_has_pv_disk_devices);
+
+/*
+ * This one is odd - it determines whether you want to run PV _and_
+ * legacy (IDE) drivers together. This combination is only possible
+ * under HVM.
+ */
+bool xen_has_pv_and_legacy_disk_devices(void)
+{
+	if (!xen_domain())
+		return false;
+
+	/* N.B. This is only ever used in HVM mode */
+	if (xen_pv_domain())
+		return false;
+
+	if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY)
+		return true;
+
+	return false;
+}
+EXPORT_SYMBOL_GPL(xen_has_pv_and_legacy_disk_devices);
+
 void xen_unplug_emulated_devices(void)
 {
 	int r;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index e4fb337..1188f4e 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -995,7 +995,7 @@ static int blkfront_probe(struct xenbus_device *dev,
 		char *type;
 		int len;
 		/* no unplug has been done: do not hook devices != xen vbds */
-		if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY) {
+		if (xen_has_pv_and_legacy_disk_devices()) {
 			int major;
 
 			if (!VDEV_IS_EXTENDED(vdevice))
@@ -1512,7 +1512,7 @@ static int __init xlblk_init(void)
 	if (!xen_domain())
 		return -ENODEV;
 
-	if (xen_hvm_domain() && !xen_platform_pci_unplug)
+	if (!xen_has_pv_disk_devices())
 		return -ENODEV;
 
 	if (register_blkdev(XENVBD_MAJOR, DEV_NAME)) {
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
index 02ca868..521b07c5 100644
--- a/drivers/input/misc/xen-kbdfront.c
+++ b/drivers/input/misc/xen-kbdfront.c
@@ -29,6 +29,7 @@
 #include <xen/interface/io/fbif.h>
 #include <xen/interface/io/kbdif.h>
 #include <xen/xenbus.h>
+#include <xen/platform_pci.h>
 
 struct xenkbd_info {
 	struct input_dev *kbd;
@@ -377,6 +378,9 @@ static int __init xenkbd_init(void)
 	if (xen_initial_domain())
 		return -ENODEV;
 
+	if (!xen_has_pv_devices())
+		return -ENODEV;
+
 	return xenbus_register_frontend(&xenkbd_driver);
 }
 
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index b88afc7..8c7579b 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1969,7 +1969,7 @@ static int __init netif_init(void)
 	if (!xen_domain())
 		return -ENODEV;
 
-	if (xen_hvm_domain() && !xen_platform_pci_unplug)
+	if (!xen_has_pv_nic_devices())
 		return -ENODEV;
 
 	printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n");
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index d6cc62c..04d185b 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -20,6 +20,7 @@
 #include <linux/workqueue.h>
 #include <linux/bitops.h>
 #include <linux/time.h>
+#include <xen/platform_pci.h>
 
 #define INVALID_GRANT_REF (0)
 #define INVALID_EVTCHN    (-1)
@@ -1137,6 +1138,9 @@ static int __init pcifront_init(void)
 	if (!xen_pv_domain() || xen_initial_domain())
 		return -ENODEV;
 
+	if (!xen_has_pv_devices())
+		return -ENODEV;
+
 	pci_frontend_registrar(1 /* enable */);
 
 	return xenbus_register_frontend(&xenpci_driver);
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index b7f5173..3a631fb 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -35,6 +35,7 @@
 #include <xen/interface/io/fbif.h>
 #include <xen/interface/io/protocols.h>
 #include <xen/xenbus.h>
+#include <xen/platform_pci.h>
 
 struct xenfb_info {
 	unsigned char		*fb;
@@ -697,6 +698,9 @@ static int __init xenfb_init(void)
 	if (xen_initial_domain())
 		return -ENODEV;
 
+	if (!xen_has_pv_devices())
+		return -ENODEV;
+
 	return xenbus_register_frontend(&xenfb_driver);
 }
 
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
index a31b54d..840c52e 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -446,7 +446,7 @@ subsys_initcall(xenbus_probe_frontend_init);
 #ifndef MODULE
 static int __init boot_wait_for_devices(void)
 {
-	if (xen_hvm_domain() && !xen_platform_pci_unplug)
+	if (!xen_has_pv_devices())
 		return -ENODEV;
 
 	ready_to_wait_for_devices = 1;
diff --git a/include/xen/platform_pci.h b/include/xen/platform_pci.h
index 438c256..b49eeab 100644
--- a/include/xen/platform_pci.h
+++ b/include/xen/platform_pci.h
@@ -48,4 +48,27 @@ static inline int xen_must_unplug_disks(void) {
 
 extern int xen_platform_pci_unplug;
 
+#if defined(CONFIG_XEN_PVHVM)
+extern bool xen_has_pv_devices(void);
+extern bool xen_has_pv_disk_devices(void);
+extern bool xen_has_pv_nic_devices(void);
+extern bool xen_has_pv_and_legacy_disk_devices(void);
+#else
+static inline bool xen_has_pv_devices(void)
+{
+	return IS_ENABLED(CONFIG_XEN);
+}
+static inline bool xen_has_pv_disk_devices(void)
+{
+	return IS_ENABLED(CONFIG_XEN);
+}
+static inline bool xen_has_pv_nic_devices(void)
+{
+	return IS_ENABLED(CONFIG_XEN);
+}
+static inline bool xen_has_pv_and_legacy_disk_devices(void)
+{
+	return false;
+}
+#endif
 #endif /* _XEN_PLATFORM_PCI_H */
-- 
1.8.3.2


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

* [PATCH 3.5 31/88] USB: serial: add support for iBall 3.5G connect usb modem
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (29 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 30/88] xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4) Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 32/88] USB: Nokia 502 is an unusual device Luis Henriques
                   ` (56 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Rahul Bedarkar, Greg Kroah-Hartman, Luis Henriques

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

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

From: Rahul Bedarkar <rahulbedarkar89@gmail.com>

commit 7d5c1b9c7cb5ec8e52b1adc65c484a923a8ea6c3 upstream.

Add support for iBall 3.5G connect usb modem.

$lsusb
Bus 002 Device 006: ID 1c9e:9605 OMEGA TECHNOLOGY

$usb-devices
T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  6 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1c9e ProdID=9605 Rev=00.00
S:  Manufacturer=USB Modem
S:  Product=USB Modem
S:  SerialNumber=1234567890ABCDEF
C:  #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Suggested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/option.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 94af767..83b50db 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -325,6 +325,9 @@ static void option_instat_callback(struct urb *urb);
  * It seems to contain a Qualcomm QSC6240/6290 chipset            */
 #define FOUR_G_SYSTEMS_PRODUCT_W14		0x9603
 
+/* iBall 3.5G connect wireless modem */
+#define IBALL_3_5G_CONNECT			0x9605
+
 /* Zoom */
 #define ZOOM_PRODUCT_4597			0x9607
 
@@ -1520,6 +1523,7 @@ static const struct usb_device_id option_ids[] = {
   	  .driver_info = (kernel_ulong_t)&four_g_w14_blacklist
   	},
 	{ USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
+	{ USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) },
 	{ USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
 	/* Pirelli  */
 	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)},
-- 
1.8.3.2


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

* [PATCH 3.5 32/88] USB: Nokia 502 is an unusual device
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (30 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 31/88] USB: serial: add support for iBall 3.5G connect usb modem Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 33/88] USB: cypress_m8: fix ring-indicator detection and reporting Luis Henriques
                   ` (55 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mikhail Zolotaryov, Greg Kroah-Hartman, Luis Henriques

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

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

From: Mikhail Zolotaryov <lebon@lebon.org.ua>

commit 0e16114f2db4838251fb64f3b550996ad3585890 upstream.

The USB storage operation of Nokia Asha 502 Dual SIM smartphone running Asha
Platform 1.1.1 is unreliable in respect of data consistency (i.e. transfered
files are corrupted). A similar issue is described here:
http://discussions.nokia.com/t5/Asha-and-other-Nokia-Series-30/Nokia-301-USB-transfers-and-corrupted-files/td-p/1974170

The workaround is (MAX_SECTORS_64):
   rmmod usb_storage && modprobe usb_storage quirks=0421:06aa:m

The patch adds the tested device to the unusual list permanently.

Signed-off-by: Mikhail Zolotaryov <lebon@lebon.org.ua>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/storage/unusual_devs.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 7da68c4..d904c59 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -226,6 +226,13 @@ UNUSUAL_DEV(  0x0421, 0x0495, 0x0370, 0x0370,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_MAX_SECTORS_64 ),
 
+/* Patch submitted by Mikhail Zolotaryov <lebon@lebon.org.ua> */
+UNUSUAL_DEV(  0x0421, 0x06aa, 0x1110, 0x1110,
+		"Nokia",
+		"502",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_MAX_SECTORS_64 ),
+
 #ifdef NO_SDDR09
 UNUSUAL_DEV(  0x0436, 0x0005, 0x0100, 0x0100,
 		"Microtech",
-- 
1.8.3.2


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

* [PATCH 3.5 33/88] USB: cypress_m8: fix ring-indicator detection and reporting
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (31 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 32/88] USB: Nokia 502 is an unusual device Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 34/88] ALSA: rme9652: fix a missing comma in channel_map_9636_ds[] Luis Henriques
                   ` (54 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johan Hovold, Greg Kroah-Hartman, Luis Henriques

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

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

From: Johan Hovold <jhovold@gmail.com>

commit 440ebadeae9298d7de3d4d105342691841ec88d0 upstream.

Fix ring-indicator (RI) status-bit definition, which was defined as CTS,
effectively preventing RI-changes from being detected while reporting
false RI status.

This bug predates git.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/cypress_m8.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/cypress_m8.h b/drivers/usb/serial/cypress_m8.h
index b461311..ce13e61 100644
--- a/drivers/usb/serial/cypress_m8.h
+++ b/drivers/usb/serial/cypress_m8.h
@@ -63,7 +63,7 @@
 #define UART_DSR	0x20	/* data set ready - flow control - device to host */
 #define CONTROL_RTS	0x10	/* request to send - flow control - host to device */
 #define UART_CTS	0x10	/* clear to send - flow control - device to host */
-#define UART_RI		0x10	/* ring indicator - modem - device to host */
+#define UART_RI		0x80	/* ring indicator - modem - device to host */
 #define UART_CD		0x40	/* carrier detect - modem - device to host */
 #define CYP_ERROR	0x08	/* received from input report - device to host */
 /* Note - the below has nothing to do with the "feature report" reset */
-- 
1.8.3.2


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

* [PATCH 3.5 34/88] ALSA: rme9652: fix a missing comma in channel_map_9636_ds[]
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (32 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 33/88] USB: cypress_m8: fix ring-indicator detection and reporting Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 35/88] sunrpc: Fix infinite loop in RPC state machine Luis Henriques
                   ` (53 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 770bd4bf2e664939a9dacd3d26ec9ff7a3933210 upstream.

The lack of comma leads to the wrong channel for an SPDIF channel.
Unfortunately this wasn't caught by compiler because it's still a
valid expression.

Reported-by: Alexander Aristov <aristov.alexander@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/rme9652/rme9652.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index a15fc10..1b3ce88 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -285,7 +285,7 @@ static char channel_map_9636_ds[26] = {
 	/* ADAT channels are remapped */
 	1, 3, 5, 7, 9, 11, 13, 15,
 	/* channels 8 and 9 are S/PDIF */
-	24, 25
+	24, 25,
 	/* others don't exist */
 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
 };
-- 
1.8.3.2


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

* [PATCH 3.5 35/88] sunrpc: Fix infinite loop in RPC state machine
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (33 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 34/88] ALSA: rme9652: fix a missing comma in channel_map_9636_ds[] Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 36/88] spidev: fix hang when transfer_one_message fails Luis Henriques
                   ` (52 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Weston Andros Adamson, Trond Myklebust, Luis Henriques

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

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

From: Weston Andros Adamson <dros@netapp.com>

commit 6ff33b7dd0228b7d7ed44791bbbc98b03fd15d9d upstream.

When a task enters call_refreshresult with status 0 from call_refresh and
!rpcauth_uptodatecred(task) it enters call_refresh again with no rate-limiting
or max number of retries.

Instead of trying forever, make use of the retry path that other errors use.

This only seems to be possible when the crrefresh callback is gss_refresh_null,
which only happens when destroying the context.

To reproduce:

1) mount with sec=krb5 (or sec=sys with krb5 negotiated for non FSID specific
   operations).

2) reboot - the client will be stuck and will need to be hard rebooted

BUG: soft lockup - CPU#0 stuck for 22s! [kworker/0:2:46]
Modules linked in: rpcsec_gss_krb5 nfsv4 nfs fscache ppdev crc32c_intel aesni_intel aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd serio_raw i2c_piix4 i2c_core e1000 parport_pc parport shpchp nfsd auth_rpcgss oid_registry exportfs nfs_acl lockd sunrpc autofs4 mptspi scsi_transport_spi mptscsih mptbase ata_generic floppy
irq event stamp: 195724
hardirqs last  enabled at (195723): [<ffffffff814a925c>] restore_args+0x0/0x30
hardirqs last disabled at (195724): [<ffffffff814b0a6a>] apic_timer_interrupt+0x6a/0x80
softirqs last  enabled at (195722): [<ffffffff8103f583>] __do_softirq+0x1df/0x276
softirqs last disabled at (195717): [<ffffffff8103f852>] irq_exit+0x53/0x9a
CPU: 0 PID: 46 Comm: kworker/0:2 Not tainted 3.13.0-rc3-branch-dros_testing+ #4
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013
Workqueue: rpciod rpc_async_schedule [sunrpc]
task: ffff8800799c4260 ti: ffff880079002000 task.ti: ffff880079002000
RIP: 0010:[<ffffffffa0064fd4>]  [<ffffffffa0064fd4>] __rpc_execute+0x8a/0x362 [sunrpc]
RSP: 0018:ffff880079003d18  EFLAGS: 00000246
RAX: 0000000000000005 RBX: 0000000000000007 RCX: 0000000000000007
RDX: 0000000000000007 RSI: ffff88007aecbae8 RDI: ffff8800783d8900
RBP: ffff880079003d78 R08: ffff88006e30e9f8 R09: ffffffffa005a3d7
R10: ffff88006e30e7b0 R11: ffff8800783d8900 R12: ffffffffa006675e
R13: ffff880079003ce8 R14: ffff88006e30e7b0 R15: ffff8800783d8900
FS:  0000000000000000(0000) GS:ffff88007f200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3072333000 CR3: 0000000001a0b000 CR4: 00000000001407f0
Stack:
 ffff880079003d98 0000000000000246 0000000000000000 ffff88007a9a4830
 ffff880000000000 ffffffff81073f47 ffff88007f212b00 ffff8800799c4260
 ffff8800783d8988 ffff88007f212b00 ffffe8ffff604800 0000000000000000
Call Trace:
 [<ffffffff81073f47>] ? trace_hardirqs_on_caller+0x145/0x1a1
 [<ffffffffa00652d3>] rpc_async_schedule+0x27/0x32 [sunrpc]
 [<ffffffff81052974>] process_one_work+0x211/0x3a5
 [<ffffffff810528d5>] ? process_one_work+0x172/0x3a5
 [<ffffffff81052eeb>] worker_thread+0x134/0x202
 [<ffffffff81052db7>] ? rescuer_thread+0x280/0x280
 [<ffffffff81052db7>] ? rescuer_thread+0x280/0x280
 [<ffffffff810584a0>] kthread+0xc9/0xd1
 [<ffffffff810583d7>] ? __kthread_parkme+0x61/0x61
 [<ffffffff814afd6c>] ret_from_fork+0x7c/0xb0
 [<ffffffff810583d7>] ? __kthread_parkme+0x61/0x61
Code: e8 87 63 fd e0 c6 05 10 dd 01 00 01 48 8b 43 70 4c 8d 6b 70 45 31 e4 a8 02 0f 85 d5 02 00 00 4c 8b 7b 48 48 c7 43 48 00 00 00 00 <4c> 8b 4b 50 4d 85 ff 75 0c 4d 85 c9 4d 89 cf 0f 84 32 01 00 00

And the output of "rpcdebug -m rpc -s all":

RPC:    61 call_refresh (status 0)
RPC:    61 call_refresh (status 0)
RPC:    61 refreshing RPCSEC_GSS cred ffff88007a413cf0
RPC:    61 refreshing RPCSEC_GSS cred ffff88007a413cf0
RPC:    61 call_refreshresult (status 0)
RPC:    61 refreshing RPCSEC_GSS cred ffff88007a413cf0
RPC:    61 call_refreshresult (status 0)
RPC:    61 refreshing RPCSEC_GSS cred ffff88007a413cf0
RPC:    61 call_refresh (status 0)
RPC:    61 call_refreshresult (status 0)
RPC:    61 call_refresh (status 0)
RPC:    61 call_refresh (status 0)
RPC:    61 refreshing RPCSEC_GSS cred ffff88007a413cf0
RPC:    61 call_refreshresult (status 0)
RPC:    61 call_refresh (status 0)
RPC:    61 refreshing RPCSEC_GSS cred ffff88007a413cf0
RPC:    61 call_refresh (status 0)
RPC:    61 refreshing RPCSEC_GSS cred ffff88007a413cf0
RPC:    61 refreshing RPCSEC_GSS cred ffff88007a413cf0
RPC:    61 call_refreshresult (status 0)
RPC:    61 call_refresh (status 0)
RPC:    61 call_refresh (status 0)
RPC:    61 call_refresh (status 0)
RPC:    61 call_refresh (status 0)
RPC:    61 call_refreshresult (status 0)
RPC:    61 refreshing RPCSEC_GSS cred ffff88007a413cf0

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/sunrpc/clnt.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 46b5fb6..c119c1b 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1334,9 +1334,13 @@ call_refreshresult(struct rpc_task *task)
 	task->tk_action = call_refresh;
 	switch (status) {
 	case 0:
-		if (rpcauth_uptodatecred(task))
+		if (rpcauth_uptodatecred(task)) {
 			task->tk_action = call_allocate;
-		return;
+			return;
+		}
+		/* Use rate-limiting and a max number of retries if refresh
+		 * had status 0 but failed to update the cred.
+		 */
 	case -ETIMEDOUT:
 		rpc_delay(task, 3*HZ);
 	case -EAGAIN:
-- 
1.8.3.2


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

* [PATCH 3.5 36/88] spidev: fix hang when transfer_one_message fails
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (34 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 35/88] sunrpc: Fix infinite loop in RPC state machine Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 18:17   ` Daniel Santos
  2014-02-07 11:22 ` [PATCH 3.5 37/88] dm thin: initialize dm_thin_new_mapping returned by get_next_mapping Luis Henriques
                   ` (51 subsequent siblings)
  87 siblings, 1 reply; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Santos, Mark Brown, Luis Henriques

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

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

From: Daniel Santos <daniel.santos@pobox.com>

commit e120cc0dcf2880a4c5c0a6cb27b655600a1cfa1d upstream.

This corrects a problem in spi_pump_messages() that leads to an spi
message hanging forever when a call to transfer_one_message() fails.
This failure occurs in my MCP2210 driver when the cs_change bit is set
on the last transfer in a message, an operation which the hardware does
not support.

Rationale
Since the transfer_one_message() returns an int, we must presume that it
may fail.  If transfer_one_message() should never fail, it should return
void.  Thus, calls to transfer_one_message() should properly manage a
failure.

Fixes: ffbbdd21329f3 (spi: create a message queueing infrastructure)
Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/spi/spi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 1041cb8..40f528b 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -574,7 +574,9 @@ static void spi_pump_messages(struct kthread_work *work)
 	ret = master->transfer_one_message(master, master->cur_msg);
 	if (ret) {
 		dev_err(&master->dev,
-			"failed to transfer one message from queue\n");
+			"failed to transfer one message from queue: %d\n", ret);
+		master->cur_msg->status = ret;
+		spi_finalize_current_message(master);
 		return;
 	}
 }
-- 
1.8.3.2


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

* [PATCH 3.5 37/88] dm thin: initialize dm_thin_new_mapping returned by get_next_mapping
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (35 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 36/88] spidev: fix hang when transfer_one_message fails Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 38/88] SELinux: Fix memory leak upon loading policy Luis Henriques
                   ` (50 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Mike Snitzer, Luis Henriques

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

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

From: Mike Snitzer <snitzer@redhat.com>

commit 16961b042db8cc5cf75d782b4255193ad56e1d4f upstream.

As additional members are added to the dm_thin_new_mapping structure
care should be taken to make sure they get initialized before use.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/dm-thin.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 7ef83d9..a9bac03 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -964,13 +964,17 @@ static int ensure_next_mapping(struct pool *pool)
 
 static struct dm_thin_new_mapping *get_next_mapping(struct pool *pool)
 {
-	struct dm_thin_new_mapping *r = pool->next_mapping;
+	struct dm_thin_new_mapping *m = pool->next_mapping;
 
 	BUG_ON(!pool->next_mapping);
 
+	memset(m, 0, sizeof(struct dm_thin_new_mapping));
+	INIT_LIST_HEAD(&m->list);
+	m->bio = NULL;
+
 	pool->next_mapping = NULL;
 
-	return r;
+	return m;
 }
 
 static void schedule_copy(struct thin_c *tc, dm_block_t virt_block,
@@ -982,15 +986,10 @@ static void schedule_copy(struct thin_c *tc, dm_block_t virt_block,
 	struct pool *pool = tc->pool;
 	struct dm_thin_new_mapping *m = get_next_mapping(pool);
 
-	INIT_LIST_HEAD(&m->list);
-	m->quiesced = 0;
-	m->prepared = 0;
 	m->tc = tc;
 	m->virt_block = virt_block;
 	m->data_block = data_dest;
 	m->cell = cell;
-	m->err = 0;
-	m->bio = NULL;
 
 	if (!ds_add_work(&pool->shared_read_ds, &m->list))
 		m->quiesced = 1;
@@ -1052,15 +1051,12 @@ static void schedule_zero(struct thin_c *tc, dm_block_t virt_block,
 	struct pool *pool = tc->pool;
 	struct dm_thin_new_mapping *m = get_next_mapping(pool);
 
-	INIT_LIST_HEAD(&m->list);
 	m->quiesced = 1;
 	m->prepared = 0;
 	m->tc = tc;
 	m->virt_block = virt_block;
 	m->data_block = data_block;
 	m->cell = cell;
-	m->err = 0;
-	m->bio = NULL;
 
 	/*
 	 * If the whole block of data is being overwritten or we are not
@@ -1224,7 +1220,6 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
 			m->data_block = lookup_result.block;
 			m->cell = cell;
 			m->cell2 = cell2;
-			m->err = 0;
 			m->bio = bio;
 
 			if (!ds_add_work(&pool->all_io_ds, &m->list)) {
-- 
1.8.3.2


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

* [PATCH 3.5 38/88] SELinux: Fix memory leak upon loading policy
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (36 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 37/88] dm thin: initialize dm_thin_new_mapping returned by get_next_mapping Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 39/88] drm/radeon: warn users when hw_i2c is enabled (v2) Luis Henriques
                   ` (49 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tetsuo Handa, Paul Moore, Luis Henriques

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

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

From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>

commit 8ed814602876bec9bad2649ca17f34b499357a1c upstream.

Hello.

I got below leak with linux-3.10.0-54.0.1.el7.x86_64 .

[  681.903890] kmemleak: 5538 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

Below is a patch, but I don't know whether we need special handing for undoing
ebitmap_set_bit() call.
----------
>>From fe97527a90fe95e2239dfbaa7558f0ed559c0992 Mon Sep 17 00:00:00 2001
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: Mon, 6 Jan 2014 16:30:21 +0900
Subject: [PATCH] SELinux: Fix memory leak upon loading policy

Commit 2463c26d "SELinux: put name based create rules in a hashtable" did not
check return value from hashtab_insert() in filename_trans_read(). It leaks
memory if hashtab_insert() returns error.

  unreferenced object 0xffff88005c9160d0 (size 8):
    comm "systemd", pid 1, jiffies 4294688674 (age 235.265s)
    hex dump (first 8 bytes):
      57 0b 00 00 6b 6b 6b a5                          W...kkk.
    backtrace:
      [<ffffffff816604ae>] kmemleak_alloc+0x4e/0xb0
      [<ffffffff811cba5e>] kmem_cache_alloc_trace+0x12e/0x360
      [<ffffffff812aec5d>] policydb_read+0xd1d/0xf70
      [<ffffffff812b345c>] security_load_policy+0x6c/0x500
      [<ffffffff812a623c>] sel_write_load+0xac/0x750
      [<ffffffff811eb680>] vfs_write+0xc0/0x1f0
      [<ffffffff811ec08c>] SyS_write+0x4c/0xa0
      [<ffffffff81690419>] system_call_fastpath+0x16/0x1b
      [<ffffffffffffffff>] 0xffffffffffffffff

However, we should not return EEXIST error to the caller, or the systemd will
show below message and the boot sequence freezes.

  systemd[1]: Failed to load SELinux policy. Freezing.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 security/selinux/ss/policydb.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 9cd9b7c..142a59f 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -1941,7 +1941,19 @@ static int filename_trans_read(struct policydb *p, void *fp)
 		if (rc)
 			goto out;
 
-		hashtab_insert(p->filename_trans, ft, otype);
+		rc = hashtab_insert(p->filename_trans, ft, otype);
+		if (rc) {
+			/*
+			 * Do not return -EEXIST to the caller, or the system
+			 * will not boot.
+			 */
+			if (rc != -EEXIST)
+				goto out;
+			/* But free memory to avoid memory leak. */
+			kfree(ft);
+			kfree(name);
+			kfree(otype);
+		}
 	}
 	hash_eval(p->filename_trans, "filenametr");
 	return 0;
-- 
1.8.3.2


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

* [PATCH 3.5 39/88] drm/radeon: warn users when hw_i2c is enabled (v2)
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (37 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 38/88] SELinux: Fix memory leak upon loading policy Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 40/88] USB: ftdi_sio: added CS5 quirk for broken smartcard readers Luis Henriques
                   ` (48 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

From: Alex Deucher <alexander.deucher@amd.com>

commit d195178297de9a91246519dbfa98952b70f9a9b6 upstream.

The hw i2c engines are disabled by default as the
current implementation is still experimental.  Print
a warning when users enable it so that it's obvious
when the option is enabled.

v2: check for non-0 rather than 1

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_i2c.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c
index 6076e85..19d68c5 100644
--- a/drivers/gpu/drm/radeon/radeon_i2c.c
+++ b/drivers/gpu/drm/radeon/radeon_i2c.c
@@ -1020,6 +1020,9 @@ void radeon_i2c_destroy(struct radeon_i2c_chan *i2c)
 /* Add the default buses */
 void radeon_i2c_init(struct radeon_device *rdev)
 {
+	if (radeon_hw_i2c)
+		DRM_INFO("hw_i2c forced on, you may experience display detection problems!\n");
+
 	if (rdev->is_atom_bios)
 		radeon_atombios_i2c_init(rdev);
 	else
-- 
1.8.3.2


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

* [PATCH 3.5 40/88] USB: ftdi_sio: added CS5 quirk for broken smartcard readers
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (38 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 39/88] drm/radeon: warn users when hw_i2c is enabled (v2) Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 41/88] serial: 8250: enable UART_BUG_NOMSR for Tegra Luis Henriques
                   ` (47 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Colin Leitner, Johan Hovold, Greg Kroah-Hartman, Luis Henriques

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

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

From: Colin Leitner <colin.leitner@googlemail.com>

commit c1f15196ac3b541d084dc80a8fbd8a74c6a0bd44 upstream.

Genuine FTDI chips support only CS7/8. A previous fix in commit
8704211f65a2 ("USB: ftdi_sio: fixed handling of unsupported CSIZE
setting") enforced this limitation and reported it back to userspace.

However, certain types of smartcard readers depend on specific
driver behaviour that requests 0 data bits (not 5) to change into a
different operating mode if CS5 has been set.

This patch reenables this behaviour for all FTDI devices.

Tagged to be added to stable, because it affects a lot of users of
embedded systems which rely on these readers to work properly.

Reported-by: Heinrich Siebmanns <H.Siebmanns@t-online.de>
Tested-by: Heinrich Siebmanns <H.Siebmanns@t-online.de>
Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.5:
  - adjusted context
  - replace dev_dbg() by dbg() ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/ftdi_sio.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 947da9d..82c392f 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2162,10 +2162,20 @@ static void ftdi_set_termios(struct tty_struct *tty,
 	}
 
 	/*
-	 * All FTDI UART chips are limited to CS7/8. We won't pretend to
+	 * All FTDI UART chips are limited to CS7/8. We shouldn't pretend to
 	 * support CS5/6 and revert the CSIZE setting instead.
+	 *
+	 * CS5 however is used to control some smartcard readers which abuse
+	 * this limitation to switch modes. Original FTDI chips fall back to
+	 * eight data bits.
+	 *
+	 * TODO: Implement a quirk to only allow this with mentioned
+	 *       readers. One I know of (Argolis Smartreader V1)
+	 *       returns "USB smartcard server" as iInterface string.
+	 *       The vendor didn't bother with a custom VID/PID of
+	 *       course.
 	 */
-	if ((C_CSIZE(tty) != CS8) && (C_CSIZE(tty) != CS7)) {
+	if (C_CSIZE(tty) == CS6) {
 		dev_warn(&port->dev, "requested CSIZE setting not supported\n");
 
 		termios->c_cflag &= ~CSIZE;
@@ -2212,6 +2222,9 @@ no_skip:
 		urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE;
 	}
 	switch (cflag & CSIZE) {
+	case CS5:
+		dbg("Setting CS5 quirk\n");
+		break;
 	case CS7:
 		urb_value |= 7;
 		dbg("Setting CS7\n");
-- 
1.8.3.2


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

* [PATCH 3.5 41/88] serial: 8250: enable UART_BUG_NOMSR for Tegra
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (39 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 40/88] USB: ftdi_sio: added CS5 quirk for broken smartcard readers Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 42/88] dm: wait until embedded kobject is released before destroying a device Luis Henriques
                   ` (46 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Stephen Warren, Greg Kroah-Hartman, Luis Henriques

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

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

From: Stephen Warren <swarren@nvidia.com>

commit 3685f19e07802ec4207b52465c408f185b66490e upstream.

Tegra chips have 4 or 5 identical UART modules embedded. UARTs C..E have
their MODEM-control signals tied off to a static state. However UARTs A
and B can optionally route those signals to/from package pins, depending
on the exact pinmux configuration.

When these signals are not routed to package pins, false interrupts may
trigger either temporarily, or permanently, all while not showing up in
the IIR; it will read as NO_INT. This will eventually lead to the UART
IRQ being disabled due to unhandled interrupts. When this happens, the
kernel may print e.g.:

    irq 68: nobody cared (try booting with the "irqpoll" option)

In order to prevent this, enable UART_BUG_NOMSR. This prevents
UART_IER_MSI from being enabled, which prevents the false interrupts
from triggering.

In practice, this is not needed under any of the following conditions:

* On Tegra chips after Tegra30, since the HW bug has apparently been
  fixed.

* On UARTs C..E since their MODEM control signals are tied to the correct
  static state which doesn't trigger the issue.

* On UARTs A..B if the MODEM control signals are routed out to package
  pins, since they will then carry valid signals.

However, we ignore these exceptions for now, since they are only relevant
if a board actually hooks up more than a 4-wire UART, and no currently
supported board does this. If we ever support a board that does, we can
refine the algorithm that enables UART_BUG_NOMSR to take those exceptions
into account, and/or read a flag from DT/... that indicates that the
board has hooked up and pinmux'd more than a 4-wire UART.

Reported-by: Olof Johansson <olof@lixom.net> # autotester
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.5:
  - file rename: 8250_core.c -> 8250.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/tty/serial/8250/8250.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index d9e2594..899c2b9 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -2615,6 +2615,10 @@ static void serial8250_config_port(struct uart_port *port, int flags)
 	if (port->type == PORT_16550A && port->iotype == UPIO_AU)
 		up->bugs |= UART_BUG_NOMSR;
 
+	/* HW bugs may trigger IRQ while IIR == NO_INT */
+	if (port->type == PORT_TEGRA)
+		up->bugs |= UART_BUG_NOMSR;
+
 	if (port->type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
 		autoconfig_irq(up);
 
-- 
1.8.3.2


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

* [PATCH 3.5 42/88] dm: wait until embedded kobject is released before destroying a device
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (40 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 41/88] serial: 8250: enable UART_BUG_NOMSR for Tegra Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 43/88] dm space map common: make sure new space is used during extend Luis Henriques
                   ` (45 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mikulas Patocka, Mike Snitzer, Luis Henriques

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

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

From: Mikulas Patocka <mpatocka@redhat.com>

commit be35f486108227e10fe5d96fd42fb2b344c59983 upstream.

There may be other parts of the kernel holding a reference on the dm
kobject.  We must wait until all references are dropped before
deallocating the mapped_device structure.

The dm_kobject_release method signals that all references are dropped
via completion.  But dm_kobject_release doesn't free the kobject (which
is embedded in the mapped_device structure).

This is the sequence of operations:
* when destroying a DM device, call kobject_put from dm_sysfs_exit
* wait until all users stop using the kobject, when it happens the
  release method is called
* the release method signals the completion and should return without
  delay
* the dm device removal code that waits on the completion continues
* the dm device removal code drops the dm_mod reference the device had
* the dm device removal code frees the mapped_device structure that
  contains the kobject

Using kobject this way should avoid the module unload race that was
mentioned at the beginning of this thread:
https://lkml.org/lkml/2014/1/4/83

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/dm-sysfs.c | 10 +++++++++-
 drivers/md/dm.c       | 11 +++++++++++
 drivers/md/dm.h       |  2 ++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-sysfs.c b/drivers/md/dm-sysfs.c
index 84d2b91..e0cc5d6 100644
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -79,6 +79,11 @@ static const struct sysfs_ops dm_sysfs_ops = {
 	.show	= dm_attr_show,
 };
 
+static void dm_kobject_release(struct kobject *kobj)
+{
+	complete(dm_get_completion_from_kobject(kobj));
+}
+
 /*
  * dm kobject is embedded in mapped_device structure
  * no need to define release function here
@@ -86,6 +91,7 @@ static const struct sysfs_ops dm_sysfs_ops = {
 static struct kobj_type dm_ktype = {
 	.sysfs_ops	= &dm_sysfs_ops,
 	.default_attrs	= dm_attrs,
+	.release	= dm_kobject_release,
 };
 
 /*
@@ -104,5 +110,7 @@ int dm_sysfs_init(struct mapped_device *md)
  */
 void dm_sysfs_exit(struct mapped_device *md)
 {
-	kobject_put(dm_kobject(md));
+	struct kobject *kobj = dm_kobject(md);
+	kobject_put(kobj);
+	wait_for_completion(dm_get_completion_from_kobject(kobj));
 }
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 9a7290b..062f89a 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -194,6 +194,9 @@ struct mapped_device {
 	/* sysfs handle */
 	struct kobject kobj;
 
+	/* wait until the kobject is released */
+	struct completion kobj_completion;
+
 	/* zero-length flush that will be cloned and submitted to targets */
 	struct bio flush_bio;
 };
@@ -1898,6 +1901,7 @@ static struct mapped_device *alloc_dev(int minor)
 	init_waitqueue_head(&md->wait);
 	INIT_WORK(&md->work, dm_wq_work);
 	init_waitqueue_head(&md->eventq);
+	init_completion(&md->kobj_completion);
 
 	md->disk->major = _major;
 	md->disk->first_minor = minor;
@@ -2712,6 +2716,13 @@ struct mapped_device *dm_get_from_kobject(struct kobject *kobj)
 	return md;
 }
 
+struct completion *dm_get_completion_from_kobject(struct kobject *kobj)
+{
+	struct mapped_device *md = container_of(kobj, struct mapped_device, kobj);
+
+	return &md->kobj_completion;
+}
+
 int dm_suspended_md(struct mapped_device *md)
 {
 	return test_bit(DMF_SUSPENDED, &md->flags);
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index b7dacd5..1174e96 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -15,6 +15,7 @@
 #include <linux/list.h>
 #include <linux/blkdev.h>
 #include <linux/hdreg.h>
+#include <linux/completion.h>
 
 /*
  * Suspend feature flags
@@ -123,6 +124,7 @@ int dm_sysfs_init(struct mapped_device *md);
 void dm_sysfs_exit(struct mapped_device *md);
 struct kobject *dm_kobject(struct mapped_device *md);
 struct mapped_device *dm_get_from_kobject(struct kobject *kobj);
+struct completion *dm_get_completion_from_kobject(struct kobject *kobj);
 
 /*
  * Targets for linear and striped mappings
-- 
1.8.3.2


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

* [PATCH 3.5 43/88] dm space map common: make sure new space is used during extend
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (41 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 42/88] dm: wait until embedded kobject is released before destroying a device Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 44/88] ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant Luis Henriques
                   ` (44 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Joe Thornber, Mike Snitzer, Luis Henriques

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

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

From: Joe Thornber <ejt@redhat.com>

commit 12c91a5c2d2a8e8cc40a9552313e1e7b0a2d9ee3 upstream.

When extending a low level space map we should update nr_blocks at
the start so the new space is used for the index entries.

Otherwise extend can fail, e.g.: sm_metadata_extend call sequence
that fails:
 -> sm_ll_extend
    -> dm_tm_new_block -> dm_sm_new_block -> sm_bootstrap_new_block
    => returns -ENOSPC because smm->begin == smm->ll.nr_blocks

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/persistent-data/dm-space-map-common.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/md/persistent-data/dm-space-map-common.c b/drivers/md/persistent-data/dm-space-map-common.c
index ff3beed..79c02d9 100644
--- a/drivers/md/persistent-data/dm-space-map-common.c
+++ b/drivers/md/persistent-data/dm-space-map-common.c
@@ -244,6 +244,10 @@ int sm_ll_extend(struct ll_disk *ll, dm_block_t extra_blocks)
 		return -EINVAL;
 	}
 
+	/*
+	 * We need to set this before the dm_tm_new_block() call below.
+	 */
+	ll->nr_blocks = nr_blocks;
 	for (i = old_blocks; i < blocks; i++) {
 		struct dm_block *b;
 		struct disk_index_entry idx;
@@ -251,6 +255,7 @@ int sm_ll_extend(struct ll_disk *ll, dm_block_t extra_blocks)
 		r = dm_tm_new_block(ll->tm, &dm_sm_bitmap_validator, &b);
 		if (r < 0)
 			return r;
+
 		idx.blocknr = cpu_to_le64(dm_block_location(b));
 
 		r = dm_tm_unlock(ll->tm, b);
@@ -265,7 +270,6 @@ int sm_ll_extend(struct ll_disk *ll, dm_block_t extra_blocks)
 			return r;
 	}
 
-	ll->nr_blocks = nr_blocks;
 	return 0;
 }
 
-- 
1.8.3.2


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

* [PATCH 3.5 44/88] ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (42 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 43/88] dm space map common: make sure new space is used during extend Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 45/88] radeon/pm: Guard access to rdev->pm.power_state array Luis Henriques
                   ` (43 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lars-Peter Clausen, Mark Brown, Luis Henriques

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

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

From: Lars-Peter Clausen <lars@metafoo.de>

commit e20970ada3f699c113fe64b04492af083d11a7d8 upstream.

The driver defines ADAU1701_SEROCTL_WORD_LEN_16 as 0x10 while it should be b10,
so 0x2. This patch fixes it.

Reported-by: Magnus Reftel <magnus.reftel@lockless.no>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/codecs/adau1701.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index 3d50fc8..347f455 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -64,7 +64,7 @@
 
 #define ADAU1701_SEROCTL_WORD_LEN_24	0x0000
 #define ADAU1701_SEROCTL_WORD_LEN_20	0x0001
-#define ADAU1701_SEROCTL_WORD_LEN_16	0x0010
+#define ADAU1701_SEROCTL_WORD_LEN_16	0x0002
 #define ADAU1701_SEROCTL_WORD_LEN_MASK	0x0003
 
 #define ADAU1701_AUXNPOW_VBPD		0x40
-- 
1.8.3.2


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

* [PATCH 3.5 45/88] radeon/pm: Guard access to rdev->pm.power_state array
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (43 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 44/88] ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 46/88] drm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID Luis Henriques
                   ` (42 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michel Dänzer, Alex Deucher, Luis Henriques

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

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

From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>

commit 370169516e736edad3b3c5aa49858058f8b55195 upstream.

It's never allocated on systems without an ATOMBIOS or COMBIOS ROM.

Should fix an oops I encountered while resetting the GPU after a lockup
on my PowerBook with an RV350.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_pm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index c7f3d6c..bb51395 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -575,8 +575,10 @@ void radeon_pm_resume(struct radeon_device *rdev)
 	rdev->pm.current_clock_mode_index = 0;
 	rdev->pm.current_sclk = rdev->pm.default_sclk;
 	rdev->pm.current_mclk = rdev->pm.default_mclk;
-	rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
-	rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.vddci;
+	if (rdev->pm.power_state) {
+		rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
+		rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.vddci;
+	}
 	if (rdev->pm.pm_method == PM_METHOD_DYNPM
 	    && rdev->pm.dynpm_state == DYNPM_STATE_SUSPENDED) {
 		rdev->pm.dynpm_state = DYNPM_STATE_ACTIVE;
-- 
1.8.3.2


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

* [PATCH 3.5 46/88] drm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (44 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 45/88] radeon/pm: Guard access to rdev->pm.power_state array Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 47/88] staging: r8712u: Set device type to wlan Luis Henriques
                   ` (41 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marek Olšák, Alex Deucher, Luis Henriques

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

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

From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com>

commit 56492e0fac2dbaf7735ffd66b206a90624917789 upstream.

This fixes a bug which was causing rejections of valid GPU commands
from userspace.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/evergreen_cs.c | 5 ++++-
 drivers/gpu/drm/radeon/r600_cs.c      | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c
index 4324c0d..64bc1fa 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -942,7 +942,10 @@ static int evergreen_cs_track_check(struct radeon_cs_parser *p)
 	if (track->cb_dirty) {
 		tmp = track->cb_target_mask;
 		for (i = 0; i < 8; i++) {
-			if ((tmp >> (i * 4)) & 0xF) {
+			u32 format = G_028C70_FORMAT(track->cb_color_info[i]);
+
+			if (format != V_028C70_COLOR_INVALID &&
+			    (tmp >> (i * 4)) & 0xF) {
 				/* at least one component is enabled */
 				if (track->cb_color_bo[i] == NULL) {
 					dev_warn(p->dev, "%s:%d mask 0x%08X | 0x%08X no cb for %d\n",
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index c05e88a..d11c75e 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -747,7 +747,10 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
 	if (track->cb_dirty) {
 		tmp = track->cb_target_mask;
 		for (i = 0; i < 8; i++) {
-			if ((tmp >> (i * 4)) & 0xF) {
+			u32 format = G_0280A0_FORMAT(track->cb_color_info[i]);
+
+			if (format != V_0280A0_COLOR_INVALID &&
+			    (tmp >> (i * 4)) & 0xF) {
 				/* at least one component is enabled */
 				if (track->cb_color_bo[i] == NULL) {
 					dev_warn(p->dev, "%s:%d mask 0x%08X | 0x%08X no cb for %d\n",
-- 
1.8.3.2


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

* [PATCH 3.5 47/88] staging: r8712u: Set device type to wlan
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (45 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 46/88] drm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 48/88] ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks Luis Henriques
                   ` (40 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit 3a21f00a5002b14e4aab52aef59d33ed28468a13 upstream.

The latest version of NetworkManager does not recognize the device as wireless
without this change.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/staging/rtl8712/usb_intf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index 1bc8097..d998c2f 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -361,6 +361,10 @@ static u8 key_2char2num(u8 hch, u8 lch)
 	return (hex_to_bin(hch) << 4) | hex_to_bin(lch);
 }
 
+static const struct device_type wlan_type = {
+	.name = "wlan",
+};
+
 /*
  * drv_init() - a device potentially for us
  *
@@ -396,6 +400,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
 	padapter->pusb_intf = pusb_intf;
 	usb_set_intfdata(pusb_intf, pnetdev);
 	SET_NETDEV_DEV(pnetdev, &pusb_intf->dev);
+	pnetdev->dev.type = &wlan_type;
 	/* step 2. */
 	padapter->dvobj_init = &r8712_usb_dvobj_init;
 	padapter->dvobj_deinit = &r8712_usb_dvobj_deinit;
-- 
1.8.3.2


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

* [PATCH 3.5 48/88] ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (46 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 47/88] staging: r8712u: Set device type to wlan Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 49/88] mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA Luis Henriques
                   ` (39 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 80ab8eae70e51d578ebbeb228e0f7a562471b8b7 upstream.

The PCI devices with DMA masks smaller than 32bit should enable
CONFIG_ZONE_DMA.  Since the recent change of page allocator, page
allocations via dma_alloc_coherent() with the limited DMA mask bits
may fail more frequently, ended up with no available buffers, when
CONFIG_ZONE_DMA isn't enabled.  With CONFIG_ZONE_DMA, the system has
much more chance to obtain such pages.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=68221
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/Kconfig | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index ff3af6e..1ae4c03 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -30,6 +30,7 @@ config SND_ALS300
 	select SND_PCM
 	select SND_AC97_CODEC
 	select SND_OPL3_LIB
+	select ZONE_DMA
 	help
 	  Say 'Y' or 'M' to include support for Avance Logic ALS300/ALS300+
 
@@ -54,6 +55,7 @@ config SND_ALI5451
 	tristate "ALi M5451 PCI Audio Controller"
 	select SND_MPU401_UART
 	select SND_AC97_CODEC
+	select ZONE_DMA
 	help
 	  Say Y here to include support for the integrated AC97 sound
 	  device on motherboards using the ALi M5451 Audio Controller
@@ -158,6 +160,7 @@ config SND_AZT3328
 	select SND_PCM
 	select SND_RAWMIDI
 	select SND_AC97_CODEC
+	select ZONE_DMA
 	help
 	  Say Y here to include support for Aztech AZF3328 (PCI168)
 	  soundcards.
@@ -463,6 +466,7 @@ config SND_EMU10K1
 	select SND_HWDEP
 	select SND_RAWMIDI
 	select SND_AC97_CODEC
+	select ZONE_DMA
 	help
 	  Say Y to include support for Sound Blaster PCI 512, Live!,
 	  Audigy and E-mu APS (partially supported) soundcards.
@@ -478,6 +482,7 @@ config SND_EMU10K1X
 	tristate "Emu10k1X (Dell OEM Version)"
 	select SND_AC97_CODEC
 	select SND_RAWMIDI
+	select ZONE_DMA
 	help
 	  Say Y here to include support for the Dell OEM version of the
 	  Sound Blaster Live!.
@@ -511,6 +516,7 @@ config SND_ES1938
 	select SND_OPL3_LIB
 	select SND_MPU401_UART
 	select SND_AC97_CODEC
+	select ZONE_DMA
 	help
 	  Say Y here to include support for soundcards based on ESS Solo-1
 	  (ES1938, ES1946, ES1969) chips.
@@ -522,6 +528,7 @@ config SND_ES1968
 	tristate "ESS ES1968/1978 (Maestro-1/2/2E)"
 	select SND_MPU401_UART
 	select SND_AC97_CODEC
+	select ZONE_DMA
 	help
 	  Say Y here to include support for soundcards based on ESS Maestro
 	  1/2/2E chips.
@@ -602,6 +609,7 @@ config SND_ICE1712
 	select SND_MPU401_UART
 	select SND_AC97_CODEC
 	select BITREVERSE
+	select ZONE_DMA
 	help
 	  Say Y here to include support for soundcards based on the
 	  ICE1712 (Envy24) chip.
@@ -688,6 +696,7 @@ config SND_LX6464ES
 config SND_MAESTRO3
 	tristate "ESS Allegro/Maestro3"
 	select SND_AC97_CODEC
+	select ZONE_DMA
 	help
 	  Say Y here to include support for soundcards based on ESS Maestro 3
 	  (Allegro) chips.
@@ -782,6 +791,7 @@ config SND_SIS7019
 	tristate "SiS 7019 Audio Accelerator"
 	depends on X86 && !X86_64
 	select SND_AC97_CODEC
+	select ZONE_DMA
 	help
 	  Say Y here to include support for the SiS 7019 Audio Accelerator.
 
@@ -793,6 +803,7 @@ config SND_SONICVIBES
 	select SND_OPL3_LIB
 	select SND_MPU401_UART
 	select SND_AC97_CODEC
+	select ZONE_DMA
 	help
 	  Say Y here to include support for soundcards based on the S3
 	  SonicVibes chip.
@@ -804,6 +815,7 @@ config SND_TRIDENT
 	tristate "Trident 4D-Wave DX/NX; SiS 7018"
 	select SND_MPU401_UART
 	select SND_AC97_CODEC
+	select ZONE_DMA
 	help
 	  Say Y here to include support for soundcards based on Trident
 	  4D-Wave DX/NX or SiS 7018 chips.
-- 
1.8.3.2


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

* [PATCH 3.5 49/88] mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (47 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 48/88] ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 50/88] rtlwifi: rtl8192cu: Add new device ID Luis Henriques
                   ` (38 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ludovic Desroches, Chris Ball, Luis Henriques

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

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

From: Ludovic Desroches <ludovic.desroches@atmel.com>

commit 66b512eda74d59b17eac04c4da1b38d82059e6c9 upstream.

With some SDIO devices, timeout errors can happen when reading data.
To solve this issue, the DMA transfer has to be activated before sending
the command to the device. This order is incorrect in PDC mode. So we
have to take care if we are using DMA or PDC to know when to send the
MMC command.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/atmel-mci.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index ac472be..e27632e 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1106,11 +1106,22 @@ static void atmci_start_request(struct atmel_mci *host,
 	iflags |= ATMCI_CMDRDY;
 	cmd = mrq->cmd;
 	cmdflags = atmci_prepare_command(slot->mmc, cmd);
-	atmci_send_command(host, cmd, cmdflags);
+
+	/*
+	 * DMA transfer should be started before sending the command to avoid
+	 * unexpected errors especially for read operations in SDIO mode.
+	 * Unfortunately, in PDC mode, command has to be sent before starting
+	 * the transfer.
+	 */
+	if (host->submit_data != &atmci_submit_data_dma)
+		atmci_send_command(host, cmd, cmdflags);
 
 	if (data)
 		host->submit_data(host, data);
 
+	if (host->submit_data == &atmci_submit_data_dma)
+		atmci_send_command(host, cmd, cmdflags);
+
 	if (mrq->stop) {
 		host->stop_cmdr = atmci_prepare_command(slot->mmc, mrq->stop);
 		host->stop_cmdr |= ATMCI_CMDR_STOP_XFER;
-- 
1.8.3.2


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

* [PATCH 3.5 50/88] rtlwifi: rtl8192cu: Add new device ID
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (48 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 49/88] mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 51/88] mwifiex: add missing endian conversion for fw_tsf Luis Henriques
                   ` (37 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit f87f960b2fb802f26ee3b00c19320e57a9c583ff upstream.

Reported-by: Jan Prinsloo <janroot@gmail.com>
Tested-by: Jan Prinsloo <janroot@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 07ab292..6245563 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -316,6 +316,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
 	{RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/
 	{RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
 	{RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
+	{RTL_USB_DEVICE(0x0df6, 0x0077, rtl92cu_hal_cfg)}, /*Sitecom-WLA2100V2*/
 	{RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/
 	{RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*/
 	/* HP - Lite-On ,8188CUS Slim Combo */
-- 
1.8.3.2


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

* [PATCH 3.5 51/88] mwifiex: add missing endian conversion for fw_tsf
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (49 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 50/88] rtlwifi: rtl8192cu: Add new device ID Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 52/88] b43: Fix lockdep splat Luis Henriques
                   ` (36 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Amitkumar Karwar, Bing Zhao, John W. Linville, Luis Henriques

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

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

From: Amitkumar Karwar <akarwar@marvell.com>

commit 9795229752c31da0c5f8a7dc4c827665327b52f9 upstream.

It is u64 data received from firmware. Little endian to cpu
conversion is required here.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/mwifiex/scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 9ca1b9c..fee62b7 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1603,7 +1603,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
 		const u8 *ie_buf;
 		size_t ie_len;
 		u16 channel = 0;
-		u64 fw_tsf = 0;
+		__le64 fw_tsf = 0;
 		u16 beacon_size = 0;
 		u32 curr_bcn_bytes;
 		u32 freq;
@@ -1731,7 +1731,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
 					      ie_buf, ie_len, rssi, GFP_KERNEL);
 				bss_priv = (struct mwifiex_bss_priv *)bss->priv;
 				bss_priv->band = band;
-				bss_priv->fw_tsf = fw_tsf;
+				bss_priv->fw_tsf = le64_to_cpu(fw_tsf);
 				if (priv->media_connected &&
 				    !memcmp(bssid,
 					    priv->curr_bss_params.bss_descriptor
-- 
1.8.3.2


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

* [PATCH 3.5 52/88] b43: Fix lockdep splat
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (50 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 51/88] mwifiex: add missing endian conversion for fw_tsf Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 53/88] b43: Fix unload oops if firmware is not available Luis Henriques
                   ` (35 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit 09164043f63c947a49797750a09ca1cd7c31108e upstream.

In https://bugzilla.kernel.org/show_bug.cgi?id=67561, a locking dependency is reported
when b43 is used with hostapd, and rfkill is used to kill the radio output.

The lockdep splat (in part) is as follows:

======================================================
[ INFO: possible circular locking dependency detected ]
3.12.0 #1 Not tainted
-------------------------------------------------------
rfkill/10040 is trying to acquire lock:
 (rtnl_mutex){+.+.+.}, at: [<ffffffff8146f282>] rtnl_lock+0x12/0x20

but task is already holding lock:
 (rfkill_global_mutex){+.+.+.}, at: [<ffffffffa04832ca>] rfkill_fop_write+0x6a/0x170 [rfkill]

--snip--

Chain exists of:
  rtnl_mutex --> misc_mtx --> rfkill_global_mutex

The fix is to move the initialization of the hardware random number generator
outside the code range covered by the rtnl_mutex.

Reported-by: yury <urykhy@gmail.com>
Tested-by: yury <urykhy@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/b43/main.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 5b349da..d7d2db9 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2415,6 +2415,7 @@ error:
 
 static int b43_one_core_attach(struct b43_bus_dev *dev, struct b43_wl *wl);
 static void b43_one_core_detach(struct b43_bus_dev *dev);
+static int b43_rng_init(struct b43_wl *wl);
 
 static void b43_request_firmware(struct work_struct *work)
 {
@@ -2466,6 +2467,10 @@ start_ieee80211:
 		goto err_one_core_detach;
 	wl->hw_registred = true;
 	b43_leds_register(wl->current_dev);
+
+	/* Register HW RNG driver */
+	b43_rng_init(wl);
+
 	goto out;
 
 err_one_core_detach:
@@ -4595,9 +4600,6 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
 	if (!dev || b43_status(dev) != B43_STAT_INITIALIZED)
 		return;
 
-	/* Unregister HW RNG driver */
-	b43_rng_exit(dev->wl);
-
 	b43_set_status(dev, B43_STAT_UNINIT);
 
 	/* Stop the microcode PSM. */
@@ -4740,9 +4742,6 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
 
 	b43_set_status(dev, B43_STAT_INITIALIZED);
 
-	/* Register HW RNG driver */
-	b43_rng_init(dev->wl);
-
 out:
 	return err;
 
@@ -5403,6 +5402,9 @@ static void b43_bcma_remove(struct bcma_device *core)
 
 	b43_one_core_detach(wldev->dev);
 
+	/* Unregister HW RNG driver */
+	b43_rng_exit(wl);
+
 	b43_leds_unregister(wl);
 
 	ieee80211_free_hw(wl->hw);
@@ -5480,6 +5482,9 @@ static void b43_ssb_remove(struct ssb_device *sdev)
 
 	b43_one_core_detach(dev);
 
+	/* Unregister HW RNG driver */
+	b43_rng_exit(wl);
+
 	if (list_empty(&wl->devlist)) {
 		b43_leds_unregister(wl);
 		/* Last core on the chip unregistered.
-- 
1.8.3.2


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

* [PATCH 3.5 53/88] b43: Fix unload oops if firmware is not available
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (51 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 52/88] b43: Fix lockdep splat Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 54/88] b43legacy: " Luis Henriques
                   ` (34 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit 0673effd41dba323d6a280ef37b5ef29f3f5a653 upstream.

The asyncronous firmware load uses a completion struct to hold firmware
processing until the user-space routines are up and running. There is.
however, a problem in that the waiter is nevered canceled during teardown.
As a result, unloading the driver when firmware is not available causes an oops.

To be able to access the completion structure at teardown, it had to be moved
into the b43_wldev structure.

This patch also fixes a typo in a comment.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/b43/b43.h  |  4 ++--
 drivers/net/wireless/b43/main.c | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index ac593ab..9f6a983 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -719,8 +719,6 @@ enum b43_firmware_file_type {
 struct b43_request_fw_context {
 	/* The device we are requesting the fw for. */
 	struct b43_wldev *dev;
-	/* a completion event structure needed if this call is asynchronous */
-	struct completion fw_load_complete;
 	/* a pointer to the firmware object */
 	const struct firmware *blob;
 	/* The type of firmware to request. */
@@ -797,6 +795,8 @@ enum {
 struct b43_wldev {
 	struct b43_bus_dev *dev;
 	struct b43_wl *wl;
+	/* a completion event structure needed if this call is asynchronous */
+	struct completion fw_load_complete;
 
 	/* The device initialization status.
 	 * Use b43_status() to query. */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index d7d2db9..71c72d1 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2061,6 +2061,7 @@ void b43_do_release_fw(struct b43_firmware_file *fw)
 
 static void b43_release_firmware(struct b43_wldev *dev)
 {
+	complete(&dev->fw_load_complete);
 	b43_do_release_fw(&dev->fw.ucode);
 	b43_do_release_fw(&dev->fw.pcm);
 	b43_do_release_fw(&dev->fw.initvals);
@@ -2086,7 +2087,7 @@ static void b43_fw_cb(const struct firmware *firmware, void *context)
 	struct b43_request_fw_context *ctx = context;
 
 	ctx->blob = firmware;
-	complete(&ctx->fw_load_complete);
+	complete(&ctx->dev->fw_load_complete);
 }
 
 int b43_do_request_fw(struct b43_request_fw_context *ctx,
@@ -2133,7 +2134,7 @@ int b43_do_request_fw(struct b43_request_fw_context *ctx,
 	}
 	if (async) {
 		/* do this part asynchronously */
-		init_completion(&ctx->fw_load_complete);
+		init_completion(&ctx->dev->fw_load_complete);
 		err = request_firmware_nowait(THIS_MODULE, 1, ctx->fwname,
 					      ctx->dev->dev->dev, GFP_KERNEL,
 					      ctx, b43_fw_cb);
@@ -2141,12 +2142,11 @@ int b43_do_request_fw(struct b43_request_fw_context *ctx,
 			pr_err("Unable to load firmware\n");
 			return err;
 		}
-		/* stall here until fw ready */
-		wait_for_completion(&ctx->fw_load_complete);
+		wait_for_completion(&ctx->dev->fw_load_complete);
 		if (ctx->blob)
 			goto fw_ready;
 	/* On some ARM systems, the async request will fail, but the next sync
-	 * request works. For this reason, we dall through here
+	 * request works. For this reason, we fall through here
 	 */
 	}
 	err = request_firmware(&ctx->blob, ctx->fwname,
-- 
1.8.3.2


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

* [PATCH 3.5 54/88] b43legacy: Fix unload oops if firmware is not available
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (52 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 53/88] b43: Fix unload oops if firmware is not available Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 55/88] nfs4.1: properly handle ENOTSUP in SECINFO_NO_NAME Luis Henriques
                   ` (33 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit 452028665312672c6ba9e16a19248ee00ead9400 upstream.

The asyncronous firmware load uses a completion struct to hold firmware
processing until the user-space routines are up and running. There is.
however, a problem in that the waiter is nevered canceled during teardown.
As a result, unloading the driver when firmware is not available causes an oops.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/b43legacy/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 0366dcc..2a1c348 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3917,6 +3917,7 @@ static void b43legacy_remove(struct ssb_device *dev)
 	 * as the ieee80211 unreg will destroy the workqueue. */
 	cancel_work_sync(&wldev->restart_work);
 	cancel_work_sync(&wl->firmware_load);
+	complete(&wldev->fw_load_complete);
 
 	B43legacy_WARN_ON(!wl);
 	if (!wldev->fw.ucode)
-- 
1.8.3.2


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

* [PATCH 3.5 55/88] nfs4.1: properly handle ENOTSUP in SECINFO_NO_NAME
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (53 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 54/88] b43legacy: " Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 56/88] audit: correct a type mismatch in audit_syscall_exit() Luis Henriques
                   ` (32 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Weston Andros Adamson, Trond Myklebust, Luis Henriques

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

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

From: Weston Andros Adamson <dros@primarydata.com>

commit 78b19bae0813bd6f921ca58490196abd101297bd upstream.

Don't check for -NFS4ERR_NOTSUPP, it's already been mapped to -ENOTSUPP
by nfs4_stat_to_errno.

This allows the client to mount v4.1 servers that don't support
SECINFO_NO_NAME by falling back to the "guess and check" method of
nfs4_find_root_sec.

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfs/nfs4proc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 4bb79e7..69fd66a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6578,7 +6578,7 @@ nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle,
 		switch (err) {
 		case 0:
 		case -NFS4ERR_WRONGSEC:
-		case -NFS4ERR_NOTSUPP:
+		case -ENOTSUPP:
 			goto out;
 		default:
 			err = nfs4_handle_exception(server, err, &exception);
@@ -6610,7 +6610,7 @@ nfs41_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
 	 * Fall back on "guess and check" method if
 	 * the server doesn't support SECINFO_NO_NAME
 	 */
-	if (err == -NFS4ERR_WRONGSEC || err == -NFS4ERR_NOTSUPP) {
+	if (err == -NFS4ERR_WRONGSEC || err == -ENOTSUPP) {
 		err = nfs4_find_root_sec(server, fhandle, info);
 		goto out_freepage;
 	}
-- 
1.8.3.2


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

* [PATCH 3.5 56/88] audit: correct a type mismatch in audit_syscall_exit()
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (54 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 55/88] nfs4.1: properly handle ENOTSUP in SECINFO_NO_NAME Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 57/88] md/raid5: fix long-standing problem with bitmap handling on write failure Luis Henriques
                   ` (31 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: AKASHI Takahiro, Al Viro, Eric Paris, Andrew Morton, Luis Henriques

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

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

From: AKASHI Takahiro <takahiro.akashi@linaro.org>

commit 06bdadd7634551cfe8ce071fe44d0311b3033d9e upstream.

audit_syscall_exit() saves a result of regs_return_value() in intermediate
"int" variable and passes it to __audit_syscall_exit(), which expects its
second argument as a "long" value.  This will result in truncating the
value returned by a system call and making a wrong audit record.

I don't know why gcc compiler doesn't complain about this, but anyway it
causes a problem at runtime on arm64 (and probably most 64-bit archs).

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/audit.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/audit.h b/include/linux/audit.h
index 41b4e49..8858e95 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -488,7 +488,7 @@ static inline void audit_syscall_exit(void *pt_regs)
 {
 	if (unlikely(current->audit_context)) {
 		int success = is_syscall_success(pt_regs);
-		int return_code = regs_return_value(pt_regs);
+		long return_code = regs_return_value(pt_regs);
 
 		__audit_syscall_exit(success, return_code);
 	}
-- 
1.8.3.2


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

* [PATCH 3.5 57/88] md/raid5: fix long-standing problem with bitmap handling on write failure.
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (55 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 56/88] audit: correct a type mismatch in audit_syscall_exit() Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 58/88] drm/radeon: set the full cache bit for fences on r7xx+ Luis Henriques
                   ` (30 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Luis Henriques

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

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

From: NeilBrown <neilb@suse.de>

commit 9f97e4b128d2ea90a5f5063ea0ee3b0911f4c669 upstream.

Before a write starts we set a bit in the write-intent bitmap.
When the write completes we clear that bit if the write was successful
to all devices.  However if the write wasn't fully successful we
should not clear the bit.  If the faulty drive is subsequently
re-added, the fact that the bit is still set ensure that we will
re-write the data that is missing.

This logic is mediated by the STRIPE_DEGRADED flag - we only clear the
bitmap bit when this flag is not set.
Currently we correctly set the flag if a write starts when some
devices are failed or missing.  But we do *not* set the flag if some
device failed during the write attempt.
This is wrong and can result in clearing the bit inappropriately.

So: set the flag when a write fails.

This bug has been present since bitmaps were introduces, so the fix is
suitable for any -stable kernel.

Reported-by: Ethan Wilson <ethan.wilson@shiftmail.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/raid5.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 4ee5324..eb0f9ea 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1851,6 +1851,7 @@ static void raid5_end_write_request(struct bio *bi, int error)
 			set_bit(R5_MadeGoodRepl, &sh->dev[i].flags);
 	} else {
 		if (!uptodate) {
+			set_bit(STRIPE_DEGRADED, &sh->state);
 			set_bit(WriteErrorSeen, &rdev->flags);
 			set_bit(R5_WriteError, &sh->dev[i].flags);
 			if (!test_and_set_bit(WantReplacement, &rdev->flags))
-- 
1.8.3.2


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

* [PATCH 3.5 58/88] drm/radeon: set the full cache bit for fences on r7xx+
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (56 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 57/88] md/raid5: fix long-standing problem with bitmap handling on write failure Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 59/88] hp_accel: Add a new PnP ID HPQ6007 for new HP laptops Luis Henriques
                   ` (29 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

From: Alex Deucher <alexander.deucher@amd.com>

commit d45b964a22cad962d3ede1eba8d24f5cee7b2a92 upstream.

Needed to properly flush the read caches for fences.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/r600.c  | 13 +++++++------
 drivers/gpu/drm/radeon/r600d.h |  1 +
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 3458d4a..ec1a029 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -2249,14 +2249,17 @@ void r600_fence_ring_emit(struct radeon_device *rdev,
 			  struct radeon_fence *fence)
 {
 	struct radeon_ring *ring = &rdev->ring[fence->ring];
+	u32 cp_coher_cntl = PACKET3_TC_ACTION_ENA | PACKET3_VC_ACTION_ENA |
+		PACKET3_SH_ACTION_ENA;
+
+	if (rdev->family >= CHIP_RV770)
+		cp_coher_cntl |= PACKET3_FULL_CACHE_ENA;
 
 	if (rdev->wb.use_event) {
 		u64 addr = rdev->fence_drv[fence->ring].gpu_addr;
 		/* flush read cache over gart */
 		radeon_ring_write(ring, PACKET3(PACKET3_SURFACE_SYNC, 3));
-		radeon_ring_write(ring, PACKET3_TC_ACTION_ENA |
-					PACKET3_VC_ACTION_ENA |
-					PACKET3_SH_ACTION_ENA);
+		radeon_ring_write(ring, cp_coher_cntl);
 		radeon_ring_write(ring, 0xFFFFFFFF);
 		radeon_ring_write(ring, 0);
 		radeon_ring_write(ring, 10); /* poll interval */
@@ -2270,9 +2273,7 @@ void r600_fence_ring_emit(struct radeon_device *rdev,
 	} else {
 		/* flush read cache over gart */
 		radeon_ring_write(ring, PACKET3(PACKET3_SURFACE_SYNC, 3));
-		radeon_ring_write(ring, PACKET3_TC_ACTION_ENA |
-					PACKET3_VC_ACTION_ENA |
-					PACKET3_SH_ACTION_ENA);
+		radeon_ring_write(ring, cp_coher_cntl);
 		radeon_ring_write(ring, 0xFFFFFFFF);
 		radeon_ring_write(ring, 0);
 		radeon_ring_write(ring, 10); /* poll interval */
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h
index 025fd5b..6dea105 100644
--- a/drivers/gpu/drm/radeon/r600d.h
+++ b/drivers/gpu/drm/radeon/r600d.h
@@ -1108,6 +1108,7 @@
 #define	PACKET3_INDIRECT_BUFFER				0x32
 #define	PACKET3_SURFACE_SYNC				0x43
 #              define PACKET3_CB0_DEST_BASE_ENA    (1 << 6)
+#              define PACKET3_FULL_CACHE_ENA       (1 << 20) /* r7xx+ only */
 #              define PACKET3_TC_ACTION_ENA        (1 << 23)
 #              define PACKET3_VC_ACTION_ENA        (1 << 24)
 #              define PACKET3_CB_ACTION_ENA        (1 << 25)
-- 
1.8.3.2


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

* [PATCH 3.5 59/88] hp_accel: Add a new PnP ID HPQ6007 for new HP laptops
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (57 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 58/88] drm/radeon: set the full cache bit for fences on r7xx+ Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 60/88] intel-iommu: fix off-by-one in pagetable freeing Luis Henriques
                   ` (28 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Takashi Iwai, Matthew Garrett, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit b0ad4ff35d479a46a3b995a299db9aeb097acfce upstream.

The DriveGuard chips on the new HP laptops are with a new PnP ID
"HPQ6007".  It should be compatible with older chips.

Acked-by: Éric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/platform/x86/hp_accel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
index fdacfce..0076fea 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -77,6 +77,7 @@ static inline void delayed_sysfs_set(struct led_classdev *led_cdev,
 static struct acpi_device_id lis3lv02d_device_ids[] = {
 	{"HPQ0004", 0}, /* HP Mobile Data Protection System PNP */
 	{"HPQ6000", 0}, /* HP Mobile Data Protection System PNP */
+	{"HPQ6007", 0}, /* HP Mobile Data Protection System PNP */
 	{"", 0},
 };
 MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids);
-- 
1.8.3.2


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

* [PATCH 3.5 60/88] intel-iommu: fix off-by-one in pagetable freeing
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (58 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 59/88] hp_accel: Add a new PnP ID HPQ6007 for new HP laptops Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 61/88] fuse: fix pipe_buf_operations Luis Henriques
                   ` (27 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alex Williamson, David Woodhouse, Joerg Roedel, Andrew Morton,
	Linus Torvalds, Luis Henriques

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

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

From: Alex Williamson <alex.williamson@redhat.com>

commit 08336fd218e087cc4fcc458e6b6dcafe8702b098 upstream.

dma_pte_free_level() has an off-by-one error when checking whether a pte
is completely covered by a range.  Take for example the case of
attempting to free pfn 0x0 - 0x1ff, ie.  512 entries covering the first
2M superpage.

The level_size() is 0x200 and we test:

  static void dma_pte_free_level(...
	...

	if (!(0 > 0 || 0x1ff < 0 + 0x200)) {
		...
	}

Clearly the 2nd test is true, which means we fail to take the branch to
clear and free the pagetable entry.  As a result, we're leaking
pagetables and failing to install new pages over the range.

This was found with a PCI device assigned to a QEMU guest using vfio-pci
without a VGA device present.  The first 1M of guest address space is
mapped with various combinations of 4K pages, but eventually the range
is entirely freed and replaced with a 2M contiguous mapping.
intel-iommu errors out with something like:

  ERROR: DMA PTE for vPFN 0x0 already set (to 5c2b8003 not 849c00083)

In this case 5c2b8003 is the pointer to the previous leaf page that was
neither freed nor cleared and 849c00083 is the superpage entry that
we're trying to replace it with.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/iommu/intel-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index f3535d9..2052974 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -914,7 +914,7 @@ static void dma_pte_free_level(struct dmar_domain *domain, int level,
 
 		/* If range covers entire pagetable, free it */
 		if (!(start_pfn > level_pfn ||
-		      last_pfn < level_pfn + level_size(level))) {
+		      last_pfn < level_pfn + level_size(level) - 1)) {
 			dma_clear_pte(pte);
 			domain_flush_cache(domain, pte, sizeof(*pte));
 			free_pgtable_page(level_pte);
-- 
1.8.3.2


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

* [PATCH 3.5 61/88] fuse: fix pipe_buf_operations
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (59 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 60/88] intel-iommu: fix off-by-one in pagetable freeing Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:22 ` [PATCH 3.5 62/88] drm/cirrus: correct register values for 16bpp Luis Henriques
                   ` (26 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Miklos Szeredi, Luis Henriques

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

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

From: Miklos Szeredi <mszeredi@suse.cz>

commit 28a625cbc2a14f17b83e47ef907b2658576a32aa upstream.

Having this struct in module memory could Oops when if the module is
unloaded while the buffer still persists in a pipe.

Since sock_pipe_buf_ops is essentially the same as fuse_dev_pipe_buf_steal
merge them into nosteal_pipe_buf_ops (this is the same as
default_pipe_buf_ops except stealing the page from the buffer is not
allowed).

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/fuse/dev.c             | 22 +++++-----------------
 fs/splice.c               | 18 ++++++++++++++++++
 include/linux/pipe_fs_i.h |  2 ++
 net/core/skbuff.c         | 32 +-------------------------------
 4 files changed, 26 insertions(+), 48 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index f4246cf..fd074cd 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1199,22 +1199,6 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov,
 	return fuse_dev_do_read(fc, file, &cs, iov_length(iov, nr_segs));
 }
 
-static int fuse_dev_pipe_buf_steal(struct pipe_inode_info *pipe,
-				   struct pipe_buffer *buf)
-{
-	return 1;
-}
-
-static const struct pipe_buf_operations fuse_dev_pipe_buf_ops = {
-	.can_merge = 0,
-	.map = generic_pipe_buf_map,
-	.unmap = generic_pipe_buf_unmap,
-	.confirm = generic_pipe_buf_confirm,
-	.release = generic_pipe_buf_release,
-	.steal = fuse_dev_pipe_buf_steal,
-	.get = generic_pipe_buf_get,
-};
-
 static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
 				    struct pipe_inode_info *pipe,
 				    size_t len, unsigned int flags)
@@ -1261,7 +1245,11 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
 		buf->page = bufs[page_nr].page;
 		buf->offset = bufs[page_nr].offset;
 		buf->len = bufs[page_nr].len;
-		buf->ops = &fuse_dev_pipe_buf_ops;
+		/*
+		 * Need to be careful about this.  Having buf->ops in module
+		 * code can Oops if the buffer persists after module unload.
+		 */
+		buf->ops = &nosteal_pipe_buf_ops;
 
 		pipe->nrbufs++;
 		page_nr++;
diff --git a/fs/splice.c b/fs/splice.c
index 6cb3acb..74ff4f0 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -553,6 +553,24 @@ static const struct pipe_buf_operations default_pipe_buf_ops = {
 	.get = generic_pipe_buf_get,
 };
 
+static int generic_pipe_buf_nosteal(struct pipe_inode_info *pipe,
+				    struct pipe_buffer *buf)
+{
+	return 1;
+}
+
+/* Pipe buffer operations for a socket and similar. */
+const struct pipe_buf_operations nosteal_pipe_buf_ops = {
+	.can_merge = 0,
+	.map = generic_pipe_buf_map,
+	.unmap = generic_pipe_buf_unmap,
+	.confirm = generic_pipe_buf_confirm,
+	.release = generic_pipe_buf_release,
+	.steal = generic_pipe_buf_nosteal,
+	.get = generic_pipe_buf_get,
+};
+EXPORT_SYMBOL(nosteal_pipe_buf_ops);
+
 static ssize_t kernel_readv(struct file *file, const struct iovec *vec,
 			    unsigned long vlen, loff_t offset)
 {
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index e1ac1ce..e51bbd3 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -158,6 +158,8 @@ int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
 int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
 void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
 
+extern const struct pipe_buf_operations nosteal_pipe_buf_ops;
+
 /* for F_SETPIPE_SZ and F_GETPIPE_SZ */
 long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
 struct pipe_inode_info *get_pipe_info(struct file *file);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7ed8ef3..1e37e1a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -74,36 +74,6 @@
 struct kmem_cache *skbuff_head_cache __read_mostly;
 static struct kmem_cache *skbuff_fclone_cache __read_mostly;
 
-static void sock_pipe_buf_release(struct pipe_inode_info *pipe,
-				  struct pipe_buffer *buf)
-{
-	put_page(buf->page);
-}
-
-static void sock_pipe_buf_get(struct pipe_inode_info *pipe,
-				struct pipe_buffer *buf)
-{
-	get_page(buf->page);
-}
-
-static int sock_pipe_buf_steal(struct pipe_inode_info *pipe,
-			       struct pipe_buffer *buf)
-{
-	return 1;
-}
-
-
-/* Pipe buffer operations for a socket. */
-static const struct pipe_buf_operations sock_pipe_buf_ops = {
-	.can_merge = 0,
-	.map = generic_pipe_buf_map,
-	.unmap = generic_pipe_buf_unmap,
-	.confirm = generic_pipe_buf_confirm,
-	.release = sock_pipe_buf_release,
-	.steal = sock_pipe_buf_steal,
-	.get = sock_pipe_buf_get,
-};
-
 /*
  *	Keep out-of-line to prevent kernel bloat.
  *	__builtin_return_address is not used because it is not always
@@ -1710,7 +1680,7 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
 		.partial = partial,
 		.nr_pages_max = MAX_SKB_FRAGS,
 		.flags = flags,
-		.ops = &sock_pipe_buf_ops,
+		.ops = &nosteal_pipe_buf_ops,
 		.spd_release = sock_spd_release,
 	};
 	struct sk_buff *frag_iter;
-- 
1.8.3.2


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

* [PATCH 3.5 62/88] drm/cirrus: correct register values for 16bpp
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (60 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 61/88] fuse: fix pipe_buf_operations Luis Henriques
@ 2014-02-07 11:22 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 63/88] IB/qib: Fix QP check when looping back to/from QP1 Luis Henriques
                   ` (25 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:22 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Takashi Iwai, Jiri Slaby, David Airlie, Andrew Morton,
	Dave Airlie, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 2510538fa000dd13a3e57b79bf073ffb1748976c upstream.

When the mode is set with 16bpp on QEMU, the output gets totally broken.
The culprit is the bogus register values set for 16bpp, which was likely
copied from from a wrong place.

Addresses https://bugzilla.novell.com/show_bug.cgi?id=799216

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/cirrus/cirrus_mode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c
index 100f630..93d4fef 100644
--- a/drivers/gpu/drm/cirrus/cirrus_mode.c
+++ b/drivers/gpu/drm/cirrus/cirrus_mode.c
@@ -274,8 +274,8 @@ static int cirrus_crtc_mode_set(struct drm_crtc *crtc,
 		sr07 |= 0x11;
 		break;
 	case 16:
-		sr07 |= 0xc1;
-		hdr = 0xc0;
+		sr07 |= 0x17;
+		hdr = 0xc1;
 		break;
 	case 24:
 		sr07 |= 0x15;
-- 
1.8.3.2


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

* [PATCH 3.5 63/88] IB/qib: Fix QP check when looping back to/from QP1
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (61 preceding siblings ...)
  2014-02-07 11:22 ` [PATCH 3.5 62/88] drm/cirrus: correct register values for 16bpp Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 64/88] ore: Fix wrong math in allocation of per device BIO Luis Henriques
                   ` (24 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ira Weiny, Roland Dreier, Luis Henriques

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

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

From: Ira Weiny <ira.weiny@intel.com>

commit 6e0ea9e6cbcead7fa8c76e3e3b9de4a50c5131c5 upstream.

The GSI QP type is compatible with and should be allowed to send data
to/from any UD QP.  This was found when testing ibacm on the same node
as an SA.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/hw/qib/qib_ud.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/qib/qib_ud.c b/drivers/infiniband/hw/qib/qib_ud.c
index a468bf2..9c96545 100644
--- a/drivers/infiniband/hw/qib/qib_ud.c
+++ b/drivers/infiniband/hw/qib/qib_ud.c
@@ -57,13 +57,20 @@ static void qib_ud_loopback(struct qib_qp *sqp, struct qib_swqe *swqe)
 	struct qib_sge *sge;
 	struct ib_wc wc;
 	u32 length;
+	enum ib_qp_type sqptype, dqptype;
 
 	qp = qib_lookup_qpn(ibp, swqe->wr.wr.ud.remote_qpn);
 	if (!qp) {
 		ibp->n_pkt_drops++;
 		return;
 	}
-	if (qp->ibqp.qp_type != sqp->ibqp.qp_type ||
+
+	sqptype = sqp->ibqp.qp_type == IB_QPT_GSI ?
+			IB_QPT_UD : sqp->ibqp.qp_type;
+	dqptype = qp->ibqp.qp_type == IB_QPT_GSI ?
+			IB_QPT_UD : qp->ibqp.qp_type;
+
+	if (dqptype != sqptype ||
 	    !(ib_qib_state_ops[qp->state] & QIB_PROCESS_RECV_OK)) {
 		ibp->n_pkt_drops++;
 		goto drop;
-- 
1.8.3.2


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

* [PATCH 3.5 64/88] ore: Fix wrong math in allocation of per device BIO
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (62 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 63/88] IB/qib: Fix QP check when looping back to/from QP1 Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 65/88] b43: fix the wrong assignment of status.freq in b43_rx() Luis Henriques
                   ` (23 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Boaz Harrosh, Luis Henriques

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

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

From: Boaz Harrosh <bharrosh@panasas.com>

commit aad560b7f63b495f48a7232fd086c5913a676e6f upstream.

At IO preparation we calculate the max pages at each device and
allocate a BIO per device of that size. The calculation was wrong
on some unaligned corner cases offset/length combination and would
make prepare return with -ENOMEM. This would be bad for pnfs-objects
that would in that case IO through MDS. And fatal for exofs were it
would fail writes with EIO.

Fix it by doing the proper math, that will work in all cases. (I
ran a test with all possible offset/length combinations this time
round).

Also when reading we do not need to allocate for the parity units
since we jump over them.

Also lower the max_io_length to take into account the parity pages
so not to allocate BIOs bigger than PAGE_SIZE

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/exofs/ore.c         | 37 +++++++++++++++++++++++++------------
 include/scsi/osd_ore.h |  1 +
 2 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c
index 1585db1..a73bc26 100644
--- a/fs/exofs/ore.c
+++ b/fs/exofs/ore.c
@@ -103,7 +103,7 @@ int ore_verify_layout(unsigned total_comps, struct ore_layout *layout)
 
 	layout->max_io_length =
 		(BIO_MAX_PAGES_KMALLOC * PAGE_SIZE - layout->stripe_unit) *
-							layout->group_width;
+					(layout->group_width - layout->parity);
 	if (layout->parity) {
 		unsigned stripe_length =
 				(layout->group_width - layout->parity) *
@@ -286,7 +286,8 @@ int  ore_get_rw_state(struct ore_layout *layout, struct ore_components *oc,
 	if (length) {
 		ore_calc_stripe_info(layout, offset, length, &ios->si);
 		ios->length = ios->si.length;
-		ios->nr_pages = (ios->length + PAGE_SIZE - 1) / PAGE_SIZE;
+		ios->nr_pages = ((ios->offset & (PAGE_SIZE - 1)) +
+				 ios->length + PAGE_SIZE - 1) / PAGE_SIZE;
 		if (layout->parity)
 			_ore_post_alloc_raid_stuff(ios);
 	}
@@ -536,6 +537,7 @@ void ore_calc_stripe_info(struct ore_layout *layout, u64 file_offset,
 	u64	H = LmodS - G * T;
 
 	u32	N = div_u64(H, U);
+	u32	Nlast;
 
 	/* "H - (N * U)" is just "H % U" so it's bound to u32 */
 	u32	C = (u32)(H - (N * U)) / stripe_unit + G * group_width;
@@ -568,6 +570,10 @@ void ore_calc_stripe_info(struct ore_layout *layout, u64 file_offset,
 	si->length = T - H;
 	if (si->length > length)
 		si->length = length;
+
+	Nlast = div_u64(H + si->length + U - 1, U);
+	si->maxdevUnits = Nlast - N;
+
 	si->M = M;
 }
 EXPORT_SYMBOL(ore_calc_stripe_info);
@@ -583,13 +589,16 @@ int _ore_add_stripe_unit(struct ore_io_state *ios,  unsigned *cur_pg,
 	int ret;
 
 	if (per_dev->bio == NULL) {
-		unsigned pages_in_stripe = ios->layout->group_width *
-					(ios->layout->stripe_unit / PAGE_SIZE);
-		unsigned nr_pages = ios->nr_pages * ios->layout->group_width /
-					(ios->layout->group_width -
-					 ios->layout->parity);
-		unsigned bio_size = (nr_pages + pages_in_stripe) /
-					ios->layout->group_width;
+		unsigned bio_size;
+
+		if (!ios->reading) {
+			bio_size = ios->si.maxdevUnits;
+		} else {
+			bio_size = (ios->si.maxdevUnits + 1) *
+			     (ios->layout->group_width - ios->layout->parity) /
+			     ios->layout->group_width;
+		}
+		bio_size *= (ios->layout->stripe_unit / PAGE_SIZE);
 
 		per_dev->bio = bio_kmalloc(GFP_KERNEL, bio_size);
 		if (unlikely(!per_dev->bio)) {
@@ -609,8 +618,12 @@ int _ore_add_stripe_unit(struct ore_io_state *ios,  unsigned *cur_pg,
 		added_len = bio_add_pc_page(q, per_dev->bio, pages[pg],
 					    pglen, pgbase);
 		if (unlikely(pglen != added_len)) {
-			ORE_DBGMSG("Failed bio_add_pc_page bi_vcnt=%u\n",
-				   per_dev->bio->bi_vcnt);
+			/* If bi_vcnt == bi_max then this is a SW BUG */
+			ORE_DBGMSG("Failed bio_add_pc_page bi_vcnt=0x%x "
+				   "bi_max=0x%x BIO_MAX=0x%x cur_len=0x%x\n",
+				   per_dev->bio->bi_vcnt,
+				   per_dev->bio->bi_max_vecs,
+				   BIO_MAX_PAGES_KMALLOC, cur_len);
 			ret = -ENOMEM;
 			goto out;
 		}
@@ -1099,7 +1112,7 @@ int ore_truncate(struct ore_layout *layout, struct ore_components *oc,
 		size_attr->attr = g_attr_logical_length;
 		size_attr->attr.val_ptr = &size_attr->newsize;
 
-		ORE_DBGMSG("trunc(0x%llx) obj_offset=0x%llx dev=%d\n",
+		ORE_DBGMSG2("trunc(0x%llx) obj_offset=0x%llx dev=%d\n",
 			     _LLU(oc->comps->obj.id), _LLU(obj_size), i);
 		ret = _truncate_mirrors(ios, i * ios->layout->mirrors_p1,
 					&size_attr->attr);
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h
index a5f9b96..6ca3265 100644
--- a/include/scsi/osd_ore.h
+++ b/include/scsi/osd_ore.h
@@ -102,6 +102,7 @@ struct ore_striping_info {
 	unsigned unit_off;
 	unsigned cur_pg;
 	unsigned cur_comp;
+	unsigned maxdevUnits;
 };
 
 struct ore_io_state;
-- 
1.8.3.2


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

* [PATCH 3.5 65/88] b43: fix the wrong assignment of status.freq in b43_rx()
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (63 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 64/88] ore: Fix wrong math in allocation of per device BIO Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 66/88] KVM: PPC: e500: Fix bad address type in deliver_tlb_misss() Luis Henriques
                   ` (22 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: ZHAO Gang, John W. Linville, Luis Henriques

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

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

From: ZHAO Gang <gamerh2o@gmail.com>

commit 64e5acb09ca6b50c97299cff9ef51299470b29f2 upstream.

Use the right function to update frequency value.

If rx skb is probe response or beacon, the wrong frequency value can
cause problem that bss info can't be updated when it should be.

Fixes: 8318d78a44d4 ("cfg80211 API for channels/bitrates, mac80211
and driver conversion")
Signed-off-by: ZHAO Gang <gamerh2o@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/b43/xmit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index b31ccc0..87b8592 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -820,10 +820,10 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
 		 * channel number in b43. */
 		if (chanstat & B43_RX_CHAN_5GHZ) {
 			status.band = IEEE80211_BAND_5GHZ;
-			status.freq = b43_freq_to_channel_5ghz(chanid);
+			status.freq = b43_channel_to_freq_5ghz(chanid);
 		} else {
 			status.band = IEEE80211_BAND_2GHZ;
-			status.freq = b43_freq_to_channel_2ghz(chanid);
+			status.freq = b43_channel_to_freq_2ghz(chanid);
 		}
 		break;
 	default:
-- 
1.8.3.2


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

* [PATCH 3.5 66/88] KVM: PPC: e500: Fix bad address type in deliver_tlb_misss()
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (64 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 65/88] b43: fix the wrong assignment of status.freq in b43_rx() Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 67/88] Btrfs: handle EAGAIN case properly in btrfs_drop_snapshot() Luis Henriques
                   ` (21 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mihai Caraman, Alexander Graf, Luis Henriques

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

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

From: Mihai Caraman <mihai.caraman@freescale.com>

commit 70713fe315ed14cd1bb07d1a7f33e973d136ae3d upstream.

Use gva_t instead of unsigned int for eaddr in deliver_tlb_miss().

Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
[ luis: backported to 3.5:
  - kvmppc_e500_deliver_tlb_miss() is defined in arch/powerpc/kvm/e500_tlb.c
    on the 3.5 kernel]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/kvm/e500_tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index 3580a0c..5871b4e 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -358,7 +358,7 @@ static void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500)
 }
 
 static inline void kvmppc_e500_deliver_tlb_miss(struct kvm_vcpu *vcpu,
-		unsigned int eaddr, int as)
+		gva_t eaddr, int as)
 {
 	struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
 	unsigned int victim, tsized;
-- 
1.8.3.2


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

* [PATCH 3.5 67/88] Btrfs: handle EAGAIN case properly in btrfs_drop_snapshot()
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (65 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 66/88] KVM: PPC: e500: Fix bad address type in deliver_tlb_misss() Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 68/88] ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API Luis Henriques
                   ` (20 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Wang Shilong, Josef Bacik, Chris Mason, Luis Henriques

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

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

From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>

commit 90515e7f5d7d24cbb2a4038a3f1b5cfa2921aa17 upstream.

We may return early in btrfs_drop_snapshot(), we shouldn't
call btrfs_std_err() for this case, fix it.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/btrfs/extent-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6bb1213..a37ec94 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7035,7 +7035,7 @@ out:
 	 */
 	if (root_dropped == false)
 		btrfs_add_dead_root(root);
-	if (err)
+	if (err && err != -EAGAIN)
 		btrfs_std_error(root->fs_info, err);
 	return err;
 }
-- 
1.8.3.2


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

* [PATCH 3.5 68/88] ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (66 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 67/88] Btrfs: handle EAGAIN case properly in btrfs_drop_snapshot() Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 69/88] powerpc: Make sure "cache" directory is removed when offlining cpu Luis Henriques
                   ` (19 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mark Brown, Rafael J. Wysocki, Luis Henriques

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

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

From: Mark Brown <broonie@linaro.org>

commit 49a12877d2777cadcb838981c3c4f5a424aef310 upstream.

There is currently no facility in ACPI to express the hookup of voltage
regulators, the expectation is that the regulators that exist in the
system will be handled transparently by firmware if they need software
control at all. This means that if for some reason the regulator API is
enabled on such a system it should assume that any supplies that devices
need are provided by the system at all relevant times without any software
intervention.

Tell the regulator core to make this assumption by calling
regulator_has_full_constraints(). Do this as soon as we know we are using
ACPI so that the information is available to the regulator core as early
as possible. This will cause the regulator core to pretend that there is
an always on regulator supplying any supply that is requested but that has
not otherwise been mapped which is the behaviour expected on a system with
ACPI.

Should the ability to specify regulators be added in future revisions of
ACPI then once we have support for ACPI mappings in the kernel the same
assumptions will apply. It is also likely that systems will default to a
mode of operation which does not require any interpretation of these
mappings in order to be compatible with existing operating system releases
so it should remain safe to make these assumptions even if the mappings
exist but are not supported by the kernel.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/acpi/bus.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 54a5732..bb5aab4 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -33,6 +33,7 @@
 #include <linux/proc_fs.h>
 #include <linux/acpi.h>
 #include <linux/slab.h>
+#include <linux/regulator/machine.h>
 #ifdef CONFIG_X86
 #include <asm/mpspec.h>
 #endif
@@ -957,6 +958,14 @@ void __init acpi_early_init(void)
 		goto error0;
 	}
 
+	/*
+	 * If the system is using ACPI then we can be reasonably
+	 * confident that any regulators are managed by the firmware
+	 * so tell the regulator core it has everything it needs to
+	 * know.
+	 */
+	regulator_has_full_constraints();
+
 	return;
 
       error0:
-- 
1.8.3.2


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

* [PATCH 3.5 69/88] powerpc: Make sure "cache" directory is removed when offlining cpu
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (67 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 68/88] ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 70/88] drm/radeon/DCE4+: clear bios scratch dpms bit (v2) Luis Henriques
                   ` (18 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Paul Mackerras, Benjamin Herrenschmidt, Luis Henriques

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

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

From: Paul Mackerras <paulus@samba.org>

commit 91b973f90c1220d71923e7efe1e61f5329806380 upstream.

The code in remove_cache_dir() is supposed to remove the "cache"
subdirectory from the sysfs directory for a CPU when that CPU is
being offlined.  It tries to do this by calling kobject_put() on
the kobject for the subdirectory.  However, the subdirectory only
gets removed once the last reference goes away, and the reference
being put here may well not be the last reference.  That means
that the "cache" subdirectory may still exist when the offlining
operation has finished.  If the same CPU subsequently gets onlined,
the code tries to add a new "cache" subdirectory.  If the old
subdirectory has not yet been removed, we get a WARN_ON in the
sysfs code, with stack trace, and an error message printed on the
console.  Further, we ultimately end up with an online cpu with no
"cache" subdirectory.

This fixes it by doing an explicit kobject_del() at the point where
we want the subdirectory to go away.  kobject_del() removes the sysfs
directory even though the object still exists in memory.  The object
will get freed at some point in the future.  A subsequent onlining
operation can create a new sysfs directory, even if the old object
still exists in memory, without causing any problems.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/kernel/cacheinfo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index 92c6b00..b4437e8 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -788,6 +788,9 @@ static void remove_cache_dir(struct cache_dir *cache_dir)
 {
 	remove_index_dirs(cache_dir);
 
+	/* Remove cache dir from sysfs */
+	kobject_del(cache_dir->kobj);
+
 	kobject_put(cache_dir->kobj);
 
 	kfree(cache_dir);
-- 
1.8.3.2


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

* [PATCH 3.5 70/88] drm/radeon/DCE4+: clear bios scratch dpms bit (v2)
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (68 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 69/88] powerpc: Make sure "cache" directory is removed when offlining cpu Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 71/88] mm/page-writeback.c: fix dirty_balance_reserve subtraction from dirtyable memory Luis Henriques
                   ` (17 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

From: Alex Deucher <alexander.deucher@amd.com>

commit 6802d4bad83f50081b2788698570218aaff8d10e upstream.

The BlankCrtc table in some DCE8 boards has some
logic shortcuts for the vbios when this bit is set.
Clear it for driver use.

v2: fix typo

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=73420

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_atombios.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index c54d295..6d0c32b 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -2785,6 +2785,10 @@ void radeon_atom_initialize_bios_scratch_regs(struct drm_device *dev)
 	/* tell the bios not to handle mode switching */
 	bios_6_scratch |= ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH;
 
+	/* clear the vbios dpms state */
+	if (ASIC_IS_DCE4(rdev))
+		bios_2_scratch &= ~ATOM_S2_DEVICE_DPMS_STATE;
+
 	if (rdev->family >= CHIP_R600) {
 		WREG32(R600_BIOS_2_SCRATCH, bios_2_scratch);
 		WREG32(R600_BIOS_6_SCRATCH, bios_6_scratch);
-- 
1.8.3.2


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

* [PATCH 3.5 71/88] mm/page-writeback.c: fix dirty_balance_reserve subtraction from dirtyable memory
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (69 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 70/88] drm/radeon/DCE4+: clear bios scratch dpms bit (v2) Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 72/88] target/iscsi: Fix network portal creation race Luis Henriques
                   ` (16 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johannes Weiner, Mel Gorman, Wu Fengguang, Andrew Morton,
	Linus Torvalds, Luis Henriques

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

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

From: Johannes Weiner <hannes@cmpxchg.org>

commit a804552b9a15c931cfc2a92a2e0aed1add8b580a upstream.

Tejun reported stuttering and latency spikes on a system where random
tasks would enter direct reclaim and get stuck on dirty pages.  Around
50% of memory was occupied by tmpfs backed by an SSD, and another disk
(rotating) was reading and writing at max speed to shrink a partition.

: The problem was pretty ridiculous.  It's a 8gig machine w/ one ssd and 10k
: rpm harddrive and I could reliably reproduce constant stuttering every
: several seconds for as long as buffered IO was going on on the hard drive
: either with tmpfs occupying somewhere above 4gig or a test program which
: allocates about the same amount of anon memory.  Although swap usage was
: zero, turning off swap also made the problem go away too.
:
: The trigger conditions seem quite plausible - high anon memory usage w/
: heavy buffered IO and swap configured - and it's highly likely that this
: is happening in the wild too.  (this can happen with copying large files
: to usb sticks too, right?)

This patch (of 2):

The dirty_balance_reserve is an approximation of the fraction of free
pages that the page allocator does not make available for page cache
allocations.  As a result, it has to be taken into account when
calculating the amount of "dirtyable memory", the baseline to which
dirty_background_ratio and dirty_ratio are applied.

However, currently the reserve is subtracted from the sum of free and
reclaimable pages, which is non-sensical and leads to erroneous results
when the system is dominated by unreclaimable pages and the
dirty_balance_reserve is bigger than free+reclaimable.  In that case, at
least the already allocated cache should be considered dirtyable.

Fix the calculation by subtracting the reserve from the amount of free
pages, then adding the reclaimable pages on top.

[akpm@linux-foundation.org: fix CONFIG_HIGHMEM build]
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: Tejun Heo <tj@kernel.org>
Tested-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Reviewed-by: 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: Luis Henriques <luis.henriques@canonical.com>
---
 mm/page-writeback.c | 55 +++++++++++++++++++++++------------------------------
 1 file changed, 24 insertions(+), 31 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 194cc02..31ea8e2 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -173,6 +173,25 @@ static struct prop_descriptor vm_completions;
  * global dirtyable memory first.
  */
 
+/**
+ * zone_dirtyable_memory - number of dirtyable pages in a zone
+ * @zone: the zone
+ *
+ * Returns the zone's number of pages potentially available for dirty
+ * page cache.  This is the base value for the per-zone dirty limits.
+ */
+static unsigned long zone_dirtyable_memory(struct zone *zone)
+{
+	unsigned long nr_pages;
+
+	nr_pages = zone_page_state(zone, NR_FREE_PAGES);
+	nr_pages -= min(nr_pages, zone->dirty_balance_reserve);
+
+	nr_pages += zone_reclaimable_pages(zone);
+
+	return nr_pages;
+}
+
 static unsigned long highmem_dirtyable_memory(unsigned long total)
 {
 #ifdef CONFIG_HIGHMEM
@@ -180,11 +199,9 @@ static unsigned long highmem_dirtyable_memory(unsigned long total)
 	unsigned long x = 0;
 
 	for_each_node_state(node, N_HIGH_MEMORY) {
-		struct zone *z =
-			&NODE_DATA(node)->node_zones[ZONE_HIGHMEM];
+		struct zone *z = &NODE_DATA(node)->node_zones[ZONE_HIGHMEM];
 
-		x += zone_page_state(z, NR_FREE_PAGES) +
-		     zone_reclaimable_pages(z) - z->dirty_balance_reserve;
+		x += zone_dirtyable_memory(z);
 	}
 	/*
 	 * Unreclaimable memory (kernel memory or anonymous memory
@@ -220,9 +237,11 @@ static unsigned long global_dirtyable_memory(void)
 {
 	unsigned long x;
 
-	x = global_page_state(NR_FREE_PAGES) + global_reclaimable_pages();
+	x = global_page_state(NR_FREE_PAGES);
 	x -= min(x, dirty_balance_reserve);
 
+	x += global_reclaimable_pages();
+
 	if (!vm_highmem_is_dirtyable)
 		x -= highmem_dirtyable_memory(x);
 
@@ -271,32 +290,6 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty)
 }
 
 /**
- * zone_dirtyable_memory - number of dirtyable pages in a zone
- * @zone: the zone
- *
- * Returns the zone's number of pages potentially available for dirty
- * page cache.  This is the base value for the per-zone dirty limits.
- */
-static unsigned long zone_dirtyable_memory(struct zone *zone)
-{
-	/*
-	 * The effective global number of dirtyable pages may exclude
-	 * highmem as a big-picture measure to keep the ratio between
-	 * dirty memory and lowmem reasonable.
-	 *
-	 * But this function is purely about the individual zone and a
-	 * highmem zone can hold its share of dirty pages, so we don't
-	 * care about vm_highmem_is_dirtyable here.
-	 */
-	unsigned long nr_pages = zone_page_state(zone, NR_FREE_PAGES) +
-		zone_reclaimable_pages(zone);
-
-	/* don't allow this to underflow */
-	nr_pages -= min(nr_pages, zone->dirty_balance_reserve);
-	return nr_pages;
-}
-
-/**
  * zone_dirty_limit - maximum number of dirty pages allowed in a zone
  * @zone: the zone
  *
-- 
1.8.3.2


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

* [PATCH 3.5 72/88] target/iscsi: Fix network portal creation race
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (70 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 71/88] mm/page-writeback.c: fix dirty_balance_reserve subtraction from dirtyable memory Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 73/88] mm, oom: base root bonus on current usage Luis Henriques
                   ` (15 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andy Grover, Nicholas Bellinger, Luis Henriques

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

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

From: Andy Grover <agrover@redhat.com>

commit ee291e63293146db64668e8d65eb35c97e8324f4 upstream.

When creating network portals rapidly, such as when restoring a
configuration, LIO's code to reuse existing portals can return a false
negative if the thread hasn't run yet and set np_thread_state to
ISCSI_NP_THREAD_ACTIVE. This causes an error in the network stack
when attempting to bind to the same address/port.

This patch sets NP_THREAD_ACTIVE before the np is placed on g_np_list,
so even if the thread hasn't run yet, iscsit_get_np will return the
existing np.

Also, convert np_lock -> np_mutex + hold across adding new net portal
to g_np_list to prevent a race where two threads may attempt to create
the same network portal, resulting in one of them failing.

(nab: Add missing mutex_unlocks in iscsit_add_np failure paths)
(DanC: Fix incorrect spin_unlock -> spin_unlock_bh)

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/target/iscsi/iscsi_target.c | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 955392e..6e270f9 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -52,7 +52,7 @@
 static LIST_HEAD(g_tiqn_list);
 static LIST_HEAD(g_np_list);
 static DEFINE_SPINLOCK(tiqn_lock);
-static DEFINE_SPINLOCK(np_lock);
+static DEFINE_MUTEX(np_lock);
 
 static struct idr tiqn_idr;
 struct idr sess_idr;
@@ -264,6 +264,9 @@ int iscsit_deaccess_np(struct iscsi_np *np, struct iscsi_portal_group *tpg)
 	return 0;
 }
 
+/*
+ * Called with mutex np_lock held
+ */
 static struct iscsi_np *iscsit_get_np(
 	struct __kernel_sockaddr_storage *sockaddr,
 	int network_transport)
@@ -274,11 +277,10 @@ static struct iscsi_np *iscsit_get_np(
 	int ip_match = 0;
 	u16 port;
 
-	spin_lock_bh(&np_lock);
 	list_for_each_entry(np, &g_np_list, np_list) {
-		spin_lock(&np->np_thread_lock);
+		spin_lock_bh(&np->np_thread_lock);
 		if (np->np_thread_state != ISCSI_NP_THREAD_ACTIVE) {
-			spin_unlock(&np->np_thread_lock);
+			spin_unlock_bh(&np->np_thread_lock);
 			continue;
 		}
 
@@ -311,13 +313,11 @@ static struct iscsi_np *iscsit_get_np(
 			 * while iscsi_tpg_add_network_portal() is called.
 			 */
 			np->np_exports++;
-			spin_unlock(&np->np_thread_lock);
-			spin_unlock_bh(&np_lock);
+			spin_unlock_bh(&np->np_thread_lock);
 			return np;
 		}
-		spin_unlock(&np->np_thread_lock);
+		spin_unlock_bh(&np->np_thread_lock);
 	}
-	spin_unlock_bh(&np_lock);
 
 	return NULL;
 }
@@ -331,16 +331,22 @@ struct iscsi_np *iscsit_add_np(
 	struct sockaddr_in6 *sock_in6;
 	struct iscsi_np *np;
 	int ret;
+
+	mutex_lock(&np_lock);
+
 	/*
 	 * Locate the existing struct iscsi_np if already active..
 	 */
 	np = iscsit_get_np(sockaddr, network_transport);
-	if (np)
+	if (np) {
+		mutex_unlock(&np_lock);
 		return np;
+	}
 
 	np = kzalloc(sizeof(struct iscsi_np), GFP_KERNEL);
 	if (!np) {
 		pr_err("Unable to allocate memory for struct iscsi_np\n");
+		mutex_unlock(&np_lock);
 		return ERR_PTR(-ENOMEM);
 	}
 
@@ -363,6 +369,7 @@ struct iscsi_np *iscsit_add_np(
 	ret = iscsi_target_setup_login_socket(np, sockaddr);
 	if (ret != 0) {
 		kfree(np);
+		mutex_unlock(&np_lock);
 		return ERR_PTR(ret);
 	}
 
@@ -371,6 +378,7 @@ struct iscsi_np *iscsit_add_np(
 		pr_err("Unable to create kthread: iscsi_np\n");
 		ret = PTR_ERR(np->np_thread);
 		kfree(np);
+		mutex_unlock(&np_lock);
 		return ERR_PTR(ret);
 	}
 	/*
@@ -381,10 +389,10 @@ struct iscsi_np *iscsit_add_np(
 	 * point because iscsi_np has not been added to g_np_list yet.
 	 */
 	np->np_exports = 1;
+	np->np_thread_state = ISCSI_NP_THREAD_ACTIVE;
 
-	spin_lock_bh(&np_lock);
 	list_add_tail(&np->np_list, &g_np_list);
-	spin_unlock_bh(&np_lock);
+	mutex_unlock(&np_lock);
 
 	pr_debug("CORE[0] - Added Network Portal: %s:%hu on %s\n",
 		np->np_ip, np->np_port, (np->np_network_transport == ISCSI_TCP) ?
@@ -455,9 +463,9 @@ int iscsit_del_np(struct iscsi_np *np)
 	}
 	iscsit_del_np_comm(np);
 
-	spin_lock_bh(&np_lock);
+	mutex_lock(&np_lock);
 	list_del(&np->np_list);
-	spin_unlock_bh(&np_lock);
+	mutex_unlock(&np_lock);
 
 	pr_debug("CORE[0] - Removed Network Portal: %s:%hu on %s\n",
 		np->np_ip, np->np_port, (np->np_network_transport == ISCSI_TCP) ?
-- 
1.8.3.2


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

* [PATCH 3.5 73/88] mm, oom: base root bonus on current usage
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (71 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 72/88] target/iscsi: Fix network portal creation race Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 74/88] x86, x32: Correct invalid use of user timespec in the kernel Luis Henriques
                   ` (14 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Rientjes, Michal Hocko, Andrew Morton, Linus Torvalds,
	Luis Henriques

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

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

From: David Rientjes <rientjes@google.com>

commit 778c14affaf94a9e4953179d3e13a544ccce7707 upstream.

A 3% of system memory bonus is sometimes too excessive in comparison to
other processes.

With commit a63d83f427fb ("oom: badness heuristic rewrite"), the OOM
killer tries to avoid killing privileged tasks by subtracting 3% of
overall memory (system or cgroup) from their per-task consumption.  But
as a result, all root tasks that consume less than 3% of overall memory
are considered equal, and so it only takes 33+ privileged tasks pushing
the system out of memory for the OOM killer to do something stupid and
kill dhclient or other root-owned processes.  For example, on a 32G
machine it can't tell the difference between the 1M agetty and the 10G
fork bomb member.

The changelog describes this 3% boost as the equivalent to the global
overcommit limit being 3% higher for privileged tasks, but this is not
the same as discounting 3% of overall memory from _every privileged task
individually_ during OOM selection.

Replace the 3% of system memory bonus with a 3% of current memory usage
bonus.

By giving root tasks a bonus that is proportional to their actual size,
they remain comparable even when relatively small.  In the example
above, the OOM killer will discount the 1M agetty's 256 badness points
down to 179, and the 10G fork bomb's 262144 points down to 183500 points
and make the right choice, instead of discounting both to 0 and killing
agetty because it's first in the task list.

Signed-off-by: David Rientjes <rientjes@google.com>
Reported-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
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: Luis Henriques <luis.henriques@canonical.com>
---
 Documentation/filesystems/proc.txt | 4 ++--
 mm/oom_kill.c                      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index fb0a6ae..a3d5e7d 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1333,8 +1333,8 @@ may allocate from based on an estimation of its current memory and swap use.
 For example, if a task is using all allowed memory, its badness score will be
 1000.  If it is using half of its allowed memory, its score will be 500.
 
-There is an additional factor included in the badness score: root
-processes are given 3% extra memory over other tasks.
+There is an additional factor included in the badness score: the current memory
+and swap usage is discounted by 3% for root processes.
 
 The amount of "allowed" memory depends on the context in which the oom killer
 was called.  If it is due to the memory assigned to the allocating task's cpuset
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index b45c813..0eba956 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -212,7 +212,7 @@ unsigned long oom_badness(struct task_struct *p, struct mem_cgroup *memcg,
 	 * implementation used by LSMs.
 	 */
 	if (has_capability_noaudit(p, CAP_SYS_ADMIN))
-		adj -= 30;
+		points -= (points * 3) / 100;
 
 	/* Normalize to oom_score_adj units */
 	adj *= totalpages / 1000;
-- 
1.8.3.2


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

* [PATCH 3.5 74/88] x86, x32: Correct invalid use of user timespec in the kernel
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (72 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 73/88] mm, oom: base root bonus on current usage Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 75/88] alpha: fix broken network checksum Luis Henriques
                   ` (13 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: PaX Team, H. Peter Anvin, Linus Torvalds, Luis Henriques

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

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

From: PaX Team <pageexec@freemail.hu>

commit 2def2ef2ae5f3990aabdbe8a755911902707d268 upstream.

The x32 case for the recvmsg() timout handling is broken:

  asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
                                      unsigned int vlen, unsigned int flags,
                                      struct compat_timespec __user *timeout)
  {
          int datagrams;
          struct timespec ktspec;

          if (flags & MSG_CMSG_COMPAT)
                  return -EINVAL;

          if (COMPAT_USE_64BIT_TIME)
                  return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
                                        flags | MSG_CMSG_COMPAT,
                                        (struct timespec *) timeout);
          ...

The timeout pointer parameter is provided by userland (hence the __user
annotation) but for x32 syscalls it's simply cast to a kernel pointer
and is passed to __sys_recvmmsg which will eventually directly
dereference it for both reading and writing.  Other callers to
__sys_recvmmsg properly copy from userland to the kernel first.

The bug was introduced by commit ee4fa23c4bfc ("compat: Use
COMPAT_USE_64BIT_TIME in net/compat.c") and should affect all kernels
since 3.4 (and perhaps vendor kernels if they backported x32 support
along with this code).

Note that CONFIG_X86_X32_ABI gets enabled at build time and only if
CONFIG_X86_X32 is enabled and ld can build x32 executables.

Other uses of COMPAT_USE_64BIT_TIME seem fine.

This addresses CVE-2014-0038.

Signed-off-by: PaX Team <pageexec@freemail.hu>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/compat.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/net/compat.c b/net/compat.c
index 1d223d5..9c0fca1 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -781,21 +781,16 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
 	if (flags & MSG_CMSG_COMPAT)
 		return -EINVAL;
 
-	if (COMPAT_USE_64BIT_TIME)
-		return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
-				      flags | MSG_CMSG_COMPAT,
-				      (struct timespec *) timeout);
-
 	if (timeout == NULL)
 		return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
 				      flags | MSG_CMSG_COMPAT, NULL);
 
-	if (get_compat_timespec(&ktspec, timeout))
+	if (compat_get_timespec(&ktspec, timeout))
 		return -EFAULT;
 
 	datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
 				   flags | MSG_CMSG_COMPAT, &ktspec);
-	if (datagrams > 0 && put_compat_timespec(&ktspec, timeout))
+	if (datagrams > 0 && compat_put_timespec(&ktspec, timeout))
 		datagrams = -EFAULT;
 
 	return datagrams;
-- 
1.8.3.2


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

* [PATCH 3.5 75/88] alpha: fix broken network checksum
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (73 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 74/88] x86, x32: Correct invalid use of user timespec in the kernel Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 76/88] ARM: at91: smc: bug fix in sam9_smc_cs_read() Luis Henriques
                   ` (12 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mikulas Patocka, Matt Turner, Luis Henriques

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

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

From: Mikulas Patocka <mpatocka@redhat.com>

commit 0ef38d70d4118b2ce1a538d14357be5ff9dc2bbd upstream.

The patch 3ddc5b46a8e90f3c9251338b60191d0a804b0d92 breaks networking on
alpha (there is a follow-up fix 5cfe8f1ba5eebe6f4b6e5858cdb1a5be4f3272a6,
but networking is still broken even with the second patch).

The patch 3ddc5b46a8e90f3c9251338b60191d0a804b0d92 makes
csum_partial_copy_from_user check the pointer with access_ok. However,
csum_partial_copy_from_user is called also from csum_partial_copy_nocheck
and csum_partial_copy_nocheck is called on kernel pointers and it is
supposed not to check pointer validity.

This bug results in ssh session hangs if the system is loaded and bulk
data are printed to ssh terminal.

This patch fixes csum_partial_copy_nocheck to call set_fs(KERNEL_DS), so
that access_ok in csum_partial_copy_from_user accepts kernel-space
addresses.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/alpha/lib/csum_partial_copy.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/alpha/lib/csum_partial_copy.c b/arch/alpha/lib/csum_partial_copy.c
index 40736da..1d2ef5a 100644
--- a/arch/alpha/lib/csum_partial_copy.c
+++ b/arch/alpha/lib/csum_partial_copy.c
@@ -373,6 +373,11 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,
 __wsum
 csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
 {
-	return csum_partial_copy_from_user((__force const void __user *)src,
-			dst, len, sum, NULL);
+	__wsum checksum;
+	mm_segment_t oldfs = get_fs();
+	set_fs(KERNEL_DS);
+	checksum = csum_partial_copy_from_user((__force const void __user *)src,
+						dst, len, sum, NULL);
+	set_fs(oldfs);
+	return checksum;
 }
-- 
1.8.3.2


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

* [PATCH 3.5 76/88] ARM: at91: smc: bug fix in sam9_smc_cs_read()
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (74 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 75/88] alpha: fix broken network checksum Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 77/88] KVM: s390: fix diagnose code extraction Luis Henriques
                   ` (11 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jean-Jacques Hiblot, Nicolas Ferre, Kevin Hilman, Luis Henriques

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

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

From: Jean-Jacques Hiblot <jjhiblot@traphandler.com>

commit 1588c51cf6d782e63a8719681d905ef0ac22ee62 upstream.

There was a copy/paste error when reading the nwe_pulse value.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Acked-by: Boris BREZILLON <b.brezillon@overkiz.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-at91/sam9_smc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
index 99a0a1d..b26156b 100644
--- a/arch/arm/mach-at91/sam9_smc.c
+++ b/arch/arm/mach-at91/sam9_smc.c
@@ -101,7 +101,7 @@ static void sam9_smc_cs_read(void __iomem *base,
 	/* Pulse register */
 	val = __raw_readl(base + AT91_SMC_PULSE);
 
-	config->nwe_setup = val & AT91_SMC_NWEPULSE;
+	config->nwe_pulse = val & AT91_SMC_NWEPULSE;
 	config->ncs_write_pulse = (val & AT91_SMC_NCS_WRPULSE) >> 8;
 	config->nrd_pulse = (val & AT91_SMC_NRDPULSE) >> 16;
 	config->ncs_read_pulse = (val & AT91_SMC_NCS_RDPULSE) >> 24;
-- 
1.8.3.2


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

* [PATCH 3.5 77/88] KVM: s390: fix diagnose code extraction
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (75 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 76/88] ARM: at91: smc: bug fix in sam9_smc_cs_read() Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 78/88] e752x_edac: Fix pci_dev usage count Luis Henriques
                   ` (10 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Heiko Carstens, Cornelia Huck, Luis Henriques

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

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

From: Heiko Carstens <heiko.carstens@de.ibm.com>

commit 743db27c526e0f31cc507959d662e97e2048a86f upstream.

The diagnose code to be used is the contents of the base register (if not
zero), plus the displacement. The current code ignores the base register
contents. So let's fix that...

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/s390/kvm/diag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index b23d9ac..e071600 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -103,7 +103,7 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu)
 
 int kvm_s390_handle_diag(struct kvm_vcpu *vcpu)
 {
-	int code = (vcpu->arch.sie_block->ipb & 0xfff0000) >> 16;
+	int code = kvm_s390_get_base_disp_rs(vcpu) & 0xffff;
 
 	switch (code) {
 	case 0x10:
-- 
1.8.3.2


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

* [PATCH 3.5 78/88] e752x_edac: Fix pci_dev usage count
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (76 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 77/88] KVM: s390: fix diagnose code extraction Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 79/88] lib/decompressors: fix "no limit" output buffer length Luis Henriques
                   ` (9 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Aristeu Rozanski, Borislav Petkov, Jean Delvare, Luis Henriques

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

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

From: Aristeu Rozanski <aris@redhat.com>

commit 90ed4988b8c030d65b41b7d13140e9376dc6ec5a upstream.

In case the device 0, function 1 is not found using pci_get_device(),
pci_scan_single_device() will be used but, differently than
pci_get_device(), it allocates a pci_dev but doesn't does bump the usage
count on the pci_dev and after few module removals and loads the pci_dev
will be freed.

Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Reviewed-by: mark gross <mark.gross@intel.com>
Link: http://lkml.kernel.org/r/20131205153755.GL4545@redhat.com
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/edac/e752x_edac.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 3186512..847f248 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -1182,9 +1182,11 @@ static int e752x_get_devs(struct pci_dev *pdev, int dev_idx,
 	pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
 				pvt->dev_info->err_dev, pvt->bridge_ck);
 
-	if (pvt->bridge_ck == NULL)
+	if (pvt->bridge_ck == NULL) {
 		pvt->bridge_ck = pci_scan_single_device(pdev->bus,
 							PCI_DEVFN(0, 1));
+		pci_dev_get(pvt->bridge_ck);
+	}
 
 	if (pvt->bridge_ck == NULL) {
 		e752x_printk(KERN_ERR, "error reporting device not found:"
-- 
1.8.3.2


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

* [PATCH 3.5 79/88] lib/decompressors: fix "no limit" output buffer length
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (77 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 78/88] e752x_edac: Fix pci_dev usage count Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 80/88] bnx2x: fix DMA unmapping of TSO split BDs Luis Henriques
                   ` (8 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexandre Courbot, Stephen Warren, Andrew Morton, Linus Torvalds,
	Mark Brown, Luis Henriques

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

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

From: Alexandre Courbot <acourbot@nvidia.com>

commit 1431574a1c4c669a0c198e4763627837416e4443 upstream.

When decompressing into memory, the output buffer length is set to some
arbitrarily high value (0x7fffffff) to indicate the output is, virtually,
unlimited in size.

The problem with this is that some platforms have their physical memory at
high physical addresses (0x80000000 or more), and that the output buffer
address and its "unlimited" length cannot be added without overflowing.
An example of this can be found in inflate_fast():

/* next_out is the output buffer address */
out = strm->next_out - OFF;
/* avail_out is the output buffer size. end will overflow if the output
 * address is >= 0x80000104 */
end = out + (strm->avail_out - 257);

This has huge consequences on the performance of kernel decompression,
since the following exit condition of inflate_fast() will be always true:

} while (in < last && out < end);

Indeed, "end" has overflowed and is now always lower than "out".  As a
result, inflate_fast() will return after processing one single byte of
input data, and will thus need to be called an unreasonably high number of
times.  This probably went unnoticed because kernel decompression is fast
enough even with this issue.

Nonetheless, adjusting the output buffer length in such a way that the
above pointer arithmetic never overflows results in a kernel decompression
that is about 3 times faster on affected machines.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 lib/decompress_inflate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c
index 19ff89e..d619b28 100644
--- a/lib/decompress_inflate.c
+++ b/lib/decompress_inflate.c
@@ -48,7 +48,7 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
 		out_len = 0x8000; /* 32 K */
 		out_buf = malloc(out_len);
 	} else {
-		out_len = 0x7fffffff; /* no limit */
+		out_len = ((size_t)~0) - (size_t)out_buf; /* no limit */
 	}
 	if (!out_buf) {
 		error("Out of memory while allocating output buffer");
-- 
1.8.3.2


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

* [PATCH 3.5 80/88] bnx2x: fix DMA unmapping of TSO split BDs
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (78 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 79/88] lib/decompressors: fix "no limit" output buffer length Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 81/88] inet_diag: fix inet_diag_dump_icsk() timewait socket state logic Luis Henriques
                   ` (7 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michal Schmidt, David S. Miller, Luis Henriques

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

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

From: Michal Schmidt <mschmidt@redhat.com>

commit 95e92fd40c967c363ad66b2fd1ce4dcd68132e54 upstream.

bnx2x triggers warnings with CONFIG_DMA_API_DEBUG=y:

  WARNING: CPU: 0 PID: 2253 at lib/dma-debug.c:887 check_unmap+0xf8/0x920()
  bnx2x 0000:28:00.0: DMA-API: device driver frees DMA memory with
  different size [device address=0x00000000da2b389e] [map size=1490 bytes]
  [unmap size=66 bytes]

The reason is that bnx2x splits a TSO BD into two BDs (headers + data)
using one DMA mapping for both, but it uses only the length of the first
BD when unmapping.

This patch fixes the bug by unmapping the whole length of the two BDs.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 27c2843..67d34eb 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -70,6 +70,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata,
 	struct sk_buff *skb = tx_buf->skb;
 	u16 bd_idx = TX_BD(tx_buf->first_bd), new_cons;
 	int nbd;
+	u16 split_bd_len = 0;
 
 	/* prefetch skb end pointer to speedup dev_kfree_skb() */
 	prefetch(&skb->end);
@@ -77,10 +78,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata,
 	DP(NETIF_MSG_TX_DONE, "fp[%d]: pkt_idx %d  buff @(%p)->skb %p\n",
 	   txdata->txq_index, idx, tx_buf, skb);
 
-	/* unmap first bd */
 	tx_start_bd = &txdata->tx_desc_ring[bd_idx].start_bd;
-	dma_unmap_single(&bp->pdev->dev, BD_UNMAP_ADDR(tx_start_bd),
-			 BD_UNMAP_LEN(tx_start_bd), DMA_TO_DEVICE);
 
 
 	nbd = le16_to_cpu(tx_start_bd->nbd) - 1;
@@ -99,12 +97,19 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata,
 	--nbd;
 	bd_idx = TX_BD(NEXT_TX_IDX(bd_idx));
 
-	/* ...and the TSO split header bd since they have no mapping */
+	/* TSO headers+data bds share a common mapping. See bnx2x_tx_split() */
 	if (tx_buf->flags & BNX2X_TSO_SPLIT_BD) {
+		tx_data_bd = &txdata->tx_desc_ring[bd_idx].reg_bd;
+		split_bd_len = BD_UNMAP_LEN(tx_data_bd);
 		--nbd;
 		bd_idx = TX_BD(NEXT_TX_IDX(bd_idx));
 	}
 
+	/* unmap first bd */
+	dma_unmap_single(&bp->pdev->dev, BD_UNMAP_ADDR(tx_start_bd),
+			 BD_UNMAP_LEN(tx_start_bd) + split_bd_len,
+			 DMA_TO_DEVICE);
+
 	/* now free frags */
 	while (nbd > 0) {
 
-- 
1.8.3.2


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

* [PATCH 3.5 81/88] inet_diag: fix inet_diag_dump_icsk() timewait socket state logic
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (79 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 80/88] bnx2x: fix DMA unmapping of TSO split BDs Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 82/88] net: avoid reference counter overflows on fib_rules in multicast forwarding Luis Henriques
                   ` (6 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Neal Cardwell, Eric Dumazet, Luis Henriques

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

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

From: Neal Cardwell <ncardwell@google.com>

[ Based upon upstream commit 70315d22d3c7383f9a508d0aab21e2eb35b2303a ]

Fix inet_diag_dump_icsk() to reflect the fact that both TIME_WAIT and
FIN_WAIT2 connections are represented by inet_timewait_sock (not just
TIME_WAIT). Thus:

(a) We need to iterate through the time_wait buckets if the user wants
either TIME_WAIT or FIN_WAIT2. (Before fixing this, "ss -nemoi state
fin-wait-2" would not return any sockets, even if there were some in
FIN_WAIT2.)

(b) We need to check tw_substate to see if the user wants to dump
sockets in the particular substate (TIME_WAIT or FIN_WAIT2) that a
given connection is in. (Before fixing this, "ss -nemoi state
time-wait" would actually return sockets in state FIN_WAIT2.)

An analogous fix is in v3.13: 70315d22d3c7383f9a508d0aab21e2eb35b2303a
("inet_diag: fix inet_diag_dump_icsk() to use correct state for
timewait sockets") but that patch is quite different because 3.13 code
is very different in this area due to the unification of TCP hash
tables in 05dbc7b ("tcp/dccp: remove twchain") in v3.13-rc1.

I tested that this applies cleanly between v3.3 and v3.12, and tested
that it works in both 3.3 and 3.12. It does not apply cleanly to 3.2
and earlier (though it makes semantic sense), and semantically is not
the right fix for 3.13 and beyond (as mentioned above).

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/inet_diag.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index e530c31..60e48d7 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -941,7 +941,7 @@ next_normal:
 			++num;
 		}
 
-		if (r->idiag_states & TCPF_TIME_WAIT) {
+		if (r->idiag_states & (TCPF_TIME_WAIT | TCPF_FIN_WAIT2)) {
 			struct inet_timewait_sock *tw;
 
 			inet_twsk_for_each(tw, node,
@@ -949,6 +949,8 @@ next_normal:
 
 				if (num < s_num)
 					goto next_dying;
+				if (!(r->idiag_states & (1 << tw->tw_substate)))
+					goto next_dying;
 				if (r->sdiag_family != AF_UNSPEC &&
 						tw->tw_family != r->sdiag_family)
 					goto next_dying;
-- 
1.8.3.2


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

* [PATCH 3.5 82/88] net: avoid reference counter overflows on fib_rules in multicast forwarding
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (80 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 81/88] inet_diag: fix inet_diag_dump_icsk() timewait socket state logic Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 83/88] net,via-rhine: Fix tx_timeout handling Luis Henriques
                   ` (5 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Patrick McHardy, Thomas Graf, Julian Anastasov, Eric Dumazet,
	Hannes Frederic Sowa, David S. Miller, Luis Henriques

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

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

From: Hannes Frederic Sowa <hannes@stressinduktion.org>

commit 95f4a45de1a0f172b35451fc52283290adb21f6e upstream.

Bob Falken reported that after 4G packets, multicast forwarding stopped
working. This was because of a rule reference counter overflow which
freed the rule as soon as the overflow happend.

This patch solves this by adding the FIB_LOOKUP_NOREF flag to
fib_rules_lookup calls. This is safe even from non-rcu locked sections
as in this case the flag only implies not taking a reference to the rule,
which we don't need at all.

Rules only hold references to the namespace, which are guaranteed to be
available during the call of the non-rcu protected function reg_vif_xmit
because of the interface reference which itself holds a reference to
the net namespace.

Fixes: f0ad0860d01e47 ("ipv4: ipmr: support multiple tables")
Fixes: d1db275dd3f6e4 ("ipv6: ip6mr: support multiple tables")
Reported-by: Bob Falken <NetFestivalHaveFun@gmx.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Thomas Graf <tgraf@suug.ch>
Cc: Julian Anastasov <ja@ssi.bg>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/ipmr.c  | 7 +++++--
 net/ipv6/ip6mr.c | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index f780fa3..7fa2594 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -154,9 +154,12 @@ static struct mr_table *ipmr_get_table(struct net *net, u32 id)
 static int ipmr_fib_lookup(struct net *net, struct flowi4 *flp4,
 			   struct mr_table **mrt)
 {
-	struct ipmr_result res;
-	struct fib_lookup_arg arg = { .result = &res, };
 	int err;
+	struct ipmr_result res;
+	struct fib_lookup_arg arg = {
+		.result = &res,
+		.flags = FIB_LOOKUP_NOREF,
+	};
 
 	err = fib_rules_lookup(net->ipv4.mr_rules_ops,
 			       flowi4_to_flowi(flp4), 0, &arg);
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 65dff8a..2df3e4a 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -138,9 +138,12 @@ static struct mr6_table *ip6mr_get_table(struct net *net, u32 id)
 static int ip6mr_fib_lookup(struct net *net, struct flowi6 *flp6,
 			    struct mr6_table **mrt)
 {
-	struct ip6mr_result res;
-	struct fib_lookup_arg arg = { .result = &res, };
 	int err;
+	struct ip6mr_result res;
+	struct fib_lookup_arg arg = {
+		.result = &res,
+		.flags = FIB_LOOKUP_NOREF,
+	};
 
 	err = fib_rules_lookup(net->ipv6.mr6_rules_ops,
 			       flowi6_to_flowi(flp6), 0, &arg);
-- 
1.8.3.2


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

* [PATCH 3.5 83/88] net,via-rhine: Fix tx_timeout handling
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (81 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 82/88] net: avoid reference counter overflows on fib_rules in multicast forwarding Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 84/88] mm: hugetlbfs: fix hugetlbfs optimization Luis Henriques
                   ` (4 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Richard Weinberger, David S. Miller, Luis Henriques

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

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

From: Richard Weinberger <richard@nod.at>

commit a926592f5e4e900f3fa903298c4619a131e60963 upstream.

rhine_reset_task() misses to disable the tx scheduler upon reset,
this can lead to a crash if work is still scheduled while we're resetting
the tx queue.

Fixes:
[   93.591707] BUG: unable to handle kernel NULL pointer dereference at 0000004c
[   93.595514] IP: [<c119d10d>] rhine_napipoll+0x491/0x6

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/via/via-rhine.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index 4c1099e..5aa8caa 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -1601,6 +1601,7 @@ static void rhine_reset_task(struct work_struct *work)
 		goto out_unlock;
 
 	napi_disable(&rp->napi);
+	netif_tx_disable(dev);
 	spin_lock_bh(&rp->lock);
 
 	/* clear all descriptors */
-- 
1.8.3.2


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

* [PATCH 3.5 84/88] mm: hugetlbfs: fix hugetlbfs optimization
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (82 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 83/88] net,via-rhine: Fix tx_timeout handling Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 85/88] usb: core: get config and string descriptors for unauthorized devices Luis Henriques
                   ` (3 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Khalid Aziz, Andrea Arcangeli, Pravin Shelar, Greg Kroah-Hartman,
	Ben Hutchings, Christoph Lameter, Johannes Weiner, Mel Gorman,
	Rik van Riel, Andi Kleen, Minchan Kim, Andrew Morton,
	Linus Torvalds, Guillaume Morin, Luis Henriques

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

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

From: Andrea Arcangeli <aarcange@redhat.com>

commit 27c73ae759774e63313c1fbfeb17ba076cea64c5 upstream.

Commit 7cb2ef56e6a8 ("mm: fix aio performance regression for database
caused by THP") can cause dereference of a dangling pointer if
split_huge_page runs during PageHuge() if there are updates to the
tail_page->private field.

Also it is repeating compound_head twice for hugetlbfs and it is running
compound_head+compound_trans_head for THP when a single one is needed in
both cases.

The new code within the PageSlab() check doesn't need to verify that the
THP page size is never bigger than the smallest hugetlbfs page size, to
avoid memory corruption.

A longstanding theoretical race condition was found while fixing the
above (see the change right after the skip_unlock label, that is
relevant for the compound_lock path too).

By re-establishing the _mapcount tail refcounting for all compound
pages, this also fixes the below problem:

  echo 0 >/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

  BUG: Bad page state in process bash  pfn:59a01
  page:ffffea000139b038 count:0 mapcount:10 mapping:          (null) index:0x0
  page flags: 0x1c00000000008000(tail)
  Modules linked in:
  CPU: 6 PID: 2018 Comm: bash Not tainted 3.12.0+ #25
  Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
  Call Trace:
    dump_stack+0x55/0x76
    bad_page+0xd5/0x130
    free_pages_prepare+0x213/0x280
    __free_pages+0x36/0x80
    update_and_free_page+0xc1/0xd0
    free_pool_huge_page+0xc2/0xe0
    set_max_huge_pages.part.58+0x14c/0x220
    nr_hugepages_store_common.isra.60+0xd0/0xf0
    nr_hugepages_store+0x13/0x20
    kobj_attr_store+0xf/0x20
    sysfs_write_file+0x189/0x1e0
    vfs_write+0xc5/0x1f0
    SyS_write+0x55/0xb0
    system_call_fastpath+0x16/0x1b

Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Tested-by: Khalid Aziz <khalid.aziz@oracle.com>
Cc: Pravin Shelar <pshelar@nicira.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Guillaume Morin <guillaume@morinfr.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/hugetlb.h |   6 ++
 mm/hugetlb.c            |  17 ++++++
 mm/swap.c               | 143 ++++++++++++++++++++++++++++--------------------
 3 files changed, 106 insertions(+), 60 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 9003fe3..16df330 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -24,6 +24,7 @@ struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
 void hugepage_put_subpool(struct hugepage_subpool *spool);
 
 int PageHuge(struct page *page);
+int PageHeadHuge(struct page *page_head);
 
 void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
 int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
@@ -85,6 +86,11 @@ static inline int PageHuge(struct page *page)
 	return 0;
 }
 
+static inline int PageHeadHuge(struct page *page_head)
+{
+	return 0;
+}
+
 static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma)
 {
 }
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 44fd603..6c53091 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -679,6 +679,23 @@ int PageHuge(struct page *page)
 }
 EXPORT_SYMBOL_GPL(PageHuge);
 
+/*
+ * PageHeadHuge() only returns true for hugetlbfs head page, but not for
+ * normal or transparent huge pages.
+ */
+int PageHeadHuge(struct page *page_head)
+{
+	compound_page_dtor *dtor;
+
+	if (!PageHead(page_head))
+		return 0;
+
+	dtor = get_compound_page_dtor(page_head);
+
+	return dtor == free_huge_page;
+}
+EXPORT_SYMBOL_GPL(PageHeadHuge);
+
 pgoff_t __basepage_index(struct page *page)
 {
 	struct page *page_head = compound_head(page);
diff --git a/mm/swap.c b/mm/swap.c
index 0c833e8..6325163 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -78,19 +78,6 @@ static void __put_compound_page(struct page *page)
 
 static void put_compound_page(struct page *page)
 {
-	/*
-	 * hugetlbfs pages cannot be split from under us.  If this is a
-	 * hugetlbfs page, check refcount on head page and release the page if
-	 * the refcount becomes zero.
-	 */
-	if (PageHuge(page)) {
-		page = compound_head(page);
-		if (put_page_testzero(page))
-			__put_compound_page(page);
-
-		return;
-	}
-
 	if (unlikely(PageTail(page))) {
 		/* __split_huge_page_refcount can run under us */
 		struct page *page_head = compound_trans_head(page);
@@ -107,14 +94,31 @@ static void put_compound_page(struct page *page)
 			 * still hot on arches that do not support
 			 * this_cpu_cmpxchg_double().
 			 */
-			if (PageSlab(page_head)) {
-				if (PageTail(page)) {
+			if (PageSlab(page_head) || PageHeadHuge(page_head)) {
+				if (likely(PageTail(page))) {
+					/*
+					 * __split_huge_page_refcount
+					 * cannot race here.
+					 */
+					VM_BUG_ON(!PageHead(page_head));
+					atomic_dec(&page->_mapcount);
 					if (put_page_testzero(page_head))
 						VM_BUG_ON(1);
-
-					atomic_dec(&page->_mapcount);
-					goto skip_lock_tail;
+					if (put_page_testzero(page_head))
+						__put_compound_page(page_head);
+					return;
 				} else
+					/*
+					 * __split_huge_page_refcount
+					 * run before us, "page" was a
+					 * THP tail. The split
+					 * page_head has been freed
+					 * and reallocated as slab or
+					 * hugetlbfs page of smaller
+					 * order (only possible if
+					 * reallocated as slab on
+					 * x86).
+					 */
 					goto skip_lock;
 			}
 			/*
@@ -128,8 +132,27 @@ static void put_compound_page(struct page *page)
 				/* __split_huge_page_refcount run before us */
 				compound_unlock_irqrestore(page_head, flags);
 skip_lock:
-				if (put_page_testzero(page_head))
-					__put_single_page(page_head);
+				if (put_page_testzero(page_head)) {
+					/*
+					 * The head page may have been
+					 * freed and reallocated as a
+					 * compound page of smaller
+					 * order and then freed again.
+					 * All we know is that it
+					 * cannot have become: a THP
+					 * page, a compound page of
+					 * higher order, a tail page.
+					 * That is because we still
+					 * hold the refcount of the
+					 * split THP tail and
+					 * page_head was the THP head
+					 * before the split.
+					 */
+					if (PageHead(page_head))
+						__put_compound_page(page_head);
+					else
+						__put_single_page(page_head);
+				}
 out_put_single:
 				if (put_page_testzero(page))
 					__put_single_page(page);
@@ -151,7 +174,6 @@ out_put_single:
 			VM_BUG_ON(atomic_read(&page->_count) != 0);
 			compound_unlock_irqrestore(page_head, flags);
 
-skip_lock_tail:
 			if (put_page_testzero(page_head)) {
 				if (PageHead(page_head))
 					__put_compound_page(page_head);
@@ -194,51 +216,52 @@ bool __get_page_tail(struct page *page)
 	 * proper PT lock that already serializes against
 	 * split_huge_page().
 	 */
+	unsigned long flags;
 	bool got = false;
-	struct page *page_head;
-
-	/*
-	 * If this is a hugetlbfs page it cannot be split under us.  Simply
-	 * increment refcount for the head page.
-	 */
-	if (PageHuge(page)) {
-		page_head = compound_head(page);
-		atomic_inc(&page_head->_count);
-		got = true;
-	} else {
-		unsigned long flags;
+	struct page *page_head = compound_trans_head(page);
 
-		page_head = compound_trans_head(page);
-		if (likely(page != page_head &&
-					get_page_unless_zero(page_head))) {
-
-			/* Ref to put_compound_page() comment. */
-			if (PageSlab(page_head)) {
-				if (likely(PageTail(page))) {
-					__get_page_tail_foll(page, false);
-					return true;
-				} else {
-					put_page(page_head);
-					return false;
-				}
-			}
-
-			/*
-			 * page_head wasn't a dangling pointer but it
-			 * may not be a head page anymore by the time
-			 * we obtain the lock. That is ok as long as it
-			 * can't be freed from under us.
-			 */
-			flags = compound_lock_irqsave(page_head);
-			/* here __split_huge_page_refcount won't run anymore */
+	if (likely(page != page_head && get_page_unless_zero(page_head))) {
+		/* Ref to put_compound_page() comment. */
+		if (PageSlab(page_head) || PageHeadHuge(page_head)) {
 			if (likely(PageTail(page))) {
+				/*
+				 * This is a hugetlbfs page or a slab
+				 * page. __split_huge_page_refcount
+				 * cannot race here.
+				 */
+				VM_BUG_ON(!PageHead(page_head));
 				__get_page_tail_foll(page, false);
-				got = true;
-			}
-			compound_unlock_irqrestore(page_head, flags);
-			if (unlikely(!got))
+				return true;
+			} else {
+				/*
+				 * __split_huge_page_refcount run
+				 * before us, "page" was a THP
+				 * tail. The split page_head has been
+				 * freed and reallocated as slab or
+				 * hugetlbfs page of smaller order
+				 * (only possible if reallocated as
+				 * slab on x86).
+				 */
 				put_page(page_head);
+				return false;
+			}
+		}
+
+		/*
+		 * page_head wasn't a dangling pointer but it
+		 * may not be a head page anymore by the time
+		 * we obtain the lock. That is ok as long as it
+		 * can't be freed from under us.
+		 */
+		flags = compound_lock_irqsave(page_head);
+		/* here __split_huge_page_refcount won't run anymore */
+		if (likely(PageTail(page))) {
+			__get_page_tail_foll(page, false);
+			got = true;
 		}
+		compound_unlock_irqrestore(page_head, flags);
+		if (unlikely(!got))
+			put_page(page_head);
 	}
 	return got;
 }
-- 
1.8.3.2


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

* [PATCH 3.5 85/88] usb: core: get config and string descriptors for unauthorized devices
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (83 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 84/88] mm: hugetlbfs: fix hugetlbfs optimization Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 86/88] tty/serial: at91: Handle shutdown more safely Luis Henriques
                   ` (2 subsequent siblings)
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Pugliese, Greg Kroah-Hartman, Luis Henriques

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

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

From: Thomas Pugliese <thomas.pugliese@gmail.com>

commit 83e83ecb79a8225e79bc8e54e9aff3e0e27658a2 upstream.

There is no need to skip querying the config and string descriptors for
unauthorized WUSB devices when usb_new_device is called.  It is allowed
by WUSB spec.  The only action that needs to be delayed until
authorization time is the set config.  This change allows user mode
tools to see the config and string descriptors earlier in enumeration
which is needed for some WUSB devices to function properly on Android
systems.  It also reduces the amount of divergent code paths needed
for WUSB devices.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/core/config.c |  7 -------
 drivers/usb/core/hub.c    | 40 +++++++---------------------------------
 2 files changed, 7 insertions(+), 40 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 78609d3..6ed7e7c 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -651,10 +651,6 @@ void usb_destroy_configuration(struct usb_device *dev)
  *
  * hub-only!! ... and only in reset path, or usb_new_device()
  * (used by real hubs and virtual root hubs)
- *
- * NOTE: if this is a WUSB device and is not authorized, we skip the
- *       whole thing. A non-authorized USB device has no
- *       configurations.
  */
 int usb_get_configuration(struct usb_device *dev)
 {
@@ -666,8 +662,6 @@ int usb_get_configuration(struct usb_device *dev)
 	struct usb_config_descriptor *desc;
 
 	cfgno = 0;
-	if (dev->authorized == 0)	/* Not really an error */
-		goto out_not_authorized;
 	result = -ENOMEM;
 	if (ncfg > USB_MAXCONFIG) {
 		dev_warn(ddev, "too many configurations: %d, "
@@ -749,7 +743,6 @@ int usb_get_configuration(struct usb_device *dev)
 
 err:
 	kfree(desc);
-out_not_authorized:
 	dev->descriptor.bNumConfigurations = cfgno;
 err2:
 	if (result == -ENOMEM)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 5e67525..d13f9a7 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2146,18 +2146,13 @@ static int usb_enumerate_device(struct usb_device *udev)
 			goto fail;
 		}
 	}
-	if (udev->wusb == 1 && udev->authorized == 0) {
-		udev->product = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-		udev->manufacturer = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-		udev->serial = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-	}
-	else {
-		/* read the standard strings and cache them if present */
-		udev->product = usb_cache_string(udev, udev->descriptor.iProduct);
-		udev->manufacturer = usb_cache_string(udev,
-						      udev->descriptor.iManufacturer);
-		udev->serial = usb_cache_string(udev, udev->descriptor.iSerialNumber);
-	}
+
+	/* read the standard strings and cache them if present */
+	udev->product = usb_cache_string(udev, udev->descriptor.iProduct);
+	udev->manufacturer = usb_cache_string(udev,
+					      udev->descriptor.iManufacturer);
+	udev->serial = usb_cache_string(udev, udev->descriptor.iSerialNumber);
+
 	err = usb_enumerate_device_otg(udev);
 fail:
 	return err;
@@ -2311,16 +2306,6 @@ int usb_deauthorize_device(struct usb_device *usb_dev)
 	usb_dev->authorized = 0;
 	usb_set_configuration(usb_dev, -1);
 
-	kfree(usb_dev->product);
-	usb_dev->product = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-	kfree(usb_dev->manufacturer);
-	usb_dev->manufacturer = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-	kfree(usb_dev->serial);
-	usb_dev->serial = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-
-	usb_destroy_configuration(usb_dev);
-	usb_dev->descriptor.bNumConfigurations = 0;
-
 out_unauthorized:
 	usb_unlock_device(usb_dev);
 	return 0;
@@ -2348,17 +2333,7 @@ int usb_authorize_device(struct usb_device *usb_dev)
 		goto error_device_descriptor;
 	}
 
-	kfree(usb_dev->product);
-	usb_dev->product = NULL;
-	kfree(usb_dev->manufacturer);
-	usb_dev->manufacturer = NULL;
-	kfree(usb_dev->serial);
-	usb_dev->serial = NULL;
-
 	usb_dev->authorized = 1;
-	result = usb_enumerate_device(usb_dev);
-	if (result < 0)
-		goto error_enumerate;
 	/* Choose and set the configuration.  This registers the interfaces
 	 * with the driver core and lets interface drivers bind to them.
 	 */
@@ -2374,7 +2349,6 @@ int usb_authorize_device(struct usb_device *usb_dev)
 	}
 	dev_info(&usb_dev->dev, "authorized to connect\n");
 
-error_enumerate:
 error_device_descriptor:
 	usb_autosuspend_device(usb_dev);
 error_autoresume:
-- 
1.8.3.2


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

* [PATCH 3.5 86/88] tty/serial: at91: Handle shutdown more safely
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (84 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 85/88] usb: core: get config and string descriptors for unauthorized devices Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 87/88] slub: Fix calculation of cpu slabs Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 88/88] turbostat: Use GCC's CPUID functions to support PIC Luis Henriques
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marek Roszko, Nicolas Ferre, Greg Kroah-Hartman, Luis Henriques

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

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

From: Marek Roszko <mark.roszko@gmail.com>

commit 0cc7c6c7916b1b6f34350ff1473b80b9f7e459c0 upstream.

Interrupts were being cleaned up late in the shutdown handler, it is possible
that an interrupt can occur and schedule a tasklet that runs after the port is
cleaned up. There is a null dereference due to this race condition with the
following stacktrace:

[<c02092b0>] (atmel_tasklet_func+0x514/0x814) from [<c001fd34>] (tasklet_action+0x70/0xa8)
[<c001fd34>] (tasklet_action+0x70/0xa8) from [<c001f60c>] (__do_softirq+0x90/0x144)
[<c001f60c>] (__do_softirq+0x90/0x144) from [<c001fa18>] (irq_exit+0x40/0x4c)
[<c001fa18>] (irq_exit+0x40/0x4c) from [<c000e298>] (handle_IRQ+0x64/0x84)
[<c000e298>] (handle_IRQ+0x64/0x84) from [<c000d6c0>] (__irq_svc+0x40/0x50)
[<c000d6c0>] (__irq_svc+0x40/0x50) from [<c0208060>] (atmel_rx_dma_release+0x88/0xb8)
[<c0208060>] (atmel_rx_dma_release+0x88/0xb8) from [<c0209740>] (atmel_shutdown+0x104/0x160)
[<c0209740>] (atmel_shutdown+0x104/0x160) from [<c0205e8c>] (uart_port_shutdown+0x2c/0x38)

Signed-off-by: Marek Roszko <mark.roszko@gmail.com>
Acked-by: Leilei Zhao <leilei.zhao@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/tty/serial/atmel_serial.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index ed7cd37..ff58d28 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1022,12 +1022,24 @@ static int atmel_startup(struct uart_port *port)
 static void atmel_shutdown(struct uart_port *port)
 {
 	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
+
 	/*
-	 * Ensure everything is stopped.
+	 * Clear out any scheduled tasklets before
+	 * we destroy the buffers
+	 */
+	tasklet_kill(&atmel_port->tasklet);
+
+	/*
+	 * Ensure everything is stopped and
+	 * disable all interrupts, port and break condition.
 	 */
 	atmel_stop_rx(port);
 	atmel_stop_tx(port);
 
+	UART_PUT_CR(port, ATMEL_US_RSTSTA);
+	UART_PUT_IDR(port, -1);
+
+
 	/*
 	 * Shut-down the DMA.
 	 */
@@ -1054,12 +1066,6 @@ static void atmel_shutdown(struct uart_port *port)
 	}
 
 	/*
-	 * Disable all interrupts, port and break condition.
-	 */
-	UART_PUT_CR(port, ATMEL_US_RSTSTA);
-	UART_PUT_IDR(port, -1);
-
-	/*
 	 * Free the interrupt
 	 */
 	free_irq(port->irq, port);
-- 
1.8.3.2


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

* [PATCH 3.5 87/88] slub: Fix calculation of cpu slabs
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (85 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 86/88] tty/serial: at91: Handle shutdown more safely Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  2014-02-07 11:23 ` [PATCH 3.5 88/88] turbostat: Use GCC's CPUID functions to support PIC Luis Henriques
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Li Zefan, Pekka Enberg, Luis Henriques

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

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

From: Li Zefan <lizefan@huawei.com>

commit 8afb1474db4701d1ab80cd8251137a3260e6913e upstream.

  /sys/kernel/slab/:t-0000048 # cat cpu_slabs
  231 N0=16 N1=215
  /sys/kernel/slab/:t-0000048 # cat slabs
  145 N0=36 N1=109

See, the number of slabs is smaller than that of cpu slabs.

The bug was introduced by commit 49e2258586b423684f03c278149ab46d8f8b6700
("slub: per cpu cache for partial pages").

We should use page->pages instead of page->pobjects when calculating
the number of cpu partial slabs. This also fixes the mapping of slabs
and nodes.

As there's no variable storing the number of total/active objects in
cpu partial slabs, and we don't have user interfaces requiring those
statistics, I just add WARN_ON for those cases.

Acked-by: Christoph Lameter <cl@linux.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/slub.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index 8c691fa..ca056a6 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4520,7 +4520,13 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
 			page = c->partial;
 
 			if (page) {
-				x = page->pobjects;
+				node = page_to_nid(page);
+				if (flags & SO_TOTAL)
+					WARN_ON_ONCE(1);
+				else if (flags & SO_OBJECTS)
+					WARN_ON_ONCE(1);
+				else
+					x = page->pages;
 				total += x;
 				nodes[node] += x;
 			}
-- 
1.8.3.2


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

* [PATCH 3.5 88/88] turbostat: Use GCC's CPUID functions to support PIC
  2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
                   ` (86 preceding siblings ...)
  2014-02-07 11:23 ` [PATCH 3.5 87/88] slub: Fix calculation of cpu slabs Luis Henriques
@ 2014-02-07 11:23 ` Luis Henriques
  87 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 11:23 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Josh Triplett, Len Brown, Luis Henriques

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

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

From: Josh Triplett <josh@joshtriplett.org>

commit 2b92865e648ce04a39fda4f903784a5d01ecb0dc upstream.

turbostat uses inline assembly to call cpuid.  On 32-bit x86, on systems
that have certain security features enabled by default that make -fPIC
the default, this causes a build error:

turbostat.c: In function ‘check_cpuid’:
turbostat.c:1906:2: error: PIC register clobbered by ‘ebx’ in ‘asm’
  asm("cpuid" : "=a" (fms), "=c" (ecx), "=d" (edx) : "a" (1) : "ebx");
  ^

GCC provides a header cpuid.h, containing a __get_cpuid function that
works with both PIC and non-PIC.  (On PIC, it saves and restores ebx
around the cpuid instruction.)  Use that instead.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 tools/power/x86/turbostat/turbostat.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 16de7ad..43a7bda 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -34,6 +34,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <sched.h>
+#include <cpuid.h>
 
 #define MSR_TSC	0x10
 #define MSR_NEHALEM_PLATFORM_INFO	0xCE
@@ -955,7 +956,7 @@ void check_cpuid()
 
 	eax = ebx = ecx = edx = 0;
 
-	asm("cpuid" : "=a" (max_level), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0));
+	__get_cpuid(0, &max_level, &ebx, &ecx, &edx);
 
 	if (ebx == 0x756e6547 && edx == 0x49656e69 && ecx == 0x6c65746e)
 		genuine_intel = 1;
@@ -964,7 +965,7 @@ void check_cpuid()
 		fprintf(stderr, "%.4s%.4s%.4s ",
 			(char *)&ebx, (char *)&edx, (char *)&ecx);
 
-	asm("cpuid" : "=a" (fms), "=c" (ecx), "=d" (edx) : "a" (1) : "ebx");
+	__get_cpuid(1, &fms, &ebx, &ecx, &edx);
 	family = (fms >> 8) & 0xf;
 	model = (fms >> 4) & 0xf;
 	stepping = fms & 0xf;
@@ -986,7 +987,7 @@ void check_cpuid()
 	 * This check is valid for both Intel and AMD.
 	 */
 	ebx = ecx = edx = 0;
-	asm("cpuid" : "=a" (max_level), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x80000000));
+	__get_cpuid(0x80000000, &max_level, &ebx, &ecx, &edx);
 
 	if (max_level < 0x80000007) {
 		fprintf(stderr, "CPUID: no invariant TSC (max_level 0x%x)\n", max_level);
@@ -997,7 +998,7 @@ void check_cpuid()
 	 * Non-Stop TSC is advertised by CPUID.EAX=0x80000007: EDX.bit8
 	 * this check is valid for both Intel and AMD
 	 */
-	asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x80000007));
+	__get_cpuid(0x80000007, &eax, &ebx, &ecx, &edx);
 	has_invariant_tsc = edx & (1 << 8);
 
 	if (!has_invariant_tsc) {
@@ -1010,7 +1011,7 @@ void check_cpuid()
 	 * this check is valid for both Intel and AMD
 	 */
 
-	asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x6));
+	__get_cpuid(0x6, &eax, &ebx, &ecx, &edx);
 	has_aperf = ecx & (1 << 0);
 	if (!has_aperf) {
 		fprintf(stderr, "No APERF MSR\n");
-- 
1.8.3.2


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

* Re: [PATCH 3.5 36/88] spidev: fix hang when transfer_one_message fails
  2014-02-07 11:22 ` [PATCH 3.5 36/88] spidev: fix hang when transfer_one_message fails Luis Henriques
@ 2014-02-07 18:17   ` Daniel Santos
  2014-02-07 18:37     ` Luis Henriques
  0 siblings, 1 reply; 91+ messages in thread
From: Daniel Santos @ 2014-02-07 18:17 UTC (permalink / raw)
  To: Luis Henriques, linux-kernel, stable, kernel-team
  Cc: Daniel Santos, Mark Brown

On 02/07/2014 05:22 AM, Luis Henriques wrote:
> 3.5.7.30 -stable review patch.  If anyone has any objections, please let me know.
>
> ------------------
>
> From: Daniel Santos <daniel.santos@pobox.com>
>
> commit e120cc0dcf2880a4c5c0a6cb27b655600a1cfa1d upstream.
>
> This corrects a problem in spi_pump_messages() that leads to an spi
> message hanging forever when a call to transfer_one_message() fails.
> This failure occurs in my MCP2210 driver when the cs_change bit is set
> on the last transfer in a message, an operation which the hardware does
> not support.
>
> Rationale
> Since the transfer_one_message() returns an int, we must presume that it
> may fail.  If transfer_one_message() should never fail, it should return
> void.  Thus, calls to transfer_one_message() should properly manage a
> failure.
>
> Fixes: ffbbdd21329f3 (spi: create a message queueing infrastructure)
> Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
> Signed-off-by: Mark Brown <broonie@linaro.org>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>   drivers/spi/spi.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 1041cb8..40f528b 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -574,7 +574,9 @@ static void spi_pump_messages(struct kthread_work *work)
>   	ret = master->transfer_one_message(master, master->cur_msg);
>   	if (ret) {
>   		dev_err(&master->dev,
> -			"failed to transfer one message from queue\n");
> +			"failed to transfer one message from queue: %d\n", ret);
> +		master->cur_msg->status = ret;
> +		spi_finalize_current_message(master);
>   		return;
>   	}
>   }

This isn't a good patch and is reverted by a later patch. I'm not sure 
what the protocol for this is, but either skip this patch or include the 
one that reverts it.

Daniel


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

* Re: [PATCH 3.5 36/88] spidev: fix hang when transfer_one_message fails
  2014-02-07 18:17   ` Daniel Santos
@ 2014-02-07 18:37     ` Luis Henriques
  0 siblings, 0 replies; 91+ messages in thread
From: Luis Henriques @ 2014-02-07 18:37 UTC (permalink / raw)
  To: Daniel Santos
  Cc: linux-kernel, stable, kernel-team, Daniel Santos, Mark Brown

On Fri, Feb 07, 2014 at 12:17:47PM -0600, Daniel Santos wrote:
> On 02/07/2014 05:22 AM, Luis Henriques wrote:
> >3.5.7.30 -stable review patch.  If anyone has any objections, please let me know.
> >
> >------------------
> >
> >From: Daniel Santos <daniel.santos@pobox.com>
> >
> >commit e120cc0dcf2880a4c5c0a6cb27b655600a1cfa1d upstream.
> >
> >This corrects a problem in spi_pump_messages() that leads to an spi
> >message hanging forever when a call to transfer_one_message() fails.
> >This failure occurs in my MCP2210 driver when the cs_change bit is set
> >on the last transfer in a message, an operation which the hardware does
> >not support.
> >
> >Rationale
> >Since the transfer_one_message() returns an int, we must presume that it
> >may fail.  If transfer_one_message() should never fail, it should return
> >void.  Thus, calls to transfer_one_message() should properly manage a
> >failure.
> >
> >Fixes: ffbbdd21329f3 (spi: create a message queueing infrastructure)
> >Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
> >Signed-off-by: Mark Brown <broonie@linaro.org>
> >Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> >---
> >  drivers/spi/spi.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> >diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> >index 1041cb8..40f528b 100644
> >--- a/drivers/spi/spi.c
> >+++ b/drivers/spi/spi.c
> >@@ -574,7 +574,9 @@ static void spi_pump_messages(struct kthread_work *work)
> >  	ret = master->transfer_one_message(master, master->cur_msg);
> >  	if (ret) {
> >  		dev_err(&master->dev,
> >-			"failed to transfer one message from queue\n");
> >+			"failed to transfer one message from queue: %d\n", ret);
> >+		master->cur_msg->status = ret;
> >+		spi_finalize_current_message(master);
> >  		return;
> >  	}
> >  }
> 
> This isn't a good patch and is reverted by a later patch. I'm not
> sure what the protocol for this is, but either skip this patch or
> include the one that reverts it.

Great, thanks.  I will drop this patch both in the 3.5 and 3.11
kernels.

Cheers,
--
Luis

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

end of thread, other threads:[~2014-02-07 18:37 UTC | newest]

Thread overview: 91+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-07 11:21 [3.5.y.z extended stable] Linux 3.5.7.30 stable review Luis Henriques
2014-02-07 11:21 ` [PATCH 3.5 01/88] ext4: fix deadlock when writing in ENOSPC conditions Luis Henriques
2014-02-07 11:21 ` [PATCH 3.5 02/88] writeback: Fix data corruption on NFS Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 03/88] md/raid5: Fix possible confusion when multiple write errors occur Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 04/88] md/raid10: fix two bugs in handling of known-bad-blocks Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 05/88] md/raid10: fix bug when raid10 recovery fails to recover a block Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 06/88] hwmon: (coretemp) Fix truncated name of alarm attributes Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 07/88] nilfs2: fix segctor bug that causes file system corruption Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 08/88] mm: fix crash when using XFS on loopback Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 09/88] vfs: In d_path don't call d_dname on a mount point Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 10/88] perf/x86/amd/ibs: Fix waking up from S3 for AMD family 10h Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 11/88] staging: comedi: 8255_pci: fix for newer PCI-DIO48H Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 12/88] mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 13/88] serial: amba-pl011: use port lock to guard control register access Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 14/88] rtlwifi: rtl8192cu: Fix W=1 build warning Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 15/88] rtlwifi: rtl8192cu: Add new firmware Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 16/88] rtlwifi: Set the link state Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 17/88] rtlwifi: rtl8192c: Add new definitions in the dm_common header Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 18/88] rtlwifi: rtl8192cu: Fix some code in RF handling Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 19/88] NFSv4: OPEN must handle the NFS4ERR_IO return code correctly Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 20/88] parport: parport_pc: remove double PCI ID for NetMos Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 21/88] staging: vt6656: [BUG] BBvUpdatePreEDThreshold Always set sensitivity on bScanning Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 22/88] [SCSI] bfa: Chinook quad port 16G FC HBA claim issue Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 23/88] usb: option: add new zte 3g modem pids to option driver Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 24/88] [media] dib8000: make 32 bits read atomic Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 25/88] serial: add support for 200 v3 series Titan card Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 26/88] usb: xhci: Check for XHCI_PLAT in xhci_cleanup_msix() Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 27/88] x86/efi: Fix off-by-one bug in EFI Boot Services reservation Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 28/88] perf kvm: Fix kvm report without guestmount Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 29/88] mtd: mxc_nand: remove duplicated ecc_stats counting Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 30/88] xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4) Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 31/88] USB: serial: add support for iBall 3.5G connect usb modem Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 32/88] USB: Nokia 502 is an unusual device Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 33/88] USB: cypress_m8: fix ring-indicator detection and reporting Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 34/88] ALSA: rme9652: fix a missing comma in channel_map_9636_ds[] Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 35/88] sunrpc: Fix infinite loop in RPC state machine Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 36/88] spidev: fix hang when transfer_one_message fails Luis Henriques
2014-02-07 18:17   ` Daniel Santos
2014-02-07 18:37     ` Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 37/88] dm thin: initialize dm_thin_new_mapping returned by get_next_mapping Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 38/88] SELinux: Fix memory leak upon loading policy Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 39/88] drm/radeon: warn users when hw_i2c is enabled (v2) Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 40/88] USB: ftdi_sio: added CS5 quirk for broken smartcard readers Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 41/88] serial: 8250: enable UART_BUG_NOMSR for Tegra Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 42/88] dm: wait until embedded kobject is released before destroying a device Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 43/88] dm space map common: make sure new space is used during extend Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 44/88] ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 45/88] radeon/pm: Guard access to rdev->pm.power_state array Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 46/88] drm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 47/88] staging: r8712u: Set device type to wlan Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 48/88] ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 49/88] mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 50/88] rtlwifi: rtl8192cu: Add new device ID Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 51/88] mwifiex: add missing endian conversion for fw_tsf Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 52/88] b43: Fix lockdep splat Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 53/88] b43: Fix unload oops if firmware is not available Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 54/88] b43legacy: " Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 55/88] nfs4.1: properly handle ENOTSUP in SECINFO_NO_NAME Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 56/88] audit: correct a type mismatch in audit_syscall_exit() Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 57/88] md/raid5: fix long-standing problem with bitmap handling on write failure Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 58/88] drm/radeon: set the full cache bit for fences on r7xx+ Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 59/88] hp_accel: Add a new PnP ID HPQ6007 for new HP laptops Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 60/88] intel-iommu: fix off-by-one in pagetable freeing Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 61/88] fuse: fix pipe_buf_operations Luis Henriques
2014-02-07 11:22 ` [PATCH 3.5 62/88] drm/cirrus: correct register values for 16bpp Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 63/88] IB/qib: Fix QP check when looping back to/from QP1 Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 64/88] ore: Fix wrong math in allocation of per device BIO Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 65/88] b43: fix the wrong assignment of status.freq in b43_rx() Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 66/88] KVM: PPC: e500: Fix bad address type in deliver_tlb_misss() Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 67/88] Btrfs: handle EAGAIN case properly in btrfs_drop_snapshot() Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 68/88] ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 69/88] powerpc: Make sure "cache" directory is removed when offlining cpu Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 70/88] drm/radeon/DCE4+: clear bios scratch dpms bit (v2) Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 71/88] mm/page-writeback.c: fix dirty_balance_reserve subtraction from dirtyable memory Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 72/88] target/iscsi: Fix network portal creation race Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 73/88] mm, oom: base root bonus on current usage Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 74/88] x86, x32: Correct invalid use of user timespec in the kernel Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 75/88] alpha: fix broken network checksum Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 76/88] ARM: at91: smc: bug fix in sam9_smc_cs_read() Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 77/88] KVM: s390: fix diagnose code extraction Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 78/88] e752x_edac: Fix pci_dev usage count Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 79/88] lib/decompressors: fix "no limit" output buffer length Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 80/88] bnx2x: fix DMA unmapping of TSO split BDs Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 81/88] inet_diag: fix inet_diag_dump_icsk() timewait socket state logic Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 82/88] net: avoid reference counter overflows on fib_rules in multicast forwarding Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 83/88] net,via-rhine: Fix tx_timeout handling Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 84/88] mm: hugetlbfs: fix hugetlbfs optimization Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 85/88] usb: core: get config and string descriptors for unauthorized devices Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 86/88] tty/serial: at91: Handle shutdown more safely Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 87/88] slub: Fix calculation of cpu slabs Luis Henriques
2014-02-07 11:23 ` [PATCH 3.5 88/88] turbostat: Use GCC's CPUID functions to support PIC Luis Henriques

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).