linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review
@ 2015-09-02  0:57 Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 01/60] md: use kzalloc() when bitmap is disabled Kamal Mostafa
                   ` (59 more replies)
  0 siblings, 60 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa

This is the start of the review cycle for the Linux 3.13.11-ckt26 stable kernel.

This version contains 60 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/ubuntu/linux.git/log/?h=linux-3.13.y-review

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

The review period for version 3.13.11-ckt26 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.13.y-ckt extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .

 -Kamal

--
 arch/arm/mach-omap2/omap_hwmod.c           | 24 ++++++---
 arch/tile/kernel/setup.c                   |  2 +-
 arch/x86/boot/compressed/eboot.c           |  4 ++
 arch/x86/xen/enlighten.c                   | 40 +++++++++++++++
 block/blk-cgroup.c                         |  6 ++-
 drivers/ata/libata-core.c                  | 11 +++--
 drivers/ata/libata-pmp.c                   |  7 +++
 drivers/ata/libata-scsi.c                  |  3 +-
 drivers/gpu/drm/drm_crtc.c                 |  5 +-
 drivers/gpu/drm/radeon/radeon_combios.c    |  7 ++-
 drivers/input/touchscreen/usbtouchscreen.c |  3 ++
 drivers/isdn/gigaset/ser-gigaset.c         | 11 ++++-
 drivers/md/md.c                            |  2 +-
 drivers/md/raid1.c                         |  2 +-
 drivers/md/raid10.c                        |  5 +-
 drivers/mmc/card/block.c                   |  2 +
 drivers/mmc/host/omap_hsmmc.c              |  8 +--
 drivers/mmc/host/sdhci-esdhc.h             |  2 +-
 drivers/mmc/host/sdhci-pxav3.c             |  1 +
 drivers/net/bonding/bond_main.c            | 14 ++++--
 drivers/net/ethernet/mellanox/mlx4/eq.c    |  4 +-
 drivers/net/ethernet/sun/niu.c             |  4 +-
 drivers/scsi/ipr.c                         | 28 +++++++----
 drivers/scsi/ipr.h                         |  1 +
 drivers/target/iscsi/iscsi_target.c        | 48 ++++++++++++++----
 drivers/target/iscsi/iscsi_target_core.h   |  1 +
 drivers/target/iscsi/iscsi_target_login.c  | 43 ++++++----------
 drivers/target/iscsi/iscsi_target_login.h  |  3 +-
 drivers/target/iscsi/iscsi_target_nego.c   | 34 ++++++++++++-
 drivers/usb/dwc3/ep0.c                     |  4 ++
 drivers/usb/gadget/mv_udc_core.c           |  2 +-
 drivers/usb/host/ohci-q.c                  |  7 +--
 drivers/usb/host/xhci-hub.c                | 22 ++++++---
 drivers/usb/host/xhci-mem.c                |  2 +-
 drivers/usb/host/xhci-ring.c               |  3 ++
 drivers/usb/host/xhci.c                    |  3 ++
 drivers/usb/host/xhci.h                    |  1 +
 drivers/usb/storage/unusual_devs.h         | 12 +++++
 drivers/vhost/vhost.c                      |  1 +
 fs/xfs/xfs_attr_remote.c                   | 15 ++++--
 include/linux/libata.h                     |  2 +
 net/bridge/br_mdb.c                        |  2 +-
 net/core/datagram.c                        | 41 ++++++++++++++--
 net/ipv4/ip_fragment.c                     |  7 ++-
 net/mac80211/debugfs_netdev.c              |  1 +
 net/netfilter/ipvs/ip_vs_core.c            | 16 +++++-
 net/netfilter/ipvs/ip_vs_ctl.c             | 78 +++++++++++++++++++-----------
 net/netfilter/ipvs/ip_vs_sched.c           | 12 ++---
 net/netfilter/ipvs/ip_vs_sync.c            |  2 +-
 net/netfilter/ipvs/ip_vs_xmit.c            |  1 -
 net/netfilter/nf_conntrack_expect.c        |  3 +-
 net/netfilter/nf_conntrack_netlink.c       |  5 --
 net/sched/act_pedit.c                      |  5 +-
 sound/pci/hda/patch_cirrus.c               |  4 +-
 sound/pci/hda/patch_hdmi.c                 |  2 +
 sound/pci/hda/patch_realtek.c              |  2 +-
 sound/pci/hda/patch_sigmatel.c             |  3 +-
 sound/soc/codecs/pcm1681.c                 |  2 +-
 sound/usb/mixer_maps.c                     | 24 +++++++++
 59 files changed, 447 insertions(+), 162 deletions(-)

AMAN DEEP (1):
      usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function

Aaron Plattner (1):
      ALSA: hda - Add new GPU codec ID 0x10de007d to snd-hda

Alan Stern (1):
      USB: OHCI: Fix race between ED unlink and URB submission

Aleksei Mamlin (1):
      libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for HP 250GB SATA disk VB0250EAVER

Alex Deucher (1):
      drm/radeon/combios: add some validation of lvds values

Alexey Khoroshilov (1):
      usb: gadget: mv_udc_core: fix phy_regs I/O memory leak

Andy Lutomirski (1):
      x86/xen: Probe target addresses in set_aliased_prot() before the hypercall

Arne Fitzenreiter (2):
      libata: add ATA_HORKAGE_NOTRIM
      libata: force disable trim for SuperSSpeed S238

Axel Lin (1):
      ASoC: pcm1681: Fix setting de-emphasis sampling rate selection

Benjamin Randazzo (1):
      md: use kzalloc() when bitmap is disabled

Bernhard Bender (1):
      Input: usbtouchscreen - avoid unresponsive TSC-30 touch screen

Brian Campbell (1):
      xhci: Calculate old endpoints correctly on device reset

Brian King (3):
      ipr: Fix locking for unit attention handling
      ipr: Fix incorrect trace indexing
      ipr: Fix invalid array indexing for HRRQ

Chris Metcalf (1):
      tile: use free_bootmem_late() for initrd

Dan Carpenter (1):
      ALSA: hda - fix cs4210_spdif_automute()

Daniel Vetter (1):
      drm: Stop resetting connector state to unknown

Dave Chinner (1):
      xfs: remote attributes need to be considered data

Dmitry Skorodumov (1):
      x86/efi: Use all 64 bit of efi_memmap in setup_e820()

Edward Hyunkoo Jee (1):
      inet: frags: fix defragmented packet's IP header for af_packet

Herbert Xu (1):
      net: Clone skb before setting peeked flag

Jack Morgenstein (1):
      net/mlx4_core: Fix wrong index in propagating port change event to VFs

Jingju Hou (1):
      mmc: sdhci-pxav3: fix platform_data is not initialized

Jiri Pirko (1):
      niu: don't count tx error twice in case of headroom realloc fails

Joakim Tjernlund (1):
      mmc: sdhci-esdhc: Make 8BIT bus work

Joe Stringer (1):
      netfilter: nf_conntrack: Support expectations in different zones

John Youn (1):
      usb: dwc3: Reset the transfer resource index on SET_INTERFACE

Julian Anastasov (3):
      ipvs: fix crash with sync protocol v0 and FTP
      ipvs: do not use random local source address for tunnels
      ipvs: fix crash if scheduler is changed

Kishon Vijay Abraham I (1):
      mmc: omap_hsmmc: Fix DTO and DCRC handling

Lior Amsalem (1):
      ata: pmp: add quirk for Marvell 4140 SATA PMP

Marc-André Lureau (1):
      vhost: actually track log eventfd file

Martin K. Petersen (1):
      libata: Do not blacklist M510DC

Mikulas Patocka (1):
      libata: increase the timeout when setting transfer mode

NeilBrown (2):
      md/raid10: always set reshape_safe when initializing reshape_position.
      md/raid1: fix test for 'was read error from last working device'.

Nicholas Bellinger (3):
      iscsi-target: Fix use-after-free during TPG session shutdown
      iscsi-target: Fix iscsit_start_kthreads failure OOPs
      iscsi-target: Fix iser explicit logout TX kthread leak

Nikolay Aleksandrov (4):
      bonding: correctly handle bonding type change on enslave failure
      bridge: mdb: fix double add notification
      bonding: fix destruction of bond with devices different from arphrd_ether
      bridge: mdb: fix delmdb state in the notification

Oliver Neukum (1):
      usb-storage: ignore ZTE MF 823 card reader in mode 0x1225

Pablo Neira Ayuso (1):
      netfilter: ctnetlink: put back references to master ct and expect objects

Roger Quadros (1):
      ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc

Takashi Iwai (2):
      ALSA: hda - Apply fixup for another Toshiba Satellite S50D
      ALSA: hda - Fix MacBook Pro 5,2 quirk

Tejun Heo (1):
      blkcg: fix gendisk reference leak in blkg_conf_prep()

Tilman Schmidt (1):
      isdn/gigaset: reset tty->receive_room when attaching ser_gigaset

Tom Hughes (1):
      mac80211: clear subdir_stations when removing debugfs

Tomas Winkler (1):
      mmc: block: Add missing mmc_blk_put() in power_ro_lock_show()

WANG Cong (1):
      act_pedit: check binding before calling tcf_hash_release()

Yao-Wen Mao (1):
      ALSA: usb-audio: add dB range mapping for some devices

Zhuang Jin Can (3):
      xhci: report U3 when link is in resume state
      xhci: prevent bus_suspend if SS port resuming in phase 1
      xhci: do not report PLC when link is in internal resume state

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

* [PATCH 3.13.y-ckt 01/60] md: use kzalloc() when bitmap is disabled
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 02/60] ata: pmp: add quirk for Marvell 4140 SATA PMP Kamal Mostafa
                   ` (58 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Benjamin Randazzo, NeilBrown, Kamal Mostafa

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

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

From: Benjamin Randazzo <benjamin@randazzo.fr>

commit b6878d9e03043695dbf3fa1caa6dfc09db225b16 upstream.

In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a
mdu_bitmap_file_t called "file".

5769         file = kmalloc(sizeof(*file), GFP_NOIO);
5770         if (!file)
5771                 return -ENOMEM;

This structure is copied to user space at the end of the function.

5786         if (err == 0 &&
5787             copy_to_user(arg, file, sizeof(*file)))
5788                 err = -EFAULT

But if bitmap is disabled only the first byte of "file" is initialized
with zero, so it's possible to read some bytes (up to 4095) of kernel
space memory from user space. This is an information leak.

5775         /* bitmap disabled, zero the first byte and copy out */
5776         if (!mddev->bitmap_info.file)
5777                 file->pathname[0] = '\0';

Signed-off-by: Benjamin Randazzo <benjamin@randazzo.fr>
Signed-off-by: NeilBrown <neilb@suse.com>
Reference: CVE-2015-5697
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/md.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2ee29a7..8cccbdf 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5633,7 +5633,7 @@ static int get_bitmap_file(struct mddev * mddev, void __user * arg)
 	char *ptr, *buf = NULL;
 	int err = -ENOMEM;
 
-	file = kmalloc(sizeof(*file), GFP_NOIO);
+	file = kzalloc(sizeof(*file), GFP_NOIO);
 
 	if (!file)
 		goto out;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 02/60] ata: pmp: add quirk for Marvell 4140 SATA PMP
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 01/60] md: use kzalloc() when bitmap is disabled Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 03/60] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for HP 250GB SATA disk VB0250EAVER Kamal Mostafa
                   ` (57 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lior Amsalem, Thomas Petazzoni, Tejun Heo, Kamal Mostafa

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

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

From: Lior Amsalem <alior@marvell.com>

commit 945b47441d83d2392ac9f984e0267ad521f24268 upstream.

This commit adds the necessary quirk to make the Marvell 4140 SATA PMP
work properly. This PMP doesn't like SRST on port number 4 (the host
port) so this commit marks this port as not supporting SRST.

Signed-off-by: Lior Amsalem <alior@marvell.com>
Reviewed-by: Nadav Haklai <nadavh@marvell.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/ata/libata-pmp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index 7ccc084..85aa761 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -460,6 +460,13 @@ static void sata_pmp_quirks(struct ata_port *ap)
 				       ATA_LFLAG_NO_SRST |
 				       ATA_LFLAG_ASSUME_ATA;
 		}
+	} else if (vendor == 0x11ab && devid == 0x4140) {
+		/* Marvell 4140 quirks */
+		ata_for_each_link(link, ap, EDGE) {
+			/* port 4 is for SEMB device and it doesn't like SRST */
+			if (link->pmp == 4)
+				link->flags |= ATA_LFLAG_DISABLED;
+		}
 	}
 }
 
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 03/60] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for HP 250GB SATA disk VB0250EAVER
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 01/60] md: use kzalloc() when bitmap is disabled Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 02/60] ata: pmp: add quirk for Marvell 4140 SATA PMP Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 04/60] libata: add ATA_HORKAGE_NOTRIM Kamal Mostafa
                   ` (56 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Aleksei Mamlin, Tejun Heo, Kamal Mostafa

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

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

From: Aleksei Mamlin <mamlinav@gmail.com>

commit 08c85d2a599d967ede38a847f5594447b6100642 upstream.

Enabling AA on HP 250GB SATA disk VB0250EAVER causes errors:

[    3.788362] ata3.00: failed to enable AA (error_mask=0x1)
[    3.789243] ata3.00: failed to enable AA (error_mask=0x1)

Add the ATA_HORKAGE_BROKEN_FPDMA_AA for this specific harddisk.

tj: Collected FPDMA_AA entries and updated comment.

Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/ata/libata-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 1efa300..684f02d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4173,9 +4173,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
 	{ "ST3320[68]13AS",	"SD1[5-9]",	ATA_HORKAGE_NONCQ |
 						ATA_HORKAGE_FIRMWARE_WARN },
 
-	/* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */
+	/* drives which fail FPDMA_AA activation (some may freeze afterwards) */
 	{ "ST1000LM024 HN-M101MBB", "2AR10001",	ATA_HORKAGE_BROKEN_FPDMA_AA },
 	{ "ST1000LM024 HN-M101MBB", "2BA30001",	ATA_HORKAGE_BROKEN_FPDMA_AA },
+	{ "VB0250EAVER",	"HPG7",		ATA_HORKAGE_BROKEN_FPDMA_AA },
 
 	/* Blacklist entries taken from Silicon Image 3124/3132
 	   Windows driver .inf file - also several Linux problem reports */
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 04/60] libata: add ATA_HORKAGE_NOTRIM
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (2 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 03/60] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for HP 250GB SATA disk VB0250EAVER Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 05/60] libata: force disable trim for SuperSSpeed S238 Kamal Mostafa
                   ` (55 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Arne Fitzenreiter, Tejun Heo, Luis Henriques, Kamal Mostafa

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

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

From: Arne Fitzenreiter <arne_f@ipfire.org>

commit 71d126fd28de2d4d9b7b2088dbccd7ca62fad6e0 upstream.

Some devices lose data on TRIM whether queued or not.  This patch adds
a horkage to disable TRIM.

tj: Collapsed unnecessary if() nesting.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ luis: backported to 3.16:
  - dropped changes to show_ata_dev_trim
  - adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/ata/libata-scsi.c | 3 ++-
 include/linux/libata.h    | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index ef8567d..6fecf0b 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2510,7 +2510,8 @@ static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf)
 		rbuf[14] = (lowest_aligned >> 8) & 0x3f;
 		rbuf[15] = lowest_aligned;
 
-		if (ata_id_has_trim(args->id)) {
+		if (ata_id_has_trim(args->id) &&
+		    !(dev->horkage & ATA_HORKAGE_NOTRIM)) {
 			rbuf[14] |= 0x80; /* TPE */
 
 			if (ata_id_has_zero_after_trim(args->id))
diff --git a/include/linux/libata.h b/include/linux/libata.h
index fa413ee..8c58412 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -429,6 +429,8 @@ enum {
 	ATA_HORKAGE_NO_NCQ_TRIM	= (1 << 19),	/* don't use queued TRIM */
 	ATA_HORKAGE_NOLPM	= (1 << 20),	/* don't use LPM */
 	ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21),	/* some WDs have broken LPM */
+	ATA_HORKAGE_NOTRIM	= (1 << 24),	/* don't use TRIM */
+
 
 	 /* DMA mask for user DMA control: User visible values; DO NOT
 	    renumber */
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 05/60] libata: force disable trim for SuperSSpeed S238
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (3 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 04/60] libata: add ATA_HORKAGE_NOTRIM Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 06/60] libata: increase the timeout when setting transfer mode Kamal Mostafa
                   ` (54 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Arne Fitzenreiter, Tejun Heo, Luis Henriques, Kamal Mostafa

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

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

From: Arne Fitzenreiter <arne_f@ipfire.org>

commit cda57b1b05cf7b8b99ab4b732bea0b05b6c015cc upstream.

This device loses blocks, often the partition table area, on trim.
Disable TRIM.
http://pcengines.ch/msata16a.htm

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/ata/libata-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 684f02d..0dd99e7 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4230,6 +4230,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
 	{ "Micron_M550*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
 	{ "Crucial_CT*M550SSD*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
 
+	/* devices that don't properly handle TRIM commands */
+	{ "SuperSSpeed S238*",		NULL,	ATA_HORKAGE_NOTRIM, },
+
 	/*
 	 * Some WD SATA-I drives spin up and down erratically when the link
 	 * is put into the slumber mode.  We don't have full list of the
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 06/60] libata: increase the timeout when setting transfer mode
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (4 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 05/60] libata: force disable trim for SuperSSpeed S238 Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 07/60] libata: Do not blacklist M510DC Kamal Mostafa
                   ` (53 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mikulas Patocka, Tejun Heo, Kamal Mostafa

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

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

From: Mikulas Patocka <mpatocka@redhat.com>

commit d531be2ca2f27cca5f041b6a140504999144a617 upstream.

I have a ST4000DM000 disk. If Linux is booted while the disk is spun down,
the command that sets transfer mode causes the disk to spin up. The
spin-up takes longer than the default 5s timeout, so the command fails and
timeout is reported.

Fix this by increasing the timeout to 15s, which is enough for the disk to
spin up.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/ata/libata-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 0dd99e7..83c95c1 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4537,7 +4537,8 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev)
 	else /* In the ancient relic department - skip all of this */
 		return 0;
 
-	err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
+	/* On some disks, this command causes spin-up, so we need longer timeout */
+	err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 15000);
 
 	DPRINTK("EXIT, err_mask=%x\n", err_mask);
 	return err_mask;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 07/60] libata: Do not blacklist M510DC
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (5 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 06/60] libata: increase the timeout when setting transfer mode Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 08/60] mac80211: clear subdir_stations when removing debugfs Kamal Mostafa
                   ` (52 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Martin K. Petersen, Tejun Heo, Kamal Mostafa

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

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

From: "Martin K. Petersen" <martin.petersen@oracle.com>

commit 9051bd393cf25e76dfb45409792719a854661500 upstream.

A new Micron drive was just announced, once again recycling the first
part of the model string. Add an underscore to the M510/M550 pattern to
avoid picking up the new DC drive.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/ata/libata-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 83c95c1..0b4f2f5 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4227,7 +4227,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
 	/* devices that don't properly handle queued TRIM commands */
 	{ "Micron_M500_*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
 	{ "Crucial_CT???M500SSD*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
-	{ "Micron_M550*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
+	{ "Micron_M550_*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
 	{ "Crucial_CT*M550SSD*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
 
 	/* devices that don't properly handle TRIM commands */
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 08/60] mac80211: clear subdir_stations when removing debugfs
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (6 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 07/60] libata: Do not blacklist M510DC Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 09/60] ALSA: hda - Add new GPU codec ID 0x10de007d to snd-hda Kamal Mostafa
                   ` (51 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tom Hughes, Johannes Berg, Kamal Mostafa

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

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

From: Tom Hughes <tom@compton.nu>

commit 4479004e6409087d1b4986881dc98c6c15dffb28 upstream.

If we don't do this, and we then fail to recreate the debugfs
directory during a mode change, then we will fail later trying
to add stations to this now bogus directory:

BUG: unable to handle kernel NULL pointer dereference at 0000006c
IP: [<c0a92202>] mutex_lock+0x12/0x30
Call Trace:
[<c0678ab4>] start_creating+0x44/0xc0
[<c0679203>] debugfs_create_dir+0x13/0xf0
[<f8a938ae>] ieee80211_sta_debugfs_add+0x6e/0x490 [mac80211]

Signed-off-by: Tom Hughes <tom@compton.nu>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/mac80211/debugfs_netdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index cae3d14..a6119a2 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -705,6 +705,7 @@ void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata)
 
 	debugfs_remove_recursive(sdata->vif.debugfs_dir);
 	sdata->vif.debugfs_dir = NULL;
