--- /dev/null
+From 53fa1f6e8a5958da698a31edf366ffe90596b490 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 17 Apr 2018 18:23:50 +0200
+Subject: ACPI / video: Only default only_lcd to true on Win8-ready _desktops_
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 53fa1f6e8a5958da698a31edf366ffe90596b490 upstream.
+
+Commit 5928c281524f (ACPI / video: Default lcd_only to true on Win8-ready
+and newer machines) made only_lcd default to true on all machines where
+acpi_osi_is_win8() returns true, including laptops.
+
+The purpose of this is to avoid the bogus / non-working acpi backlight
+interface which many newer BIOS-es define on desktop machines.
+
+But this is causing a regression on some laptops, specifically on the
+Dell XPS 13 2013 model, which does not have the LCD flag set for its
+fully functional ACPI backlight interface.
+
+Rather then DMI quirking our way out of this, this commits changes the
+logic for setting only_lcd to true, to only do this on machines with
+a desktop (or server) dmi chassis-type.
+
+Note that we cannot simply only check the chassis-type and not register
+the backlight interface based on that as there are some laptops and
+tablets which have their chassis-type set to "3" aka desktop. Hopefully
+the combination of checking the LCD flag, but only on devices with
+a desktop(ish) chassis-type will avoid the needs for DMI quirks for this,
+or at least limit the amount of DMI quirks which we need to a minimum.
+
+Fixes: 5928c281524f (ACPI / video: Default lcd_only to true on Win8-ready and newer machines)
+Reported-and-tested-by: James Hogan <jhogan@kernel.org>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Cc: 4.15+ <stable@vger.kernel.org> # 4.15+
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/acpi_video.c | 27 +++++++++++++++++++++++++--
+ 1 file changed, 25 insertions(+), 2 deletions(-)
+
+--- a/drivers/acpi/acpi_video.c
++++ b/drivers/acpi/acpi_video.c
+@@ -2069,6 +2069,25 @@ static int __init intel_opregion_present
+ return opregion;
+ }
+
++static bool dmi_is_desktop(void)
++{
++ const char *chassis_type;
++
++ chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
++ if (!chassis_type)
++ return false;
++
++ if (!strcmp(chassis_type, "3") || /* 3: Desktop */
++ !strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */
++ !strcmp(chassis_type, "5") || /* 5: Pizza Box */
++ !strcmp(chassis_type, "6") || /* 6: Mini Tower */
++ !strcmp(chassis_type, "7") || /* 7: Tower */
++ !strcmp(chassis_type, "11")) /* 11: Main Server Chassis */
++ return true;
++
++ return false;
++}
++
+ int acpi_video_register(void)
+ {
+ int ret = 0;
+@@ -2089,8 +2108,12 @@ int acpi_video_register(void)
+ * win8 ready (where we also prefer the native backlight driver, so
+ * normally the acpi_video code should not register there anyways).
+ */
+- if (only_lcd == -1)
+- only_lcd = acpi_osi_is_win8();
++ if (only_lcd == -1) {
++ if (dmi_is_desktop() && acpi_osi_is_win8())
++ only_lcd = true;
++ else
++ only_lcd = false;
++ }
+
+ dmi_check_system(video_dmi_table);
+
--- /dev/null
+From 9de4ee40547fd315d4a0ed1dd15a2fa3559ad707 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Wed, 18 Apr 2018 12:51:31 +0300
+Subject: cdrom: information leak in cdrom_ioctl_media_changed()
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit 9de4ee40547fd315d4a0ed1dd15a2fa3559ad707 upstream.
+
+This cast is wrong. "cdi->capacity" is an int and "arg" is an unsigned
+long. The way the check is written now, if one of the high 32 bits is
+set then we could read outside the info->slots[] array.
+
+This bug is pretty old and it predates git.
+
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Cc: stable@vger.kernel.org
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cdrom/cdrom.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/cdrom/cdrom.c
++++ b/drivers/cdrom/cdrom.c
+@@ -2368,7 +2368,7 @@ static int cdrom_ioctl_media_changed(str
+ if (!CDROM_CAN(CDC_SELECT_DISC) || arg == CDSL_CURRENT)
+ return media_changed(cdi, 1);
+
+- if ((unsigned int)arg >= cdi->capacity)
++ if (arg >= cdi->capacity)
+ return -EINVAL;
+
+ info = kmalloc(sizeof(*info), GFP_KERNEL);
--- /dev/null
+From af2e460ade0b0180d0f3812ca4f4f59cc9597f3e Mon Sep 17 00:00:00 2001
+From: Sebastian Ott <sebott@linux.ibm.com>
+Date: Wed, 11 Apr 2018 11:21:17 +0200
+Subject: s390/cio: update chpid descriptor after resource accessibility event
+
+From: Sebastian Ott <sebott@linux.ibm.com>
+
+commit af2e460ade0b0180d0f3812ca4f4f59cc9597f3e upstream.
+
+Channel path descriptors have been seen as something stable (as
+long as the chpid is configured). Recent tests have shown that the
+descriptor can also be altered when the link state of a channel path
+changes. Thus it is necessary to update the descriptor during
+handling of resource accessibility events.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
+Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/s390/cio/chsc.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+--- a/drivers/s390/cio/chsc.c
++++ b/drivers/s390/cio/chsc.c
+@@ -451,6 +451,7 @@ static void chsc_process_sei_link_incide
+
+ static void chsc_process_sei_res_acc(struct chsc_sei_nt0_area *sei_area)
+ {
++ struct channel_path *chp;
+ struct chp_link link;
+ struct chp_id chpid;
+ int status;
+@@ -463,10 +464,17 @@ static void chsc_process_sei_res_acc(str
+ chpid.id = sei_area->rsid;
+ /* allocate a new channel path structure, if needed */
+ status = chp_get_status(chpid);
+- if (status < 0)
+- chp_new(chpid);
+- else if (!status)
++ if (!status)
+ return;
++
++ if (status < 0) {
++ chp_new(chpid);
++ } else {
++ chp = chpid_to_chp(chpid);
++ mutex_lock(&chp->lock);
++ chp_update_desc(chp);
++ mutex_unlock(&chp->lock);
++ }
+ memset(&link, 0, sizeof(struct chp_link));
+ link.chpid = chpid;
+ if ((sei_area->vf & 0xc0) != 0) {
--- /dev/null
+From 5d27a2bf6e14f5c7d1033ad1e993fcd0eba43e83 Mon Sep 17 00:00:00 2001
+From: Stefan Haberland <sth@linux.vnet.ibm.com>
+Date: Thu, 12 Apr 2018 13:38:22 +0200
+Subject: s390/dasd: fix IO error for newly defined devices
+
+From: Stefan Haberland <sth@linux.vnet.ibm.com>
+
+commit 5d27a2bf6e14f5c7d1033ad1e993fcd0eba43e83 upstream.
+
+When a new CKD storage volume is defined at the storage server, Linux
+may be relying on outdated information about that volume, which leads to
+the following errors:
+
+1. Command Reject Errors for minidisk on z/VM:
+
+dasd-eckd.b3193d: 0.0.XXXX: An error occurred in the DASD device driver,
+ reason=09
+dasd(eckd): I/O status report for device 0.0.XXXX:
+dasd(eckd): in req: 00000000XXXXXXXX CC:00 FC:04 AC:00 SC:17 DS:02 CS:00
+ RC:0
+dasd(eckd): device 0.0.2046: Failing CCW: 00000000XXXXXXXX
+dasd(eckd): Sense(hex) 0- 7: 80 00 00 00 00 00 00 00
+dasd(eckd): Sense(hex) 8-15: 00 00 00 00 00 00 00 00
+dasd(eckd): Sense(hex) 16-23: 00 00 00 00 e1 00 0f 00
+dasd(eckd): Sense(hex) 24-31: 00 00 40 e2 00 00 00 00
+dasd(eckd): 24 Byte: 0 MSG 0, no MSGb to SYSOP
+
+2. Equipment Check errors on LPAR or for dedicated devices on z/VM:
+
+dasd(eckd): I/O status report for device 0.0.XXXX:
+dasd(eckd): in req: 00000000XXXXXXXX CC:00 FC:04 AC:00 SC:17 DS:0E CS:40
+ fcxs:01 schxs:00 RC:0
+dasd(eckd): device 0.0.9713: Failing TCW: 00000000XXXXXXXX
+dasd(eckd): Sense(hex) 0- 7: 10 00 00 00 13 58 4d 0f
+dasd(eckd): Sense(hex) 8-15: 67 00 00 00 00 00 00 04
+dasd(eckd): Sense(hex) 16-23: e5 18 05 33 97 01 0f 0f
+dasd(eckd): Sense(hex) 24-31: 00 00 40 e2 00 04 58 0d
+dasd(eckd): 24 Byte: 0 MSG f, no MSGb to SYSOP
+
+Fix this problem by using the up-to-date information provided during
+online processing via the device specific SNEQ to detect the case of
+outdated LCU data. If there is a difference, perform a re-read of that
+data.
+
+Cc: stable@vger.kernel.org
+Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
+Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/s390/block/dasd_alias.c | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+--- a/drivers/s390/block/dasd_alias.c
++++ b/drivers/s390/block/dasd_alias.c
+@@ -591,13 +591,22 @@ static int _schedule_lcu_update(struct a
+ int dasd_alias_add_device(struct dasd_device *device)
+ {
+ struct dasd_eckd_private *private = device->private;
+- struct alias_lcu *lcu;
++ __u8 uaddr = private->uid.real_unit_addr;
++ struct alias_lcu *lcu = private->lcu;
+ unsigned long flags;
+ int rc;
+
+- lcu = private->lcu;
+ rc = 0;
+ spin_lock_irqsave(&lcu->lock, flags);
++ /*
++ * Check if device and lcu type differ. If so, the uac data may be
++ * outdated and needs to be updated.
++ */
++ if (private->uid.type != lcu->uac->unit[uaddr].ua_type) {
++ lcu->flags |= UPDATE_PENDING;
++ DBF_DEV_EVENT(DBF_WARNING, device, "%s",
++ "uid type mismatch - trigger rescan");
++ }
+ if (!(lcu->flags & UPDATE_PENDING)) {
+ rc = _add_device_to_lcu(lcu, device, device);
+ if (rc)
--- /dev/null
+From 783c3b53b9506db3e05daacfe34e0287eebb09d8 Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Mon, 16 Apr 2018 12:22:24 +0200
+Subject: s390/uprobes: implement arch_uretprobe_is_alive()
+
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+commit 783c3b53b9506db3e05daacfe34e0287eebb09d8 upstream.
+
+Implement s390 specific arch_uretprobe_is_alive() to avoid SIGSEGVs
+observed with uretprobes in combination with setjmp/longjmp.
+
+See commit 2dea1d9c38e4 ("powerpc/uprobes: Implement
+arch_uretprobe_is_alive()") for more details.
+
+With this implemented all test cases referenced in the above commit
+pass.
+
+Reported-by: Ziqian SUN <zsun@redhat.com>
+Cc: <stable@vger.kernel.org> # v4.3+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/s390/kernel/uprobes.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/s390/kernel/uprobes.c
++++ b/arch/s390/kernel/uprobes.c
+@@ -147,6 +147,15 @@ unsigned long arch_uretprobe_hijack_retu
+ return orig;
+ }
+
++bool arch_uretprobe_is_alive(struct return_instance *ret, enum rp_check ctx,
++ struct pt_regs *regs)
++{
++ if (ctx == RP_CHECK_CHAIN_CALL)
++ return user_stack_pointer(regs) <= ret->stack;
++ else
++ return user_stack_pointer(regs) < ret->stack;
++}
++
+ /* Instruction Emulation */
+
+ static void adjust_psw_addr(psw_t *psw, unsigned long len)
--- /dev/null
+From 94e5395d2403c8bc2504a7cbe4c4caaacb7b8b84 Mon Sep 17 00:00:00 2001
+From: "Martin K. Petersen" <martin.petersen@oracle.com>
+Date: Wed, 18 Apr 2018 22:54:59 -0400
+Subject: scsi: mptsas: Disable WRITE SAME
+
+From: Martin K. Petersen <martin.petersen@oracle.com>
+
+commit 94e5395d2403c8bc2504a7cbe4c4caaacb7b8b84 upstream.
+
+First generation MPT Fusion controllers can not translate WRITE SAME
+when the attached device is a SATA drive. Disable WRITE SAME support.
+
+Reported-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/message/fusion/mptsas.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/message/fusion/mptsas.c
++++ b/drivers/message/fusion/mptsas.c
+@@ -1994,6 +1994,7 @@ static struct scsi_host_template mptsas_
+ .cmd_per_lun = 7,
+ .use_clustering = ENABLE_CLUSTERING,
+ .shost_attrs = mptscsih_host_attrs,
++ .no_write_same = 1,
+ };
+
+ static int mptsas_get_linkerrors(struct sas_phy *phy)
strparser-fix-incorrect-strp-need_bytes-value.patch
+scsi-mptsas-disable-write-same.patch
+cdrom-information-leak-in-cdrom_ioctl_media_changed.patch
+s390-cio-update-chpid-descriptor-after-resource-accessibility-event.patch
+s390-dasd-fix-io-error-for-newly-defined-devices.patch
+s390-uprobes-implement-arch_uretprobe_is_alive.patch
+acpi-video-only-default-only_lcd-to-true-on-win8-ready-_desktops_.patch