From: Greg Kroah-Hartman Date: Mon, 11 Mar 2019 22:13:24 +0000 (-0700) Subject: 4.9-stable patches X-Git-Tag: v5.0.2~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f6d79239c24f4949b80827070c89c3417cdd579;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: futex-rt_mutex-restructure-rt_mutex_finish_proxy_lock.patch input-elan_i2c-add-id-for-touchpad-found-in-lenovo-s21e-20.patch input-wacom_serial4-add-support-for-wacom-artpad-ii-tablet.patch iscsi_ibft-fix-missing-break-in-switch-statement.patch scsi-aacraid-fix-missing-break-in-switch-statement.patch --- diff --git a/queue-4.9/futex-rt_mutex-restructure-rt_mutex_finish_proxy_lock.patch b/queue-4.9/futex-rt_mutex-restructure-rt_mutex_finish_proxy_lock.patch new file mode 100644 index 00000000000..e1c336123ba --- /dev/null +++ b/queue-4.9/futex-rt_mutex-restructure-rt_mutex_finish_proxy_lock.patch @@ -0,0 +1,163 @@ +From 38d589f2fd08f1296aea3ce62bebd185125c6d81 Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Wed, 22 Mar 2017 11:35:57 +0100 +Subject: futex,rt_mutex: Restructure rt_mutex_finish_proxy_lock() + +From: Peter Zijlstra + +commit 38d589f2fd08f1296aea3ce62bebd185125c6d81 upstream. + +With the ultimate goal of keeping rt_mutex wait_list and futex_q waiters +consistent it's necessary to split 'rt_mutex_futex_lock()' into finer +parts, such that only the actual blocking can be done without hb->lock +held. + +Split split_mutex_finish_proxy_lock() into two parts, one that does the +blocking and one that does remove_waiter() when the lock acquire failed. + +When the rtmutex was acquired successfully the waiter can be removed in the +acquisiton path safely, since there is no concurrency on the lock owner. + +This means that, except for futex_lock_pi(), all wait_list modifications +are done with both hb->lock and wait_lock held. + +[bigeasy@linutronix.de: fix for futex_requeue_pi_signal_restart] + +Signed-off-by: Peter Zijlstra (Intel) +Cc: juri.lelli@arm.com +Cc: bigeasy@linutronix.de +Cc: xlpang@redhat.com +Cc: rostedt@goodmis.org +Cc: mathieu.desnoyers@efficios.com +Cc: jdesfossez@efficios.com +Cc: dvhart@infradead.org +Cc: bristot@redhat.com +Link: http://lkml.kernel.org/r/20170322104152.001659630@infradead.org +Signed-off-by: Thomas Gleixner +Signed-off-by: Zubin Mithra +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/futex.c | 7 +++-- + kernel/locking/rtmutex.c | 52 ++++++++++++++++++++++++++++++++++------ + kernel/locking/rtmutex_common.h | 8 +++--- + 3 files changed, 55 insertions(+), 12 deletions(-) + +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -2966,10 +2966,13 @@ static int futex_wait_requeue_pi(u32 __u + */ + WARN_ON(!q.pi_state); + pi_mutex = &q.pi_state->pi_mutex; +- ret = rt_mutex_finish_proxy_lock(pi_mutex, to, &rt_waiter); +- debug_rt_mutex_free_waiter(&rt_waiter); ++ ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); + + spin_lock(q.lock_ptr); ++ if (ret && !rt_mutex_cleanup_proxy_lock(pi_mutex, &rt_waiter)) ++ ret = 0; ++ ++ debug_rt_mutex_free_waiter(&rt_waiter); + /* + * Fixup the pi_state owner and possibly acquire the lock if we + * haven't already. +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -1746,21 +1746,23 @@ struct task_struct *rt_mutex_next_owner( + } + + /** +- * rt_mutex_finish_proxy_lock() - Complete lock acquisition ++ * rt_mutex_wait_proxy_lock() - Wait for lock acquisition + * @lock: the rt_mutex we were woken on + * @to: the timeout, null if none. hrtimer should already have + * been started. + * @waiter: the pre-initialized rt_mutex_waiter + * +- * Complete the lock acquisition started our behalf by another thread. ++ * Wait for the the lock acquisition started on our behalf by ++ * rt_mutex_start_proxy_lock(). Upon failure, the caller must call ++ * rt_mutex_cleanup_proxy_lock(). + * + * Returns: + * 0 - success + * <0 - error, one of -EINTR, -ETIMEDOUT + * +- * Special API call for PI-futex requeue support ++ * Special API call for PI-futex support + */ +-int rt_mutex_finish_proxy_lock(struct rt_mutex *lock, ++int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, + struct hrtimer_sleeper *to, + struct rt_mutex_waiter *waiter) + { +@@ -1773,9 +1775,6 @@ int rt_mutex_finish_proxy_lock(struct rt + /* sleep on the mutex */ + ret = __rt_mutex_slowlock(lock, TASK_INTERRUPTIBLE, to, waiter); + +- if (unlikely(ret)) +- remove_waiter(lock, waiter); +- + /* + * try_to_take_rt_mutex() sets the waiter bit unconditionally. We might + * have to fix that up. +@@ -1786,3 +1785,42 @@ int rt_mutex_finish_proxy_lock(struct rt + + return ret; + } ++ ++/** ++ * rt_mutex_cleanup_proxy_lock() - Cleanup failed lock acquisition ++ * @lock: the rt_mutex we were woken on ++ * @waiter: the pre-initialized rt_mutex_waiter ++ * ++ * Attempt to clean up after a failed rt_mutex_wait_proxy_lock(). ++ * ++ * Unless we acquired the lock; we're still enqueued on the wait-list and can ++ * in fact still be granted ownership until we're removed. Therefore we can ++ * find we are in fact the owner and must disregard the ++ * rt_mutex_wait_proxy_lock() failure. ++ * ++ * Returns: ++ * true - did the cleanup, we done. ++ * false - we acquired the lock after rt_mutex_wait_proxy_lock() returned, ++ * caller should disregards its return value. ++ * ++ * Special API call for PI-futex support ++ */ ++bool rt_mutex_cleanup_proxy_lock(struct rt_mutex *lock, ++ struct rt_mutex_waiter *waiter) ++{ ++ bool cleanup = false; ++ ++ raw_spin_lock_irq(&lock->wait_lock); ++ /* ++ * Unless we're the owner; we're still enqueued on the wait_list. ++ * So check if we became owner, if not, take us off the wait_list. ++ */ ++ if (rt_mutex_owner(lock) != current) { ++ remove_waiter(lock, waiter); ++ fixup_rt_mutex_waiters(lock); ++ cleanup = true; ++ } ++ raw_spin_unlock_irq(&lock->wait_lock); ++ ++ return cleanup; ++} +--- a/kernel/locking/rtmutex_common.h ++++ b/kernel/locking/rtmutex_common.h +@@ -107,9 +107,11 @@ extern void rt_mutex_proxy_unlock(struct + extern int rt_mutex_start_proxy_lock(struct rt_mutex *lock, + struct rt_mutex_waiter *waiter, + struct task_struct *task); +-extern int rt_mutex_finish_proxy_lock(struct rt_mutex *lock, +- struct hrtimer_sleeper *to, +- struct rt_mutex_waiter *waiter); ++extern int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, ++ struct hrtimer_sleeper *to, ++ struct rt_mutex_waiter *waiter); ++extern bool rt_mutex_cleanup_proxy_lock(struct rt_mutex *lock, ++ struct rt_mutex_waiter *waiter); + extern int rt_mutex_timed_futex_lock(struct rt_mutex *l, struct hrtimer_sleeper *to); + extern bool rt_mutex_futex_unlock(struct rt_mutex *lock, + struct wake_q_head *wqh); diff --git a/queue-4.9/input-elan_i2c-add-id-for-touchpad-found-in-lenovo-s21e-20.patch b/queue-4.9/input-elan_i2c-add-id-for-touchpad-found-in-lenovo-s21e-20.patch new file mode 100644 index 00000000000..5f365f9caa4 --- /dev/null +++ b/queue-4.9/input-elan_i2c-add-id-for-touchpad-found-in-lenovo-s21e-20.patch @@ -0,0 +1,30 @@ +From e154ab69321ce2c54f19863d75c77b4e2dc9d365 Mon Sep 17 00:00:00 2001 +From: Vincent Batts +Date: Sat, 9 Mar 2019 15:48:04 -0800 +Subject: Input: elan_i2c - add id for touchpad found in Lenovo s21e-20 + +From: Vincent Batts + +commit e154ab69321ce2c54f19863d75c77b4e2dc9d365 upstream. + +Lenovo s21e-20 uses ELAN0601 in its ACPI tables for the Elan touchpad. + +Signed-off-by: Vincent Batts +Cc: stable@vger.kernel.org +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/mouse/elan_i2c_core.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/input/mouse/elan_i2c_core.c ++++ b/drivers/input/mouse/elan_i2c_core.c +@@ -1241,6 +1241,7 @@ static const struct acpi_device_id elan_ + { "ELAN0000", 0 }, + { "ELAN0100", 0 }, + { "ELAN0600", 0 }, ++ { "ELAN0601", 0 }, + { "ELAN0602", 0 }, + { "ELAN0605", 0 }, + { "ELAN0608", 0 }, diff --git a/queue-4.9/input-wacom_serial4-add-support-for-wacom-artpad-ii-tablet.patch b/queue-4.9/input-wacom_serial4-add-support-for-wacom-artpad-ii-tablet.patch new file mode 100644 index 00000000000..9c9f8fa60b6 --- /dev/null +++ b/queue-4.9/input-wacom_serial4-add-support-for-wacom-artpad-ii-tablet.patch @@ -0,0 +1,43 @@ +From 44fc95e218a09d7966a9d448941fdb003f6bb69f Mon Sep 17 00:00:00 2001 +From: Jason Gerecke +Date: Sat, 9 Mar 2019 15:32:13 -0800 +Subject: Input: wacom_serial4 - add support for Wacom ArtPad II tablet + +From: Jason Gerecke + +commit 44fc95e218a09d7966a9d448941fdb003f6bb69f upstream. + +Tablet initially begins communicating at 9600 baud, so this command +should be used to connect to the device: + + $ inputattach --daemon --baud 9600 --wacom_iv /dev/ttyS0 + +https://github.com/linuxwacom/xf86-input-wacom/issues/40 + +Signed-off-by: Jason Gerecke +Cc: stable@vger.kernel.org +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/tablet/wacom_serial4.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/input/tablet/wacom_serial4.c ++++ b/drivers/input/tablet/wacom_serial4.c +@@ -187,6 +187,7 @@ enum { + MODEL_DIGITIZER_II = 0x5544, /* UD */ + MODEL_GRAPHIRE = 0x4554, /* ET */ + MODEL_PENPARTNER = 0x4354, /* CT */ ++ MODEL_ARTPAD_II = 0x4B54, /* KT */ + }; + + static void wacom_handle_model_response(struct wacom *wacom) +@@ -245,6 +246,7 @@ static void wacom_handle_model_response( + wacom->flags = F_HAS_STYLUS2 | F_HAS_SCROLLWHEEL; + break; + ++ case MODEL_ARTPAD_II: + case MODEL_DIGITIZER_II: + wacom->dev->name = "Wacom Digitizer II"; + wacom->dev->id.version = MODEL_DIGITIZER_II; diff --git a/queue-4.9/iscsi_ibft-fix-missing-break-in-switch-statement.patch b/queue-4.9/iscsi_ibft-fix-missing-break-in-switch-statement.patch new file mode 100644 index 00000000000..e58ae8f2a69 --- /dev/null +++ b/queue-4.9/iscsi_ibft-fix-missing-break-in-switch-statement.patch @@ -0,0 +1,35 @@ +From df997abeebadaa4824271009e2d2b526a70a11cb Mon Sep 17 00:00:00 2001 +From: "Gustavo A. R. Silva" +Date: Mon, 11 Feb 2019 12:43:23 -0600 +Subject: iscsi_ibft: Fix missing break in switch statement + +From: Gustavo A. R. Silva + +commit df997abeebadaa4824271009e2d2b526a70a11cb upstream. + +Add missing break statement in order to prevent the code from falling +through to case ISCSI_BOOT_TGT_NAME, which is unnecessary. + +This bug was found thanks to the ongoing efforts to enable +-Wimplicit-fallthrough. + +Fixes: b33a84a38477 ("ibft: convert iscsi_ibft module to iscsi boot lib") +Cc: stable@vger.kernel.org +Signed-off-by: Gustavo A. R. Silva +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firmware/iscsi_ibft.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/firmware/iscsi_ibft.c ++++ b/drivers/firmware/iscsi_ibft.c +@@ -542,6 +542,7 @@ static umode_t __init ibft_check_tgt_for + case ISCSI_BOOT_TGT_NIC_ASSOC: + case ISCSI_BOOT_TGT_CHAP_TYPE: + rc = S_IRUGO; ++ break; + case ISCSI_BOOT_TGT_NAME: + if (tgt->tgt_name_len) + rc = S_IRUGO; diff --git a/queue-4.9/scsi-aacraid-fix-missing-break-in-switch-statement.patch b/queue-4.9/scsi-aacraid-fix-missing-break-in-switch-statement.patch new file mode 100644 index 00000000000..8834a3f14bc --- /dev/null +++ b/queue-4.9/scsi-aacraid-fix-missing-break-in-switch-statement.patch @@ -0,0 +1,38 @@ +From 5e420fe635813e5746b296cfc8fff4853ae205a2 Mon Sep 17 00:00:00 2001 +From: "Gustavo A. R. Silva" +Date: Fri, 15 Feb 2019 15:42:42 -0600 +Subject: scsi: aacraid: Fix missing break in switch statement + +From: Gustavo A. R. Silva + +commit 5e420fe635813e5746b296cfc8fff4853ae205a2 upstream. + +Add missing break statement and fix identation issue. + +This bug was found thanks to the ongoing efforts to enable +-Wimplicit-fallthrough. + +Fixes: 9cb62fa24e0d ("aacraid: Log firmware AIF messages") +Cc: stable@vger.kernel.org +Signed-off-by: Gustavo A. R. Silva +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/aacraid/commsup.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/aacraid/commsup.c ++++ b/drivers/scsi/aacraid/commsup.c +@@ -1179,8 +1179,9 @@ static void aac_handle_aif(struct aac_de + ADD : DELETE; + break; + } +- case AifBuManagerEvent: +- aac_handle_aif_bu(dev, aifcmd); ++ break; ++ case AifBuManagerEvent: ++ aac_handle_aif_bu(dev, aifcmd); + break; + } + diff --git a/queue-4.9/series b/queue-4.9/series index 499e6873f9a..a3d826edc57 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -81,3 +81,8 @@ perf-trace-support-multiple-vfs_getname-probes.patch mips-loongson-introduce-and-use-loongson_llsc_mb.patch mips-remove-function-size-check-in-get_frame_info.patch fs-ratelimit-__find_get_block_slow-failure-message.patch +input-wacom_serial4-add-support-for-wacom-artpad-ii-tablet.patch +input-elan_i2c-add-id-for-touchpad-found-in-lenovo-s21e-20.patch +iscsi_ibft-fix-missing-break-in-switch-statement.patch +scsi-aacraid-fix-missing-break-in-switch-statement.patch +futex-rt_mutex-restructure-rt_mutex_finish_proxy_lock.patch