+	sdata->debugfs.subdir_stations = NULL;
 }
 
 void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 09/60] ALSA: hda - Add new GPU codec ID 0x10de007d to snd-hda
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (7 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 08/60] mac80211: clear subdir_stations when removing debugfs Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 10/60] md/raid10: always set reshape_safe when initializing reshape_position Kamal Mostafa
                   ` (50 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Aaron Plattner, Takashi Iwai, Kamal Mostafa

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

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

From: Aaron Plattner <aplattner@nvidia.com>

commit 6c3d91193d829bf58a35a10650415b05a736ca6c upstream.

Vendor ID 0x10de007d is used by a yet-to-be-named GPU chip.

This chip also has the 2-ch audio swapping bug, so patch_nvhdmi is
appropriate here.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/pci/hda/patch_hdmi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 0c1be26..09a4c80 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -3345,6 +3345,7 @@ static const struct hda_codec_preset snd_hda_preset_hdmi[] = {
 { .id = 0x10de0070, .name = "GPU 70 HDMI/DP",	.patch = patch_nvhdmi },
 { .id = 0x10de0071, .name = "GPU 71 HDMI/DP",	.patch = patch_nvhdmi },
 { .id = 0x10de0072, .name = "GPU 72 HDMI/DP",	.patch = patch_nvhdmi },
+{ .id = 0x10de007d, .name = "GPU 7d HDMI/DP",	.patch = patch_nvhdmi },
 { .id = 0x10de8001, .name = "MCP73 HDMI",	.patch = patch_nvhdmi_2ch },
 { .id = 0x11069f80, .name = "VX900 HDMI/DP",	.patch = patch_via_hdmi },
 { .id = 0x11069f81, .name = "VX900 HDMI/DP",	.patch = patch_via_hdmi },
@@ -3402,6 +3403,7 @@ MODULE_ALIAS("snd-hda-codec-id:10de0067");
 MODULE_ALIAS("snd-hda-codec-id:10de0070");
 MODULE_ALIAS("snd-hda-codec-id:10de0071");
 MODULE_ALIAS("snd-hda-codec-id:10de0072");
+MODULE_ALIAS("snd-hda-codec-id:10de007d");
 MODULE_ALIAS("snd-hda-codec-id:10de8001");
 MODULE_ALIAS("snd-hda-codec-id:11069f80");
 MODULE_ALIAS("snd-hda-codec-id:11069f81");
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 10/60] md/raid10: always set reshape_safe when initializing reshape_position.
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (8 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 09/60] ALSA: hda - Add new GPU codec ID 0x10de007d to snd-hda Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-04 19:39   ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 11/60] drm: Stop resetting connector state to unknown Kamal Mostafa
                   ` (49 subsequent siblings)
  59 siblings, 1 reply; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.com>

commit 299b0685e31c9f3dcc2d58ee3beca761a40b44b3 upstream.

'reshape_position' tracks where in the reshape we have reached.
'reshape_safe' tracks where in the reshape we have safely recorded
in the metadata.

These are compared to determine when to update the metadata.
So it is important that reshape_safe is initialised properly.
Currently it isn't.  When starting a reshape from the beginning
it usually has the correct value by luck.  But when reducing the
number of devices in a RAID10, it has the wrong value and this leads
to the metadata not being updated correctly.
This can lead to corruption if the reshape is not allowed to complete.

This patch is suitable for any -stable kernel which supports RAID10
reshape, which is 3.5 and later.

Fixes: 3ea7daa5d7fd ("md/raid10: add reshape support")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid10.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 1b707ad..b8215a3 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3597,6 +3597,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
 			/* far_copies must be 1 */
 			conf->prev.stride = conf->dev_sectors;
 	}
+	conf->reshape_safe = conf->reshape_progress;
 	spin_lock_init(&conf->device_lock);
 	INIT_LIST_HEAD(&conf->retry_list);
 
@@ -3804,7 +3805,6 @@ static int run(struct mddev *mddev)
 		}
 		conf->offset_diff = min_offset_diff;
 
-		conf->reshape_safe = conf->reshape_progress;
 		clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
 		clear_bit(MD_RECOVERY_CHECK, &mddev->recovery);
 		set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);
@@ -4149,6 +4149,7 @@ static int raid10_start_reshape(struct mddev *mddev)
 		conf->reshape_progress = size;
 	} else
 		conf->reshape_progress = 0;
+	conf->reshape_safe = conf->reshape_progress;
 	spin_unlock_irq(&conf->device_lock);
 
 	if (mddev->delta_disks && mddev->bitmap) {
@@ -4215,6 +4216,7 @@ abort:
 		rdev->new_data_offset = rdev->data_offset;
 	smp_wmb();
 	conf->reshape_progress = MaxSector;
+	conf->reshape_safe = MaxSector;
 	mddev->reshape_position = MaxSector;
 	spin_unlock_irq(&conf->device_lock);
 	return ret;
@@ -4566,6 +4568,7 @@ static void end_reshape(struct r10conf *conf)
 	md_finish_reshape(conf->mddev);
 	smp_wmb();
 	conf->reshape_progress = MaxSector;
+	conf->reshape_safe = MaxSector;
 	spin_unlock_irq(&conf->device_lock);
 
 	/* read-ahead size must cover two whole stripes, which is
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 11/60] drm: Stop resetting connector state to unknown
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (9 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 10/60] md/raid10: always set reshape_safe when initializing reshape_position Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 12/60] usb: dwc3: Reset the transfer resource index on SET_INTERFACE Kamal Mostafa
                   ` (48 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Rui Matos, Julien Wajsberg, kuddel.mail, Lennart Poettering,
	Daniel Vetter, Kamal Mostafa

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

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

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

commit 5677d67ae3949f09f57357241b88222d49b8c782 upstream.

It's causing piles of issues since we've stopped forcing full detect
cycles in the sysfs interfaces with

commit c484f02d0f02fbbfc6decc945a69aae011041a27
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Mar 6 12:36:42 2015 +0000

    drm: Lighten sysfs connector 'status'

The original justification for this was that the hpd handlers could
use the unknown state as a hint to force a full detection. But current
i915 code isn't doing that any more, and no one else really uses reset
on resume. So instead just keep the old state around.

References: http://article.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/62584
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=100641
Cc: Rui Matos <tiagomatos@gmail.com>
Cc: Julien Wajsberg <felash@gmail.com>
Cc: kuddel.mail@gmx.de
Cc: Lennart Poettering <mzxreary@0pointer.de>
Acked-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rui Tiago Cação Matos <tiagomatos@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/drm_crtc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 944ff1e..87591bb 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3730,12 +3730,9 @@ void drm_mode_config_reset(struct drm_device *dev)
 		if (encoder->funcs->reset)
 			encoder->funcs->reset(encoder);
 
-	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
-		connector->status = connector_status_unknown;
-
+	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
 		if (connector->funcs->reset)
 			connector->funcs->reset(connector);
-	}
 }
 EXPORT_SYMBOL(drm_mode_config_reset);
 
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 12/60] usb: dwc3: Reset the transfer resource index on SET_INTERFACE
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (10 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 11/60] drm: Stop resetting connector state to unknown Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 13/60] usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function Kamal Mostafa
                   ` (47 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: John Youn, Felipe Balbi, Luis Henriques, Kamal Mostafa

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

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

From: John Youn <John.Youn@synopsys.com>

commit aebda618718157a69c0dc0adb978d69bc2b8723c upstream.

This fixes an issue introduced in commit b23c843992b6 (usb: dwc3:
gadget: fix DEPSTARTCFG for non-EP0 EPs) that made sure we would
only use DEPSTARTCFG once per SetConfig.

The trick is that we should use one DEPSTARTCFG per SetConfig *OR*
SetInterface. SetInterface was completely missed from the original
patch.

This problem became aparent after commit 76e838c9f776 (usb: dwc3:
gadget: return error if command sent to DEPCMD register fails)
added checking of the return status of device endpoint commands.

'Set Endpoint Transfer Resource' command was caught failing
occasionally. This is because the Transfer Resource
Index was not getting reset during a SET_INTERFACE request.

Finally, to fix the issue, was we have to do is make sure that
our start_config_issued flag gets reset whenever we receive a
SetInterface request.

To verify the problem (and its fix), all we have to do is run
test 9 from testusb with 'testusb -t 9 -s 2048 -a -c 5000'.

Tested-by: Huang Rui <ray.huang@amd.com>
Tested-by: Subbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com>
Fixes: b23c843992b6 (usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs)
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
  - replaced dwc3_trace() by dev_vdbg() ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/dwc3/ep0.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 0985ff7..bcefce0 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -707,6 +707,10 @@ static int dwc3_ep0_std_request(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
 		dev_vdbg(dwc->dev, "USB_REQ_SET_ISOCH_DELAY\n");
 		ret = dwc3_ep0_set_isoch_delay(dwc, ctrl);
 		break;
+	case USB_REQ_SET_INTERFACE:
+		dev_vdbg(dwc->dev, "USB_REQ_SET_INTERFACE");
+		dwc->start_config_issued = false;
+		/* Fall through */
 	default:
 		dev_vdbg(dwc->dev, "Forwarding to gadget driver\n");
 		ret = dwc3_ep0_delegate_req(dwc, ctrl);
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 13/60] usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (11 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 12/60] usb: dwc3: Reset the transfer resource index on SET_INTERFACE Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 14/60] xhci: Calculate old endpoints correctly on device reset Kamal Mostafa
                   ` (46 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Aman Deep, Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: AMAN DEEP <aman.deep@samsung.com>

commit 3496810663922617d4b706ef2780c279252ddd6a upstream.

virt_dev->num_cached_rings counts on freed ring and is not updated
correctly. In xhci_free_or_cache_endpoint_ring() function, the free ring
is added into cache and then num_rings_cache is incremented as below:
		virt_dev->ring_cache[rings_cached] =
			virt_dev->eps[ep_index].ring;
		virt_dev->num_rings_cached++;
here, free ring pointer is added to a current index and then
index is incremented.
So current index always points to empty location in the ring cache.
For getting available free ring, current index should be decremented
first and then corresponding ring buffer value should be taken from ring
cache.

But In function xhci_endpoint_init(), the num_rings_cached index is
accessed before decrement.
		virt_dev->eps[ep_index].new_ring =
			virt_dev->ring_cache[virt_dev->num_rings_cached];
		virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL;
		virt_dev->num_rings_cached--;
This is bug in manipulating the index of ring cache.
And it should be as below:
		virt_dev->num_rings_cached--;
		virt_dev->eps[ep_index].new_ring =
			virt_dev->ring_cache[virt_dev->num_rings_cached];
		virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL;

Signed-off-by: Aman Deep <aman.deep@samsung.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/xhci-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 06d0d1e..146923a 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1331,10 +1331,10 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
 		/* Attempt to use the ring cache */
 		if (virt_dev->num_rings_cached == 0)
 			return -ENOMEM;
+		virt_dev->num_rings_cached--;
 		virt_dev->eps[ep_index].new_ring =
 			virt_dev->ring_cache[virt_dev->num_rings_cached];
 		virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL;
-		virt_dev->num_rings_cached--;
 		xhci_reinit_cached_ring(xhci, virt_dev->eps[ep_index].new_ring,
 					1, type);
 	}
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 14/60] xhci: Calculate old endpoints correctly on device reset
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (12 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 13/60] usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 15/60] xhci: report U3 when link is in resume state Kamal Mostafa
                   ` (45 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Brian Campbell, Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Brian Campbell <bacam@z273.org.uk>

commit 326124a027abc9a7f43f72dc94f6f0f7a55b02b3 upstream.

When resetting a device the number of active TTs may need to be
corrected by xhci_update_tt_active_eps, but the number of old active
endpoints supplied to it was always zero, so the number of TTs and the
bandwidth reserved for them was not updated, and could rise
unnecessarily.

This affected systems using Intel's Patherpoint chipset, which rely on
software bandwidth checking.  For example, a Lenovo X230 would lose the
ability to use ports on the docking station after enough suspend/resume
cycles because the bandwidth calculated would rise with every cycle when
a suitable device is attached.

The correct number of active endpoints is calculated in the same way as
in xhci_reserve_bandwidth.

Signed-off-by: Brian Campbell <bacam@z273.org.uk>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@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 b2b2da2..1fc236c 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3425,6 +3425,9 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev)
 			return -EINVAL;
 	}
 
+	if (virt_dev->tt_info)
+		old_active_eps = virt_dev->tt_info->active_eps;
+
 	if (virt_dev->udev != udev) {
 		/* If the virt_dev and the udev does not match, this virt_dev
 		 * may belong to another udev.
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 15/60] xhci: report U3 when link is in resume state
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (13 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 14/60] xhci: Calculate old endpoints correctly on device reset Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 16/60] xhci: prevent bus_suspend if SS port resuming in phase 1 Kamal Mostafa
                   ` (44 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Zhuang Jin Can, Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Zhuang Jin Can <jin.can.zhuang@intel.com>

commit 243292a2ad3dc365849b820a64868927168894ac upstream.

xhci_hub_report_usb3_link_state() returns pls as U0 when the link
is in resume state, and this causes usb core to think the link is in
U0 while actually it's in resume state. When usb core transfers
control request on the link, it fails with TRB error as the link
is not ready for transfer.

To fix the issue, report U3 when the link is in resume state, thus
usb core knows the link it's not ready for transfer.

Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/xhci-hub.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 9b69daf..d2d82de 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -480,10 +480,13 @@ static void xhci_hub_report_usb3_link_state(struct xhci_hcd *xhci,
 	u32 pls = status_reg & PORT_PLS_MASK;
 
 	/* resume state is a xHCI internal state.
-	 * Do not report it to usb core.
+	 * Do not report it to usb core, instead, pretend to be U3,
+	 * thus usb core knows it's not ready for transfer
 	 */
-	if (pls == XDEV_RESUME)
+	if (pls == XDEV_RESUME) {
+		*status |= USB_SS_PORT_LS_U3;
 		return;
+	}
 
 	/* When the CAS bit is set then warm reset
 	 * should be performed on port
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 16/60] xhci: prevent bus_suspend if SS port resuming in phase 1
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (14 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 15/60] xhci: report U3 when link is in resume state Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 17/60] xhci: do not report PLC when link is in internal resume state Kamal Mostafa
                   ` (43 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Zhuang Jin Can, Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Zhuang Jin Can <jin.can.zhuang@intel.com>

commit fac4271d1126c45ceaceb7f4a336317b771eb121 upstream.

When the link is just waken, it's in Resume state, and driver sets PLS to
U0. This refers to Phase 1. Phase 2 refers to when the link has completed
the transition from Resume state to U0.

With the fix of xhci: report U3 when link is in resume state, it also
exposes an issue that usb3 roothub and controller can suspend right
after phase 1, and this causes a hard hang in controller.

To fix the issue, we need to prevent usb3 bus suspend if any port is
resuming in phase 1.

[merge separate USB2 and USB3 port resume checking to one -Mathias]
Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/xhci-hub.c  | 6 +++---
 drivers/usb/host/xhci-ring.c | 3 +++
 drivers/usb/host/xhci.h      | 1 +
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index d2d82de..672e0b1 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -1121,10 +1121,10 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
 	spin_lock_irqsave(&xhci->lock, flags);
 
 	if (hcd->self.root_hub->do_remote_wakeup) {
-		if (bus_state->resuming_ports) {
+		if (bus_state->resuming_ports ||	/* USB2 */
+		    bus_state->port_remote_wakeup) {	/* USB3 */
 			spin_unlock_irqrestore(&xhci->lock, flags);
-			xhci_dbg(xhci, "suspend failed because "
-						"a port is resuming\n");
+			xhci_dbg(xhci, "suspend failed because a port is resuming\n");
 			return -EBUSY;
 		}
 	}
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index d328d16..3f1276c 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1757,6 +1757,9 @@ static void handle_port_status(struct xhci_hcd *xhci,
 		usb_hcd_resume_root_hub(hcd);
 	}
 
