]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fixes for 5.3
authorSasha Levin <sashal@kernel.org>
Wed, 2 Oct 2019 01:08:44 +0000 (21:08 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 2 Oct 2019 01:08:44 +0000 (21:08 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.3/alsa-hda-realtek-pci-quirk-for-medion-e4254.patch [new file with mode: 0644]
queue-5.3/blk-mq-add-callback-of-.cleanup_rq.patch [new file with mode: 0644]
queue-5.3/drm-i915-perf-fix-icl-perf-register-offsets.patch [new file with mode: 0644]
queue-5.3/scsi-implement-.cleanup_rq-callback.patch [new file with mode: 0644]
queue-5.3/series

diff --git a/queue-5.3/alsa-hda-realtek-pci-quirk-for-medion-e4254.patch b/queue-5.3/alsa-hda-realtek-pci-quirk-for-medion-e4254.patch
new file mode 100644 (file)
index 0000000..49f9a02
--- /dev/null
@@ -0,0 +1,84 @@
+From 2f91d77850747ea7b6c09d8c65d419680a20810b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 15 Sep 2019 16:57:28 +0200
+Subject: ALSA: hda/realtek - PCI quirk for Medion E4254
+
+From: Jan-Marek Glogowski <glogow@fbihome.de>
+
+[ Upstream commit bd9c10bc663dd2eaac8fe39dad0f18cd21527446 ]
+
+The laptop has a combined jack to attach headsets on the right.
+The BIOS encodes them as two different colored jacks at the front,
+but otherwise it seems to be configured ok. But any adaption of
+the pins config on its own doesn't fix the jack detection to work
+in Linux. Still Windows works correct.
+
+This is somehow fixed by chaining ALC256_FIXUP_ASUS_HEADSET_MODE,
+which seems to register the microphone jack as a headset part and
+also results in fixing jack sensing, visible in dmesg as:
+
+-snd_hda_codec_realtek hdaudioC0D0:      Mic=0x19
++snd_hda_codec_realtek hdaudioC0D0:      Headset Mic=0x19
+
+[ Actually the essential change is the location of the jack; the
+  driver created "Front Mic Jack" without the matching volume / mute
+  control element due to its jack location, which confused PA.
+  -- tiwai ]
+
+Signed-off-by: Jan-Marek Glogowski <glogow@fbihome.de>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/8f4f9b20-0aeb-f8f1-c02f-fd53c09679f1@fbihome.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/pci/hda/patch_realtek.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index d223a79ac934f..36aee8ad20547 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -5870,6 +5870,7 @@ enum {
+       ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
+       ALC299_FIXUP_PREDATOR_SPK,
+       ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC,
++      ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
+ };
+ static const struct hda_fixup alc269_fixups[] = {
+@@ -6926,6 +6927,16 @@ static const struct hda_fixup alc269_fixups[] = {
+               .chained = true,
+               .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
+       },
++      [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
++              .type = HDA_FIXUP_PINS,
++              .v.pins = (const struct hda_pintbl[]) {
++                      { 0x19, 0x04a11040 },
++                      { 0x21, 0x04211020 },
++                      { }
++              },
++              .chained = true,
++              .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
++      },
+ };
+ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
+@@ -7189,6 +7200,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
+       SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
+       SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
+       SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
++      SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
+ #if 0
+       /* Below is a quirk table taken from the old code.
+@@ -7357,6 +7369,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
+       {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
+       {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
+       {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
++      {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
+       {}
+ };
+ #define ALC225_STANDARD_PINS \
+-- 
+2.20.1
+
diff --git a/queue-5.3/blk-mq-add-callback-of-.cleanup_rq.patch b/queue-5.3/blk-mq-add-callback-of-.cleanup_rq.patch
new file mode 100644 (file)
index 0000000..c9a72c1
--- /dev/null
@@ -0,0 +1,98 @@
+From e3fbbbc2691532613e550e201ec65d3672dd0404 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 25 Jul 2019 10:04:59 +0800
+Subject: blk-mq: add callback of .cleanup_rq
+
+From: Ming Lei <ming.lei@redhat.com>
+
+[ Upstream commit 226b4fc75c78f9c497c5182d939101b260cfb9f3 ]
+
+SCSI maintains its own driver private data hooked off of each SCSI
+request, and the pridate data won't be freed after scsi_queue_rq()
+returns BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE. An upper layer driver
+(e.g. dm-rq) may need to retry these SCSI requests, before SCSI has
+fully dispatched them, due to a lower level SCSI driver's resource
+limitation identified in scsi_queue_rq(). Currently SCSI's per-request
+private data is leaked when the upper layer driver (dm-rq) frees and
+then retries these requests in response to BLK_STS_RESOURCE or
+BLK_STS_DEV_RESOURCE returns from scsi_queue_rq().
+
+This usecase is so specialized that it doesn't warrant training an
+existing blk-mq interface (e.g. blk_mq_free_request) to allow SCSI to
+account for freeing its driver private data -- doing so would add an
+extra branch for handling a special case that all other consumers of
+SCSI (and blk-mq) won't ever need to worry about.
+
+So the most pragmatic way forward is to delegate freeing SCSI driver
+private data to the upper layer driver (dm-rq).  Do so by adding
+new .cleanup_rq callback and calling a new blk_mq_cleanup_rq() method
+from dm-rq.  A following commit will implement the .cleanup_rq() hook
+in scsi_mq_ops.
+
+Cc: Ewan D. Milne <emilne@redhat.com>
+Cc: Bart Van Assche <bvanassche@acm.org>
+Cc: Hannes Reinecke <hare@suse.com>
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: Mike Snitzer <snitzer@redhat.com>
+Cc: dm-devel@redhat.com
+Cc: <stable@vger.kernel.org>
+Fixes: 396eaf21ee17 ("blk-mq: improve DM's blk-mq IO merging via blk_insert_cloned_request feedback")
+Signed-off-by: Ming Lei <ming.lei@redhat.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/md/dm-rq.c     |  1 +
+ include/linux/blk-mq.h | 13 +++++++++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
+index c9e44ac1f9a6d..21d5c1784d0ce 100644
+--- a/drivers/md/dm-rq.c
++++ b/drivers/md/dm-rq.c
+@@ -408,6 +408,7 @@ static int map_request(struct dm_rq_target_io *tio)
+               ret = dm_dispatch_clone_request(clone, rq);
+               if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE) {
+                       blk_rq_unprep_clone(clone);
++                      blk_mq_cleanup_rq(clone);
+                       tio->ti->type->release_clone_rq(clone, &tio->info);
+                       tio->clone = NULL;
+                       return DM_MAPIO_REQUEUE;
+diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
+index 3fa1fa59f9b2e..ab25e69a15d11 100644
+--- a/include/linux/blk-mq.h
++++ b/include/linux/blk-mq.h
+@@ -140,6 +140,7 @@ typedef int (poll_fn)(struct blk_mq_hw_ctx *);
+ typedef int (map_queues_fn)(struct blk_mq_tag_set *set);
+ typedef bool (busy_fn)(struct request_queue *);
+ typedef void (complete_fn)(struct request *);
++typedef void (cleanup_rq_fn)(struct request *);
+ struct blk_mq_ops {
+@@ -200,6 +201,12 @@ struct blk_mq_ops {
+       /* Called from inside blk_get_request() */
+       void (*initialize_rq_fn)(struct request *rq);
++      /*
++       * Called before freeing one request which isn't completed yet,
++       * and usually for freeing the driver private data
++       */
++      cleanup_rq_fn           *cleanup_rq;
++
+       /*
+        * If set, returns whether or not this queue currently is busy
+        */
+@@ -366,4 +373,10 @@ static inline blk_qc_t request_to_qc_t(struct blk_mq_hw_ctx *hctx,
+                       BLK_QC_T_INTERNAL;
+ }
++static inline void blk_mq_cleanup_rq(struct request *rq)
++{
++      if (rq->q->mq_ops->cleanup_rq)
++              rq->q->mq_ops->cleanup_rq(rq);
++}
++
+ #endif
+-- 
+2.20.1
+
diff --git a/queue-5.3/drm-i915-perf-fix-icl-perf-register-offsets.patch b/queue-5.3/drm-i915-perf-fix-icl-perf-register-offsets.patch
new file mode 100644 (file)
index 0000000..fb6ce56
--- /dev/null
@@ -0,0 +1,41 @@
+From 42fea671d859839839735f363192d60c29fb0fc9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 29 Jul 2019 12:28:41 +0300
+Subject: drm/i915/perf: fix ICL perf register offsets
+
+From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
+
+[ Upstream commit 8dcfdfb4501012a8d36d2157dc73925715f2befb ]
+
+We got the wrong offsets (could they have changed?). New values were
+computed off an error state by looking up the register offset in the
+context image as written by the HW.
+
+Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
+Fixes: 1de401c08fa805 ("drm/i915/perf: enable perf support on ICL")
+Acked-by: Kenneth Graunke <kenneth@whitecape.org>
+Link: https://patchwork.freedesktop.org/patch/msgid/20190610081914.25428-1-lionel.g.landwerlin@intel.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/bridge/br_vlan.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
+index f5b2aeebbfe98..339236f75a2a0 100644
+--- a/net/bridge/br_vlan.c
++++ b/net/bridge/br_vlan.c
+@@ -715,6 +715,11 @@ void br_vlan_flush(struct net_bridge *br)
+       ASSERT_RTNL();
++      /* delete auto-added default pvid local fdb before flushing vlans
++       * otherwise it will be leaked on bridge device init failure
++       */
++      br_fdb_delete_by_port(br, NULL, 0, 1);
++
+       vg = br_vlan_group(br);
+       __vlan_flush(vg);
+       RCU_INIT_POINTER(br->vlgrp, NULL);
+-- 
+2.20.1
+
diff --git a/queue-5.3/scsi-implement-.cleanup_rq-callback.patch b/queue-5.3/scsi-implement-.cleanup_rq-callback.patch
new file mode 100644 (file)
index 0000000..97c89a7
--- /dev/null
@@ -0,0 +1,62 @@
+From 12eb9fca217615750122e1b959a690d8c80a7705 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 25 Jul 2019 10:05:00 +0800
+Subject: scsi: implement .cleanup_rq callback
+
+From: Ming Lei <ming.lei@redhat.com>
+
+[ Upstream commit b7e9e1fb7a9227be34ad4a5e778022c3164494cf ]
+
+Implement .cleanup_rq() callback for freeing driver private part
+of the request. Then we can avoid to leak this part if the request isn't
+completed by SCSI, and freed by blk-mq or upper layer(such as dm-rq) finally.
+
+Cc: Ewan D. Milne <emilne@redhat.com>
+Cc: Bart Van Assche <bvanassche@acm.org>
+Cc: Hannes Reinecke <hare@suse.com>
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: Mike Snitzer <snitzer@redhat.com>
+Cc: dm-devel@redhat.com
+Cc: <stable@vger.kernel.org>
+Fixes: 396eaf21ee17 ("blk-mq: improve DM's blk-mq IO merging via blk_insert_cloned_request feedback")
+Signed-off-by: Ming Lei <ming.lei@redhat.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/scsi_lib.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
+index 11e64b50497f8..4e88d7e9cf9a3 100644
+--- a/drivers/scsi/scsi_lib.c
++++ b/drivers/scsi/scsi_lib.c
+@@ -1089,6 +1089,18 @@ static void scsi_initialize_rq(struct request *rq)
+       cmd->retries = 0;
+ }
++/*
++ * Only called when the request isn't completed by SCSI, and not freed by
++ * SCSI
++ */
++static void scsi_cleanup_rq(struct request *rq)
++{
++      if (rq->rq_flags & RQF_DONTPREP) {
++              scsi_mq_uninit_cmd(blk_mq_rq_to_pdu(rq));
++              rq->rq_flags &= ~RQF_DONTPREP;
++      }
++}
++
+ /* Add a command to the list used by the aacraid and dpt_i2o drivers */
+ void scsi_add_cmd_to_list(struct scsi_cmnd *cmd)
+ {
+@@ -1821,6 +1833,7 @@ static const struct blk_mq_ops scsi_mq_ops = {
+       .init_request   = scsi_mq_init_request,
+       .exit_request   = scsi_mq_exit_request,
+       .initialize_rq_fn = scsi_initialize_rq,
++      .cleanup_rq     = scsi_cleanup_rq,
+       .busy           = scsi_mq_lld_busy,
+       .map_queues     = scsi_map_queues,
+ };
+-- 
+2.20.1
+
index a3ec1e05dd50483aeefc2ae7ce823122ca61bf24..31496556172538f6c96b7be64c599e010efdeb0b 100644 (file)
@@ -248,3 +248,7 @@ rdma-fix-double-free-in-srq-creation-error-flow.patch
 randstruct-check-member-structs-in-is_pure_ops_struct.patch
 arm-dts-am3517-evm-fix-missing-video.patch
 rcu-tree-fix-sched_fifo-params.patch
+drm-i915-perf-fix-icl-perf-register-offsets.patch
+alsa-hda-realtek-pci-quirk-for-medion-e4254.patch
+blk-mq-add-callback-of-.cleanup_rq.patch
+scsi-implement-.cleanup_rq-callback.patch