--- /dev/null
+From a31489d2a368d2f9225ed6a6f595c63bc7d10de8 Mon Sep 17 00:00:00 2001
+From: Edward Vear <edwardvear@gmail.com>
+Date: Tue, 27 Oct 2020 00:02:03 -0700
+Subject: Bluetooth: Fix attempting to set RPA timeout when unsupported
+
+From: Edward Vear <edwardvear@gmail.com>
+
+commit a31489d2a368d2f9225ed6a6f595c63bc7d10de8 upstream.
+
+During controller initialization, an LE Set RPA Timeout command is sent
+to the controller if supported. However, the value checked to determine
+if the command is supported is incorrect. Page 1921 of the Bluetooth
+Core Spec v5.2 shows that bit 2 of octet 35 of the Supported_Commands
+field corresponds to the LE Set RPA Timeout command, but currently
+bit 6 of octet 35 is checked. This patch checks the correct value
+instead.
+
+This issue led to the error seen in the following btmon output during
+initialization of an adapter (rtl8761b) and prevented initialization
+from completing.
+
+< HCI Command: LE Set Resolvable Private Address Timeout (0x08|0x002e) plen 2
+ Timeout: 900 seconds
+> HCI Event: Command Complete (0x0e) plen 4
+ LE Set Resolvable Private Address Timeout (0x08|0x002e) ncmd 2
+ Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a)
+= Close Index: 00:E0:4C:6B:E5:03
+
+The error did not appear when running with this patch.
+
+Signed-off-by: Edward Vear <edwardvear@gmail.com>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
+Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/bluetooth/hci_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/bluetooth/hci_core.c
++++ b/net/bluetooth/hci_core.c
+@@ -763,7 +763,7 @@ static int hci_init3_req(struct hci_requ
+ hci_req_add(req, HCI_OP_LE_CLEAR_RESOLV_LIST, 0, NULL);
+ }
+
+- if (hdev->commands[35] & 0x40) {
++ if (hdev->commands[35] & 0x04) {
+ __le16 rpa_timeout = cpu_to_le16(hdev->rpa_timeout);
+
+ /* Set RPA timeout */
--- /dev/null
+From 320d159e2d63a97a40f24cd6dfda5a57eec65b91 Mon Sep 17 00:00:00 2001
+From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
+Date: Fri, 18 Dec 2020 11:10:53 +0100
+Subject: dt-bindings: rtc: add reset-source property
+
+From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
+
+commit 320d159e2d63a97a40f24cd6dfda5a57eec65b91 upstream.
+
+Some RTCs, e.g. the pcf2127, can be used as a hardware watchdog. But
+if the reset pin is not actually wired up, the driver exposes a
+watchdog device that doesn't actually work.
+
+Provide a standard binding that can be used to indicate that a given
+RTC can perform a reset of the machine, similar to wakeup-source.
+
+Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
+Reviewed-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+Link: https://lore.kernel.org/r/20201218101054.25416-2-rasmus.villemoes@prevas.dk
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/devicetree/bindings/rtc/rtc.yaml | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/Documentation/devicetree/bindings/rtc/rtc.yaml
++++ b/Documentation/devicetree/bindings/rtc/rtc.yaml
+@@ -63,6 +63,11 @@ properties:
+ description:
+ Enables wake up of host system on alarm.
+
++ reset-source:
++ $ref: /schemas/types.yaml#/definitions/flag
++ description:
++ The RTC is able to reset the machine.
++
+ additionalProperties: true
+
+ ...
--- /dev/null
+From aa8c7db494d0a83ecae583aa193f1134ef25d506 Mon Sep 17 00:00:00 2001
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+Date: Tue, 29 Dec 2020 15:14:55 -0800
+Subject: kdev_t: always inline major/minor helper functions
+
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+
+commit aa8c7db494d0a83ecae583aa193f1134ef25d506 upstream.
+
+Silly GCC doesn't always inline these trivial functions.
+
+Fixes the following warning:
+
+ arch/x86/kernel/sys_ia32.o: warning: objtool: cp_stat64()+0xd8: call to new_encode_dev() with UACCESS enabled
+
+Link: https://lkml.kernel.org/r/984353b44a4484d86ba9f73884b7306232e25e30.1608737428.git.jpoimboe@redhat.com
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Reported-by: Randy Dunlap <rdunlap@infradead.org>
+Acked-by: Randy Dunlap <rdunlap@infradead.org> [build-tested]
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/kdev_t.h | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+--- a/include/linux/kdev_t.h
++++ b/include/linux/kdev_t.h
+@@ -21,61 +21,61 @@
+ })
+
+ /* acceptable for old filesystems */
+-static inline bool old_valid_dev(dev_t dev)
++static __always_inline bool old_valid_dev(dev_t dev)
+ {
+ return MAJOR(dev) < 256 && MINOR(dev) < 256;
+ }
+
+-static inline u16 old_encode_dev(dev_t dev)
++static __always_inline u16 old_encode_dev(dev_t dev)
+ {
+ return (MAJOR(dev) << 8) | MINOR(dev);
+ }
+
+-static inline dev_t old_decode_dev(u16 val)
++static __always_inline dev_t old_decode_dev(u16 val)
+ {
+ return MKDEV((val >> 8) & 255, val & 255);
+ }
+
+-static inline u32 new_encode_dev(dev_t dev)
++static __always_inline u32 new_encode_dev(dev_t dev)
+ {
+ unsigned major = MAJOR(dev);
+ unsigned minor = MINOR(dev);
+ return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
+ }
+
+-static inline dev_t new_decode_dev(u32 dev)
++static __always_inline dev_t new_decode_dev(u32 dev)
+ {
+ unsigned major = (dev & 0xfff00) >> 8;
+ unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
+ return MKDEV(major, minor);
+ }
+
+-static inline u64 huge_encode_dev(dev_t dev)
++static __always_inline u64 huge_encode_dev(dev_t dev)
+ {
+ return new_encode_dev(dev);
+ }
+
+-static inline dev_t huge_decode_dev(u64 dev)
++static __always_inline dev_t huge_decode_dev(u64 dev)
+ {
+ return new_decode_dev(dev);
+ }
+
+-static inline int sysv_valid_dev(dev_t dev)
++static __always_inline int sysv_valid_dev(dev_t dev)
+ {
+ return MAJOR(dev) < (1<<14) && MINOR(dev) < (1<<18);
+ }
+
+-static inline u32 sysv_encode_dev(dev_t dev)
++static __always_inline u32 sysv_encode_dev(dev_t dev)
+ {
+ return MINOR(dev) | (MAJOR(dev) << 18);
+ }
+
+-static inline unsigned sysv_major(u32 dev)
++static __always_inline unsigned sysv_major(u32 dev)
+ {
+ return (dev >> 18) & 0x3fff;
+ }
+
+-static inline unsigned sysv_minor(u32 dev)
++static __always_inline unsigned sysv_minor(u32 dev)
+ {
+ return dev & 0x3ffff;
+ }
--- /dev/null
+From alexdeucher@gmail.com Wed Jan 6 17:47:17 2021
+From: Alex Deucher <alexdeucher@gmail.com>
+Date: Tue, 5 Jan 2021 11:45:45 -0500
+Subject: Revert "drm/amd/display: Fix memory leaks in S3 resume"
+To: amd-gfx@lists.freedesktop.org
+Cc: Alex Deucher <alexander.deucher@amd.com>, Stylon Wang <stylon.wang@amd.com>, Harry Wentland <harry.wentland@amd.com>, Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>, Andre Tomt <andre@tomt.net>, Oleksandr Natalenko <oleksandr@natalenko.name>, stable@vger.kernel.org
+Message-ID: <20210105164545.963036-1-alexander.deucher@amd.com>
+
+From: Alex Deucher <alexdeucher@gmail.com>
+
+This reverts commit a135a1b4c4db1f3b8cbed9676a40ede39feb3362.
+
+This leads to blank screens on some boards after replugging a
+display. Revert until we understand the root cause and can
+fix both the leak and the blank screen after replug.
+
+Cc: Stylon Wang <stylon.wang@amd.com>
+Cc: Harry Wentland <harry.wentland@amd.com>
+Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Cc: Andre Tomt <andre@tomt.net>
+Cc: Oleksandr Natalenko <oleksandr@natalenko.name>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -2278,8 +2278,7 @@ void amdgpu_dm_update_connector_after_de
+
+ drm_connector_update_edid_property(connector,
+ aconnector->edid);
+- aconnector->num_modes = drm_add_edid_modes(connector, aconnector->edid);
+- drm_connector_list_update(connector);
++ drm_add_edid_modes(connector, aconnector->edid);
+
+ if (aconnector->dc_link->aux_mode)
+ drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
--- /dev/null
+From nbd@nbd.name Wed Jan 6 17:49:44 2021
+From: Felix Fietkau <nbd@nbd.name>
+Date: Tue, 5 Jan 2021 11:18:21 +0100
+Subject: Revert "mtd: spinand: Fix OOB read"
+To: stable@vger.kernel.org
+Cc: gregkh@linuxfoundation.org, Miquel Raynal <miquel.raynal@bootlin.com>
+Message-ID: <20210105101821.47138-1-nbd@nbd.name>
+
+From: Felix Fietkau <nbd@nbd.name>
+
+This reverts stable commit baad618d078c857f99cc286ea249e9629159901f.
+
+This commit is adding lines to spinand_write_to_cache_op, wheras the upstream
+commit 868cbe2a6dcee451bd8f87cbbb2a73cf463b57e5 that this was supposed to
+backport was touching spinand_read_from_cache_op.
+It causes a crash on writing OOB data by attempting to write to read-only
+kernel memory.
+
+Cc: Miquel Raynal <miquel.raynal@bootlin.com>
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mtd/nand/spi/core.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/drivers/mtd/nand/spi/core.c
++++ b/drivers/mtd/nand/spi/core.c
+@@ -318,10 +318,6 @@ static int spinand_write_to_cache_op(str
+ buf += ret;
+ }
+
+- if (req->ooblen)
+- memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
+- req->ooblen);
+-
+ return 0;
+ }
+
--- /dev/null
+From 5d78533a0c53af9659227c803df944ba27cd56e0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Thu, 24 Sep 2020 12:52:55 +0200
+Subject: rtc: pcf2127: move watchdog initialisation to a separate function
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+
+commit 5d78533a0c53af9659227c803df944ba27cd56e0 upstream.
+
+The obvious advantages are:
+
+ - The linker can drop the watchdog functions if CONFIG_WATCHDOG is off.
+ - All watchdog stuff grouped together with only a single function call
+ left in generic code.
+ - Watchdog register is only read when it is actually used.
+ - Less #ifdefery
+
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+Link: https://lore.kernel.org/r/20200924105256.18162-2-u.kleine-koenig@pengutronix.de
+Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-pcf2127.c | 56 +++++++++++++++++++++++++---------------------
+ 1 file changed, 31 insertions(+), 25 deletions(-)
+
+--- a/drivers/rtc/rtc-pcf2127.c
++++ b/drivers/rtc/rtc-pcf2127.c
+@@ -331,6 +331,36 @@ static const struct watchdog_ops pcf2127
+ .set_timeout = pcf2127_wdt_set_timeout,
+ };
+
++static int pcf2127_watchdog_init(struct device *dev, struct pcf2127 *pcf2127)
++{
++ u32 wdd_timeout;
++ int ret;
++
++ if (!IS_ENABLED(CONFIG_WATCHDOG))
++ return 0;
++
++ pcf2127->wdd.parent = dev;
++ pcf2127->wdd.info = &pcf2127_wdt_info;
++ pcf2127->wdd.ops = &pcf2127_watchdog_ops;
++ pcf2127->wdd.min_timeout = PCF2127_WD_VAL_MIN;
++ pcf2127->wdd.max_timeout = PCF2127_WD_VAL_MAX;
++ pcf2127->wdd.timeout = PCF2127_WD_VAL_DEFAULT;
++ pcf2127->wdd.min_hw_heartbeat_ms = 500;
++ pcf2127->wdd.status = WATCHDOG_NOWAYOUT_INIT_STATUS;
++
++ watchdog_set_drvdata(&pcf2127->wdd, pcf2127);
++
++ /* Test if watchdog timer is started by bootloader */
++ ret = regmap_read(pcf2127->regmap, PCF2127_REG_WD_VAL, &wdd_timeout);
++ if (ret)
++ return ret;
++
++ if (wdd_timeout)
++ set_bit(WDOG_HW_RUNNING, &pcf2127->wdd.status);
++
++ return devm_watchdog_register_device(dev, &pcf2127->wdd);
++}
++
+ /* Alarm */
+ static int pcf2127_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
+ {
+@@ -532,7 +562,6 @@ static int pcf2127_probe(struct device *
+ int alarm_irq, const char *name, bool has_nvmem)
+ {
+ struct pcf2127 *pcf2127;
+- u32 wdd_timeout;
+ int ret = 0;
+
+ dev_dbg(dev, "%s\n", __func__);
+@@ -571,17 +600,6 @@ static int pcf2127_probe(struct device *
+ pcf2127->rtc->ops = &pcf2127_rtc_alrm_ops;
+ }
+
+- pcf2127->wdd.parent = dev;
+- pcf2127->wdd.info = &pcf2127_wdt_info;
+- pcf2127->wdd.ops = &pcf2127_watchdog_ops;
+- pcf2127->wdd.min_timeout = PCF2127_WD_VAL_MIN;
+- pcf2127->wdd.max_timeout = PCF2127_WD_VAL_MAX;
+- pcf2127->wdd.timeout = PCF2127_WD_VAL_DEFAULT;
+- pcf2127->wdd.min_hw_heartbeat_ms = 500;
+- pcf2127->wdd.status = WATCHDOG_NOWAYOUT_INIT_STATUS;
+-
+- watchdog_set_drvdata(&pcf2127->wdd, pcf2127);
+-
+ if (has_nvmem) {
+ struct nvmem_config nvmem_cfg = {
+ .priv = pcf2127,
+@@ -611,19 +629,7 @@ static int pcf2127_probe(struct device *
+ return ret;
+ }
+
+- /* Test if watchdog timer is started by bootloader */
+- ret = regmap_read(pcf2127->regmap, PCF2127_REG_WD_VAL, &wdd_timeout);
+- if (ret)
+- return ret;
+-
+- if (wdd_timeout)
+- set_bit(WDOG_HW_RUNNING, &pcf2127->wdd.status);
+-
+-#ifdef CONFIG_WATCHDOG
+- ret = devm_watchdog_register_device(dev, &pcf2127->wdd);
+- if (ret)
+- return ret;
+-#endif /* CONFIG_WATCHDOG */
++ pcf2127_watchdog_init(dev, pcf2127);
+
+ /*
+ * Disable battery low/switch-over timestamp and interrupts.
--- /dev/null
+From 71ac13457d9d1007effde65b54818106b2c2b525 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Fri, 18 Dec 2020 11:10:54 +0100
+Subject: rtc: pcf2127: only use watchdog when explicitly available
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+
+commit 71ac13457d9d1007effde65b54818106b2c2b525 upstream.
+
+Most boards using the pcf2127 chip (in my bubble) don't make use of the
+watchdog functionality and the respective output is not connected. The
+effect on such a board is that there is a watchdog device provided that
+doesn't work.
+
+So only register the watchdog if the device tree has a "reset-source"
+property.
+
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+[RV: s/has-watchdog/reset-source/]
+Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
+Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+Link: https://lore.kernel.org/r/20201218101054.25416-3-rasmus.villemoes@prevas.dk
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-pcf2127.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/rtc/rtc-pcf2127.c
++++ b/drivers/rtc/rtc-pcf2127.c
+@@ -336,7 +336,8 @@ static int pcf2127_watchdog_init(struct
+ u32 wdd_timeout;
+ int ret;
+
+- if (!IS_ENABLED(CONFIG_WATCHDOG))
++ if (!IS_ENABLED(CONFIG_WATCHDOG) ||
++ !device_property_read_bool(dev, "reset-source"))
+ return 0;
+
+ pcf2127->wdd.parent = dev;
revert-drm-amd-display-fix-memory-leaks-in-s3-resume.patch
revert-mtd-spinand-fix-oob-read.patch
+rtc-pcf2127-move-watchdog-initialisation-to-a-separate-function.patch
+rtc-pcf2127-only-use-watchdog-when-explicitly-available.patch
+dt-bindings-rtc-add-reset-source-property.patch
+kdev_t-always-inline-major-minor-helper-functions.patch
+bluetooth-fix-attempting-to-set-rpa-timeout-when-unsupported.patch