+	if (hcd->speed == HCD_USB3 && (temp & PORT_PLS_MASK) == XDEV_INACTIVE)
+		bus_state->port_remote_wakeup &= ~(1 << faked_port_index);
+
 	if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_RESUME) {
 		xhci_dbg(xhci, "port resume event for port %d\n", port_id);
 
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 5b77371..d053de1 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -285,6 +285,7 @@ struct xhci_op_regs {
 #define XDEV_U0		(0x0 << 5)
 #define XDEV_U2		(0x2 << 5)
 #define XDEV_U3		(0x3 << 5)
+#define XDEV_INACTIVE	(0x6 << 5)
 #define XDEV_RESUME	(0xf << 5)
 /* true: port has power (see HCC_PPC) */
 #define PORT_POWER	(1 << 9)
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 17/60] xhci: do not report PLC when link is in internal resume state
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (15 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 16/60] xhci: prevent bus_suspend if SS port resuming in phase 1 Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 18/60] USB: OHCI: Fix race between ED unlink and URB submission Kamal Mostafa
                   ` (42 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Zhuang Jin Can, Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Zhuang Jin Can <jin.can.zhuang@intel.com>

commit aca3a0489ac019b58cf32794d5362bb284cb9b94 upstream.

Port link change with port in resume state should not be
reported to usbcore, as this is an internal state to be
handled by xhci driver. Reporting PLC to usbcore may
cause usbcore clearing PLC first and port change event irq
won't be generated.

Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/xhci-hub.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 672e0b1..50d8413 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -587,7 +587,14 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
 		status |= USB_PORT_STAT_C_RESET << 16;
 	/* USB3.0 only */
 	if (hcd->speed == HCD_USB3) {
-		if ((raw_port_status & PORT_PLC))
+		/* Port link change with port in resume state should not be
+		 * reported to usbcore, as this is an internal state to be
+		 * handled by xhci driver. Reporting PLC to usbcore may
+		 * cause usbcore clearing PLC first and port change event
+		 * irq won't be generated.
+		 */
+		if ((raw_port_status & PORT_PLC) &&
+			(raw_port_status & PORT_PLS_MASK) != XDEV_RESUME)
 			status |= USB_PORT_STAT_C_LINK_STATE << 16;
 		if ((raw_port_status & PORT_WRC))
 			status |= USB_PORT_STAT_C_BH_RESET << 16;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 18/60] USB: OHCI: Fix race between ED unlink and URB submission
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (16 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 17/60] xhci: do not report PLC when link is in internal resume state Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 19/60] usb-storage: ignore ZTE MF 823 card reader in mode 0x1225 Kamal Mostafa
                   ` (41 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Stern, Greg Kroah-Hartman, Luis Henriques, Kamal Mostafa

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

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

From: Alan Stern <stern@rowland.harvard.edu>

commit 7d8021c967648accd1b78e5e1ddaad655cd2c61f upstream.

This patch fixes a bug introduced by commit 977dcfdc6031 ("USB: OHCI:
don't lose track of EDs when a controller dies").  The commit changed
ed_state from ED_UNLINK to ED_IDLE too early, before finish_urb() had
been called.  The user-visible consequence is that the driver
occasionally crashes or locks up when an URB is submitted while
another URB for the same endpoint is being unlinked.

This patch moves the ED state change later, to the right place.  The
drawback is that now we may unnecessarily execute some instructions
multiple times when a controller dies.  Since controllers dying is an
exceptional occurrence, a little wasted time won't matter.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Heiko Przybyl <lil_tux@web.de>
Tested-by: Heiko Przybyl <lil_tux@web.de>
Fixes: 977dcfdc60311e7aa571cabf6f39c36dde13339e
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/ohci-q.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index 4e9f6a4..810bfb1 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -929,10 +929,6 @@ rescan_all:
 		int			completed, modified;
 		__hc32			*prev;
 
-		/* Is this ED already invisible to the hardware? */
-		if (ed->state == ED_IDLE)
-			goto ed_idle;
-
 		/* only take off EDs that the HC isn't using, accounting for
 		 * frame counter wraps and EDs with partially retired TDs
 		 */
@@ -963,14 +959,12 @@ skip_ed:
 		}
 
 		/* ED's now officially unlinked, hc doesn't see */
-		ed->state = ED_IDLE;
 		if (quirk_zfmicro(ohci) && ed->type == PIPE_INTERRUPT)
 			ohci->eds_scheduled--;
 		ed->hwHeadP &= ~cpu_to_hc32(ohci, ED_H);
 		ed->hwNextED = 0;
 		wmb();
 		ed->hwINFO &= ~cpu_to_hc32(ohci, ED_SKIP | ED_DEQUEUE);
-ed_idle:
 
 		/* reentrancy:  if we drop the schedule lock, someone might
 		 * have modified this list.  normally it's just prepending
@@ -1041,6 +1035,7 @@ rescan_this:
 		if (list_empty(&ed->td_list)) {
 			*last = ed->ed_next;
 			ed->ed_next = NULL;
+			ed->state = ED_IDLE;
 		} else if (ohci->rh_state == OHCI_RH_RUNNING) {
 			*last = ed->ed_next;
 			ed->ed_next = NULL;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 19/60] usb-storage: ignore ZTE MF 823 card reader in mode 0x1225
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (17 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 18/60] USB: OHCI: Fix race between ED unlink and URB submission Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 20/60] blkcg: fix gendisk reference leak in blkg_conf_prep() Kamal Mostafa
                   ` (40 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Oliver Neukum, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Oliver Neukum <oneukum@suse.com>

commit 5fb2c782f451a4fb9c19c076e2c442839faf0f76 upstream.

This device automatically switches itself to another mode (0x1405)
unless the specific access pattern of Windows is followed in its
initial mode. That makes a dirty unmount of the internal storage
devices inevitable if they are mounted. So the card reader of
such a device should be ignored, lest an unclean removal become
inevitable.

This replaces an earlier patch that ignored all LUNs of this device.
That patch was overly broad.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reviewed-by: Lars Melin <larsm17@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/storage/unusual_devs.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 3e5fa2e..ccd7058 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -2046,6 +2046,18 @@ UNUSUAL_DEV( 0x1908, 0x3335, 0x0200, 0x0200,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_NO_READ_DISC_INFO ),
 
+/* Reported by Oliver Neukum <oneukum@suse.com>
+ * This device morphes spontaneously into another device if the access
+ * pattern of Windows isn't followed. Thus writable media would be dirty
+ * if the initial instance is used. So the device is limited to its
+ * virtual CD.
+ * And yes, the concept that BCD goes up to 9 is not heeded */
+UNUSUAL_DEV( 0x19d2, 0x1225, 0x0000, 0xffff,
+		"ZTE,Incorporated",
+		"ZTE WCDMA Technologies MSM",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_SINGLE_LUN ),
+
 /* Reported by Sven Geggus <sven-usbst@geggus.net>
  * This encrypted pen drive returns bogus data for the initial READ(10).
  */
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 20/60] blkcg: fix gendisk reference leak in blkg_conf_prep()
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (18 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 19/60] usb-storage: ignore ZTE MF 823 card reader in mode 0x1225 Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 21/60] tile: use free_bootmem_late() for initrd Kamal Mostafa
                   ` (39 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tejun Heo, Jens Axboe, Kamal Mostafa

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

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

From: Tejun Heo <tj@kernel.org>

commit 5f6c2d2b7dbb541c1e922538c49fa04c494ae3d7 upstream.

When a blkcg configuration is targeted to a partition rather than a
whole device, blkg_conf_prep fails with -EINVAL; unfortunately, it
forgets to put the gendisk ref in that case.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 block/blk-cgroup.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index d8f80e7..a717585 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -703,8 +703,12 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
 		return -EINVAL;
 
 	disk = get_gendisk(MKDEV(major, minor), &part);
-	if (!disk || part)
+	if (!disk)
 		return -EINVAL;
+	if (part) {
+		put_disk(disk);
+		return -EINVAL;
+	}
 
 	rcu_read_lock();
 	spin_lock_irq(disk->queue->queue_lock);
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 21/60] tile: use free_bootmem_late() for initrd
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (19 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 20/60] blkcg: fix gendisk reference leak in blkg_conf_prep() Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 22/60] Input: usbtouchscreen - avoid unresponsive TSC-30 touch screen Kamal Mostafa
                   ` (38 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Chris Metcalf, Kamal Mostafa

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

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

From: Chris Metcalf <cmetcalf@ezchip.com>

commit 3f81d2447b37ac697b3c600039f2c6b628c06e21 upstream.

We were previously using free_bootmem() and just getting lucky
that nothing too bad happened.

Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/tile/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index 74c9172..bdb3ecf 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -1146,7 +1146,7 @@ static void __init load_hv_initrd(void)
 
 void __init free_initrd_mem(unsigned long begin, unsigned long end)
 {
-	free_bootmem(__pa(begin), end - begin);
+	free_bootmem_late(__pa(begin), end - begin);
 }
 
 static int __init setup_initrd(char *str)
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 22/60] Input: usbtouchscreen - avoid unresponsive TSC-30 touch screen
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (20 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 21/60] tile: use free_bootmem_late() for initrd Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 23/60] md/raid1: fix test for 'was read error from last working device' Kamal Mostafa
                   ` (37 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bernhard Bender, Dmitry Torokhov, Kamal Mostafa

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

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

From: Bernhard Bender <bernhard.bender@bytecmed.com>

commit 968491709e5b1aaf429428814fff3d932fa90b60 upstream.

This patch fixes a problem in the usbtouchscreen driver for DMC TSC-30
touch screen.  Due to a missing delay between the RESET and SET_RATE
commands, the touch screen may become unresponsive during system startup or
driver loading.

According to the DMC documentation, a delay is needed after the RESET
command to allow the chip to complete its internal initialization. As this
delay is not guaranteed, we had a system where the touch screen
occasionally did not send any touch data. There was no other indication of
the problem.

The patch fixes the problem by adding a 150ms delay between the RESET and
SET_RATE commands.

Suggested-by: Jakob Mustafa <jakob.mustafa@bytecmed.com>
Signed-off-by: Bernhard Bender <bernhard.bender@bytecmed.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/input/touchscreen/usbtouchscreen.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 5f87bed..20aef5d 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -626,6 +626,9 @@ static int dmc_tsc10_init(struct usbtouch_usb *usbtouch)
 		goto err_out;
 	}
 
+	/* TSC-25 data sheet specifies a delay after the RESET command */
+	msleep(150);
+
 	/* set coordinate output rate */
 	buf[0] = buf[1] = 0xFF;
 	ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0),
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 23/60] md/raid1: fix test for 'was read error from last working device'.
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (21 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 22/60] Input: usbtouchscreen - avoid unresponsive TSC-30 touch screen Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 24/60] mmc: omap_hsmmc: Fix DTO and DCRC handling Kamal Mostafa
                   ` (36 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.com>

commit 34cab6f42003cb06f48f86a86652984dec338ae9 upstream.

When we get a read error from the last working device, we don't
try to repair it, and don't fail the device.  We simple report a
read error to the caller.

However the current test for 'is this the last working device' is
wrong.
When there is only one fully working device, it assumes that a
non-faulty device is that device.  However a spare which is rebuilding
would be non-faulty but so not the only working device.

So change the test from "!Faulty" to "In_sync".  If ->degraded says
there is only one fully working device and this device is in_sync,
this must be the one.

This bug has existed since we allowed read_balance to read from
a recovering spare in v3.0

Reported-and-tested-by: Alexander Lyakas <alex.bolshoy@gmail.com>
Fixes: 76073054c95b ("md/raid1: clean up read_balance.")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 53457ee..d08e98e 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -337,7 +337,7 @@ static void raid1_end_read_request(struct bio *bio, int error)
 		spin_lock_irqsave(&conf->device_lock, flags);
 		if (r1_bio->mddev->degraded == conf->raid_disks ||
 		    (r1_bio->mddev->degraded == conf->raid_disks-1 &&
-		     !test_bit(Faulty, &conf->mirrors[mirror].rdev->flags)))
+		     test_bit(In_sync, &conf->mirrors[mirror].rdev->flags)))
 			uptodate = 1;
 		spin_unlock_irqrestore(&conf->device_lock, flags);
 	}
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 24/60] mmc: omap_hsmmc: Fix DTO and DCRC handling
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (22 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 23/60] md/raid1: fix test for 'was read error from last working device' Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 25/60] isdn/gigaset: reset tty->receive_room when attaching ser_gigaset Kamal Mostafa
                   ` (35 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kishon Vijay Abraham I, Vignesh R, Ulf Hansson, Kamal Mostafa

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

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

From: Kishon Vijay Abraham I <kishon@ti.com>

commit 408806f740497c5d71f9c305b3d6aad260ff186d upstream.

DTO/DCRC errors were not being informed to the mmc core since
commit ae4bf788ee9b ("mmc: omap_hsmmc: consolidate error report handling of
HSMMC IRQ"). This commit made sure 'end_trans' is never set on DTO/DCRC
errors. This is because after this commit 'host->data' is checked after
it has been cleared to NULL by omap_hsmmc_dma_cleanup().

Because 'end_trans' is never set, omap_hsmmc_xfer_done() is never invoked
making core layer not to be aware of DTO/DCRC errors. Because of this
any command invoked after DTO/DCRC error leads to a hang.

Fix this by checking for 'host->data' before it is actually cleared.

Fixes: ae4bf788ee9b ("mmc: omap_hsmmc: consolidate error report handling of
HSMMC IRQ")

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Tested-by: Andreas Fenkart <afenkart@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/mmc/host/omap_hsmmc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index dbd32ad..99bd1d1 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1024,15 +1024,15 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
 
 		if (status & (CTO_EN | CCRC_EN))
 			end_cmd = 1;
+		if (host->data || host->response_busy) {
+			end_trans = !end_cmd;
+			host->response_busy = 0;
+		}
 		if (status & (CTO_EN | DTO_EN))
 			hsmmc_command_incomplete(host, -ETIMEDOUT, end_cmd);
 		else if (status & (CCRC_EN | DCRC_EN))
 			hsmmc_command_incomplete(host, -EILSEQ, end_cmd);
 
-		if (host->data || host->response_busy) {
-			end_trans = !end_cmd;
-			host->response_busy = 0;
-		}
 	}
 
 	OMAP_HSMMC_WRITE(host->base, STAT, status);
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 25/60] isdn/gigaset: reset tty->receive_room when attaching ser_gigaset
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (23 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 24/60] mmc: omap_hsmmc: Fix DTO and DCRC handling Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 26/60] mmc: sdhci-pxav3: fix platform_data is not initialized Kamal Mostafa
                   ` (34 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tilman Schmidt, David S. Miller, Kamal Mostafa

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

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

From: Tilman Schmidt <tilman@imap.cc>

commit fd98e9419d8d622a4de91f76b306af6aa627aa9c upstream.

Commit 79901317ce80 ("n_tty: Don't flush buffer when closing ldisc"),
first merged in kernel release 3.10, caused the following regression
in the Gigaset M101 driver:

Before that commit, when closing the N_TTY line discipline in
preparation to switching to N_GIGASET_M101, receive_room would be
reset to a non-zero value by the call to n_tty_flush_buffer() in
n_tty's close method. With the removal of that call, receive_room
might be left at zero, blocking data reception on the serial line.

The present patch fixes that regression by setting receive_room
to an appropriate value in the ldisc open method.

Fixes: 79901317ce80 ("n_tty: Don't flush buffer when closing ldisc")
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/isdn/gigaset/ser-gigaset.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
index 8c91fd5..3ac9c41 100644
--- a/drivers/isdn/gigaset/ser-gigaset.c
+++ b/drivers/isdn/gigaset/ser-gigaset.c
@@ -524,9 +524,18 @@ gigaset_tty_open(struct tty_struct *tty)
 	cs->hw.ser->tty = tty;
 	atomic_set(&cs->hw.ser->refcnt, 1);
 	init_completion(&cs->hw.ser->dead_cmp);
-
 	tty->disc_data = cs;
 
+	/* Set the amount of data we're willing to receive per call
+	 * from the hardware driver to half of the input buffer size
+	 * to leave some reserve.
+	 * Note: We don't do flow control towards the hardware driver.
+	 * If more data is received than will fit into the input buffer,
+	 * it will be dropped and an error will be logged. This should
+	 * never happen as the device is slow and the buffer size ample.
+	 */
+	tty->receive_room = RBUFSIZE/2;
+
 	/* OK.. Initialization of the datastructures and the HW is done.. Now
 	 * startup system and notify the LL that we are ready to run
 	 */
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 26/60] mmc: sdhci-pxav3: fix platform_data is not initialized
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (24 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 25/60] isdn/gigaset: reset tty->receive_room when attaching ser_gigaset Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 27/60] mmc: block: Add missing mmc_blk_put() in power_ro_lock_show() Kamal Mostafa
                   ` (33 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Jingju Hou, Ulf Hansson, Kamal Mostafa

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

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

From: Jingju Hou <houjingj@marvell.com>

commit 9cd76049f0d90ae241f5ad80e311489824527000 upstream.

pdev->dev.platform_data is not initialized if match is true in function
sdhci_pxav3_probe. Just local variable pdata is assigned the return value
from function pxav3_get_mmc_pdata().

static int sdhci_pxav3_probe(struct platform_device *pdev) {

    struct sdhci_pxa_platdata *pdata = pdev->dev.platform_data;
    ...
    if (match) {
		ret = mmc_of_parse(host->mmc);
		if (ret)
			goto err_of_parse;
		sdhci_get_of_property(pdev);
		pdata = pxav3_get_mmc_pdata(dev);
     }
     ...
}

Signed-off-by: Jingju Hou <houjingj@marvell.com>
Fixes: b650352dd3df("mmc: sdhci-pxa: Add device tree support")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/mmc/host/sdhci-pxav3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 9654246..b8f319d 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -257,6 +257,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 			goto err_of_parse;
 		sdhci_get_of_property(pdev);
 		pdata = pxav3_get_mmc_pdata(dev);
+		pdev->dev.platform_data = pdata;
 	} else if (pdata) {
 		/* on-chip device */
 		if (pdata->flags & PXA_FLAG_CARD_PERMANENT)
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 27/60] mmc: block: Add missing mmc_blk_put() in power_ro_lock_show()
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (25 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 26/60] mmc: sdhci-pxav3: fix platform_data is not initialized Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 28/60] mmc: sdhci-esdhc: Make 8BIT bus work Kamal Mostafa
                   ` (32 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tomas Winkler, Ulf Hansson, Kamal Mostafa

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

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

From: Tomas Winkler <tomas.winkler@intel.com>

commit 9098f84cced870f54d8c410dd2444cfa61467fa0 upstream.

Enclosing mmc_blk_put() is missing in power_ro_lock_show() sysfs handler,
let's add it.

Fixes: add710eaa886 ("mmc: boot partition ro lock support")
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/mmc/card/block.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index a651096..a6bf69b 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -205,6 +205,8 @@ static ssize_t power_ro_lock_show(struct device *dev,
 
 	ret = snprintf(buf, PAGE_SIZE, "%d\n", locked);
 
+	mmc_blk_put(md);
+
 	return ret;
 }
 
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 28/60] mmc: sdhci-esdhc: Make 8BIT bus work
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (26 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 27/60] mmc: block: Add missing mmc_blk_put() in power_ro_lock_show() Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 29/60] bonding: correctly handle bonding type change on enslave failure Kamal Mostafa
                   ` (31 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Joakim Tjernlund, Ulf Hansson, Kamal Mostafa

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

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

From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>

commit 8e91125ff3f57f15c6568e2a6d32743b3f7815e4 upstream.

Support for 8BIT bus with was added some time ago to sdhci-esdhc but
then missed to remove the 8BIT from the reserved bit mask which made
8BIT non functional.

Fixes: 66b50a00992d ("mmc: esdhc: Add support for 8-bit bus width and..")
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/mmc/host/sdhci-esdhc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h
index a7d9f95..7fd86be 100644
--- a/drivers/mmc/host/sdhci-esdhc.h
+++ b/drivers/mmc/host/sdhci-esdhc.h
@@ -47,6 +47,6 @@
 #define ESDHC_DMA_SYSCTL	0x40c
 #define ESDHC_DMA_SNOOP		0x00000040
 
-#define ESDHC_HOST_CONTROL_RES	0x05
+#define ESDHC_HOST_CONTROL_RES	0x01
 
 #endif /* _DRIVERS_MMC_SDHCI_ESDHC_H */
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 29/60] bonding: correctly handle bonding type change on enslave failure
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (27 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 28/60] mmc: sdhci-esdhc: Make 8BIT bus work Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 30/60] net: Clone skb before setting peeked flag Kamal Mostafa
                   ` (30 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nikolay Aleksandrov, David S. Miller, Kamal Mostafa

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

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

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

commit 7d5cd2ce5292b45e555de776cb9e72975a07460d upstream.

If the bond is enslaving a device with different type it will be setup
by it, but if after being setup the enslave fails the bond doesn't
switch back its type and also keeps pointers to foreign structures that can
be long gone. Thus revert back any type changes if the enslave failed and
the bond had to change its type.
Example:
 Before patch:
$ echo lo > bond0/bonding/slaves
-bash: echo: write error: Cannot assign requested address
$ ip l sh bond0
20: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
mode DEFAULT group default
    link/loopback 16:54:78:34:bd:41 brd 00:00:00:00:00:00
$ echo +eth1 > bond0/bonding/slaves
$ ip l sh bond0
20: bond0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode
DEFAULT group default qlen 1000
    link/ether 52:54:00:3f:47:69 brd ff:ff:ff:ff:ff:ff
(notice the MASTER flag is gone)

 After patch:
$ echo lo > bond0/bonding/slaves
-bash: echo: write error: Cannot assign requested address
$ ip l sh bond0
21: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
mode DEFAULT group default qlen 1000
    link/ether 6e:66:94:f6:07:fc brd ff:ff:ff:ff:ff:ff
$ echo +eth1 > bond0/bonding/slaves
$ ip l sh bond0
21: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
mode DEFAULT group default qlen 1000
    link/ether 52:54:00:3f:47:69 brd ff:ff:ff:ff:ff:ff

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fixes: e36b9d16c6a6 ("bonding: clean muticast addresses when device changes type")
Signed-off-by: David S. Miller <davem@davemloft.net>
[ kamal: backport to 3.13-stable: uses ether_addr_equal() not _equal64bits() ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/bonding/bond_main.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index db8844d..175f8f7 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1657,9 +1657,16 @@ err_free:
 
 err_undo_flags:
 	/* Enslave of first slave has failed and we need to fix master's mac */
-	if (!bond_has_slaves(bond) &&
-	    ether_addr_equal(bond_dev->dev_addr, slave_dev->dev_addr))
-		eth_hw_addr_random(bond_dev);
+	if (!bond_has_slaves(bond)) {
+		if (ether_addr_equal(bond_dev->dev_addr,
+					    slave_dev->dev_addr))
+			eth_hw_addr_random(bond_dev);
+		if (bond_dev->type != ARPHRD_ETHER) {
+			ether_setup(bond_dev);
+			bond_dev->flags |= IFF_MASTER;
+			bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
+		}
+	}
 
 	return res;
 }
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 30/60] net: Clone skb before setting peeked flag
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (28 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 29/60] bonding: correctly handle bonding type change on enslave failure Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 31/60] bridge: mdb: fix double add notification Kamal Mostafa
                   ` (29 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Herbert Xu, David S. Miller, Kamal Mostafa

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

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

From: Herbert Xu <herbert@gondor.apana.org.au>

commit 738ac1ebb96d02e0d23bc320302a6ea94c612dec upstream.

Shared skbs must not be modified and this is crucial for broadcast
and/or multicast paths where we use it as an optimisation to avoid
unnecessary cloning.

The function skb_recv_datagram breaks this rule by setting peeked
without cloning the skb first.  This causes funky races which leads
to double-free.

This patch fixes this by cloning the skb and replacing the skb
in the list when setting skb->peeked.

Fixes: a59322be07c9 ("[UDP]: Only increment counter on first peek/recv")
Reported-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/core/datagram.c | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/net/core/datagram.c b/net/core/datagram.c
index a16ed7b..7f6f929 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -130,6 +130,35 @@ out_noerr:
 	goto out;
 }
 
+static int skb_set_peeked(struct sk_buff *skb)
+{
+	struct sk_buff *nskb;
+
+	if (skb->peeked)
+		return 0;
+
+	/* We have to unshare an skb before modifying it. */
+	if (!skb_shared(skb))
+		goto done;
+
+	nskb = skb_clone(skb, GFP_ATOMIC);
+	if (!nskb)
+		return -ENOMEM;
+
+	skb->prev->next = nskb;
+	skb->next->prev = nskb;
+	nskb->prev = skb->prev;
+	nskb->next = skb->next;
+
+	consume_skb(skb);
+	skb = nskb;
+
+done:
+	skb->peeked = 1;
+
+	return 0;
+}
+
 /**
  *	__skb_recv_datagram - Receive a datagram skbuff
  *	@sk: socket
@@ -164,7 +193,9 @@ out_noerr:
 struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags,
 				    int *peeked, int *off, int *err)
 {
+	struct sk_buff_head *queue = &sk->sk_receive_queue;
 	struct sk_buff *skb, *last;
+	unsigned long cpu_flags;
 	long timeo;
 	/*
 	 * Caller is allowed not to check sk->sk_err before skb_recv_datagram()
@@ -183,8 +214,6 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags,
 		 * Look at current nfs client by the way...
 		 * However, this function was correct in any case. 8)
 		 */
-		unsigned long cpu_flags;
-		struct sk_buff_head *queue = &sk->sk_receive_queue;
 		int _off = *off;
 
 		last = (struct sk_buff *)queue;
@@ -198,7 +227,11 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags,
 					_off -= skb->len;
 					continue;
 				}
-				skb->peeked = 1;
+
+				error = skb_set_peeked(skb);
+				if (error)
+					goto unlock_err;
+
 				atomic_inc(&skb->users);
 			} else
 				__skb_unlink(skb, queue);
@@ -222,6 +255,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags,
 
 	return NULL;
 
+unlock_err:
+	spin_unlock_irqrestore(&queue->lock, cpu_flags);
 no_packet:
 	*err = error;
 	return NULL;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 31/60] bridge: mdb: fix double add notification
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (29 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 30/60] net: Clone skb before setting peeked flag Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 32/60] usb: gadget: mv_udc_core: fix phy_regs I/O memory leak Kamal Mostafa
                   ` (28 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nikolay Aleksandrov, David S. Miller, Kamal Mostafa

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

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

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

commit 5ebc784625ea68a9570d1f70557e7932988cd1b4 upstream.

Since the mdb add/del code was introduced there have been 2 br_mdb_notify
calls when doing br_mdb_add() resulting in 2 notifications on each add.

Example:
 Command: bridge mdb add dev br0 port eth1 grp 239.0.0.1 permanent
 Before patch:
 root@debian:~# bridge monitor all
 [MDB]dev br0 port eth1 grp 239.0.0.1 permanent
 [MDB]dev br0 port eth1 grp 239.0.0.1 permanent

 After patch:
 root@debian:~# bridge monitor all
 [MDB]dev br0 port eth1 grp 239.0.0.1 permanent

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fixes: cfd567543590 ("bridge: add support of adding and deleting mdb entries")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/bridge/br_mdb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
index af8315a..589afd0 100644
--- a/net/bridge/br_mdb.c
+++ b/net/bridge/br_mdb.c
@@ -350,7 +350,6 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
 	if (state == MDB_TEMPORARY)
 		mod_timer(&p->timer, now + br->multicast_membership_interval);
 
-	br_mdb_notify(br->dev, port, group, RTM_NEWMDB);
 	return 0;
 }
 
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 32/60] usb: gadget: mv_udc_core: fix phy_regs I/O memory leak
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (30 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 31/60] bridge: mdb: fix double add notification Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 33/60] inet: frags: fix defragmented packet's IP header for af_packet Kamal Mostafa
                   ` (27 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexey Khoroshilov, Felipe Balbi, Luis Henriques, Kamal Mostafa

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

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

From: Alexey Khoroshilov <khoroshilov@ispras.ru>

commit 53e20f2eb161fbe9eea28b54dccc870cec94eca2 upstream.

There was an omission in transition to devm_xxx resource handling.
iounmap(udc->phy_regs) were removed, but ioremap() was left
without devm_.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 3517c31a8ece6 ("usb: gadget: mv_udc: use devm_xxx for probe")
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
  - file rename: drivers/usb/gadget/udc/mv_udc_core.c ->
    drivers/usb/gadget/mv_udc_core.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/gadget/mv_udc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index 104cdbe..f544495 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -2161,7 +2161,7 @@ static int mv_udc_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	udc->phy_regs = ioremap(r->start, resource_size(r));
+	udc->phy_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r));
 	if (udc->phy_regs == NULL) {
 		dev_err(&pdev->dev, "failed to map phy I/O memory\n");
 		return -EBUSY;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 33/60] inet: frags: fix defragmented packet's IP header for af_packet
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (31 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 32/60] usb: gadget: mv_udc_core: fix phy_regs I/O memory leak Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 34/60] bonding: fix destruction of bond with devices different from arphrd_ether Kamal Mostafa
                   ` (26 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Edward Hyunkoo Jee, Eric Dumazet, Willem de Bruijn, Jerry Chu,
	David S. Miller, Luis Henriques, Kamal Mostafa

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

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

From: Edward Hyunkoo Jee <edjee@google.com>

commit 0848f6428ba3a2e42db124d41ac6f548655735bf upstream.

When ip_frag_queue() computes positions, it assumes that the passed
sk_buff does not contain L2 headers.

However, when PACKET_FANOUT_FLAG_DEFRAG is used, IP reassembly
functions can be called on outgoing packets that contain L2 headers.

Also, IPv4 checksum is not corrected after reassembly.

Fixes: 7736d33f4262 ("packet: Add pre-defragmentation support for ipv4 fanouts.")
Signed-off-by: Edward Hyunkoo Jee <edjee@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Jerry Chu <hkchu@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/ipv4/ip_fragment.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index a679298..e7fe33f 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -357,7 +357,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
 	ihl = ip_hdrlen(skb);
 
 	/* Determine the position of this fragment. */
-	end = offset + skb->len - ihl;
+	end = offset + skb->len - skb_network_offset(skb) - ihl;
 	err = -EINVAL;
 
 	/* Is this the final fragment? */
@@ -387,7 +387,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
 		goto err;
 
 	err = -ENOMEM;
-	if (pskb_pull(skb, ihl) == NULL)
+	if (!pskb_pull(skb, skb_network_offset(skb) + ihl))
 		goto err;
 
 	err = pskb_trim_rcsum(skb, end - offset);
@@ -628,6 +628,9 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
 	iph->frag_off = qp->q.max_size ? htons(IP_DF) : 0;
 	iph->tot_len = htons(len);
 	iph->tos |= ecn;
+
+	ip_send_check(iph);
+
 	IP_INC_STATS_BH(net, IPSTATS_MIB_REASMOKS);
 	qp->q.fragments = NULL;
 	qp->q.fragments_tail = NULL;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 34/60] bonding: fix destruction of bond with devices different from arphrd_ether
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (32 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 33/60] inet: frags: fix defragmented packet's IP header for af_packet Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 35/60] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc Kamal Mostafa
                   ` (25 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nikolay Aleksandrov, David S. Miller, Luis Henriques, Kamal Mostafa

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

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

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

commit 06f6d1094aa0992432b1e2a0920b0ee86ccd83bf upstream.

When the bonding is being unloaded and the netdevice notifier is
unregistered it executes NETDEV_UNREGISTER for each device which should
remove the bond's proc entry but if the device enslaved is not of
ARPHRD_ETHER type and is in front of the bonding, it may execute
bond_release_and_destroy() first which would release the last slave and
destroy the bond device leaving the proc entry and thus we will get the
following error (with dynamic debug on for bond_netdev_event to see the
events order):
[  908.963051] eql: event: 9
[  908.963052] eql: IFF_SLAVE
[  908.963054] eql: event: 2
[  908.963056] eql: IFF_SLAVE
[  908.963058] eql: event: 6
[  908.963059] eql: IFF_SLAVE
[  908.963110] bond0: Releasing active interface eql
[  908.976168] bond0: Destroying bond bond0
[  908.976266] bond0 (unregistering): Released all slaves
[  908.984097] ------------[ cut here ]------------
[  908.984107] WARNING: CPU: 0 PID: 1787 at fs/proc/generic.c:575
remove_proc_entry+0x112/0x160()
[  908.984110] remove_proc_entry: removing non-empty directory
'net/bonding', leaking at least 'bond0'
[  908.984111] Modules linked in: bonding(-) eql(O) 9p nfsd auth_rpcgss
oid_registry nfs_acl nfs lockd grace fscache sunrpc crct10dif_pclmul
crc32_pclmul crc32c_intel ghash_clmulni_intel ppdev qxl drm_kms_helper
snd_hda_codec_generic aesni_intel ttm aes_x86_64 glue_helper pcspkr lrw
gf128mul ablk_helper cryptd snd_hda_intel virtio_console snd_hda_codec
psmouse serio_raw snd_hwdep snd_hda_core 9pnet_virtio 9pnet evdev joydev
drm virtio_balloon snd_pcm snd_timer snd soundcore i2c_piix4 i2c_core
pvpanic acpi_cpufreq parport_pc parport processor thermal_sys button
autofs4 ext4 crc16 mbcache jbd2 hid_generic usbhid hid sg sr_mod cdrom
ata_generic virtio_blk virtio_net floppy ata_piix e1000 libata ehci_pci
virtio_pci scsi_mod uhci_hcd ehci_hcd virtio_ring virtio usbcore
usb_common [last unloaded: bonding]

[  908.984168] CPU: 0 PID: 1787 Comm: rmmod Tainted: G        W  O
4.2.0-rc2+ #8
[  908.984170] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[  908.984172]  0000000000000000 ffffffff81732d41 ffffffff81525b34
ffff8800358dfda8
[  908.984175]  ffffffff8106c521 ffff88003595af78 ffff88003595af40
ffff88003e3a4280
[  908.984178]  ffffffffa058d040 0000000000000000 ffffffff8106c59a
ffffffff8172ebd0
[  908.984181] Call Trace:
[  908.984188]  [<ffffffff81525b34>] ? dump_stack+0x40/0x50
[  908.984193]  [<ffffffff8106c521>] ? warn_slowpath_common+0x81/0xb0
[  908.984196]  [<ffffffff8106c59a>] ? warn_slowpath_fmt+0x4a/0x50
[  908.984199]  [<ffffffff81218352>] ? remove_proc_entry+0x112/0x160
[  908.984205]  [<ffffffffa05850e6>] ? bond_destroy_proc_dir+0x26/0x30
[bonding]
[  908.984208]  [<ffffffffa057540e>] ? bond_net_exit+0x8e/0xa0 [bonding]
[  908.984217]  [<ffffffff8142f407>] ? ops_exit_list.isra.4+0x37/0x70
[  908.984225]  [<ffffffff8142f52d>] ?
unregister_pernet_operations+0x8d/0xd0
[  908.984228]  [<ffffffff8142f58d>] ?
unregister_pernet_subsys+0x1d/0x30
[  908.984232]  [<ffffffffa0585269>] ? bonding_exit+0x23/0xdba [bonding]
[  908.984236]  [<ffffffff810e28ba>] ? SyS_delete_module+0x18a/0x250
[  908.984241]  [<ffffffff81086f99>] ? task_work_run+0x89/0xc0
[  908.984244]  [<ffffffff8152b732>] ?
entry_SYSCALL_64_fastpath+0x16/0x75
[  908.984247] ---[ end trace 7c006ed4abbef24b ]---

Thus remove the proc entry manually if bond_release_and_destroy() is
used. Because of the checks in bond_remove_proc_entry() it's not a
problem for a bond device to change namespaces (the bug fixed by the
Fixes commit) but since commit
f9399814927ad ("bonding: Don't allow bond devices to change network
namespaces.") that can't happen anyway.

Reported-by: Carol Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fixes: a64d49c3dd50 ("bonding: Manage /proc/net/bonding/ entries from
                      the netdev events")
Tested-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/bonding/bond_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 175f8f7..74dab00 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1881,6 +1881,7 @@ static int  bond_release_and_destroy(struct net_device *bond_dev,
 		bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
 		pr_info("%s: destroying bond %s.\n",
 			bond_dev->name, bond_dev->name);
+		bond_remove_proc_entry(bond);
 		unregister_netdevice(bond_dev);
 	}
 	return ret;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 35/60] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (33 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 34/60] bonding: fix destruction of bond with devices different from arphrd_ether Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 36/60] ASoC: pcm1681: Fix setting de-emphasis sampling rate selection Kamal Mostafa
                   ` (24 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Roger Quadros, Paul Walmsley, Kamal Mostafa

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

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

From: Roger Quadros <rogerq@ti.com>

commit 9a258afa928b45e6dd2efcac46ccf7eea705d35a upstream.

For hwmods without sysc, _init_mpu_rt_base(oh) won't be called and so
_find_mpu_rt_port(oh) will return NULL thus preventing ready state check
on those modules after the module is enabled.

This can potentially cause a bus access error if the module is accessed
before the module is ready.

Fix this by unconditionally calling _init_mpu_rt_base() during hwmod
_init(). Do ioremap only if we need SYSC access.

Eventhough _wait_target_ready() check doesn't really need MPU RT port but
just the PRCM registers, we still mandate that the hwmod must have an
MPU RT port if ready state check needs to be done. Else it would mean that
the module is not accessible by MPU so there is no point in waiting
for target to be ready.

e.g. this fixes the below DCAN bus access error on AM437x-gp-evm.

[   16.672978] ------------[ cut here ]------------
[   16.677885] WARNING: CPU: 0 PID: 1580 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x234/0x35c()
[   16.687946] 44000000.ocp:L3 Custom Error: MASTER M2 (64-bit) TARGET L4_PER_0 (Read): Data Access in User mode during Functional access
[   16.700654] Modules linked in: xhci_hcd btwilink ti_vpfe dwc3 videobuf2_core ov2659 bluetooth v4l2_common videodev ti_am335x_adc kfifo_buf industrialio c_can_platform videobuf2_dma_contig media snd_soc_tlv320aic3x pixcir_i2c_ts c_can dc
[   16.731144] CPU: 0 PID: 1580 Comm: rpc.statd Not tainted 3.14.26-02561-gf733aa036398 #180
[   16.739747] Backtrace:
[   16.742336] [<c0011108>] (dump_backtrace) from [<c00112a4>] (show_stack+0x18/0x1c)
[   16.750285]  r6:00000093 r5:00000009 r4:eab5b8a8 r3:00000000
[   16.756252] [<c001128c>] (show_stack) from [<c05a4418>] (dump_stack+0x20/0x28)
[   16.763870] [<c05a43f8>] (dump_stack) from [<c0037120>] (warn_slowpath_common+0x6c/0x8c)
[   16.772408] [<c00370b4>] (warn_slowpath_common) from [<c00371e4>] (warn_slowpath_fmt+0x38/0x40)
[   16.781550]  r8:c05d1f90 r7:c0730844 r6:c0730448 r5:80080003 r4:ed0cd210
[   16.788626] [<c00371b0>] (warn_slowpath_fmt) from [<c027fa94>] (l3_interrupt_handler+0x234/0x35c)
[   16.797968]  r3:ed0cd480 r2:c0730508
[   16.801747] [<c027f860>] (l3_interrupt_handler) from [<c0063758>] (handle_irq_event_percpu+0x54/0x1bc)
[   16.811533]  r10:ed005600 r9:c084855b r8:0000002a r7:00000000 r6:00000000 r5:0000002a
[   16.819780]  r4:ed0e6d80
[   16.822453] [<c0063704>] (handle_irq_event_percpu) from [<c00638f0>] (handle_irq_event+0x30/0x40)
[   16.831789]  r10:eb2b6938 r9:eb2b6960 r8:bf011420 r7:fa240100 r6:00000000 r5:0000002a
[   16.840052]  r4:ed005600
[   16.842744] [<c00638c0>] (handle_irq_event) from [<c00661d8>] (handle_fasteoi_irq+0x74/0x128)
[   16.851702]  r4:ed005600 r3:00000000
[   16.855479] [<c0066164>] (handle_fasteoi_irq) from [<c0063068>] (generic_handle_irq+0x28/0x38)
[   16.864523]  r4:0000002a r3:c0066164
[   16.868294] [<c0063040>] (generic_handle_irq) from [<c000ef60>] (handle_IRQ+0x38/0x8c)
[   16.876612]  r4:c081c640 r3:00000202
[   16.880380] [<c000ef28>] (handle_IRQ) from [<c00084f0>] (gic_handle_irq+0x30/0x5c)
[   16.888328]  r6:eab5ba38 r5:c0804460 r4:fa24010c r3:00000100
[   16.894303] [<c00084c0>] (gic_handle_irq) from [<c05a8d80>] (__irq_svc+0x40/0x50)
[   16.902193] Exception stack(0xeab5ba38 to 0xeab5ba80)
[   16.907499] ba20:                                                       00000000 00000006
[   16.916108] ba40: fa1d0000 fa1d0008 ed3d3000 eab5bab4 ed3d3460 c0842af4 bf011420 eb2b6960
[   16.924716] ba60: eb2b6938 eab5ba8c eab5ba90 eab5ba80 bf035220 bf07702c 600f0013 ffffffff
[   16.933317]  r7:eab5ba6c r6:ffffffff r5:600f0013 r4:bf07702c
[   16.939317] [<bf077000>] (c_can_plat_read_reg_aligned_to_16bit [c_can_platform]) from [<bf035220>] (c_can_get_berr_counter+0x38/0x64 [c_can])
[   16.952696] [<bf0351e8>] (c_can_get_berr_counter [c_can]) from [<bf010294>] (can_fill_info+0x124/0x15c [can_dev])
[   16.963480]  r5:ec8c9740 r4:ed3d3000
[   16.967253] [<bf010170>] (can_fill_info [can_dev]) from [<c0502fa8>] (rtnl_fill_ifinfo+0x58c/0x8fc)
[   16.976749]  r6:ec8c9740 r5:ed3d3000 r4:eb2b6780
[   16.981613] [<c0502a1c>] (rtnl_fill_ifinfo) from [<c0503408>] (rtnl_dump_ifinfo+0xf0/0x1dc)
[   16.990401]  r10:ec8c9740 r9:00000000 r8:00000000 r7:00000000 r6:ebd4d1b4 r5:ed3d3000
[   16.998671]  r4:00000000
[   17.001342] [<c0503318>] (rtnl_dump_ifinfo) from [<c050e6e4>] (netlink_dump+0xa8/0x1e0)
[   17.009772]  r10:00000000 r9:00000000 r8:c0503318 r7:ebf3e6c0 r6:ebd4d1b4 r5:ec8c9740
[   17.018050]  r4:ebd4d000
[   17.020714] [<c050e63c>] (netlink_dump) from [<c050ec10>] (__netlink_dump_start+0x104/0x154)
[   17.029591]  r6:eab5bd34 r5:ec8c9980 r4:ebd4d000
[   17.034454] [<c050eb0c>] (__netlink_dump_start) from [<c0505604>] (rtnetlink_rcv_msg+0x110/0x1f4)
[   17.043778]  r7:00000000 r6:ec8c9980 r5:00000f40 r4:ebf3e6c0
[   17.049743] [<c05054f4>] (rtnetlink_rcv_msg) from [<c05108e8>] (netlink_rcv_skb+0xb4/0xc8)
[   17.058449]  r8:eab5bdac r7:ec8c9980 r6:c05054f4 r5:ec8c9980 r4:ebf3e6c0
[   17.065534] [<c0510834>] (netlink_rcv_skb) from [<c0504134>] (rtnetlink_rcv+0x24/0x2c)
[   17.073854]  r6:ebd4d000 r5:00000014 r4:ec8c9980 r3:c0504110
[   17.079846] [<c0504110>] (rtnetlink_rcv) from [<c05102ac>] (netlink_unicast+0x180/0x1ec)
[   17.088363]  r4:ed0c6800 r3:c0504110
[   17.092113] [<c051012c>] (netlink_unicast) from [<c0510670>] (netlink_sendmsg+0x2ac/0x380)
[   17.100813]  r10:00000000 r8:00000008 r7:ec8c9980 r6:ebd4d000 r5:eab5be70 r4:eab5bee4
[   17.109083] [<c05103c4>] (netlink_sendmsg) from [<c04dfdb4>] (sock_sendmsg+0x90/0xb0)
[   17.117305]  r10:00000000 r9:eab5a000 r8:becdda3c r7:0000000c r6:ea978400 r5:eab5be70
[   17.125563]  r4:c05103c4
[   17.128225] [<c04dfd24>] (sock_sendmsg) from [<c04e1c28>] (SyS_sendto+0xb8/0xdc)
[   17.136001]  r6:becdda5c r5:00000014 r4:ecd37040
[   17.140876] [<c04e1b70>] (SyS_sendto) from [<c000e680>] (ret_fast_syscall+0x0/0x30)
[   17.148923]  r10:00000000 r8:c000e804 r7:00000122 r6:becdda5c r5:0000000c r4:becdda5c
[   17.157169] ---[ end trace 2b71e15b38f58bad ]---

Fixes: 6423d6df1440 ("ARM: OMAP2+: hwmod: check for module address space during init")
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm/mach-omap2/omap_hwmod.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 8a1b5e0..f1a4cea 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2444,6 +2444,9 @@ static int of_dev_hwmod_lookup(struct device_node *np,
  * registers.  This address is needed early so the OCP registers that
  * are part of the device's address space can be ioremapped properly.
  *
+ * If SYSC access is not needed, the registers will not be remapped
+ * and non-availability of MPU access is not treated as an error.
+ *
  * Returns 0 on success, -EINVAL if an invalid hwmod is passed, and
  * -ENXIO on absent or invalid register target address space.
  */
@@ -2458,6 +2461,11 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
 
 	_save_mpu_port_index(oh);
 
+	/* if we don't need sysc access we don't need to ioremap */
+	if (!oh->class->sysc)
+		return 0;
+
+	/* we can't continue without MPU PORT if we need sysc access */
 	if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
 		return -ENXIO;
 
@@ -2467,8 +2475,10 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
 			 oh->name);
 
 		/* Extract the IO space from device tree blob */
-		if (!np)
+		if (!np) {
+			pr_err("omap_hwmod: %s: no dt node\n", oh->name);
 			return -ENXIO;
+		}
 
 		va_start = of_iomap(np, index + oh->mpu_rt_idx);
 	} else {
@@ -2527,13 +2537,11 @@ static int __init _init(struct omap_hwmod *oh, void *data)
 				oh->name, np->name);
 	}
 
