diff --git a/kernel/drivers/module-bbswitch/pspec.xml b/kernel/drivers/module-bbswitch/pspec.xml
index 29134444..922cfc8d 100644
--- a/kernel/drivers/module-bbswitch/pspec.xml
+++ b/kernel/drivers/module-bbswitch/pspec.xml
@@ -11,7 +11,7 @@
Kernel module allowing to switch dedicated graphics card on Optimus laptops
kernel module allowing to switch dedicated graphics card on Optimus laptops
- kernel-module-headers
+ kernel-module-headers
https://github.com/Bumblebee-Project/bbswitch/archive/v0.8.tar.gz
@@ -20,7 +20,7 @@
module-bbswitch
- kernel
+ kernel
/lib/modules
@@ -34,6 +34,13 @@
+
+ 2015-09-18
+ 0.8
+ Rebuild for kernel-4.1.7.
+ Ertuğrul Erata
+ ertugrulerata@gmail.com
+
2015-08-18
0.8
diff --git a/kernel/drivers/module-broadcom-wl/pspec.xml b/kernel/drivers/module-broadcom-wl/pspec.xml
index 3cb9e328..06dc2432 100644
--- a/kernel/drivers/module-broadcom-wl/pspec.xml
+++ b/kernel/drivers/module-broadcom-wl/pspec.xml
@@ -15,7 +15,7 @@
http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_248.tar.gz
http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz
- kernel-module-headers
+ kernel-module-headers
patch/linux-40.patch
@@ -30,7 +30,7 @@
module-broadcom-wl
- kernel
+ kernel
module-broadcom-wl-userspace
@@ -62,6 +62,13 @@
+
+ 2015-09-18
+ 6.30.223.248
+ Rebuild for kernel 4.1.7.
+ Ertuğrul Erata
+ ertugrulerata@gmail.com
+
2015-08-18
6.30.223.248
diff --git a/kernel/drivers/module-virtualbox-guest/pspec.xml b/kernel/drivers/module-virtualbox-guest/pspec.xml
index 8a82d576..734a0576 100644
--- a/kernel/drivers/module-virtualbox-guest/pspec.xml
+++ b/kernel/drivers/module-virtualbox-guest/pspec.xml
@@ -14,14 +14,14 @@
This package provides the kernel modules needed for mouse integration and shared folder support between VirtualBox host and guest systems.
http://source.pisilinux.org/1.0/module-virtualbox-guest-4.3.28.tar.xz
- kernel-module-headers
+ kernel-module-headers
module-virtualbox-guest
- kernel
+ kernel
baselayout
module-virtualbox-guest-userspace
@@ -55,7 +55,7 @@
2015-08-18
4.3.28
- Rebuild for kernel-4.1.6.
+ Rebuild for kernel-4.1.7.
Ertuğrul Erata
ertugrulerata@gmail.com
diff --git a/kernel/drivers/module-virtualbox/pspec.xml b/kernel/drivers/module-virtualbox/pspec.xml
index 0a90bc3d..5b0de905 100644
--- a/kernel/drivers/module-virtualbox/pspec.xml
+++ b/kernel/drivers/module-virtualbox/pspec.xml
@@ -14,14 +14,14 @@
This package provides the kernel support for VirtualBox.
http://source.pisilinux.org/1.0/module-virtualbox-4.3.28.tar.xz
- kernel-module-headers
+ kernel-module-headers
module-virtualbox
- kernel
+ kernel
module-virtualbox-userspace
@@ -47,6 +47,13 @@
+
+ 2015-09-18
+ 4.3.28
+ Rebuild for kernel-4.1.7.
+ Ertuğrul Erata
+ ertugrulerata@gmail.com
+
2015-08-18
4.3.28
diff --git a/kernel/kernel/files/configs/kernel-x86_64-config b/kernel/kernel/files/configs/kernel-x86_64-config
index ac6c09d2..39d4fc93 100644
--- a/kernel/kernel/files/configs/kernel-x86_64-config
+++ b/kernel/kernel/files/configs/kernel-x86_64-config
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86_64 4.1.6 Kernel Configuration
+# Linux/x86_64 4.1.7 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
diff --git a/kernel/kernel/files/patches/linux/patch-4.1.7.xz b/kernel/kernel/files/patches/linux/patch-4.1.7.xz
new file mode 100644
index 00000000..056b9d3c
Binary files /dev/null and b/kernel/kernel/files/patches/linux/patch-4.1.7.xz differ
diff --git a/kernel/kernel/files/patches/mageia/Input-evdev-do-not-report-errors-form-flush.patch b/kernel/kernel/files/patches/mageia/Input-evdev-do-not-report-errors-form-flush.patch
new file mode 100644
index 00000000..dc0b728c
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/Input-evdev-do-not-report-errors-form-flush.patch
@@ -0,0 +1,64 @@
+From eb38f3a4f6e86f8bb10a3217ebd85ecc5d763aae Mon Sep 17 00:00:00 2001
+From: Takashi Iwai
+Date: Thu, 3 Sep 2015 22:20:00 -0700
+Subject: [PATCH] Input: evdev - do not report errors form flush()
+
+We've got bug reports showing the old systemd-logind (at least
+system-210) aborting unexpectedly, and this turned out to be because
+of an invalid error code from close() call to evdev devices. close()
+is supposed to return only either EINTR or EBADFD, while the device
+returned ENODEV. logind was overreacting to it and decided to kill
+itself when an unexpected error code was received. What a tragedy.
+
+The bad error code comes from flush fops, and actually evdev_flush()
+returns ENODEV when device is disconnected or client's access to it is
+revoked. But in these cases the fact that flush did not actually happen is
+not an error, but rather normal behavior. For non-disconnected devices
+result of flush is also not that interesting as there is no potential of
+data loss and even if it fails application has no way of handling the
+error. Because of that we are better off always returning success from
+evdev_flush().
+
+Also returning EINTR from flush()/close() is discouraged (as it is not
+clear how application should handle this error), so let's stop taking
+evdev->mutex interruptibly.
+
+Bugzilla: http://bugzilla.suse.com/show_bug.cgi?id=939834
+Cc:
+Signed-off-by: Takashi Iwai
+Signed-off-by: Dmitry Torokhov
+---
+ drivers/input/evdev.c | 13 ++++---------
+ 1 file changed, 4 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
+index 9d35499..08d4964 100644
+--- a/drivers/input/evdev.c
++++ b/drivers/input/evdev.c
+@@ -290,19 +290,14 @@ static int evdev_flush(struct file *file, fl_owner_t id)
+ {
+ struct evdev_client *client = file->private_data;
+ struct evdev *evdev = client->evdev;
+- int retval;
+
+- retval = mutex_lock_interruptible(&evdev->mutex);
+- if (retval)
+- return retval;
++ mutex_lock(&evdev->mutex);
+
+- if (!evdev->exist || client->revoked)
+- retval = -ENODEV;
+- else
+- retval = input_flush_device(&evdev->handle, file);
++ if (evdev->exist && !client->revoked)
++ input_flush_device(&evdev->handle, file);
+
+ mutex_unlock(&evdev->mutex);
+- return retval;
++ return 0;
+ }
+
+ static void evdev_free(struct device *dev)
+--
+2.3.8
+
diff --git a/kernel/kernel/files/patches/mageia/Revert-sched-x86_64-Don-t-save-flags-on-context-swit.patch b/kernel/kernel/files/patches/mageia/Revert-sched-x86_64-Don-t-save-flags-on-context-swit.patch
deleted file mode 100644
index 12178194..00000000
--- a/kernel/kernel/files/patches/mageia/Revert-sched-x86_64-Don-t-save-flags-on-context-swit.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 512255a2ad2c832ca7d4de9f31245f73781922d0 Mon Sep 17 00:00:00 2001
-From: Andy Lutomirski
-Date: Mon, 17 Aug 2015 12:22:50 -0700
-Subject: [PATCH] Revert "sched/x86_64: Don't save flags on context switch"
-
-This reverts commit:
-
- 2c7577a75837 ("sched/x86_64: Don't save flags on context switch")
-
-It was a nice speedup. It's also not quite correct: SYSENTER
-enables interrupts too early.
-
-We can re-add this optimization once the SYSENTER code is beaten
-into shape, which should happen in 4.3 or 4.4.
-
-Signed-off-by: Andy Lutomirski
-Cc: Linus Torvalds
-Cc: Peter Zijlstra
-Cc: Thomas Gleixner
-Cc: stable@vger.kernel.org # v3.19
-Link: http://lkml.kernel.org/r/85f56651f59f76624e80785a8fd3bdfdd089a818.1439838962.git.luto@kernel.org
-Signed-off-by: Ingo Molnar
----
- arch/x86/include/asm/switch_to.h | 12 ++++--------
- 1 file changed, 4 insertions(+), 8 deletions(-)
-
-diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm/switch_to.h
-index 751bf4b..d7f3b3b 100644
---- a/arch/x86/include/asm/switch_to.h
-+++ b/arch/x86/include/asm/switch_to.h
-@@ -79,12 +79,12 @@ do { \
- #else /* CONFIG_X86_32 */
-
- /* frame pointer must be last for get_wchan */
--#define SAVE_CONTEXT "pushq %%rbp ; movq %%rsi,%%rbp\n\t"
--#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp\t"
-+#define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t"
-+#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popf\t"
-
- #define __EXTRA_CLOBBER \
- , "rcx", "rbx", "rdx", "r8", "r9", "r10", "r11", \
-- "r12", "r13", "r14", "r15", "flags"
-+ "r12", "r13", "r14", "r15"
-
- #ifdef CONFIG_CC_STACKPROTECTOR
- #define __switch_canary \
-@@ -100,11 +100,7 @@ do { \
- #define __switch_canary_iparam
- #endif /* CC_STACKPROTECTOR */
-
--/*
-- * There is no need to save or restore flags, because flags are always
-- * clean in kernel mode, with the possible exception of IOPL. Kernel IOPL
-- * has no effect.
-- */
-+/* Save restore flags to clear handle leaking NT */
- #define switch_to(prev, next, last) \
- asm volatile(SAVE_CONTEXT \
- "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
---
-2.4.5
-
diff --git a/kernel/kernel/files/patches/mageia/SCSI-Fix-NULL-pointer-dereference-in-runtime-PM.patch b/kernel/kernel/files/patches/mageia/SCSI-Fix-NULL-pointer-dereference-in-runtime-PM.patch
deleted file mode 100644
index e7623744..00000000
--- a/kernel/kernel/files/patches/mageia/SCSI-Fix-NULL-pointer-dereference-in-runtime-PM.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From 49718f0fb8c9af192b33d8af3a2826db04025371 Mon Sep 17 00:00:00 2001
-From: Alan Stern
-Date: Mon, 17 Aug 2015 11:02:42 -0400
-Subject: [PATCH] SCSI: Fix NULL pointer dereference in runtime PM
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The routines in scsi_rpm.c assume that if a runtime-PM callback is
-invoked for a SCSI device, it can only mean that the device's driver
-has asked the block layer to handle the runtime power management (by
-calling blk_pm_runtime_init(), which among other things sets q->dev).
-
-However, this assumption turns out to be wrong for things like the ses
-driver. Normally ses devices are not allowed to do runtime PM, but
-userspace can override this setting. If this happens, the kernel gets
-a NULL pointer dereference when blk_post_runtime_resume() tries to use
-the uninitialized q->dev pointer.
-
-This patch fixes the problem by calling the block layer's runtime-PM
-routines only if the device's driver really does have a runtime-PM
-callback routine. Since ses doesn't define any such callbacks, the
-crash won't occur.
-
-This fixes Bugzilla #101371.
-
-Signed-off-by: Alan Stern
-Reported-by: Stanisław Pitucha
-Reported-by: Ilan Cohen
-Tested-by: Ilan Cohen
-Reviewed-by: Johannes Thumshirn
-Cc: stable@vger.kernel.org
-Signed-off-by: James Bottomley
----
- drivers/scsi/scsi_pm.c | 22 +++++++++++-----------
- 1 file changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
-index 9e43ae1..e4b7998 100644
---- a/drivers/scsi/scsi_pm.c
-+++ b/drivers/scsi/scsi_pm.c
-@@ -217,15 +217,15 @@ static int sdev_runtime_suspend(struct device *dev)
- {
- const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
- struct scsi_device *sdev = to_scsi_device(dev);
-- int err;
-+ int err = 0;
-
-- err = blk_pre_runtime_suspend(sdev->request_queue);
-- if (err)
-- return err;
-- if (pm && pm->runtime_suspend)
-+ if (pm && pm->runtime_suspend) {
-+ err = blk_pre_runtime_suspend(sdev->request_queue);
-+ if (err)
-+ return err;
- err = pm->runtime_suspend(dev);
-- blk_post_runtime_suspend(sdev->request_queue, err);
--
-+ blk_post_runtime_suspend(sdev->request_queue, err);
-+ }
- return err;
- }
-
-@@ -248,11 +248,11 @@ static int sdev_runtime_resume(struct device *dev)
- const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
- int err = 0;
-
-- blk_pre_runtime_resume(sdev->request_queue);
-- if (pm && pm->runtime_resume)
-+ if (pm && pm->runtime_resume) {
-+ blk_pre_runtime_resume(sdev->request_queue);
- err = pm->runtime_resume(dev);
-- blk_post_runtime_resume(sdev->request_queue, err);
--
-+ blk_post_runtime_resume(sdev->request_queue, err);
-+ }
- return err;
- }
-
---
-2.4.5
-
diff --git a/kernel/kernel/files/patches/mageia/ata-Revert-libata-Implement-NCQ-autosense.patch b/kernel/kernel/files/patches/mageia/ata-Revert-libata-Implement-NCQ-autosense.patch
deleted file mode 100644
index dbb919f3..00000000
--- a/kernel/kernel/files/patches/mageia/ata-Revert-libata-Implement-NCQ-autosense.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From 74a80d67b8316eb3fbeb73dafc060a5a0a708587 Mon Sep 17 00:00:00 2001
-From: Tejun Heo
-Date: Mon, 3 Aug 2015 11:46:39 -0400
-Subject: [PATCH] Revert "libata: Implement NCQ autosense"
-
-This reverts commit 42b966fbf35da9c87f08d98f9b8978edf9e717cf.
-
-As implemented, ACS-4 sense reporting for ATA devices bypasses error
-diagnosis and handling in libata degrading EH behavior significantly.
-Revert the related changes for now.
-
-Signed-off-by: Tejun Heo
-Cc: Hannes Reinecke
-Cc: stable@vger.kernel.org #v4.1+
----
- drivers/ata/libata-eh.c | 18 ------------------
- drivers/ata/libata-scsi.c | 9 ++-------
- drivers/ata/libata.h | 1 -
- include/linux/ata.h | 2 --
- 4 files changed, 2 insertions(+), 28 deletions(-)
-
-diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
-index 16125be..cb0508a 100644
---- a/drivers/ata/libata-eh.c
-+++ b/drivers/ata/libata-eh.c
-@@ -1592,8 +1592,6 @@ static int ata_eh_read_log_10h(struct ata_device *dev,
- tf->hob_lbah = buf[10];
- tf->nsect = buf[12];
- tf->hob_nsect = buf[13];
-- if (ata_id_has_ncq_autosense(dev->id))
-- tf->auxiliary = buf[14] << 16 | buf[15] << 8 | buf[16];
-
- return 0;
- }
-@@ -1791,18 +1789,6 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
- memcpy(&qc->result_tf, &tf, sizeof(tf));
- qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48;
- qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ;
-- if (qc->result_tf.auxiliary) {
-- char sense_key, asc, ascq;
--
-- sense_key = (qc->result_tf.auxiliary >> 16) & 0xff;
-- asc = (qc->result_tf.auxiliary >> 8) & 0xff;
-- ascq = qc->result_tf.auxiliary & 0xff;
-- ata_dev_dbg(dev, "NCQ Autosense %02x/%02x/%02x\n",
-- sense_key, asc, ascq);
-- ata_scsi_set_sense(qc->scsicmd, sense_key, asc, ascq);
-- qc->flags |= ATA_QCFLAG_SENSE_VALID;
-- }
--
- ehc->i.err_mask &= ~AC_ERR_DEV;
- }
-
-@@ -1832,10 +1818,6 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
- return ATA_EH_RESET;
- }
-
-- /* Set by NCQ autosense */
-- if (qc->flags & ATA_QCFLAG_SENSE_VALID)
-- return 0;
--
- if (stat & (ATA_ERR | ATA_DF))
- qc->err_mask |= AC_ERR_DEV;
- else
-diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
-index e1ecd2a..0d7f0da 100644
---- a/drivers/ata/libata-scsi.c
-+++ b/drivers/ata/libata-scsi.c
-@@ -270,11 +270,8 @@ DEVICE_ATTR(unload_heads, S_IRUGO | S_IWUSR,
- ata_scsi_park_show, ata_scsi_park_store);
- EXPORT_SYMBOL_GPL(dev_attr_unload_heads);
-
--void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq)
-+static void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq)
- {
-- if (!cmd)
-- return;
--
- cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
-
- scsi_build_sense_buffer(0, cmd->sense_buffer, sk, asc, ascq);
-@@ -1780,9 +1777,7 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
- ((cdb[2] & 0x20) || need_sense)) {
- ata_gen_passthru_sense(qc);
- } else {
-- if (qc->flags & ATA_QCFLAG_SENSE_VALID) {
-- cmd->result = SAM_STAT_CHECK_CONDITION;
-- } else if (!need_sense) {
-+ if (!need_sense) {
- cmd->result = SAM_STAT_GOOD;
- } else {
- /* TODO: decide which descriptor format to use
-diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
-index 8cfdd96..f840ca1 100644
---- a/drivers/ata/libata.h
-+++ b/drivers/ata/libata.h
-@@ -137,7 +137,6 @@ extern int ata_scsi_add_hosts(struct ata_host *host,
- struct scsi_host_template *sht);
- extern void ata_scsi_scan_host(struct ata_port *ap, int sync);
- extern int ata_scsi_offline_dev(struct ata_device *dev);
--extern void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq);
- extern void ata_scsi_media_change_notify(struct ata_device *dev);
- extern void ata_scsi_hotplug(struct work_struct *work);
- extern void ata_schedule_scsi_eh(struct Scsi_Host *shost);
-diff --git a/include/linux/ata.h b/include/linux/ata.h
-index 0e6a782..d2992bf 100644
---- a/include/linux/ata.h
-+++ b/include/linux/ata.h
-@@ -528,8 +528,6 @@ struct ata_bmdma_prd {
- #define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
- #define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4))
- #define ata_id_has_devslp(id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8))
--#define ata_id_has_ncq_autosense(id) \
-- ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7))
-
- static inline bool ata_id_has_hipm(const u16 *id)
- {
---
-2.4.5
-
diff --git a/kernel/kernel/files/patches/mageia/ata-Revert-libata-Implement-support-for-sense-data-repor.patch b/kernel/kernel/files/patches/mageia/ata-Revert-libata-Implement-support-for-sense-data-repor.patch
deleted file mode 100644
index 69533d57..00000000
--- a/kernel/kernel/files/patches/mageia/ata-Revert-libata-Implement-support-for-sense-data-repor.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-From 84ded2f8e7dda336fc2fb3570726ceb3b3b3590f Mon Sep 17 00:00:00 2001
-From: Tejun Heo
-Date: Mon, 3 Aug 2015 11:45:34 -0400
-Subject: [PATCH] Revert "libata: Implement support for sense data reporting"
-
-This reverts commit fe7173c206de63fc28475ee6ae42ff95c05692de.
-
-As implemented, ACS-4 sense reporting for ATA devices bypasses error
-diagnosis and handling in libata degrading EH behavior significantly.
-Revert the related changes for now.
-
-ATA_ID_COMMAND_SET_3/4 constants are not reverted as they're used by
-later changes.
-
-Signed-off-by: Tejun Heo
-Cc: Hannes Reinecke
-Cc: stable@vger.kernel.org #v4.1+
----
- drivers/ata/libata-core.c | 20 +----------
- drivers/ata/libata-eh.c | 86 ++---------------------------------------------
- include/linux/ata.h | 16 ---------
- 3 files changed, 4 insertions(+), 118 deletions(-)
-
-diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index 426bc12..19bcb80 100644
---- a/drivers/ata/libata-core.c
-+++ b/drivers/ata/libata-core.c
-@@ -2147,24 +2147,6 @@ static int ata_dev_config_ncq(struct ata_device *dev,
- return 0;
- }
-
--static void ata_dev_config_sense_reporting(struct ata_device *dev)
--{
-- unsigned int err_mask;
--
-- if (!ata_id_has_sense_reporting(dev->id))
-- return;
--
-- if (ata_id_sense_reporting_enabled(dev->id))
-- return;
--
-- err_mask = ata_dev_set_feature(dev, SETFEATURE_SENSE_DATA, 0x1);
-- if (err_mask) {
-- ata_dev_dbg(dev,
-- "failed to enable Sense Data Reporting, Emask 0x%x\n",
-- err_mask);
-- }
--}
--
- /**
- * ata_dev_configure - Configure the specified ATA/ATAPI device
- * @dev: Target device to configure
-@@ -2387,7 +2369,7 @@ int ata_dev_configure(struct ata_device *dev)
- dev->devslp_timing[i] = sata_setting[j];
- }
- }
-- ata_dev_config_sense_reporting(dev);
-+
- dev->cdb_len = 16;
- }
-
-diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
-index af08d32..16125be 100644
---- a/drivers/ata/libata-eh.c
-+++ b/drivers/ata/libata-eh.c
-@@ -1630,70 +1630,6 @@ unsigned int atapi_eh_tur(struct ata_device *dev, u8 *r_sense_key)
- }
-
- /**
-- * ata_eh_request_sense - perform REQUEST_SENSE_DATA_EXT
-- * @dev: device to perform REQUEST_SENSE_SENSE_DATA_EXT to
-- * @sense_buf: result sense data buffer (SCSI_SENSE_BUFFERSIZE bytes long)
-- * @dfl_sense_key: default sense key to use
-- *
-- * Perform REQUEST_SENSE_DATA_EXT after the device reported CHECK
-- * SENSE. This function is EH helper.
-- *
-- * LOCKING:
-- * Kernel thread context (may sleep).
-- *
-- * RETURNS:
-- * encoded sense data on success, 0 on failure or if sense data
-- * is not available.
-- */
--static u32 ata_eh_request_sense(struct ata_queued_cmd *qc,
-- struct scsi_cmnd *cmd)
--{
-- struct ata_device *dev = qc->dev;
-- struct ata_taskfile tf;
-- unsigned int err_mask;
--
-- if (!cmd)
-- return 0;
--
-- DPRINTK("ATA request sense\n");
-- ata_dev_warn(dev, "request sense\n");
-- if (!ata_id_sense_reporting_enabled(dev->id)) {
-- ata_dev_warn(qc->dev, "sense data reporting disabled\n");
-- return 0;
-- }
-- ata_tf_init(dev, &tf);
--
-- tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
-- tf.flags |= ATA_TFLAG_LBA | ATA_TFLAG_LBA48;
-- tf.command = ATA_CMD_REQ_SENSE_DATA;
-- tf.protocol = ATA_PROT_NODATA;
--
-- err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
-- /*
-- * ACS-4 states:
-- * The device may set the SENSE DATA AVAILABLE bit to one in the
-- * STATUS field and clear the ERROR bit to zero in the STATUS field
-- * to indicate that the command returned completion without an error
-- * and the sense data described in table 306 is available.
-- *
-- * IOW the 'ATA_SENSE' bit might not be set even though valid
-- * sense data is available.
-- * So check for both.
-- */
-- if ((tf.command & ATA_SENSE) ||
-- tf.lbah != 0 || tf.lbam != 0 || tf.lbal != 0) {
-- ata_scsi_set_sense(cmd, tf.lbah, tf.lbam, tf.lbal);
-- qc->flags |= ATA_QCFLAG_SENSE_VALID;
-- ata_dev_warn(dev, "sense data %02x/%02x/%02x\n",
-- tf.lbah, tf.lbam, tf.lbal);
-- } else {
-- ata_dev_warn(dev, "request sense failed stat %02x emask %x\n",
-- tf.command, err_mask);
-- }
-- return err_mask;
--}
--
--/**
- * atapi_eh_request_sense - perform ATAPI REQUEST_SENSE
- * @dev: device to perform REQUEST_SENSE to
- * @sense_buf: result sense data buffer (SCSI_SENSE_BUFFERSIZE bytes long)
-@@ -1896,22 +1832,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
- return ATA_EH_RESET;
- }
-
-- /*
-- * Sense data reporting does not work if the
-- * device fault bit is set.
-- */
-- if ((stat & ATA_SENSE) && !(stat & ATA_DF) &&
-- !(qc->flags & ATA_QCFLAG_SENSE_VALID)) {
-- if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) {
-- tmp = ata_eh_request_sense(qc, qc->scsicmd);
-- if (tmp)
-- qc->err_mask |= tmp;
-- } else {
-- ata_dev_warn(qc->dev, "sense data available but port frozen\n");
-- }
-- }
--
-- /* Set by NCQ autosense or request sense above */
-+ /* Set by NCQ autosense */
- if (qc->flags & ATA_QCFLAG_SENSE_VALID)
- return 0;
-
-@@ -2658,15 +2579,14 @@ static void ata_eh_link_report(struct ata_link *link)
-
- #ifdef CONFIG_ATA_VERBOSE_ERROR
- if (res->command & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ |
-- ATA_SENSE | ATA_ERR)) {
-+ ATA_ERR)) {
- if (res->command & ATA_BUSY)
- ata_dev_err(qc->dev, "status: { Busy }\n");
- else
-- ata_dev_err(qc->dev, "status: { %s%s%s%s%s}\n",
-+ ata_dev_err(qc->dev, "status: { %s%s%s%s}\n",
- res->command & ATA_DRDY ? "DRDY " : "",
- res->command & ATA_DF ? "DF " : "",
- res->command & ATA_DRQ ? "DRQ " : "",
-- res->command & ATA_SENSE ? "SENSE " : "",
- res->command & ATA_ERR ? "ERR " : "");
- }
-
-diff --git a/include/linux/ata.h b/include/linux/ata.h
-index 6c78956..0e6a782 100644
---- a/include/linux/ata.h
-+++ b/include/linux/ata.h
-@@ -385,8 +385,6 @@ enum {
- SATA_SSP = 0x06, /* Software Settings Preservation */
- SATA_DEVSLP = 0x09, /* Device Sleep */
-
-- SETFEATURE_SENSE_DATA = 0xC3, /* Sense Data Reporting feature */
--
- /* feature values for SET_MAX */
- ATA_SET_MAX_ADDR = 0x00,
- ATA_SET_MAX_PASSWD = 0x01,
-@@ -710,20 +708,6 @@ static inline bool ata_id_has_read_log_d
- return id[ATA_ID_COMMAND_SET_3] & (1 << 3);
- }
-
--static inline bool ata_id_has_sense_reporting(const u16 *id)
--{
-- if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15)))
-- return false;
-- return id[ATA_ID_COMMAND_SET_3] & (1 << 6);
--}
--
--static inline bool ata_id_sense_reporting_enabled(const u16 *id)
--{
-- if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15)))
-- return false;
-- return id[ATA_ID_COMMAND_SET_4] & (1 << 6);
--}
--
- /**
- * ata_id_major_version - get ATA level of drive
- * @id: Identify data
diff --git a/kernel/kernel/files/patches/mageia/ata-Revert-libata-eh-Set-information-field-for-autosense.patch b/kernel/kernel/files/patches/mageia/ata-Revert-libata-eh-Set-information-field-for-autosense.patch
deleted file mode 100644
index f51f3667..00000000
--- a/kernel/kernel/files/patches/mageia/ata-Revert-libata-eh-Set-information-field-for-autosense.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-From fe16d4f202c59a560533a223bc6375739ee30944 Mon Sep 17 00:00:00 2001
-From: Tejun Heo
-Date: Mon, 3 Aug 2015 11:41:33 -0400
-Subject: [PATCH] Revert "libata-eh: Set 'information' field for autosense"
-
-This reverts commit a1524f226a02aa6edebd90ae0752e97cfd78b159.
-
-As implemented, ACS-4 sense reporting for ATA devices bypasses error
-diagnosis and handling in libata degrading EH behavior significantly.
-Revert the related changes for now.
-
-Signed-off-by: Tejun Heo
-Cc: Hannes Reinecke
-Cc: stable@vger.kernel.org #v4.1+
----
- drivers/ata/libata-core.c | 4 ++--
- drivers/ata/libata-eh.c | 3 ---
- drivers/ata/libata-scsi.c | 12 ------------
- drivers/ata/libata.h | 5 +----
- drivers/scsi/scsi_error.c | 31 -------------------------------
- include/scsi/scsi_eh.h | 1 -
- 6 files changed, 3 insertions(+), 53 deletions(-)
-
-diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index db5d9f7..426bc12 100644
---- a/drivers/ata/libata-core.c
-+++ b/drivers/ata/libata-core.c
-@@ -694,11 +694,11 @@ static int ata_rwcmd_protocol(struct ata_taskfile *tf, struct ata_device *dev)
- * RETURNS:
- * Block address read from @tf.
- */
--u64 ata_tf_read_block(const struct ata_taskfile *tf, struct ata_device *dev)
-+u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev)
- {
- u64 block = 0;
-
-- if (!dev || tf->flags & ATA_TFLAG_LBA) {
-+ if (tf->flags & ATA_TFLAG_LBA) {
- if (tf->flags & ATA_TFLAG_LBA48) {
- block |= (u64)tf->hob_lbah << 40;
- block |= (u64)tf->hob_lbam << 32;
-diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
-index 7465031..af08d32 100644
---- a/drivers/ata/libata-eh.c
-+++ b/drivers/ata/libata-eh.c
-@@ -1864,7 +1864,6 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
- ata_dev_dbg(dev, "NCQ Autosense %02x/%02x/%02x\n",
- sense_key, asc, ascq);
- ata_scsi_set_sense(qc->scsicmd, sense_key, asc, ascq);
-- ata_scsi_set_sense_information(qc->scsicmd, &qc->result_tf);
- qc->flags |= ATA_QCFLAG_SENSE_VALID;
- }
-
-@@ -1907,8 +1906,6 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
- tmp = ata_eh_request_sense(qc, qc->scsicmd);
- if (tmp)
- qc->err_mask |= tmp;
-- else
-- ata_scsi_set_sense_information(qc->scsicmd, tf);
- } else {
- ata_dev_warn(qc->dev, "sense data available but port frozen\n");
- }
-diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
-index 641a61a..e1ecd2a 100644
---- a/drivers/ata/libata-scsi.c
-+++ b/drivers/ata/libata-scsi.c
-@@ -280,18 +280,6 @@ void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq)
- scsi_build_sense_buffer(0, cmd->sense_buffer, sk, asc, ascq);
- }
-
--void ata_scsi_set_sense_information(struct scsi_cmnd *cmd,
-- const struct ata_taskfile *tf)
--{
-- u64 information;
--
-- if (!cmd)
-- return;
--
-- information = ata_tf_read_block(tf, NULL);
-- scsi_set_sense_information(cmd->sense_buffer, information);
--}
--
- static ssize_t
- ata_scsi_em_message_store(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
-diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
-index a998a17..8cfdd96 100644
---- a/drivers/ata/libata.h
-+++ b/drivers/ata/libata.h
-@@ -67,8 +67,7 @@ extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag);
- extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
- u64 block, u32 n_block, unsigned int tf_flags,
- unsigned int tag);
--extern u64 ata_tf_read_block(const struct ata_taskfile *tf,
-- struct ata_device *dev);
-+extern u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev);
- extern unsigned ata_exec_internal(struct ata_device *dev,
- struct ata_taskfile *tf, const u8 *cdb,
- int dma_dir, void *buf, unsigned int buflen,
-@@ -139,8 +138,6 @@ extern int ata_scsi_add_hosts(struct ata_host *host,
- extern void ata_scsi_scan_host(struct ata_port *ap, int sync);
- extern int ata_scsi_offline_dev(struct ata_device *dev);
- extern void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq);
--extern void ata_scsi_set_sense_information(struct scsi_cmnd *cmd,
-- const struct ata_taskfile *tf);
- extern void ata_scsi_media_change_notify(struct ata_device *dev);
- extern void ata_scsi_hotplug(struct work_struct *work);
- extern void ata_schedule_scsi_eh(struct Scsi_Host *shost);
-diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
-index 106884a..b79bbea 100644
---- a/drivers/scsi/scsi_error.c
-+++ b/drivers/scsi/scsi_error.c
-@@ -26,7 +26,6 @@
- #include
- #include
- #include
--#include
-
- #include
- #include
-@@ -2523,33 +2522,3 @@ void scsi_build_sense_buffer(int desc, u8 *buf, u8 key, u8 asc, u8 ascq)
- }
- }
- EXPORT_SYMBOL(scsi_build_sense_buffer);
--
--/**
-- * scsi_set_sense_information - set the information field in a
-- * formatted sense data buffer
-- * @buf: Where to build sense data
-- * @info: 64-bit information value to be set
-- *
-- **/
--void scsi_set_sense_information(u8 *buf, u64 info)
--{
-- if ((buf[0] & 0x7f) == 0x72) {
-- u8 *ucp, len;
--
-- len = buf[7];
-- ucp = (char *)scsi_sense_desc_find(buf, len + 8, 0);
-- if (!ucp) {
-- buf[7] = len + 0xa;
-- ucp = buf + 8 + len;
-- }
-- ucp[0] = 0;
-- ucp[1] = 0xa;
-- ucp[2] = 0x80; /* Valid bit */
-- ucp[3] = 0;
-- put_unaligned_be64(info, &ucp[4]);
-- } else if ((buf[0] & 0x7f) == 0x70) {
-- buf[0] |= 0x80;
-- put_unaligned_be64(info, &buf[3]);
-- }
--}
--EXPORT_SYMBOL(scsi_set_sense_information);
-diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
-index 4942710..8d1d7fa 100644
---- a/include/scsi/scsi_eh.h
-+++ b/include/scsi/scsi_eh.h
-@@ -28,7 +28,6 @@ extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len,
- u64 * info_out);
-
- extern void scsi_build_sense_buffer(int desc, u8 *buf, u8 key, u8 asc, u8 ascq);
--extern void scsi_set_sense_information(u8 *buf, u64 info);
-
- extern int scsi_ioctl_reset(struct scsi_device *, int __user *);
-
---
-2.4.5
-
diff --git a/kernel/kernel/files/patches/mageia/ata-jmicron-disable-broken-async_suspend.patch b/kernel/kernel/files/patches/mageia/ata-jmicron-disable-broken-async_suspend.patch
deleted file mode 100644
index f0787f4f..00000000
--- a/kernel/kernel/files/patches/mageia/ata-jmicron-disable-broken-async_suspend.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-
-Fix broken async_suspend
-
-https://bugzilla.kernel.org/show_bug.cgi?id=81551
-
---- a/drivers/pci/quirks.c
-+++ a/drivers/pci/quirks.c
-@@ -29,6 +29,21 @@
- #include "pci.h"
-
- /*
-+ * For JMicron chips, we need to disable the async_suspend method, otherwise
-+ * they will hit the power-on issue when doing device resume, add one quick
-+ * solution to disable the async_suspend method.
-+ */
-+static void pci_async_suspend_fixup(struct pci_dev *pdev)
-+{
-+ /*
-+ * disabling the async_suspend method for JMicron chips to
-+ * avoid device resuming issue.
-+ */
-+ device_disable_async_suspend(&pdev->dev);
-+}
-+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, pci_async_suspend_fixup);
-+
-+/*
- * Decoding should be disabled for a PCI device during BAR sizing to avoid
- * conflict. But doing so may cause problems on host bridge and perhaps other
- * key system devices. For devices that need to have mmio decoding always-on,
diff --git a/kernel/kernel/files/patches/mageia/ata-revert-Disabling-the-async-PM-for-JMicron-chip-363-361.patch b/kernel/kernel/files/patches/mageia/ata-revert-Disabling-the-async-PM-for-JMicron-chip-363-361.patch
deleted file mode 100644
index 687066be..00000000
--- a/kernel/kernel/files/patches/mageia/ata-revert-Disabling-the-async-PM-for-JMicron-chip-363-361.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-
-This patch reverts:
-
-From e6b7e41cdd8cae0591e04d9519b65470110e2d44 Mon Sep 17 00:00:00 2001
-From: Chuansheng Liu
-Date: Mon, 1 Sep 2014 08:38:03 +0800
-Subject: [PATCH] ata: Disabling the async PM for JMicron chip 363/361
-
-
-in favour of the pci quirks based patch:
-https://bugzilla.kernel.org/show_bug.cgi?id=81551
-
-Signed-off-by: Thomas Backlund
-
----
- drivers/ata/ahci.c | 12 ------------
- drivers/ata/pata_jmicron.c | 12 ------------
- 2 files changed, 24 deletions(-)
-
-diff --git b/drivers/ata/ahci.c a/drivers/ata/ahci.c
-index f7da21b..bca3d64 100644
---- b/drivers/ata/ahci.c
-+++ a/drivers/ata/ahci.c
-@@ -1337,18 +1337,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
- else if (pdev->vendor == 0x1c44 && pdev->device == 0x8000)
- ahci_pci_bar = AHCI_PCI_BAR_ENMOTUS;
-
-- /*
-- * The JMicron chip 361/363 contains one SATA controller and one
-- * PATA controller,for powering on these both controllers, we must
-- * follow the sequence one by one, otherwise one of them can not be
-- * powered on successfully, so here we disable the async suspend
-- * method for these chips.
-- */
-- if (pdev->vendor == PCI_VENDOR_ID_JMICRON &&
-- (pdev->device == PCI_DEVICE_ID_JMICRON_JMB363 ||
-- pdev->device == PCI_DEVICE_ID_JMICRON_JMB361))
-- device_disable_async_suspend(&pdev->dev);
--
- /* acquire resources */
- rc = pcim_enable_device(pdev);
- if (rc)
-diff --git b/drivers/ata/pata_jmicron.c a/drivers/ata/pata_jmicron.c
-index 47e418b..4d1a5d2 100644
---- b/drivers/ata/pata_jmicron.c
-+++ a/drivers/ata/pata_jmicron.c
-@@ -143,18 +143,6 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i
- };
- const struct ata_port_info *ppi[] = { &info, NULL };
-
-- /*
-- * The JMicron chip 361/363 contains one SATA controller and one
-- * PATA controller,for powering on these both controllers, we must
-- * follow the sequence one by one, otherwise one of them can not be
-- * powered on successfully, so here we disable the async suspend
-- * method for these chips.
-- */
-- if (pdev->vendor == PCI_VENDOR_ID_JMICRON &&
-- (pdev->device == PCI_DEVICE_ID_JMICRON_JMB363 ||
-- pdev->device == PCI_DEVICE_ID_JMICRON_JMB361))
-- device_disable_async_suspend(&pdev->dev);
--
- return ata_pci_bmdma_init_one(pdev, ppi, &jmicron_sht, NULL, 0);
- }
-
---
-1.8.5.6
-
diff --git a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Avoid-TP3-on-CHV.patch b/kernel/kernel/files/patches/mageia/gpu-drm-i915-Avoid-TP3-on-CHV.patch
deleted file mode 100644
index 8fb32d99..00000000
--- a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Avoid-TP3-on-CHV.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From ed63baaf849e91c84ac3e042b1fd6a0af07c16f3 Mon Sep 17 00:00:00 2001
-From: "Thulasimani,Sivakumar"
-Date: Tue, 18 Aug 2015 15:30:37 +0530
-Subject: [PATCH] drm/i915: Avoid TP3 on CHV
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This patch removes TP3 support on CHV since there is no support
-for HBR2 on this platform.
-
-v2: rename the function to indicate it checks source rates (Jani)
-v3: update comment to indicate TP3 dependency on HBR2 supported
- hardware (Jani)
-
-Cc: stable@vger.kernel.org # v4.1+
-Reviewed-by: Ville Syrjälä
-Signed-off-by: Sivakumar Thulasimani
-[Jani: fixed a couple of checkpatch warnings.]
-Signed-off-by: Jani Nikula
-
-diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
-index 7ad0e0b..1df0e1f 100644
---- a/drivers/gpu/drm/i915/intel_dp.c
-+++ b/drivers/gpu/drm/i915/intel_dp.c
-@@ -1166,6 +1166,19 @@ intel_dp_sink_rates(struct intel_dp *intel_dp, const int **sink_rates)
- return (intel_dp_max_link_bw(intel_dp) >> 3) + 1;
- }
-
-+static bool intel_dp_source_supports_hbr2(struct drm_device *dev)
-+{
-+ /* WaDisableHBR2:skl */
-+ if (IS_SKYLAKE(dev) && INTEL_REVID(dev) <= SKL_REVID_B0)
-+ return false;
-+
-+ if ((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) || IS_BROADWELL(dev) ||
-+ (INTEL_INFO(dev)->gen >= 9))
-+ return true;
-+ else
-+ return false;
-+}
-+
- static int
- intel_dp_source_rates(struct drm_device *dev, const int **source_rates)
- {
-@@ -1176,12 +1189,8 @@ intel_dp_source_rates(struct drm_device *dev, const int **source_rates)
-
- *source_rates = default_rates;
-
-- /* WaDisableHBR2:skl */
-- if (IS_SKYLAKE(dev) && INTEL_REVID(dev) <= SKL_REVID_B0)
-- return (DP_LINK_BW_2_7 >> 3) + 1;
--
-- if ((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) || IS_BROADWELL(dev) ||
-- (INTEL_INFO(dev)->gen >= 9))
-+ /* This depends on the fact that 5.4 is last value in the array */
-+ if (intel_dp_source_supports_hbr2(dev))
- return (DP_LINK_BW_5_4 >> 3) + 1;
- else
- return (DP_LINK_BW_2_7 >> 3) + 1;
-@@ -3936,10 +3945,15 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
- }
- }
-
-- /* Training Pattern 3 support, both source and sink */
-+ /* Training Pattern 3 support, Intel platforms that support HBR2 alone
-+ * have support for TP3 hence that check is used along with dpcd check
-+ * to ensure TP3 can be enabled.
-+ * SKL < B0: due it's WaDisableHBR2 is the only exception where TP3 is
-+ * supported but still not enabled.
-+ */
- if (intel_dp->dpcd[DP_DPCD_REV] >= 0x12 &&
- intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED &&
-- (IS_HASWELL(dev_priv) || INTEL_INFO(dev_priv)->gen >= 8)) {
-+ intel_dp_source_supports_hbr2(dev)) {
- intel_dp->use_tps3 = true;
- DRM_DEBUG_KMS("Displayport TPS3 supported\n");
- } else
---
-2.4.5
-
diff --git a/kernel/kernel/files/patches/mageia/gpu-drm-i915-remove-HBR2-from-chv-supported-list.patch b/kernel/kernel/files/patches/mageia/gpu-drm-i915-remove-HBR2-from-chv-supported-list.patch
deleted file mode 100644
index 892f4d25..00000000
--- a/kernel/kernel/files/patches/mageia/gpu-drm-i915-remove-HBR2-from-chv-supported-list.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 5e86dfe39f54ab13fd8079ac3d6cb100318909a3 Mon Sep 17 00:00:00 2001
-From: "Thulasimani,Sivakumar"
-Date: Tue, 18 Aug 2015 11:07:57 +0530
-Subject: [PATCH] drm/i915: remove HBR2 from chv supported list
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This patch removes 5.4Gbps from supported link rate for CHV since
-it is not supported in it.
-
-v2: change the ordering for better readability (Ville)
-
-Cc: stable@vger.kernel.org # v4.1+
-Reviewed-by: Ville Syrjälä
-Signed-off-by: Sivakumar Thulasimani
-Signed-off-by: Jani Nikula
----
- drivers/gpu/drm/i915/intel_dp.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
-index 6c8bf34..7ad0e0b 100644
---- a/drivers/gpu/drm/i915/intel_dp.c
-+++ b/drivers/gpu/drm/i915/intel_dp.c
-@@ -1176,11 +1176,12 @@ intel_dp_source_rates(struct drm_device *dev, const int **source_rates)
-
- *source_rates = default_rates;
-
-+ /* WaDisableHBR2:skl */
- if (IS_SKYLAKE(dev) && INTEL_REVID(dev) <= SKL_REVID_B0)
-- /* WaDisableHBR2:skl */
- return (DP_LINK_BW_2_7 >> 3) + 1;
-- else if (INTEL_INFO(dev)->gen >= 8 ||
-- (IS_HASWELL(dev) && !IS_HSW_ULX(dev)))
-+
-+ if ((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) || IS_BROADWELL(dev) ||
-+ (INTEL_INFO(dev)->gen >= 9))
- return (DP_LINK_BW_5_4 >> 3) + 1;
- else
- return (DP_LINK_BW_2_7 >> 3) + 1;
---
-2.4.5
-
diff --git a/kernel/kernel/files/patches/mageia/scsi-Fix-NULL-pointer-dereference-in-RTPM-of-block-layer.patch b/kernel/kernel/files/patches/mageia/scsi-Fix-NULL-pointer-dereference-in-RTPM-of-block-layer.patch
new file mode 100644
index 00000000..49928d17
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/scsi-Fix-NULL-pointer-dereference-in-RTPM-of-block-layer.patch
@@ -0,0 +1,74 @@
+SCSI: Fix NULL pointer dereference in RTPM of block layer
+
+The routines in scsi_pm.c assume that if a runtime-PM callback is
+invoked for a SCSI device, it can only mean that the device's driver
+has asked the block layer to handle the runtime power management (by
+calling blk_pm_runtime_init(), which among other things sets q->dev).
+
+However, this assumption turns out to be wrong for things like the ses
+driver. Normally ses devices are not allowed to do runtime PM, but
+userspace can override this setting. If this happens, the kernel gets
+a NULL pointer dereference when blk_post_runtime_resume() tries to use
+the uninitialized q->dev pointer.
+
+This patch fixes the problem by checking q->dev in block layer before
+handle runtime PM. Since ses doesn't define any PM callbacks and call
+blk_pm_runtime_init(), the crash won't occur.
+
+This fixes Bugzilla #101371.
+https://bugzilla.kernel.org/show_bug.cgi?id=101371
+
+Signed-off-by: Ken Xue
+Acked-by: Alan Stern
+Cc: stable@vger.kernel.org
+
+---
+ block/blk-core.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/block/blk-core.c b/block/blk-core.c
+index 60912e9..a07ab18 100644
+--- a/block/blk-core.c
++++ b/block/blk-core.c
+@@ -3280,6 +3280,9 @@ int blk_pre_runtime_suspend(struct request_queue *q)
+ {
+ int ret = 0;
+
++ if (!q->dev)
++ return ret;
++
+ spin_lock_irq(q->queue_lock);
+ if (q->nr_pending) {
+ ret = -EBUSY;
+@@ -3307,6 +3310,9 @@ EXPORT_SYMBOL(blk_pre_runtime_suspend);
+ */
+ void blk_post_runtime_suspend(struct request_queue *q, int err)
+ {
++ if (!q->dev)
++ return;
++
+ spin_lock_irq(q->queue_lock);
+ if (!err) {
+ q->rpm_status = RPM_SUSPENDED;
+@@ -3331,6 +3337,9 @@ EXPORT_SYMBOL(blk_post_runtime_suspend);
+ */
+ void blk_pre_runtime_resume(struct request_queue *q)
+ {
++ if (!q->dev)
++ return;
++
+ spin_lock_irq(q->queue_lock);
+ q->rpm_status = RPM_RESUMING;
+ spin_unlock_irq(q->queue_lock);
+@@ -3353,6 +3362,9 @@ EXPORT_SYMBOL(blk_pre_runtime_resume);
+ */
+ void blk_post_runtime_resume(struct request_queue *q, int err)
+ {
++ if (!q->dev)
++ return;
++
+ spin_lock_irq(q->queue_lock);
+ if (!err) {
+ q->rpm_status = RPM_ACTIVE;
+--
+1.9.1
diff --git a/kernel/kernel/files/patches/mageia/scsi-Revert-SCSI-Fix-NULL-pointer-dereference-in-runtime-PM.patch b/kernel/kernel/files/patches/mageia/scsi-Revert-SCSI-Fix-NULL-pointer-dereference-in-runtime-PM.patch
new file mode 100644
index 00000000..dc20be03
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/scsi-Revert-SCSI-Fix-NULL-pointer-dereference-in-runtime-PM.patch
@@ -0,0 +1,64 @@
+Revert "SCSI: Fix NULL pointer dereference in runtime PM"
+
+This reverts commit 49718f0fb8c9 ("SCSI: Fix NULL pointer dereference in
+runtime PM")
+
+The old commit may lead to a issue that blk_{pre|post}_runtime_suspend and
+blk_{pre|post}_runtime_resume can not be called in pairs.
+
+Take sr device as example, when sr device goes to runtime suspend,
+blk_{pre|post}_runtime_suspend will be called since sr device defined
+pm->runtime_suspend. But blk_{pre|post}_runtime_resume will not be called
+since sr device doesn't have pm->runtime_resume. Then sr device can not
+resume correctly anymore.
+
+Signed-off-by: Ken Xue
+Acked-by: Alan Stern
+Cc: stable@vger.kernel.org
+
+---
+ drivers/scsi/scsi_pm.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
+index e4b7998..459abe1 100644
+--- a/drivers/scsi/scsi_pm.c
++++ b/drivers/scsi/scsi_pm.c
+@@ -219,13 +219,13 @@ static int sdev_runtime_suspend(struct device *dev)
+ struct scsi_device *sdev = to_scsi_device(dev);
+ int err = 0;
+
+- if (pm && pm->runtime_suspend) {
+- err = blk_pre_runtime_suspend(sdev->request_queue);
+- if (err)
+- return err;
++ err = blk_pre_runtime_suspend(sdev->request_queue);
++ if (err)
++ return err;
++ if (pm && pm->runtime_suspend)
+ err = pm->runtime_suspend(dev);
+- blk_post_runtime_suspend(sdev->request_queue, err);
+- }
++ blk_post_runtime_suspend(sdev->request_queue, err);
++
+ return err;
+ }
+
+@@ -248,11 +248,11 @@ static int sdev_runtime_resume(struct device *dev)
+ const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+ int err = 0;
+
+- if (pm && pm->runtime_resume) {
+- blk_pre_runtime_resume(sdev->request_queue);
++ blk_pre_runtime_resume(sdev->request_queue);
++ if (pm && pm->runtime_resume)
+ err = pm->runtime_resume(dev);
+- blk_post_runtime_resume(sdev->request_queue, err);
+- }
++ blk_post_runtime_resume(sdev->request_queue, err);
++
+ return err;
+ }
+
+--
+1.9.1
diff --git a/kernel/kernel/files/patches/mageia/series b/kernel/kernel/files/patches/mageia/series
index f1c2fe31..b96a67db 100644
--- a/kernel/kernel/files/patches/mageia/series
+++ b/kernel/kernel/files/patches/mageia/series
@@ -14,33 +14,72 @@
###
### Stable Queue
###
-stable-ipc-sem-fix-use-after-free-on-ipc_rmid-after-a-task-using-same-semaphore-set-exits.patch
-stable-ipc-sem.c-update-correct-memory-barriers.patch
-stable-mm-hwpoison-fix-page-refcount-of-unknown-non-lru-page.patch
-stable-mm-hwpoison-fix-fail-isolate-hugetlbfs-page-w-refcount-held.patch
-stable-clk-pxa-pxa3xx-fix-cken-register-access.patch
-stable-xen-blkfront-don-t-add-indirect-pages-to-list-when.patch
-stable-xen-blkback-replace-work_pending-with-work_busy-in-purge_persistent_gnt.patch
-stable-rsi-fix-failure-to-load-firmware-after-memory-leak-fix-and-fix-the-leak.patch
-stable-perf-fix-fasync-handling-on-inherited-events.patch
-stable-perf-fix-running-time-accounting.patch
-stable-perf-fix-double-free-of-the-aux-buffer.patch
-stable-perf-fix-perf_event_ioc_period-migration-race.patch
-stable-iwlwifi-pcie-fix-prepare-card-flow.patch
-stable-rtlwifi-rtl8723be-add-module-parameter-for-msi-interrupts.patch
-stable-rtlwifi-fix-null-dereference-when-pci-driver-used-as-an-ap.patch
-stable-x86-xen-build-xen-pv-apic-driver-for-domu-as-well.patch
-stable-xen-xenbus-don-t-leak-memory-when-unmapping-the-ring-on-hvm-backend.patch
-stable-dm-thin-metadata-delete-btrees-when-releasing-metadata-snapshot.patch
-stable-localmodconfig-use-kbuild-files-too.patch
-stable-edac-ppc4xx-access-mci-csrows-array-elements-properly.patch
-stable-hid-hid-input-fix-accessing-freed-memory-during-device-disconnect.patch
-stable-hid-uclogic-fix-limit-in-uclogic_tablet_enable.patch
-stable-drm-radeon-add-new-oland-pci-id.patch
-stable-drm-vmwgfx-fix-execbuf-locking-issues.patch
-
-# DaveM
-stable-net_41.mbox.patch
+stable-x86-ldt-make-modify_ldt-synchronous.patch
+stable-x86-ldt-correct-ldt-access-in-single-stepping-logic.patch
+stable-x86-ldt-correct-fpu-emulation-access-to-ldt.patch
+stable-x86-ldt-further-fix-fpu-emulation.patch
+stable-drm-radeon-don-t-link-train-displayport-on-hpd-until-we-get-the-dpcd.patch
+stable-drm-i915-apply-the-pci_d0-d3-hibernation-workaround-everywhere-on-pre-gen6.patch
+stable-drm-i915-check-dp-link-status-on-long-hpd-too.patch
+stable-drm-radeon-atom-send-out-the-full-aux-address.patch
+stable-drm-radeon-native-send-out-the-full-aux-address.patch
+stable-drm-radeon-fix-hdmi-quantization_range-for-pre-dce5-asics.patch
+stable-drm-i915-preserve-ssc-earlier.patch
+stable-drm-qxl-validate-monitors-config-modes.patch
+stable-drm-i915-allow-dsi-dual-link-to-be-configured-on-any-pipe.patch
+stable-drm-i915-always-mark-the-object-as-dirty-when-used-by-the-gpu.patch
+stable-drm-i915-limit-the-number-of-loops-for-reading-a-split-64bit-register.patch
+stable-s390-sclp-fix-compile-error.patch
+stable-s390-setup-fix-novx-parameter.patch
+stable-iio-bmg160-iio_buffer-and-iio_triggered_buffer-are-required.patch
+stable-iio-event-remove-negative-error-code-from-iio_event_poll.patch
+stable-iio-industrialio-buffer-fix-iio_buffer_poll-return-value.patch
+stable-iio-adis16400-fix-adis16448-gyroscope-scale.patch
+stable-iio-add-inverse-unit-conversion-macros.patch
+stable-iio-adis16480-fix-scale-factors.patch
+stable-sched-fix-cpu_active_mask-cpu_online_mask-race.patch
+stable-staging-comedi-adl_pci7x3x-fix-digital-output-on-pci-7230.patch
+stable-staging-comedi-usbduxsigma-don-t-clobber-ai_timer-in-command-test.patch
+stable-staging-comedi-usbduxsigma-don-t-clobber-ao_timer-in-command-test.patch
+stable-pm-clk-don-t-return-int-on-__pm_clk_enable.patch
+stable-clk-rockchip-rk3288-add-clk_set_rate_parent-to-sclk_mac.patch
+stable-clk-exynos4-fix-wrong-clock-for-exynos4x12-adc.patch
+stable-clk-s5pv210-add-missing-call-to.patch
+stable-clk-pistachio-fix-override-of-clk-pll-settings-from-boot-loader.patch
+stable-clk-pistachio-correct-critical-clock-list.patch
+stable-clk-versatile-off-by-one-in-clk_sp810_timerclken_of_get.patch
+stable-clk-pxa-fix-core-frequency-reporting-unit.patch
+stable-clk-qcom-set-clk_set_rate_parent-on-ce1-clocks.patch
+stable-clk-qcom-fix-msm8916-prng-clock-enable-bit.patch
+stable-pci-fix-ti816x-class-code-quirk.patch
+stable-pci-add-dev_flags-bit-to-access-vpd-through-function-0.patch
+stable-pci-add-vpd-function-0-quirk-for-intel-ethernet-devices.patch
+stable-pci-disable-async-suspend-resume-for-jmicron-multi-function-sata-ahci.patch
+stable-spi-bcm2835-set-up-spi-mode-before-asserting-cs-gpio.patch
+stable-spi-fix-regression-in-spi-bitbang-txrx.h.patch
+stable-spi-sh-msiof-fix-fifo-size-to-64-word-from-256-word.patch
+stable-spi-img-spfi-check-for-timeout-error-before-proceeding.patch
+stable-spi-img-spfi-fix-multiple-calls-to-request-gpio.patch
+stable-spi-img-spfi-fix-kbuild-test-robot-warning.patch
+stable-spi-dw-allow-interface-drivers-to-limit-data-i-o-to-word-sizes.patch
+stable-usb-symbolserial-use-usb_get_serial_port_data.patch
+stable-usb-qcserial-add-hp-lt4111-lte-ev-do-hspa-gobi-4g-module.patch
+stable-usb-ftdi_sio-added-custom-pid-for-customware-products.patch
+stable-usb-pl2303-fix-baud-rate-divisor-calculations.patch
+stable-libxfs-readahead-of-dir3-data-blocks-should-use-the-read-verifier.patch
+stable-xfs-fix-xfs_attr_leafblock-definition.patch
+stable-xfs-fix-file-type-directory-corruption-for-btree-directories.patch
+stable-usb-gadget-m66592-udc-forever-loop-in-set_feature.patch
+stable-doc-usb-gadget-testing-using-the-updated-testusb.c.patch
+stable-usb-dwc3-ep0-fix-mem-corruption-on-out-transfers-of-more-than-512-bytes.patch
+stable-usb-gadget-f_uac2-finalize-wmaxpacketsize-according-to-bandwidth.patch
+stable-usb-host-ehci-sys-delete-useless-bus_to_hcd-conversion.patch
+stable-tty-serial-men_z135_uart.c-fix-race-between-irq-and-set_termios.patch
+stable-asoc-rt5640-fix-line-out-no-sound-issue.patch
+stable-asoc-samsung-remove-redundant-arndale_audio_remove.patch
+stable-asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch
+stable-asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch
+stable-asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch
###
### Arch x86
@@ -65,15 +104,6 @@ x86-increase-default-minimum-vmalloc-area-by-64MB-to-192MB.patch
# slows down boot
Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch
-# wrong optimization
-Revert-sched-x86_64-Don-t-save-flags-on-context-swit.patch
-
-# fix unbootable systems
-x86-apic-Fix-fallout-from-x2apic-cleanup.patch
-
-# fixes powertop
-x86-idle-Restore-trace_cpu_idle-to-mwait_idle-calls.patch
-
###
### Core
###
@@ -148,21 +178,13 @@ block-floppy-disable-pnp-modalias.patch
# prefer ata over ide drivers
ata-prefer-ata-drivers-over-ide-drivers-when-both-are-built.patch
-# korg #81551
-ata-revert-Disabling-the-async-PM-for-JMicron-chip-363-361.patch
-ata-jmicron-disable-broken-async_suspend.patch
-
# Nice SSD speedup
block-Make-CFQ-default-to-IOPS-mode-on-SSDs.patch
block-cfq-iosched-fix-the-setting-of-IOPS-mode-on-SSDs.patch
-# libata eh breakage
-ata-Revert-libata-eh-Set-information-field-for-autosense.patch
-ata-Revert-libata-Implement-support-for-sense-data-repor.patch
-ata-Revert-libata-Implement-NCQ-autosense.patch
-
-# ses driver crash
-SCSI-Fix-NULL-pointer-dereference-in-runtime-PM.patch
+# properly fix null pointer deref introduced in 4.1.7
+scsi-Revert-SCSI-Fix-NULL-pointer-dereference-in-runtime-PM.patch
+scsi-Fix-NULL-pointer-dereference-in-RTPM-of-block-layer.patch
###
### File-system
@@ -208,10 +230,6 @@ gpu-drm-mach64-linux-3.14-buildfix.patch
gpu-drm-mach64-3.17-buildfix.patch
gpu-drm-mach64-3.18-buildfix.patch
-# i915
-gpu-drm-i915-remove-HBR2-from-chv-supported-list.patch
-gpu-drm-i915-Avoid-TP3-on-CHV.patch
-
###
### Hardware Monitoring
###
@@ -222,6 +240,9 @@ gpu-drm-i915-Avoid-TP3-on-CHV.patch
input-i8042-quirks-for-Fujitsu-Lifebook-A544-and-Lif.patch
+# fixes systemd-logind killing itself
+Input-evdev-do-not-report-errors-form-flush.patch
+
###
### idle
###
diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch b/kernel/kernel/files/patches/mageia/stable-asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch
new file mode 100644
index 00000000..9fdd46c7
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch
@@ -0,0 +1,31 @@
+From 9d8352864907f0ad76124c5b28f65b5a382d7d7c Mon Sep 17 00:00:00 2001
+From: Axel Lin
+Date: Fri, 14 Aug 2015 17:54:07 +0800
+Subject: ASoC: adav80x: Remove .read_flag_mask setting from adav80x_regmap_config
+
+From: Axel Lin
+
+commit 9d8352864907f0ad76124c5b28f65b5a382d7d7c upstream.
+
+Don't set .read_flag_mask for adav803, it's for adav801 only.
+
+Fixes: 0c2d69645628 ("ASoC: adav80x: Split SPI and I2C code into different modules")
+Signed-off-by: Axel Lin
+Acked-by: Lars-Peter Clausen
+Signed-off-by: Mark Brown
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ sound/soc/codecs/adav80x.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/sound/soc/codecs/adav80x.c
++++ b/sound/soc/codecs/adav80x.c
+@@ -864,7 +864,6 @@ const struct regmap_config adav80x_regma
+ .val_bits = 8,
+ .pad_bits = 1,
+ .reg_bits = 7,
+- .read_flag_mask = 0x01,
+
+ .max_register = ADAV80X_PLL_OUTE,
+
diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch b/kernel/kernel/files/patches/mageia/stable-asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch
new file mode 100644
index 00000000..49961f20
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch
@@ -0,0 +1,33 @@
+From 1cf5a330c05ae37a0a98ac7c9800a6f50d5579ec Mon Sep 17 00:00:00 2001
+From: Nikesh Oswal
+Date: Wed, 19 Aug 2015 16:02:24 +0100
+Subject: ASoC: arizona: Fix gain settings of FLL in free-run mode
+
+From: Nikesh Oswal
+
+commit 1cf5a330c05ae37a0a98ac7c9800a6f50d5579ec upstream.
+
+The wrong register was used to set the gain of ref loop, when changing
+the FLL output on an active FLL. This patch corrects the offset of the
+gain register.
+
+Signed-off-by: Nikesh Oswal
+Signed-off-by: Charles Keepax
+Signed-off-by: Mark Brown
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ sound/soc/codecs/arizona.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/arizona.c
++++ b/sound/soc/codecs/arizona.c
+@@ -1912,7 +1912,7 @@ static int arizona_enable_fll(struct ari
+
+ if (already_enabled) {
+ /* Facilitate smooth refclk across the transition */
+- regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x7,
++ regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x9,
+ ARIZONA_FLL1_GAIN_MASK, 0);
+ regmap_update_bits_async(fll->arizona->regmap, fll->base + 1,
+ ARIZONA_FLL1_FREERUN,
diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch b/kernel/kernel/files/patches/mageia/stable-asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch
new file mode 100644
index 00000000..1ae728a8
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch
@@ -0,0 +1,141 @@
+From 0e7659712836ca59b4735bc5cc94de38698a5e01 Mon Sep 17 00:00:00 2001
+From: Charles Keepax
+Date: Tue, 25 Aug 2015 12:43:48 +0100
+Subject: ASoC: arizona: Poll for FLL clock OK rather than use interrupts
+
+From: Charles Keepax
+
+commit 0e7659712836ca59b4735bc5cc94de38698a5e01 upstream.
+
+The extcon driver takes the DAPM mutex from within the interrupt thread
+in several places, which makes it possible to get into a situation where
+the interrupt thread is blocked waiting on the DAPM mutex whilst a DAPM
+sequence is running which is attempting to configure the FLL. In this
+case the FLL completion can't be completed as as the IRQ handler is
+ONE_SHOT, which cause the FLL lock to use the full time out (250mS) and
+report that the process timed out.
+
+It is not really practical to make the extcon driver not take the DAPM
+mutex from within the interrupt thread, at least not without extensive
+modification. So this patch fixes the issue by switching the wait for
+the FLL lock to polling. A few fast polls are done first as the FLL
+should lock quickly for a good quality reference clock, (indeed it hits
+on the first poll on my system) and it will poll every 20mS after that
+until it times out.
+
+Signed-off-by: Charles Keepax
+Signed-off-by: Mark Brown
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ sound/soc/codecs/arizona.c | 47 ++++++++++++++++++---------------------------
+ sound/soc/codecs/arizona.h | 1
+ 2 files changed, 19 insertions(+), 29 deletions(-)
+
+--- a/sound/soc/codecs/arizona.c
++++ b/sound/soc/codecs/arizona.c
+@@ -1610,17 +1610,6 @@ int arizona_init_dai(struct arizona_priv
+ }
+ EXPORT_SYMBOL_GPL(arizona_init_dai);
+
+-static irqreturn_t arizona_fll_clock_ok(int irq, void *data)
+-{
+- struct arizona_fll *fll = data;
+-
+- arizona_fll_dbg(fll, "clock OK\n");
+-
+- complete(&fll->ok);
+-
+- return IRQ_HANDLED;
+-}
+-
+ static struct {
+ unsigned int min;
+ unsigned int max;
+@@ -1902,10 +1891,11 @@ static int arizona_is_enabled_fll(struct
+ static int arizona_enable_fll(struct arizona_fll *fll)
+ {
+ struct arizona *arizona = fll->arizona;
+- unsigned long time_left;
+ bool use_sync = false;
+ int already_enabled = arizona_is_enabled_fll(fll);
+ struct arizona_fll_cfg cfg;
++ int i;
++ unsigned int val;
+
+ if (already_enabled < 0)
+ return already_enabled;
+@@ -1964,9 +1954,6 @@ static int arizona_enable_fll(struct ari
+ if (!already_enabled)
+ pm_runtime_get(arizona->dev);
+
+- /* Clear any pending completions */
+- try_wait_for_completion(&fll->ok);
+-
+ regmap_update_bits_async(arizona->regmap, fll->base + 1,
+ ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA);
+ if (use_sync)
+@@ -1978,10 +1965,24 @@ static int arizona_enable_fll(struct ari
+ regmap_update_bits_async(arizona->regmap, fll->base + 1,
+ ARIZONA_FLL1_FREERUN, 0);
+
+- time_left = wait_for_completion_timeout(&fll->ok,
+- msecs_to_jiffies(250));
+- if (time_left == 0)
++ arizona_fll_dbg(fll, "Waiting for FLL lock...\n");
++ val = 0;
++ for (i = 0; i < 15; i++) {
++ if (i < 5)
++ usleep_range(200, 400);
++ else
++ msleep(20);
++
++ regmap_read(arizona->regmap,
++ ARIZONA_INTERRUPT_RAW_STATUS_5,
++ &val);
++ if (val & (ARIZONA_FLL1_CLOCK_OK_STS << (fll->id - 1)))
++ break;
++ }
++ if (i == 15)
+ arizona_fll_warn(fll, "Timed out waiting for lock\n");
++ else
++ arizona_fll_dbg(fll, "FLL locked (%d polls)\n", i);
+
+ return 0;
+ }
+@@ -2066,11 +2067,8 @@ EXPORT_SYMBOL_GPL(arizona_set_fll);
+ int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq,
+ int ok_irq, struct arizona_fll *fll)
+ {
+- int ret;
+ unsigned int val;
+
+- init_completion(&fll->ok);
+-
+ fll->id = id;
+ fll->base = base;
+ fll->arizona = arizona;
+@@ -2092,13 +2090,6 @@ int arizona_init_fll(struct arizona *ari
+ snprintf(fll->clock_ok_name, sizeof(fll->clock_ok_name),
+ "FLL%d clock OK", id);
+
+- ret = arizona_request_irq(arizona, ok_irq, fll->clock_ok_name,
+- arizona_fll_clock_ok, fll);
+- if (ret != 0) {
+- dev_err(arizona->dev, "Failed to get FLL%d clock OK IRQ: %d\n",
+- id, ret);
+- }
+-
+ regmap_update_bits(arizona->regmap, fll->base + 1,
+ ARIZONA_FLL1_FREERUN, 0);
+
+--- a/sound/soc/codecs/arizona.h
++++ b/sound/soc/codecs/arizona.h
+@@ -233,7 +233,6 @@ struct arizona_fll {
+ int id;
+ unsigned int base;
+ unsigned int vco_mult;
+- struct completion ok;
+
+ unsigned int fout;
+ int sync_src;
diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-rt5640-fix-line-out-no-sound-issue.patch b/kernel/kernel/files/patches/mageia/stable-asoc-rt5640-fix-line-out-no-sound-issue.patch
new file mode 100644
index 00000000..c26be5c7
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-asoc-rt5640-fix-line-out-no-sound-issue.patch
@@ -0,0 +1,89 @@
+From 9b850ca4f1c5acd7fcbbd4b38a2d27132801a8d5 Mon Sep 17 00:00:00 2001
+From: John Lin
+Date: Tue, 11 Aug 2015 14:27:25 +0800
+Subject: ASoC: rt5640: fix line out no sound issue
+
+From: John Lin
+
+commit 9b850ca4f1c5acd7fcbbd4b38a2d27132801a8d5 upstream.
+
+The power for line out was not turned on when line out is enabled.
+So we add "LOUT amp" widget to turn on the power for line out.
+
+Signed-off-by: John Lin
+Signed-off-by: Mark Brown
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ sound/soc/codecs/rt5640.c | 40 +++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 37 insertions(+), 3 deletions(-)
+
+--- a/sound/soc/codecs/rt5640.c
++++ b/sound/soc/codecs/rt5640.c
+@@ -985,6 +985,35 @@ static int rt5640_hp_event(struct snd_so
+ return 0;
+ }
+
++static int rt5640_lout_event(struct snd_soc_dapm_widget *w,
++ struct snd_kcontrol *kcontrol, int event)
++{
++ struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
++
++ switch (event) {
++ case SND_SOC_DAPM_POST_PMU:
++ hp_amp_power_on(codec);
++ snd_soc_update_bits(codec, RT5640_PWR_ANLG1,
++ RT5640_PWR_LM, RT5640_PWR_LM);
++ snd_soc_update_bits(codec, RT5640_OUTPUT,
++ RT5640_L_MUTE | RT5640_R_MUTE, 0);
++ break;
++
++ case SND_SOC_DAPM_PRE_PMD:
++ snd_soc_update_bits(codec, RT5640_OUTPUT,
++ RT5640_L_MUTE | RT5640_R_MUTE,
++ RT5640_L_MUTE | RT5640_R_MUTE);
++ snd_soc_update_bits(codec, RT5640_PWR_ANLG1,
++ RT5640_PWR_LM, 0);
++ break;
++
++ default:
++ return 0;
++ }
++
++ return 0;
++}
++
+ static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w,
+ struct snd_kcontrol *kcontrol, int event)
+ {
+@@ -1180,13 +1209,16 @@ static const struct snd_soc_dapm_widget
+ 0, rt5640_spo_l_mix, ARRAY_SIZE(rt5640_spo_l_mix)),
+ SND_SOC_DAPM_MIXER("SPOR MIX", SND_SOC_NOPM, 0,
+ 0, rt5640_spo_r_mix, ARRAY_SIZE(rt5640_spo_r_mix)),
+- SND_SOC_DAPM_MIXER("LOUT MIX", RT5640_PWR_ANLG1, RT5640_PWR_LM_BIT, 0,
++ SND_SOC_DAPM_MIXER("LOUT MIX", SND_SOC_NOPM, 0, 0,
+ rt5640_lout_mix, ARRAY_SIZE(rt5640_lout_mix)),
+ SND_SOC_DAPM_SUPPLY_S("Improve HP Amp Drv", 1, SND_SOC_NOPM,
+ 0, 0, rt5640_hp_power_event, SND_SOC_DAPM_POST_PMU),
+ SND_SOC_DAPM_PGA_S("HP Amp", 1, SND_SOC_NOPM, 0, 0,
+ rt5640_hp_event,
+ SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
++ SND_SOC_DAPM_PGA_S("LOUT amp", 1, SND_SOC_NOPM, 0, 0,
++ rt5640_lout_event,
++ SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
+ SND_SOC_DAPM_SUPPLY("HP L Amp", RT5640_PWR_ANLG1,
+ RT5640_PWR_HP_L_BIT, 0, NULL, 0),
+ SND_SOC_DAPM_SUPPLY("HP R Amp", RT5640_PWR_ANLG1,
+@@ -1501,8 +1533,10 @@ static const struct snd_soc_dapm_route r
+ {"HP R Playback", "Switch", "HP Amp"},
+ {"HPOL", NULL, "HP L Playback"},
+ {"HPOR", NULL, "HP R Playback"},
+- {"LOUTL", NULL, "LOUT MIX"},
+- {"LOUTR", NULL, "LOUT MIX"},
++
++ {"LOUT amp", NULL, "LOUT MIX"},
++ {"LOUTL", NULL, "LOUT amp"},
++ {"LOUTR", NULL, "LOUT amp"},
+ };
+
+ static const struct snd_soc_dapm_route rt5640_specific_dapm_routes[] = {
diff --git a/kernel/kernel/files/patches/mageia/stable-asoc-samsung-remove-redundant-arndale_audio_remove.patch b/kernel/kernel/files/patches/mageia/stable-asoc-samsung-remove-redundant-arndale_audio_remove.patch
new file mode 100644
index 00000000..ea815142
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-asoc-samsung-remove-redundant-arndale_audio_remove.patch
@@ -0,0 +1,48 @@
+From 14a500fe1396934c6b3ed8f009459a4723da7862 Mon Sep 17 00:00:00 2001
+From: Vaishali Thakkar
+Date: Thu, 20 Aug 2015 22:11:15 +0530
+Subject: ASoC: samsung: Remove redundant arndale_audio_remove
+
+From: Vaishali Thakkar
+
+commit 14a500fe1396934c6b3ed8f009459a4723da7862 upstream.
+
+There is no use of snd_soc_unregister_card in remove function
+as devm_snd_soc_register_card in probe function automatically
+handles it. So, remove use of snd_soc_unregister_card and with
+this change remove arndale_audio_remove as it is now redundant.
+
+Signed-off-by: Vaishali Thakkar
+Signed-off-by: Mark Brown
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ sound/soc/samsung/arndale_rt5631.c | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+--- a/sound/soc/samsung/arndale_rt5631.c
++++ b/sound/soc/samsung/arndale_rt5631.c
+@@ -116,15 +116,6 @@ static int arndale_audio_probe(struct pl
+ return ret;
+ }
+
+-static int arndale_audio_remove(struct platform_device *pdev)
+-{
+- struct snd_soc_card *card = platform_get_drvdata(pdev);
+-
+- snd_soc_unregister_card(card);
+-
+- return 0;
+-}
+-
+ static const struct of_device_id samsung_arndale_rt5631_of_match[] __maybe_unused = {
+ { .compatible = "samsung,arndale-rt5631", },
+ { .compatible = "samsung,arndale-alc5631", },
+@@ -139,7 +130,6 @@ static struct platform_driver arndale_au
+ .of_match_table = of_match_ptr(samsung_arndale_rt5631_of_match),
+ },
+ .probe = arndale_audio_probe,
+- .remove = arndale_audio_remove,
+ };
+
+ module_platform_driver(arndale_audio_driver);
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-exynos4-fix-wrong-clock-for-exynos4x12-adc.patch b/kernel/kernel/files/patches/mageia/stable-clk-exynos4-fix-wrong-clock-for-exynos4x12-adc.patch
new file mode 100644
index 00000000..60bdcac4
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-clk-exynos4-fix-wrong-clock-for-exynos4x12-adc.patch
@@ -0,0 +1,55 @@
+From e323d56eb06b266b77c2b430cb5f1977ba549e03 Mon Sep 17 00:00:00 2001
+From: Krzysztof Kozlowski
+Date: Fri, 12 Jun 2015 10:53:25 +0900
+Subject: clk: exynos4: Fix wrong clock for Exynos4x12 ADC
+
+From: Krzysztof Kozlowski
+
+commit e323d56eb06b266b77c2b430cb5f1977ba549e03 upstream.
+
+The TSADC gate clock was used in Exynos4x12 DTSI for exynos-adc driver.
+However TSADC is present only on Exynos4210 so on Trats2 board (with
+Exynos4412 SoC) the exynos-adc driver could not be probed:
+ ERROR: could not get clock /adc@126C0000:adc(0)
+ exynos-adc 126c0000.adc: failed getting clock, err = -2
+ exynos-adc: probe of 126c0000.adc failed with error -2
+
+Instead on Exynos4x12 SoCs the main clock used by Analog to Digital
+Converter is located in different register and it is named in datasheet
+as PCLK_ADC. Regardless of the name the purpose of this PCLK_ADC clock
+is the same as purpose of TSADC from Exynos4210.
+
+The patch adds gate clock for Exynos4x12 using the proper register so
+backward compatibility is preserved. This fixes the probe of exynos-adc
+driver on Exynos4x12 boards and allows accessing sensors connected to it
+on Trats2 board (ntc,ncp15wb473 AP and battery thermistors).
+
+Signed-off-by: Krzysztof Kozlowski
+Fixes: c63c57433003 ("ARM: dts: Add ADC's dt data to read raw data for exynos4x12")
+Reviewed-by: Javier Martinez Canillas
+Acked-by: Tomasz Figa
+Signed-off-by: Stephen Boyd
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/clk/samsung/clk-exynos4.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/clk/samsung/clk-exynos4.c
++++ b/drivers/clk/samsung/clk-exynos4.c
+@@ -85,6 +85,7 @@
+ #define DIV_PERIL4 0xc560
+ #define DIV_PERIL5 0xc564
+ #define E4X12_DIV_CAM1 0xc568
++#define E4X12_GATE_BUS_FSYS1 0xc744
+ #define GATE_SCLK_CAM 0xc820
+ #define GATE_IP_CAM 0xc920
+ #define GATE_IP_TV 0xc924
+@@ -1095,6 +1096,7 @@ static struct samsung_gate_clock exynos4
+ 0),
+ GATE(CLK_PPMUIMAGE, "ppmuimage", "aclk200", E4X12_GATE_IP_IMAGE, 9, 0,
+ 0),
++ GATE(CLK_TSADC, "tsadc", "aclk133", E4X12_GATE_BUS_FSYS1, 16, 0, 0),
+ GATE(CLK_MIPI_HSI, "mipi_hsi", "aclk133", GATE_IP_FSYS, 10, 0, 0),
+ GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, 0, 0),
+ GATE(CLK_SYSREG, "sysreg", "aclk100", E4X12_GATE_IP_PERIR, 1,
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-pistachio-correct-critical-clock-list.patch b/kernel/kernel/files/patches/mageia/stable-clk-pistachio-correct-critical-clock-list.patch
new file mode 100644
index 00000000..b711f795
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-clk-pistachio-correct-critical-clock-list.patch
@@ -0,0 +1,81 @@
+From d31ff5f7f3b142b8d1ebb3da89187c54cdf2bc71 Mon Sep 17 00:00:00 2001
+From: "Damien.Horsley"
+Date: Wed, 26 Aug 2015 17:11:40 +0100
+Subject: clk: pistachio: correct critical clock list
+
+From: "Damien.Horsley"
+
+commit d31ff5f7f3b142b8d1ebb3da89187c54cdf2bc71 upstream.
+
+Current critical clock list for pistachio enables
+only mips and sys clocks by default but there are
+also other clocks that are not claimed by anyone and
+needs to be enabled by default.
+
+This patch updates the critical clocks that need
+to be enabled by default.
+
+Add a separate struct to distinguish the critical clocks
+as listed:
+1.) core clocks:
+ a.) mips clock
+2.) peripheral system clocks:
+ a.) sys clock
+ b.) sys_bus clock
+ c.) DDR clock
+ d.) ROM clock
+
+Fixes: b35d7c33419c("CLK: Pistachio: Register core clocks")
+Reviewed-by: Andrew Bresticker
+Signed-off-by: Ezequiel Garcia
+Signed-off-by: Damien.Horsley
+Signed-off-by: Govindraj Raja
+Signed-off-by: Stephen Boyd
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/clk/pistachio/clk-pistachio.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+--- a/drivers/clk/pistachio/clk-pistachio.c
++++ b/drivers/clk/pistachio/clk-pistachio.c
+@@ -159,9 +159,15 @@ PNAME(mux_debug) = { "mips_pll_mux", "rp
+ "wifi_pll_mux", "bt_pll_mux" };
+ static u32 mux_debug_idx[] = { 0x0, 0x1, 0x2, 0x4, 0x8, 0x10 };
+
+-static unsigned int pistachio_critical_clks[] __initdata = {
+- CLK_MIPS,
+- CLK_PERIPH_SYS,
++static unsigned int pistachio_critical_clks_core[] __initdata = {
++ CLK_MIPS
++};
++
++static unsigned int pistachio_critical_clks_sys[] __initdata = {
++ PERIPH_CLK_SYS,
++ PERIPH_CLK_SYS_BUS,
++ PERIPH_CLK_DDR,
++ PERIPH_CLK_ROM,
+ };
+
+ static void __init pistachio_clk_init(struct device_node *np)
+@@ -193,8 +199,8 @@ static void __init pistachio_clk_init(st
+
+ pistachio_clk_register_provider(p);
+
+- pistachio_clk_force_enable(p, pistachio_critical_clks,
+- ARRAY_SIZE(pistachio_critical_clks));
++ pistachio_clk_force_enable(p, pistachio_critical_clks_core,
++ ARRAY_SIZE(pistachio_critical_clks_core));
+ }
+ CLK_OF_DECLARE(pistachio_clk, "img,pistachio-clk", pistachio_clk_init);
+
+@@ -261,6 +267,9 @@ static void __init pistachio_clk_periph_
+ ARRAY_SIZE(pistachio_periph_gates));
+
+ pistachio_clk_register_provider(p);
++
++ pistachio_clk_force_enable(p, pistachio_critical_clks_sys,
++ ARRAY_SIZE(pistachio_critical_clks_sys));
+ }
+ CLK_OF_DECLARE(pistachio_clk_periph, "img,pistachio-clk-periph",
+ pistachio_clk_periph_init);
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-pistachio-fix-override-of-clk-pll-settings-from-boot-loader.patch b/kernel/kernel/files/patches/mageia/stable-clk-pistachio-fix-override-of-clk-pll-settings-from-boot-loader.patch
new file mode 100644
index 00000000..2264f79c
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-clk-pistachio-fix-override-of-clk-pll-settings-from-boot-loader.patch
@@ -0,0 +1,54 @@
+From e53f21c761d141bbcbce06e9ddab3b4e0a828f2c Mon Sep 17 00:00:00 2001
+From: Zdenko Pulitika
+Date: Wed, 26 Aug 2015 17:11:38 +0100
+Subject: clk: pistachio: Fix override of clk-pll settings from boot loader
+
+From: Zdenko Pulitika
+
+commit e53f21c761d141bbcbce06e9ddab3b4e0a828f2c upstream.
+
+PLL enable callbacks are overriding PLL mode (int/frac) and
+Noise reduction (on/off) settings set by the boot loader which
+results in the incorrect clock rate.
+
+PLL mode and noise reduction are defined by the DSMPD and DACPD bits
+of the PLL control register. PLL .enable() callbacks enable PLL
+by deasserting all power-down bits of the PLL control register,
+including DSMPD and DACPD bits, which is not necessary since
+these bits don't actually enable/disable PLL.
+
+This commit fixes the problem by removing DSMPD and DACPD bits
+from the "PLL enable" mask.
+
+Fixes: 43049b0c83f17("CLK: Pistachio: Add PLL driver")
+Reviewed-by: Andrew Bresitcker
+Signed-off-by: Zdenko Pulitika
+Signed-off-by: Govindraj Raja
+Signed-off-by: Stephen Boyd
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/clk/pistachio/clk-pll.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/drivers/clk/pistachio/clk-pll.c
++++ b/drivers/clk/pistachio/clk-pll.c
+@@ -115,8 +115,7 @@ static int pll_gf40lp_frac_enable(struct
+ u32 val;
+
+ val = pll_readl(pll, PLL_CTRL3);
+- val &= ~(PLL_FRAC_CTRL3_PD | PLL_FRAC_CTRL3_DACPD |
+- PLL_FRAC_CTRL3_DSMPD | PLL_FRAC_CTRL3_FOUTPOSTDIVPD |
++ val &= ~(PLL_FRAC_CTRL3_PD | PLL_FRAC_CTRL3_FOUTPOSTDIVPD |
+ PLL_FRAC_CTRL3_FOUT4PHASEPD | PLL_FRAC_CTRL3_FOUTVCOPD);
+ pll_writel(pll, val, PLL_CTRL3);
+
+@@ -233,7 +232,7 @@ static int pll_gf40lp_laint_enable(struc
+ u32 val;
+
+ val = pll_readl(pll, PLL_CTRL1);
+- val &= ~(PLL_INT_CTRL1_PD | PLL_INT_CTRL1_DSMPD |
++ val &= ~(PLL_INT_CTRL1_PD |
+ PLL_INT_CTRL1_FOUTPOSTDIVPD | PLL_INT_CTRL1_FOUTVCOPD);
+ pll_writel(pll, val, PLL_CTRL1);
+
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-pxa-fix-core-frequency-reporting-unit.patch b/kernel/kernel/files/patches/mageia/stable-clk-pxa-fix-core-frequency-reporting-unit.patch
new file mode 100644
index 00000000..6e08e1fe
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-clk-pxa-fix-core-frequency-reporting-unit.patch
@@ -0,0 +1,61 @@
+From 4b5fb7dc9096d949a22651370bb6bf11f21edb30 Mon Sep 17 00:00:00 2001
+From: Robert Jarzmik
+Date: Sun, 12 Jul 2015 22:49:53 +0200
+Subject: clk: pxa: fix core frequency reporting unit
+
+From: Robert Jarzmik
+
+commit 4b5fb7dc9096d949a22651370bb6bf11f21edb30 upstream.
+
+Legacy drivers which are not yet ported, such as cpufreq-pxa[23]xx, rely
+on pxaXXx_get_clk_frequency_khz() to find the CPU core frequency.
+
+This reporting was broken because the expected unit is kHz and not
+Hz. Fix the reporting for pxa25x, pxa27x and pxa3xx.
+
+Fixes: fe7710fae477 ("clk: add pxa25x clock drivers")
+Fixes: d40670dc6169 ("clk: add pxa27x clock drivers")
+Fixes: 9bbb8a338fb2 ("clk: pxa: add pxa3xx clock driver")
+Signed-off-by: Robert Jarzmik
+Signed-off-by: Stephen Boyd
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/clk/pxa/clk-pxa25x.c | 2 +-
+ drivers/clk/pxa/clk-pxa27x.c | 2 +-
+ drivers/clk/pxa/clk-pxa3xx.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/clk/pxa/clk-pxa25x.c
++++ b/drivers/clk/pxa/clk-pxa25x.c
+@@ -79,7 +79,7 @@ unsigned int pxa25x_get_clk_frequency_kh
+ clks[3] / 1000000, (clks[3] % 1000000) / 10000);
+ }
+
+- return (unsigned int)clks[0];
++ return (unsigned int)clks[0] / KHz;
+ }
+
+ static unsigned long clk_pxa25x_memory_get_rate(struct clk_hw *hw,
+--- a/drivers/clk/pxa/clk-pxa27x.c
++++ b/drivers/clk/pxa/clk-pxa27x.c
+@@ -80,7 +80,7 @@ unsigned int pxa27x_get_clk_frequency_kh
+ pr_info("System bus clock: %ld.%02ldMHz\n",
+ clks[4] / 1000000, (clks[4] % 1000000) / 10000);
+ }
+- return (unsigned int)clks[0];
++ return (unsigned int)clks[0] / KHz;
+ }
+
+ bool pxa27x_is_ppll_disabled(void)
+--- a/drivers/clk/pxa/clk-pxa3xx.c
++++ b/drivers/clk/pxa/clk-pxa3xx.c
+@@ -78,7 +78,7 @@ unsigned int pxa3xx_get_clk_frequency_kh
+ pr_info("System bus clock: %ld.%02ldMHz\n",
+ clks[4] / 1000000, (clks[4] % 1000000) / 10000);
+ }
+- return (unsigned int)clks[0];
++ return (unsigned int)clks[0] / KHz;
+ }
+
+ static unsigned long clk_pxa3xx_ac97_get_rate(struct clk_hw *hw,
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-pxa-pxa3xx-fix-cken-register-access.patch b/kernel/kernel/files/patches/mageia/stable-clk-pxa-pxa3xx-fix-cken-register-access.patch
deleted file mode 100644
index 203cd5f0..00000000
--- a/kernel/kernel/files/patches/mageia/stable-clk-pxa-pxa3xx-fix-cken-register-access.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From b93028c9af807b9474789e6aba34a6135b6cb708 Mon Sep 17 00:00:00 2001
-From: Robert Jarzmik
-Date: Tue, 4 Aug 2015 08:21:33 +0200
-Subject: clk: pxa: pxa3xx: fix CKEN register access
-
-From: Robert Jarzmik
-
-commit b93028c9af807b9474789e6aba34a6135b6cb708 upstream.
-
-Clocks 0 to 31 are on CKENA, and not CKENB. The clock register names
-were inadequately inverted. As a consequence, all clock operations were
-happening on CKENB, because almost all but 2 clocks are on CKENA.
-
-As the clocks were activated by the bootloader in the former tests, it
-escaped the testing that the wrong clock gate was manipulated. The error
-was revealed by changing the pxa3xx-nand driver to a module, where upon
-unloading, the wrong clock was disabled in CKENB.
-
-Fixes: 9bbb8a338fb2 ("clk: pxa: add pxa3xx clock driver")
-Signed-off-by: Robert Jarzmik
-Signed-off-by: Stephen Boyd
-Signed-off-by: Greg Kroah-Hartman
-
----
- drivers/clk/pxa/clk-pxa3xx.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/clk/pxa/clk-pxa3xx.c
-+++ b/drivers/clk/pxa/clk-pxa3xx.c
-@@ -126,7 +126,7 @@ PARENTS(pxa3xx_ac97_bus) = { "ring_osc_6
- PARENTS(pxa3xx_sbus) = { "ring_osc_60mhz", "system_bus" };
- PARENTS(pxa3xx_smemcbus) = { "ring_osc_60mhz", "smemc" };
-
--#define CKEN_AB(bit) ((CKEN_ ## bit > 31) ? &CKENA : &CKENB)
-+#define CKEN_AB(bit) ((CKEN_ ## bit > 31) ? &CKENB : &CKENA)
- #define PXA3XX_CKEN(dev_id, con_id, parents, mult_lp, div_lp, mult_hp, \
- div_hp, bit, is_lp, flags) \
- PXA_CKEN(dev_id, con_id, bit, parents, mult_lp, div_lp, \
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-qcom-fix-msm8916-prng-clock-enable-bit.patch b/kernel/kernel/files/patches/mageia/stable-clk-qcom-fix-msm8916-prng-clock-enable-bit.patch
new file mode 100644
index 00000000..d2d00d7e
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-clk-qcom-fix-msm8916-prng-clock-enable-bit.patch
@@ -0,0 +1,32 @@
+From 1c4b4b0eb1909010b8ebda1ef208bf3ed62e7487 Mon Sep 17 00:00:00 2001
+From: Georgi Djakov
+Date: Tue, 25 Aug 2015 15:27:43 +0300
+Subject: clk: qcom: Fix MSM8916 prng clock enable bit
+
+From: Georgi Djakov
+
+commit 1c4b4b0eb1909010b8ebda1ef208bf3ed62e7487 upstream.
+
+Fix the enable bit of the pseudorandom number generator clock.
+
+Reported-by: Stanimir Varbanov
+Fixes: 3966fab8b6ab "clk: qcom: Add MSM8916 Global Clock Controller support"
+Signed-off-by: Georgi Djakov
+Signed-off-by: Stephen Boyd
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/clk/qcom/gcc-msm8916.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/clk/qcom/gcc-msm8916.c
++++ b/drivers/clk/qcom/gcc-msm8916.c
+@@ -2278,7 +2278,7 @@ static struct clk_branch gcc_prng_ahb_cl
+ .halt_check = BRANCH_HALT_VOTED,
+ .clkr = {
+ .enable_reg = 0x45004,
+- .enable_mask = BIT(0),
++ .enable_mask = BIT(8),
+ .hw.init = &(struct clk_init_data){
+ .name = "gcc_prng_ahb_clk",
+ .parent_names = (const char *[]){
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-qcom-set-clk_set_rate_parent-on-ce1-clocks.patch b/kernel/kernel/files/patches/mageia/stable-clk-qcom-set-clk_set_rate_parent-on-ce1-clocks.patch
new file mode 100644
index 00000000..2e3f0458
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-clk-qcom-set-clk_set_rate_parent-on-ce1-clocks.patch
@@ -0,0 +1,45 @@
+From d7a304e9d018c99dda80f4c16ec0fe817b5be4a1 Mon Sep 17 00:00:00 2001
+From: Stephen Boyd
+Date: Tue, 14 Jul 2015 16:57:29 -0700
+Subject: clk: qcom: Set CLK_SET_RATE_PARENT on ce1 clocks
+
+From: Stephen Boyd
+
+commit d7a304e9d018c99dda80f4c16ec0fe817b5be4a1 upstream.
+
+The other ce clocks have the flag set, but ce1 doesn't, so
+clk_set_rate() doesn't propagate up the tree to the ce1_src_clk.
+Set the flag as this is supported.
+
+Reported-by: Bjorn Andersson
+Tested-by: Bjorn Andersson
+Fixes: 02824653200b ("clk: qcom: Add APQ8084 Global Clock Controller support")
+Fixes: d33faa9ead8d ("clk: qcom: Add support for MSM8974's global clock controller (GCC)")
+Signed-off-by: Stephen Boyd
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/clk/qcom/gcc-apq8084.c | 1 +
+ drivers/clk/qcom/gcc-msm8974.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/drivers/clk/qcom/gcc-apq8084.c
++++ b/drivers/clk/qcom/gcc-apq8084.c
+@@ -2105,6 +2105,7 @@ static struct clk_branch gcc_ce1_clk = {
+ "ce1_clk_src",
+ },
+ .num_parents = 1,
++ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+--- a/drivers/clk/qcom/gcc-msm8974.c
++++ b/drivers/clk/qcom/gcc-msm8974.c
+@@ -1783,6 +1783,7 @@ static struct clk_branch gcc_ce1_clk = {
+ "ce1_clk_src",
+ },
+ .num_parents = 1,
++ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-rockchip-rk3288-add-clk_set_rate_parent-to-sclk_mac.patch b/kernel/kernel/files/patches/mageia/stable-clk-rockchip-rk3288-add-clk_set_rate_parent-to-sclk_mac.patch
new file mode 100644
index 00000000..0b070dc1
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-clk-rockchip-rk3288-add-clk_set_rate_parent-to-sclk_mac.patch
@@ -0,0 +1,39 @@
+From 4791eb61dbe8100ccac59fecfac9d93a15db1447 Mon Sep 17 00:00:00 2001
+From: Heiko Stuebner
+Date: Thu, 18 Jun 2015 16:18:28 +0200
+Subject: clk: rockchip: rk3288: add CLK_SET_RATE_PARENT to sclk_mac
+
+From: Heiko Stuebner
+
+commit 4791eb61dbe8100ccac59fecfac9d93a15db1447 upstream.
+
+The dwmac ethernet controller on the rk3288 supports phys connected
+via rgmii and rmii. With rgmii phys it is expected that the mac clock
+is provided externally while with rmii phys the clock can be external
+but also generated from the plls. In the later case it of course needs
+be at 50MHz, which gets set from the dwmac_rk driver.
+As most devices use a rgmii phy it never surfaced so far that the mac
+clk mux, doesn't go up one lever to the pll clock in the rmii case with
+internal clock generation, as it is missing the CLK_SET_RATE_PARENT flag,
+and thus will not set the correct frequency in most cases.
+
+Fixes: b9e4ba541607 ("clk: rockchip: add clock controller for rk3288")
+Signed-off-by: Heiko Stuebner
+Signed-off-by: Stephen Boyd
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/clk/rockchip/clk-rk3288.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/clk/rockchip/clk-rk3288.c
++++ b/drivers/clk/rockchip/clk-rk3288.c
+@@ -578,7 +578,7 @@ static struct rockchip_clk_branch rk3288
+ COMPOSITE(0, "mac_pll_src", mux_pll_src_npll_cpll_gpll_p, 0,
+ RK3288_CLKSEL_CON(21), 0, 2, MFLAGS, 8, 5, DFLAGS,
+ RK3288_CLKGATE_CON(2), 5, GFLAGS),
+- MUX(SCLK_MAC, "mac_clk", mux_mac_p, 0,
++ MUX(SCLK_MAC, "mac_clk", mux_mac_p, CLK_SET_RATE_PARENT,
+ RK3288_CLKSEL_CON(21), 4, 1, MFLAGS),
+ GATE(SCLK_MACREF_OUT, "sclk_macref_out", "mac_clk", 0,
+ RK3288_CLKGATE_CON(5), 3, GFLAGS),
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-s5pv210-add-missing-call-to.patch b/kernel/kernel/files/patches/mageia/stable-clk-s5pv210-add-missing-call-to.patch
new file mode 100644
index 00000000..fb96a551
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-clk-s5pv210-add-missing-call-to.patch
@@ -0,0 +1,37 @@
+From ba30011577330b7e29ecb5916d89c6db9fbc5b3d Mon Sep 17 00:00:00 2001
+From: Marek Szyprowski
+Date: Wed, 12 Aug 2015 10:58:22 +0200
+Subject: clk: s5pv210: add missing call to
+ samsung_clk_of_add_provider()
+
+From: Marek Szyprowski
+
+commit ba30011577330b7e29ecb5916d89c6db9fbc5b3d upstream.
+
+Commit d5e136a21b2028fb1f45143ea7112d5869bfc6c7 ("clk: samsung: Register
+clk provider only after registering its all clocks", merged to v3.17-rc1)
+modified a way that driver registers registers to core framework. This
+change has not been applied to s5pv210 clocks driver, which has been
+merged in parallel to that commit. This patch adds a missing call to
+samsung_clk_of_add_provider(), so the driver is operational again.
+
+Signed-off-by: Marek Szyprowski
+Acked-by: Tomasz Figa
+Signed-off-by: Michael Turquette
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/clk/samsung/clk-s5pv210.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/clk/samsung/clk-s5pv210.c
++++ b/drivers/clk/samsung/clk-s5pv210.c
+@@ -828,6 +828,8 @@ static void __init __s5pv210_clk_init(st
+
+ s5pv210_clk_sleep_init();
+
++ samsung_clk_of_add_provider(np, ctx);
++
+ pr_info("%s clocks: mout_apll = %ld, mout_mpll = %ld\n"
+ "\tmout_epll = %ld, mout_vpll = %ld\n",
+ is_s5p6442 ? "S5P6442" : "S5PV210",
diff --git a/kernel/kernel/files/patches/mageia/stable-clk-versatile-off-by-one-in-clk_sp810_timerclken_of_get.patch b/kernel/kernel/files/patches/mageia/stable-clk-versatile-off-by-one-in-clk_sp810_timerclken_of_get.patch
new file mode 100644
index 00000000..dcd5f48d
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-clk-versatile-off-by-one-in-clk_sp810_timerclken_of_get.patch
@@ -0,0 +1,34 @@
+From 3294bee87091be5f179474f6c39d1d87769635e2 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter
+Date: Wed, 29 Jul 2015 13:17:06 +0300
+Subject: clk: versatile: off by one in clk_sp810_timerclken_of_get()
+
+From: Dan Carpenter
+
+commit 3294bee87091be5f179474f6c39d1d87769635e2 upstream.
+
+The ">" should be ">=" or we end up reading beyond the end of the array.
+
+Fixes: 6e973d2c4385 ('clk: vexpress: Add separate SP810 driver')
+Signed-off-by: Dan Carpenter
+Acked-by: Pawel Moll
+Signed-off-by: Stephen Boyd
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/clk/versatile/clk-sp810.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/clk/versatile/clk-sp810.c
++++ b/drivers/clk/versatile/clk-sp810.c
+@@ -128,8 +128,8 @@ static struct clk *clk_sp810_timerclken_
+ {
+ struct clk_sp810 *sp810 = data;
+
+- if (WARN_ON(clkspec->args_count != 1 || clkspec->args[0] >
+- ARRAY_SIZE(sp810->timerclken)))
++ if (WARN_ON(clkspec->args_count != 1 ||
++ clkspec->args[0] >= ARRAY_SIZE(sp810->timerclken)))
+ return NULL;
+
+ return sp810->timerclken[clkspec->args[0]].clk;
diff --git a/kernel/kernel/files/patches/mageia/stable-dm-thin-metadata-delete-btrees-when-releasing-metadata-snapshot.patch b/kernel/kernel/files/patches/mageia/stable-dm-thin-metadata-delete-btrees-when-releasing-metadata-snapshot.patch
deleted file mode 100644
index 3f3678c8..00000000
--- a/kernel/kernel/files/patches/mageia/stable-dm-thin-metadata-delete-btrees-when-releasing-metadata-snapshot.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 7f518ad0a212e2a6fd68630e176af1de395070a7 Mon Sep 17 00:00:00 2001
-From: Joe Thornber
-Date: Wed, 12 Aug 2015 15:10:21 +0100
-Subject: dm thin metadata: delete btrees when releasing metadata snapshot
-
-From: Joe Thornber
-
-commit 7f518ad0a212e2a6fd68630e176af1de395070a7 upstream.
-
-The device details and mapping trees were just being decremented
-before. Now btree_del() is called to do a deep delete.
-
-Signed-off-by: Joe Thornber
-Signed-off-by: Mike Snitzer
-Signed-off-by: Greg Kroah-Hartman
-
----
- drivers/md/dm-thin-metadata.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/md/dm-thin-metadata.c
-+++ b/drivers/md/dm-thin-metadata.c
-@@ -1295,8 +1295,8 @@ static int __release_metadata_snap(struc
- return r;
-
- disk_super = dm_block_data(copy);
-- dm_sm_dec_block(pmd->metadata_sm, le64_to_cpu(disk_super->data_mapping_root));
-- dm_sm_dec_block(pmd->metadata_sm, le64_to_cpu(disk_super->device_details_root));
-+ dm_btree_del(&pmd->info, le64_to_cpu(disk_super->data_mapping_root));
-+ dm_btree_del(&pmd->details_info, le64_to_cpu(disk_super->device_details_root));
- dm_sm_dec_block(pmd->metadata_sm, held_root);
-
- return dm_tm_unlock(pmd->tm, copy);
diff --git a/kernel/kernel/files/patches/mageia/stable-doc-usb-gadget-testing-using-the-updated-testusb.c.patch b/kernel/kernel/files/patches/mageia/stable-doc-usb-gadget-testing-using-the-updated-testusb.c.patch
new file mode 100644
index 00000000..0864b1a3
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-doc-usb-gadget-testing-using-the-updated-testusb.c.patch
@@ -0,0 +1,44 @@
+From f811a38300be3cdb603171aea5ad3fb42b71ca53 Mon Sep 17 00:00:00 2001
+From: Peter Chen
+Date: Fri, 31 Jul 2015 16:36:30 +0800
+Subject: doc: usb: gadget-testing: using the updated testusb.c
+
+From: Peter Chen
+
+commit f811a38300be3cdb603171aea5ad3fb42b71ca53 upstream.
+
+testusb.c at http://www.linux-usb.org/usbtest/ is out of date,
+using the one at the kernel source folder.
+
+Signed-off-by: Peter Chen
+Signed-off-by: Felipe Balbi
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ Documentation/usb/gadget-testing.txt | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+--- a/Documentation/usb/gadget-testing.txt
++++ b/Documentation/usb/gadget-testing.txt
+@@ -237,9 +237,7 @@ Testing the LOOPBACK function
+ -----------------------------
+
+ device: run the gadget
+-host: test-usb
+-
+-http://www.linux-usb.org/usbtest/testusb.c
++host: test-usb (tools/usb/testusb.c)
+
+ 8. MASS STORAGE function
+ ========================
+@@ -588,9 +586,8 @@ Testing the SOURCESINK function
+ -------------------------------
+
+ device: run the gadget
+-host: test-usb
++host: test-usb (tools/usb/testusb.c)
+
+-http://www.linux-usb.org/usbtest/testusb.c
+
+ 16. UAC1 function
+ =================
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-allow-dsi-dual-link-to-be-configured-on-any-pipe.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-allow-dsi-dual-link-to-be-configured-on-any-pipe.patch
new file mode 100644
index 00000000..c545c5a9
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-i915-allow-dsi-dual-link-to-be-configured-on-any-pipe.patch
@@ -0,0 +1,58 @@
+From 824257857fd81f5e749831ff9cd63566b5a86abe Mon Sep 17 00:00:00 2001
+From: Gaurav K Singh
+Date: Mon, 3 Aug 2015 15:45:32 +0530
+Subject: drm/i915: Allow DSI dual link to be configured on any pipe
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Gaurav K Singh
+
+commit 824257857fd81f5e749831ff9cd63566b5a86abe upstream.
+
+Just like single link MIPI panels, similarly for dual link panels, pipe
+to be configured is based on the DVO port from VBT Block 2. In hardware,
+Port A is mapped with Pipe A and Port C is mapped with Pipe B.
+
+This issue got introduced in -
+
+commit 7e9804fdcffc650515c60f524b8b2076ee59e710
+Author: Jani Nikula
+Date: Fri Jan 16 14:27:23 2015 +0200
+
+ drm/i915/dsi: add drm mipi dsi host support
+
+Signed-off-by: Gaurav K Singh
+Reviewed-by: Ville Syrjälä
+Signed-off-by: Jani Nikula
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/i915/intel_dsi.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+--- a/drivers/gpu/drm/i915/intel_dsi.c
++++ b/drivers/gpu/drm/i915/intel_dsi.c
+@@ -1036,11 +1036,7 @@ void intel_dsi_init(struct drm_device *d
+ intel_connector->unregister = intel_connector_unregister;
+
+ /* Pipe A maps to MIPI DSI port A, pipe B maps to MIPI DSI port C */
+- if (dev_priv->vbt.dsi.config->dual_link) {
+- /* XXX: does dual link work on either pipe? */
+- intel_encoder->crtc_mask = (1 << PIPE_A);
+- intel_dsi->ports = ((1 << PORT_A) | (1 << PORT_C));
+- } else if (dev_priv->vbt.dsi.port == DVO_PORT_MIPIA) {
++ if (dev_priv->vbt.dsi.port == DVO_PORT_MIPIA) {
+ intel_encoder->crtc_mask = (1 << PIPE_A);
+ intel_dsi->ports = (1 << PORT_A);
+ } else if (dev_priv->vbt.dsi.port == DVO_PORT_MIPIC) {
+@@ -1048,6 +1044,9 @@ void intel_dsi_init(struct drm_device *d
+ intel_dsi->ports = (1 << PORT_C);
+ }
+
++ if (dev_priv->vbt.dsi.config->dual_link)
++ intel_dsi->ports = ((1 << PORT_A) | (1 << PORT_C));
++
+ /* Create a DSI host (and a device) for each port. */
+ for_each_dsi_port(port, intel_dsi->ports) {
+ struct intel_dsi_host *host;
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-always-mark-the-object-as-dirty-when-used-by-the-gpu.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-always-mark-the-object-as-dirty-when-used-by-the-gpu.patch
new file mode 100644
index 00000000..59d9b821
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-i915-always-mark-the-object-as-dirty-when-used-by-the-gpu.patch
@@ -0,0 +1,58 @@
+From 51bc140431e233284660b1d22c47dec9ecdb521e Mon Sep 17 00:00:00 2001
+From: Chris Wilson
+Date: Mon, 31 Aug 2015 15:10:39 +0100
+Subject: drm/i915: Always mark the object as dirty when used by the GPU
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Chris Wilson
+
+commit 51bc140431e233284660b1d22c47dec9ecdb521e upstream.
+
+There have been many hard to track down bugs whereby userspace forgot to
+flag a write buffer and then cause graphics corruption or a hung GPU
+when that buffer was later purged under memory pressure (as the buffer
+appeared clean, its pages would have been evicted rather than preserved
+and any changes more recent than in the backing storage would be lost).
+In retrospect this is a rare optimisation against memory pressure,
+already the slow path. If we always mark the buffer as dirty when
+accessed by the GPU, anything not used can still be evicted cheaply
+(ideal behaviour for mark-and-sweep eviction) but we do not run the risk
+of corruption. For correct read serialisation, userspace still has to
+notify when the GPU writes to an object. However, there are certain
+situations under which userspace may wish to tell white lies to the
+kernel...
+
+Signed-off-by: Chris Wilson
+Cc: Daniel Vetter
+Cc: Kristian Høgsberg
+Cc: Jesse Barnes
+Cc: "Goel, Akash"
+Cc: Michał Winiarski
+Reviewed-by: Daniel Vetter
+Signed-off-by: Jani Nikula
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
++++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+@@ -1025,6 +1025,7 @@ i915_gem_execbuffer_move_to_active(struc
+ u32 old_read = obj->base.read_domains;
+ u32 old_write = obj->base.write_domain;
+
++ obj->dirty = 1; /* be paranoid */
+ obj->base.write_domain = obj->base.pending_write_domain;
+ if (obj->base.write_domain == 0)
+ obj->base.pending_read_domains |= obj->base.read_domains;
+@@ -1032,7 +1033,6 @@ i915_gem_execbuffer_move_to_active(struc
+
+ i915_vma_move_to_active(vma, ring);
+ if (obj->base.write_domain) {
+- obj->dirty = 1;
+ i915_gem_request_assign(&obj->last_write_req, req);
+
+ intel_fb_obj_invalidate(obj, ring, ORIGIN_CS);
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-apply-the-pci_d0-d3-hibernation-workaround-everywhere-on-pre-gen6.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-apply-the-pci_d0-d3-hibernation-workaround-everywhere-on-pre-gen6.patch
new file mode 100644
index 00000000..b425285d
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-i915-apply-the-pci_d0-d3-hibernation-workaround-everywhere-on-pre-gen6.patch
@@ -0,0 +1,79 @@
+From 54875571bbfde00fc63741715c531cbb5246c3b2 Mon Sep 17 00:00:00 2001
+From: Imre Deak
+Date: Tue, 30 Jun 2015 17:06:47 +0300
+Subject: drm/i915: apply the PCI_D0/D3 hibernation workaround everywhere on pre GEN6
+
+From: Imre Deak
+
+commit 54875571bbfde00fc63741715c531cbb5246c3b2 upstream.
+
+commit da2bc1b9db3351addd293e5b82757efe1f77ed1d
+Author: Imre Deak
+Date: Thu Oct 23 19:23:26 2014 +0300
+
+ drm/i915: add poweroff_late handler
+
+introduced a regression on old platforms during hibernation. A workaround was
+added in
+
+commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb
+Author: Imre Deak
+Date: Mon Mar 2 13:04:41 2015 +0200
+
+ drm/i915: gen4: work around hang during hibernation
+
+using an explicit blacklist for the GENs/BIOS vendors where the issue was
+reported. Later there we had reports of the same failure on platforms not on
+this list.
+
+To my best knowledge the correct thing to do is still to put the device to PCI
+D3 state during hibernation, see [1] and [2] for the reasons. This also aligns
+with our future plans to unify more the runtime and system suspend/resume
+paths. Since an exact blacklist seems to be impractical (multiple GENs and
+BIOS vendors are affected) apply the workaround on everything pre GEN6.
+
+[1] http://lists.freedesktop.org/archives/intel-gfx/2015-February/060710.html
+[2] https://lkml.org/lkml/2015/6/22/274
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95061
+Reported-by: Ilya Tumaykin
+Reported-by: Dirk Griesbach
+Reported-by: Pavel Machek
+Reported-by: Mikko Rapeli
+Tested-by: Mikko Rapeli
+Reported-by: Paul Bolle
+Signed-off-by: Imre Deak
+Signed-off-by: Jani Nikula
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+--- a/drivers/gpu/drm/i915/i915_drv.c
++++ b/drivers/gpu/drm/i915/i915_drv.c
+@@ -647,15 +647,18 @@ static int i915_drm_suspend_late(struct
+
+ pci_disable_device(drm_dev->pdev);
+ /*
+- * During hibernation on some GEN4 platforms the BIOS may try to access
++ * During hibernation on some platforms the BIOS may try to access
+ * the device even though it's already in D3 and hang the machine. So
+ * leave the device in D0 on those platforms and hope the BIOS will
+- * power down the device properly. Platforms where this was seen:
+- * Lenovo Thinkpad X301, X61s
++ * power down the device properly. The issue was seen on multiple old
++ * GENs with different BIOS vendors, so having an explicit blacklist
++ * is inpractical; apply the workaround on everything pre GEN6. The
++ * platforms where the issue was seen:
++ * Lenovo Thinkpad X301, X61s, X60, T60, X41
++ * Fujitsu FSC S7110
++ * Acer Aspire 1830T
+ */
+- if (!(hibernation &&
+- drm_dev->pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO &&
+- INTEL_INFO(dev_priv)->gen == 4))
++ if (!(hibernation && INTEL_INFO(dev_priv)->gen < 6))
+ pci_set_power_state(drm_dev->pdev, PCI_D3hot);
+
+ return 0;
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-check-dp-link-status-on-long-hpd-too.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-check-dp-link-status-on-long-hpd-too.patch
new file mode 100644
index 00000000..fd5d79d6
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-i915-check-dp-link-status-on-long-hpd-too.patch
@@ -0,0 +1,75 @@
+From d14e7b6d1d8747826cb900db852351c550e00fdd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?=
+Date: Thu, 20 Aug 2015 19:37:29 +0300
+Subject: drm/i915: Check DP link status on long hpd too
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?=
+
+commit d14e7b6d1d8747826cb900db852351c550e00fdd upstream.
+
+We are no longer checkling the DP link status on long hpd. We used to do
+that from the .hot_plug() handler, but it was removed when MST got
+introduced.
+
+If there's no userspace we now fail to retrain the link if the sink
+power is toggled (or cable yanked and replugged), meaning the user is
+left staring at a blank screen. With the retraining put back that should
+be fixed.
+
+Also remove the leftover comment that referred to the old retraining
+from .hot_plug().
+
+Fixes a regression introduced in:
+commit 0e32b39ceed665bfa4a77a4bc307b6652b991632
+Author: Dave Airlie
+Date: Fri May 2 14:02:48 2014 +1000
+
+ drm/i915: add DP 1.2 MST support (v0.7)
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89453
+Tested-by: Palmer Dabbelt
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91407
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89461
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89594
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85641
+Cc: Dave Airlie
+Signed-off-by: Ville Syrjälä
+Reviewed-by: Daniel Vetter
+Signed-off-by: Jani Nikula
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/i915/intel_dp.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+--- a/drivers/gpu/drm/i915/intel_dp.c
++++ b/drivers/gpu/drm/i915/intel_dp.c
+@@ -4691,9 +4691,12 @@ intel_dp_hpd_pulse(struct intel_digital_
+
+ intel_dp_probe_oui(intel_dp);
+
+- if (!intel_dp_probe_mst(intel_dp))
++ if (!intel_dp_probe_mst(intel_dp)) {
++ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
++ intel_dp_check_link_status(intel_dp);
++ drm_modeset_unlock(&dev->mode_config.connection_mutex);
+ goto mst_fail;
+-
++ }
+ } else {
+ if (intel_dp->is_mst) {
+ if (intel_dp_check_mst_status(intel_dp) == -EINVAL)
+@@ -4701,10 +4704,6 @@ intel_dp_hpd_pulse(struct intel_digital_
+ }
+
+ if (!intel_dp->is_mst) {
+- /*
+- * we'll check the link status via the normal hot plug path later -
+- * but for short hpds we should check it now
+- */
+ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
+ intel_dp_check_link_status(intel_dp);
+ drm_modeset_unlock(&dev->mode_config.connection_mutex);
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-limit-the-number-of-loops-for-reading-a-split-64bit-register.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-limit-the-number-of-loops-for-reading-a-split-64bit-register.patch
new file mode 100644
index 00000000..8dd737f1
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-i915-limit-the-number-of-loops-for-reading-a-split-64bit-register.patch
@@ -0,0 +1,57 @@
+From acd29f7b22262d9e848393b9b6ae13eb42d22514 Mon Sep 17 00:00:00 2001
+From: Chris Wilson
+Date: Tue, 8 Sep 2015 14:17:13 +0100
+Subject: drm/i915: Limit the number of loops for reading a split 64bit register
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Chris Wilson
+
+commit acd29f7b22262d9e848393b9b6ae13eb42d22514 upstream.
+
+In I915_READ64_2x32 we attempt to read a 64bit register using 2 32bit
+reads. Due to the nature of the registers we try to read in this manner,
+they may increment between the two instruction (e.g. a timestamp
+counter). To keep the result accurate, we repeat the read if we detect
+an overflow (i.e. the upper value varies). However, some hardware is just
+plain flaky and may endless loop as the the upper 32bits are not stable.
+Just give up after a couple of tries and report whatever we read last.
+
+v2: Use the most recent values when erring out on an unstable register.
+
+Reported-by: russianneuromancer@ya.ru
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91906
+Signed-off-by: Chris Wilson
+Cc: Michał Winiarski
+Cc: Daniel Vetter
+Cc: Jani Nikula
+Reviewed-by: Daniel Vetter
+Signed-off-by: Jani Nikula
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/i915/i915_drv.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/gpu/drm/i915/i915_drv.h
++++ b/drivers/gpu/drm/i915/i915_drv.h
+@@ -3190,13 +3190,13 @@ int intel_freq_opcode(struct drm_i915_pr
+ #define I915_READ64(reg) dev_priv->uncore.funcs.mmio_readq(dev_priv, (reg), true)
+
+ #define I915_READ64_2x32(lower_reg, upper_reg) ({ \
+- u32 upper, lower, tmp; \
+- tmp = I915_READ(upper_reg); \
++ u32 upper, lower, old_upper, loop = 0; \
++ upper = I915_READ(upper_reg); \
+ do { \
+- upper = tmp; \
++ old_upper = upper; \
+ lower = I915_READ(lower_reg); \
+- tmp = I915_READ(upper_reg); \
+- } while (upper != tmp); \
++ upper = I915_READ(upper_reg); \
++ } while (upper != old_upper && loop++ < 2); \
+ (u64)upper << 32 | lower; })
+
+ #define POSTING_READ(reg) (void)I915_READ_NOTRACE(reg)
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-i915-preserve-ssc-earlier.patch b/kernel/kernel/files/patches/mageia/stable-drm-i915-preserve-ssc-earlier.patch
new file mode 100644
index 00000000..ba74fa2d
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-i915-preserve-ssc-earlier.patch
@@ -0,0 +1,117 @@
+From 69f92f67b68ab7028ffe15f0eea76b59f8859383 Mon Sep 17 00:00:00 2001
+From: Lukas Wunner
+Date: Wed, 15 Jul 2015 13:57:35 +0200
+Subject: drm/i915: Preserve SSC earlier
+
+From: Lukas Wunner
+
+commit 69f92f67b68ab7028ffe15f0eea76b59f8859383 upstream.
+
+Commit 92122789b2d6 ("drm/i915: preserve SSC if previously set v3")
+added code to intel_modeset_gem_init to override the SSC status read
+from VBT with the SSC status set by BIOS.
+
+However, intel_modeset_gem_init is invoked *after* intel_modeset_init,
+which calls intel_setup_outputs, which *modifies* SSC status by way of
+intel_init_pch_refclk. So unlike advertised, intel_modeset_gem_init
+doesn't preserve the SSC status set by BIOS but whatever
+intel_init_pch_refclk decided on.
+
+This is a problem on dual gpu laptops such as the MacBook Pro which
+require either a handler to switch DDC lines, or the discrete gpu
+to proxy DDC/AUX communication: Both the handler and the discrete
+gpu may initialize after the i915 driver, and consequently, an LVDS
+connector may initially seem disconnected and the SSC therefore
+is disabled by intel_init_pch_refclk, but on reprobe the connector
+may turn out to be connected and the SSC must then be enabled.
+
+Due to 92122789b2d6 however, the SSC is not enabled on reprobe since
+it is assumed BIOS disabled it while in fact it was disabled by
+intel_init_pch_refclk.
+
+Also, because the SSC status is preserved so late, the preserved value
+only ever gets used on resume but not on panel initialization:
+intel_modeset_init calls intel_init_display which indirectly calls
+intel_panel_use_ssc via multiple subroutines, *before* the BIOS value
+overrides the VBT value in intel_modeset_gem_init (intel_panel_use_ssc
+is the sole user of dev_priv->vbt.lvds_use_ssc).
+
+Fix this by moving the code introduced by 92122789b2d6 from
+intel_modeset_gem_init to intel_modeset_init before the invocation
+of intel_setup_outputs and intel_init_display.
+
+Add a DRM_DEBUG_KMS as suggested way back by Jani:
+http://lists.freedesktop.org/archives/intel-gfx/2014-June/046666.html
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88861
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61115
+Tested-by: Paul Hordiienko
+ [MBP 6,2 2010 intel ILK + nvidia GT216 pre-retina]
+Tested-by: William Brown
+ [MBP 8,2 2011 intel SNB + amd turks pre-retina]
+Tested-by: Lukas Wunner
+ [MBP 9,1 2012 intel IVB + nvidia GK107 pre-retina]
+Tested-by: Bruno Bierbaumer
+ [MBP 11,3 2013 intel HSW + nvidia GK107 retina -- work in progress]
+Fixes: 92122789b2d6 ("drm/i915: preserve SSC if previously set v3")
+Signed-off-by: Lukas Wunner
+Reviewed-by: Jesse Barnes
+Signed-off-by: Jani Nikula
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++++-----------
+ 1 file changed, 18 insertions(+), 11 deletions(-)
+
+--- a/drivers/gpu/drm/i915/intel_display.c
++++ b/drivers/gpu/drm/i915/intel_display.c
+@@ -13781,6 +13781,24 @@ void intel_modeset_init(struct drm_devic
+ if (INTEL_INFO(dev)->num_pipes == 0)
+ return;
+
++ /*
++ * There may be no VBT; and if the BIOS enabled SSC we can
++ * just keep using it to avoid unnecessary flicker. Whereas if the
++ * BIOS isn't using it, don't assume it will work even if the VBT
++ * indicates as much.
++ */
++ if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev)) {
++ bool bios_lvds_use_ssc = !!(I915_READ(PCH_DREF_CONTROL) &
++ DREF_SSC1_ENABLE);
++
++ if (dev_priv->vbt.lvds_use_ssc != bios_lvds_use_ssc) {
++ DRM_DEBUG_KMS("SSC %sabled by BIOS, overriding VBT which says %sabled\n",
++ bios_lvds_use_ssc ? "en" : "dis",
++ dev_priv->vbt.lvds_use_ssc ? "en" : "dis");
++ dev_priv->vbt.lvds_use_ssc = bios_lvds_use_ssc;
++ }
++ }
++
+ intel_init_display(dev);
+ intel_init_audio(dev);
+
+@@ -14266,7 +14284,6 @@ void intel_modeset_setup_hw_state(struct
+
+ void intel_modeset_gem_init(struct drm_device *dev)
+ {
+- struct drm_i915_private *dev_priv = dev->dev_private;
+ struct drm_crtc *c;
+ struct drm_i915_gem_object *obj;
+ int ret;
+@@ -14275,16 +14292,6 @@ void intel_modeset_gem_init(struct drm_d
+ intel_init_gt_powersave(dev);
+ mutex_unlock(&dev->struct_mutex);
+
+- /*
+- * There may be no VBT; and if the BIOS enabled SSC we can
+- * just keep using it to avoid unnecessary flicker. Whereas if the
+- * BIOS isn't using it, don't assume it will work even if the VBT
+- * indicates as much.
+- */
+- if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev))
+- dev_priv->vbt.lvds_use_ssc = !!(I915_READ(PCH_DREF_CONTROL) &
+- DREF_SSC1_ENABLE);
+-
+ intel_modeset_init_hw(dev);
+
+ intel_setup_overlay(dev);
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-qxl-validate-monitors-config-modes.patch b/kernel/kernel/files/patches/mageia/stable-drm-qxl-validate-monitors-config-modes.patch
new file mode 100644
index 00000000..2ee9e873
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-qxl-validate-monitors-config-modes.patch
@@ -0,0 +1,147 @@
+From bd3e1c7c6de9f5f70d97cdb6c817151c0477c5e3 Mon Sep 17 00:00:00 2001
+From: Jonathon Jongsma
+Date: Thu, 20 Aug 2015 14:04:32 -0500
+Subject: drm/qxl: validate monitors config modes
+
+From: Jonathon Jongsma
+
+commit bd3e1c7c6de9f5f70d97cdb6c817151c0477c5e3 upstream.
+
+Due to some recent changes in
+drm_helper_probe_single_connector_modes_merge_bits(), old custom modes
+were not being pruned properly. In current kernels,
+drm_mode_validate_basic() is called to sanity-check each mode in the
+list. If the sanity-check passes, the mode's status gets set to to
+MODE_OK. In older kernels this check was not done, so old custom modes
+would still have a status of MODE_UNVERIFIED at this point, and would
+therefore be pruned later in the function.
+
+As a result of this new behavior, the list of modes for a device always
+includes every custom mode ever configured for the device, with the
+largest one listed first. Since desktop environments usually choose the
+first preferred mode when a hotplug event is emitted, this had the
+result of making it very difficult for the user to reduce the size of
+the display.
+
+The qxl driver did implement the mode_valid connector function, but it
+was empty. In order to restore the old behavior where old custom modes
+are pruned, we implement a proper mode_valid function for the qxl
+driver. This function now checks each mode against the last configured
+custom mode and the list of standard modes. If the mode doesn't match
+any of these, its status is set to MODE_BAD so that it will be pruned as
+expected.
+
+Signed-off-by: Jonathon Jongsma
+Signed-off-by: Dave Airlie
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/qxl/qxl_display.c | 66 +++++++++++++++++++++++---------------
+ drivers/gpu/drm/qxl/qxl_drv.h | 2 +
+ 2 files changed, 42 insertions(+), 26 deletions(-)
+
+--- a/drivers/gpu/drm/qxl/qxl_display.c
++++ b/drivers/gpu/drm/qxl/qxl_display.c
+@@ -160,9 +160,35 @@ static int qxl_add_monitors_config_modes
+ *pwidth = head->width;
+ *pheight = head->height;
+ drm_mode_probed_add(connector, mode);
++ /* remember the last custom size for mode validation */
++ qdev->monitors_config_width = mode->hdisplay;
++ qdev->monitors_config_height = mode->vdisplay;
+ return 1;
+ }
+
++static struct mode_size {
++ int w;
++ int h;
++} common_modes[] = {
++ { 640, 480},
++ { 720, 480},
++ { 800, 600},
++ { 848, 480},
++ {1024, 768},
++ {1152, 768},
++ {1280, 720},
++ {1280, 800},
++ {1280, 854},
++ {1280, 960},
++ {1280, 1024},
++ {1440, 900},
++ {1400, 1050},
++ {1680, 1050},
++ {1600, 1200},
++ {1920, 1080},
++ {1920, 1200}
++};
++
+ static int qxl_add_common_modes(struct drm_connector *connector,
+ unsigned pwidth,
+ unsigned pheight)
+@@ -170,29 +196,6 @@ static int qxl_add_common_modes(struct d
+ struct drm_device *dev = connector->dev;
+ struct drm_display_mode *mode = NULL;
+ int i;
+- struct mode_size {
+- int w;
+- int h;
+- } common_modes[] = {
+- { 640, 480},
+- { 720, 480},
+- { 800, 600},
+- { 848, 480},
+- {1024, 768},
+- {1152, 768},
+- {1280, 720},
+- {1280, 800},
+- {1280, 854},
+- {1280, 960},
+- {1280, 1024},
+- {1440, 900},
+- {1400, 1050},
+- {1680, 1050},
+- {1600, 1200},
+- {1920, 1080},
+- {1920, 1200}
+- };
+-
+ for (i = 0; i < ARRAY_SIZE(common_modes); i++) {
+ mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h,
+ 60, false, false, false);
+@@ -823,11 +826,22 @@ static int qxl_conn_get_modes(struct drm
+ static int qxl_conn_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
++ struct drm_device *ddev = connector->dev;
++ struct qxl_device *qdev = ddev->dev_private;
++ int i;
++
+ /* TODO: is this called for user defined modes? (xrandr --add-mode)
+ * TODO: check that the mode fits in the framebuffer */
+- DRM_DEBUG("%s: %dx%d status=%d\n", mode->name, mode->hdisplay,
+- mode->vdisplay, mode->status);
+- return MODE_OK;
++
++ if(qdev->monitors_config_width == mode->hdisplay &&
++ qdev->monitors_config_height == mode->vdisplay)
++ return MODE_OK;
++
++ for (i = 0; i < ARRAY_SIZE(common_modes); i++) {
++ if (common_modes[i].w == mode->hdisplay && common_modes[i].h == mode->vdisplay)
++ return MODE_OK;
++ }
++ return MODE_BAD;
+ }
+
+ static struct drm_encoder *qxl_best_encoder(struct drm_connector *connector)
+--- a/drivers/gpu/drm/qxl/qxl_drv.h
++++ b/drivers/gpu/drm/qxl/qxl_drv.h
+@@ -325,6 +325,8 @@ struct qxl_device {
+ struct work_struct fb_work;
+
+ struct drm_property *hotplug_mode_update_property;
++ int monitors_config_width;
++ int monitors_config_height;
+ };
+
+ /* forward declaration for QXL_INFO_IO */
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-radeon-add-new-oland-pci-id.patch b/kernel/kernel/files/patches/mageia/stable-drm-radeon-add-new-oland-pci-id.patch
deleted file mode 100644
index fc3b4431..00000000
--- a/kernel/kernel/files/patches/mageia/stable-drm-radeon-add-new-oland-pci-id.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From e037239e5e7b61007763984aa35a8329596d8c88 Mon Sep 17 00:00:00 2001
-From: Alex Deucher
-Date: Mon, 10 Aug 2015 15:28:49 -0400
-Subject: drm/radeon: add new OLAND pci id
-
-From: Alex Deucher
-
-commit e037239e5e7b61007763984aa35a8329596d8c88 upstream.
-
-Signed-off-by: Alex Deucher
-Signed-off-by: Greg Kroah-Hartman
-
----
- include/drm/drm_pciids.h | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/include/drm/drm_pciids.h
-+++ b/include/drm/drm_pciids.h
-@@ -172,6 +172,7 @@
- {0x1002, 0x6610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
- {0x1002, 0x6611, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
- {0x1002, 0x6613, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
-+ {0x1002, 0x6617, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
- {0x1002, 0x6620, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
- {0x1002, 0x6621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
- {0x1002, 0x6623, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-radeon-atom-send-out-the-full-aux-address.patch b/kernel/kernel/files/patches/mageia/stable-drm-radeon-atom-send-out-the-full-aux-address.patch
new file mode 100644
index 00000000..7c961fcb
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-radeon-atom-send-out-the-full-aux-address.patch
@@ -0,0 +1,39 @@
+From 3f8340cc72c9a1a4b49bce7802afd7f248400ef5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?=
+Date: Thu, 27 Aug 2015 17:23:31 +0300
+Subject: drm/radeon/atom: Send out the full AUX address
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?=
+
+commit 3f8340cc72c9a1a4b49bce7802afd7f248400ef5 upstream.
+
+AUX addresses are 20 bits long. Send out the entire address instead of
+just the low 16 bits.
+
+Cc: Alex Deucher
+Cc: "Christian König"
+Signed-off-by: Ville Syrjälä
+Signed-off-by: Alex Deucher
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/radeon/atombios_dp.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/atombios_dp.c
++++ b/drivers/gpu/drm/radeon/atombios_dp.c
+@@ -171,8 +171,9 @@ radeon_dp_aux_transfer_atom(struct drm_d
+ return -E2BIG;
+
+ tx_buf[0] = msg->address & 0xff;
+- tx_buf[1] = msg->address >> 8;
+- tx_buf[2] = msg->request << 4;
++ tx_buf[1] = (msg->address >> 8) & 0xff;
++ tx_buf[2] = (msg->request << 4) |
++ ((msg->address >> 16) & 0xf);
+ tx_buf[3] = msg->size ? (msg->size - 1) : 0;
+
+ switch (msg->request & ~DP_AUX_I2C_MOT) {
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-radeon-don-t-link-train-displayport-on-hpd-until-we-get-the-dpcd.patch b/kernel/kernel/files/patches/mageia/stable-drm-radeon-don-t-link-train-displayport-on-hpd-until-we-get-the-dpcd.patch
new file mode 100644
index 00000000..fee261a2
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-radeon-don-t-link-train-displayport-on-hpd-until-we-get-the-dpcd.patch
@@ -0,0 +1,75 @@
+From 924f92bf12bfbef3662619e3ed24a1cea7c1cbcd Mon Sep 17 00:00:00 2001
+From: Stephen Chandler Paul
+Date: Fri, 21 Aug 2015 14:16:12 -0400
+Subject: DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd
+
+From: Stephen Chandler Paul
+
+commit 924f92bf12bfbef3662619e3ed24a1cea7c1cbcd upstream.
+
+Most of the time this isn't an issue since hotplugging an adaptor will
+trigger a crtc mode change which in turn, causes the driver to probe
+every DisplayPort for a dpcd. However, in cases where hotplugging
+doesn't cause a mode change (specifically when one unplugs a monitor
+from a DisplayPort connector, then plugs that same monitor back in
+seconds later on the same port without any other monitors connected), we
+never probe for the dpcd before starting the initial link training. What
+happens from there looks like this:
+
+ - GPU has only one monitor connected. It's connected via
+ DisplayPort, and does not go through an adaptor of any sort.
+
+ - User unplugs DisplayPort connector from GPU.
+
+ - Change in HPD is detected by the driver, we probe every
+ DisplayPort for a possible connection.
+
+ - Probe the port the user originally had the monitor connected
+ on for it's dpcd. This fails, and we clear the first (and only
+ the first) byte of the dpcd to indicate we no longer have a
+ dpcd for this port.
+
+ - User plugs the previously disconnected monitor back into the
+ same DisplayPort.
+
+ - radeon_connector_hotplug() is called before everyone else,
+ and tries to handle the link training. Since only the first
+ byte of the dpcd is zeroed, the driver is able to complete
+ link training but does so against the wrong dpcd, causing it
+ to initialize the link with the wrong settings.
+
+ - Display stays blank (usually), dpcd is probed after the
+ initial link training, and the driver prints no obvious
+ messages to the log.
+
+In theory, since only one byte of the dpcd is chopped off (specifically,
+the byte that contains the revision information for DisplayPort), it's
+not entirely impossible that this bug may not show on certain monitors.
+For instance, the only reason this bug was visible on my ASUS PB238
+monitor was due to the fact that this monitor using the enhanced framing
+symbol sequence, the flag for which is ignored if the radeon driver
+thinks that the DisplayPort version is below 1.1.
+
+Signed-off-by: Stephen Chandler Paul
+Reviewed-by: Jerome Glisse
+Signed-off-by: Alex Deucher
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/radeon/radeon_connectors.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/gpu/drm/radeon/radeon_connectors.c
++++ b/drivers/gpu/drm/radeon/radeon_connectors.c
+@@ -95,6 +95,11 @@ void radeon_connector_hotplug(struct drm
+ if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
+ drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
+ } else if (radeon_dp_needs_link_train(radeon_connector)) {
++ /* Don't try to start link training before we
++ * have the dpcd */
++ if (!radeon_dp_getdpcd(radeon_connector))
++ return;
++
+ /* set it to OFF so that drm_helper_connector_dpms()
+ * won't return immediately since the current state
+ * is ON at this point.
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-radeon-fix-hdmi-quantization_range-for-pre-dce5-asics.patch b/kernel/kernel/files/patches/mageia/stable-drm-radeon-fix-hdmi-quantization_range-for-pre-dce5-asics.patch
new file mode 100644
index 00000000..90a2ec0c
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-radeon-fix-hdmi-quantization_range-for-pre-dce5-asics.patch
@@ -0,0 +1,47 @@
+From 86b7709d48f0df8796bddd7e1ce45c6fb7a7c6ec Mon Sep 17 00:00:00 2001
+From: Alex Deucher
+Date: Thu, 27 Aug 2015 09:52:22 -0400
+Subject: drm/radeon: fix HDMI quantization_range for pre-DCE5 asics
+
+From: Alex Deucher
+
+commit 86b7709d48f0df8796bddd7e1ce45c6fb7a7c6ec upstream.
+
+Support for output_csc is only available on DCE5 and newer so
+don't mess with the HDMI quantization_range on pre-DCE5 asics.
+
+bug:
+https://bugs.freedesktop.org/show_bug.cgi?id=83226
+
+Signed-off-by: Alex Deucher
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/radeon/radeon_audio.c | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_audio.c
++++ b/drivers/gpu/drm/radeon/radeon_audio.c
+@@ -522,13 +522,15 @@ static int radeon_audio_set_avi_packet(s
+ return err;
+ }
+
+- if (drm_rgb_quant_range_selectable(radeon_connector_edid(connector))) {
+- if (radeon_encoder->output_csc == RADEON_OUTPUT_CSC_TVRGB)
+- frame.quantization_range = HDMI_QUANTIZATION_RANGE_LIMITED;
+- else
+- frame.quantization_range = HDMI_QUANTIZATION_RANGE_FULL;
+- } else {
+- frame.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT;
++ if (radeon_encoder->output_csc != RADEON_OUTPUT_CSC_BYPASS) {
++ if (drm_rgb_quant_range_selectable(radeon_connector_edid(connector))) {
++ if (radeon_encoder->output_csc == RADEON_OUTPUT_CSC_TVRGB)
++ frame.quantization_range = HDMI_QUANTIZATION_RANGE_LIMITED;
++ else
++ frame.quantization_range = HDMI_QUANTIZATION_RANGE_FULL;
++ } else {
++ frame.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT;
++ }
+ }
+
+ err = hdmi_avi_infoframe_pack(&frame, buffer, sizeof(buffer));
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-radeon-native-send-out-the-full-aux-address.patch b/kernel/kernel/files/patches/mageia/stable-drm-radeon-native-send-out-the-full-aux-address.patch
new file mode 100644
index 00000000..d89b354a
--- /dev/null
+++ b/kernel/kernel/files/patches/mageia/stable-drm-radeon-native-send-out-the-full-aux-address.patch
@@ -0,0 +1,40 @@
+From 7040c399aea2b0213a9aefd73e507369a6d641d6 Mon Sep 17 00:00:00 2001
+From: Alex Deucher
+Date: Mon, 31 Aug 2015 11:15:05 -0400
+Subject: drm/radeon/native: Send out the full AUX address
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Alex Deucher
+
+commit 7040c399aea2b0213a9aefd73e507369a6d641d6 upstream.
+
+AUX addresses are 20 bits long. Send out the entire address instead of
+just the low 16 bits.
+
+Port of:
+drm/radeon/atom: Send out the full AUX address
+to radeon non-atom aux path
+
+Reviewed-by: Christian König
+Signed-off-by: Alex Deucher
+Signed-off-by: Greg Kroah-Hartman
+
+---
+ drivers/gpu/drm/radeon/radeon_dp_auxch.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_dp_auxch.c
++++ b/drivers/gpu/drm/radeon/radeon_dp_auxch.c
+@@ -116,8 +116,8 @@ radeon_dp_aux_transfer_native(struct drm
+ AUX_SW_WR_BYTES(bytes));
+
+ /* write the data header into the registers */
+- /* request, addres, msg size */
+- byte = (msg->request << 4);
++ /* request, address, msg size */
++ byte = (msg->request << 4) | ((msg->address >> 16) & 0xf);
+ WREG32(AUX_SW_DATA + aux_offset[instance],
+ AUX_SW_DATA_MASK(byte) | AUX_SW_AUTOINCREMENT_DISABLE);
+
diff --git a/kernel/kernel/files/patches/mageia/stable-drm-vmwgfx-fix-execbuf-locking-issues.patch b/kernel/kernel/files/patches/mageia/stable-drm-vmwgfx-fix-execbuf-locking-issues.patch
deleted file mode 100644
index c8232310..00000000
--- a/kernel/kernel/files/patches/mageia/stable-drm-vmwgfx-fix-execbuf-locking-issues.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 3e04e2fe6d87807d27521ad6ebb9e7919d628f25 Mon Sep 17 00:00:00 2001
-From: Thomas Hellstrom
-Date: Tue, 11 Aug 2015 22:31:17 -0700
-Subject: drm/vmwgfx: Fix execbuf locking issues
-
-From: Thomas Hellstrom
-
-commit 3e04e2fe6d87807d27521ad6ebb9e7919d628f25 upstream.
-
-This addresses two issues that cause problems with viewperf maya-03 in
-situation with memory pressure.
-
-The first issue causes attempts to unreserve buffers if batched
-reservation fails due to, for example, a signal pending. While previously
-the ttm_eu api was resistant against this type of error, it is no longer
-and the lockdep code will complain about attempting to unreserve buffers
-that are not reserved. The issue is resolved by avoid calling
-ttm_eu_backoff_reservation in the buffer reserve error path.
-
-The second issue is that the binding_mutex may be held when user-space
-fence objects are created and hence during memory reclaims. This may cause
-recursive attempts to grab the binding mutex. The issue is resolved by not
-holding the binding mutex across fence creation and submission.
-
-Signed-off-by: Thomas Hellstrom
-Reviewed-by: Sinclair Yeh
-Signed-off-by: Dave Airlie
-Signed-off-by: Greg Kroah-Hartman
-
----
- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
-+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
-@@ -2492,7 +2492,7 @@ int vmw_execbuf_process(struct drm_file
- ret = ttm_eu_reserve_buffers(&ticket, &sw_context->validate_nodes,
- true, NULL);
- if (unlikely(ret != 0))
-- goto out_err;
-+ goto out_err_nores;
-
- ret = vmw_validate_buffers(dev_priv, sw_context);
- if (unlikely(ret != 0))
-@@ -2536,6 +2536,7 @@ int vmw_execbuf_process(struct drm_file
- vmw_resource_relocations_free(&sw_context->res_relocations);
-
- vmw_fifo_commit(dev_priv, command_size);
-+ mutex_unlock(&dev_priv->binding_mutex);
-
- vmw_query_bo_switch_commit(dev_priv, sw_context);
- ret = vmw_execbuf_fence_commands(file_priv, dev_priv,
-@@ -2551,7 +2552,6 @@ int vmw_execbuf_process(struct drm_file
- DRM_ERROR("Fence submission error. Syncing.\n");
-
- vmw_resource_list_unreserve(&sw_context->resource_list, false);
-- mutex_unlock(&dev_priv->binding_mutex);
-
- ttm_eu_fence_buffer_objects(&ticket, &sw_context->validate_nodes,
- (void *) fence);
diff --git a/kernel/kernel/files/patches/mageia/stable-edac-ppc4xx-access-mci-csrows-array-elements-properly.patch b/kernel/kernel/files/patches/mageia/stable-edac-ppc4xx-access-mci-csrows-array-elements-properly.patch
deleted file mode 100644
index bc5b51c9..00000000
--- a/kernel/kernel/files/patches/mageia/stable-edac-ppc4xx-access-mci-csrows-array-elements-properly.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 5c16179b550b9fd8114637a56b153c9768ea06a5 Mon Sep 17 00:00:00 2001
-From: Michael Walle
-Date: Tue, 21 Jul 2015 11:00:53 +0200
-Subject: EDAC, ppc4xx: Access mci->csrows array elements properly
-
-From: Michael Walle
-
-commit 5c16179b550b9fd8114637a56b153c9768ea06a5 upstream.
-
-The commit
-
- de3910eb79ac ("edac: change the mem allocation scheme to
- make Documentation/kobject.txt happy")
-
-changed the memory allocation for the csrows member. But ppc4xx_edac was
-forgotten in the patch. Fix it.
-
-Signed-off-by: Michael Walle
-Cc: linux-edac
-Cc: Mauro Carvalho Chehab
-Link: http://lkml.kernel.org/r/1437469253-8611-1-git-send-email-michael@walle.cc
-Signed-off-by: Borislav Petkov