From a332ecd8c3869966ba45d398d0a08775793594b5 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Mar 2023 08:29:41 +0100 Subject: [PATCH] 4.19-stable patches added patches: firmware-coreboot-framebuffer-ignore-reserved-pixel-color-bits.patch rtc-pm8xxx-fix-set-alarm-race.patch wifi-rtl8xxxu-fixing-transmisison-failure-for-rtl8192eu.patch --- ...fer-ignore-reserved-pixel-color-bits.patch | 52 +++++++++++++ .../rtc-pm8xxx-fix-set-alarm-race.patch | 74 +++++++++++++++++++ queue-4.19/series | 3 + ...g-transmisison-failure-for-rtl8192eu.patch | 36 +++++++++ 4 files changed, 165 insertions(+) create mode 100644 queue-4.19/firmware-coreboot-framebuffer-ignore-reserved-pixel-color-bits.patch create mode 100644 queue-4.19/rtc-pm8xxx-fix-set-alarm-race.patch create mode 100644 queue-4.19/wifi-rtl8xxxu-fixing-transmisison-failure-for-rtl8192eu.patch diff --git a/queue-4.19/firmware-coreboot-framebuffer-ignore-reserved-pixel-color-bits.patch b/queue-4.19/firmware-coreboot-framebuffer-ignore-reserved-pixel-color-bits.patch new file mode 100644 index 00000000000..af2cce6b22c --- /dev/null +++ b/queue-4.19/firmware-coreboot-framebuffer-ignore-reserved-pixel-color-bits.patch @@ -0,0 +1,52 @@ +From e6acaf25cba14661211bb72181c35dd13b24f5b3 Mon Sep 17 00:00:00 2001 +From: Alper Nebi Yasak +Date: Sun, 22 Jan 2023 22:04:31 +0300 +Subject: firmware: coreboot: framebuffer: Ignore reserved pixel color bits + +From: Alper Nebi Yasak + +commit e6acaf25cba14661211bb72181c35dd13b24f5b3 upstream. + +The coreboot framebuffer doesn't support transparency, its 'reserved' +bit field is merely padding for byte/word alignment of pixel colors [1]. +When trying to match the framebuffer to a simplefb format, the kernel +driver unnecessarily requires the format's transparency bit field to +exactly match this padding, even if the former is zero-width. + +Due to a coreboot bug [2] (fixed upstream), some boards misreport the +reserved field's size as equal to its position (0x18 for both on a +'Lick' Chromebook), and the driver fails to probe where it would have +otherwise worked fine with e.g. the a8r8g8b8 or x8r8g8b8 formats. + +Remove the transparency comparison with reserved bits. When the +bits-per-pixel and other color components match, transparency will +already be in a subset of the reserved field. Not forcing it to match +reserved bits allows the driver to work on the boards which misreport +the reserved field. It also enables using simplefb formats that don't +have transparency bits, although this doesn't currently happen due to +format support and ordering in linux/platform_data/simplefb.h. + +[1] https://review.coreboot.org/plugins/gitiles/coreboot/+/4.19/src/commonlib/include/commonlib/coreboot_tables.h#255 +[2] https://review.coreboot.org/plugins/gitiles/coreboot/+/4.13/src/drivers/intel/fsp2_0/graphics.c#82 + +Signed-off-by: Alper Nebi Yasak +Link: https://lore.kernel.org/r/20230122190433.195941-1-alpernebiyasak@gmail.com +Cc: Salvatore Bonaccorso +Signed-off-by: Greg Kroah-Hartman +--- + drivers/firmware/google/framebuffer-coreboot.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/firmware/google/framebuffer-coreboot.c ++++ b/drivers/firmware/google/framebuffer-coreboot.c +@@ -51,9 +51,7 @@ static int framebuffer_probe(struct core + fb->green_mask_pos == formats[i].green.offset && + fb->green_mask_size == formats[i].green.length && + fb->blue_mask_pos == formats[i].blue.offset && +- fb->blue_mask_size == formats[i].blue.length && +- fb->reserved_mask_pos == formats[i].transp.offset && +- fb->reserved_mask_size == formats[i].transp.length) ++ fb->blue_mask_size == formats[i].blue.length) + pdata.format = formats[i].name; + } + if (!pdata.format) diff --git a/queue-4.19/rtc-pm8xxx-fix-set-alarm-race.patch b/queue-4.19/rtc-pm8xxx-fix-set-alarm-race.patch new file mode 100644 index 00000000000..9befd7bb5bc --- /dev/null +++ b/queue-4.19/rtc-pm8xxx-fix-set-alarm-race.patch @@ -0,0 +1,74 @@ +From c88db0eff9722fc2b6c4d172a50471d20e08ecc6 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 2 Feb 2023 16:54:27 +0100 +Subject: rtc: pm8xxx: fix set-alarm race + +From: Johan Hovold + +commit c88db0eff9722fc2b6c4d172a50471d20e08ecc6 upstream. + +Make sure to disable the alarm before updating the four alarm time +registers to avoid spurious alarms during the update. + +Note that the disable needs to be done outside of the ctrl_reg_lock +section to prevent a racing alarm interrupt from disabling the newly set +alarm when the lock is released. + +Fixes: 9a9a54ad7aa2 ("drivers/rtc: add support for Qualcomm PMIC8xxx RTC") +Cc: stable@vger.kernel.org # 3.1 +Signed-off-by: Johan Hovold +Reviewed-by: David Collins +Link: https://lore.kernel.org/r/20230202155448.6715-2-johan+linaro@kernel.org +Signed-off-by: Alexandre Belloni +Signed-off-by: Greg Kroah-Hartman +--- + drivers/rtc/rtc-pm8xxx.c | 24 ++++++++++-------------- + 1 file changed, 10 insertions(+), 14 deletions(-) + +--- a/drivers/rtc/rtc-pm8xxx.c ++++ b/drivers/rtc/rtc-pm8xxx.c +@@ -229,7 +229,6 @@ static int pm8xxx_rtc_set_alarm(struct d + { + int rc, i; + u8 value[NUM_8_BIT_RTC_REGS]; +- unsigned int ctrl_reg; + unsigned long secs, irq_flags; + struct pm8xxx_rtc *rtc_dd = dev_get_drvdata(dev); + const struct pm8xxx_rtc_regs *regs = rtc_dd->regs; +@@ -241,6 +240,11 @@ static int pm8xxx_rtc_set_alarm(struct d + secs >>= 8; + } + ++ rc = regmap_update_bits(rtc_dd->regmap, regs->alarm_ctrl, ++ regs->alarm_en, 0); ++ if (rc) ++ return rc; ++ + spin_lock_irqsave(&rtc_dd->ctrl_reg_lock, irq_flags); + + rc = regmap_bulk_write(rtc_dd->regmap, regs->alarm_rw, value, +@@ -250,19 +254,11 @@ static int pm8xxx_rtc_set_alarm(struct d + goto rtc_rw_fail; + } + +- rc = regmap_read(rtc_dd->regmap, regs->alarm_ctrl, &ctrl_reg); +- if (rc) +- goto rtc_rw_fail; +- +- if (alarm->enabled) +- ctrl_reg |= regs->alarm_en; +- else +- ctrl_reg &= ~regs->alarm_en; +- +- rc = regmap_write(rtc_dd->regmap, regs->alarm_ctrl, ctrl_reg); +- if (rc) { +- dev_err(dev, "Write to RTC alarm control register failed\n"); +- goto rtc_rw_fail; ++ if (alarm->enabled) { ++ rc = regmap_update_bits(rtc_dd->regmap, regs->alarm_ctrl, ++ regs->alarm_en, regs->alarm_en); ++ if (rc) ++ goto rtc_rw_fail; + } + + dev_dbg(dev, "Alarm Set for h:r:s=%d:%d:%d, d/m/y=%d/%d/%d\n", diff --git a/queue-4.19/series b/queue-4.19/series index 47658318493..6a564cc861e 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -138,3 +138,6 @@ regulator-s5m8767-bounds-check-id-indexing-into-arra.patch pinctrl-at91-use-devm_kasprintf-to-avoid-potential-l.patch dm-thin-add-cond_resched-to-various-workqueue-loops.patch dm-cache-add-cond_resched-to-various-workqueue-loops.patch +wifi-rtl8xxxu-fixing-transmisison-failure-for-rtl8192eu.patch +firmware-coreboot-framebuffer-ignore-reserved-pixel-color-bits.patch +rtc-pm8xxx-fix-set-alarm-race.patch diff --git a/queue-4.19/wifi-rtl8xxxu-fixing-transmisison-failure-for-rtl8192eu.patch b/queue-4.19/wifi-rtl8xxxu-fixing-transmisison-failure-for-rtl8192eu.patch new file mode 100644 index 00000000000..4be08b2e0a9 --- /dev/null +++ b/queue-4.19/wifi-rtl8xxxu-fixing-transmisison-failure-for-rtl8192eu.patch @@ -0,0 +1,36 @@ +From c6015bf3ff1ffb3caa27eb913797438a0fc634a0 Mon Sep 17 00:00:00 2001 +From: Jun ASAKA +Date: Sat, 17 Dec 2022 11:06:59 +0800 +Subject: wifi: rtl8xxxu: fixing transmisison failure for rtl8192eu + +From: Jun ASAKA + +commit c6015bf3ff1ffb3caa27eb913797438a0fc634a0 upstream. + +Fixing transmission failure which results in +"authentication with ... timed out". This can be +fixed by disable the REG_TXPAUSE. + +Signed-off-by: Jun ASAKA +Reviewed-by: Ping-Ke Shih +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20221217030659.12577-1-JunASAKA@zzy040330.moe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c ++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c +@@ -1679,6 +1679,11 @@ static void rtl8192e_enable_rf(struct rt + val8 = rtl8xxxu_read8(priv, REG_PAD_CTRL1); + val8 &= ~BIT(0); + rtl8xxxu_write8(priv, REG_PAD_CTRL1, val8); ++ ++ /* ++ * Fix transmission failure of rtl8192e. ++ */ ++ rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00); + } + + struct rtl8xxxu_fileops rtl8192eu_fops = { -- 2.47.3