-	if (oh->class->sysc) {
-		r = _init_mpu_rt_base(oh, NULL, index, np);
-		if (r < 0) {
-			WARN(1, "omap_hwmod: %s: doesn't have mpu register target base\n",
-			     oh->name);
-			return 0;
-		}
+	r = _init_mpu_rt_base(oh, NULL, index, np);
+	if (r < 0) {
+		WARN(1, "omap_hwmod: %s: doesn't have mpu register target base\n",
+		     oh->name);
+		return 0;
 	}
 
 	r = _init_clocks(oh, NULL);
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 36/60] ASoC: pcm1681: Fix setting de-emphasis sampling rate selection
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (34 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 35/60] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 37/60] iscsi-target: Fix use-after-free during TPG session shutdown Kamal Mostafa
                   ` (23 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Axel Lin, Mark Brown, Kamal Mostafa

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

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

From: Axel Lin <axel.lin@ingics.com>

commit fa8173a3ef0570affde7da352de202190b3786c2 upstream.

The de-emphasis sampling rate selection is controlled by BIT[3:4] of
PCM1681_DEEMPH_CONTROL register. Do proper left shift to set it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Marek Belisko <marek.belisko@streamunlimited.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/soc/codecs/pcm1681.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c
index 651e2fe..dfa9755 100644
--- a/sound/soc/codecs/pcm1681.c
+++ b/sound/soc/codecs/pcm1681.c
@@ -102,7 +102,7 @@ static int pcm1681_set_deemph(struct snd_soc_codec *codec)
 
 	if (val != -1) {
 		regmap_update_bits(priv->regmap, PCM1681_DEEMPH_CONTROL,
-					PCM1681_DEEMPH_RATE_MASK, val);
+				   PCM1681_DEEMPH_RATE_MASK, val << 3);
 		enable = 1;
 	} else
 		enable = 0;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 37/60] iscsi-target: Fix use-after-free during TPG session shutdown
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (35 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 36/60] ASoC: pcm1681: Fix setting de-emphasis sampling rate selection Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 38/60] iscsi-target: Fix iscsit_start_kthreads failure OOPs Kamal Mostafa
                   ` (22 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sunilkumar Nadumuttlu, Nicholas Bellinger, Kamal Mostafa

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

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

From: Nicholas Bellinger <nab@linux-iscsi.org>

commit 417c20a9bdd1e876384127cf096d8ae8b559066c upstream.

This patch fixes a use-after-free bug in iscsit_release_sessions_for_tpg()
where se_portal_group->session_lock was incorrectly released/re-acquired
while walking the active se_portal_group->tpg_sess_list.

The can result in a NULL pointer dereference when iscsit_close_session()
shutdown happens in the normal path asynchronously to this code, causing
a bogus dereference of an already freed list entry to occur.

To address this bug, walk the session list checking for the same state
as before, but move entries to a local list to avoid dropping the lock
while walking the active list.

As before, signal using iscsi_session->session_restatement=1 for those
list entries to be released locally by iscsit_free_session() code.

Reported-by: Sunilkumar Nadumuttlu <sjn@datera.io>
Cc: Sunilkumar Nadumuttlu <sjn@datera.io>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/target/iscsi/iscsi_target.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 8da53d7..6d70def 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4708,6 +4708,7 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force)
 	struct iscsi_session *sess;
 	struct se_portal_group *se_tpg = &tpg->tpg_se_tpg;
 	struct se_session *se_sess, *se_sess_tmp;
