From: Greg Kroah-Hartman Date: Mon, 6 Mar 2023 07:30:03 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v6.2.3~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2cf8c7bb24bac80bac1ba25d476c348de06ecef1;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: firmware-coreboot-framebuffer-ignore-reserved-pixel-color-bits.patch ipmi_ssif-rename-idle-state-and-check.patch rtc-pm8xxx-fix-set-alarm-race.patch wifi-rtl8xxxu-fixing-transmisison-failure-for-rtl8192eu.patch --- diff --git a/queue-5.10/firmware-coreboot-framebuffer-ignore-reserved-pixel-color-bits.patch b/queue-5.10/firmware-coreboot-framebuffer-ignore-reserved-pixel-color-bits.patch new file mode 100644 index 00000000000..13e37d61542 --- /dev/null +++ b/queue-5.10/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 +@@ -43,9 +43,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-5.10/ipmi_ssif-rename-idle-state-and-check.patch b/queue-5.10/ipmi_ssif-rename-idle-state-and-check.patch new file mode 100644 index 00000000000..a8dc280edf6 --- /dev/null +++ b/queue-5.10/ipmi_ssif-rename-idle-state-and-check.patch @@ -0,0 +1,193 @@ +From 8230831c43a328c2be6d28c65d3f77e14c59986b Mon Sep 17 00:00:00 2001 +From: Corey Minyard +Date: Wed, 25 Jan 2023 10:13:13 -0600 +Subject: ipmi_ssif: Rename idle state and check + +From: Corey Minyard + +commit 8230831c43a328c2be6d28c65d3f77e14c59986b upstream. + +Rename the SSIF_IDLE() to IS_SSIF_IDLE(), since that is more clear, and +rename SSIF_NORMAL to SSIF_IDLE, since that's more accurate. + +Cc: stable@vger.kernel.org +Signed-off-by: Corey Minyard +Signed-off-by: Greg Kroah-Hartman +--- + drivers/char/ipmi/ipmi_ssif.c | 46 +++++++++++++++++++++--------------------- + 1 file changed, 23 insertions(+), 23 deletions(-) + +--- a/drivers/char/ipmi/ipmi_ssif.c ++++ b/drivers/char/ipmi/ipmi_ssif.c +@@ -92,7 +92,7 @@ + #define SSIF_WATCH_WATCHDOG_TIMEOUT msecs_to_jiffies(250) + + enum ssif_intf_state { +- SSIF_NORMAL, ++ SSIF_IDLE, + SSIF_GETTING_FLAGS, + SSIF_GETTING_EVENTS, + SSIF_CLEARING_FLAGS, +@@ -100,8 +100,8 @@ enum ssif_intf_state { + /* FIXME - add watchdog stuff. */ + }; + +-#define SSIF_IDLE(ssif) ((ssif)->ssif_state == SSIF_NORMAL \ +- && (ssif)->curr_msg == NULL) ++#define IS_SSIF_IDLE(ssif) ((ssif)->ssif_state == SSIF_IDLE \ ++ && (ssif)->curr_msg == NULL) + + /* + * Indexes into stats[] in ssif_info below. +@@ -348,9 +348,9 @@ static void return_hosed_msg(struct ssif + + /* + * Must be called with the message lock held. This will release the +- * message lock. Note that the caller will check SSIF_IDLE and start a +- * new operation, so there is no need to check for new messages to +- * start in here. ++ * message lock. Note that the caller will check IS_SSIF_IDLE and ++ * start a new operation, so there is no need to check for new ++ * messages to start in here. + */ + static void start_clear_flags(struct ssif_info *ssif_info, unsigned long *flags) + { +@@ -367,7 +367,7 @@ static void start_clear_flags(struct ssi + + if (start_send(ssif_info, msg, 3) != 0) { + /* Error, just go to normal state. */ +- ssif_info->ssif_state = SSIF_NORMAL; ++ ssif_info->ssif_state = SSIF_IDLE; + } + } + +@@ -382,7 +382,7 @@ static void start_flag_fetch(struct ssif + mb[0] = (IPMI_NETFN_APP_REQUEST << 2); + mb[1] = IPMI_GET_MSG_FLAGS_CMD; + if (start_send(ssif_info, mb, 2) != 0) +- ssif_info->ssif_state = SSIF_NORMAL; ++ ssif_info->ssif_state = SSIF_IDLE; + } + + static void check_start_send(struct ssif_info *ssif_info, unsigned long *flags, +@@ -393,7 +393,7 @@ static void check_start_send(struct ssif + + flags = ipmi_ssif_lock_cond(ssif_info, &oflags); + ssif_info->curr_msg = NULL; +- ssif_info->ssif_state = SSIF_NORMAL; ++ ssif_info->ssif_state = SSIF_IDLE; + ipmi_ssif_unlock_cond(ssif_info, flags); + ipmi_free_smi_msg(msg); + } +@@ -407,7 +407,7 @@ static void start_event_fetch(struct ssi + + msg = ipmi_alloc_smi_msg(); + if (!msg) { +- ssif_info->ssif_state = SSIF_NORMAL; ++ ssif_info->ssif_state = SSIF_IDLE; + ipmi_ssif_unlock_cond(ssif_info, flags); + return; + } +@@ -430,7 +430,7 @@ static void start_recv_msg_fetch(struct + + msg = ipmi_alloc_smi_msg(); + if (!msg) { +- ssif_info->ssif_state = SSIF_NORMAL; ++ ssif_info->ssif_state = SSIF_IDLE; + ipmi_ssif_unlock_cond(ssif_info, flags); + return; + } +@@ -448,9 +448,9 @@ static void start_recv_msg_fetch(struct + + /* + * Must be called with the message lock held. This will release the +- * message lock. Note that the caller will check SSIF_IDLE and start a +- * new operation, so there is no need to check for new messages to +- * start in here. ++ * message lock. Note that the caller will check IS_SSIF_IDLE and ++ * start a new operation, so there is no need to check for new ++ * messages to start in here. + */ + static void handle_flags(struct ssif_info *ssif_info, unsigned long *flags) + { +@@ -466,7 +466,7 @@ static void handle_flags(struct ssif_inf + /* Events available. */ + start_event_fetch(ssif_info, flags); + else { +- ssif_info->ssif_state = SSIF_NORMAL; ++ ssif_info->ssif_state = SSIF_IDLE; + ipmi_ssif_unlock_cond(ssif_info, flags); + } + } +@@ -579,7 +579,7 @@ static void watch_timeout(struct timer_l + if (ssif_info->watch_timeout) { + mod_timer(&ssif_info->watch_timer, + jiffies + ssif_info->watch_timeout); +- if (SSIF_IDLE(ssif_info)) { ++ if (IS_SSIF_IDLE(ssif_info)) { + start_flag_fetch(ssif_info, flags); /* Releases lock */ + return; + } +@@ -782,7 +782,7 @@ static void msg_done_handler(struct ssif + } + + switch (ssif_info->ssif_state) { +- case SSIF_NORMAL: ++ case SSIF_IDLE: + ipmi_ssif_unlock_cond(ssif_info, flags); + if (!msg) + break; +@@ -800,7 +800,7 @@ static void msg_done_handler(struct ssif + * Error fetching flags, or invalid length, + * just give up for now. + */ +- ssif_info->ssif_state = SSIF_NORMAL; ++ ssif_info->ssif_state = SSIF_IDLE; + ipmi_ssif_unlock_cond(ssif_info, flags); + dev_warn(&ssif_info->client->dev, + "Error getting flags: %d %d, %x\n", +@@ -835,7 +835,7 @@ static void msg_done_handler(struct ssif + "Invalid response clearing flags: %x %x\n", + data[0], data[1]); + } +- ssif_info->ssif_state = SSIF_NORMAL; ++ ssif_info->ssif_state = SSIF_IDLE; + ipmi_ssif_unlock_cond(ssif_info, flags); + break; + +@@ -913,7 +913,7 @@ static void msg_done_handler(struct ssif + } + + flags = ipmi_ssif_lock_cond(ssif_info, &oflags); +- if (SSIF_IDLE(ssif_info) && !ssif_info->stopping) { ++ if (IS_SSIF_IDLE(ssif_info) && !ssif_info->stopping) { + if (ssif_info->req_events) + start_event_fetch(ssif_info, flags); + else if (ssif_info->req_flags) +@@ -1087,7 +1087,7 @@ static void start_next_msg(struct ssif_i + unsigned long oflags; + + restart: +- if (!SSIF_IDLE(ssif_info)) { ++ if (!IS_SSIF_IDLE(ssif_info)) { + ipmi_ssif_unlock_cond(ssif_info, flags); + return; + } +@@ -1310,7 +1310,7 @@ static void shutdown_ssif(void *send_inf + dev_set_drvdata(&ssif_info->client->dev, NULL); + + /* make sure the driver is not looking for flags any more. */ +- while (ssif_info->ssif_state != SSIF_NORMAL) ++ while (ssif_info->ssif_state != SSIF_IDLE) + schedule_timeout(1); + + ssif_info->stopping = true; +@@ -1882,7 +1882,7 @@ static int ssif_probe(struct i2c_client + } + + spin_lock_init(&ssif_info->lock); +- ssif_info->ssif_state = SSIF_NORMAL; ++ ssif_info->ssif_state = SSIF_IDLE; + timer_setup(&ssif_info->retry_timer, retry_timeout, 0); + timer_setup(&ssif_info->watch_timer, watch_timeout, 0); + diff --git a/queue-5.10/rtc-pm8xxx-fix-set-alarm-race.patch b/queue-5.10/rtc-pm8xxx-fix-set-alarm-race.patch new file mode 100644 index 00000000000..47ec3f40247 --- /dev/null +++ b/queue-5.10/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 +@@ -219,7 +219,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; +@@ -231,6 +230,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, +@@ -240,19 +244,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:m:s=%ptRt, y-m-d=%ptRdr\n", diff --git a/queue-5.10/series b/queue-5.10/series index dfa902c4b71..cb42049c4f3 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -328,3 +328,7 @@ drm-panel-orientation-quirks-add-quirk-for-lenovo-id.patch dm-thin-add-cond_resched-to-various-workqueue-loops.patch dm-cache-add-cond_resched-to-various-workqueue-loops.patch nfsd-zero-out-pointers-after-putting-nfsd_files-on-c.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 +ipmi_ssif-rename-idle-state-and-check.patch diff --git a/queue-5.10/wifi-rtl8xxxu-fixing-transmisison-failure-for-rtl8192eu.patch b/queue-5.10/wifi-rtl8xxxu-fixing-transmisison-failure-for-rtl8192eu.patch new file mode 100644 index 00000000000..3f1cf429a39 --- /dev/null +++ b/queue-5.10/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 +@@ -1671,6 +1671,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 = {