]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.12
authorSasha Levin <sashal@kernel.org>
Sun, 30 May 2021 20:40:29 +0000 (16:40 -0400)
committerSasha Levin <sashal@kernel.org>
Sun, 30 May 2021 20:40:29 +0000 (16:40 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
61 files changed:
queue-5.12/alsa-dice-disable-double_pcm_frames-mode-for-m-audio.patch [new file with mode: 0644]
queue-5.12/alsa-sb8-add-a-comment-note-regarding-an-unused-poin.patch [new file with mode: 0644]
queue-5.12/asoc-cs43130-handle-errors-in-cs43130_probe-properly.patch [new file with mode: 0644]
queue-5.12/ath6kl-return-error-code-in-ath6kl_wmi_set_roam_lrss.patch [new file with mode: 0644]
queue-5.12/block-fix-a-race-between-del_gendisk-and-blkrrpart.patch [new file with mode: 0644]
queue-5.12/brcmfmac-properly-check-for-bus-register-errors.patch [new file with mode: 0644]
queue-5.12/btrfs-do-not-bug_on-in-link_to_fixup_dir.patch [new file with mode: 0644]
queue-5.12/btrfs-release-path-before-starting-transaction-when-.patch [new file with mode: 0644]
queue-5.12/btrfs-return-whole-extents-in-fiemap.patch [new file with mode: 0644]
queue-5.12/char-hpet-add-checks-after-calling-ioremap.patch [new file with mode: 0644]
queue-5.12/dmaengine-qcom_hidma-comment-platform_driver_registe.patch [new file with mode: 0644]
queue-5.12/drm-amd-amdgpu-fix-a-potential-deadlock-in-gpu-reset.patch [new file with mode: 0644]
queue-5.12/drm-amd-amdgpu-fix-refcount-leak.patch [new file with mode: 0644]
queue-5.12/drm-amd-display-disconnect-non-dp-with-no-edid.patch [new file with mode: 0644]
queue-5.12/drm-amdgpu-fix-a-use-after-free.patch [new file with mode: 0644]
queue-5.12/drm-amdgpu-stop-touching-sched.ready-in-the-backend.patch [new file with mode: 0644]
queue-5.12/gpio-cadence-add-missing-module_device_table.patch [new file with mode: 0644]
queue-5.12/isdn-misdn-correctly-handle-ph_info-allocation-failu.patch [new file with mode: 0644]
queue-5.12/isdn-misdninfineon-check-cleanup-ioremap-failure-cor.patch [new file with mode: 0644]
queue-5.12/libertas-register-sysfs-groups-properly.patch [new file with mode: 0644]
queue-5.12/linux-bits.h-fix-compilation-error-with-genmask.patch [new file with mode: 0644]
queue-5.12/media-dvb-add-check-on-sp8870_readreg-return.patch [new file with mode: 0644]
queue-5.12/media-gspca-mt9m111-check-write_bridge-for-timeout.patch [new file with mode: 0644]
queue-5.12/media-gspca-properly-check-for-errors-in-po1030_prob.patch [new file with mode: 0644]
queue-5.12/net-caif-remove-bug_on-dev-null-in-caif_xmit.patch [new file with mode: 0644]
queue-5.12/net-fujitsu-fix-potential-null-ptr-deref.patch [new file with mode: 0644]
queue-5.12/net-liquidio-add-missing-null-pointer-checks.patch [new file with mode: 0644]
queue-5.12/net-smc-properly-handle-workqueue-allocation-failure.patch [new file with mode: 0644]
queue-5.12/openrisc-define-memory-barrier-mb.patch [new file with mode: 0644]
queue-5.12/platform-x86-hp-wireless-add-amd-s-hardware-id-to-th.patch [new file with mode: 0644]
queue-5.12/platform-x86-hp_accel-avoid-invoking-_ini-to-speed-u.patch [new file with mode: 0644]
queue-5.12/platform-x86-intel_punit_ipc-append-module_device_ta.patch [new file with mode: 0644]
queue-5.12/platform-x86-touchscreen_dmi-add-info-for-the-chuwi-.patch [new file with mode: 0644]
queue-5.12/platform-x86-touchscreen_dmi-add-info-for-the-mediac.patch [new file with mode: 0644]
queue-5.12/revert-alsa-gus-add-a-check-of-the-status-of-snd_ctl.patch [new file with mode: 0644]
queue-5.12/revert-alsa-sb-fix-a-missing-check-of-snd_ctl_add.patch [new file with mode: 0644]
queue-5.12/revert-alsa-usx2y-fix-potential-null-pointer-derefer.patch [new file with mode: 0644]
queue-5.12/revert-asoc-cs43130-fix-a-null-pointer-dereference.patch [new file with mode: 0644]
queue-5.12/revert-ath6kl-return-error-code-in-ath6kl_wmi_set_ro.patch [new file with mode: 0644]
queue-5.12/revert-brcmfmac-add-a-check-for-the-status-of-usb_re.patch [new file with mode: 0644]
queue-5.12/revert-char-hpet-fix-a-missing-check-of-ioremap.patch [new file with mode: 0644]
queue-5.12/revert-crypto-cavium-nitrox-add-an-error-message-to-.patch [new file with mode: 0644]
queue-5.12/revert-dmaengine-qcom_hidma-check-for-driver-registe.patch [new file with mode: 0644]
queue-5.12/revert-isdn-misdn-fix-potential-null-pointer-derefer.patch [new file with mode: 0644]
queue-5.12/revert-isdn-misdninfineon-fix-potential-null-pointer.patch [new file with mode: 0644]
queue-5.12/revert-libertas-add-checks-for-the-return-value-of-s.patch [new file with mode: 0644]
queue-5.12/revert-media-dvb-add-check-on-sp8870_readreg.patch [new file with mode: 0644]
queue-5.12/revert-media-gspca-check-the-return-value-of-write_b.patch [new file with mode: 0644]
queue-5.12/revert-media-gspca-mt9m111-check-write_bridge-for-ti.patch [new file with mode: 0644]
queue-5.12/revert-media-usb-gspca-add-a-missed-check-for-goto_l.patch [new file with mode: 0644]
queue-5.12/revert-net-caif-replace-bug_on-with-recovery-code.patch [new file with mode: 0644]
queue-5.12/revert-net-fujitsu-fix-a-potential-null-pointer-dere.patch [new file with mode: 0644]
queue-5.12/revert-net-liquidio-fix-a-null-pointer-dereference.patch [new file with mode: 0644]
queue-5.12/revert-net-smc-fix-a-null-pointer-dereference.patch [new file with mode: 0644]
queue-5.12/revert-serial-max310x-pass-return-value-of-spi_regis.patch [new file with mode: 0644]
queue-5.12/scsi-buslogic-fix-64-bit-system-enumeration-error-fo.patch [new file with mode: 0644]
queue-5.12/scsi-pm80xx-fix-drives-missing-during-rmmod-insmod-l.patch [new file with mode: 0644]
queue-5.12/scsi-ufs-ufs-mediatek-fix-power-down-spec-violation.patch [new file with mode: 0644]
queue-5.12/serial-max310x-unregister-uart-driver-in-case-of-fai.patch [new file with mode: 0644]
queue-5.12/series
queue-5.12/smb3-incorrect-file-id-in-requests-compounded-with-o.patch [new file with mode: 0644]

diff --git a/queue-5.12/alsa-dice-disable-double_pcm_frames-mode-for-m-audio.patch b/queue-5.12/alsa-dice-disable-double_pcm_frames-mode-for-m-audio.patch
new file mode 100644 (file)
index 0000000..10a98a8
--- /dev/null
@@ -0,0 +1,137 @@
+From 26ccf47d83dbe7e961e46f0d72f411df40592262 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 18 May 2021 10:25:10 +0900
+Subject: ALSA: dice: disable double_pcm_frames mode for M-Audio Profire 610,
+ 2626 and Avid M-Box 3 Pro
+
+From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+
+[ Upstream commit 9f079c1bdc9087842dc5ac9d81b1d7f2578e81ce ]
+
+ALSA dice driver detects jumbo payload at high sampling transfer frequency
+for below models:
+
+ * Avid M-Box 3 Pro
+ * M-Audio Profire 610
+ * M-Audio Profire 2626
+
+Although many DICE-based devices have a quirk at high sampling transfer
+frequency to multiplex double number of PCM frames into data block than
+the number in IEC 61883-1/6, the above devices are just compliant to
+IEC 61883-1/6.
+
+This commit disables the mode of double_pcm_frames for the models.
+
+Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+Link: https://lore.kernel.org/r/20210518012510.37126-1-o-takashi@sakamocchi.jp
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/firewire/dice/dice-pcm.c    |  4 ++--
+ sound/firewire/dice/dice-stream.c |  2 +-
+ sound/firewire/dice/dice.c        | 24 ++++++++++++++++++++++++
+ sound/firewire/dice/dice.h        |  3 ++-
+ 4 files changed, 29 insertions(+), 4 deletions(-)
+
+diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c
+index af8a90ee40f3..a69ca1111b03 100644
+--- a/sound/firewire/dice/dice-pcm.c
++++ b/sound/firewire/dice/dice-pcm.c
+@@ -218,7 +218,7 @@ static int pcm_open(struct snd_pcm_substream *substream)
+               if (frames_per_period > 0) {
+                       // For double_pcm_frame quirk.
+-                      if (rate > 96000) {
++                      if (rate > 96000 && !dice->disable_double_pcm_frames) {
+                               frames_per_period *= 2;
+                               frames_per_buffer *= 2;
+                       }
+@@ -273,7 +273,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
+               mutex_lock(&dice->mutex);
+               // For double_pcm_frame quirk.
+-              if (rate > 96000) {
++              if (rate > 96000 && !dice->disable_double_pcm_frames) {
+                       events_per_period /= 2;
+                       events_per_buffer /= 2;
+               }
+diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c
+index 1a14c083e8ce..c4dfe76500c2 100644
+--- a/sound/firewire/dice/dice-stream.c
++++ b/sound/firewire/dice/dice-stream.c
+@@ -181,7 +181,7 @@ static int keep_resources(struct snd_dice *dice, struct amdtp_stream *stream,
+       // as 'Dual Wire'.
+       // For this quirk, blocking mode is required and PCM buffer size should
+       // be aligned to SYT_INTERVAL.
+-      double_pcm_frames = rate > 96000;
++      double_pcm_frames = (rate > 96000 && !dice->disable_double_pcm_frames);
+       if (double_pcm_frames) {
+               rate /= 2;
+               pcm_chs *= 2;
+diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c
+index 107a81691f0e..239d164b0eea 100644
+--- a/sound/firewire/dice/dice.c
++++ b/sound/firewire/dice/dice.c
+@@ -21,6 +21,7 @@ MODULE_LICENSE("GPL v2");
+ #define OUI_SSL                       0x0050c2        // Actually ID reserved by IEEE.
+ #define OUI_PRESONUS          0x000a92
+ #define OUI_HARMAN            0x000fd7
++#define OUI_AVID              0x00a07e
+ #define DICE_CATEGORY_ID      0x04
+ #define WEISS_CATEGORY_ID     0x00
+@@ -222,6 +223,14 @@ static int dice_probe(struct fw_unit *unit,
+                               (snd_dice_detect_formats_t)entry->driver_data;
+       }
++      // Below models are compliant to IEC 61883-1/6 and have no quirk at high sampling transfer
++      // frequency.
++      // * Avid M-Box 3 Pro
++      // * M-Audio Profire 610
++      // * M-Audio Profire 2626
++      if (entry->vendor_id == OUI_MAUDIO || entry->vendor_id == OUI_AVID)
++              dice->disable_double_pcm_frames = true;
++
+       spin_lock_init(&dice->lock);
+       mutex_init(&dice->mutex);
+       init_completion(&dice->clock_accepted);
+@@ -278,7 +287,22 @@ static void dice_bus_reset(struct fw_unit *unit)
+ #define DICE_INTERFACE        0x000001
++#define DICE_DEV_ENTRY_TYPICAL(vendor, model, data) \
++      { \
++              .match_flags    = IEEE1394_MATCH_VENDOR_ID | \
++                                IEEE1394_MATCH_MODEL_ID | \
++                                IEEE1394_MATCH_SPECIFIER_ID | \
++                                IEEE1394_MATCH_VERSION, \
++              .vendor_id      = (vendor), \
++              .model_id       = (model), \
++              .specifier_id   = (vendor), \
++              .version        = DICE_INTERFACE, \
++              .driver_data = (kernel_ulong_t)(data), \
++      }
++
+ static const struct ieee1394_device_id dice_id_table[] = {
++      // Avid M-Box 3 Pro. To match in probe function.
++      DICE_DEV_ENTRY_TYPICAL(OUI_AVID, 0x000004, snd_dice_detect_extension_formats),
+       /* M-Audio Profire 2626 has a different value in version field. */
+       {
+               .match_flags    = IEEE1394_MATCH_VENDOR_ID |
+diff --git a/sound/firewire/dice/dice.h b/sound/firewire/dice/dice.h
+index adc6f7c84460..3c967d1b3605 100644
+--- a/sound/firewire/dice/dice.h
++++ b/sound/firewire/dice/dice.h
+@@ -109,7 +109,8 @@ struct snd_dice {
+       struct fw_iso_resources rx_resources[MAX_STREAMS];
+       struct amdtp_stream tx_stream[MAX_STREAMS];
+       struct amdtp_stream rx_stream[MAX_STREAMS];
+-      bool global_enabled;
++      bool global_enabled:1;
++      bool disable_double_pcm_frames:1;
+       struct completion clock_accepted;
+       unsigned int substreams_counter;
+-- 
+2.30.2
+
diff --git a/queue-5.12/alsa-sb8-add-a-comment-note-regarding-an-unused-poin.patch b/queue-5.12/alsa-sb8-add-a-comment-note-regarding-an-unused-poin.patch
new file mode 100644 (file)
index 0000000..ea290bf
--- /dev/null
@@ -0,0 +1,45 @@
+From f6cdab7be98defd043097e7b2a4e46d0597ec6bd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:02 +0200
+Subject: ALSA: sb8: Add a comment note regarding an unused pointer
+
+From: Atul Gopinathan <atulgopinathan@gmail.com>
+
+[ Upstream commit a28591f61b60fac820c6de59826ffa710e5e314e ]
+
+The field "fm_res" of "struct snd_sb8" is never used/dereferenced
+throughout the sb8.c code. Therefore there is no need for any null value
+check after the "request_region()".
+
+Add a comment note to make developers know about this and prevent any
+"NULL check" patches on this part of code.
+
+Cc: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Atul Gopinathan <atulgopinathan@gmail.com>
+Link: https://lore.kernel.org/r/20210503115736.2104747-36-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/isa/sb/sb8.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
+index 95290ffe5c6e..ed3a87ebe3f4 100644
+--- a/sound/isa/sb/sb8.c
++++ b/sound/isa/sb/sb8.c
+@@ -93,7 +93,11 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
+       acard = card->private_data;
+       card->private_free = snd_sb8_free;
+-      /* block the 0x388 port to avoid PnP conflicts */
++      /*
++       * Block the 0x388 port to avoid PnP conflicts.
++       * No need to check this value after request_region,
++       * as we never do anything with it.
++       */
+       acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
+       if (port[dev] != SNDRV_AUTO_PORT) {
+-- 
+2.30.2
+
diff --git a/queue-5.12/asoc-cs43130-handle-errors-in-cs43130_probe-properly.patch b/queue-5.12/asoc-cs43130-handle-errors-in-cs43130_probe-properly.patch
new file mode 100644 (file)
index 0000000..1b78cb8
--- /dev/null
@@ -0,0 +1,78 @@
+From 53af95c598cabc166fb4a6a0aa40bcdfb41aebe6 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:24 +0200
+Subject: ASoC: cs43130: handle errors in cs43130_probe() properly
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 2da441a6491d93eff8ffff523837fd621dc80389 ]
+
+cs43130_probe() does not do any valid error checking of things it
+initializes, OR what it does, it does not unwind properly if there are
+errors.
+
+Fix this up by moving the sysfs files to an attribute group so the
+driver core will correctly add/remove them all at once and handle errors
+with them, and correctly check for creating a new workqueue and
+unwinding if that fails.
+
+Cc: Mark Brown <broonie@kernel.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-58-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/cs43130.c | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
+index c2b6f0ae6d57..80cd3ea0c157 100644
+--- a/sound/soc/codecs/cs43130.c
++++ b/sound/soc/codecs/cs43130.c
+@@ -1735,6 +1735,14 @@ static DEVICE_ATTR(hpload_dc_r, 0444, cs43130_show_dc_r, NULL);
+ static DEVICE_ATTR(hpload_ac_l, 0444, cs43130_show_ac_l, NULL);
+ static DEVICE_ATTR(hpload_ac_r, 0444, cs43130_show_ac_r, NULL);
++static struct attribute *hpload_attrs[] = {
++      &dev_attr_hpload_dc_l.attr,
++      &dev_attr_hpload_dc_r.attr,
++      &dev_attr_hpload_ac_l.attr,
++      &dev_attr_hpload_ac_r.attr,
++};
++ATTRIBUTE_GROUPS(hpload);
++
+ static struct reg_sequence hp_en_cal_seq[] = {
+       {CS43130_INT_MASK_4, CS43130_INT_MASK_ALL},
+       {CS43130_HP_MEAS_LOAD_1, 0},
+@@ -2302,23 +2310,15 @@ static int cs43130_probe(struct snd_soc_component *component)
+       cs43130->hpload_done = false;
+       if (cs43130->dc_meas) {
+-              ret = device_create_file(component->dev, &dev_attr_hpload_dc_l);
+-              if (ret < 0)
+-                      return ret;
+-
+-              ret = device_create_file(component->dev, &dev_attr_hpload_dc_r);
+-              if (ret < 0)
+-                      return ret;
+-
+-              ret = device_create_file(component->dev, &dev_attr_hpload_ac_l);
+-              if (ret < 0)
+-                      return ret;
+-
+-              ret = device_create_file(component->dev, &dev_attr_hpload_ac_r);
+-              if (ret < 0)
++              ret = sysfs_create_groups(&component->dev->kobj, hpload_groups);
++              if (ret)
+                       return ret;
+               cs43130->wq = create_singlethread_workqueue("cs43130_hp");
++              if (!cs43130->wq) {
++                      sysfs_remove_groups(&component->dev->kobj, hpload_groups);
++                      return -ENOMEM;
++              }
+               INIT_WORK(&cs43130->work, cs43130_imp_meas);
+       }
+-- 
+2.30.2
+
diff --git a/queue-5.12/ath6kl-return-error-code-in-ath6kl_wmi_set_roam_lrss.patch b/queue-5.12/ath6kl-return-error-code-in-ath6kl_wmi_set_roam_lrss.patch
new file mode 100644 (file)
index 0000000..12d2331
--- /dev/null
@@ -0,0 +1,64 @@
+From 069acf201d922de059968e1b7d8c637496e12a6f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:10 +0200
+Subject: ath6kl: return error code in ath6kl_wmi_set_roam_lrssi_cmd()
+
+From: Anirudh Rayabharam <mail@anirudhrb.com>
+
+[ Upstream commit 54433367840b46a1555c8ed36c4c0cfc5dbf1358 ]
+
+Propagate error code from failure of ath6kl_wmi_cmd_send() to the
+caller.
+
+Signed-off-by: Anirudh Rayabharam <mail@anirudhrb.com>
+Cc: Kalle Valo <kvalo@codeaurora.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-44-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/ath/ath6kl/debug.c | 5 ++++-
+ drivers/net/wireless/ath/ath6kl/wmi.c   | 4 +---
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
+index 7506cea46f58..433a047f3747 100644
+--- a/drivers/net/wireless/ath/ath6kl/debug.c
++++ b/drivers/net/wireless/ath/ath6kl/debug.c
+@@ -1027,14 +1027,17 @@ static ssize_t ath6kl_lrssi_roam_write(struct file *file,
+ {
+       struct ath6kl *ar = file->private_data;
+       unsigned long lrssi_roam_threshold;
++      int ret;
+       if (kstrtoul_from_user(user_buf, count, 0, &lrssi_roam_threshold))
+               return -EINVAL;
+       ar->lrssi_roam_threshold = lrssi_roam_threshold;
+-      ath6kl_wmi_set_roam_lrssi_cmd(ar->wmi, ar->lrssi_roam_threshold);
++      ret = ath6kl_wmi_set_roam_lrssi_cmd(ar->wmi, ar->lrssi_roam_threshold);
++      if (ret)
++              return ret;
+       return count;
+ }
+diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
+index aca9732ec1ee..b137e7f34397 100644
+--- a/drivers/net/wireless/ath/ath6kl/wmi.c
++++ b/drivers/net/wireless/ath/ath6kl/wmi.c
+@@ -776,10 +776,8 @@ int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi)
+       cmd->info.params.roam_rssi_floor = DEF_LRSSI_ROAM_FLOOR;
+       cmd->roam_ctrl = WMI_SET_LRSSI_SCAN_PARAMS;
+-      ath6kl_wmi_cmd_send(wmi, 0, skb, WMI_SET_ROAM_CTRL_CMDID,
++      return ath6kl_wmi_cmd_send(wmi, 0, skb, WMI_SET_ROAM_CTRL_CMDID,
+                           NO_SYNC_WMIFLAG);
+-
+-      return 0;
+ }
+ int ath6kl_wmi_force_roam_cmd(struct wmi *wmi, const u8 *bssid)
+-- 
+2.30.2
+
diff --git a/queue-5.12/block-fix-a-race-between-del_gendisk-and-blkrrpart.patch b/queue-5.12/block-fix-a-race-between-del_gendisk-and-blkrrpart.patch
new file mode 100644 (file)
index 0000000..13db4c1
--- /dev/null
@@ -0,0 +1,43 @@
+From 03344fc4ee41b9238a54c659033db5dfb5d3a08d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 14 May 2021 15:18:42 +0200
+Subject: block: fix a race between del_gendisk and BLKRRPART
+
+From: Gulam Mohamed <gulam.mohamed@oracle.com>
+
+[ Upstream commit bc6a385132601c29a6da1dbf8148c0d3c9ad36dc ]
+
+When BLKRRPART is called concurrently with del_gendisk, the partitions
+rescan can create a stale partition that will never be be cleaned up.
+
+Fix this by checking the the disk is up before rescanning partitions
+while under bd_mutex.
+
+Signed-off-by: Gulam Mohamed <gulam.mohamed@oracle.com>
+[hch: split from a larger patch]
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Ming Lei <ming.lei@redhat.com>
+Link: https://lore.kernel.org/r/20210514131842.1600568-3-hch@lst.de
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/block_dev.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/fs/block_dev.c b/fs/block_dev.c
+index a5a6a7930e5e..389609bc5aa3 100644
+--- a/fs/block_dev.c
++++ b/fs/block_dev.c
+@@ -1244,6 +1244,9 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)
+       lockdep_assert_held(&bdev->bd_mutex);
++      if (!(disk->flags & GENHD_FL_UP))
++              return -ENXIO;
++
+ rescan:
+       ret = blk_drop_partitions(bdev);
+       if (ret)
+-- 
+2.30.2
+
diff --git a/queue-5.12/brcmfmac-properly-check-for-bus-register-errors.patch b/queue-5.12/brcmfmac-properly-check-for-bus-register-errors.patch
new file mode 100644 (file)
index 0000000..7a7be21
--- /dev/null
@@ -0,0 +1,197 @@
+From 5dab98039dd4a843f01c69cfa4031d6bd8e0f877 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:36 +0200
+Subject: brcmfmac: properly check for bus register errors
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 419b4a142a7ece36cebcd434f8ce2af59ef94b85 ]
+
+The brcmfmac driver ignores any errors on initialization with the
+different busses by deferring the initialization to a workqueue and
+ignoring all possible errors that might happen.  Fix up all of this by
+only allowing the module to load if all bus registering worked properly.
+
+Cc: Kalle Valo <kvalo@codeaurora.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-70-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 +---
+ .../broadcom/brcm80211/brcmfmac/bus.h         | 19 ++++++++-
+ .../broadcom/brcm80211/brcmfmac/core.c        | 42 ++++++++-----------
+ .../broadcom/brcm80211/brcmfmac/pcie.c        |  9 +---
+ .../broadcom/brcm80211/brcmfmac/pcie.h        |  5 ---
+ .../broadcom/brcm80211/brcmfmac/usb.c         |  4 +-
+ 6 files changed, 41 insertions(+), 46 deletions(-)
+
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+index ce8c102df7b3..633d0ab19031 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+@@ -1217,13 +1217,9 @@ static struct sdio_driver brcmf_sdmmc_driver = {
+       },
+ };
+-void brcmf_sdio_register(void)
++int brcmf_sdio_register(void)
+ {
+-      int ret;
+-
+-      ret = sdio_register_driver(&brcmf_sdmmc_driver);
+-      if (ret)
+-              brcmf_err("sdio_register_driver failed: %d\n", ret);
++      return sdio_register_driver(&brcmf_sdmmc_driver);
+ }
+ void brcmf_sdio_exit(void)
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
+index 08f9d47f2e5c..3f5da3bb6aa5 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
+@@ -275,11 +275,26 @@ void brcmf_bus_add_txhdrlen(struct device *dev, uint len);
+ #ifdef CONFIG_BRCMFMAC_SDIO
+ void brcmf_sdio_exit(void);
+-void brcmf_sdio_register(void);
++int brcmf_sdio_register(void);
++#else
++static inline void brcmf_sdio_exit(void) { }
++static inline int brcmf_sdio_register(void) { return 0; }
+ #endif
++
+ #ifdef CONFIG_BRCMFMAC_USB
+ void brcmf_usb_exit(void);
+-void brcmf_usb_register(void);
++int brcmf_usb_register(void);
++#else
++static inline void brcmf_usb_exit(void) { }
++static inline int brcmf_usb_register(void) { return 0; }
++#endif
++
++#ifdef CONFIG_BRCMFMAC_PCIE
++void brcmf_pcie_exit(void);
++int brcmf_pcie_register(void);
++#else
++static inline void brcmf_pcie_exit(void) { }
++static inline int brcmf_pcie_register(void) { return 0; }
+ #endif
+ #endif /* BRCMFMAC_BUS_H */
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+index ea78fe527c5d..7e528833aafa 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+@@ -1518,40 +1518,34 @@ void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state)
+       }
+ }
+-static void brcmf_driver_register(struct work_struct *work)
+-{
+-#ifdef CONFIG_BRCMFMAC_SDIO
+-      brcmf_sdio_register();
+-#endif
+-#ifdef CONFIG_BRCMFMAC_USB
+-      brcmf_usb_register();
+-#endif
+-#ifdef CONFIG_BRCMFMAC_PCIE
+-      brcmf_pcie_register();
+-#endif
+-}
+-static DECLARE_WORK(brcmf_driver_work, brcmf_driver_register);
+-
+ int __init brcmf_core_init(void)
+ {
+-      if (!schedule_work(&brcmf_driver_work))
+-              return -EBUSY;
++      int err;
++      err = brcmf_sdio_register();
++      if (err)
++              return err;
++
++      err = brcmf_usb_register();
++      if (err)
++              goto error_usb_register;
++
++      err = brcmf_pcie_register();
++      if (err)
++              goto error_pcie_register;
+       return 0;
++
++error_pcie_register:
++      brcmf_usb_exit();
++error_usb_register:
++      brcmf_sdio_exit();
++      return err;
+ }
+ void __exit brcmf_core_exit(void)
+ {
+-      cancel_work_sync(&brcmf_driver_work);
+-
+-#ifdef CONFIG_BRCMFMAC_SDIO
+       brcmf_sdio_exit();
+-#endif
+-#ifdef CONFIG_BRCMFMAC_USB
+       brcmf_usb_exit();
+-#endif
+-#ifdef CONFIG_BRCMFMAC_PCIE
+       brcmf_pcie_exit();
+-#endif
+ }
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+index ad79e3b7e74a..143a705b5cb3 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+@@ -2140,15 +2140,10 @@ static struct pci_driver brcmf_pciedrvr = {
+ };
+-void brcmf_pcie_register(void)
++int brcmf_pcie_register(void)
+ {
+-      int err;
+-
+       brcmf_dbg(PCIE, "Enter\n");
+-      err = pci_register_driver(&brcmf_pciedrvr);
+-      if (err)
+-              brcmf_err(NULL, "PCIE driver registration failed, err=%d\n",
+-                        err);
++      return pci_register_driver(&brcmf_pciedrvr);
+ }
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.h
+index d026401d2001..8e6c227e8315 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.h
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.h
+@@ -11,9 +11,4 @@ struct brcmf_pciedev {
+       struct brcmf_pciedev_info *devinfo;
+ };
+-
+-void brcmf_pcie_exit(void);
+-void brcmf_pcie_register(void);
+-
+-
+ #endif /* BRCMFMAC_PCIE_H */
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+index d2a803fc8ac6..9fb68c2dc7e3 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+@@ -1584,8 +1584,8 @@ void brcmf_usb_exit(void)
+       usb_deregister(&brcmf_usbdrvr);
+ }
+-void brcmf_usb_register(void)
++int brcmf_usb_register(void)
+ {
+       brcmf_dbg(USB, "Enter\n");
+-      usb_register(&brcmf_usbdrvr);
++      return usb_register(&brcmf_usbdrvr);
+ }
+-- 
+2.30.2
+
diff --git a/queue-5.12/btrfs-do-not-bug_on-in-link_to_fixup_dir.patch b/queue-5.12/btrfs-do-not-bug_on-in-link_to_fixup_dir.patch
new file mode 100644 (file)
index 0000000..f6a2e27
--- /dev/null
@@ -0,0 +1,76 @@
+From fc379f21bd32739256f1cf7890b63eaa37fb2bb7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 14 May 2021 10:56:16 -0400
+Subject: btrfs: do not BUG_ON in link_to_fixup_dir
+
+From: Josef Bacik <josef@toxicpanda.com>
+
+[ Upstream commit 91df99a6eb50d5a1bc70fff4a09a0b7ae6aab96d ]
+
+While doing error injection testing I got the following panic
+
+  kernel BUG at fs/btrfs/tree-log.c:1862!
+  invalid opcode: 0000 [#1] SMP NOPTI
+  CPU: 1 PID: 7836 Comm: mount Not tainted 5.13.0-rc1+ #305
+  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
+  RIP: 0010:link_to_fixup_dir+0xd5/0xe0
+  RSP: 0018:ffffb5800180fa30 EFLAGS: 00010216
+  RAX: fffffffffffffffb RBX: 00000000fffffffb RCX: ffff8f595287faf0
+  RDX: ffffb5800180fa37 RSI: ffff8f5954978800 RDI: 0000000000000000
+  RBP: ffff8f5953af9450 R08: 0000000000000019 R09: 0000000000000001
+  R10: 000151f408682970 R11: 0000000120021001 R12: ffff8f5954978800
+  R13: ffff8f595287faf0 R14: ffff8f5953c77dd0 R15: 0000000000000065
+  FS:  00007fc5284c8c40(0000) GS:ffff8f59bbd00000(0000) knlGS:0000000000000000
+  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+  CR2: 00007fc5287f47c0 CR3: 000000011275e002 CR4: 0000000000370ee0
+  Call Trace:
+   replay_one_buffer+0x409/0x470
+   ? btree_read_extent_buffer_pages+0xd0/0x110
+   walk_up_log_tree+0x157/0x1e0
+   walk_log_tree+0xa6/0x1d0
+   btrfs_recover_log_trees+0x1da/0x360
+   ? replay_one_extent+0x7b0/0x7b0
+   open_ctree+0x1486/0x1720
+   btrfs_mount_root.cold+0x12/0xea
+   ? __kmalloc_track_caller+0x12f/0x240
+   legacy_get_tree+0x24/0x40
+   vfs_get_tree+0x22/0xb0
+   vfs_kern_mount.part.0+0x71/0xb0
+   btrfs_mount+0x10d/0x380
+   ? vfs_parse_fs_string+0x4d/0x90
+   legacy_get_tree+0x24/0x40
+   vfs_get_tree+0x22/0xb0
+   path_mount+0x433/0xa10
+   __x64_sys_mount+0xe3/0x120
+   do_syscall_64+0x3d/0x80
+   entry_SYSCALL_64_after_hwframe+0x44/0xae
+
+We can get -EIO or any number of legitimate errors from
+btrfs_search_slot(), panicing here is not the appropriate response.  The
+error path for this code handles errors properly, simply return the
+error.
+
+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: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/tree-log.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
+index 53624fca0747..d7f1599e69b1 100644
+--- a/fs/btrfs/tree-log.c
++++ b/fs/btrfs/tree-log.c
+@@ -1858,8 +1858,6 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans,
+               ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+       } else if (ret == -EEXIST) {
+               ret = 0;
+-      } else {
+-              BUG(); /* Logic Error */
+       }
+       iput(inode);
+-- 
+2.30.2
+
diff --git a/queue-5.12/btrfs-release-path-before-starting-transaction-when-.patch b/queue-5.12/btrfs-release-path-before-starting-transaction-when-.patch
new file mode 100644 (file)
index 0000000..5434d0c
--- /dev/null
@@ -0,0 +1,155 @@
+From bb72e26b3e853cfcc18a8da2c31be9c2ba1158db Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 14 May 2021 10:03:40 +0100
+Subject: btrfs: release path before starting transaction when cloning inline
+ extent
+
+From: Filipe Manana <fdmanana@suse.com>
+
+[ Upstream commit 6416954ca75baed71640bf3828625bf165fb9b5e ]
+
+When cloning an inline extent there are a few cases, such as when we have
+an implicit hole at file offset 0, where we start a transaction while
+holding a read lock on a leaf. Starting the transaction results in a call
+to sb_start_intwrite(), which results in doing a read lock on a percpu
+semaphore. Lockdep doesn't like this and complains about it:
+
+  [46.580704] ======================================================
+  [46.580752] WARNING: possible circular locking dependency detected
+  [46.580799] 5.13.0-rc1 #28 Not tainted
+  [46.580832] ------------------------------------------------------
+  [46.580877] cloner/3835 is trying to acquire lock:
+  [46.580918] c00000001301d638 (sb_internal#2){.+.+}-{0:0}, at: clone_copy_inline_extent+0xe4/0x5a0
+  [46.581167]
+  [46.581167] but task is already holding lock:
+  [46.581217] c000000007fa2550 (btrfs-tree-00){++++}-{3:3}, at: __btrfs_tree_read_lock+0x70/0x1d0
+  [46.581293]
+  [46.581293] which lock already depends on the new lock.
+  [46.581293]
+  [46.581351]
+  [46.581351] the existing dependency chain (in reverse order) is:
+  [46.581410]
+  [46.581410] -> #1 (btrfs-tree-00){++++}-{3:3}:
+  [46.581464]        down_read_nested+0x68/0x200
+  [46.581536]        __btrfs_tree_read_lock+0x70/0x1d0
+  [46.581577]        btrfs_read_lock_root_node+0x88/0x200
+  [46.581623]        btrfs_search_slot+0x298/0xb70
+  [46.581665]        btrfs_set_inode_index+0xfc/0x260
+  [46.581708]        btrfs_new_inode+0x26c/0x950
+  [46.581749]        btrfs_create+0xf4/0x2b0
+  [46.581782]        lookup_open.isra.57+0x55c/0x6a0
+  [46.581855]        path_openat+0x418/0xd20
+  [46.581888]        do_filp_open+0x9c/0x130
+  [46.581920]        do_sys_openat2+0x2ec/0x430
+  [46.581961]        do_sys_open+0x90/0xc0
+  [46.581993]        system_call_exception+0x3d4/0x410
+  [46.582037]        system_call_common+0xec/0x278
+  [46.582078]
+  [46.582078] -> #0 (sb_internal#2){.+.+}-{0:0}:
+  [46.582135]        __lock_acquire+0x1e90/0x2c50
+  [46.582176]        lock_acquire+0x2b4/0x5b0
+  [46.582263]        start_transaction+0x3cc/0x950
+  [46.582308]        clone_copy_inline_extent+0xe4/0x5a0
+  [46.582353]        btrfs_clone+0x5fc/0x880
+  [46.582388]        btrfs_clone_files+0xd8/0x1c0
+  [46.582434]        btrfs_remap_file_range+0x3d8/0x590
+  [46.582481]        do_clone_file_range+0x10c/0x270
+  [46.582558]        vfs_clone_file_range+0x1b0/0x310
+  [46.582605]        ioctl_file_clone+0x90/0x130
+  [46.582651]        do_vfs_ioctl+0x874/0x1ac0
+  [46.582697]        sys_ioctl+0x6c/0x120
+  [46.582733]        system_call_exception+0x3d4/0x410
+  [46.582777]        system_call_common+0xec/0x278
+  [46.582822]
+  [46.582822] other info that might help us debug this:
+  [46.582822]
+  [46.582888]  Possible unsafe locking scenario:
+  [46.582888]
+  [46.582942]        CPU0                    CPU1
+  [46.582984]        ----                    ----
+  [46.583028]   lock(btrfs-tree-00);
+  [46.583062]                                lock(sb_internal#2);
+  [46.583119]                                lock(btrfs-tree-00);
+  [46.583174]   lock(sb_internal#2);
+  [46.583212]
+  [46.583212]  *** DEADLOCK ***
+  [46.583212]
+  [46.583266] 6 locks held by cloner/3835:
+  [46.583299]  #0: c00000001301d448 (sb_writers#12){.+.+}-{0:0}, at: ioctl_file_clone+0x90/0x130
+  [46.583382]  #1: c00000000f6d3768 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: lock_two_nondirectories+0x58/0xc0
+  [46.583477]  #2: c00000000f6d72a8 (&sb->s_type->i_mutex_key#15/4){+.+.}-{3:3}, at: lock_two_nondirectories+0x9c/0xc0
+  [46.583574]  #3: c00000000f6d7138 (&ei->i_mmap_lock){+.+.}-{3:3}, at: btrfs_remap_file_range+0xd0/0x590
+  [46.583657]  #4: c00000000f6d35f8 (&ei->i_mmap_lock/1){+.+.}-{3:3}, at: btrfs_remap_file_range+0xe0/0x590
+  [46.583743]  #5: c000000007fa2550 (btrfs-tree-00){++++}-{3:3}, at: __btrfs_tree_read_lock+0x70/0x1d0
+  [46.583828]
+  [46.583828] stack backtrace:
+  [46.583872] CPU: 1 PID: 3835 Comm: cloner Not tainted 5.13.0-rc1 #28
+  [46.583931] Call Trace:
+  [46.583955] [c0000000167c7200] [c000000000c1ee78] dump_stack+0xec/0x144 (unreliable)
+  [46.584052] [c0000000167c7240] [c000000000274058] print_circular_bug.isra.32+0x3a8/0x400
+  [46.584123] [c0000000167c72e0] [c0000000002741f4] check_noncircular+0x144/0x190
+  [46.584191] [c0000000167c73b0] [c000000000278fc0] __lock_acquire+0x1e90/0x2c50
+  [46.584259] [c0000000167c74f0] [c00000000027aa94] lock_acquire+0x2b4/0x5b0
+  [46.584317] [c0000000167c75e0] [c000000000a0d6cc] start_transaction+0x3cc/0x950
+  [46.584388] [c0000000167c7690] [c000000000af47a4] clone_copy_inline_extent+0xe4/0x5a0
+  [46.584457] [c0000000167c77c0] [c000000000af525c] btrfs_clone+0x5fc/0x880
+  [46.584514] [c0000000167c7990] [c000000000af5698] btrfs_clone_files+0xd8/0x1c0
+  [46.584583] [c0000000167c7a00] [c000000000af5b58] btrfs_remap_file_range+0x3d8/0x590
+  [46.584652] [c0000000167c7ae0] [c0000000005d81dc] do_clone_file_range+0x10c/0x270
+  [46.584722] [c0000000167c7b40] [c0000000005d84f0] vfs_clone_file_range+0x1b0/0x310
+  [46.584793] [c0000000167c7bb0] [c00000000058bf80] ioctl_file_clone+0x90/0x130
+  [46.584861] [c0000000167c7c10] [c00000000058c894] do_vfs_ioctl+0x874/0x1ac0
+  [46.584922] [c0000000167c7d10] [c00000000058db4c] sys_ioctl+0x6c/0x120
+  [46.584978] [c0000000167c7d60] [c0000000000364a4] system_call_exception+0x3d4/0x410
+  [46.585046] [c0000000167c7e10] [c00000000000d45c] system_call_common+0xec/0x278
+  [46.585114] --- interrupt: c00 at 0x7ffff7e22990
+  [46.585160] NIP:  00007ffff7e22990 LR: 00000001000010ec CTR: 0000000000000000
+  [46.585224] REGS: c0000000167c7e80 TRAP: 0c00   Not tainted  (5.13.0-rc1)
+  [46.585280] MSR:  800000000280f033 <SF,VEC,VSX,EE,PR,FP,ME,IR,DR,RI,LE>  CR: 28000244  XER: 00000000
+  [46.585374] IRQMASK: 0
+  [46.585374] GPR00: 0000000000000036 00007fffffffdec0 00007ffff7f17100 0000000000000004
+  [46.585374] GPR04: 000000008020940d 00007fffffffdf40 0000000000000000 0000000000000000
+  [46.585374] GPR08: 0000000000000004 0000000000000000 0000000000000000 0000000000000000
+  [46.585374] GPR12: 0000000000000000 00007ffff7ffa940 0000000000000000 0000000000000000
+  [46.585374] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
+  [46.585374] GPR20: 0000000000000000 000000009123683e 00007fffffffdf40 0000000000000000
+  [46.585374] GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000004
+  [46.585374] GPR28: 0000000100030260 0000000100030280 0000000000000003 000000000000005f
+  [46.585919] NIP [00007ffff7e22990] 0x7ffff7e22990
+  [46.585964] LR [00000001000010ec] 0x1000010ec
+  [46.586010] --- interrupt: c00
+
+This should be a false positive, as both locks are acquired in read mode.
+Nevertheless, we don't need to hold a leaf locked when we start the
+transaction, so just release the leaf (path) before starting it.
+
+Reported-by: Ritesh Harjani <riteshh@linux.ibm.com>
+Link: https://lore.kernel.org/linux-btrfs/20210513214404.xks77p566fglzgum@riteshh-domain/
+Reviewed-by: Anand Jain <anand.jain@oracle.com>
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/reflink.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c
+index 0abbf050580d..53ee17f5e382 100644
+--- a/fs/btrfs/reflink.c
++++ b/fs/btrfs/reflink.c
+@@ -285,6 +285,11 @@ copy_inline_extent:
+       ret = btrfs_inode_set_file_extent_range(BTRFS_I(dst), 0, aligned_end);
+ out:
+       if (!ret && !trans) {
++              /*
++               * Release path before starting a new transaction so we don't
++               * hold locks that would confuse lockdep.
++               */
++              btrfs_release_path(path);
+               /*
+                * No transaction here means we copied the inline extent into a
+                * page of the destination inode.
+-- 
+2.30.2
+
diff --git a/queue-5.12/btrfs-return-whole-extents-in-fiemap.patch b/queue-5.12/btrfs-return-whole-extents-in-fiemap.patch
new file mode 100644 (file)
index 0000000..f7150e7
--- /dev/null
@@ -0,0 +1,86 @@
+From 459b0553ac9606a8622b4cb30126ded4f089b9f7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 6 Apr 2021 15:31:18 -0700
+Subject: btrfs: return whole extents in fiemap
+
+From: Boris Burkov <boris@bur.io>
+
+[ Upstream commit 15c7745c9a0078edad1f7df5a6bb7b80bc8cca23 ]
+
+  `xfs_io -c 'fiemap <off> <len>' <file>`
+
+can give surprising results on btrfs that differ from xfs.
+
+btrfs prints out extents trimmed to fit the user input. If the user's
+fiemap request has an offset, then rather than returning each whole
+extent which intersects that range, we also trim the start extent to not
+have start < off.
+
+Documentation in filesystems/fiemap.txt and the xfs_io man page suggests
+that returning the whole extent is expected.
+
+Some cases which all yield the same fiemap in xfs, but not btrfs:
+  dd if=/dev/zero of=$f bs=4k count=1
+  sudo xfs_io -c 'fiemap 0 1024' $f
+    0: [0..7]: 26624..26631
+  sudo xfs_io -c 'fiemap 2048 1024' $f
+    0: [4..7]: 26628..26631
+  sudo xfs_io -c 'fiemap 2048 4096' $f
+    0: [4..7]: 26628..26631
+  sudo xfs_io -c 'fiemap 3584 512' $f
+    0: [7..7]: 26631..26631
+  sudo xfs_io -c 'fiemap 4091 5' $f
+    0: [7..6]: 26631..26630
+
+I believe this is a consequence of the logic for merging contiguous
+extents represented by separate extent items. That logic needs to track
+the last offset as it loops through the extent items, which happens to
+pick up the start offset on the first iteration, and trim off the
+beginning of the full extent. To fix it, start `off` at 0 rather than
+`start` so that we keep the iteration/merging intact without cutting off
+the start of the extent.
+
+after the fix, all the above commands give:
+
+  0: [0..7]: 26624..26631
+
+The merging logic is exercised by fstest generic/483, and I have written
+a new fstest for checking we don't have backwards or zero-length fiemaps
+for cases like those above.
+
+Reviewed-by: Josef Bacik <josef@toxicpanda.com>
+Signed-off-by: Boris Burkov <boris@bur.io>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/extent_io.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
+index 910769d5fcdb..1eb5d22d5373 100644
+--- a/fs/btrfs/extent_io.c
++++ b/fs/btrfs/extent_io.c
+@@ -4975,7 +4975,7 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
+                 u64 start, u64 len)
+ {
+       int ret = 0;
+-      u64 off = start;
++      u64 off;
+       u64 max = start + len;
+       u32 flags = 0;
+       u32 found_type;
+@@ -5010,6 +5010,11 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
+               goto out_free_ulist;
+       }
++      /*
++       * We can't initialize that to 'start' as this could miss extents due
++       * to extent item merging
++       */
++      off = 0;
+       start = round_down(start, btrfs_inode_sectorsize(inode));
+       len = round_up(max, btrfs_inode_sectorsize(inode)) - start;
+-- 
+2.30.2
+
diff --git a/queue-5.12/char-hpet-add-checks-after-calling-ioremap.patch b/queue-5.12/char-hpet-add-checks-after-calling-ioremap.patch
new file mode 100644 (file)
index 0000000..eb20734
--- /dev/null
@@ -0,0 +1,46 @@
+From 64116f05265cb12b8bb8f7def276052d6bb641b9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:56 +0200
+Subject: char: hpet: add checks after calling ioremap
+
+From: Tom Seewald <tseewald@gmail.com>
+
+[ Upstream commit b11701c933112d49b808dee01cb7ff854ba6a77a ]
+
+The function hpet_resources() calls ioremap() two times, but in both
+cases it does not check if ioremap() returned a null pointer. Fix this
+by adding null pointer checks and returning an appropriate error.
+
+Signed-off-by: Tom Seewald <tseewald@gmail.com>
+Link: https://lore.kernel.org/r/20210503115736.2104747-30-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/char/hpet.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
+index 6f13def6c172..8b55085650ad 100644
+--- a/drivers/char/hpet.c
++++ b/drivers/char/hpet.c
+@@ -969,6 +969,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
+       if (ACPI_SUCCESS(status)) {
+               hdp->hd_phys_address = addr.address.minimum;
+               hdp->hd_address = ioremap(addr.address.minimum, addr.address.address_length);
++              if (!hdp->hd_address)
++                      return AE_ERROR;
+               if (hpet_is_known(hdp)) {
+                       iounmap(hdp->hd_address);
+@@ -982,6 +984,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
+               hdp->hd_phys_address = fixmem32->address;
+               hdp->hd_address = ioremap(fixmem32->address,
+                                               HPET_RANGE_SIZE);
++              if (!hdp->hd_address)
++                      return AE_ERROR;
+               if (hpet_is_known(hdp)) {
+                       iounmap(hdp->hd_address);
+-- 
+2.30.2
+
diff --git a/queue-5.12/dmaengine-qcom_hidma-comment-platform_driver_registe.patch b/queue-5.12/dmaengine-qcom_hidma-comment-platform_driver_registe.patch
new file mode 100644 (file)
index 0000000..831d183
--- /dev/null
@@ -0,0 +1,52 @@
+From 1e65d7605a11f25717f401f5465a7ad9ac2df0b8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:18 +0200
+Subject: dmaengine: qcom_hidma: comment platform_driver_register call
+
+From: Phillip Potter <phil@philpotter.co.uk>
+
+[ Upstream commit 4df2a8b0ad634d98a67e540a4e18a60f943e7d9f ]
+
+Place a comment in hidma_mgmt_init explaining why success must
+currently be assumed, due to the cleanup issue that would need to
+be considered were this module ever to be unloadable or were this
+platform_driver_register call ever to fail.
+
+Acked-By: Vinod Koul <vkoul@kernel.org>
+Acked-By: Sinan Kaya <okaya@kernel.org>
+Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
+Link: https://lore.kernel.org/r/20210503115736.2104747-52-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/dma/qcom/hidma_mgmt.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/drivers/dma/qcom/hidma_mgmt.c b/drivers/dma/qcom/hidma_mgmt.c
+index fe87b01f7a4e..62026607f3f8 100644
+--- a/drivers/dma/qcom/hidma_mgmt.c
++++ b/drivers/dma/qcom/hidma_mgmt.c
+@@ -418,6 +418,20 @@ static int __init hidma_mgmt_init(void)
+               hidma_mgmt_of_populate_channels(child);
+       }
+ #endif
++      /*
++       * We do not check for return value here, as it is assumed that
++       * platform_driver_register must not fail. The reason for this is that
++       * the (potential) hidma_mgmt_of_populate_channels calls above are not
++       * cleaned up if it does fail, and to do this work is quite
++       * complicated. In particular, various calls of of_address_to_resource,
++       * of_irq_to_resource, platform_device_register_full, of_dma_configure,
++       * and of_msi_configure which then call other functions and so on, must
++       * be cleaned up - this is not a trivial exercise.
++       *
++       * Currently, this module is not intended to be unloaded, and there is
++       * no module_exit function defined which does the needed cleanup. For
++       * this reason, we have to assume success here.
++       */
+       platform_driver_register(&hidma_mgmt_driver);
+       return 0;
+-- 
+2.30.2
+
diff --git a/queue-5.12/drm-amd-amdgpu-fix-a-potential-deadlock-in-gpu-reset.patch b/queue-5.12/drm-amd-amdgpu-fix-a-potential-deadlock-in-gpu-reset.patch
new file mode 100644 (file)
index 0000000..76f67a1
--- /dev/null
@@ -0,0 +1,94 @@
+From a0e3028a7d5297dde0094ce256ef73b6f98eab58 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 17 May 2021 12:47:20 +0800
+Subject: drm/amd/amdgpu: fix a potential deadlock in gpu reset
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Lang Yu <Lang.Yu@amd.com>
+
+[ Upstream commit 9c2876d56f1ce9b6b2072f1446fb1e8d1532cb3d ]
+
+When amdgpu_ib_ring_tests failed, the reset logic called
+amdgpu_device_ip_suspend twice, then deadlock occurred.
+Deadlock log:
+
+[  805.655192] amdgpu 0000:04:00.0: amdgpu: ib ring test failed (-110).
+[  806.290952] [drm] free PSP TMR buffer
+
+[  806.319406] ============================================
+[  806.320315] WARNING: possible recursive locking detected
+[  806.321225] 5.11.0-custom #1 Tainted: G        W  OEL
+[  806.322135] --------------------------------------------
+[  806.323043] cat/2593 is trying to acquire lock:
+[  806.323825] ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
+[  806.325668]
+               but task is already holding lock:
+[  806.326664] ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
+[  806.328430]
+               other info that might help us debug this:
+[  806.329539]  Possible unsafe locking scenario:
+
+[  806.330549]        CPU0
+[  806.330983]        ----
+[  806.331416]   lock(&adev->dm.dc_lock);
+[  806.332086]   lock(&adev->dm.dc_lock);
+[  806.332738]
+                *** DEADLOCK ***
+
+[  806.333747]  May be due to missing lock nesting notation
+
+[  806.334899] 3 locks held by cat/2593:
+[  806.335537]  #0: ffff888100d3f1b8 (&attr->mutex){+.+.}-{3:3}, at: simple_attr_read+0x4e/0x110
+[  806.337009]  #1: ffff888136b1fd78 (&adev->reset_sem){++++}-{3:3}, at: amdgpu_device_lock_adev+0x42/0x94 [amdgpu]
+[  806.339018]  #2: ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
+[  806.340869]
+               stack backtrace:
+[  806.341621] CPU: 6 PID: 2593 Comm: cat Tainted: G        W  OEL    5.11.0-custom #1
+[  806.342921] Hardware name: AMD Celadon-CZN/Celadon-CZN, BIOS WLD0C23N_Weekly_20_12_2 12/23/2020
+[  806.344413] Call Trace:
+[  806.344849]  dump_stack+0x93/0xbd
+[  806.345435]  __lock_acquire.cold+0x18a/0x2cf
+[  806.346179]  lock_acquire+0xca/0x390
+[  806.346807]  ? dm_suspend+0xb8/0x1d0 [amdgpu]
+[  806.347813]  __mutex_lock+0x9b/0x930
+[  806.348454]  ? dm_suspend+0xb8/0x1d0 [amdgpu]
+[  806.349434]  ? amdgpu_device_indirect_rreg+0x58/0x70 [amdgpu]
+[  806.350581]  ? _raw_spin_unlock_irqrestore+0x47/0x50
+[  806.351437]  ? dm_suspend+0xb8/0x1d0 [amdgpu]
+[  806.352437]  ? rcu_read_lock_sched_held+0x4f/0x80
+[  806.353252]  ? rcu_read_lock_sched_held+0x4f/0x80
+[  806.354064]  mutex_lock_nested+0x1b/0x20
+[  806.354747]  ? mutex_lock_nested+0x1b/0x20
+[  806.355457]  dm_suspend+0xb8/0x1d0 [amdgpu]
+[  806.356427]  ? soc15_common_set_clockgating_state+0x17d/0x19 [amdgpu]
+[  806.357736]  amdgpu_device_ip_suspend_phase1+0x78/0xd0 [amdgpu]
+[  806.360394]  amdgpu_device_ip_suspend+0x21/0x70 [amdgpu]
+[  806.362926]  amdgpu_device_pre_asic_reset+0xb3/0x270 [amdgpu]
+[  806.365560]  amdgpu_device_gpu_recover.cold+0x679/0x8eb [amdgpu]
+
+Signed-off-by: Lang Yu <Lang.Yu@amd.com>
+Acked-by: Christian KÃnig <christian.koenig@amd.com>
+Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+index 5eee251e3335..85d90e857693 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+@@ -4356,7 +4356,6 @@ out:
+                       r = amdgpu_ib_ring_tests(tmp_adev);
+                       if (r) {
+                               dev_err(tmp_adev->dev, "ib ring test failed (%d).\n", r);
+-                              r = amdgpu_device_ip_suspend(tmp_adev);
+                               need_full_reset = true;
+                               r = -EAGAIN;
+                               goto end;
+-- 
+2.30.2
+
diff --git a/queue-5.12/drm-amd-amdgpu-fix-refcount-leak.patch b/queue-5.12/drm-amd-amdgpu-fix-refcount-leak.patch
new file mode 100644 (file)
index 0000000..268cdc4
--- /dev/null
@@ -0,0 +1,49 @@
+From 8f24ac215c7d457904146c7a64e1e57848e4d4f5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 17 May 2021 16:16:10 +0800
+Subject: drm/amd/amdgpu: fix refcount leak
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Jingwen Chen <Jingwen.Chen2@amd.com>
+
+[ Upstream commit fa7e6abc75f3d491bc561734312d065dc9dc2a77 ]
+
+[Why]
+the gem object rfb->base.obj[0] is get according to num_planes
+in amdgpufb_create, but is not put according to num_planes
+
+[How]
+put rfb->base.obj[0] in amdgpu_fbdev_destroy according to num_planes
+
+Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
+Acked-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
+index 24010cacf7d0..813b96e233ba 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
+@@ -290,10 +290,13 @@ out:
+ static int amdgpu_fbdev_destroy(struct drm_device *dev, struct amdgpu_fbdev *rfbdev)
+ {
+       struct amdgpu_framebuffer *rfb = &rfbdev->rfb;
++      int i;
+       drm_fb_helper_unregister_fbi(&rfbdev->helper);
+       if (rfb->base.obj[0]) {
++              for (i = 0; i < rfb->base.format->num_planes; i++)
++                      drm_gem_object_put(rfb->base.obj[0]);
+               amdgpufb_destroy_pinned_object(rfb->base.obj[0]);
+               rfb->base.obj[0] = NULL;
+               drm_framebuffer_unregister_private(&rfb->base);
+-- 
+2.30.2
+
diff --git a/queue-5.12/drm-amd-display-disconnect-non-dp-with-no-edid.patch b/queue-5.12/drm-amd-display-disconnect-non-dp-with-no-edid.patch
new file mode 100644 (file)
index 0000000..94a5400
--- /dev/null
@@ -0,0 +1,63 @@
+From 9e2c791bfa20f137b9263442bea4dc71868d3c9b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 4 May 2021 16:20:55 -0400
+Subject: drm/amd/display: Disconnect non-DP with no EDID
+
+From: Chris Park <Chris.Park@amd.com>
+
+[ Upstream commit 080039273b126eeb0185a61c045893a25dbc046e ]
+
+[Why]
+Active DP dongles return no EDID when dongle
+is connected, but VGA display is taken out.
+Current driver behavior does not remove the
+active display when this happens, and this is
+a gap between dongle DTP and dongle behavior.
+
+[How]
+For active DP dongles and non-DP scenario,
+disconnect sink on detection when no EDID
+is read due to timeout.
+
+Signed-off-by: Chris Park <Chris.Park@amd.com>
+Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
+Acked-by: Stylon Wang <stylon.wang@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/display/dc/core/dc_link.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+index 440bf0a0e12a..204928479c95 100644
+--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
++++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+@@ -1067,6 +1067,24 @@ static bool dc_link_detect_helper(struct dc_link *link,
+                           dc_is_dvi_signal(link->connector_signal)) {
+                               if (prev_sink)
+                                       dc_sink_release(prev_sink);
++                              link_disconnect_sink(link);
++
++                              return false;
++                      }
++                      /*
++                       * Abort detection for DP connectors if we have
++                       * no EDID and connector is active converter
++                       * as there are no display downstream
++                       *
++                       */
++                      if (dc_is_dp_sst_signal(link->connector_signal) &&
++                              (link->dpcd_caps.dongle_type ==
++                                              DISPLAY_DONGLE_DP_VGA_CONVERTER ||
++                              link->dpcd_caps.dongle_type ==
++                                              DISPLAY_DONGLE_DP_DVI_CONVERTER)) {
++                              if (prev_sink)
++                                      dc_sink_release(prev_sink);
++                              link_disconnect_sink(link);
+                               return false;
+                       }
+-- 
+2.30.2
+
diff --git a/queue-5.12/drm-amdgpu-fix-a-use-after-free.patch b/queue-5.12/drm-amdgpu-fix-a-use-after-free.patch
new file mode 100644 (file)
index 0000000..b0c6520
--- /dev/null
@@ -0,0 +1,52 @@
+From 84c436bc4e04bfb550a2d626a1244f2f7205a7f3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 18 May 2021 10:56:07 +0800
+Subject: drm/amdgpu: Fix a use-after-free
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: xinhui pan <xinhui.pan@amd.com>
+
+[ Upstream commit 1e5c37385097c35911b0f8a0c67ffd10ee1af9a2 ]
+
+looks like we forget to set ttm->sg to NULL.
+Hit panic below
+
+[ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: 0000 [#1] SMP DEBUG_PAGEALLOC NOPTI
+[ 1235.989074] Call Trace:
+[ 1235.991751]  sg_free_table+0x17/0x20
+[ 1235.995667]  amdgpu_ttm_backend_unbind.cold+0x4d/0xf7 [amdgpu]
+[ 1236.002288]  amdgpu_ttm_backend_destroy+0x29/0x130 [amdgpu]
+[ 1236.008464]  ttm_tt_destroy+0x1e/0x30 [ttm]
+[ 1236.013066]  ttm_bo_cleanup_memtype_use+0x51/0xa0 [ttm]
+[ 1236.018783]  ttm_bo_release+0x262/0xa50 [ttm]
+[ 1236.023547]  ttm_bo_put+0x82/0xd0 [ttm]
+[ 1236.027766]  amdgpu_bo_unref+0x26/0x50 [amdgpu]
+[ 1236.032809]  amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu+0x7aa/0xd90 [amdgpu]
+[ 1236.040400]  kfd_ioctl_alloc_memory_of_gpu+0xe2/0x330 [amdgpu]
+[ 1236.046912]  kfd_ioctl+0x463/0x690 [amdgpu]
+
+Signed-off-by: xinhui pan <xinhui.pan@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+index 6b14626c148e..13ac2f1dcc2c 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+@@ -1287,6 +1287,7 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_bo_device *bdev,
+       if (gtt && gtt->userptr) {
+               amdgpu_ttm_tt_set_user_pages(ttm, NULL);
+               kfree(ttm->sg);
++              ttm->sg = NULL;
+               ttm->page_flags &= ~TTM_PAGE_FLAG_SG;
+               return;
+       }
+-- 
+2.30.2
+
diff --git a/queue-5.12/drm-amdgpu-stop-touching-sched.ready-in-the-backend.patch b/queue-5.12/drm-amdgpu-stop-touching-sched.ready-in-the-backend.patch
new file mode 100644 (file)
index 0000000..055f6ac
--- /dev/null
@@ -0,0 +1,102 @@
+From 1cfa09a4efd8038cf992c5e9f152a9c9c2df42c7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 18 May 2021 17:48:02 +0200
+Subject: drm/amdgpu: stop touching sched.ready in the backend
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Christian König <christian.koenig@amd.com>
+
+[ Upstream commit a2b4785f01280a4291edb9fda69032fc2e4bfd3f ]
+
+This unfortunately comes up in regular intervals and breaks
+GPU reset for the engine in question.
+
+The sched.ready flag controls if an engine can't get working
+during hw_init, but should never be set to false during hw_fini.
+
+v2: squash in unused variable fix (Alex)
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 2 --
+ drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 --
+ drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 5 -----
+ drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c  | 8 +-------
+ 4 files changed, 1 insertion(+), 16 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
+index c6724a0e0c43..dc947c8ffe21 100644
+--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
++++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
+@@ -198,8 +198,6 @@ static int jpeg_v2_5_hw_fini(void *handle)
+               if (adev->jpeg.cur_state != AMD_PG_STATE_GATE &&
+                     RREG32_SOC15(JPEG, i, mmUVD_JRBC_STATUS))
+                       jpeg_v2_5_set_powergating_state(adev, AMD_PG_STATE_GATE);
+-
+-              ring->sched.ready = false;
+       }
+       return 0;
+diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
+index e8fbb2a0de34..1d354245678d 100644
+--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
+@@ -166,8 +166,6 @@ static int jpeg_v3_0_hw_fini(void *handle)
+             RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS))
+               jpeg_v3_0_set_powergating_state(adev, AMD_PG_STATE_GATE);
+-      ring->sched.ready = false;
+-
+       return 0;
+ }
+diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+index 690a5090475a..32c6aa03d267 100644
+--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
++++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+@@ -470,11 +470,6 @@ static void sdma_v5_2_gfx_stop(struct amdgpu_device *adev)
+               ib_cntl = REG_SET_FIELD(ib_cntl, SDMA0_GFX_IB_CNTL, IB_ENABLE, 0);
+               WREG32(sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_GFX_IB_CNTL), ib_cntl);
+       }
+-
+-      sdma0->sched.ready = false;
+-      sdma1->sched.ready = false;
+-      sdma2->sched.ready = false;
+-      sdma3->sched.ready = false;
+ }
+ /**
+diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
+index 9b844e9fb16f..ebbc04ff5da0 100644
+--- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
+@@ -368,7 +368,7 @@ static int vcn_v3_0_hw_fini(void *handle)
+ {
+       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_ring *ring;
+-      int i, j;
++      int i;
+       for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
+               if (adev->vcn.harvest_config & (1 << i))
+@@ -383,12 +383,6 @@ static int vcn_v3_0_hw_fini(void *handle)
+                               vcn_v3_0_set_powergating_state(adev, AMD_PG_STATE_GATE);
+                       }
+               }
+-              ring->sched.ready = false;
+-
+-              for (j = 0; j < adev->vcn.num_enc_rings; ++j) {
+-                      ring = &adev->vcn.inst[i].ring_enc[j];
+-                      ring->sched.ready = false;
+-              }
+       }
+       return 0;
+-- 
+2.30.2
+
diff --git a/queue-5.12/gpio-cadence-add-missing-module_device_table.patch b/queue-5.12/gpio-cadence-add-missing-module_device_table.patch
new file mode 100644 (file)
index 0000000..3fb5298
--- /dev/null
@@ -0,0 +1,36 @@
+From 19cc526fa90ee7f97eeb8c1740958d8df6767058 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 12 May 2021 11:17:47 +0800
+Subject: gpio: cadence: Add missing MODULE_DEVICE_TABLE
+
+From: Zou Wei <zou_wei@huawei.com>
+
+[ Upstream commit 1e948b1752b58c9c570989ab29ceef5b38fdccda ]
+
+This patch adds missing MODULE_DEVICE_TABLE definition which generates
+correct modalias for automatic loading of this driver when it is built
+as an external module.
+
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Zou Wei <zou_wei@huawei.com>
+Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpio/gpio-cadence.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/gpio/gpio-cadence.c b/drivers/gpio/gpio-cadence.c
+index a4d3239d2594..4ab3fcd9b9ba 100644
+--- a/drivers/gpio/gpio-cadence.c
++++ b/drivers/gpio/gpio-cadence.c
+@@ -278,6 +278,7 @@ static const struct of_device_id cdns_of_ids[] = {
+       { .compatible = "cdns,gpio-r1p02" },
+       { /* sentinel */ },
+ };
++MODULE_DEVICE_TABLE(of, cdns_of_ids);
+ static struct platform_driver cdns_gpio_driver = {
+       .driver = {
+-- 
+2.30.2
+
diff --git a/queue-5.12/isdn-misdn-correctly-handle-ph_info-allocation-failu.patch b/queue-5.12/isdn-misdn-correctly-handle-ph_info-allocation-failu.patch
new file mode 100644 (file)
index 0000000..15d0522
--- /dev/null
@@ -0,0 +1,104 @@
+From 8b1b7a76c6f55e1db67857136920cbd299ccb68b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:14 +0200
+Subject: isdn: mISDN: correctly handle ph_info allocation failure in
+ hfcsusb_ph_info
+
+From: Phillip Potter <phil@philpotter.co.uk>
+
+[ Upstream commit 5265db2ccc735e2783b790d6c19fb5cee8c025ed ]
+
+Modify return type of hfcusb_ph_info to int, so that we can pass error
+value up the call stack when allocation of ph_info fails. Also change
+three of four call sites to actually account for the memory failure.
+The fourth, in ph_state_nt, is infeasible to change as it is in turn
+called by ph_state which is used as a function pointer argument to
+mISDN_initdchannel, which would necessitate changing its signature
+and updating all the places where it is used (too many).
+
+Fixes original flawed commit (38d22659803a) from the University of
+Minnesota.
+
+Cc: David S. Miller <davem@davemloft.net>
+Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
+Link: https://lore.kernel.org/r/20210503115736.2104747-48-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/isdn/hardware/mISDN/hfcsusb.c | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
+index 4bb470d3963d..cd5642cef01f 100644
+--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
++++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
+@@ -46,7 +46,7 @@ static void hfcsusb_start_endpoint(struct hfcsusb *hw, int channel);
+ static void hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel);
+ static int  hfcsusb_setup_bch(struct bchannel *bch, int protocol);
+ static void deactivate_bchannel(struct bchannel *bch);
+-static void hfcsusb_ph_info(struct hfcsusb *hw);
++static int  hfcsusb_ph_info(struct hfcsusb *hw);
+ /* start next background transfer for control channel */
+ static void
+@@ -241,7 +241,7 @@ hfcusb_l2l1B(struct mISDNchannel *ch, struct sk_buff *skb)
+  * send full D/B channel status information
+  * as MPH_INFORMATION_IND
+  */
+-static void
++static int
+ hfcsusb_ph_info(struct hfcsusb *hw)
+ {
+       struct ph_info *phi;
+@@ -249,6 +249,9 @@ hfcsusb_ph_info(struct hfcsusb *hw)
+       int i;
+       phi = kzalloc(struct_size(phi, bch, dch->dev.nrbchan), GFP_ATOMIC);
++      if (!phi)
++              return -ENOMEM;
++
+       phi->dch.ch.protocol = hw->protocol;
+       phi->dch.ch.Flags = dch->Flags;
+       phi->dch.state = dch->state;
+@@ -260,6 +263,8 @@ hfcsusb_ph_info(struct hfcsusb *hw)
+       _queue_data(&dch->dev.D, MPH_INFORMATION_IND, MISDN_ID_ANY,
+                   struct_size(phi, bch, dch->dev.nrbchan), phi, GFP_ATOMIC);
+       kfree(phi);
++
++      return 0;
+ }
+ /*
+@@ -344,8 +349,7 @@ hfcusb_l2l1D(struct mISDNchannel *ch, struct sk_buff *skb)
+                       ret = l1_event(dch->l1, hh->prim);
+               break;
+       case MPH_INFORMATION_REQ:
+-              hfcsusb_ph_info(hw);
+-              ret = 0;
++              ret = hfcsusb_ph_info(hw);
+               break;
+       }
+@@ -400,8 +404,7 @@ hfc_l1callback(struct dchannel *dch, u_int cmd)
+                              hw->name, __func__, cmd);
+               return -1;
+       }
+-      hfcsusb_ph_info(hw);
+-      return 0;
++      return hfcsusb_ph_info(hw);
+ }
+ static int
+@@ -743,8 +746,7 @@ hfcsusb_setup_bch(struct bchannel *bch, int protocol)
+                       handle_led(hw, (bch->nr == 1) ? LED_B1_OFF :
+                                  LED_B2_OFF);
+       }
+-      hfcsusb_ph_info(hw);
+-      return 0;
++      return hfcsusb_ph_info(hw);
+ }
+ static void
+-- 
+2.30.2
+
diff --git a/queue-5.12/isdn-misdninfineon-check-cleanup-ioremap-failure-cor.patch b/queue-5.12/isdn-misdninfineon-check-cleanup-ioremap-failure-cor.patch
new file mode 100644 (file)
index 0000000..773cc34
--- /dev/null
@@ -0,0 +1,99 @@
+From 3981a8c8c84558a78fb1753673264eefe25dc883 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:08 +0200
+Subject: isdn: mISDNinfineon: check/cleanup ioremap failure correctly in
+ setup_io
+
+From: Phillip Potter <phil@philpotter.co.uk>
+
+[ Upstream commit c446f0d4702d316e1c6bf621f70e79678d28830a ]
+
+Move hw->cfg.mode and hw->addr.mode assignments from hw->ci->cfg_mode
+and hw->ci->addr_mode respectively, to be before the subsequent checks
+for memory IO mode (and possible ioremap calls in this case).
+
+Also introduce ioremap error checks at both locations. This allows
+resources to be properly freed on ioremap failure, as when the caller
+of setup_io then subsequently calls release_io via its error path,
+release_io can now correctly determine the mode as it has been set
+before the ioremap call.
+
+Finally, refactor release_io function so that it will call
+release_mem_region in the memory IO case, regardless of whether or not
+hw->cfg.p/hw->addr.p are NULL. This means resources are then properly
+released on failure.
+
+This properly implements the original reverted commit (d721fe99f6ad)
+from the University of Minnesota, whilst also implementing the ioremap
+check for the hw->ci->cfg_mode if block as well.
+
+Cc: David S. Miller <davem@davemloft.net>
+Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
+Link: https://lore.kernel.org/r/20210503115736.2104747-42-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/isdn/hardware/mISDN/mISDNinfineon.c | 24 ++++++++++++++-------
+ 1 file changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/isdn/hardware/mISDN/mISDNinfineon.c b/drivers/isdn/hardware/mISDN/mISDNinfineon.c
+index fa9c491f9c38..88d592bafdb0 100644
+--- a/drivers/isdn/hardware/mISDN/mISDNinfineon.c
++++ b/drivers/isdn/hardware/mISDN/mISDNinfineon.c
+@@ -630,17 +630,19 @@ static void
+ release_io(struct inf_hw *hw)
+ {
+       if (hw->cfg.mode) {
+-              if (hw->cfg.p) {
++              if (hw->cfg.mode == AM_MEMIO) {
+                       release_mem_region(hw->cfg.start, hw->cfg.size);
+-                      iounmap(hw->cfg.p);
++                      if (hw->cfg.p)
++                              iounmap(hw->cfg.p);
+               } else
+                       release_region(hw->cfg.start, hw->cfg.size);
+               hw->cfg.mode = AM_NONE;
+       }
+       if (hw->addr.mode) {
+-              if (hw->addr.p) {
++              if (hw->addr.mode == AM_MEMIO) {
+                       release_mem_region(hw->addr.start, hw->addr.size);
+-                      iounmap(hw->addr.p);
++                      if (hw->addr.p)
++                              iounmap(hw->addr.p);
+               } else
+                       release_region(hw->addr.start, hw->addr.size);
+               hw->addr.mode = AM_NONE;
+@@ -670,9 +672,12 @@ setup_io(struct inf_hw *hw)
+                               (ulong)hw->cfg.start, (ulong)hw->cfg.size);
+                       return err;
+               }
+-              if (hw->ci->cfg_mode == AM_MEMIO)
+-                      hw->cfg.p = ioremap(hw->cfg.start, hw->cfg.size);
+               hw->cfg.mode = hw->ci->cfg_mode;
++              if (hw->ci->cfg_mode == AM_MEMIO) {
++                      hw->cfg.p = ioremap(hw->cfg.start, hw->cfg.size);
++                      if (!hw->cfg.p)
++                              return -ENOMEM;
++              }
+               if (debug & DEBUG_HW)
+                       pr_notice("%s: IO cfg %lx (%lu bytes) mode%d\n",
+                                 hw->name, (ulong)hw->cfg.start,
+@@ -697,9 +702,12 @@ setup_io(struct inf_hw *hw)
+                               (ulong)hw->addr.start, (ulong)hw->addr.size);
+                       return err;
+               }
+-              if (hw->ci->addr_mode == AM_MEMIO)
+-                      hw->addr.p = ioremap(hw->addr.start, hw->addr.size);
+               hw->addr.mode = hw->ci->addr_mode;
++              if (hw->ci->addr_mode == AM_MEMIO) {
++                      hw->addr.p = ioremap(hw->addr.start, hw->addr.size);
++                      if (!hw->addr.p)
++                              return -ENOMEM;
++              }
+               if (debug & DEBUG_HW)
+                       pr_notice("%s: IO addr %lx (%lu bytes) mode%d\n",
+                                 hw->name, (ulong)hw->addr.start,
+-- 
+2.30.2
+
diff --git a/queue-5.12/libertas-register-sysfs-groups-properly.patch b/queue-5.12/libertas-register-sysfs-groups-properly.patch
new file mode 100644 (file)
index 0000000..a6f2c81
--- /dev/null
@@ -0,0 +1,94 @@
+From 97e7d1e2a211b2ac1b926795c6c45e1b9aa45f2f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:20 +0200
+Subject: libertas: register sysfs groups properly
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 7e79b38fe9a403b065ac5915465f620a8fb3de84 ]
+
+The libertas driver was trying to register sysfs groups "by hand" which
+causes them to be created _after_ the device is initialized and
+announced to userspace, which causes races and can prevent userspace
+tools from seeing the sysfs files correctly.
+
+Fix this up by using the built-in sysfs_groups pointers in struct
+net_device which were created for this very reason, fixing the race
+condition, and properly allowing for any error that might have occured
+to be handled properly.
+
+Cc: Kalle Valo <kvalo@codeaurora.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-54-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/marvell/libertas/mesh.c | 28 +++-----------------
+ 1 file changed, 4 insertions(+), 24 deletions(-)
+
+diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c
+index c611e6668b21..c68814841583 100644
+--- a/drivers/net/wireless/marvell/libertas/mesh.c
++++ b/drivers/net/wireless/marvell/libertas/mesh.c
+@@ -801,19 +801,6 @@ static const struct attribute_group mesh_ie_group = {
+       .attrs = mesh_ie_attrs,
+ };
+-static void lbs_persist_config_init(struct net_device *dev)
+-{
+-      int ret;
+-      ret = sysfs_create_group(&(dev->dev.kobj), &boot_opts_group);
+-      ret = sysfs_create_group(&(dev->dev.kobj), &mesh_ie_group);
+-}
+-
+-static void lbs_persist_config_remove(struct net_device *dev)
+-{
+-      sysfs_remove_group(&(dev->dev.kobj), &boot_opts_group);
+-      sysfs_remove_group(&(dev->dev.kobj), &mesh_ie_group);
+-}
+-
+ /***************************************************************************
+  * Initializing and starting, stopping mesh
+@@ -1009,6 +996,10 @@ static int lbs_add_mesh(struct lbs_private *priv)
+       SET_NETDEV_DEV(priv->mesh_dev, priv->dev->dev.parent);
+       mesh_dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
++      mesh_dev->sysfs_groups[0] = &lbs_mesh_attr_group;
++      mesh_dev->sysfs_groups[1] = &boot_opts_group;
++      mesh_dev->sysfs_groups[2] = &mesh_ie_group;
++
+       /* Register virtual mesh interface */
+       ret = register_netdev(mesh_dev);
+       if (ret) {
+@@ -1016,19 +1007,10 @@ static int lbs_add_mesh(struct lbs_private *priv)
+               goto err_free_netdev;
+       }
+-      ret = sysfs_create_group(&(mesh_dev->dev.kobj), &lbs_mesh_attr_group);
+-      if (ret)
+-              goto err_unregister;
+-
+-      lbs_persist_config_init(mesh_dev);
+-
+       /* Everything successful */
+       ret = 0;
+       goto done;
+-err_unregister:
+-      unregister_netdev(mesh_dev);
+-
+ err_free_netdev:
+       free_netdev(mesh_dev);
+@@ -1049,8 +1031,6 @@ void lbs_remove_mesh(struct lbs_private *priv)
+       netif_stop_queue(mesh_dev);
+       netif_carrier_off(mesh_dev);
+-      sysfs_remove_group(&(mesh_dev->dev.kobj), &lbs_mesh_attr_group);
+-      lbs_persist_config_remove(mesh_dev);
+       unregister_netdev(mesh_dev);
+       priv->mesh_dev = NULL;
+       kfree(mesh_dev->ieee80211_ptr);
+-- 
+2.30.2
+
diff --git a/queue-5.12/linux-bits.h-fix-compilation-error-with-genmask.patch b/queue-5.12/linux-bits.h-fix-compilation-error-with-genmask.patch
new file mode 100644 (file)
index 0000000..dd75aa1
--- /dev/null
@@ -0,0 +1,133 @@
+From 30c7bbec521f0b91b0530f970e4e33d4fbb7beba Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 22 May 2021 17:42:02 -0700
+Subject: linux/bits.h: fix compilation error with GENMASK
+
+From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
+
+[ Upstream commit f747e6667ebb2ffb8133486c9cd19800d72b0d98 ]
+
+GENMASK() has an input check which uses __builtin_choose_expr() to
+enable a compile time sanity check of its inputs if they are known at
+compile time.
+
+However, it turns out that __builtin_constant_p() does not always return
+a compile time constant [0].  It was thought this problem was fixed with
+gcc 4.9 [1], but apparently this is not the case [2].
+
+Switch to use __is_constexpr() instead which always returns a compile time
+constant, regardless of its inputs.
+
+Link: https://lore.kernel.org/lkml/42b4342b-aefc-a16a-0d43-9f9c0d63ba7a@rasmusvillemoes.dk [0]
+Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19449 [1]
+Link: https://lore.kernel.org/lkml/1ac7bbc2-45d9-26ed-0b33-bf382b8d858b@I-love.SAKURA.ne.jp [2]
+Link: https://lkml.kernel.org/r/20210511203716.117010-1-rikard.falkeborn@gmail.com
+Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
+Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
+Cc: Ard Biesheuvel <ardb@kernel.org>
+Cc: Yury Norov <yury.norov@gmail.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/bits.h        |  2 +-
+ include/linux/const.h       |  8 ++++++++
+ include/linux/minmax.h      | 10 ++--------
+ tools/include/linux/bits.h  |  2 +-
+ tools/include/linux/const.h |  8 ++++++++
+ 5 files changed, 20 insertions(+), 10 deletions(-)
+
+diff --git a/include/linux/bits.h b/include/linux/bits.h
+index 7f475d59a097..87d112650dfb 100644
+--- a/include/linux/bits.h
++++ b/include/linux/bits.h
+@@ -22,7 +22,7 @@
+ #include <linux/build_bug.h>
+ #define GENMASK_INPUT_CHECK(h, l) \
+       (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
+-              __builtin_constant_p((l) > (h)), (l) > (h), 0)))
++              __is_constexpr((l) > (h)), (l) > (h), 0)))
+ #else
+ /*
+  * BUILD_BUG_ON_ZERO is not available in h files included from asm files,
+diff --git a/include/linux/const.h b/include/linux/const.h
+index 81b8aae5a855..435ddd72d2c4 100644
+--- a/include/linux/const.h
++++ b/include/linux/const.h
+@@ -3,4 +3,12 @@
+ #include <vdso/const.h>
++/*
++ * This returns a constant expression while determining if an argument is
++ * a constant expression, most importantly without evaluating the argument.
++ * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
++ */
++#define __is_constexpr(x) \
++      (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
++
+ #endif /* _LINUX_CONST_H */
+diff --git a/include/linux/minmax.h b/include/linux/minmax.h
+index c0f57b0c64d9..5433c08fcc68 100644
+--- a/include/linux/minmax.h
++++ b/include/linux/minmax.h
+@@ -2,6 +2,8 @@
+ #ifndef _LINUX_MINMAX_H
+ #define _LINUX_MINMAX_H
++#include <linux/const.h>
++
+ /*
+  * min()/max()/clamp() macros must accomplish three things:
+  *
+@@ -17,14 +19,6 @@
+ #define __typecheck(x, y) \
+       (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
+-/*
+- * This returns a constant expression while determining if an argument is
+- * a constant expression, most importantly without evaluating the argument.
+- * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
+- */
+-#define __is_constexpr(x) \
+-      (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
+-
+ #define __no_side_effects(x, y) \
+               (__is_constexpr(x) && __is_constexpr(y))
+diff --git a/tools/include/linux/bits.h b/tools/include/linux/bits.h
+index 7f475d59a097..87d112650dfb 100644
+--- a/tools/include/linux/bits.h
++++ b/tools/include/linux/bits.h
+@@ -22,7 +22,7 @@
+ #include <linux/build_bug.h>
+ #define GENMASK_INPUT_CHECK(h, l) \
+       (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
+-              __builtin_constant_p((l) > (h)), (l) > (h), 0)))
++              __is_constexpr((l) > (h)), (l) > (h), 0)))
+ #else
+ /*
+  * BUILD_BUG_ON_ZERO is not available in h files included from asm files,
+diff --git a/tools/include/linux/const.h b/tools/include/linux/const.h
+index 81b8aae5a855..435ddd72d2c4 100644
+--- a/tools/include/linux/const.h
++++ b/tools/include/linux/const.h
+@@ -3,4 +3,12 @@
+ #include <vdso/const.h>
++/*
++ * This returns a constant expression while determining if an argument is
++ * a constant expression, most importantly without evaluating the argument.
++ * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
++ */
++#define __is_constexpr(x) \
++      (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
++
+ #endif /* _LINUX_CONST_H */
+-- 
+2.30.2
+
diff --git a/queue-5.12/media-dvb-add-check-on-sp8870_readreg-return.patch b/queue-5.12/media-dvb-add-check-on-sp8870_readreg-return.patch
new file mode 100644 (file)
index 0000000..12d9f87
--- /dev/null
@@ -0,0 +1,40 @@
+From ee343d34b416ca9f6242986194d0edd057b6e08a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:26 +0200
+Subject: media: dvb: Add check on sp8870_readreg return
+
+From: Alaa Emad <alaaemadhossney.ae@gmail.com>
+
+[ Upstream commit c6d822c56e7fd29e6fa1b1bb91b98f6a1e942b3c ]
+
+The function sp8870_readreg returns a negative value when i2c_transfer
+fails so properly check for this and return the error if it happens.
+
+Cc: Sean Young <sean@mess.org>
+Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Signed-off-by: Alaa Emad <alaaemadhossney.ae@gmail.com>
+Link: https://lore.kernel.org/r/20210503115736.2104747-60-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/dvb-frontends/sp8870.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/media/dvb-frontends/sp8870.c b/drivers/media/dvb-frontends/sp8870.c
+index ee893a2f2261..9767159aeb9b 100644
+--- a/drivers/media/dvb-frontends/sp8870.c
++++ b/drivers/media/dvb-frontends/sp8870.c
+@@ -280,7 +280,9 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)
+       sp8870_writereg(state, 0xc05, reg0xc05);
+       // read status reg in order to clear pending irqs
+-      sp8870_readreg(state, 0x200);
++      err = sp8870_readreg(state, 0x200);
++      if (err < 0)
++              return err;
+       // system controller start
+       sp8870_microcontroller_start(state);
+-- 
+2.30.2
+
diff --git a/queue-5.12/media-gspca-mt9m111-check-write_bridge-for-timeout.patch b/queue-5.12/media-gspca-mt9m111-check-write_bridge-for-timeout.patch
new file mode 100644 (file)
index 0000000..2b53666
--- /dev/null
@@ -0,0 +1,61 @@
+From bb4c1e170a6510eccf3a6c75c8d57524b7480104 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:28 +0200
+Subject: media: gspca: mt9m111: Check write_bridge for timeout
+
+From: Alaa Emad <alaaemadhossney.ae@gmail.com>
+
+[ Upstream commit e932f5b458eee63d013578ea128b9ff8ef5f5496 ]
+
+If m5602_write_bridge times out, it will return a negative error value.
+So properly check for this and handle the error correctly instead of
+just ignoring it.
+
+Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Signed-off-by: Alaa Emad <alaaemadhossney.ae@gmail.com>
+Link: https://lore.kernel.org/r/20210503115736.2104747-62-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/usb/gspca/m5602/m5602_mt9m111.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/media/usb/gspca/m5602/m5602_mt9m111.c b/drivers/media/usb/gspca/m5602/m5602_mt9m111.c
+index 50481dc928d0..bf1af6ed9131 100644
+--- a/drivers/media/usb/gspca/m5602/m5602_mt9m111.c
++++ b/drivers/media/usb/gspca/m5602/m5602_mt9m111.c
+@@ -195,7 +195,7 @@ static const struct v4l2_ctrl_config mt9m111_greenbal_cfg = {
+ int mt9m111_probe(struct sd *sd)
+ {
+       u8 data[2] = {0x00, 0x00};
+-      int i;
++      int i, err;
+       struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
+       if (force_sensor) {
+@@ -213,15 +213,17 @@ int mt9m111_probe(struct sd *sd)
+       /* Do the preinit */
+       for (i = 0; i < ARRAY_SIZE(preinit_mt9m111); i++) {
+               if (preinit_mt9m111[i][0] == BRIDGE) {
+-                      m5602_write_bridge(sd,
+-                              preinit_mt9m111[i][1],
+-                              preinit_mt9m111[i][2]);
++                      err = m5602_write_bridge(sd,
++                                      preinit_mt9m111[i][1],
++                                      preinit_mt9m111[i][2]);
+               } else {
+                       data[0] = preinit_mt9m111[i][2];
+                       data[1] = preinit_mt9m111[i][3];
+-                      m5602_write_sensor(sd,
+-                              preinit_mt9m111[i][1], data, 2);
++                      err = m5602_write_sensor(sd,
++                                      preinit_mt9m111[i][1], data, 2);
+               }
++              if (err < 0)
++                      return err;
+       }
+       if (m5602_read_sensor(sd, MT9M111_SC_CHIPVER, data, 2))
+-- 
+2.30.2
+
diff --git a/queue-5.12/media-gspca-properly-check-for-errors-in-po1030_prob.patch b/queue-5.12/media-gspca-properly-check-for-errors-in-po1030_prob.patch
new file mode 100644 (file)
index 0000000..c9d11e4
--- /dev/null
@@ -0,0 +1,52 @@
+From a70373fc0e074249854dd8ea0285083384de6d6f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:30 +0200
+Subject: media: gspca: properly check for errors in po1030_probe()
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit dacb408ca6f0e34df22b40d8dd5fae7f8e777d84 ]
+
+If m5602_write_sensor() or m5602_write_bridge() fail, do not continue to
+initialize the device but return the error to the calling funtion.
+
+Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-64-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/usb/gspca/m5602/m5602_po1030.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/media/usb/gspca/m5602/m5602_po1030.c b/drivers/media/usb/gspca/m5602/m5602_po1030.c
+index 7bdbb8065146..8fd99ceee4b6 100644
+--- a/drivers/media/usb/gspca/m5602/m5602_po1030.c
++++ b/drivers/media/usb/gspca/m5602/m5602_po1030.c
+@@ -155,6 +155,7 @@ static const struct v4l2_ctrl_config po1030_greenbal_cfg = {
+ int po1030_probe(struct sd *sd)
+ {
+       u8 dev_id_h = 0, i;
++      int err;
+       struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
+       if (force_sensor) {
+@@ -173,10 +174,13 @@ int po1030_probe(struct sd *sd)
+       for (i = 0; i < ARRAY_SIZE(preinit_po1030); i++) {
+               u8 data = preinit_po1030[i][2];
+               if (preinit_po1030[i][0] == SENSOR)
+-                      m5602_write_sensor(sd,
+-                              preinit_po1030[i][1], &data, 1);
++                      err = m5602_write_sensor(sd, preinit_po1030[i][1],
++                                               &data, 1);
+               else
+-                      m5602_write_bridge(sd, preinit_po1030[i][1], data);
++                      err = m5602_write_bridge(sd, preinit_po1030[i][1],
++                                               data);
++              if (err < 0)
++                      return err;
+       }
+       if (m5602_read_sensor(sd, PO1030_DEVID_H, &dev_id_h, 1))
+-- 
+2.30.2
+
diff --git a/queue-5.12/net-caif-remove-bug_on-dev-null-in-caif_xmit.patch b/queue-5.12/net-caif-remove-bug_on-dev-null-in-caif_xmit.patch
new file mode 100644 (file)
index 0000000..e990a84
--- /dev/null
@@ -0,0 +1,80 @@
+From eab59c2b074c947a0433d155294f3ec62bea05e9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:46 +0200
+Subject: net: caif: remove BUG_ON(dev == NULL) in caif_xmit
+
+From: Du Cheng <ducheng2@gmail.com>
+
+[ Upstream commit 65a67792e3416f7c5d7daa47d99334cbb19a7449 ]
+
+The condition of dev == NULL is impossible in caif_xmit(), hence it is
+for the removal.
+
+Explanation:
+The static caif_xmit() is only called upon via a function pointer
+`ndo_start_xmit` defined in include/linux/netdevice.h:
+```
+struct net_device_ops {
+    ...
+    netdev_tx_t     (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev);
+    ...
+}
+```
+
+The exhausive list of call points are:
+```
+drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
+    dev->netdev_ops->ndo_start_xmit(skb, dev);
+    ^                                    ^
+
+drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c
+    struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev);
+                            ^                       ^
+    return adapter->rn_ops->ndo_start_xmit(skb, netdev); // adapter would crash first
+          ^                                    ^
+
+drivers/usb/gadget/function/f_ncm.c
+    ncm->netdev->netdev_ops->ndo_start_xmit(NULL, ncm->netdev);
+             ^                                   ^
+
+include/linux/netdevice.h
+static inline netdev_tx_t __netdev_start_xmit(...
+{
+    return ops->ndo_start_xmit(skb, dev);
+                                   ^
+}
+
+    const struct net_device_ops *ops = dev->netdev_ops;
+                                      ^
+    rc = __netdev_start_xmit(ops, skb, dev, more);
+                                      ^
+```
+
+In each of the enumerated scenarios, it is impossible for the NULL-valued dev to
+reach the caif_xmit() without crashing the kernel earlier, therefore `BUG_ON(dev ==
+NULL)` is rather useless, hence the removal.
+
+Cc: David S. Miller <davem@davemloft.net>
+Signed-off-by: Du Cheng <ducheng2@gmail.com>
+Link: https://lore.kernel.org/r/20210503115736.2104747-20-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/caif/caif_serial.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
+index 4720a7bac4fb..9f30748da4ab 100644
+--- a/drivers/net/caif/caif_serial.c
++++ b/drivers/net/caif/caif_serial.c
+@@ -269,7 +269,6 @@ static netdev_tx_t caif_xmit(struct sk_buff *skb, struct net_device *dev)
+ {
+       struct ser_device *ser;
+-      BUG_ON(dev == NULL);
+       ser = netdev_priv(dev);
+       /* Send flow off once, on high water mark */
+-- 
+2.30.2
+
diff --git a/queue-5.12/net-fujitsu-fix-potential-null-ptr-deref.patch b/queue-5.12/net-fujitsu-fix-potential-null-ptr-deref.patch
new file mode 100644 (file)
index 0000000..f6f1641
--- /dev/null
@@ -0,0 +1,42 @@
+From 517c57bccbf07e2135b1603849d25cbc23296b3b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:42 +0200
+Subject: net: fujitsu: fix potential null-ptr-deref
+
+From: Anirudh Rayabharam <mail@anirudhrb.com>
+
+[ Upstream commit 52202be1cd996cde6e8969a128dc27ee45a7cb5e ]
+
+In fmvj18x_get_hwinfo(), if ioremap fails there will be NULL pointer
+deref. To fix this, check the return value of ioremap and return -1
+to the caller in case of failure.
+
+Cc: "David S. Miller" <davem@davemloft.net>
+Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
+Signed-off-by: Anirudh Rayabharam <mail@anirudhrb.com>
+Link: https://lore.kernel.org/r/20210503115736.2104747-16-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/fujitsu/fmvj18x_cs.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
+index dc90c61fc827..b0c0504950d8 100644
+--- a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
++++ b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
+@@ -547,6 +547,11 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
+       return -1;
+     base = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
++    if (!base) {
++      pcmcia_release_window(link, link->resource[2]);
++      return -1;
++    }
++
+     pcmcia_map_mem_page(link, link->resource[2], 0);
+     /*
+-- 
+2.30.2
+
diff --git a/queue-5.12/net-liquidio-add-missing-null-pointer-checks.patch b/queue-5.12/net-liquidio-add-missing-null-pointer-checks.patch
new file mode 100644 (file)
index 0000000..16a7096
--- /dev/null
@@ -0,0 +1,235 @@
+From 64ba9fb2d6ef5cc30b6df56a37eed703bc9fd979 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:32 +0200
+Subject: net: liquidio: Add missing null pointer checks
+
+From: Tom Seewald <tseewald@gmail.com>
+
+[ Upstream commit dbc97bfd3918ed9268bfc174cae8a7d6b3d51aad ]
+
+The functions send_rx_ctrl_cmd() in both liquidio/lio_main.c and
+liquidio/lio_vf_main.c do not check if the call to
+octeon_alloc_soft_command() fails and returns a null pointer. Both
+functions also return void so errors are not propagated back to the
+caller.
+
+Fix these issues by updating both instances of send_rx_ctrl_cmd() to
+return an integer rather than void, and have them return -ENOMEM if an
+allocation failure occurs. Also update all callers of send_rx_ctrl_cmd()
+so that they now check the return value.
+
+Cc: David S. Miller <davem@davemloft.net>
+Signed-off-by: Tom Seewald <tseewald@gmail.com>
+Link: https://lore.kernel.org/r/20210503115736.2104747-66-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../net/ethernet/cavium/liquidio/lio_main.c   | 28 +++++++++++++------
+ .../ethernet/cavium/liquidio/lio_vf_main.c    | 27 +++++++++++++-----
+ 2 files changed, 40 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
+index 6fa570068648..591229b96257 100644
+--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
++++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
+@@ -1153,7 +1153,7 @@ static void octeon_destroy_resources(struct octeon_device *oct)
+  * @lio: per-network private data
+  * @start_stop: whether to start or stop
+  */
+-static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)
++static int send_rx_ctrl_cmd(struct lio *lio, int start_stop)
+ {
+       struct octeon_soft_command *sc;
+       union octnet_cmd *ncmd;
+@@ -1161,11 +1161,16 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)
+       int retval;
+       if (oct->props[lio->ifidx].rx_on == start_stop)
+-              return;
++              return 0;
+       sc = (struct octeon_soft_command *)
+               octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE,
+                                         16, 0);
++      if (!sc) {
++              netif_info(lio, rx_err, lio->netdev,
++                         "Failed to allocate octeon_soft_command struct\n");
++              return -ENOMEM;
++      }
+       ncmd = (union octnet_cmd *)sc->virtdptr;
+@@ -1187,18 +1192,19 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)
+       if (retval == IQ_SEND_FAILED) {
+               netif_info(lio, rx_err, lio->netdev, "Failed to send RX Control message\n");
+               octeon_free_soft_command(oct, sc);
+-              return;
+       } else {
+               /* Sleep on a wait queue till the cond flag indicates that the
+                * response arrived or timed-out.
+                */
+               retval = wait_for_sc_completion_timeout(oct, sc, 0);
+               if (retval)
+-                      return;
++                      return retval;
+               oct->props[lio->ifidx].rx_on = start_stop;
+               WRITE_ONCE(sc->caller_is_done, true);
+       }
++
++      return retval;
+ }
+ /**
+@@ -1773,6 +1779,7 @@ static int liquidio_open(struct net_device *netdev)
+       struct octeon_device_priv *oct_priv =
+               (struct octeon_device_priv *)oct->priv;
+       struct napi_struct *napi, *n;
++      int ret = 0;
+       if (oct->props[lio->ifidx].napi_enabled == 0) {
+               tasklet_disable(&oct_priv->droq_tasklet);
+@@ -1808,7 +1815,9 @@ static int liquidio_open(struct net_device *netdev)
+       netif_info(lio, ifup, lio->netdev, "Interface Open, ready for traffic\n");
+       /* tell Octeon to start forwarding packets to host */
+-      send_rx_ctrl_cmd(lio, 1);
++      ret = send_rx_ctrl_cmd(lio, 1);
++      if (ret)
++              return ret;
+       /* start periodical statistics fetch */
+       INIT_DELAYED_WORK(&lio->stats_wk.work, lio_fetch_stats);
+@@ -1819,7 +1828,7 @@ static int liquidio_open(struct net_device *netdev)
+       dev_info(&oct->pci_dev->dev, "%s interface is opened\n",
+                netdev->name);
+-      return 0;
++      return ret;
+ }
+ /**
+@@ -1833,6 +1842,7 @@ static int liquidio_stop(struct net_device *netdev)
+       struct octeon_device_priv *oct_priv =
+               (struct octeon_device_priv *)oct->priv;
+       struct napi_struct *napi, *n;
++      int ret = 0;
+       ifstate_reset(lio, LIO_IFSTATE_RUNNING);
+@@ -1849,7 +1859,9 @@ static int liquidio_stop(struct net_device *netdev)
+       lio->link_changes++;
+       /* Tell Octeon that nic interface is down. */
+-      send_rx_ctrl_cmd(lio, 0);
++      ret = send_rx_ctrl_cmd(lio, 0);
++      if (ret)
++              return ret;
+       if (OCTEON_CN23XX_PF(oct)) {
+               if (!oct->msix_on)
+@@ -1884,7 +1896,7 @@ static int liquidio_stop(struct net_device *netdev)
+       dev_info(&oct->pci_dev->dev, "%s interface is stopped\n", netdev->name);
+-      return 0;
++      return ret;
+ }
+ /**
+diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+index 516f166ceff8..ffddb3126a32 100644
+--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
++++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+@@ -595,7 +595,7 @@ static void octeon_destroy_resources(struct octeon_device *oct)
+  * @lio: per-network private data
+  * @start_stop: whether to start or stop
+  */
+-static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)
++static int send_rx_ctrl_cmd(struct lio *lio, int start_stop)
+ {
+       struct octeon_device *oct = (struct octeon_device *)lio->oct_dev;
+       struct octeon_soft_command *sc;
+@@ -603,11 +603,16 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)
+       int retval;
+       if (oct->props[lio->ifidx].rx_on == start_stop)
+-              return;
++              return 0;
+       sc = (struct octeon_soft_command *)
+               octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE,
+                                         16, 0);
++      if (!sc) {
++              netif_info(lio, rx_err, lio->netdev,
++                         "Failed to allocate octeon_soft_command struct\n");
++              return -ENOMEM;
++      }
+       ncmd = (union octnet_cmd *)sc->virtdptr;
+@@ -635,11 +640,13 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)
+                */
+               retval = wait_for_sc_completion_timeout(oct, sc, 0);
+               if (retval)
+-                      return;
++                      return retval;
+               oct->props[lio->ifidx].rx_on = start_stop;
+               WRITE_ONCE(sc->caller_is_done, true);
+       }
++
++      return retval;
+ }
+ /**
+@@ -906,6 +913,7 @@ static int liquidio_open(struct net_device *netdev)
+       struct octeon_device_priv *oct_priv =
+               (struct octeon_device_priv *)oct->priv;
+       struct napi_struct *napi, *n;
++      int ret = 0;
+       if (!oct->props[lio->ifidx].napi_enabled) {
+               tasklet_disable(&oct_priv->droq_tasklet);
+@@ -932,11 +940,13 @@ static int liquidio_open(struct net_device *netdev)
+                                       (LIQUIDIO_NDEV_STATS_POLL_TIME_MS));
+       /* tell Octeon to start forwarding packets to host */
+-      send_rx_ctrl_cmd(lio, 1);
++      ret = send_rx_ctrl_cmd(lio, 1);
++      if (ret)
++              return ret;
+       dev_info(&oct->pci_dev->dev, "%s interface is opened\n", netdev->name);
+-      return 0;
++      return ret;
+ }
+ /**
+@@ -950,9 +960,12 @@ static int liquidio_stop(struct net_device *netdev)
+       struct octeon_device_priv *oct_priv =
+               (struct octeon_device_priv *)oct->priv;
+       struct napi_struct *napi, *n;
++      int ret = 0;
+       /* tell Octeon to stop forwarding packets to host */
+-      send_rx_ctrl_cmd(lio, 0);
++      ret = send_rx_ctrl_cmd(lio, 0);
++      if (ret)
++              return ret;
+       netif_info(lio, ifdown, lio->netdev, "Stopping interface!\n");
+       /* Inform that netif carrier is down */
+@@ -986,7 +999,7 @@ static int liquidio_stop(struct net_device *netdev)
+       dev_info(&oct->pci_dev->dev, "%s interface is stopped\n", netdev->name);
+-      return 0;
++      return ret;
+ }
+ /**
+-- 
+2.30.2
+
diff --git a/queue-5.12/net-smc-properly-handle-workqueue-allocation-failure.patch b/queue-5.12/net-smc-properly-handle-workqueue-allocation-failure.patch
new file mode 100644 (file)
index 0000000..04f29f5
--- /dev/null
@@ -0,0 +1,55 @@
+From 4bdb6e3f45a719a7d364b08fe7246b3b44b0f0d1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:44 +0200
+Subject: net/smc: properly handle workqueue allocation failure
+
+From: Anirudh Rayabharam <mail@anirudhrb.com>
+
+[ Upstream commit bbeb18f27a44ce6adb00d2316968bc59dc640b9b ]
+
+In smcd_alloc_dev(), if alloc_ordered_workqueue() fails, properly catch
+it, clean up and return NULL to let the caller know there was a failure.
+Move the call to alloc_ordered_workqueue higher in the function in order
+to abort earlier without needing to unwind the call to device_initialize().
+
+Cc: Ursula Braun <ubraun@linux.ibm.com>
+Cc: David S. Miller <davem@davemloft.net>
+Signed-off-by: Anirudh Rayabharam <mail@anirudhrb.com>
+Link: https://lore.kernel.org/r/20210503115736.2104747-18-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/smc/smc_ism.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
+index 6558cf7643a7..94b31f2551bc 100644
+--- a/net/smc/smc_ism.c
++++ b/net/smc/smc_ism.c
+@@ -402,6 +402,14 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,
+               return NULL;
+       }
++      smcd->event_wq = alloc_ordered_workqueue("ism_evt_wq-%s)",
++                                               WQ_MEM_RECLAIM, name);
++      if (!smcd->event_wq) {
++              kfree(smcd->conn);
++              kfree(smcd);
++              return NULL;
++      }
++
+       smcd->dev.parent = parent;
+       smcd->dev.release = smcd_release;
+       device_initialize(&smcd->dev);
+@@ -415,8 +423,6 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,
+       INIT_LIST_HEAD(&smcd->vlan);
+       INIT_LIST_HEAD(&smcd->lgr_list);
+       init_waitqueue_head(&smcd->lgrs_deleted);
+-      smcd->event_wq = alloc_ordered_workqueue("ism_evt_wq-%s)",
+-                                               WQ_MEM_RECLAIM, name);
+       return smcd;
+ }
+ EXPORT_SYMBOL_GPL(smcd_alloc_dev);
+-- 
+2.30.2
+
diff --git a/queue-5.12/openrisc-define-memory-barrier-mb.patch b/queue-5.12/openrisc-define-memory-barrier-mb.patch
new file mode 100644 (file)
index 0000000..e7ea0bf
--- /dev/null
@@ -0,0 +1,48 @@
+From e0fbe1b3abb3808ae259d49cbfcf8ab680f5a8d2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 14 Apr 2021 14:45:43 +0200
+Subject: openrisc: Define memory barrier mb
+
+From: Peter Zijlstra <peterz@infradead.org>
+
+[ Upstream commit 8b549c18ae81dbc36fb11e4aa08b8378c599ca95 ]
+
+This came up in the discussion of the requirements of qspinlock on an
+architecture.  OpenRISC uses qspinlock, but it was noticed that the
+memmory barrier was not defined.
+
+Peter defined it in the mail thread writing:
+
+    As near as I can tell this should do. The arch spec only lists
+    this one instruction and the text makes it sound like a completion
+    barrier.
+
+This is correct so applying this patch.
+
+Signed-off-by: Peter Zijlstra <peterz@infradead.org>
+[shorne@gmail.com:Turned the mail into a patch]
+Signed-off-by: Stafford Horne <shorne@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/openrisc/include/asm/barrier.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+ create mode 100644 arch/openrisc/include/asm/barrier.h
+
+diff --git a/arch/openrisc/include/asm/barrier.h b/arch/openrisc/include/asm/barrier.h
+new file mode 100644
+index 000000000000..7538294721be
+--- /dev/null
++++ b/arch/openrisc/include/asm/barrier.h
+@@ -0,0 +1,9 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++#ifndef __ASM_BARRIER_H
++#define __ASM_BARRIER_H
++
++#define mb() asm volatile ("l.msync" ::: "memory")
++
++#include <asm-generic/barrier.h>
++
++#endif /* __ASM_BARRIER_H */
+-- 
+2.30.2
+
diff --git a/queue-5.12/platform-x86-hp-wireless-add-amd-s-hardware-id-to-th.patch b/queue-5.12/platform-x86-hp-wireless-add-amd-s-hardware-id-to-th.patch
new file mode 100644 (file)
index 0000000..5fa1b05
--- /dev/null
@@ -0,0 +1,43 @@
+From e6fcdb24d1f85243190f8a580c4442277487e3c9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 14 May 2021 23:30:47 +0530
+Subject: platform/x86: hp-wireless: add AMD's hardware id to the supported
+ list
+
+From: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
+
+[ Upstream commit f048630bdd55eb5379ef35f971639fe52fabe499 ]
+
+Newer AMD based laptops uses AMDI0051 as the hardware id to support the
+airplane mode button. Adding this to the supported list.
+
+Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
+Link: https://lore.kernel.org/r/20210514180047.1697543-1-Shyam-sundar.S-k@amd.com
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/hp-wireless.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/platform/x86/hp-wireless.c b/drivers/platform/x86/hp-wireless.c
+index 12c31fd5d5ae..0753ef18e721 100644
+--- a/drivers/platform/x86/hp-wireless.c
++++ b/drivers/platform/x86/hp-wireless.c
+@@ -17,12 +17,14 @@ MODULE_LICENSE("GPL");
+ MODULE_AUTHOR("Alex Hung");
+ MODULE_ALIAS("acpi*:HPQ6001:*");
+ MODULE_ALIAS("acpi*:WSTADEF:*");
++MODULE_ALIAS("acpi*:AMDI0051:*");
+ static struct input_dev *hpwl_input_dev;
+ static const struct acpi_device_id hpwl_ids[] = {
+       {"HPQ6001", 0},
+       {"WSTADEF", 0},
++      {"AMDI0051", 0},
+       {"", 0},
+ };
+-- 
+2.30.2
+
diff --git a/queue-5.12/platform-x86-hp_accel-avoid-invoking-_ini-to-speed-u.patch b/queue-5.12/platform-x86-hp_accel-avoid-invoking-_ini-to-speed-u.patch
new file mode 100644 (file)
index 0000000..6aae847
--- /dev/null
@@ -0,0 +1,95 @@
+From 213bd91c5261d2774d943457726562e0b39a5770 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 30 Apr 2021 14:07:35 +0800
+Subject: platform/x86: hp_accel: Avoid invoking _INI to speed up resume
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
+
+[ Upstream commit 79d341e26ebcdbc622348aaaab6f8f89b6fdb25f ]
+
+hp_accel can take almost two seconds to resume on some HP laptops.
+
+The bottleneck is on evaluating _INI, which is only needed to run once.
+
+Resolve the issue by only invoking _INI when it's necessary. Namely, on
+probe and on hibernation restore.
+
+Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Acked-by: Ã‰ric Piel <eric.piel@trempplin-utc.net>
+Link: https://lore.kernel.org/r/20210430060736.590321-1-kai.heng.feng@canonical.com
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/misc/lis3lv02d/lis3lv02d.h |  1 +
+ drivers/platform/x86/hp_accel.c    | 22 +++++++++++++++++++++-
+ 2 files changed, 22 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h b/drivers/misc/lis3lv02d/lis3lv02d.h
+index c394c0b08519..7ac788fae1b8 100644
+--- a/drivers/misc/lis3lv02d/lis3lv02d.h
++++ b/drivers/misc/lis3lv02d/lis3lv02d.h
+@@ -271,6 +271,7 @@ struct lis3lv02d {
+       int                     regs_size;
+       u8                      *reg_cache;
+       bool                    regs_stored;
++      bool                    init_required;
+       u8                      odr_mask;  /* ODR bit mask */
+       u8                      whoami;    /* indicates measurement precision */
+       s16 (*read_data) (struct lis3lv02d *lis3, int reg);
+diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
+index 799cbe2ffcf3..8c0867bda828 100644
+--- a/drivers/platform/x86/hp_accel.c
++++ b/drivers/platform/x86/hp_accel.c
+@@ -88,6 +88,9 @@ MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids);
+ static int lis3lv02d_acpi_init(struct lis3lv02d *lis3)
+ {
+       struct acpi_device *dev = lis3->bus_priv;
++      if (!lis3->init_required)
++              return 0;
++
+       if (acpi_evaluate_object(dev->handle, METHOD_NAME__INI,
+                                NULL, NULL) != AE_OK)
+               return -EINVAL;
+@@ -356,6 +359,7 @@ static int lis3lv02d_add(struct acpi_device *device)
+       }
+       /* call the core layer do its init */
++      lis3_dev.init_required = true;
+       ret = lis3lv02d_init_device(&lis3_dev);
+       if (ret)
+               return ret;
+@@ -403,11 +407,27 @@ static int lis3lv02d_suspend(struct device *dev)
+ static int lis3lv02d_resume(struct device *dev)
+ {
++      lis3_dev.init_required = false;
++      lis3lv02d_poweron(&lis3_dev);
++      return 0;
++}
++
++static int lis3lv02d_restore(struct device *dev)
++{
++      lis3_dev.init_required = true;
+       lis3lv02d_poweron(&lis3_dev);
+       return 0;
+ }
+-static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume);
++static const struct dev_pm_ops hp_accel_pm = {
++      .suspend = lis3lv02d_suspend,
++      .resume = lis3lv02d_resume,
++      .freeze = lis3lv02d_suspend,
++      .thaw = lis3lv02d_resume,
++      .poweroff = lis3lv02d_suspend,
++      .restore = lis3lv02d_restore,
++};
++
+ #define HP_ACCEL_PM (&hp_accel_pm)
+ #else
+ #define HP_ACCEL_PM NULL
+-- 
+2.30.2
+
diff --git a/queue-5.12/platform-x86-intel_punit_ipc-append-module_device_ta.patch b/queue-5.12/platform-x86-intel_punit_ipc-append-module_device_ta.patch
new file mode 100644 (file)
index 0000000..0d8ddc9
--- /dev/null
@@ -0,0 +1,38 @@
+From ac56041b2364cf5262440427234929610bd414f4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 19 May 2021 13:15:21 +0300
+Subject: platform/x86: intel_punit_ipc: Append MODULE_DEVICE_TABLE for ACPI
+
+From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+
+[ Upstream commit bc1eca606d8084465e6f89fd646cc71defbad490 ]
+
+The intel_punit_ipc driver might be compiled as a module.
+When udev handles the event of the devices appearing
+the intel_punit_ipc module is missing.
+
+Append MODULE_DEVICE_TABLE for ACPI case to fix the loading issue.
+
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Link: https://lore.kernel.org/r/20210519101521.79338-1-andriy.shevchenko@linux.intel.com
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/intel_punit_ipc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/platform/x86/intel_punit_ipc.c b/drivers/platform/x86/intel_punit_ipc.c
+index 05cced59e251..f58b8543f6ac 100644
+--- a/drivers/platform/x86/intel_punit_ipc.c
++++ b/drivers/platform/x86/intel_punit_ipc.c
+@@ -312,6 +312,7 @@ static const struct acpi_device_id punit_ipc_acpi_ids[] = {
+       { "INT34D4", 0 },
+       { }
+ };
++MODULE_DEVICE_TABLE(acpi, punit_ipc_acpi_ids);
+ static struct platform_driver intel_punit_ipc_driver = {
+       .probe = intel_punit_ipc_probe,
+-- 
+2.30.2
+
diff --git a/queue-5.12/platform-x86-touchscreen_dmi-add-info-for-the-chuwi-.patch b/queue-5.12/platform-x86-touchscreen_dmi-add-info-for-the-chuwi-.patch
new file mode 100644 (file)
index 0000000..1496477
--- /dev/null
@@ -0,0 +1,80 @@
+From 607b3303a3561b54b0cc223c71c92b031ef400c2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 May 2021 11:32:28 +0200
+Subject: platform/x86: touchscreen_dmi: Add info for the Chuwi Hi10 Pro
+ (CWI529) tablet
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit e68671e9e1275dfdda333c3e83b6d28963af16b6 ]
+
+Add touchscreen info for the Chuwi Hi10 Pro (CWI529) tablet. This includes
+info for getting the firmware directly from the UEFI, so that the user does
+not need to manually install the firmware in /lib/firmware/silead.
+
+This change will make the touchscreen on these devices work OOTB,
+without requiring any manual setup.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20210520093228.7439-1-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/touchscreen_dmi.c | 35 ++++++++++++++++++++++++++
+ 1 file changed, 35 insertions(+)
+
+diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c
+index 5e4eb3b36d70..8618c44106c2 100644
+--- a/drivers/platform/x86/touchscreen_dmi.c
++++ b/drivers/platform/x86/touchscreen_dmi.c
+@@ -115,6 +115,32 @@ static const struct ts_dmi_data chuwi_hi10_plus_data = {
+       .properties     = chuwi_hi10_plus_props,
+ };
++static const struct property_entry chuwi_hi10_pro_props[] = {
++      PROPERTY_ENTRY_U32("touchscreen-min-x", 8),
++      PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
++      PROPERTY_ENTRY_U32("touchscreen-size-x", 1912),
++      PROPERTY_ENTRY_U32("touchscreen-size-y", 1272),
++      PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
++      PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi10-pro.fw"),
++      PROPERTY_ENTRY_U32("silead,max-fingers", 10),
++      PROPERTY_ENTRY_BOOL("silead,home-button"),
++      { }
++};
++
++static const struct ts_dmi_data chuwi_hi10_pro_data = {
++      .embedded_fw = {
++              .name   = "silead/gsl1680-chuwi-hi10-pro.fw",
++              .prefix = { 0xf0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 },
++              .length = 42504,
++              .sha256 = { 0xdb, 0x92, 0x68, 0xa8, 0xdb, 0x81, 0x31, 0x00,
++                          0x1f, 0x58, 0x89, 0xdb, 0x19, 0x1b, 0x15, 0x8c,
++                          0x05, 0x14, 0xf4, 0x95, 0xba, 0x15, 0x45, 0x98,
++                          0x42, 0xa3, 0xbb, 0x65, 0xe3, 0x30, 0xa5, 0x93 },
++      },
++      .acpi_name      = "MSSL1680:00",
++      .properties     = chuwi_hi10_pro_props,
++};
++
+ static const struct property_entry chuwi_vi8_props[] = {
+       PROPERTY_ENTRY_U32("touchscreen-min-x", 4),
+       PROPERTY_ENTRY_U32("touchscreen-min-y", 6),
+@@ -889,6 +915,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
+                       DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
+               },
+       },
++      {
++              /* Chuwi Hi10 Prus (CWI597) */
++              .driver_data = (void *)&chuwi_hi10_pro_data,
++              .matches = {
++                      DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "Hi10 pro tablet"),
++                      DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
++              },
++      },
+       {
+               /* Chuwi Vi8 (CWI506) */
+               .driver_data = (void *)&chuwi_vi8_data,
+-- 
+2.30.2
+
diff --git a/queue-5.12/platform-x86-touchscreen_dmi-add-info-for-the-mediac.patch b/queue-5.12/platform-x86-touchscreen_dmi-add-info-for-the-mediac.patch
new file mode 100644 (file)
index 0000000..fcc7606
--- /dev/null
@@ -0,0 +1,44 @@
+From 5b9f61c80558612d1d2f814e2e563a3f4eb656ee Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 4 May 2021 20:57:46 +0200
+Subject: platform/x86: touchscreen_dmi: Add info for the Mediacom Winpad 7.0
+ W700 tablet
+
+From: Teava Radu <rateava@gmail.com>
+
+[ Upstream commit 39a6172ea88b3117353ae16cbb0a53cd80a9340a ]
+
+Add touchscreen info for the Mediacom Winpad 7.0 W700 tablet.
+Tested on 5.11 hirsute.
+Note: it's hw clone to Wintron surftab 7.
+
+Signed-off-by: Teava Radu <rateava@gmail.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20210504185746.175461-6-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/touchscreen_dmi.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c
+index c44a6e8dceb8..5e4eb3b36d70 100644
+--- a/drivers/platform/x86/touchscreen_dmi.c
++++ b/drivers/platform/x86/touchscreen_dmi.c
+@@ -1070,6 +1070,14 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
+                       DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
+               },
+       },
++      {
++              /* Mediacom WinPad 7.0 W700 (same hw as Wintron surftab 7") */
++              .driver_data = (void *)&trekstor_surftab_wintron70_data,
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "MEDIACOM"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "WinPad 7 W10 - WPW700"),
++              },
++      },
+       {
+               /* Mediacom Flexbook Edge 11 (same hw as TS Primebook C11) */
+               .driver_data = (void *)&trekstor_primebook_c11_data,
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-alsa-gus-add-a-check-of-the-status-of-snd_ctl.patch b/queue-5.12/revert-alsa-gus-add-a-check-of-the-status-of-snd_ctl.patch
new file mode 100644 (file)
index 0000000..a6c103f
--- /dev/null
@@ -0,0 +1,59 @@
+From 7e2d23d3c0ab7b261e6739f631cd64dafd2b1a4f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:59 +0200
+Subject: Revert "ALSA: gus: add a check of the status of snd_ctl_add"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 1dacca7fa1ebea47d38d20cd2df37094805d2649 ]
+
+This reverts commit 0f25e000cb4398081748e54f62a902098aa79ec1.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original commit did nothing if there was an error, except to print
+out a message, which is pointless.  So remove the commit as it gives a
+"false sense of doing something".
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Reviewed-by: Takashi Iwai <tiwai@suse.de>
+Link: https://lore.kernel.org/r/20210503115736.2104747-33-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/isa/gus/gus_main.c | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
+index afc088f0377c..b7518122a10d 100644
+--- a/sound/isa/gus/gus_main.c
++++ b/sound/isa/gus/gus_main.c
+@@ -77,17 +77,8 @@ static const struct snd_kcontrol_new snd_gus_joystick_control = {
+ static void snd_gus_init_control(struct snd_gus_card *gus)
+ {
+-      int ret;
+-
+-      if (!gus->ace_flag) {
+-              ret =
+-                      snd_ctl_add(gus->card,
+-                                      snd_ctl_new1(&snd_gus_joystick_control,
+-                                              gus));
+-              if (ret)
+-                      snd_printk(KERN_ERR "gus: snd_ctl_add failed: %d\n",
+-                                      ret);
+-      }
++      if (!gus->ace_flag)
++              snd_ctl_add(gus->card, snd_ctl_new1(&snd_gus_joystick_control, gus));
+ }
+ /*
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-alsa-sb-fix-a-missing-check-of-snd_ctl_add.patch b/queue-5.12/revert-alsa-sb-fix-a-missing-check-of-snd_ctl_add.patch
new file mode 100644 (file)
index 0000000..de1172c
--- /dev/null
@@ -0,0 +1,53 @@
+From b1017526e823b25706e7c8434512fa0bf80d53b9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:34 +0200
+Subject: Revert "ALSA: sb: fix a missing check of snd_ctl_add"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 4b059ce1f4b368208c2310925f49be77f15e527b ]
+
+This reverts commit beae77170c60aa786f3e4599c18ead2854d8694d.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It is safe to ignore this error as the
+mixer element is optional, and the driver is very legacy.
+
+Cc: Aditya Pakki <pakki001@umn.edu>
+Reviewed-by: Takashi Iwai <tiwai@suse.de>
+Link: https://lore.kernel.org/r/20210503115736.2104747-8-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/isa/sb/sb16_main.c | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
+index 38dc1fde25f3..aa4870531023 100644
+--- a/sound/isa/sb/sb16_main.c
++++ b/sound/isa/sb/sb16_main.c
+@@ -846,14 +846,10 @@ int snd_sb16dsp_pcm(struct snd_sb *chip, int device)
+       snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb16_playback_ops);
+       snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb16_capture_ops);
+-      if (chip->dma16 >= 0 && chip->dma8 != chip->dma16) {
+-              err = snd_ctl_add(card, snd_ctl_new1(
+-                                      &snd_sb16_dma_control, chip));
+-              if (err)
+-                      return err;
+-      } else {
++      if (chip->dma16 >= 0 && chip->dma8 != chip->dma16)
++              snd_ctl_add(card, snd_ctl_new1(&snd_sb16_dma_control, chip));
++      else
+               pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
+-      }
+       snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
+                                      card->dev, 64*1024, 128*1024);
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-alsa-usx2y-fix-potential-null-pointer-derefer.patch b/queue-5.12/revert-alsa-usx2y-fix-potential-null-pointer-derefer.patch
new file mode 100644 (file)
index 0000000..afe29ee
--- /dev/null
@@ -0,0 +1,51 @@
+From 750718db59ce2ee1cb95fb42e1cc5908b0650cba Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:03 +0200
+Subject: Revert "ALSA: usx2y: Fix potential NULL pointer dereference"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 4667a6fc1777ce071504bab570d3599107f4790f ]
+
+This reverts commit a2c6433ee5a35a8de6d563f6512a26f87835ea0f.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original patch was incorrect, and would leak memory if the error
+path the patch added was hit.
+
+Cc: Aditya Pakki <pakki001@umn.edu>
+Reviewed-by: Takashi Iwai <tiwai@suse.de>
+Link: https://lore.kernel.org/r/20210503115736.2104747-37-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/usb/usx2y/usb_stream.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c
+index 091c071b270a..6bba17bf689a 100644
+--- a/sound/usb/usx2y/usb_stream.c
++++ b/sound/usb/usx2y/usb_stream.c
+@@ -91,12 +91,7 @@ static int init_urbs(struct usb_stream_kernel *sk, unsigned use_packsize,
+       for (u = 0; u < USB_STREAM_NURBS; ++u) {
+               sk->inurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
+-              if (!sk->inurb[u])
+-                      return -ENOMEM;
+-
+               sk->outurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
+-              if (!sk->outurb[u])
+-                      return -ENOMEM;
+       }
+       if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) ||
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-asoc-cs43130-fix-a-null-pointer-dereference.patch b/queue-5.12/revert-asoc-cs43130-fix-a-null-pointer-dereference.patch
new file mode 100644 (file)
index 0000000..d9449c9
--- /dev/null
@@ -0,0 +1,47 @@
+From 2d2a5738da7fc49bb58a12a3f52bfc42972f4444 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:23 +0200
+Subject: Revert "ASoC: cs43130: fix a NULL pointer dereference"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit fdda0dd2686ecd1f2e616c9e0366ea71b40c485d ]
+
+This reverts commit a2be42f18d409213bb7e7a736e3ef6ba005115bb.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original patch here is not correct, sysfs files that were created
+are not unwound.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Cc: Mark Brown <broonie@kernel.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-57-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/cs43130.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
+index 80bc7c10ed75..c2b6f0ae6d57 100644
+--- a/sound/soc/codecs/cs43130.c
++++ b/sound/soc/codecs/cs43130.c
+@@ -2319,8 +2319,6 @@ static int cs43130_probe(struct snd_soc_component *component)
+                       return ret;
+               cs43130->wq = create_singlethread_workqueue("cs43130_hp");
+-              if (!cs43130->wq)
+-                      return -ENOMEM;
+               INIT_WORK(&cs43130->work, cs43130_imp_meas);
+       }
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-ath6kl-return-error-code-in-ath6kl_wmi_set_ro.patch b/queue-5.12/revert-ath6kl-return-error-code-in-ath6kl_wmi_set_ro.patch
new file mode 100644 (file)
index 0000000..28290a4
--- /dev/null
@@ -0,0 +1,52 @@
+From 1ba34784007b220cbcd2bc086f778b47c820aa6d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:09 +0200
+Subject: Revert "ath6kl: return error code in ath6kl_wmi_set_roam_lrssi_cmd()"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit efba106f89fc6848726716c101f4c84e88720a9c ]
+
+This reverts commit fc6a6521556c8250e356ddc6a3f2391aa62dc976.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The change being reverted does NOTHING as the caller to this function
+does not even look at the return value of the call.  So the "claim" that
+this fixed an an issue is not true.  It will be fixed up properly in a
+future patch by propagating the error up the stack correctly.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Cc: Kalle Valo <kvalo@codeaurora.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-43-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/ath/ath6kl/wmi.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
+index b137e7f34397..aca9732ec1ee 100644
+--- a/drivers/net/wireless/ath/ath6kl/wmi.c
++++ b/drivers/net/wireless/ath/ath6kl/wmi.c
+@@ -776,8 +776,10 @@ int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi)
+       cmd->info.params.roam_rssi_floor = DEF_LRSSI_ROAM_FLOOR;
+       cmd->roam_ctrl = WMI_SET_LRSSI_SCAN_PARAMS;
+-      return ath6kl_wmi_cmd_send(wmi, 0, skb, WMI_SET_ROAM_CTRL_CMDID,
++      ath6kl_wmi_cmd_send(wmi, 0, skb, WMI_SET_ROAM_CTRL_CMDID,
+                           NO_SYNC_WMIFLAG);
++
++      return 0;
+ }
+ int ath6kl_wmi_force_roam_cmd(struct wmi *wmi, const u8 *bssid)
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-brcmfmac-add-a-check-for-the-status-of-usb_re.patch b/queue-5.12/revert-brcmfmac-add-a-check-for-the-status-of-usb_re.patch
new file mode 100644 (file)
index 0000000..045f695
--- /dev/null
@@ -0,0 +1,51 @@
+From 808f1b0586465051437e81f3481ed72bf1c736ea Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:35 +0200
+Subject: Revert "brcmfmac: add a check for the status of usb_register"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 30a350947692f794796f563029d29764497f2887 ]
+
+This reverts commit 42daad3343be4a4e1ee03e30a5f5cc731dadfef5.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original commit here did nothing to actually help if usb_register()
+failed, so it gives a "false sense of security" when there is none.  The
+correct solution is to correctly unwind from this error.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Cc: Kalle Valo <kvalo@codeaurora.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-69-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+index 586f4dfc638b..d2a803fc8ac6 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+@@ -1586,10 +1586,6 @@ void brcmf_usb_exit(void)
+ void brcmf_usb_register(void)
+ {
+-      int ret;
+-
+       brcmf_dbg(USB, "Enter\n");
+-      ret = usb_register(&brcmf_usbdrvr);
+-      if (ret)
+-              brcmf_err("usb_register failed %d\n", ret);
++      usb_register(&brcmf_usbdrvr);
+ }
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-char-hpet-fix-a-missing-check-of-ioremap.patch b/queue-5.12/revert-char-hpet-fix-a-missing-check-of-ioremap.patch
new file mode 100644 (file)
index 0000000..ae2d232
--- /dev/null
@@ -0,0 +1,48 @@
+From a5027fd49e0417c3df1fcbf0cd4f778ee785374f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:55 +0200
+Subject: Revert "char: hpet: fix a missing check of ioremap"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 566f53238da74801b48e985788e5f7c9159e5940 ]
+
+This reverts commit 13bd14a41ce3105d5b1f3cd8b4d1e249d17b6d9b.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+While this is technically correct, it is only fixing ONE of these errors
+in this function, so the patch is not fully correct.  I'll leave this
+revert and provide a fix for this later that resolves this same
+"problem" everywhere in this function.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Link: https://lore.kernel.org/r/20210503115736.2104747-29-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/char/hpet.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
+index ed3b7dab678d..6f13def6c172 100644
+--- a/drivers/char/hpet.c
++++ b/drivers/char/hpet.c
+@@ -969,8 +969,6 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
+       if (ACPI_SUCCESS(status)) {
+               hdp->hd_phys_address = addr.address.minimum;
+               hdp->hd_address = ioremap(addr.address.minimum, addr.address.address_length);
+-              if (!hdp->hd_address)
+-                      return AE_ERROR;
+               if (hpet_is_known(hdp)) {
+                       iounmap(hdp->hd_address);
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-crypto-cavium-nitrox-add-an-error-message-to-.patch b/queue-5.12/revert-crypto-cavium-nitrox-add-an-error-message-to-.patch
new file mode 100644 (file)
index 0000000..2be5f22
--- /dev/null
@@ -0,0 +1,54 @@
+From 6c2118c909f3ae07a27a92711c0bd978a35abed9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 28 Apr 2021 09:49:31 +0200
+Subject: Revert "crypto: cavium/nitrox - add an error message to explain the
+ failure of pci_request_mem_regions"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 6a3239a738d86c5e9b5aad17fefe2c2bfd6ced83 ]
+
+This reverts commit 9fcddaf2e28d779cb946d23838ba6d50f299aa80 as it was
+submitted under a fake name and we can not knowingly accept anonymous
+contributions to the repository.
+
+This commit was part of a submission "test" to the Linux kernel
+community by some "researchers" at umn.edu.  As outlined at:
+       https://www-users.cs.umn.edu/%7Ekjlu/papers/full-disclosure.pdf
+it was done so as an attempt to submit a known-buggy patch to see if it
+could get by our review.  However, the submission turned out to actually
+be correct, and not have a bug in it as the author did not understand
+how the PCI driver model works at all, and so the submission was
+accepted.
+
+As this change is of useless consequence, there is no loss of
+functionality in reverting it.
+
+Cc: "David S. Miller" <davem@davemloft.net>
+Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Cc: linux-crypto@vger.kernel.org
+Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Email: Herbert Xu <herbert@gondor.apana.org.au>
+Link: https://lore.kernel.org/r/YIkTi9a3nnL50wMq@kroah.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/crypto/cavium/nitrox/nitrox_main.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/drivers/crypto/cavium/nitrox/nitrox_main.c b/drivers/crypto/cavium/nitrox/nitrox_main.c
+index facc8e6bc580..d385daf2c71c 100644
+--- a/drivers/crypto/cavium/nitrox/nitrox_main.c
++++ b/drivers/crypto/cavium/nitrox/nitrox_main.c
+@@ -442,7 +442,6 @@ static int nitrox_probe(struct pci_dev *pdev,
+       err = pci_request_mem_regions(pdev, nitrox_driver_name);
+       if (err) {
+               pci_disable_device(pdev);
+-              dev_err(&pdev->dev, "Failed to request mem regions!\n");
+               return err;
+       }
+       pci_set_master(pdev);
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-dmaengine-qcom_hidma-check-for-driver-registe.patch b/queue-5.12/revert-dmaengine-qcom_hidma-check-for-driver-registe.patch
new file mode 100644 (file)
index 0000000..c80e35c
--- /dev/null
@@ -0,0 +1,51 @@
+From ffcb451752b071b5b7776515bda6828182aeedda Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:17 +0200
+Subject: Revert "dmaengine: qcom_hidma: Check for driver register failure"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 43ed0fcf613a87dd0221ec72d1ade4d6544f2ffc ]
+
+This reverts commit a474b3f0428d6b02a538aa10b3c3b722751cb382.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original change is NOT correct, as it does not correctly unwind from
+the resources that was allocated before the call to
+platform_driver_register().
+
+Cc: Aditya Pakki <pakki001@umn.edu>
+Acked-By: Vinod Koul <vkoul@kernel.org>
+Acked-By: Sinan Kaya <okaya@kernel.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-51-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/dma/qcom/hidma_mgmt.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/dma/qcom/hidma_mgmt.c b/drivers/dma/qcom/hidma_mgmt.c
+index 806ca02c52d7..fe87b01f7a4e 100644
+--- a/drivers/dma/qcom/hidma_mgmt.c
++++ b/drivers/dma/qcom/hidma_mgmt.c
+@@ -418,8 +418,9 @@ static int __init hidma_mgmt_init(void)
+               hidma_mgmt_of_populate_channels(child);
+       }
+ #endif
+-      return platform_driver_register(&hidma_mgmt_driver);
++      platform_driver_register(&hidma_mgmt_driver);
++      return 0;
+ }
+ module_init(hidma_mgmt_init);
+ MODULE_LICENSE("GPL v2");
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-isdn-misdn-fix-potential-null-pointer-derefer.patch b/queue-5.12/revert-isdn-misdn-fix-potential-null-pointer-derefer.patch
new file mode 100644 (file)
index 0000000..e8fcb2d
--- /dev/null
@@ -0,0 +1,50 @@
+From e82d6a66f0d7fab1776043c4a3e758799d78d755 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:13 +0200
+Subject: Revert "isdn: mISDN: Fix potential NULL pointer dereference of
+ kzalloc"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 36a2c87f7ed9e305d05b9a5c044cc6c494771504 ]
+
+This reverts commit 38d22659803a033b1b66cd2624c33570c0dde77d.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+While it looks like the original change is correct, it is not, as none
+of the setup actually happens, and the error value is not propagated
+upwards.
+
+Cc: Aditya Pakki <pakki001@umn.edu>
+Cc: David S. Miller <davem@davemloft.net>
+Link: https://lore.kernel.org/r/20210503115736.2104747-47-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/isdn/hardware/mISDN/hfcsusb.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
+index 70061991915a..4bb470d3963d 100644
+--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
++++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
+@@ -249,9 +249,6 @@ hfcsusb_ph_info(struct hfcsusb *hw)
+       int i;
+       phi = kzalloc(struct_size(phi, bch, dch->dev.nrbchan), GFP_ATOMIC);
+-      if (!phi)
+-              return;
+-
+       phi->dch.ch.protocol = hw->protocol;
+       phi->dch.ch.Flags = dch->Flags;
+       phi->dch.state = dch->state;
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-isdn-misdninfineon-fix-potential-null-pointer.patch b/queue-5.12/revert-isdn-misdninfineon-fix-potential-null-pointer.patch
new file mode 100644 (file)
index 0000000..4482504
--- /dev/null
@@ -0,0 +1,55 @@
+From b4484ae66d4dff48e0a1fbb082209d7ba8a4f676 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:07 +0200
+Subject: Revert "isdn: mISDNinfineon: fix potential NULL pointer dereference"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit abd7bca23bd4247124265152d00ffd4b2b0d6877 ]
+
+This reverts commit d721fe99f6ada070ae8fc0ec3e01ce5a42def0d9.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original commit was incorrect, it should have never have used
+"unlikely()" and if it ever does trigger, resources are left grabbed.
+
+Given there are no users for this code around, I'll just revert this and
+leave it "as is" as the odds that ioremap() will ever fail here is
+horrendiously low.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Cc: David S. Miller <davem@davemloft.net>
+Link: https://lore.kernel.org/r/20210503115736.2104747-41-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/isdn/hardware/mISDN/mISDNinfineon.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/drivers/isdn/hardware/mISDN/mISDNinfineon.c b/drivers/isdn/hardware/mISDN/mISDNinfineon.c
+index a16c7a2a7f3d..fa9c491f9c38 100644
+--- a/drivers/isdn/hardware/mISDN/mISDNinfineon.c
++++ b/drivers/isdn/hardware/mISDN/mISDNinfineon.c
+@@ -697,11 +697,8 @@ setup_io(struct inf_hw *hw)
+                               (ulong)hw->addr.start, (ulong)hw->addr.size);
+                       return err;
+               }
+-              if (hw->ci->addr_mode == AM_MEMIO) {
++              if (hw->ci->addr_mode == AM_MEMIO)
+                       hw->addr.p = ioremap(hw->addr.start, hw->addr.size);
+-                      if (unlikely(!hw->addr.p))
+-                              return -ENOMEM;
+-              }
+               hw->addr.mode = hw->ci->addr_mode;
+               if (debug & DEBUG_HW)
+                       pr_notice("%s: IO addr %lx (%lu bytes) mode%d\n",
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-libertas-add-checks-for-the-return-value-of-s.patch b/queue-5.12/revert-libertas-add-checks-for-the-return-value-of-s.patch
new file mode 100644 (file)
index 0000000..81040eb
--- /dev/null
@@ -0,0 +1,55 @@
+From 6de18e0eff403d4817281f8512a9e395f490e08b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:19 +0200
+Subject: Revert "libertas: add checks for the return value of
+ sysfs_create_group"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 46651077765c80a0d6f87f3469129a72e49ce91b ]
+
+This reverts commit 434256833d8eb988cb7f3b8a41699e2fe48d9332.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original commit was incorrect, the error needs to be propagated back
+to the caller AND if the second group call fails, the first needs to be
+removed.  There are much better ways to solve this, the driver should
+NOT be calling sysfs_create_group() on its own as it is racing userspace
+and loosing.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Cc: Kalle Valo <kvalo@codeaurora.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-53-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/marvell/libertas/mesh.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c
+index f5b78257d551..c611e6668b21 100644
+--- a/drivers/net/wireless/marvell/libertas/mesh.c
++++ b/drivers/net/wireless/marvell/libertas/mesh.c
+@@ -805,12 +805,7 @@ static void lbs_persist_config_init(struct net_device *dev)
+ {
+       int ret;
+       ret = sysfs_create_group(&(dev->dev.kobj), &boot_opts_group);
+-      if (ret)
+-              pr_err("failed to create boot_opts_group.\n");
+-
+       ret = sysfs_create_group(&(dev->dev.kobj), &mesh_ie_group);
+-      if (ret)
+-              pr_err("failed to create mesh_ie_group.\n");
+ }
+ static void lbs_persist_config_remove(struct net_device *dev)
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-media-dvb-add-check-on-sp8870_readreg.patch b/queue-5.12/revert-media-dvb-add-check-on-sp8870_readreg.patch
new file mode 100644 (file)
index 0000000..1ff9393
--- /dev/null
@@ -0,0 +1,50 @@
+From d24ff2db760bcfdcab6038da4c2487fe15cf9b06 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:25 +0200
+Subject: Revert "media: dvb: Add check on sp8870_readreg"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 47e4ff06fa7f5ba4860543a2913bbd0c164640aa ]
+
+This reverts commit 467a37fba93f2b4fe3ab597ff6a517b22b566882.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+This commit is not properly checking for an error at all, so if a
+read succeeds from this device, it will error out.
+
+Cc: Aditya Pakki <pakki001@umn.edu>
+Cc: Sean Young <sean@mess.org>
+Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-59-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/dvb-frontends/sp8870.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/drivers/media/dvb-frontends/sp8870.c b/drivers/media/dvb-frontends/sp8870.c
+index 655db8272268..ee893a2f2261 100644
+--- a/drivers/media/dvb-frontends/sp8870.c
++++ b/drivers/media/dvb-frontends/sp8870.c
+@@ -280,9 +280,7 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)
+       sp8870_writereg(state, 0xc05, reg0xc05);
+       // read status reg in order to clear pending irqs
+-      err = sp8870_readreg(state, 0x200);
+-      if (err)
+-              return err;
++      sp8870_readreg(state, 0x200);
+       // system controller start
+       sp8870_microcontroller_start(state);
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-media-gspca-check-the-return-value-of-write_b.patch b/queue-5.12/revert-media-gspca-check-the-return-value-of-write_b.patch
new file mode 100644 (file)
index 0000000..2618268
--- /dev/null
@@ -0,0 +1,64 @@
+From e80aa6a0ae1b165e05d2d2cca33ee3075b2cd8e3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:29 +0200
+Subject: Revert "media: gspca: Check the return value of write_bridge for
+ timeout"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 8e23e83c752b54e98102627a1cc09281ad71a299 ]
+
+This reverts commit a21a0eb56b4e8fe4a330243af8030f890cde2283.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+Different error values should never be "OR" together and expect anything
+sane to come out of the result.
+
+Cc: Aditya Pakki <pakki001@umn.edu>
+Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-63-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/usb/gspca/m5602/m5602_po1030.c | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/media/usb/gspca/m5602/m5602_po1030.c b/drivers/media/usb/gspca/m5602/m5602_po1030.c
+index d680b777f097..7bdbb8065146 100644
+--- a/drivers/media/usb/gspca/m5602/m5602_po1030.c
++++ b/drivers/media/usb/gspca/m5602/m5602_po1030.c
+@@ -154,7 +154,6 @@ static const struct v4l2_ctrl_config po1030_greenbal_cfg = {
+ int po1030_probe(struct sd *sd)
+ {
+-      int rc = 0;
+       u8 dev_id_h = 0, i;
+       struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
+@@ -174,14 +173,11 @@ int po1030_probe(struct sd *sd)
+       for (i = 0; i < ARRAY_SIZE(preinit_po1030); i++) {
+               u8 data = preinit_po1030[i][2];
+               if (preinit_po1030[i][0] == SENSOR)
+-                      rc |= m5602_write_sensor(sd,
++                      m5602_write_sensor(sd,
+                               preinit_po1030[i][1], &data, 1);
+               else
+-                      rc |= m5602_write_bridge(sd, preinit_po1030[i][1],
+-                                              data);
++                      m5602_write_bridge(sd, preinit_po1030[i][1], data);
+       }
+-      if (rc < 0)
+-              return rc;
+       if (m5602_read_sensor(sd, PO1030_DEVID_H, &dev_id_h, 1))
+               return -ENODEV;
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-media-gspca-mt9m111-check-write_bridge-for-ti.patch b/queue-5.12/revert-media-gspca-mt9m111-check-write_bridge-for-ti.patch
new file mode 100644 (file)
index 0000000..1c55e47
--- /dev/null
@@ -0,0 +1,68 @@
+From f95dfbe724bb0ccb906a0a6e18d998cc80d2bba8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:27 +0200
+Subject: Revert "media: gspca: mt9m111: Check write_bridge for timeout"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit d8c3be2fb2079d0cb4cd29d6aba58dbe54771e42 ]
+
+This reverts commit 656025850074f5c1ba2e05be37bda57ba2b8d491.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+Different error values should never be "OR" together and expect anything
+sane to come out of the result.
+
+Cc: Aditya Pakki <pakki001@umn.edu>
+Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-61-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/usb/gspca/m5602/m5602_mt9m111.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/media/usb/gspca/m5602/m5602_mt9m111.c b/drivers/media/usb/gspca/m5602/m5602_mt9m111.c
+index bfa3b381d8a2..50481dc928d0 100644
+--- a/drivers/media/usb/gspca/m5602/m5602_mt9m111.c
++++ b/drivers/media/usb/gspca/m5602/m5602_mt9m111.c
+@@ -195,7 +195,7 @@ static const struct v4l2_ctrl_config mt9m111_greenbal_cfg = {
+ int mt9m111_probe(struct sd *sd)
+ {
+       u8 data[2] = {0x00, 0x00};
+-      int i, rc = 0;
++      int i;
+       struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
+       if (force_sensor) {
+@@ -213,18 +213,16 @@ int mt9m111_probe(struct sd *sd)
+       /* Do the preinit */
+       for (i = 0; i < ARRAY_SIZE(preinit_mt9m111); i++) {
+               if (preinit_mt9m111[i][0] == BRIDGE) {
+-                      rc |= m5602_write_bridge(sd,
++                      m5602_write_bridge(sd,
+                               preinit_mt9m111[i][1],
+                               preinit_mt9m111[i][2]);
+               } else {
+                       data[0] = preinit_mt9m111[i][2];
+                       data[1] = preinit_mt9m111[i][3];
+-                      rc |= m5602_write_sensor(sd,
++                      m5602_write_sensor(sd,
+                               preinit_mt9m111[i][1], data, 2);
+               }
+       }
+-      if (rc < 0)
+-              return rc;
+       if (m5602_read_sensor(sd, MT9M111_SC_CHIPVER, data, 2))
+               return -ENODEV;
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-media-usb-gspca-add-a-missed-check-for-goto_l.patch b/queue-5.12/revert-media-usb-gspca-add-a-missed-check-for-goto_l.patch
new file mode 100644 (file)
index 0000000..60d06fe
--- /dev/null
@@ -0,0 +1,55 @@
+From 2a60ed490b24c0a20f99cf4d2691d5be23a3e412 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:33 +0200
+Subject: Revert "media: usb: gspca: add a missed check for goto_low_power"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit fd013265e5b5576a74a033920d6c571e08d7c423 ]
+
+This reverts commit 5b711870bec4dc9a6d705d41e127e73944fa3650.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to do does nothing useful as a user
+can do nothing with this information and if an error did happen, the
+code would continue on as before.  Because of this, just revert it.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-7-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/usb/gspca/cpia1.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c
+index a4f7431486f3..d93d384286c1 100644
+--- a/drivers/media/usb/gspca/cpia1.c
++++ b/drivers/media/usb/gspca/cpia1.c
+@@ -1424,7 +1424,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
+ {
+       struct sd *sd = (struct sd *) gspca_dev;
+       struct cam *cam;
+-      int ret;
+       sd->mainsFreq = FREQ_DEF == V4L2_CID_POWER_LINE_FREQUENCY_60HZ;
+       reset_camera_params(gspca_dev);
+@@ -1436,10 +1435,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
+       cam->cam_mode = mode;
+       cam->nmodes = ARRAY_SIZE(mode);
+-      ret = goto_low_power(gspca_dev);
+-      if (ret)
+-              gspca_err(gspca_dev, "Cannot go to low power mode: %d\n",
+-                        ret);
++      goto_low_power(gspca_dev);
+       /* Check the firmware version. */
+       sd->params.version.firmwareVersion = 0;
+       get_version_information(gspca_dev);
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-net-caif-replace-bug_on-with-recovery-code.patch b/queue-5.12/revert-net-caif-replace-bug_on-with-recovery-code.patch
new file mode 100644 (file)
index 0000000..25f7783
--- /dev/null
@@ -0,0 +1,51 @@
+From 4eb387b5b0b51b42a1dcfd06c2cfb22e1ad72223 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:45 +0200
+Subject: Revert "net: caif: replace BUG_ON with recovery code"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 4df07045fcfd684379a394d0f2aa0cc4067bda2a ]
+
+This reverts commit c5dea815834c7d2e9fc633785455bc428b7a1956.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original change here was pointless as dev can never be NULL in this
+function so the claim in the changelog that this "fixes" anything is
+incorrect (also the developer forgot about panic_on_warn).  A follow-up
+change will resolve this issue properly.
+
+Cc: Aditya Pakki <pakki001@umn.edu>
+Cc: David S. Miller <davem@davemloft.net>
+Link: https://lore.kernel.org/r/20210503115736.2104747-19-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/caif/caif_serial.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
+index 8215cd77301f..4720a7bac4fb 100644
+--- a/drivers/net/caif/caif_serial.c
++++ b/drivers/net/caif/caif_serial.c
+@@ -269,9 +269,7 @@ static netdev_tx_t caif_xmit(struct sk_buff *skb, struct net_device *dev)
+ {
+       struct ser_device *ser;
+-      if (WARN_ON(!dev))
+-              return -EINVAL;
+-
++      BUG_ON(dev == NULL);
+       ser = netdev_priv(dev);
+       /* Send flow off once, on high water mark */
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-net-fujitsu-fix-a-potential-null-pointer-dere.patch b/queue-5.12/revert-net-fujitsu-fix-a-potential-null-pointer-dere.patch
new file mode 100644 (file)
index 0000000..ea2b6cc
--- /dev/null
@@ -0,0 +1,53 @@
+From cb145c659cdff7d80413c8650bed2c734e433ee2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:41 +0200
+Subject: Revert "net: fujitsu: fix a potential NULL pointer dereference"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 5f94eaa4ee23e80841fa359a372f84cfe25daee1 ]
+
+This reverts commit 9f4d6358e11bbc7b839f9419636188e4151fb6e4.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original change does not change any behavior as the caller of this
+function onlyu checks for "== -1" as an error condition so this error is
+not handled properly.  Remove this change and it will be fixed up
+properly in a later commit.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Cc: David S. Miller <davem@davemloft.net>
+Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
+Link: https://lore.kernel.org/r/20210503115736.2104747-15-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/fujitsu/fmvj18x_cs.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
+index a7b7a4aace79..dc90c61fc827 100644
+--- a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
++++ b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
+@@ -547,11 +547,6 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
+       return -1;
+     base = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
+-    if (!base) {
+-          pcmcia_release_window(link, link->resource[2]);
+-          return -ENOMEM;
+-    }
+-
+     pcmcia_map_mem_page(link, link->resource[2], 0);
+     /*
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-net-liquidio-fix-a-null-pointer-dereference.patch b/queue-5.12/revert-net-liquidio-fix-a-null-pointer-dereference.patch
new file mode 100644 (file)
index 0000000..9a1891f
--- /dev/null
@@ -0,0 +1,52 @@
+From fdedfa16825ab89ee09e41aad2af385144f03483 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:57:31 +0200
+Subject: Revert "net: liquidio: fix a NULL pointer dereference"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 4fd798a5a89114c1892574c50f2aebd49bc5b4f5 ]
+
+This reverts commit fe543b2f174f34a7a751aa08b334fe6b105c4569.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+While the original commit does keep the immediate "NULL dereference"
+from happening, it does not properly propagate the error back to the
+callers, AND it does not fix this same identical issue in the
+drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for some reason.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Cc: David S. Miller <davem@davemloft.net>
+Link: https://lore.kernel.org/r/20210503115736.2104747-65-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/cavium/liquidio/lio_main.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
+index 7c5af4beedc6..6fa570068648 100644
+--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
++++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
+@@ -1166,11 +1166,6 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)
+       sc = (struct octeon_soft_command *)
+               octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE,
+                                         16, 0);
+-      if (!sc) {
+-              netif_info(lio, rx_err, lio->netdev,
+-                         "Failed to allocate octeon_soft_command\n");
+-              return;
+-      }
+       ncmd = (union octnet_cmd *)sc->virtdptr;
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-net-smc-fix-a-null-pointer-dereference.patch b/queue-5.12/revert-net-smc-fix-a-null-pointer-dereference.patch
new file mode 100644 (file)
index 0000000..94a5d73
--- /dev/null
@@ -0,0 +1,52 @@
+From 06c235aac3c96dd1c5e4e42503de0e6bb0b5b6f1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:43 +0200
+Subject: Revert "net/smc: fix a NULL pointer dereference"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit 5369ead83f5aff223b6418c99cb1fe9a8f007363 ]
+
+This reverts commit e183d4e414b64711baf7a04e214b61969ca08dfa.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+The original commit causes a memory leak and does not properly fix the
+issue it claims to fix.  I will send a follow-on patch to resolve this
+properly.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Cc: Ursula Braun <ubraun@linux.ibm.com>
+Cc: David S. Miller <davem@davemloft.net>
+Link: https://lore.kernel.org/r/20210503115736.2104747-17-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/smc/smc_ism.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
+index 9c6e95882553..6558cf7643a7 100644
+--- a/net/smc/smc_ism.c
++++ b/net/smc/smc_ism.c
+@@ -417,11 +417,6 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,
+       init_waitqueue_head(&smcd->lgrs_deleted);
+       smcd->event_wq = alloc_ordered_workqueue("ism_evt_wq-%s)",
+                                                WQ_MEM_RECLAIM, name);
+-      if (!smcd->event_wq) {
+-              kfree(smcd->conn);
+-              kfree(smcd);
+-              return NULL;
+-      }
+       return smcd;
+ }
+ EXPORT_SYMBOL_GPL(smcd_alloc_dev);
+-- 
+2.30.2
+
diff --git a/queue-5.12/revert-serial-max310x-pass-return-value-of-spi_regis.patch b/queue-5.12/revert-serial-max310x-pass-return-value-of-spi_regis.patch
new file mode 100644 (file)
index 0000000..7515f6d
--- /dev/null
@@ -0,0 +1,51 @@
+From e2fde0fbe5e60f571e8030004e81f03edc05f6ec Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:37 +0200
+Subject: Revert "serial: max310x: pass return value of spi_register_driver"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[ Upstream commit b0a85abbe92e1a6f3e8580a4590fa7245de7090b ]
+
+This reverts commit 51f689cc11333944c7a457f25ec75fcb41e99410.
+
+Because of recent interactions with developers from @umn.edu, all
+commits from them have been recently re-reviewed to ensure if they were
+correct or not.
+
+Upon review, this commit was found to be incorrect for the reasons
+below, so it must be reverted.  It will be fixed up "correctly" in a
+later kernel change.
+
+This change did not properly unwind from the error condition, so it was
+not correct.
+
+Cc: Kangjie Lu <kjlu@umn.edu>
+Acked-by: Jiri Slaby <jirislaby@kernel.org>
+Link: https://lore.kernel.org/r/20210503115736.2104747-11-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/tty/serial/max310x.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
+index 1b61d26bb7af..93f69b66b896 100644
+--- a/drivers/tty/serial/max310x.c
++++ b/drivers/tty/serial/max310x.c
+@@ -1518,10 +1518,10 @@ static int __init max310x_uart_init(void)
+               return ret;
+ #ifdef CONFIG_SPI_MASTER
+-      ret = spi_register_driver(&max310x_spi_driver);
++      spi_register_driver(&max310x_spi_driver);
+ #endif
+-      return ret;
++      return 0;
+ }
+ module_init(max310x_uart_init);
+-- 
+2.30.2
+
diff --git a/queue-5.12/scsi-buslogic-fix-64-bit-system-enumeration-error-fo.patch b/queue-5.12/scsi-buslogic-fix-64-bit-system-enumeration-error-fo.patch
new file mode 100644 (file)
index 0000000..ea48ae2
--- /dev/null
@@ -0,0 +1,65 @@
+From 38cc54182d1770d1e34ea634c3d6c354945ef40a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 11 May 2021 03:04:37 +0000
+Subject: scsi: BusLogic: Fix 64-bit system enumeration error for Buslogic
+
+From: Matt Wang <wwentao@vmware.com>
+
+[ Upstream commit 56f396146af278135c0ff958c79b5ee1bd22453d ]
+
+Commit 391e2f25601e ("[SCSI] BusLogic: Port driver to 64-bit")
+introduced a serious issue for 64-bit systems.  With this commit,
+64-bit kernel will enumerate 8*15 non-existing disks.  This is caused
+by the broken CCB structure.  The change from u32 data to void *data
+increased CCB length on 64-bit system, which introduced an extra 4
+byte offset of the CDB.  This leads to incorrect response to INQUIRY
+commands during enumeration.
+
+Fix disk enumeration failure by reverting the portion of the commit
+above which switched the data pointer from u32 to void.
+
+Link: https://lore.kernel.org/r/C325637F-1166-4340-8F0F-3BCCD59D4D54@vmware.com
+Acked-by: Khalid Aziz <khalid@gonehiking.org>
+Signed-off-by: Matt Wang <wwentao@vmware.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/BusLogic.c | 6 +++---
+ drivers/scsi/BusLogic.h | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
+index ccb061ab0a0a..7231de2767a9 100644
+--- a/drivers/scsi/BusLogic.c
++++ b/drivers/scsi/BusLogic.c
+@@ -3078,11 +3078,11 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command,
+               ccb->opcode = BLOGIC_INITIATOR_CCB_SG;
+               ccb->datalen = count * sizeof(struct blogic_sg_seg);
+               if (blogic_multimaster_type(adapter))
+-                      ccb->data = (void *)((unsigned int) ccb->dma_handle +
++                      ccb->data = (unsigned int) ccb->dma_handle +
+                                       ((unsigned long) &ccb->sglist -
+-                                      (unsigned long) ccb));
++                                      (unsigned long) ccb);
+               else
+-                      ccb->data = ccb->sglist;
++                      ccb->data = virt_to_32bit_virt(ccb->sglist);
+               scsi_for_each_sg(command, sg, count, i) {
+                       ccb->sglist[i].segbytes = sg_dma_len(sg);
+diff --git a/drivers/scsi/BusLogic.h b/drivers/scsi/BusLogic.h
+index 6182cc8a0344..e081ad47d1cf 100644
+--- a/drivers/scsi/BusLogic.h
++++ b/drivers/scsi/BusLogic.h
+@@ -814,7 +814,7 @@ struct blogic_ccb {
+       unsigned char cdblen;                           /* Byte 2 */
+       unsigned char sense_datalen;                    /* Byte 3 */
+       u32 datalen;                                    /* Bytes 4-7 */
+-      void *data;                                     /* Bytes 8-11 */
++      u32 data;                                       /* Bytes 8-11 */
+       unsigned char:8;                                /* Byte 12 */
+       unsigned char:8;                                /* Byte 13 */
+       enum blogic_adapter_status adapter_status;      /* Byte 14 */
+-- 
+2.30.2
+
diff --git a/queue-5.12/scsi-pm80xx-fix-drives-missing-during-rmmod-insmod-l.patch b/queue-5.12/scsi-pm80xx-fix-drives-missing-during-rmmod-insmod-l.patch
new file mode 100644 (file)
index 0000000..65f8956
--- /dev/null
@@ -0,0 +1,121 @@
+From 156c122bcc7facffe053639ba16f16710284627a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 5 May 2021 17:31:03 +0530
+Subject: scsi: pm80xx: Fix drives missing during rmmod/insmod loop
+
+From: Ajish Koshy <ajish.koshy@microchip.com>
+
+[ Upstream commit d1acd81bd6eb685aa9fef25624fb36d297f6404e ]
+
+When driver is loaded after rmmod some drives are not showing up during
+discovery.
+
+SATA drives are directly attached to the controller connected phys.  During
+device discovery, the IDENTIFY command (qc timeout (cmd 0xec)) is timing out
+during revalidation. This will trigger abort from host side and controller
+successfully aborts the command and returns success. Post this successful
+abort response ATA library decides to mark the disk as NODEV.
+
+To overcome this, inside pm8001_scan_start() after phy_start() call, add get
+start response and wait for few milliseconds to trigger next phy start.
+This millisecond delay will give sufficient time for the controller state
+machine to accept next phy start.
+
+Link: https://lore.kernel.org/r/20210505120103.24497-1-ajish.koshy@microchip.com
+Signed-off-by: Ajish Koshy <ajish.koshy@microchip.com>
+Signed-off-by: Viswas G <viswas.g@microchip.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/pm8001/pm8001_hwi.c  | 10 ++++++----
+ drivers/scsi/pm8001/pm8001_init.c |  2 +-
+ drivers/scsi/pm8001/pm8001_sas.c  |  7 ++++++-
+ drivers/scsi/pm8001/pm80xx_hwi.c  | 12 ++++++------
+ 4 files changed, 19 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
+index 1b1a57f46989..c2a38a172904 100644
+--- a/drivers/scsi/pm8001/pm8001_hwi.c
++++ b/drivers/scsi/pm8001/pm8001_hwi.c
+@@ -3709,11 +3709,13 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void* piomb)
+       case HW_EVENT_PHY_START_STATUS:
+               pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_PHY_START_STATUS status = %x\n",
+                          status);
+-              if (status == 0) {
++              if (status == 0)
+                       phy->phy_state = 1;
+-                      if (pm8001_ha->flags == PM8001F_RUN_TIME &&
+-                                      phy->enable_completion != NULL)
+-                              complete(phy->enable_completion);
++
++              if (pm8001_ha->flags == PM8001F_RUN_TIME &&
++                              phy->enable_completion != NULL) {
++                      complete(phy->enable_completion);
++                      phy->enable_completion = NULL;
+               }
+               break;
+       case HW_EVENT_SAS_PHY_UP:
+diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
+index bd626ef876da..4f3ec2bba8c9 100644
+--- a/drivers/scsi/pm8001/pm8001_init.c
++++ b/drivers/scsi/pm8001/pm8001_init.c
+@@ -1144,8 +1144,8 @@ static int pm8001_pci_probe(struct pci_dev *pdev,
+               goto err_out_shost;
+       }
+       list_add_tail(&pm8001_ha->list, &hba_list);
+-      scsi_scan_host(pm8001_ha->shost);
+       pm8001_ha->flags = PM8001F_RUN_TIME;
++      scsi_scan_host(pm8001_ha->shost);
+       return 0;
+ err_out_shost:
+diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
+index a98d4496ff8b..0a637609504e 100644
+--- a/drivers/scsi/pm8001/pm8001_sas.c
++++ b/drivers/scsi/pm8001/pm8001_sas.c
+@@ -264,12 +264,17 @@ void pm8001_scan_start(struct Scsi_Host *shost)
+       int i;
+       struct pm8001_hba_info *pm8001_ha;
+       struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
++      DECLARE_COMPLETION_ONSTACK(completion);
+       pm8001_ha = sha->lldd_ha;
+       /* SAS_RE_INITIALIZATION not available in SPCv/ve */
+       if (pm8001_ha->chip_id == chip_8001)
+               PM8001_CHIP_DISP->sas_re_init_req(pm8001_ha);
+-      for (i = 0; i < pm8001_ha->chip->n_phy; ++i)
++      for (i = 0; i < pm8001_ha->chip->n_phy; ++i) {
++              pm8001_ha->phy[i].enable_completion = &completion;
+               PM8001_CHIP_DISP->phy_start_req(pm8001_ha, i);
++              wait_for_completion(&completion);
++              msleep(300);
++      }
+ }
+ int pm8001_scan_finished(struct Scsi_Host *shost, unsigned long time)
+diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
+index c6b0834e3806..5de7adfabd57 100644
+--- a/drivers/scsi/pm8001/pm80xx_hwi.c
++++ b/drivers/scsi/pm8001/pm80xx_hwi.c
+@@ -3485,13 +3485,13 @@ static int mpi_phy_start_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
+       pm8001_dbg(pm8001_ha, INIT,
+                  "phy start resp status:0x%x, phyid:0x%x\n",
+                  status, phy_id);
+-      if (status == 0) {
++      if (status == 0)
+               phy->phy_state = PHY_LINK_DOWN;
+-              if (pm8001_ha->flags == PM8001F_RUN_TIME &&
+-                              phy->enable_completion != NULL) {
+-                      complete(phy->enable_completion);
+-                      phy->enable_completion = NULL;
+-              }
++
++      if (pm8001_ha->flags == PM8001F_RUN_TIME &&
++                      phy->enable_completion != NULL) {
++              complete(phy->enable_completion);
++              phy->enable_completion = NULL;
+       }
+       return 0;
+-- 
+2.30.2
+
diff --git a/queue-5.12/scsi-ufs-ufs-mediatek-fix-power-down-spec-violation.patch b/queue-5.12/scsi-ufs-ufs-mediatek-fix-power-down-spec-violation.patch
new file mode 100644 (file)
index 0000000..1180c3c
--- /dev/null
@@ -0,0 +1,55 @@
+From d809f3ac418b4c695fb299696d60c602f2266c1c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 12 May 2021 18:01:45 +0800
+Subject: scsi: ufs: ufs-mediatek: Fix power down spec violation
+
+From: Peter Wang <peter.wang@mediatek.com>
+
+[ Upstream commit c625b80b9d00f3546722cd77527f9697c8c4c911 ]
+
+As per spec, e.g. JESD220E chapter 7.2, while powering off the UFS device,
+RST_N signal should be between VSS(Ground) and VCCQ/VCCQ2. The power down
+sequence after fixing:
+
+Power down:
+
+ 1. Assert RST_N low
+
+ 2. Turn-off VCC
+
+ 3. Turn-off VCCQ/VCCQ2
+
+Link: https://lore.kernel.org/r/1620813706-25331-1-git-send-email-peter.wang@mediatek.com
+Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
+Signed-off-by: Peter Wang <peter.wang@mediatek.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/ufs/ufs-mediatek.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
+index a981f261b304..aee3cfc7142a 100644
+--- a/drivers/scsi/ufs/ufs-mediatek.c
++++ b/drivers/scsi/ufs/ufs-mediatek.c
+@@ -922,6 +922,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm)
+ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
+ {
+       int err;
++      struct arm_smccc_res res;
+       if (ufshcd_is_link_hibern8(hba)) {
+               err = ufs_mtk_link_set_lpm(hba);
+@@ -941,6 +942,9 @@ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
+                       goto fail;
+       }
++      if (ufshcd_is_link_off(hba))
++              ufs_mtk_device_reset_ctrl(0, res);
++
+       return 0;
+ fail:
+       /*
+-- 
+2.30.2
+
diff --git a/queue-5.12/serial-max310x-unregister-uart-driver-in-case-of-fai.patch b/queue-5.12/serial-max310x-unregister-uart-driver-in-case-of-fai.patch
new file mode 100644 (file)
index 0000000..baf1be3
--- /dev/null
@@ -0,0 +1,49 @@
+From 19cbe18947f189518dbd85fe3ea49e627ae82047 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 May 2021 13:56:38 +0200
+Subject: serial: max310x: unregister uart driver in case of failure and abort
+
+From: Atul Gopinathan <atulgopinathan@gmail.com>
+
+[ Upstream commit 3890e3dea315f1a257d1b940a2a4e2fa16a7b095 ]
+
+The macro "spi_register_driver" invokes the function
+"__spi_register_driver()" which has a return type of int and can fail,
+returning a negative value in such a case. This is currently ignored and
+the init() function yields success even if the spi driver failed to
+register.
+
+Fix this by collecting the return value of "__spi_register_driver()" and
+also unregister the uart driver in case of failure.
+
+Cc: Jiri Slaby <jirislaby@kernel.org>
+Signed-off-by: Atul Gopinathan <atulgopinathan@gmail.com>
+Link: https://lore.kernel.org/r/20210503115736.2104747-12-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/tty/serial/max310x.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
+index 93f69b66b896..43e55e6abea6 100644
+--- a/drivers/tty/serial/max310x.c
++++ b/drivers/tty/serial/max310x.c
+@@ -1518,10 +1518,12 @@ static int __init max310x_uart_init(void)
+               return ret;
+ #ifdef CONFIG_SPI_MASTER
+-      spi_register_driver(&max310x_spi_driver);
++      ret = spi_register_driver(&max310x_spi_driver);
++      if (ret)
++              uart_unregister_driver(&max310x_uart);
+ #endif
+-      return 0;
++      return ret;
+ }
+ module_init(max310x_uart_init);
+-- 
+2.30.2
+
index 476805eb94cc4aa465f3db41a1d7589ce3185039..2d6c4c202b8c619e5d95be8d9a20a683eaba2569 100644 (file)
@@ -158,3 +158,63 @@ nvmet-tcp-fix-inline-data-size-comparison-in-nvmet_tcp_queue_response.patch
 mptcp-avoid-error-message-on-infinite-mapping.patch
 mptcp-fix-data-stream-corruption.patch
 mptcp-drop-unconditional-pr_warn-on-bad-opt.patch
+platform-x86-hp_accel-avoid-invoking-_ini-to-speed-u.patch
+gpio-cadence-add-missing-module_device_table.patch
+revert-crypto-cavium-nitrox-add-an-error-message-to-.patch
+revert-media-usb-gspca-add-a-missed-check-for-goto_l.patch
+revert-alsa-sb-fix-a-missing-check-of-snd_ctl_add.patch
+revert-serial-max310x-pass-return-value-of-spi_regis.patch
+serial-max310x-unregister-uart-driver-in-case-of-fai.patch
+revert-net-fujitsu-fix-a-potential-null-pointer-dere.patch
+net-fujitsu-fix-potential-null-ptr-deref.patch
+revert-net-smc-fix-a-null-pointer-dereference.patch
+net-smc-properly-handle-workqueue-allocation-failure.patch
+revert-net-caif-replace-bug_on-with-recovery-code.patch
+net-caif-remove-bug_on-dev-null-in-caif_xmit.patch
+revert-char-hpet-fix-a-missing-check-of-ioremap.patch
+char-hpet-add-checks-after-calling-ioremap.patch
+revert-alsa-gus-add-a-check-of-the-status-of-snd_ctl.patch
+alsa-sb8-add-a-comment-note-regarding-an-unused-poin.patch
+revert-alsa-usx2y-fix-potential-null-pointer-derefer.patch
+revert-isdn-misdninfineon-fix-potential-null-pointer.patch
+isdn-misdninfineon-check-cleanup-ioremap-failure-cor.patch
+revert-ath6kl-return-error-code-in-ath6kl_wmi_set_ro.patch
+ath6kl-return-error-code-in-ath6kl_wmi_set_roam_lrss.patch
+revert-isdn-misdn-fix-potential-null-pointer-derefer.patch
+isdn-misdn-correctly-handle-ph_info-allocation-failu.patch
+revert-dmaengine-qcom_hidma-check-for-driver-registe.patch
+dmaengine-qcom_hidma-comment-platform_driver_registe.patch
+revert-libertas-add-checks-for-the-return-value-of-s.patch
+libertas-register-sysfs-groups-properly.patch
+revert-asoc-cs43130-fix-a-null-pointer-dereference.patch
+asoc-cs43130-handle-errors-in-cs43130_probe-properly.patch
+revert-media-dvb-add-check-on-sp8870_readreg.patch
+media-dvb-add-check-on-sp8870_readreg-return.patch
+revert-media-gspca-mt9m111-check-write_bridge-for-ti.patch
+media-gspca-mt9m111-check-write_bridge-for-timeout.patch
+revert-media-gspca-check-the-return-value-of-write_b.patch
+media-gspca-properly-check-for-errors-in-po1030_prob.patch
+revert-net-liquidio-fix-a-null-pointer-dereference.patch
+net-liquidio-add-missing-null-pointer-checks.patch
+revert-brcmfmac-add-a-check-for-the-status-of-usb_re.patch
+brcmfmac-properly-check-for-bus-register-errors.patch
+btrfs-return-whole-extents-in-fiemap.patch
+scsi-ufs-ufs-mediatek-fix-power-down-spec-violation.patch
+scsi-buslogic-fix-64-bit-system-enumeration-error-fo.patch
+openrisc-define-memory-barrier-mb.patch
+scsi-pm80xx-fix-drives-missing-during-rmmod-insmod-l.patch
+btrfs-release-path-before-starting-transaction-when-.patch
+btrfs-do-not-bug_on-in-link_to_fixup_dir.patch
+alsa-dice-disable-double_pcm_frames-mode-for-m-audio.patch
+platform-x86-hp-wireless-add-amd-s-hardware-id-to-th.patch
+platform-x86-intel_punit_ipc-append-module_device_ta.patch
+platform-x86-touchscreen_dmi-add-info-for-the-mediac.patch
+smb3-incorrect-file-id-in-requests-compounded-with-o.patch
+drm-amd-display-disconnect-non-dp-with-no-edid.patch
+drm-amd-amdgpu-fix-refcount-leak.patch
+drm-amdgpu-fix-a-use-after-free.patch
+drm-amd-amdgpu-fix-a-potential-deadlock-in-gpu-reset.patch
+drm-amdgpu-stop-touching-sched.ready-in-the-backend.patch
+platform-x86-touchscreen_dmi-add-info-for-the-chuwi-.patch
+block-fix-a-race-between-del_gendisk-and-blkrrpart.patch
+linux-bits.h-fix-compilation-error-with-genmask.patch
diff --git a/queue-5.12/smb3-incorrect-file-id-in-requests-compounded-with-o.patch b/queue-5.12/smb3-incorrect-file-id-in-requests-compounded-with-o.patch
new file mode 100644 (file)
index 0000000..1bdff54
--- /dev/null
@@ -0,0 +1,42 @@
+From 4dea0fd5ed54dcdb6ec433f0cea126bc5e706dc8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 15 May 2021 09:52:22 -0500
+Subject: SMB3: incorrect file id in requests compounded with open
+
+From: Steve French <stfrench@microsoft.com>
+
+[ Upstream commit c0d46717b95735b0eacfddbcca9df37a49de9c7a ]
+
+See MS-SMB2 3.2.4.1.4, file ids in compounded requests should be set to
+0xFFFFFFFFFFFFFFFF (we were treating it as u32 not u64 and setting
+it incorrectly).
+
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Reported-by: Stefan Metzmacher <metze@samba.org>
+Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/cifs/smb2pdu.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
+index 20b353429e69..7606ce344de5 100644
+--- a/fs/cifs/smb2pdu.c
++++ b/fs/cifs/smb2pdu.c
+@@ -3907,10 +3907,10 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
+                        * Related requests use info from previous read request
+                        * in chain.
+                        */
+-                      shdr->SessionId = 0xFFFFFFFF;
++                      shdr->SessionId = 0xFFFFFFFFFFFFFFFF;
+                       shdr->TreeId = 0xFFFFFFFF;
+-                      req->PersistentFileId = 0xFFFFFFFF;
+-                      req->VolatileFileId = 0xFFFFFFFF;
++                      req->PersistentFileId = 0xFFFFFFFFFFFFFFFF;
++                      req->VolatileFileId = 0xFFFFFFFFFFFFFFFF;
+               }
+       }
+       if (remaining_bytes > io_parms->length)
+-- 
+2.30.2
+