+	LIST_HEAD(free_list);
 	int session_count = 0;
 
 	spin_lock_bh(&se_tpg->session_lock);
@@ -4729,14 +4730,17 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force)
 		}
 		atomic_set(&sess->session_reinstatement, 1);
 		spin_unlock(&sess->conn_lock);
-		spin_unlock_bh(&se_tpg->session_lock);
 
-		iscsit_free_session(sess);
-		spin_lock_bh(&se_tpg->session_lock);
+		list_move_tail(&se_sess->sess_list, &free_list);
+	}
+	spin_unlock_bh(&se_tpg->session_lock);
 
+	list_for_each_entry_safe(se_sess, se_sess_tmp, &free_list, sess_list) {
+		sess = (struct iscsi_session *)se_sess->fabric_sess_ptr;
+
+		iscsit_free_session(sess);
 		session_count++;
 	}
-	spin_unlock_bh(&se_tpg->session_lock);
 
 	pr_debug("Released %d iSCSI Session(s) from Target Portal"
 			" Group: %hu\n", session_count, tpg->tpgt);
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 38/60] iscsi-target: Fix iscsit_start_kthreads failure OOPs
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (36 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 37/60] iscsi-target: Fix use-after-free during TPG session shutdown Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 39/60] iscsi-target: Fix iser explicit logout TX kthread leak Kamal Mostafa
                   ` (21 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sagi Grimberg, Nicholas Bellinger, Luis Henriques, Kamal Mostafa

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

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

From: Nicholas Bellinger <nab@linux-iscsi.org>

commit e54198657b65625085834847ab6271087323ffea upstream.

This patch fixes a regression introduced with the following commit
in v4.0-rc1 code, where a iscsit_start_kthreads() failure triggers
a NULL pointer dereference OOPs:

    commit 88dcd2dab5c23b1c9cfc396246d8f476c872f0ca
    Author: Nicholas Bellinger <nab@linux-iscsi.org>
    Date:   Thu Feb 26 22:19:15 2015 -0800

        iscsi-target: Convert iscsi_thread_set usage to kthread.h

To address this bug, move iscsit_start_kthreads() immediately
preceeding the transmit of last login response, before signaling
a successful transition into full-feature-phase within existing
iscsi_target_do_tx_login_io() logic.

This ensures that no target-side resource allocation failures can
occur after the final login response has been successfully sent.

Also, it adds a iscsi_conn->rx_login_comp to allow the RX thread
to sleep to prevent other socket related failures until the final
iscsi_post_login_handler() call is able to complete.

Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/target/iscsi/iscsi_target.c       | 18 ++++++++++---
 drivers/target/iscsi/iscsi_target_core.h  |  1 +
 drivers/target/iscsi/iscsi_target_login.c | 43 ++++++++++++-------------------
 drivers/target/iscsi/iscsi_target_login.h |  3 ++-
 drivers/target/iscsi/iscsi_target_nego.c  | 34 +++++++++++++++++++++++-
 5 files changed, 67 insertions(+), 32 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 6d70def..cc55f68 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -3936,7 +3936,13 @@ get_immediate:
 	}
 
 transport_err:
-	iscsit_take_action_for_connection_exit(conn);
+	/*
+	 * Avoid the normal connection failure code-path if this connection
+	 * is still within LOGIN mode, and iscsi_np process context is
+	 * responsible for cleaning up the early connection failure.
+	 */
+	if (conn->conn_state != TARG_CONN_STATE_IN_LOGIN)
+		iscsit_take_action_for_connection_exit(conn);
 out:
 	return 0;
 }
@@ -4022,7 +4028,7 @@ reject:
 
 int iscsi_target_rx_thread(void *arg)
 {
-	int ret;
+	int ret, rc;
 	u8 buffer[ISCSI_HDR_LEN], opcode;
 	u32 checksum = 0, digest = 0;
 	struct iscsi_conn *conn = arg;
@@ -4032,10 +4038,16 @@ int iscsi_target_rx_thread(void *arg)
 	 * connection recovery / failure event can be triggered externally.
 	 */
 	allow_signal(SIGINT);
+	/*
+	 * Wait for iscsi_post_login_handler() to complete before allowing
+	 * incoming iscsi/tcp socket I/O, and/or failing the connection.
+	 */
+	rc = wait_for_completion_interruptible(&conn->rx_login_comp);
+	if (rc < 0)
+		return 0;
 
 	if (conn->conn_transport->transport_type == ISCSI_INFINIBAND) {
 		struct completion comp;
-		int rc;
 
 		init_completion(&comp);
 		rc = wait_for_completion_interruptible(&comp);
diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h
index 31a68f5..baebec2 100644
--- a/drivers/target/iscsi/iscsi_target_core.h
+++ b/drivers/target/iscsi/iscsi_target_core.h
@@ -604,6 +604,7 @@ struct iscsi_conn {
 	int			bitmap_id;
 	int			rx_thread_active;
 	struct task_struct	*rx_thread;
+	struct completion	rx_login_comp;
 	int			tx_thread_active;
 	struct task_struct	*tx_thread;
 	/* list_head for session connection list */
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
index 1a8aea1..509eda2 100644
--- a/drivers/target/iscsi/iscsi_target_login.c
+++ b/drivers/target/iscsi/iscsi_target_login.c
@@ -83,6 +83,7 @@ static struct iscsi_login *iscsi_login_init_conn(struct iscsi_conn *conn)
 	init_completion(&conn->conn_logout_comp);
 	init_completion(&conn->rx_half_close_comp);
 	init_completion(&conn->tx_half_close_comp);
+	init_completion(&conn->rx_login_comp);
 	spin_lock_init(&conn->cmd_lock);
 	spin_lock_init(&conn->conn_usage_lock);
 	spin_lock_init(&conn->immed_queue_lock);
@@ -716,6 +717,7 @@ int iscsit_start_kthreads(struct iscsi_conn *conn)
 
 	return 0;
 out_tx:
+	send_sig(SIGINT, conn->tx_thread, 1);
 	kthread_stop(conn->tx_thread);
 	conn->tx_thread_active = false;
 out_bitmap:
@@ -726,7 +728,7 @@ out_bitmap:
 	return ret;
 }
 
-int iscsi_post_login_handler(
+void iscsi_post_login_handler(
 	struct iscsi_np *np,
 	struct iscsi_conn *conn,
 	u8 zero_tsih)
@@ -736,7 +738,6 @@ int iscsi_post_login_handler(
 	struct se_session *se_sess = sess->se_sess;
 	struct iscsi_portal_group *tpg = sess->tpg;
 	struct se_portal_group *se_tpg = &tpg->tpg_se_tpg;
-	int rc;
 
 	iscsit_inc_conn_usage_count(conn);
 
@@ -777,10 +778,6 @@ int iscsi_post_login_handler(
 			sess->sess_ops->InitiatorName);
 		spin_unlock_bh(&sess->conn_lock);
 
-		rc = iscsit_start_kthreads(conn);
-		if (rc)
-			return rc;
-
 		iscsi_post_login_start_timers(conn);
 		/*
 		 * Determine CPU mask to ensure connection's RX and TX kthreads
@@ -789,15 +786,20 @@ int iscsi_post_login_handler(
 		iscsit_thread_get_cpumask(conn);
 		conn->conn_rx_reset_cpumask = 1;
 		conn->conn_tx_reset_cpumask = 1;
-
+		/*
+		 * Wakeup the sleeping iscsi_target_rx_thread() now that
+		 * iscsi_conn is in TARG_CONN_STATE_LOGGED_IN state.
+		 */
+		complete(&conn->rx_login_comp);
 		iscsit_dec_conn_usage_count(conn);
+
 		if (stop_timer) {
 			spin_lock_bh(&se_tpg->session_lock);
 			iscsit_stop_time2retain_timer(sess);
 			spin_unlock_bh(&se_tpg->session_lock);
 		}
 		iscsit_dec_session_usage_count(sess);
-		return 0;
+		return;
 	}
 
 	iscsi_set_session_parameters(sess->sess_ops, conn->param_list, 1);
@@ -838,10 +840,6 @@ int iscsi_post_login_handler(
 		" iSCSI Target Portal Group: %hu\n", tpg->nsessions, tpg->tpgt);
 	spin_unlock_bh(&se_tpg->session_lock);
 
-	rc = iscsit_start_kthreads(conn);
-	if (rc)
-		return rc;
-
 	iscsi_post_login_start_timers(conn);
 	/*
 	 * Determine CPU mask to ensure connection's RX and TX kthreads
@@ -850,10 +848,12 @@ int iscsi_post_login_handler(
 	iscsit_thread_get_cpumask(conn);
 	conn->conn_rx_reset_cpumask = 1;
 	conn->conn_tx_reset_cpumask = 1;
-
+	/*
+	 * Wakeup the sleeping iscsi_target_rx_thread() now that
+	 * iscsi_conn is in TARG_CONN_STATE_LOGGED_IN state.
+	 */
+	complete(&conn->rx_login_comp);
 	iscsit_dec_conn_usage_count(conn);
-
-	return 0;
 }
 
 static void iscsi_handle_login_thread_timeout(unsigned long data)
@@ -1417,23 +1417,12 @@ static int __iscsi_target_login_thread(struct iscsi_np *np)
 	if (ret < 0)
 		goto new_sess_out;
 
-	if (!conn->sess) {
-		pr_err("struct iscsi_conn session pointer is NULL!\n");
-		goto new_sess_out;
-	}
-
 	iscsi_stop_login_thread_timer(np);
 
-	if (signal_pending(current))
-		goto new_sess_out;
-
 	if (ret == 1) {
 		tpg_np = conn->tpg_np;
 
-		ret = iscsi_post_login_handler(np, conn, zero_tsih);
-		if (ret < 0)
-			goto new_sess_out;
-
+		iscsi_post_login_handler(np, conn, zero_tsih);
 		iscsit_deaccess_np(np, tpg, tpg_np);
 	}
 
diff --git a/drivers/target/iscsi/iscsi_target_login.h b/drivers/target/iscsi/iscsi_target_login.h
index 29d0983..55cbf45 100644
--- a/drivers/target/iscsi/iscsi_target_login.h
+++ b/drivers/target/iscsi/iscsi_target_login.h
@@ -12,7 +12,8 @@ extern int iscsit_accept_np(struct iscsi_np *, struct iscsi_conn *);
 extern int iscsit_get_login_rx(struct iscsi_conn *, struct iscsi_login *);
 extern int iscsit_put_login_tx(struct iscsi_conn *, struct iscsi_login *, u32);
 extern void iscsit_free_conn(struct iscsi_np *, struct iscsi_conn *);
-extern int iscsi_post_login_handler(struct iscsi_np *, struct iscsi_conn *, u8);
+extern int iscsit_start_kthreads(struct iscsi_conn *);
+extern void iscsi_post_login_handler(struct iscsi_np *, struct iscsi_conn *, u8);
 extern void iscsi_target_login_sess_out(struct iscsi_conn *, struct iscsi_np *,
 				bool, bool);
 extern int iscsi_target_login_thread(void *);
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c
index 582ba84..25ad113 100644
--- a/drivers/target/iscsi/iscsi_target_nego.c
+++ b/drivers/target/iscsi/iscsi_target_nego.c
@@ -17,6 +17,7 @@
  ******************************************************************************/
 
 #include <linux/ctype.h>
+#include <linux/kthread.h>
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
 #include <target/target_core_fabric.h>
@@ -361,10 +362,24 @@ static int iscsi_target_do_tx_login_io(struct iscsi_conn *conn, struct iscsi_log
 		ntohl(login_rsp->statsn), login->rsp_length);
 
 	padding = ((-login->rsp_length) & 3);
+	/*
+	 * Before sending the last login response containing the transition
+	 * bit for full-feature-phase, go ahead and start up TX/RX threads
+	 * now to avoid potential resource allocation failures after the
+	 * final login response has been sent.
+	 */
+	if (login->login_complete) {
+		int rc = iscsit_start_kthreads(conn);
+		if (rc) {
+			iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
+					    ISCSI_LOGIN_STATUS_NO_RESOURCES);
+			return -1;
+		}
+	}
 
 	if (conn->conn_transport->iscsit_put_login_tx(conn, login,
 					login->rsp_length + padding) < 0)
-		return -1;
+		goto err;
 
 	login->rsp_length		= 0;
 	mutex_lock(&sess->cmdsn_mutex);
@@ -373,6 +388,23 @@ static int iscsi_target_do_tx_login_io(struct iscsi_conn *conn, struct iscsi_log
 	mutex_unlock(&sess->cmdsn_mutex);
 
 	return 0;
+
+err:
+	if (login->login_complete) {
+		if (conn->rx_thread && conn->rx_thread_active) {
+			send_sig(SIGINT, conn->rx_thread, 1);
+			kthread_stop(conn->rx_thread);
+		}
+		if (conn->tx_thread && conn->tx_thread_active) {
+			send_sig(SIGINT, conn->tx_thread, 1);
+			kthread_stop(conn->tx_thread);
+		}
+		spin_lock(&iscsit_global->ts_bitmap_lock);
+		bitmap_release_region(iscsit_global->ts_bitmap, conn->bitmap_id,
+				      get_order(1));
+		spin_unlock(&iscsit_global->ts_bitmap_lock);
+	}
+	return -1;
 }
 
 static void iscsi_target_sk_data_ready(struct sock *sk, int count)
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 39/60] iscsi-target: Fix iser explicit logout TX kthread leak
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (37 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 38/60] iscsi-target: Fix iscsit_start_kthreads failure OOPs Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 40/60] ALSA: hda - Apply fixup for another Toshiba Satellite S50D Kamal Mostafa
                   ` (20 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sagi Grimberg, Nicholas Bellinger, Kamal Mostafa

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

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

From: Nicholas Bellinger <nab@linux-iscsi.org>

commit 007d038bdf95ccfe2491d0078be54040d110fd06 upstream.

This patch fixes a regression introduced with the following commit
in v4.0-rc1 code, where an explicit iser-target logout would result
in ->tx_thread_active being incorrectly cleared by the logout post
handler, and subsequent TX kthread leak:

    commit 88dcd2dab5c23b1c9cfc396246d8f476c872f0ca
    Author: Nicholas Bellinger <nab@linux-iscsi.org>
    Date:   Thu Feb 26 22:19:15 2015 -0800

        iscsi-target: Convert iscsi_thread_set usage to kthread.h

To address this bug, change iscsit_logout_post_handler_closesession()
and iscsit_logout_post_handler_samecid() to only cmpxchg() on
->tx_thread_active for traditional iscsi/tcp connections.

This is required because iscsi/tcp connections are invoking logout
post handler logic directly from TX kthread context, while iser
connections are invoking logout post handler logic from a seperate
workqueue context.

Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/target/iscsi/iscsi_target.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index cc55f68..931833f 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4487,7 +4487,18 @@ static void iscsit_logout_post_handler_closesession(
 	struct iscsi_conn *conn)
 {
 	struct iscsi_session *sess = conn->sess;
-	int sleep = cmpxchg(&conn->tx_thread_active, true, false);
+	int sleep = 1;
+	/*
+	 * Traditional iscsi/tcp will invoke this logic from TX thread
+	 * context during session logout, so clear tx_thread_active and
+	 * sleep if iscsit_close_connection() has not already occured.
+	 *
+	 * Since iser-target invokes this logic from it's own workqueue,
+	 * always sleep waiting for RX/TX thread shutdown to complete
+	 * within iscsit_close_connection().
+	 */
+	if (conn->conn_transport->transport_type == ISCSI_TCP)
+		sleep = cmpxchg(&conn->tx_thread_active, true, false);
 
 	atomic_set(&conn->conn_logout_remove, 0);
 	complete(&conn->conn_logout_comp);
@@ -4501,7 +4512,10 @@ static void iscsit_logout_post_handler_closesession(
 static void iscsit_logout_post_handler_samecid(
 	struct iscsi_conn *conn)
 {
-	int sleep = cmpxchg(&conn->tx_thread_active, true, false);
+	int sleep = 1;
+
+	if (conn->conn_transport->transport_type == ISCSI_TCP)
+		sleep = cmpxchg(&conn->tx_thread_active, true, false);
 
 	atomic_set(&conn->conn_logout_remove, 0);
 	complete(&conn->conn_logout_comp);
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 40/60] ALSA: hda - Apply fixup for another Toshiba Satellite S50D
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (38 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 39/60] iscsi-target: Fix iser explicit logout TX kthread leak Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 41/60] vhost: actually track log eventfd file Kamal Mostafa
                   ` (19 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

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

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

From: Takashi Iwai <tiwai@suse.de>

commit b9d9c9efc292dd0ffe172780f915ed74eba3556c upstream.

Toshiba Satellite S50D has another model with a different PCI SSID
(1179:fa93) while the previous fixup was for 1179:fa91.  Adjust the
fixup entry with SND_PCI_QUIRK_MASK() to match with both devices.

Reported-by: Tim Sample <timsample@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/pci/hda/patch_sigmatel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index d025af4..33282e5 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -2924,7 +2924,8 @@ static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl[] = {
 	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x148a,
 		      "HP Mini", STAC_92HD83XXX_HP_LED),
 	SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP, "HP", STAC_92HD83XXX_HP),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_TOSHIBA, 0xfa91,
+	/* match both for 0xfa91 and 0xfa93 */
+	SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_TOSHIBA, 0xfffd, 0xfa91,
 		      "Toshiba Satellite S50D", STAC_92HD83XXX_GPIO10_EAPD),
 	{} /* terminator */
 };
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 41/60] vhost: actually track log eventfd file
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (39 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 40/60] ALSA: hda - Apply fixup for another Toshiba Satellite S50D Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 42/60] xfs: remote attributes need to be considered data Kamal Mostafa
                   ` (18 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marc-André Lureau, Michael S. Tsirkin, Kamal Mostafa

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

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

From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>

commit 7932c0bd7740f4cd2aa168d3ce0199e7af7d72d5 upstream.

While reviewing vhost log code, I found out that log_file is never
set. Note: I haven't tested the change (QEMU doesn't use LOG_FD yet).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/vhost/vhost.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 69068e0..384bcc8 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -878,6 +878,7 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp)
 		}
 		if (eventfp != d->log_file) {
 			filep = d->log_file;
+			d->log_file = eventfp;
 			ctx = d->log_ctx;
 			d->log_ctx = eventfp ?
 				eventfd_ctx_fileget(eventfp) : NULL;
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 42/60] xfs: remote attributes need to be considered data
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (40 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 41/60] vhost: actually track log eventfd file Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 43/60] ALSA: usb-audio: add dB range mapping for some devices Kamal Mostafa
                   ` (17 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dave Chinner, Dave Chinner, Luis Henriques, Kamal Mostafa

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

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

From: Dave Chinner <dchinner@redhat.com>

commit df150ed102baa0e78c06e08e975dfb47147dd677 upstream.

We don't log remote attribute contents, and instead write them
synchronously before we commit the block allocation and attribute
tree update transaction. As a result we are writing to the allocated
space before the allcoation has been made permanent.

As a result, we cannot consider this allocation to be a metadata
allocation. Metadata allocation can take blocks from the free list
and so reuse them before the transaction that freed the block is
committed to disk. This behaviour is perfectly fine for journalled
metadata changes as log recovery will ensure the free operation is
replayed before the overwrite, but for remote attribute writes this
is not the case.

Hence we have to consider the remote attribute blocks to contain
data and allocate accordingly. We do this by dropping the
XFS_BMAPI_METADATA flag from the block allocation. This means the
allocation will not use blocks that are on the busy list without
first ensuring that the freeing transaction has been committed to
disk and the blocks removed from the busy list. This ensures we will
never overwrite a freed block without first ensuring that it is
really free.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
[ luis: backported to 3.16:
  - file rename: fs/xfs/libxfs/xfs_attr_remote.c -> fs/xfs/xfs_attr_remote.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/xfs/xfs_attr_remote.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/xfs_attr_remote.c b/fs/xfs/xfs_attr_remote.c
index 5549d69..1aec8ad 100644
--- a/fs/xfs/xfs_attr_remote.c
+++ b/fs/xfs/xfs_attr_remote.c
@@ -435,14 +435,21 @@ xfs_attr_rmtval_set(
 
 		/*
 		 * Allocate a single extent, up to the size of the value.
+		 *
+		 * Note that we have to consider this a data allocation as we
+		 * write the remote attribute without logging the contents.
+		 * Hence we must ensure that we aren't using blocks that are on
+		 * the busy list so that we don't overwrite blocks which have
+		 * recently been freed but their transactions are not yet
+		 * committed to disk. If we overwrite the contents of a busy
+		 * extent and then crash then the block may not contain the
+		 * correct metadata after log recovery occurs.
 		 */
 		xfs_bmap_init(args->flist, args->firstblock);
 		nmap = 1;
 		error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno,
-				  blkcnt,
-				  XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
-				  args->firstblock, args->total, &map, &nmap,
-				  args->flist);
+				  blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock,
+				  args->total, &map, &nmap, args->flist);
 		if (!error) {
 			error = xfs_bmap_finish(&args->trans, args->flist,
 						&committed);
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 43/60] ALSA: usb-audio: add dB range mapping for some devices
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (41 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 42/60] xfs: remote attributes need to be considered data Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 44/60] drm/radeon/combios: add some validation of lvds values Kamal Mostafa
                   ` (16 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Yao-Wen Mao, Takashi Iwai, Kamal Mostafa

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

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

From: Yao-Wen Mao <yaowen@google.com>

commit 2d1cb7f658fb9c3ba8f9dab8aca297d4dfdec835 upstream.

Add the correct dB ranges of Bose Companion 5 and Drangonfly DAC 1.2.

Signed-off-by: Yao-Wen Mao <yaowen@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/usb/mixer_maps.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
index d06fbd9..2d17f40f 100644
--- a/sound/usb/mixer_maps.c
+++ b/sound/usb/mixer_maps.c
@@ -330,6 +330,20 @@ static const struct usbmix_name_map scms_usb3318_map[] = {
 	{ 0 }
 };
 
+/* Bose companion 5, the dB conversion factor is 16 instead of 256 */
+static struct usbmix_dB_map bose_companion5_dB = {-5006, -6};
+static struct usbmix_name_map bose_companion5_map[] = {
+	{ 3, NULL, .dB = &bose_companion5_dB },
+	{ 0 }	/* terminator */
+};
+
+/* Dragonfly DAC 1.2, the dB conversion factor is 1 instead of 256 */
+static struct usbmix_dB_map dragonfly_1_2_dB = {0, 5000};
+static struct usbmix_name_map dragonfly_1_2_map[] = {
+	{ 7, NULL, .dB = &dragonfly_1_2_dB },
+	{ 0 }	/* terminator */
+};
+
 /*
  * Control map entries
  */
@@ -432,6 +446,16 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
 		.id = USB_ID(0x25c4, 0x0003),
 		.map = scms_usb3318_map,
 	},
