]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Jan 2021 13:36:28 +0000 (14:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Jan 2021 13:36:28 +0000 (14:36 +0100)
added patches:
acpi-scan-make-acpi_bus_get_device-clear-return-pointer-on-error.patch
alsa-hda-via-add-minimum-mute-flag.patch
alsa-seq-oss-fix-missing-error-check-in-snd_seq_oss_synth_make_info.patch
btrfs-fix-lockdep-splat-in-btrfs_recover_relocation.patch
dm-avoid-filesystem-lookup-in-dm_get_dev_t.patch
dm-integrity-fix-a-crash-if-recalculate-used-without-internal_hash.patch
drm-atomic-put-state-on-error-path.patch
i2c-bpmp-tegra-ignore-unknown-i2c_m-flags.patch
mmc-core-don-t-initialize-block-size-from-ext_csd-if-not-present.patch
mmc-sdhci-xenon-fix-1.8v-regulator-stabilization.patch

queue-4.19/acpi-scan-make-acpi_bus_get_device-clear-return-pointer-on-error.patch [new file with mode: 0644]
queue-4.19/alsa-hda-via-add-minimum-mute-flag.patch [new file with mode: 0644]
queue-4.19/alsa-seq-oss-fix-missing-error-check-in-snd_seq_oss_synth_make_info.patch [new file with mode: 0644]
queue-4.19/btrfs-fix-lockdep-splat-in-btrfs_recover_relocation.patch [new file with mode: 0644]
queue-4.19/dm-avoid-filesystem-lookup-in-dm_get_dev_t.patch [new file with mode: 0644]
queue-4.19/dm-integrity-fix-a-crash-if-recalculate-used-without-internal_hash.patch [new file with mode: 0644]
queue-4.19/drm-atomic-put-state-on-error-path.patch [new file with mode: 0644]
queue-4.19/i2c-bpmp-tegra-ignore-unknown-i2c_m-flags.patch [new file with mode: 0644]
queue-4.19/mmc-core-don-t-initialize-block-size-from-ext_csd-if-not-present.patch [new file with mode: 0644]
queue-4.19/mmc-sdhci-xenon-fix-1.8v-regulator-stabilization.patch [new file with mode: 0644]

diff --git a/queue-4.19/acpi-scan-make-acpi_bus_get_device-clear-return-pointer-on-error.patch b/queue-4.19/acpi-scan-make-acpi_bus_get_device-clear-return-pointer-on-error.patch
new file mode 100644 (file)
index 0000000..f7fd61c
--- /dev/null
@@ -0,0 +1,48 @@
+From 78a18fec5258c8df9435399a1ea022d73d3eceb9 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Fri, 15 Jan 2021 22:57:52 +0100
+Subject: ACPI: scan: Make acpi_bus_get_device() clear return pointer on error
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 78a18fec5258c8df9435399a1ea022d73d3eceb9 upstream.
+
+Set the acpi_device pointer which acpi_bus_get_device() returns-by-
+reference to NULL on errors.
+
+We've recently had 2 cases where callers of acpi_bus_get_device()
+did not properly error check the return value, so set the returned-
+by-reference acpi_device pointer to NULL, because at least some
+callers of acpi_bus_get_device() expect that to be done on errors.
+
+[ rjw: This issue was exposed by commit 71da201f38df ("ACPI: scan:
+  Defer enumeration of devices with _DEP lists") which caused it to
+  be much more likely to occur on some systems, but the real defect
+  had been introduced by an earlier commit. ]
+
+Fixes: 40e7fcb19293 ("ACPI: Add _DEP support to fix battery issue on Asus T100TA")
+Fixes: bcfcd409d4db ("usb: split code locating ACPI companion into port and device")
+Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
+Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
+Diagnosed-by: Rafael J. Wysocki <rafael@kernel.org>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Cc: All applicable <stable@vger.kernel.org>
+[ rjw: Subject and changelog edits ]
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/scan.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/acpi/scan.c
++++ b/drivers/acpi/scan.c
+@@ -586,6 +586,8 @@ static int acpi_get_device_data(acpi_han
+       if (!device)
+               return -EINVAL;
++      *device = NULL;
++
+       status = acpi_get_data_full(handle, acpi_scan_drop_device,
+                                   (void **)device, callback);
+       if (ACPI_FAILURE(status) || !*device) {
diff --git a/queue-4.19/alsa-hda-via-add-minimum-mute-flag.patch b/queue-4.19/alsa-hda-via-add-minimum-mute-flag.patch
new file mode 100644 (file)
index 0000000..0931ede
--- /dev/null
@@ -0,0 +1,33 @@
+From 67ea698c3950d10925be33c21ca49ffb64e21842 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 14 Jan 2021 08:24:53 +0100
+Subject: ALSA: hda/via: Add minimum mute flag
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 67ea698c3950d10925be33c21ca49ffb64e21842 upstream.
+
+It turned out that VIA codecs also mute the sound in the lowest mixer
+level.  Turn on the dac_min_mute flag to indicate the mute-as-minimum
+in TLV like already done in Conexant and IDT codecs.
+
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210559
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20210114072453.11379-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_via.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_via.c
++++ b/sound/pci/hda/patch_via.c
+@@ -126,6 +126,7 @@ static struct via_spec *via_new_spec(str
+               spec->codec_type = VT1708S;
+       spec->gen.indep_hp = 1;
+       spec->gen.keep_eapd_on = 1;
++      spec->gen.dac_min_mute = 1;
+       spec->gen.pcm_playback_hook = via_playback_pcm_hook;
+       spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
+       codec->power_save_node = 1;
diff --git a/queue-4.19/alsa-seq-oss-fix-missing-error-check-in-snd_seq_oss_synth_make_info.patch b/queue-4.19/alsa-seq-oss-fix-missing-error-check-in-snd_seq_oss_synth_make_info.patch
new file mode 100644 (file)
index 0000000..1318e67
--- /dev/null
@@ -0,0 +1,38 @@
+From 217bfbb8b0bfa24619b11ab75c135fec99b99b20 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 15 Jan 2021 10:34:28 +0100
+Subject: ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info()
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 217bfbb8b0bfa24619b11ab75c135fec99b99b20 upstream.
+
+snd_seq_oss_synth_make_info() didn't check the error code from
+snd_seq_oss_midi_make_info(), and this leads to the call of strlcpy()
+with the uninitialized string as the source, which may lead to the
+access over the limit.
+
+Add the proper error check for avoiding the failure.
+
+Reported-by: syzbot+e42504ff21cff05a595f@syzkaller.appspotmail.com
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20210115093428.15882-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/core/seq/oss/seq_oss_synth.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/sound/core/seq/oss/seq_oss_synth.c
++++ b/sound/core/seq/oss/seq_oss_synth.c
+@@ -624,7 +624,8 @@ snd_seq_oss_synth_make_info(struct seq_o
+       if (info->is_midi) {
+               struct midi_info minf;
+-              snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf);
++              if (snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf))
++                      return -ENXIO;
+               inf->synth_type = SYNTH_TYPE_MIDI;
+               inf->synth_subtype = 0;
+               inf->nr_voices = 16;
diff --git a/queue-4.19/btrfs-fix-lockdep-splat-in-btrfs_recover_relocation.patch b/queue-4.19/btrfs-fix-lockdep-splat-in-btrfs_recover_relocation.patch
new file mode 100644 (file)
index 0000000..e5bb410
--- /dev/null
@@ -0,0 +1,155 @@
+From fb286100974e7239af243bc2255a52f29442f9c8 Mon Sep 17 00:00:00 2001
+From: Josef Bacik <josef@toxicpanda.com>
+Date: Wed, 16 Dec 2020 11:22:14 -0500
+Subject: btrfs: fix lockdep splat in btrfs_recover_relocation
+
+From: Josef Bacik <josef@toxicpanda.com>
+
+commit fb286100974e7239af243bc2255a52f29442f9c8 upstream.
+
+While testing the error paths of relocation I hit the following lockdep
+splat:
+
+  ======================================================
+  WARNING: possible circular locking dependency detected
+  5.10.0-rc6+ #217 Not tainted
+  ------------------------------------------------------
+  mount/779 is trying to acquire lock:
+  ffffa0e676945418 (&fs_info->balance_mutex){+.+.}-{3:3}, at: btrfs_recover_balance+0x2f0/0x340
+
+  but task is already holding lock:
+  ffffa0e60ee31da8 (btrfs-root-00){++++}-{3:3}, at: __btrfs_tree_read_lock+0x27/0x100
+
+  which lock already depends on the new lock.
+
+  the existing dependency chain (in reverse order) is:
+
+  -> #2 (btrfs-root-00){++++}-{3:3}:
+        down_read_nested+0x43/0x130
+        __btrfs_tree_read_lock+0x27/0x100
+        btrfs_read_lock_root_node+0x31/0x40
+        btrfs_search_slot+0x462/0x8f0
+        btrfs_update_root+0x55/0x2b0
+        btrfs_drop_snapshot+0x398/0x750
+        clean_dirty_subvols+0xdf/0x120
+        btrfs_recover_relocation+0x534/0x5a0
+        btrfs_start_pre_rw_mount+0xcb/0x170
+        open_ctree+0x151f/0x1726
+        btrfs_mount_root.cold+0x12/0xea
+        legacy_get_tree+0x30/0x50
+        vfs_get_tree+0x28/0xc0
+        vfs_kern_mount.part.0+0x71/0xb0
+        btrfs_mount+0x10d/0x380
+        legacy_get_tree+0x30/0x50
+        vfs_get_tree+0x28/0xc0
+        path_mount+0x433/0xc10
+        __x64_sys_mount+0xe3/0x120
+        do_syscall_64+0x33/0x40
+        entry_SYSCALL_64_after_hwframe+0x44/0xa9
+
+  -> #1 (sb_internal#2){.+.+}-{0:0}:
+        start_transaction+0x444/0x700
+        insert_balance_item.isra.0+0x37/0x320
+        btrfs_balance+0x354/0xf40
+        btrfs_ioctl_balance+0x2cf/0x380
+        __x64_sys_ioctl+0x83/0xb0
+        do_syscall_64+0x33/0x40
+        entry_SYSCALL_64_after_hwframe+0x44/0xa9
+
+  -> #0 (&fs_info->balance_mutex){+.+.}-{3:3}:
+        __lock_acquire+0x1120/0x1e10
+        lock_acquire+0x116/0x370
+        __mutex_lock+0x7e/0x7b0
+        btrfs_recover_balance+0x2f0/0x340
+        open_ctree+0x1095/0x1726
+        btrfs_mount_root.cold+0x12/0xea
+        legacy_get_tree+0x30/0x50
+        vfs_get_tree+0x28/0xc0
+        vfs_kern_mount.part.0+0x71/0xb0
+        btrfs_mount+0x10d/0x380
+        legacy_get_tree+0x30/0x50
+        vfs_get_tree+0x28/0xc0
+        path_mount+0x433/0xc10
+        __x64_sys_mount+0xe3/0x120
+        do_syscall_64+0x33/0x40
+        entry_SYSCALL_64_after_hwframe+0x44/0xa9
+
+  other info that might help us debug this:
+
+  Chain exists of:
+    &fs_info->balance_mutex --> sb_internal#2 --> btrfs-root-00
+
+   Possible unsafe locking scenario:
+
+        CPU0                    CPU1
+        ----                    ----
+    lock(btrfs-root-00);
+                                lock(sb_internal#2);
+                                lock(btrfs-root-00);
+    lock(&fs_info->balance_mutex);
+
+   *** DEADLOCK ***
+
+  2 locks held by mount/779:
+   #0: ffffa0e60dc040e0 (&type->s_umount_key#47/1){+.+.}-{3:3}, at: alloc_super+0xb5/0x380
+   #1: ffffa0e60ee31da8 (btrfs-root-00){++++}-{3:3}, at: __btrfs_tree_read_lock+0x27/0x100
+
+  stack backtrace:
+  CPU: 0 PID: 779 Comm: mount Not tainted 5.10.0-rc6+ #217
+  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
+  Call Trace:
+   dump_stack+0x8b/0xb0
+   check_noncircular+0xcf/0xf0
+   ? trace_call_bpf+0x139/0x260
+   __lock_acquire+0x1120/0x1e10
+   lock_acquire+0x116/0x370
+   ? btrfs_recover_balance+0x2f0/0x340
+   __mutex_lock+0x7e/0x7b0
+   ? btrfs_recover_balance+0x2f0/0x340
+   ? btrfs_recover_balance+0x2f0/0x340
+   ? rcu_read_lock_sched_held+0x3f/0x80
+   ? kmem_cache_alloc_trace+0x2c4/0x2f0
+   ? btrfs_get_64+0x5e/0x100
+   btrfs_recover_balance+0x2f0/0x340
+   open_ctree+0x1095/0x1726
+   btrfs_mount_root.cold+0x12/0xea
+   ? rcu_read_lock_sched_held+0x3f/0x80
+   legacy_get_tree+0x30/0x50
+   vfs_get_tree+0x28/0xc0
+   vfs_kern_mount.part.0+0x71/0xb0
+   btrfs_mount+0x10d/0x380
+   ? __kmalloc_track_caller+0x2f2/0x320
+   legacy_get_tree+0x30/0x50
+   vfs_get_tree+0x28/0xc0
+   ? capable+0x3a/0x60
+   path_mount+0x433/0xc10
+   __x64_sys_mount+0xe3/0x120
+   do_syscall_64+0x33/0x40
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+
+This is straightforward to fix, simply release the path before we setup
+the balance_ctl.
+
+CC: stable@vger.kernel.org # 4.4+
+Reviewed-by: Qu Wenruo <wqu@suse.com>
+Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
+Signed-off-by: Josef Bacik <josef@toxicpanda.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/volumes.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/fs/btrfs/volumes.c
++++ b/fs/btrfs/volumes.c
+@@ -4011,6 +4011,8 @@ int btrfs_recover_balance(struct btrfs_f
+               btrfs_warn(fs_info,
+       "balance: cannot set exclusive op status, resume manually");
++      btrfs_release_path(path);
++
+       mutex_lock(&fs_info->balance_mutex);
+       BUG_ON(fs_info->balance_ctl);
+       spin_lock(&fs_info->balance_lock);
diff --git a/queue-4.19/dm-avoid-filesystem-lookup-in-dm_get_dev_t.patch b/queue-4.19/dm-avoid-filesystem-lookup-in-dm_get_dev_t.patch
new file mode 100644 (file)
index 0000000..2a7661f
--- /dev/null
@@ -0,0 +1,66 @@
+From 809b1e4945774c9ec5619a8f4e2189b7b3833c0c Mon Sep 17 00:00:00 2001
+From: Hannes Reinecke <hare@suse.de>
+Date: Thu, 21 Jan 2021 18:50:56 +0100
+Subject: dm: avoid filesystem lookup in dm_get_dev_t()
+
+From: Hannes Reinecke <hare@suse.de>
+
+commit 809b1e4945774c9ec5619a8f4e2189b7b3833c0c upstream.
+
+This reverts commit
+644bda6f3460 ("dm table: fall back to getting device using name_to_dev_t()")
+
+dm_get_dev_t() is just used to convert an arbitrary 'path' string
+into a dev_t. It doesn't presume that the device is present; that
+check will be done later, as the only caller is dm_get_device(),
+which does a dm_get_table_device() later on, which will properly
+open the device.
+
+So if the path string already _is_ in major:minor representation
+we can convert it directly, avoiding a recursion into the filesystem
+to lookup the block device.
+
+This avoids a hang in multipath_message() when the filesystem is
+inaccessible.
+
+Fixes: 644bda6f3460 ("dm table: fall back to getting device using name_to_dev_t()")
+Cc: stable@vger.kernel.org
+Signed-off-by: Hannes Reinecke <hare@suse.de>
+Signed-off-by: Martin Wilck <mwilck@suse.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/md/dm-table.c |   15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+--- a/drivers/md/dm-table.c
++++ b/drivers/md/dm-table.c
+@@ -431,14 +431,23 @@ int dm_get_device(struct dm_target *ti,
+ {
+       int r;
+       dev_t dev;
++      unsigned int major, minor;
++      char dummy;
+       struct dm_dev_internal *dd;
+       struct dm_table *t = ti->table;
+       BUG_ON(!t);
+-      dev = dm_get_dev_t(path);
+-      if (!dev)
+-              return -ENODEV;
++      if (sscanf(path, "%u:%u%c", &major, &minor, &dummy) == 2) {
++              /* Extract the major/minor numbers */
++              dev = MKDEV(major, minor);
++              if (MAJOR(dev) != major || MINOR(dev) != minor)
++                      return -EOVERFLOW;
++      } else {
++              dev = dm_get_dev_t(path);
++              if (!dev)
++                      return -ENODEV;
++      }
+       dd = find_device(&t->devices, dev);
+       if (!dd) {
diff --git a/queue-4.19/dm-integrity-fix-a-crash-if-recalculate-used-without-internal_hash.patch b/queue-4.19/dm-integrity-fix-a-crash-if-recalculate-used-without-internal_hash.patch
new file mode 100644 (file)
index 0000000..2deb7ac
--- /dev/null
@@ -0,0 +1,35 @@
+From 2d06dfecb132a1cc2e374a44eae83b5c4356b8b4 Mon Sep 17 00:00:00 2001
+From: Mikulas Patocka <mpatocka@redhat.com>
+Date: Wed, 20 Jan 2021 06:02:31 -0500
+Subject: dm integrity: fix a crash if "recalculate" used without "internal_hash"
+
+From: Mikulas Patocka <mpatocka@redhat.com>
+
+commit 2d06dfecb132a1cc2e374a44eae83b5c4356b8b4 upstream.
+
+Recalculate can only be specified with internal_hash.
+
+Cc: stable@vger.kernel.org # v4.19+
+Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/md/dm-integrity.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/md/dm-integrity.c
++++ b/drivers/md/dm-integrity.c
+@@ -3515,6 +3515,12 @@ try_smaller_buffer:
+                       r = -ENOMEM;
+                       goto bad;
+               }
++      } else {
++              if (ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING)) {
++                      ti->error = "Recalculate can only be specified with internal_hash";
++                      r = -EINVAL;
++                      goto bad;
++              }
+       }
+       ic->bufio = dm_bufio_client_create(ic->meta_dev ? ic->meta_dev->bdev : ic->dev->bdev,
diff --git a/queue-4.19/drm-atomic-put-state-on-error-path.patch b/queue-4.19/drm-atomic-put-state-on-error-path.patch
new file mode 100644 (file)
index 0000000..0b2dbf8
--- /dev/null
@@ -0,0 +1,33 @@
+From 43b67309b6b2a3c08396cc9b3f83f21aa529d273 Mon Sep 17 00:00:00 2001
+From: Pan Bian <bianpan2016@163.com>
+Date: Tue, 19 Jan 2021 04:11:27 -0800
+Subject: drm/atomic: put state on error path
+
+From: Pan Bian <bianpan2016@163.com>
+
+commit 43b67309b6b2a3c08396cc9b3f83f21aa529d273 upstream.
+
+Put the state before returning error code.
+
+Fixes: 44596b8c4750 ("drm/atomic: Unify conflicting encoder handling.")
+Signed-off-by: Pan Bian <bianpan2016@163.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Link: https://patchwork.freedesktop.org/patch/msgid/20210119121127.84127-1-bianpan2016@163.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/drm_atomic_helper.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/drm_atomic_helper.c
++++ b/drivers/gpu/drm/drm_atomic_helper.c
+@@ -2938,7 +2938,7 @@ int drm_atomic_helper_set_config(struct
+       ret = handle_conflicting_encoders(state, true);
+       if (ret)
+-              return ret;
++              goto fail;
+       ret = drm_atomic_commit(state);
diff --git a/queue-4.19/i2c-bpmp-tegra-ignore-unknown-i2c_m-flags.patch b/queue-4.19/i2c-bpmp-tegra-ignore-unknown-i2c_m-flags.patch
new file mode 100644 (file)
index 0000000..46fc6e4
--- /dev/null
@@ -0,0 +1,34 @@
+From bc1c2048abbe3c3074b4de91d213595c57741a6b Mon Sep 17 00:00:00 2001
+From: Mikko Perttunen <mperttunen@nvidia.com>
+Date: Tue, 12 Jan 2021 12:22:25 +0200
+Subject: i2c: bpmp-tegra: Ignore unknown I2C_M flags
+
+From: Mikko Perttunen <mperttunen@nvidia.com>
+
+commit bc1c2048abbe3c3074b4de91d213595c57741a6b upstream.
+
+In order to not to start returning errors when new I2C_M flags are
+added, change behavior to just ignore all flags that we don't know
+about. This includes the I2C_M_DMA_SAFE flag that already exists but
+causes -EINVAL to be returned for valid transactions.
+
+Cc: stable@vger.kernel.org # v4.19+
+Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-tegra-bpmp.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/i2c/busses/i2c-tegra-bpmp.c
++++ b/drivers/i2c/busses/i2c-tegra-bpmp.c
+@@ -91,7 +91,7 @@ static int tegra_bpmp_xlate_flags(u16 fl
+               flags &= ~I2C_M_RECV_LEN;
+       }
+-      return (flags != 0) ? -EINVAL : 0;
++      return 0;
+ }
+ /**
diff --git a/queue-4.19/mmc-core-don-t-initialize-block-size-from-ext_csd-if-not-present.patch b/queue-4.19/mmc-core-don-t-initialize-block-size-from-ext_csd-if-not-present.patch
new file mode 100644 (file)
index 0000000..2b3c3ad
--- /dev/null
@@ -0,0 +1,46 @@
+From b503087445ce7e45fabdee87ca9e460d5b5b5168 Mon Sep 17 00:00:00 2001
+From: Peter Collingbourne <pcc@google.com>
+Date: Thu, 14 Jan 2021 12:14:05 -0800
+Subject: mmc: core: don't initialize block size from ext_csd if not present
+
+From: Peter Collingbourne <pcc@google.com>
+
+commit b503087445ce7e45fabdee87ca9e460d5b5b5168 upstream.
+
+If extended CSD was not available, the eMMC driver would incorrectly
+set the block size to 0, as the data_sector_size field of ext_csd
+was never initialized. This issue was exposed by commit 817046ecddbc
+("block: Align max_hw_sectors to logical blocksize") which caused
+max_sectors and max_hw_sectors to be set to 0 after setting the block
+size to 0, resulting in a kernel panic in bio_split when attempting
+to read from the device. Fix it by only reading the block size from
+ext_csd if it is available.
+
+Fixes: a5075eb94837 ("mmc: block: Allow disabling 512B sector size emulation")
+Signed-off-by: Peter Collingbourne <pcc@google.com>
+Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
+Link: https://linux-review.googlesource.com/id/If244d178da4d86b52034459438fec295b02d6e60
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20210114201405.2934886-1-pcc@google.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/core/queue.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/core/queue.c
++++ b/drivers/mmc/core/queue.c
+@@ -364,8 +364,10 @@ static void mmc_setup_queue(struct mmc_q
+               min(host->max_blk_count, host->max_req_size / 512));
+       blk_queue_max_segments(mq->queue, host->max_segs);
+-      if (mmc_card_mmc(card))
++      if (mmc_card_mmc(card) && card->ext_csd.data_sector_size) {
+               block_size = card->ext_csd.data_sector_size;
++              WARN_ON(block_size != 512 && block_size != 4096);
++      }
+       blk_queue_logical_block_size(mq->queue, block_size);
+       blk_queue_max_segment_size(mq->queue,
diff --git a/queue-4.19/mmc-sdhci-xenon-fix-1.8v-regulator-stabilization.patch b/queue-4.19/mmc-sdhci-xenon-fix-1.8v-regulator-stabilization.patch
new file mode 100644 (file)
index 0000000..8550b11
--- /dev/null
@@ -0,0 +1,45 @@
+From 1a3ed0dc3594d99ff341ec63865a40519ea24b8d Mon Sep 17 00:00:00 2001
+From: Alex Leibovich <alexl@marvell.com>
+Date: Fri, 11 Dec 2020 15:16:56 +0100
+Subject: mmc: sdhci-xenon: fix 1.8v regulator stabilization
+
+From: Alex Leibovich <alexl@marvell.com>
+
+commit 1a3ed0dc3594d99ff341ec63865a40519ea24b8d upstream.
+
+Automatic Clock Gating is a feature used for the power consumption
+optimisation. It turned out that during early init phase it may prevent the
+stable voltage switch to 1.8V - due to that on some platforms an endless
+printout in dmesg can be observed: "mmc1: 1.8V regulator output did not
+became stable" Fix the problem by disabling the ACG at very beginning of
+the sdhci_init and let that be enabled later.
+
+Fixes: 3a3748dba881 ("mmc: sdhci-xenon: Add Marvell Xenon SDHC core functionality")
+Signed-off-by: Alex Leibovich <alexl@marvell.com>
+Signed-off-by: Marcin Wojtas <mw@semihalf.com>
+Cc: stable@vger.kernel.org
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Link: https://lore.kernel.org/r/20201211141656.24915-1-mw@semihalf.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/sdhci-xenon.c |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/sdhci-xenon.c
++++ b/drivers/mmc/host/sdhci-xenon.c
+@@ -170,7 +170,12 @@ static void xenon_reset_exit(struct sdhc
+       /* Disable tuning request and auto-retuning again */
+       xenon_retune_setup(host);
+-      xenon_set_acg(host, true);
++      /*
++       * The ACG should be turned off at the early init time, in order
++       * to solve a possible issues with the 1.8V regulator stabilization.
++       * The feature is enabled in later stage.
++       */
++      xenon_set_acg(host, false);
+       xenon_set_sdclk_off_idle(host, sdhc_id, false);