+	{
+		/* Bose Companion 5 */
+		.id = USB_ID(0x05a7, 0x1020),
+		.map = bose_companion5_map,
+	},
+	{
+		/* Dragonfly DAC 1.2 */
+		.id = USB_ID(0x21b4, 0x0081),
+		.map = dragonfly_1_2_map,
+	},
 	{ 0 } /* terminator */
 };
 
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 44/60] drm/radeon/combios: add some validation of lvds values
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (42 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 43/60] ALSA: usb-audio: add dB range mapping for some devices Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 45/60] x86/efi: Use all 64 bit of efi_memmap in setup_e820() Kamal Mostafa
                   ` (15 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa

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

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

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

commit 0a90a0cff9f429f886f423967ae053150dce9259 upstream.

Fixes a broken hsync start value uncovered by:
abc0b1447d4974963548777a5ba4a4457c82c426
(drm: Perform basic sanity checks on probed modes)

The driver handled the bad hsync start elsewhere, but
the above commit prevented it from getting added.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=91401

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_combios.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index 68ce360..8cac698 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -1271,10 +1271,15 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder
 
 			if ((RBIOS16(tmp) == lvds->native_mode.hdisplay) &&
 			    (RBIOS16(tmp + 2) == lvds->native_mode.vdisplay)) {
+				u32 hss = (RBIOS16(tmp + 21) - RBIOS16(tmp + 19) - 1) * 8;
+
+				if (hss > lvds->native_mode.hdisplay)
+					hss = (10 - 1) * 8;
+
 				lvds->native_mode.htotal = lvds->native_mode.hdisplay +
 					(RBIOS16(tmp + 17) - RBIOS16(tmp + 19)) * 8;
 				lvds->native_mode.hsync_start = lvds->native_mode.hdisplay +
-					(RBIOS16(tmp + 21) - RBIOS16(tmp + 19) - 1) * 8;
+					hss;
 				lvds->native_mode.hsync_end = lvds->native_mode.hsync_start +
 					(RBIOS8(tmp + 23) * 8);
 
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 45/60] x86/efi: Use all 64 bit of efi_memmap in setup_e820()
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (43 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 44/60] drm/radeon/combios: add some validation of lvds values Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 46/60] ipr: Fix locking for unit attention handling Kamal Mostafa
                   ` (14 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dmitry Skorodumov, Denis V. Lunev, Matt Fleming, Kamal Mostafa

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

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

From: Dmitry Skorodumov <sdmitry@parallels.com>

commit 7cc03e48965453b5df1cce5062c826189b04b960 upstream.

The efi_info structure stores low 32 bits of memory map
in efi_memmap and high 32 bits in efi_memmap_hi.

While constructing pointer in the setup_e820(), need
to take into account all 64 bit of the pointer.

It is because on 64bit machine the function
efi_get_memory_map() may return full 64bit pointer and before
the patch that pointer was truncated.

The issue is triggered on Parallles virtual machine and
fixed with this patch.

Signed-off-by: Dmitry Skorodumov <sdmitry@parallels.com>
Cc: Denis V. Lunev <den@openvz.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/x86/boot/compressed/eboot.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 3f88561..3898595 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -561,6 +561,10 @@ static efi_status_t setup_e820(struct boot_params *params,
 		unsigned int e820_type = 0;
 		unsigned long m = efi->efi_memmap;
 
+#ifdef CONFIG_X86_64
+		m |= (u64)efi->efi_memmap_hi << 32;
+#endif
+
 		d = (efi_memory_desc_t *)(m + (i * efi->efi_memdesc_size));
 		switch (d->type) {
 		case EFI_RESERVED_TYPE:
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 46/60] ipr: Fix locking for unit attention handling
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (44 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 45/60] x86/efi: Use all 64 bit of efi_memmap in setup_e820() Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 47/60] ipr: Fix incorrect trace indexing Kamal Mostafa
                   ` (13 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Brian King, James Bottomley, Kamal Mostafa

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

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

From: Brian King <brking@linux.vnet.ibm.com>

commit 36b8e180e1e929e00b351c3b72aab3147fc14116 upstream.

Make sure we have the host lock held when calling scsi_report_bus_reset. Fixes
a crash seen as the __devices list in the scsi host was changing as we were
iterating through it.

Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/scsi/ipr.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 8c2f6ab..11a552d 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -6179,21 +6179,23 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd)
 	struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
 	struct scsi_cmnd *scsi_cmd = ipr_cmd->scsi_cmd;
 	u32 ioasc = be32_to_cpu(ipr_cmd->s.ioasa.hdr.ioasc);
-	unsigned long hrrq_flags;
+	unsigned long lock_flags;
 
 	scsi_set_resid(scsi_cmd, be32_to_cpu(ipr_cmd->s.ioasa.hdr.residual_data_len));
 
 	if (likely(IPR_IOASC_SENSE_KEY(ioasc) == 0)) {
 		scsi_dma_unmap(scsi_cmd);
 
-		spin_lock_irqsave(ipr_cmd->hrrq->lock, hrrq_flags);
+		spin_lock_irqsave(ipr_cmd->hrrq->lock, lock_flags);
 		list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
 		scsi_cmd->scsi_done(scsi_cmd);
-		spin_unlock_irqrestore(ipr_cmd->hrrq->lock, hrrq_flags);
+		spin_unlock_irqrestore(ipr_cmd->hrrq->lock, lock_flags);
 	} else {
-		spin_lock_irqsave(ipr_cmd->hrrq->lock, hrrq_flags);
+		spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
+		spin_lock(&ipr_cmd->hrrq->_lock);
 		ipr_erp_start(ioa_cfg, ipr_cmd);
-		spin_unlock_irqrestore(ipr_cmd->hrrq->lock, hrrq_flags);
+		spin_unlock(&ipr_cmd->hrrq->_lock);
+		spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
 	}
 }
 
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 47/60] ipr: Fix incorrect trace indexing
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (45 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 46/60] ipr: Fix locking for unit attention handling Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 48/60] ipr: Fix invalid array indexing for HRRQ Kamal Mostafa
                   ` (12 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Brian King, James Bottomley, Kamal Mostafa

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

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

From: Brian King <brking@linux.vnet.ibm.com>

commit bb7c54339e6a10ecce5c4961adf5e75b3cf0af30 upstream.

When ipr's internal driver trace was changed to an atomic, a signed/unsigned
bug slipped in which results in us indexing backwards in our memory buffer
writing on memory that does not belong to us. This patch fixes this by removing
the modulo and instead just mask off the low bits.

Tested-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/scsi/ipr.c | 5 +++--
 drivers/scsi/ipr.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 11a552d..b0f5836 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -592,9 +592,10 @@ static void ipr_trc_hook(struct ipr_cmnd *ipr_cmd,
 {
 	struct ipr_trace_entry *trace_entry;
 	struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
+	unsigned int trace_index;
 
-	trace_entry = &ioa_cfg->trace[atomic_add_return
-			(1, &ioa_cfg->trace_index)%IPR_NUM_TRACE_ENTRIES];
+	trace_index = atomic_add_return(1, &ioa_cfg->trace_index) & IPR_TRACE_INDEX_MASK;
+	trace_entry = &ioa_cfg->trace[trace_index];
 	trace_entry->time = jiffies;
 	trace_entry->op_code = ipr_cmd->ioarcb.cmd_pkt.cdb[0];
 	trace_entry->type = type;
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index c01e581..746ed2a 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -1459,6 +1459,7 @@ struct ipr_ioa_cfg {
 
 #define IPR_NUM_TRACE_INDEX_BITS	8
 #define IPR_NUM_TRACE_ENTRIES		(1 << IPR_NUM_TRACE_INDEX_BITS)
+#define IPR_TRACE_INDEX_MASK		(IPR_NUM_TRACE_ENTRIES - 1)
 #define IPR_TRACE_SIZE	(sizeof(struct ipr_trace_entry) * IPR_NUM_TRACE_ENTRIES)
 	char trace_start[8];
 #define IPR_TRACE_START_LABEL			"trace"
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 48/60] ipr: Fix invalid array indexing for HRRQ
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (46 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 47/60] ipr: Fix incorrect trace indexing Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 49/60] ALSA: hda - Fix MacBook Pro 5,2 quirk Kamal Mostafa
                   ` (11 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Brian King, James Bottomley, Kamal Mostafa

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

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

From: Brian King <brking@linux.vnet.ibm.com>

commit 3f1c0581310d5d94bd72740231507e763a6252a4 upstream.

Fixes another signed / unsigned array indexing bug in the ipr driver.
Currently, when hrrq_index wraps, it becomes a negative number. We
do the modulo, but still have a negative number, so we end up indexing
backwards in the array. Given where the hrrq array is located in memory,
we probably won't actually reference memory we don't own, but nonetheless
ipr is still looking at data within struct ipr_ioa_cfg and interpreting it as
struct ipr_hrr_queue data, so bad things could certainly happen.

Each ipr adapter has anywhere from 1 to 16 HRRQs. By default, we use 2 on new
adapters.  Let's take an example:

Assume ioa_cfg->hrrq_index=0x7fffffffe and ioa_cfg->hrrq_num=4:

The atomic_add_return will then return -1. We mod this with 3 and get -2, add
one and get -1 for an array index.

On adapters which support more than a single HRRQ, we dedicate HRRQ to adapter
initialization and error interrupts so that we can optimize the other queues
for fast path I/O. So all normal I/O uses HRRQ 1-15. So we want to spread the
I/O requests across those HRRQs.

With the default module parameter settings, this bug won't hit, only when
someone sets the ipr.number_of_msix parameter to a value larger than 3 is when
bad things start to happen.

Tested-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/scsi/ipr.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index b0f5836..430583c 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -1045,10 +1045,15 @@ static void ipr_send_blocking_cmd(struct ipr_cmnd *ipr_cmd,
 
 static int ipr_get_hrrq_index(struct ipr_ioa_cfg *ioa_cfg)
 {
+	unsigned int hrrq;
+
 	if (ioa_cfg->hrrq_num == 1)
-		return 0;
-	else
-		return (atomic_add_return(1, &ioa_cfg->hrrq_index) % (ioa_cfg->hrrq_num - 1)) + 1;
+		hrrq = 0;
+	else {
+		hrrq = atomic_add_return(1, &ioa_cfg->hrrq_index);
+		hrrq = (hrrq % (ioa_cfg->hrrq_num - 1)) + 1;
+	}
+	return hrrq;
 }
 
 /**
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 49/60] ALSA: hda - Fix MacBook Pro 5,2 quirk
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (47 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 48/60] ipr: Fix invalid array indexing for HRRQ Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 50/60] x86/xen: Probe target addresses in set_aliased_prot() before the hypercall Kamal Mostafa
                   ` (10 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 649ccd08534ee26deb2e5b08509800d0e95167f5 upstream.

MacBook Pro 5,2 with ALC889 codec had already a fixup entry, but this
seems not working correctly, a fix for pin NID 0x15 is needed in
addition.  It's equivalent with the fixup for MacBook Air 1,1, so use
this instead.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=102131
Reported-and-tested-by: Jeffery Miller <jefferym@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 0440d36..4535173 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2233,7 +2233,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
 	SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
 	SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
-	SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF),
+	SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
 
 	SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
 	SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 50/60] x86/xen: Probe target addresses in set_aliased_prot() before the hypercall
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (48 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 49/60] ALSA: hda - Fix MacBook Pro 5,2 quirk Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 51/60] netfilter: ctnetlink: put back references to master ct and expect objects Kamal Mostafa
                   ` (9 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andy Lutomirski, Andrew Cooper, Andy Lutomirski, Boris Ostrovsky,
	Borislav Petkov, Brian Gerst, David Vrabel, Denys Vlasenko,
	H. Peter Anvin, Jan Beulich, Konrad Rzeszutek Wilk,
	Linus Torvalds, Peter Zijlstra, Sasha Levin, Steven Rostedt,
	Thomas Gleixner, security, xen-devel, Ingo Molnar, Kamal Mostafa

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

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

From: Andy Lutomirski <luto@kernel.org>

commit aa1acff356bbedfd03b544051f5b371746735d89 upstream.

The update_va_mapping hypercall can fail if the VA isn't present
in the guest's page tables.  Under certain loads, this can
result in an OOPS when the target address is in unpopulated vmap
space.

While we're at it, add comments to help explain what's going on.

This isn't a great long-term fix.  This code should probably be
changed to use something like set_memory_ro.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Vrabel <dvrabel@cantab.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: security@kernel.org <security@kernel.org>
Cc: xen-devel <xen-devel@lists.xen.org>
Link: http://lkml.kernel.org/r/0b0e55b995cda11e7829f140b833ef932fcabe3a.1438291540.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/x86/xen/enlighten.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index fa6ade7..2cbc2f2 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -480,6 +480,7 @@ static void set_aliased_prot(void *v, pgprot_t prot)
 	pte_t pte;
 	unsigned long pfn;
 	struct page *page;
+	unsigned char dummy;
 
 	ptep = lookup_address((unsigned long)v, &level);
 	BUG_ON(ptep == NULL);
@@ -489,6 +490,32 @@ static void set_aliased_prot(void *v, pgprot_t prot)
 
 	pte = pfn_pte(pfn, prot);
 
+	/*
+	 * Careful: update_va_mapping() will fail if the virtual address
+	 * we're poking isn't populated in the page tables.  We don't
+	 * need to worry about the direct map (that's always in the page
+	 * tables), but we need to be careful about vmap space.  In
+	 * particular, the top level page table can lazily propagate
+	 * entries between processes, so if we've switched mms since we
+	 * vmapped the target in the first place, we might not have the
+	 * top-level page table entry populated.
+	 *
+	 * We disable preemption because we want the same mm active when
+	 * we probe the target and when we issue the hypercall.  We'll
+	 * have the same nominal mm, but if we're a kernel thread, lazy
+	 * mm dropping could change our pgd.
+	 *
+	 * Out of an abundance of caution, this uses __get_user() to fault
+	 * in the target address just in case there's some obscure case
+	 * in which the target address isn't readable.
+	 */
+
+	preempt_disable();
+
+	pagefault_disable();	/* Avoid warnings due to being atomic. */
+	__get_user(dummy, (unsigned char __user __force *)v);
+	pagefault_enable();
+
 	if (HYPERVISOR_update_va_mapping((unsigned long)v, pte, 0))
 		BUG();
 
@@ -500,6 +527,8 @@ static void set_aliased_prot(void *v, pgprot_t prot)
 				BUG();
 	} else
 		kmap_flush_unused();
+
+	preempt_enable();
 }
 
 static void xen_alloc_ldt(struct desc_struct *ldt, unsigned entries)
@@ -507,6 +536,17 @@ static void xen_alloc_ldt(struct desc_struct *ldt, unsigned entries)
 	const unsigned entries_per_page = PAGE_SIZE / LDT_ENTRY_SIZE;
 	int i;
 
+	/*
+	 * We need to mark the all aliases of the LDT pages RO.  We
+	 * don't need to call vm_flush_aliases(), though, since that's
+	 * only responsible for flushing aliases out the TLBs, not the
+	 * page tables, and Xen will flush the TLB for us if needed.
+	 *
+	 * To avoid confusing future readers: none of this is necessary
+	 * to load the LDT.  The hypervisor only checks this when the
+	 * LDT is faulted in due to subsequent descriptor access.
+	 */
+
 	for(i = 0; i < entries; i += entries_per_page)
 		set_aliased_prot(ldt + i, PAGE_KERNEL_RO);
 }
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 51/60] netfilter: ctnetlink: put back references to master ct and expect objects
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (49 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 50/60] x86/xen: Probe target addresses in set_aliased_prot() before the hypercall Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 52/60] bridge: mdb: fix delmdb state in the notification Kamal Mostafa
                   ` (8 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Pablo Neira Ayuso, Kamal Mostafa

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

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

From: Pablo Neira Ayuso <pablo@netfilter.org>

commit 95dd8653de658143770cb0e55a58d2aab97c79d2 upstream.

We have to put back the references to the master conntrack and the expectation
that we just created, otherwise we'll leak them.

Fixes: 0ef71ee1a5b9 ("netfilter: ctnetlink: refactor ctnetlink_create_expect")
Reported-by: Tim Wiess <Tim.Wiess@watchguard.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/netfilter/nf_conntrack_netlink.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 08870b8..d110f66 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -2926,11 +2926,6 @@ ctnetlink_create_expect(struct net *net, u16 zone,
 	}
 
 	err = nf_ct_expect_related_report(exp, portid, report);
-	if (err < 0)
-		goto err_exp;
-
-	return 0;
-err_exp:
 	nf_ct_expect_put(exp);
 err_ct:
 	nf_ct_put(ct);
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 52/60] bridge: mdb: fix delmdb state in the notification
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (50 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 51/60] netfilter: ctnetlink: put back references to master ct and expect objects Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 53/60] ipvs: fix crash with sync protocol v0 and FTP Kamal Mostafa
                   ` (7 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nikolay Aleksandrov, David S. Miller, Kamal Mostafa

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

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

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

commit 7ae90a4f96486e3e20274afa1b8329802f5e1981 upstream.

Since mdb states were introduced when deleting an entry the state was
left as it was set in the delete request from the user which leads to
the following output when doing a monitor (for example):
$ bridge mdb add dev br0 port eth3 grp 239.0.0.1 permanent
(monitor) dev br0 port eth3 grp 239.0.0.1 permanent
$ bridge mdb del dev br0 port eth3 grp 239.0.0.1 permanent
(monitor) dev br0 port eth3 grp 239.0.0.1 temp
^^^
Note the "temp" state in the delete notification which is wrong since
the entry was permanent, the state in a delete is always reported as
"temp" regardless of the real state of the entry.

After this patch:
$ bridge mdb add dev br0 port eth3 grp 239.0.0.1 permanent
(monitor) dev br0 port eth3 grp 239.0.0.1 permanent
$ bridge mdb del dev br0 port eth3 grp 239.0.0.1 permanent
(monitor) dev br0 port eth3 grp 239.0.0.1 permanent

There's one important note to make here that the state is actually not
matched when doing a delete, so one can delete a permanent entry by
stating "temp" in the end of the command, I've chosen this fix in order
not to break user-space tools which rely on this (incorrect) behaviour.

So to give an example after this patch and using the wrong state:
$ bridge mdb add dev br0 port eth3 grp 239.0.0.1 permanent
(monitor) dev br0 port eth3 grp 239.0.0.1 permanent
$ bridge mdb del dev br0 port eth3 grp 239.0.0.1 temp
(monitor) dev br0 port eth3 grp 239.0.0.1 permanent

Note the state of the entry that got deleted is correct in the
notification.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fixes: ccb1c31a7a87 ("bridge: add flags to distinguish permanent mdb entires")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/bridge/br_mdb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
index 589afd0..d3d88d2 100644
--- a/net/bridge/br_mdb.c
+++ b/net/bridge/br_mdb.c
@@ -451,6 +451,7 @@ static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry)
 		if (p->port->state == BR_STATE_DISABLED)
 			goto unlock;
 
+		entry->state = p->state;
 		rcu_assign_pointer(*pp, p->next);
 		hlist_del_init(&p->mglist);
 		del_timer(&p->timer);
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 53/60] ipvs: fix crash with sync protocol v0 and FTP
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (51 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 52/60] bridge: mdb: fix delmdb state in the notification Kamal Mostafa
@ 2015-09-02  0:57 ` Kamal Mostafa
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 54/60] act_pedit: check binding before calling tcf_hash_release() Kamal Mostafa
                   ` (6 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:57 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Julian Anastasov, Simon Horman, Kamal Mostafa

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

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

From: Julian Anastasov <ja@ssi.bg>

commit 56184858d1fc95c46723436b455cb7261cd8be6f upstream.

Fix crash in 3.5+ if FTP is used after switching
sync_version to 0.

Fixes: 749c42b620a9 ("ipvs: reduce sync rate with time thresholds")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/netfilter/ipvs/ip_vs_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 4555dd5..c3ae7f4 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -612,7 +612,7 @@ static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp,
 			pkts = atomic_add_return(1, &cp->in_pkts);
 		else
 			pkts = sysctl_sync_threshold(ipvs);
-		ip_vs_sync_conn(net, cp->control, pkts);
+		ip_vs_sync_conn(net, cp, pkts);
 	}
 }
 
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 54/60] act_pedit: check binding before calling tcf_hash_release()
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (52 preceding siblings ...)
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 53/60] ipvs: fix crash with sync protocol v0 and FTP Kamal Mostafa
@ 2015-09-02  0:58 ` Kamal Mostafa
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 55/60] netfilter: nf_conntrack: Support expectations in different zones Kamal Mostafa
                   ` (5 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:58 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jamal Hadi Salim, Daniel Borkmann, Cong Wang, Cong Wang,
	David S. Miller, Kamal Mostafa

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

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

From: WANG Cong <xiyou.wangcong@gmail.com>

commit 5175f7106cc55a1bcf97bf7d5ba0900017ebcef8 upstream.

When we share an action within a filter, the bind refcnt
should increase, therefore we should not call tcf_hash_release().

Fixes: 1a29321ed045 ("net_sched: act: Dont increment refcnt on replace")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/sched/act_pedit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 7aa2dcd..99682a9 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -83,13 +83,12 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla,
 		}
 		ret = ACT_P_CREATED;
 	} else {
-		p = to_pedit(pc);
-		tcf_hash_release(pc, bind, &pedit_hash_info);
 		if (bind)
 			return 0;
+		tcf_hash_release(pc, bind, &pedit_hash_info);
 		if (!ovr)
 			return -EEXIST;
-
+		p = to_pedit(pc);
 		if (p->tcfp_nkeys && p->tcfp_nkeys != parm->nkeys) {
 			keys = kmalloc(ksize, GFP_KERNEL);
 			if (keys == NULL)
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 55/60] netfilter: nf_conntrack: Support expectations in different zones
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (53 preceding siblings ...)
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 54/60] act_pedit: check binding before calling tcf_hash_release() Kamal Mostafa
@ 2015-09-02  0:58 ` Kamal Mostafa
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 56/60] ipvs: do not use random local source address for tunnels Kamal Mostafa
                   ` (4 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:58 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Joe Stringer, Pablo Neira Ayuso, Kamal Mostafa

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

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

From: Joe Stringer <joestringer@nicira.com>

commit 4b31814d20cbe5cd4ccf18089751e77a04afe4f2 upstream.

When zones were originally introduced, the expectation functions were
all extended to perform lookup using the zone. However, insertion was
not modified to check the zone. This means that two expectations which
are intended to apply for different connections that have the same tuple
but exist in different zones cannot both be tracked.

Fixes: 5d0aa2ccd4 (netfilter: nf_conntrack: add support for "conntrack zones")
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/netfilter/nf_conntrack_expect.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index 4fd1ca9..71c46f4 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -202,7 +202,8 @@ static inline int expect_clash(const struct nf_conntrack_expect *a,
 			a->mask.src.u3.all[count] & b->mask.src.u3.all[count];
 	}
 
-	return nf_ct_tuple_mask_cmp(&a->tuple, &b->tuple, &intersect_mask);
+	return nf_ct_tuple_mask_cmp(&a->tuple, &b->tuple, &intersect_mask) &&
+	       nf_ct_zone(a->master) == nf_ct_zone(b->master);
 }
 
 static inline int expect_matches(const struct nf_conntrack_expect *a,
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 56/60] ipvs: do not use random local source address for tunnels
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (54 preceding siblings ...)
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 55/60] netfilter: nf_conntrack: Support expectations in different zones Kamal Mostafa
@ 2015-09-02  0:58 ` Kamal Mostafa
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 57/60] ALSA: hda - fix cs4210_spdif_automute() Kamal Mostafa
                   ` (3 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:58 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Julian Anastasov, Simon Horman, Kamal Mostafa

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

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

From: Julian Anastasov <ja@ssi.bg>

commit 4754957f04f5f368792a0eb7dab0ae89fb93dcfd upstream.

Michael Vallaly reports about wrong source address used
in rare cases for tunneled traffic. Looks like
__ip_vs_get_out_rt in 3.10+ is providing uninitialized
dest_dst->dst_saddr.ip because ip_vs_dest_dst_alloc uses
kmalloc. While we retry after seeing EINVAL from routing
for data that does not look like valid local address, it
still succeeded when this memory was previously used from
other dests and with different local addresses. As result,
we can use valid local address that is not suitable for
our real server.

Fix it by providing 0.0.0.0 every time our cache is refreshed.
By this way we will get preferred source address from routing.

Reported-by: Michael Vallaly <lvs@nolatency.com>
Fixes: 026ace060dfe ("ipvs: optimize dst usage for real server")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/netfilter/ipvs/ip_vs_xmit.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 7f0e1cf..f27dbbd 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -129,7 +129,6 @@ static struct rtable *do_output_route4(struct net *net, __be32 daddr,
 
 	memset(&fl4, 0, sizeof(fl4));
 	fl4.daddr = daddr;
-	fl4.saddr = (rt_mode & IP_VS_RT_MODE_CONNECT) ? *saddr : 0;
 	fl4.flowi4_flags = (rt_mode & IP_VS_RT_MODE_KNOWN_NH) ?
 			   FLOWI_FLAG_KNOWN_NH : 0;
 
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 57/60] ALSA: hda - fix cs4210_spdif_automute()
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (55 preceding siblings ...)
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 56/60] ipvs: do not use random local source address for tunnels Kamal Mostafa
@ 2015-09-02  0:58 ` Kamal Mostafa
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 58/60] niu: don't count tx error twice in case of headroom realloc fails Kamal Mostafa
                   ` (2 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:58 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Takashi Iwai, Kamal Mostafa

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

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

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 44008f0896ae205b02b0882dbf807f0de149efc4 upstream.

Smatch complains that we have nested checks for "spdif_present".  It
turns out the current behavior isn't correct, we should remove the first
check and keep the second.

Fixes: 1077a024812d ('ALSA: hda - Use generic parser for Cirrus codec driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/pci/hda/patch_cirrus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 51e2080..7b0aac9 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -1002,9 +1002,7 @@ static void cs4210_spdif_automute(struct hda_codec *codec,
 
 	spec->spdif_present = spdif_present;
 	/* SPDIF TX on/off */
-	if (spdif_present)
-		snd_hda_set_pin_ctl(codec, spdif_pin,
-				    spdif_present ? PIN_OUT : 0);
+	snd_hda_set_pin_ctl(codec, spdif_pin, spdif_present ? PIN_OUT : 0);
 
 	cs_automute(codec);
 }
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 58/60] niu: don't count tx error twice in case of headroom realloc fails
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (56 preceding siblings ...)
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 57/60] ALSA: hda - fix cs4210_spdif_automute() Kamal Mostafa
@ 2015-09-02  0:58 ` Kamal Mostafa
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 59/60] net/mlx4_core: Fix wrong index in propagating port change event to VFs Kamal Mostafa
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 60/60] ipvs: fix crash if scheduler is changed Kamal Mostafa
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:58 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jiri Pirko, David S. Miller, Kamal Mostafa

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

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

From: Jiri Pirko <jiri@resnulli.us>

commit 42288830494cd51873ca745a7a229023df061226 upstream.

Fixes: a3138df9 ("[NIU]: Add Sun Neptune ethernet driver.")
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/ethernet/sun/niu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index 388540f..61f75a8 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -6663,10 +6663,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
 		struct sk_buff *skb_new;
 
 		skb_new = skb_realloc_headroom(skb, len);
-		if (!skb_new) {
-			rp->tx_errors++;
+		if (!skb_new)
 			goto out_drop;
-		}
 		kfree_skb(skb);
 		skb = skb_new;
 	} else
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 59/60] net/mlx4_core: Fix wrong index in propagating port change event to VFs
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (57 preceding siblings ...)
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 58/60] niu: don't count tx error twice in case of headroom realloc fails Kamal Mostafa
@ 2015-09-02  0:58 ` Kamal Mostafa
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 60/60] ipvs: fix crash if scheduler is changed Kamal Mostafa
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:58 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jack Morgenstein, Matan Barak, Or Gerlitz, David S. Miller,
	Kamal Mostafa

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

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

From: Jack Morgenstein <jackm@dev.mellanox.co.il>

commit 1c1bf34951e8d17941bf708d1901c47e81b15d55 upstream.

The port-change event processing in procedure mlx4_eq_int() uses "slave"
as the vf_oper array index. Since the value of "slave" is the PF function
index, the result is that the PF link state is used for deciding to
propagate the event for all the VFs. The VF link state should be used,
so the VF function index should be used here.

Fixes: 948e306d7d64 ('net/mlx4: Add VF link state support')
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/ethernet/mellanox/mlx4/eq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
index c9cdb2a..dbf8a16 100644
--- a/drivers/net/ethernet/mellanox/mlx4/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
@@ -558,7 +558,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)
 						mlx4_dbg(dev, "%s: Sending MLX4_PORT_CHANGE_SUBTYPE_DOWN"
 							 " to slave: %d, port:%d\n",
 							 __func__, i, port);
-						s_info = &priv->mfunc.master.vf_oper[slave].vport[port].state;
+						s_info = &priv->mfunc.master.vf_oper[i].vport[port].state;
 						if (IFLA_VF_LINK_STATE_AUTO == s_info->link_state)
 							mlx4_slave_event(dev, i, eqe);
 					} else {  /* IB port */
@@ -584,7 +584,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)
 					for (i = 0; i < dev->num_slaves; i++) {
 						if (i == mlx4_master_func_num(dev))
 							continue;
-						s_info = &priv->mfunc.master.vf_oper[slave].vport[port].state;
+						s_info = &priv->mfunc.master.vf_oper[i].vport[port].state;
 						if (IFLA_VF_LINK_STATE_AUTO == s_info->link_state)
 							mlx4_slave_event(dev, i, eqe);
 					}
-- 
1.9.1


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

* [PATCH 3.13.y-ckt 60/60] ipvs: fix crash if scheduler is changed
  2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
                   ` (58 preceding siblings ...)
  2015-09-02  0:58 ` [PATCH 3.13.y-ckt 59/60] net/mlx4_core: Fix wrong index in propagating port change event to VFs Kamal Mostafa
@ 2015-09-02  0:58 ` Kamal Mostafa
  59 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-02  0:58 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Julian Anastasov, Simon Horman, Luis Henriques, Kamal Mostafa

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

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

From: Julian Anastasov <ja@ssi.bg>

commit 05f00505a89acd21f5d0d20f5797dfbc4cf85243 upstream.

I overlooked the svc->sched_data usage from schedulers
when the services were converted to RCU in 3.10. Now
the rare ipvsadm -E command can change the scheduler
but due to the reverse order of ip_vs_bind_scheduler
and ip_vs_unbind_scheduler we provide new sched_data
to the old scheduler resulting in a crash.

To fix it without changing the scheduler methods we
have to use synchronize_rcu() only for the editing case.
It means all svc->scheduler readers should expect a
NULL value. To avoid breakage for the service listing
and ipvsadm -R we can use the "none" name to indicate
that scheduler is not assigned, a state when we drop
new connections.

Reported-by: Alexander Vasiliev <a.vasylev@404-group.com>
Fixes: ceec4c381681 ("ipvs: convert services to rcu")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/netfilter/ipvs/ip_vs_core.c  | 16 +++++++--
 net/netfilter/ipvs/ip_vs_ctl.c   | 78 +++++++++++++++++++++++++---------------
 net/netfilter/ipvs/ip_vs_sched.c | 12 +++----
 3 files changed, 69 insertions(+), 37 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 3d2d2c8..747b7ea 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -313,7 +313,13 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
 		 * return *ignored=0 i.e. ICMP and NF_DROP
 		 */
 		sched = rcu_dereference(svc->scheduler);
-		dest = sched->schedule(svc, skb, iph);
+		if (sched) {
+			/* read svc->sched_data after svc->scheduler */
+			smp_rmb();
+			dest = sched->schedule(svc, skb, iph);
+		} else {
+			dest = NULL;
+		}
 		if (!dest) {
 			IP_VS_DBG(1, "p-schedule: no dest found.\n");
 			kfree(param.pe_data);
@@ -460,7 +466,13 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
 	}
 
 	sched = rcu_dereference(svc->scheduler);
-	dest = sched->schedule(svc, skb, iph);
+	if (sched) {
+		/* read svc->sched_data after svc->scheduler */
+		smp_rmb();
+		dest = sched->schedule(svc, skb, iph);
+	} else {
+		dest = NULL;
+	}
 	if (dest == NULL) {
 		IP_VS_DBG(1, "Schedule: no dest found.\n");
 		return NULL;
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 008604c..fc1a495 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -820,15 +820,16 @@ __ip_vs_update_dest(struct ip_vs_service *svc, struct ip_vs_dest *dest,
 	__ip_vs_dst_cache_reset(dest);
 	spin_unlock_bh(&dest->dst_lock);
 
-	sched = rcu_dereference_protected(svc->scheduler, 1);
 	if (add) {
 		ip_vs_start_estimator(svc->net, &dest->stats);
 		list_add_rcu(&dest->n_list, &svc->destinations);
 		svc->num_dests++;
-		if (sched->add_dest)
+		sched = rcu_dereference_protected(svc->scheduler, 1);
+		if (sched && sched->add_dest)
 			sched->add_dest(svc, dest);
 	} else {
-		if (sched->upd_dest)
+		sched = rcu_dereference_protected(svc->scheduler, 1);
+		if (sched && sched->upd_dest)
 			sched->upd_dest(svc, dest);
 	}
 }
@@ -1059,7 +1060,7 @@ static void __ip_vs_unlink_dest(struct ip_vs_service *svc,
 		struct ip_vs_scheduler *sched;
 
 		sched = rcu_dereference_protected(svc->scheduler, 1);
-		if (sched->del_dest)
+		if (sched && sched->del_dest)
 			sched->del_dest(svc, dest);
 	}
 }
@@ -1150,11 +1151,14 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u,
 	ip_vs_use_count_inc();
 
 	/* Lookup the scheduler by 'u->sched_name' */
-	sched = ip_vs_scheduler_get(u->sched_name);
-	if (sched == NULL) {
-		pr_info("Scheduler module ip_vs_%s not found\n", u->sched_name);
-		ret = -ENOENT;
-		goto out_err;
+	if (strcmp(u->sched_name, "none")) {
+		sched = ip_vs_scheduler_get(u->sched_name);
+		if (!sched) {
+			pr_info("Scheduler module ip_vs_%s not found\n",
+				u->sched_name);
+			ret = -ENOENT;
+			goto out_err;
+		}
 	}
 
 	if (u->pe_name && *u->pe_name) {
@@ -1215,10 +1219,12 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u,
 	spin_lock_init(&svc->stats.lock);
 
 	/* Bind the scheduler */
-	ret = ip_vs_bind_scheduler(svc, sched);
-	if (ret)
-		goto out_err;
-	sched = NULL;
+	if (sched) {
+		ret = ip_vs_bind_scheduler(svc, sched);
+		if (ret)
+			goto out_err;
+		sched = NULL;
+	}
 
 	/* Bind the ct retriever */
 	RCU_INIT_POINTER(svc->pe, pe);
@@ -1266,17 +1272,20 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u,
 static int
 ip_vs_edit_service(struct ip_vs_service *svc, struct ip_vs_service_user_kern *u)
 {
-	struct ip_vs_scheduler *sched, *old_sched;
+	struct ip_vs_scheduler *sched = NULL, *old_sched;
 	struct ip_vs_pe *pe = NULL, *old_pe = NULL;
 	int ret = 0;
 
 	/*
 	 * Lookup the scheduler, by 'u->sched_name'
 	 */
-	sched = ip_vs_scheduler_get(u->sched_name);
-	if (sched == NULL) {
-		pr_info("Scheduler module ip_vs_%s not found\n", u->sched_name);
-		return -ENOENT;
+	if (strcmp(u->sched_name, "none")) {
+		sched = ip_vs_scheduler_get(u->sched_name);
+		if (!sched) {
+			pr_info("Scheduler module ip_vs_%s not found\n",
+				u->sched_name);
+			return -ENOENT;
+		}
 	}
 	old_sched = sched;
 
@@ -1304,14 +1313,20 @@ ip_vs_edit_service(struct ip_vs_service *svc, struct ip_vs_service_user_kern *u)
 
 	old_sched = rcu_dereference_protected(svc->scheduler, 1);
 	if (sched != old_sched) {
+		if (old_sched) {
+			ip_vs_unbind_scheduler(svc, old_sched);
+			RCU_INIT_POINTER(svc->scheduler, NULL);
+			/* Wait all svc->sched_data users */
+			synchronize_rcu();
+		}
 		/* Bind the new scheduler */
-		ret = ip_vs_bind_scheduler(svc, sched);
-		if (ret) {
-			old_sched = sched;
-			goto out;
+		if (sched) {
+			ret = ip_vs_bind_scheduler(svc, sched);
+			if (ret) {
+				ip_vs_scheduler_put(sched);
+				goto out;
+			}
 		}
-		/* Unbind the old scheduler on success */
-		ip_vs_unbind_scheduler(svc, old_sched);
 	}
 
 	/*
@@ -2037,6 +2052,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
 		const struct ip_vs_iter *iter = seq->private;
 		const struct ip_vs_dest *dest;
 		struct ip_vs_scheduler *sched = rcu_dereference(svc->scheduler);
+		char *sched_name = sched ? sched->name : "none";
 
 		if (iter->table == ip_vs_svc_table) {
 #ifdef CONFIG_IP_VS_IPV6
@@ -2045,18 +2061,18 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
 					   ip_vs_proto_name(svc->protocol),
 					   &svc->addr.in6,
 					   ntohs(svc->port),
-					   sched->name);
+					   sched_name);
 			else
 #endif
 				seq_printf(seq, "%s  %08X:%04X %s %s ",
 					   ip_vs_proto_name(svc->protocol),
 					   ntohl(svc->addr.ip),
 					   ntohs(svc->port),
-					   sched->name,
+					   sched_name,
 					   (svc->flags & IP_VS_SVC_F_ONEPACKET)?"ops ":"");
 		} else {
 			seq_printf(seq, "FWM  %08X %s %s",
-				   svc->fwmark, sched->name,
+				   svc->fwmark, sched_name,
 				   (svc->flags & IP_VS_SVC_F_ONEPACKET)?"ops ":"");
 		}
 
@@ -2471,13 +2487,15 @@ static void
 ip_vs_copy_service(struct ip_vs_service_entry *dst, struct ip_vs_service *src)
 {
 	struct ip_vs_scheduler *sched;
+	char *sched_name;
 
 	sched = rcu_dereference_protected(src->scheduler, 1);
+	sched_name = sched ? sched->name : "none";
 	dst->protocol = src->protocol;
 	dst->addr = src->addr.ip;
 	dst->port = src->port;
 	dst->fwmark = src->fwmark;
-	strlcpy(dst->sched_name, sched->name, sizeof(dst->sched_name));
+	strlcpy(dst->sched_name, sched_name, sizeof(dst->sched_name));
 	dst->flags = src->flags;
 	dst->timeout = src->timeout / HZ;
 	dst->netmask = src->netmask;
@@ -2903,6 +2921,7 @@ static int ip_vs_genl_fill_service(struct sk_buff *skb,
 	struct nlattr *nl_service;
 	struct ip_vs_flags flags = { .flags = svc->flags,
 				     .mask = ~0 };
+	char *sched_name;
 
 	nl_service = nla_nest_start(skb, IPVS_CMD_ATTR_SERVICE);
 	if (!nl_service)
@@ -2921,8 +2940,9 @@ static int ip_vs_genl_fill_service(struct sk_buff *skb,
 	}
 
 	sched = rcu_dereference_protected(svc->scheduler, 1);
+	sched_name = sched ? sched->name : "none";
 	pe = rcu_dereference_protected(svc->pe, 1);
-	if (nla_put_string(skb, IPVS_SVC_ATTR_SCHED_NAME, sched->name) ||
+	if (nla_put_string(skb, IPVS_SVC_ATTR_SCHED_NAME, sched_name) ||
 	    (pe && nla_put_string(skb, IPVS_SVC_ATTR_PE_NAME, pe->name)) ||
 	    nla_put(skb, IPVS_SVC_ATTR_FLAGS, sizeof(flags), &flags) ||
 	    nla_put_u32(skb, IPVS_SVC_ATTR_TIMEOUT, svc->timeout / HZ) ||
diff --git a/net/netfilter/ipvs/ip_vs_sched.c b/net/netfilter/ipvs/ip_vs_sched.c
index 4dbcda6..21b6b51 100644
--- a/net/netfilter/ipvs/ip_vs_sched.c
+++ b/net/netfilter/ipvs/ip_vs_sched.c
@@ -74,7 +74,7 @@ void ip_vs_unbind_scheduler(struct ip_vs_service *svc,
 
 	if (sched->done_service)
 		sched->done_service(svc);
-	/* svc->scheduler can not be set to NULL */
+	/* svc->scheduler can be set to NULL only by caller */
 }
 
 
@@ -148,21 +148,21 @@ void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler)
 
 void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg)
 {
-	struct ip_vs_scheduler *sched;
+	struct ip_vs_scheduler *sched = rcu_dereference(svc->scheduler);
+	char *sched_name = sched ? sched->name : "none";
 
-	sched = rcu_dereference(svc->scheduler);
 	if (svc->fwmark) {
 		IP_VS_ERR_RL("%s: FWM %u 0x%08X - %s\n",
-			     sched->name, svc->fwmark, svc->fwmark, msg);
+			     sched_name, svc->fwmark, svc->fwmark, msg);
 #ifdef CONFIG_IP_VS_IPV6
 	} else if (svc->af == AF_INET6) {
 		IP_VS_ERR_RL("%s: %s [%pI6c]:%d - %s\n",
-			     sched->name, ip_vs_proto_name(svc->protocol),
+			     sched_name, ip_vs_proto_name(svc->protocol),
 			     &svc->addr.in6, ntohs(svc->port), msg);
 #endif
 	} else {
 		IP_VS_ERR_RL("%s: %s %pI4:%d - %s\n",
-			     sched->name, ip_vs_proto_name(svc->protocol),
+			     sched_name, ip_vs_proto_name(svc->protocol),
 			     &svc->addr.ip, ntohs(svc->port), msg);
 	}
 }
-- 
1.9.1


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

* Re: [PATCH 3.13.y-ckt 10/60] md/raid10: always set reshape_safe when initializing reshape_position.
  2015-09-02  0:57 ` [PATCH 3.13.y-ckt 10/60] md/raid10: always set reshape_safe when initializing reshape_position Kamal Mostafa
@ 2015-09-04 19:39   ` Kamal Mostafa
  0 siblings, 0 replies; 62+ messages in thread
From: Kamal Mostafa @ 2015-09-04 19:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: stable, kernel-team, NeilBrown

On Tue, 2015-09-01 at 17:57 -0700, Kamal Mostafa wrote:
> 3.13.11-ckt26 -stable review patch.  If anyone has any objections, please let me know.

I'm deferring this commit until the next 3.13-stable release (along with
"md: flush ->event_work before stopping array.") as per the guidance on
their cc: stable lines.

 -Kamal


> ------------------
> 
> From: NeilBrown <neilb@suse.com>
> 
> commit 299b0685e31c9f3dcc2d58ee3beca761a40b44b3 upstream.
> 
> 'reshape_position' tracks where in the reshape we have reached.
> 'reshape_safe' tracks where in the reshape we have safely recorded
> in the metadata.
> 
> These are compared to determine when to update the metadata.
> So it is important that reshape_safe is initialised properly.
> Currently it isn't.  When starting a reshape from the beginning
> it usually has the correct value by luck.  But when reducing the
> number of devices in a RAID10, it has the wrong value and this leads
> to the metadata not being updated correctly.
> This can lead to corruption if the reshape is not allowed to complete.
> 
> This patch is suitable for any -stable kernel which supports RAID10
> reshape, which is 3.5 and later.
> 
> Fixes: 3ea7daa5d7fd ("md/raid10: add reshape support")
> Signed-off-by: NeilBrown <neilb@suse.com>
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  drivers/md/raid10.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 1b707ad..b8215a3 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -3597,6 +3597,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
>  			/* far_copies must be 1 */
>  			conf->prev.stride = conf->dev_sectors;
>  	}
> +	conf->reshape_safe = conf->reshape_progress;
>  	spin_lock_init(&conf->device_lock);
>  	INIT_LIST_HEAD(&conf->retry_list);
>  
> @@ -3804,7 +3805,6 @@ static int run(struct mddev *mddev)
>  		}
>  		conf->offset_diff = min_offset_diff;
>  
> -		conf->reshape_safe = conf->reshape_progress;
>  		clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
>  		clear_bit(MD_RECOVERY_CHECK, &mddev->recovery);
>  		set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);
> @@ -4149,6 +4149,7 @@ static int raid10_start_reshape(struct mddev *mddev)
>  		conf->reshape_progress = size;
>  	} else
>  		conf->reshape_progress = 0;
> +	conf->reshape_safe = conf->reshape_progress;
>  	spin_unlock_irq(&conf->device_lock);
>  
>  	if (mddev->delta_disks && mddev->bitmap) {
> @@ -4215,6 +4216,7 @@ abort:
>  		rdev->new_data_offset = rdev->data_offset;
>  	smp_wmb();
>  	conf->reshape_progress = MaxSector;
> +	conf->reshape_safe = MaxSector;
>  	mddev->reshape_position = MaxSector;
>  	spin_unlock_irq(&conf->device_lock);
>  	return ret;
> @@ -4566,6 +4568,7 @@ static void end_reshape(struct r10conf *conf)
>  	md_finish_reshape(conf->mddev);
>  	smp_wmb();
>  	conf->reshape_progress = MaxSector;
> +	conf->reshape_safe = MaxSector;
>  	spin_unlock_irq(&conf->device_lock);
>  
>  	/* read-ahead size must cover two whole stripes, which is



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

end of thread, other threads:[~2015-09-04 19:39 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 01/60] md: use kzalloc() when bitmap is disabled Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 02/60] ata: pmp: add quirk for Marvell 4140 SATA PMP Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 03/60] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for HP 250GB SATA disk VB0250EAVER Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 04/60] libata: add ATA_HORKAGE_NOTRIM Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 05/60] libata: force disable trim for SuperSSpeed S238 Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 06/60] libata: increase the timeout when setting transfer mode Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 07/60] libata: Do not blacklist M510DC Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 08/60] mac80211: clear subdir_stations when removing debugfs Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 09/60] ALSA: hda - Add new GPU codec ID 0x10de007d to snd-hda Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 10/60] md/raid10: always set reshape_safe when initializing reshape_position Kamal Mostafa
2015-09-04 19:39   ` Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 11/60] drm: Stop resetting connector state to unknown Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 12/60] usb: dwc3: Reset the transfer resource index on SET_INTERFACE Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 13/60] usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 14/60] xhci: Calculate old endpoints correctly on device reset Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 15/60] xhci: report U3 when link is in resume state Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 16/60] xhci: prevent bus_suspend if SS port resuming in phase 1 Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 17/60] xhci: do not report PLC when link is in internal resume state Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 18/60] USB: OHCI: Fix race between ED unlink and URB submission Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 19/60] usb-storage: ignore ZTE MF 823 card reader in mode 0x1225 Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 20/60] blkcg: fix gendisk reference leak in blkg_conf_prep() Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 21/60] tile: use free_bootmem_late() for initrd Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 22/60] Input: usbtouchscreen - avoid unresponsive TSC-30 touch screen Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 23/60] md/raid1: fix test for 'was read error from last working device' Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 24/60] mmc: omap_hsmmc: Fix DTO and DCRC handling Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 25/60] isdn/gigaset: reset tty->receive_room when attaching ser_gigaset Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 26/60] mmc: sdhci-pxav3: fix platform_data is not initialized Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 27/60] mmc: block: Add missing mmc_blk_put() in power_ro_lock_show() Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 28/60] mmc: sdhci-esdhc: Make 8BIT bus work Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 29/60] bonding: correctly handle bonding type change on enslave failure Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 30/60] net: Clone skb before setting peeked flag Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 31/60] bridge: mdb: fix double add notification Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 32/60] usb: gadget: mv_udc_core: fix phy_regs I/O memory leak Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 33/60] inet: frags: fix defragmented packet's IP header for af_packet Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 34/60] bonding: fix destruction of bond with devices different from arphrd_ether Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 35/60] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 36/60] ASoC: pcm1681: Fix setting de-emphasis sampling rate selection Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 37/60] iscsi-target: Fix use-after-free during TPG session shutdown Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 38/60] iscsi-target: Fix iscsit_start_kthreads failure OOPs Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 39/60] iscsi-target: Fix iser explicit logout TX kthread leak Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 40/60] ALSA: hda - Apply fixup for another Toshiba Satellite S50D Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 41/60] vhost: actually track log eventfd file Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 42/60] xfs: remote attributes need to be considered data Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 43/60] ALSA: usb-audio: add dB range mapping for some devices Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 44/60] drm/radeon/combios: add some validation of lvds values Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 45/60] x86/efi: Use all 64 bit of efi_memmap in setup_e820() Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 46/60] ipr: Fix locking for unit attention handling Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 47/60] ipr: Fix incorrect trace indexing Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 48/60] ipr: Fix invalid array indexing for HRRQ Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 49/60] ALSA: hda - Fix MacBook Pro 5,2 quirk Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 50/60] x86/xen: Probe target addresses in set_aliased_prot() before the hypercall Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 51/60] netfilter: ctnetlink: put back references to master ct and expect objects Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 52/60] bridge: mdb: fix delmdb state in the notification Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 53/60] ipvs: fix crash with sync protocol v0 and FTP Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 54/60] act_pedit: check binding before calling tcf_hash_release() Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 55/60] netfilter: nf_conntrack: Support expectations in different zones Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 56/60] ipvs: do not use random local source address for tunnels Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 57/60] ALSA: hda - fix cs4210_spdif_automute() Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 58/60] niu: don't count tx error twice in case of headroom realloc fails Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 59/60] net/mlx4_core: Fix wrong index in propagating port change event to VFs Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 60/60] ipvs: fix crash if scheduler is changed Kamal Mostafa

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).