From 8a306ecdacb2b89bb17a02f3cd2afb132a49956f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 2 Sep 2023 10:44:38 +0200 Subject: [PATCH] 5.4-stable patches added patches: arm-pxa-remove-use-of-symbol_get.patch hid-wacom-remove-the-battery-when-the-ekr-is-off.patch mmc-au1xmmc-force-non-modular-build-and-remove-symbol_get-usage.patch modules-only-allow-symbol_get-of-export_symbol_gpl-modules.patch net-enetc-use-export_symbol_gpl-for-enetc_phc_index.patch rtc-ds1685-use-export_symbol_gpl-for-ds1685_rtc_poweroff.patch staging-rtl8712-fix-race-condition.patch usb-serial-option-add-foxconn-t99w368-t99w373-product.patch usb-serial-option-add-quectel-em05g-variant-0x030e.patch --- .../arm-pxa-remove-use-of-symbol_get.patch | 73 +++++++++ ...move-the-battery-when-the-ekr-is-off.patch | 130 ++++++++++++++++ ...ar-build-and-remove-symbol_get-usage.patch | 139 ++++++++++++++++++ ...bol_get-of-export_symbol_gpl-modules.patch | 63 ++++++++ ...xport_symbol_gpl-for-enetc_phc_index.patch | 34 +++++ ...t_symbol_gpl-for-ds1685_rtc_poweroff.patch | 34 +++++ queue-5.4/series | 9 ++ .../staging-rtl8712-fix-race-condition.patch | 50 +++++++ ...-add-foxconn-t99w368-t99w373-product.patch | 66 +++++++++ ...ion-add-quectel-em05g-variant-0x030e.patch | 65 ++++++++ 10 files changed, 663 insertions(+) create mode 100644 queue-5.4/arm-pxa-remove-use-of-symbol_get.patch create mode 100644 queue-5.4/hid-wacom-remove-the-battery-when-the-ekr-is-off.patch create mode 100644 queue-5.4/mmc-au1xmmc-force-non-modular-build-and-remove-symbol_get-usage.patch create mode 100644 queue-5.4/modules-only-allow-symbol_get-of-export_symbol_gpl-modules.patch create mode 100644 queue-5.4/net-enetc-use-export_symbol_gpl-for-enetc_phc_index.patch create mode 100644 queue-5.4/rtc-ds1685-use-export_symbol_gpl-for-ds1685_rtc_poweroff.patch create mode 100644 queue-5.4/staging-rtl8712-fix-race-condition.patch create mode 100644 queue-5.4/usb-serial-option-add-foxconn-t99w368-t99w373-product.patch create mode 100644 queue-5.4/usb-serial-option-add-quectel-em05g-variant-0x030e.patch diff --git a/queue-5.4/arm-pxa-remove-use-of-symbol_get.patch b/queue-5.4/arm-pxa-remove-use-of-symbol_get.patch new file mode 100644 index 00000000000..cc2870bd21b --- /dev/null +++ b/queue-5.4/arm-pxa-remove-use-of-symbol_get.patch @@ -0,0 +1,73 @@ +From 0faa29c4207e6e29cfc81b427df60e326c37083a Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 1 Aug 2023 19:35:40 +0200 +Subject: ARM: pxa: remove use of symbol_get() + +From: Arnd Bergmann + +commit 0faa29c4207e6e29cfc81b427df60e326c37083a upstream. + +The spitz board file uses the obscure symbol_get() function +to optionally call a function from sharpsl_pm.c if that is +built. However, the two files are always built together +these days, and have been for a long time, so this can +be changed to a normal function call. + +Link: https://lore.kernel.org/lkml/20230731162639.GA9441@lst.de/ +Signed-off-by: Arnd Bergmann +Signed-off-by: Christoph Hellwig +Signed-off-by: Luis Chamberlain +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/mach-pxa/sharpsl_pm.c | 2 -- + arch/arm/mach-pxa/spitz.c | 14 +------------- + 2 files changed, 1 insertion(+), 15 deletions(-) + +--- a/arch/arm/mach-pxa/sharpsl_pm.c ++++ b/arch/arm/mach-pxa/sharpsl_pm.c +@@ -220,8 +220,6 @@ void sharpsl_battery_kick(void) + { + schedule_delayed_work(&sharpsl_bat, msecs_to_jiffies(125)); + } +-EXPORT_SYMBOL(sharpsl_battery_kick); +- + + static void sharpsl_battery_thread(struct work_struct *private_) + { +--- a/arch/arm/mach-pxa/spitz.c ++++ b/arch/arm/mach-pxa/spitz.c +@@ -9,7 +9,6 @@ + */ + + #include +-#include /* symbol_get ; symbol_put */ + #include + #include + #include +@@ -514,17 +513,6 @@ static struct pxa2xx_spi_chip spitz_ads7 + .gpio_cs = SPITZ_GPIO_ADS7846_CS, + }; + +-static void spitz_bl_kick_battery(void) +-{ +- void (*kick_batt)(void); +- +- kick_batt = symbol_get(sharpsl_battery_kick); +- if (kick_batt) { +- kick_batt(); +- symbol_put(sharpsl_battery_kick); +- } +-} +- + static struct corgi_lcd_platform_data spitz_lcdcon_info = { + .init_mode = CORGI_LCD_MODE_VGA, + .max_intensity = 0x2f, +@@ -532,7 +520,7 @@ static struct corgi_lcd_platform_data sp + .limit_mask = 0x0b, + .gpio_backlight_cont = SPITZ_GPIO_BACKLIGHT_CONT, + .gpio_backlight_on = SPITZ_GPIO_BACKLIGHT_ON, +- .kick_battery = spitz_bl_kick_battery, ++ .kick_battery = sharpsl_battery_kick, + }; + + static struct pxa2xx_spi_chip spitz_lcdcon_chip = { diff --git a/queue-5.4/hid-wacom-remove-the-battery-when-the-ekr-is-off.patch b/queue-5.4/hid-wacom-remove-the-battery-when-the-ekr-is-off.patch new file mode 100644 index 00000000000..a2f52fb9b07 --- /dev/null +++ b/queue-5.4/hid-wacom-remove-the-battery-when-the-ekr-is-off.patch @@ -0,0 +1,130 @@ +From 9ac6678b95b0dd9458a7a6869f46e51cd55a1d84 Mon Sep 17 00:00:00 2001 +From: Aaron Armstrong Skomra +Date: Tue, 25 Jul 2023 15:20:25 -0700 +Subject: HID: wacom: remove the battery when the EKR is off + +From: Aaron Armstrong Skomra + +commit 9ac6678b95b0dd9458a7a6869f46e51cd55a1d84 upstream. + +Currently the EKR battery remains even after we stop getting information +from the device. This can lead to a stale battery persisting indefinitely +in userspace. + +The remote sends a heartbeat every 10 seconds. Delete the battery if we +miss two heartbeats (after 21 seconds). Restore the battery once we see +a heartbeat again. + +Signed-off-by: Aaron Skomra +Signed-off-by: Aaron Armstrong Skomra +Reviewed-by: Jason Gerecke +Fixes: 9f1015d45f62 ("HID: wacom: EKR: attach the power_supply on first connection") +CC: stable@vger.kernel.org +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/wacom.h | 1 + + drivers/hid/wacom_sys.c | 25 +++++++++++++++++++++---- + drivers/hid/wacom_wac.c | 1 + + drivers/hid/wacom_wac.h | 1 + + 4 files changed, 24 insertions(+), 4 deletions(-) + +--- a/drivers/hid/wacom.h ++++ b/drivers/hid/wacom.h +@@ -153,6 +153,7 @@ struct wacom_remote { + struct input_dev *input; + bool registered; + struct wacom_battery battery; ++ ktime_t active_time; + } remotes[WACOM_MAX_REMOTES]; + }; + +--- a/drivers/hid/wacom_sys.c ++++ b/drivers/hid/wacom_sys.c +@@ -2529,6 +2529,18 @@ fail: + return; + } + ++static void wacom_remote_destroy_battery(struct wacom *wacom, int index) ++{ ++ struct wacom_remote *remote = wacom->remote; ++ ++ if (remote->remotes[index].battery.battery) { ++ devres_release_group(&wacom->hdev->dev, ++ &remote->remotes[index].battery.bat_desc); ++ remote->remotes[index].battery.battery = NULL; ++ remote->remotes[index].active_time = 0; ++ } ++} ++ + static void wacom_remote_destroy_one(struct wacom *wacom, unsigned int index) + { + struct wacom_remote *remote = wacom->remote; +@@ -2543,9 +2555,7 @@ static void wacom_remote_destroy_one(str + remote->remotes[i].registered = false; + spin_unlock_irqrestore(&remote->remote_lock, flags); + +- if (remote->remotes[i].battery.battery) +- devres_release_group(&wacom->hdev->dev, +- &remote->remotes[i].battery.bat_desc); ++ wacom_remote_destroy_battery(wacom, i); + + if (remote->remotes[i].group.name) + devres_release_group(&wacom->hdev->dev, +@@ -2553,7 +2563,6 @@ static void wacom_remote_destroy_one(str + + remote->remotes[i].serial = 0; + remote->remotes[i].group.name = NULL; +- remote->remotes[i].battery.battery = NULL; + wacom->led.groups[i].select = WACOM_STATUS_UNKNOWN; + } + } +@@ -2638,6 +2647,9 @@ static int wacom_remote_attach_battery(s + if (remote->remotes[index].battery.battery) + return 0; + ++ if (!remote->remotes[index].active_time) ++ return 0; ++ + if (wacom->led.groups[index].select == WACOM_STATUS_UNKNOWN) + return 0; + +@@ -2653,6 +2665,7 @@ static void wacom_remote_work(struct wor + { + struct wacom *wacom = container_of(work, struct wacom, remote_work); + struct wacom_remote *remote = wacom->remote; ++ ktime_t kt = ktime_get(); + struct wacom_remote_data data; + unsigned long flags; + unsigned int count; +@@ -2679,6 +2692,10 @@ static void wacom_remote_work(struct wor + serial = data.remote[i].serial; + if (data.remote[i].connected) { + ++ if (kt - remote->remotes[i].active_time > WACOM_REMOTE_BATTERY_TIMEOUT ++ && remote->remotes[i].active_time != 0) ++ wacom_remote_destroy_battery(wacom, i); ++ + if (remote->remotes[i].serial == serial) { + wacom_remote_attach_battery(wacom, i); + continue; +--- a/drivers/hid/wacom_wac.c ++++ b/drivers/hid/wacom_wac.c +@@ -1127,6 +1127,7 @@ static int wacom_remote_irq(struct wacom + if (index < 0 || !remote->remotes[index].registered) + goto out; + ++ remote->remotes[i].active_time = ktime_get(); + input = remote->remotes[index].input; + + input_report_key(input, BTN_0, (data[9] & 0x01)); +--- a/drivers/hid/wacom_wac.h ++++ b/drivers/hid/wacom_wac.h +@@ -15,6 +15,7 @@ + #define WACOM_NAME_MAX 64 + #define WACOM_MAX_REMOTES 5 + #define WACOM_STATUS_UNKNOWN 255 ++#define WACOM_REMOTE_BATTERY_TIMEOUT 21000000000ll + + /* packet length for individual models */ + #define WACOM_PKGLEN_BBFUN 9 diff --git a/queue-5.4/mmc-au1xmmc-force-non-modular-build-and-remove-symbol_get-usage.patch b/queue-5.4/mmc-au1xmmc-force-non-modular-build-and-remove-symbol_get-usage.patch new file mode 100644 index 00000000000..b66240f9262 --- /dev/null +++ b/queue-5.4/mmc-au1xmmc-force-non-modular-build-and-remove-symbol_get-usage.patch @@ -0,0 +1,139 @@ +From d4a5c59a955bba96b273ec1a5885bada24c56979 Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Tue, 1 Aug 2023 19:35:41 +0200 +Subject: mmc: au1xmmc: force non-modular build and remove symbol_get usage + +From: Christoph Hellwig + +commit d4a5c59a955bba96b273ec1a5885bada24c56979 upstream. + +au1xmmc is split somewhat awkwardly into the main mmc subsystem driver, +and callbacks in platform_data that sit under arch/mips/ and are +always built in. The latter than call mmc_detect_change through +symbol_get. Remove the use of symbol_get by requiring the driver +to be built in. In the future the interrupt handlers for card +insert/eject detection should probably be moved into the main driver, +and which point it can be built modular again. + +Signed-off-by: Christoph Hellwig +Acked-by: Manuel Lauss +Reviewed-by: Arnd Bergmann +[mcgrof: squashed in depends on MMC=y suggested by Arnd] +Signed-off-by: Luis Chamberlain +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/alchemy/devboards/db1000.c | 8 +------- + arch/mips/alchemy/devboards/db1200.c | 19 ++----------------- + arch/mips/alchemy/devboards/db1300.c | 10 +--------- + drivers/mmc/host/Kconfig | 5 +++-- + 4 files changed, 7 insertions(+), 35 deletions(-) + +--- a/arch/mips/alchemy/devboards/db1000.c ++++ b/arch/mips/alchemy/devboards/db1000.c +@@ -14,7 +14,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -167,12 +166,7 @@ static struct platform_device db1x00_aud + + static irqreturn_t db1100_mmc_cd(int irq, void *ptr) + { +- void (*mmc_cd)(struct mmc_host *, unsigned long); +- /* link against CONFIG_MMC=m */ +- mmc_cd = symbol_get(mmc_detect_change); +- mmc_cd(ptr, msecs_to_jiffies(500)); +- symbol_put(mmc_detect_change); +- ++ mmc_detect_change(ptr, msecs_to_jiffies(500)); + return IRQ_HANDLED; + } + +--- a/arch/mips/alchemy/devboards/db1200.c ++++ b/arch/mips/alchemy/devboards/db1200.c +@@ -10,7 +10,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -340,14 +339,7 @@ static irqreturn_t db1200_mmc_cd(int irq + + static irqreturn_t db1200_mmc_cdfn(int irq, void *ptr) + { +- void (*mmc_cd)(struct mmc_host *, unsigned long); +- +- /* link against CONFIG_MMC=m */ +- mmc_cd = symbol_get(mmc_detect_change); +- if (mmc_cd) { +- mmc_cd(ptr, msecs_to_jiffies(200)); +- symbol_put(mmc_detect_change); +- } ++ mmc_detect_change(ptr, msecs_to_jiffies(200)); + + msleep(100); /* debounce */ + if (irq == DB1200_SD0_INSERT_INT) +@@ -431,14 +423,7 @@ static irqreturn_t pb1200_mmc1_cd(int ir + + static irqreturn_t pb1200_mmc1_cdfn(int irq, void *ptr) + { +- void (*mmc_cd)(struct mmc_host *, unsigned long); +- +- /* link against CONFIG_MMC=m */ +- mmc_cd = symbol_get(mmc_detect_change); +- if (mmc_cd) { +- mmc_cd(ptr, msecs_to_jiffies(200)); +- symbol_put(mmc_detect_change); +- } ++ mmc_detect_change(ptr, msecs_to_jiffies(200)); + + msleep(100); /* debounce */ + if (irq == PB1200_SD1_INSERT_INT) +--- a/arch/mips/alchemy/devboards/db1300.c ++++ b/arch/mips/alchemy/devboards/db1300.c +@@ -17,7 +17,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -459,14 +458,7 @@ static irqreturn_t db1300_mmc_cd(int irq + + static irqreturn_t db1300_mmc_cdfn(int irq, void *ptr) + { +- void (*mmc_cd)(struct mmc_host *, unsigned long); +- +- /* link against CONFIG_MMC=m. We can only be called once MMC core has +- * initialized the controller, so symbol_get() should always succeed. +- */ +- mmc_cd = symbol_get(mmc_detect_change); +- mmc_cd(ptr, msecs_to_jiffies(200)); +- symbol_put(mmc_detect_change); ++ mmc_detect_change(ptr, msecs_to_jiffies(200)); + + msleep(100); /* debounce */ + if (irq == DB1300_SD1_INSERT_INT) +--- a/drivers/mmc/host/Kconfig ++++ b/drivers/mmc/host/Kconfig +@@ -466,11 +466,12 @@ config MMC_ALCOR + of Alcor Micro PCI-E card reader + + config MMC_AU1X +- tristate "Alchemy AU1XX0 MMC Card Interface support" ++ bool "Alchemy AU1XX0 MMC Card Interface support" + depends on MIPS_ALCHEMY ++ depends on MMC=y + help + This selects the AMD Alchemy(R) Multimedia card interface. +- If you have a Alchemy platform with a MMC slot, say Y or M here. ++ If you have a Alchemy platform with a MMC slot, say Y here. + + If unsure, say N. + diff --git a/queue-5.4/modules-only-allow-symbol_get-of-export_symbol_gpl-modules.patch b/queue-5.4/modules-only-allow-symbol_get-of-export_symbol_gpl-modules.patch new file mode 100644 index 00000000000..0490255135d --- /dev/null +++ b/queue-5.4/modules-only-allow-symbol_get-of-export_symbol_gpl-modules.patch @@ -0,0 +1,63 @@ +From 9011e49d54dcc7653ebb8a1e05b5badb5ecfa9f9 Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Tue, 1 Aug 2023 19:35:44 +0200 +Subject: modules: only allow symbol_get of EXPORT_SYMBOL_GPL modules + +From: Christoph Hellwig + +commit 9011e49d54dcc7653ebb8a1e05b5badb5ecfa9f9 upstream. + +It has recently come to my attention that nvidia is circumventing the +protection added in 262e6ae7081d ("modules: inherit +TAINT_PROPRIETARY_MODULE") by importing exports from their proprietary +modules into an allegedly GPL licensed module and then rexporting them. + +Given that symbol_get was only ever intended for tightly cooperating +modules using very internal symbols it is logical to restrict it to +being used on EXPORT_SYMBOL_GPL and prevent nvidia from costly DMCA +Circumvention of Access Controls law suites. + +All symbols except for four used through symbol_get were already exported +as EXPORT_SYMBOL_GPL, and the remaining four ones were switched over in +the preparation patches. + +Fixes: 262e6ae7081d ("modules: inherit TAINT_PROPRIETARY_MODULE") +Signed-off-by: Christoph Hellwig +Reviewed-by: Greg Kroah-Hartman +Signed-off-by: Luis Chamberlain +Signed-off-by: Greg Kroah-Hartman +--- + kernel/module.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -2291,15 +2291,26 @@ static void free_module(struct module *m + void *__symbol_get(const char *symbol) + { + struct module *owner; ++ enum mod_license license; + const struct kernel_symbol *sym; + + preempt_disable(); +- sym = find_symbol(symbol, &owner, NULL, NULL, true, true); +- if (sym && strong_try_module_get(owner)) ++ sym = find_symbol(symbol, &owner, NULL, &license, true, true); ++ if (!sym) ++ goto fail; ++ if (license != GPL_ONLY) { ++ pr_warn("failing symbol_get of non-GPLONLY symbol %s.\n", ++ symbol); ++ goto fail; ++ } ++ if (strong_try_module_get(owner)) + sym = NULL; + preempt_enable(); + + return sym ? (void *)kernel_symbol_value(sym) : NULL; ++fail: ++ preempt_enable(); ++ return NULL; + } + EXPORT_SYMBOL_GPL(__symbol_get); + diff --git a/queue-5.4/net-enetc-use-export_symbol_gpl-for-enetc_phc_index.patch b/queue-5.4/net-enetc-use-export_symbol_gpl-for-enetc_phc_index.patch new file mode 100644 index 00000000000..350c0fa550b --- /dev/null +++ b/queue-5.4/net-enetc-use-export_symbol_gpl-for-enetc_phc_index.patch @@ -0,0 +1,34 @@ +From 569820befb16ffc755ab7af71f4f08cc5f68f0fe Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Tue, 1 Aug 2023 19:35:42 +0200 +Subject: net: enetc: use EXPORT_SYMBOL_GPL for enetc_phc_index + +From: Christoph Hellwig + +commit 569820befb16ffc755ab7af71f4f08cc5f68f0fe upstream. + +enetc_phc_index is only used via symbol_get, which was only ever +intended for very internal symbols like this one. Use EXPORT_SYMBOL_GPL +for it so that symbol_get can enforce only being used on +EXPORT_SYMBOL_GPL symbols. + +Signed-off-by: Christoph Hellwig +Reviewed-by: Jakub Kicinski +Reviewed-by: Greg Kroah-Hartman +Signed-off-by: Luis Chamberlain +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c ++++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c +@@ -8,7 +8,7 @@ + #include "enetc.h" + + int enetc_phc_index = -1; +-EXPORT_SYMBOL(enetc_phc_index); ++EXPORT_SYMBOL_GPL(enetc_phc_index); + + static struct ptp_clock_info enetc_ptp_caps = { + .owner = THIS_MODULE, diff --git a/queue-5.4/rtc-ds1685-use-export_symbol_gpl-for-ds1685_rtc_poweroff.patch b/queue-5.4/rtc-ds1685-use-export_symbol_gpl-for-ds1685_rtc_poweroff.patch new file mode 100644 index 00000000000..fd9aef318c9 --- /dev/null +++ b/queue-5.4/rtc-ds1685-use-export_symbol_gpl-for-ds1685_rtc_poweroff.patch @@ -0,0 +1,34 @@ +From 95e7ebc6823170256a8ce19fad87912805bfa001 Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Tue, 1 Aug 2023 19:35:43 +0200 +Subject: rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff + +From: Christoph Hellwig + +commit 95e7ebc6823170256a8ce19fad87912805bfa001 upstream. + +ds1685_rtc_poweroff is only used externally via symbol_get, which was +only ever intended for very internal symbols like this one. Use +EXPORT_SYMBOL_GPL for it so that symbol_get can enforce only being used +on EXPORT_SYMBOL_GPL symbols. + +Signed-off-by: Christoph Hellwig +Acked-by: Joshua Kinard +Reviewed-by: Greg Kroah-Hartman +Signed-off-by: Luis Chamberlain +Signed-off-by: Greg Kroah-Hartman +--- + drivers/rtc/rtc-ds1685.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/rtc/rtc-ds1685.c ++++ b/drivers/rtc/rtc-ds1685.c +@@ -1437,7 +1437,7 @@ ds1685_rtc_poweroff(struct platform_devi + unreachable(); + } + } +-EXPORT_SYMBOL(ds1685_rtc_poweroff); ++EXPORT_SYMBOL_GPL(ds1685_rtc_poweroff); + /* ----------------------------------------------------------------------- */ + + diff --git a/queue-5.4/series b/queue-5.4/series index 855aaa0a040..d4906398fbe 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -1 +1,10 @@ erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch +arm-pxa-remove-use-of-symbol_get.patch +mmc-au1xmmc-force-non-modular-build-and-remove-symbol_get-usage.patch +net-enetc-use-export_symbol_gpl-for-enetc_phc_index.patch +rtc-ds1685-use-export_symbol_gpl-for-ds1685_rtc_poweroff.patch +modules-only-allow-symbol_get-of-export_symbol_gpl-modules.patch +usb-serial-option-add-quectel-em05g-variant-0x030e.patch +usb-serial-option-add-foxconn-t99w368-t99w373-product.patch +hid-wacom-remove-the-battery-when-the-ekr-is-off.patch +staging-rtl8712-fix-race-condition.patch diff --git a/queue-5.4/staging-rtl8712-fix-race-condition.patch b/queue-5.4/staging-rtl8712-fix-race-condition.patch new file mode 100644 index 00000000000..c19b5846ffb --- /dev/null +++ b/queue-5.4/staging-rtl8712-fix-race-condition.patch @@ -0,0 +1,50 @@ +From 1422b526fba994cf05fd288a152106563b875fce Mon Sep 17 00:00:00 2001 +From: Nam Cao +Date: Mon, 31 Jul 2023 13:06:20 +0200 +Subject: staging: rtl8712: fix race condition + +From: Nam Cao + +commit 1422b526fba994cf05fd288a152106563b875fce upstream. + +In probe function, request_firmware_nowait() is called to load firmware +asynchronously. At completion of firmware loading, register_netdev() is +called. However, a mutex needed by netdev is initialized after the call +to request_firmware_nowait(). Consequently, it can happen that +register_netdev() is called before the driver is ready. + +Move the mutex initialization into r8712_init_drv_sw(), which is called +before request_firmware_nowait(). + +Reported-by: syzbot+b08315e8cf5a78eed03c@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/linux-staging/000000000000d9d4560601b8e0d7@google.com/T/#u +Fixes: 8c213fa59199 ("staging: r8712u: Use asynchronous firmware loading") +Cc: stable +Signed-off-by: Nam Cao +Link: https://lore.kernel.org/r/20230731110620.116562-1-namcaov@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/rtl8712/os_intfs.c | 1 + + drivers/staging/rtl8712/usb_intf.c | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/rtl8712/os_intfs.c ++++ b/drivers/staging/rtl8712/os_intfs.c +@@ -323,6 +323,7 @@ int r8712_init_drv_sw(struct _adapter *p + mp871xinit(padapter); + init_default_value(padapter); + r8712_InitSwLeds(padapter); ++ mutex_init(&padapter->mutex_start); + return ret; + } + +--- a/drivers/staging/rtl8712/usb_intf.c ++++ b/drivers/staging/rtl8712/usb_intf.c +@@ -570,7 +570,6 @@ static int r871xu_drv_init(struct usb_in + if (rtl871x_load_fw(padapter)) + goto error; + spin_lock_init(&padapter->lock_rx_ff0_filter); +- mutex_init(&padapter->mutex_start); + return 0; + error: + usb_put_dev(udev); diff --git a/queue-5.4/usb-serial-option-add-foxconn-t99w368-t99w373-product.patch b/queue-5.4/usb-serial-option-add-foxconn-t99w368-t99w373-product.patch new file mode 100644 index 00000000000..863a93fb15e --- /dev/null +++ b/queue-5.4/usb-serial-option-add-foxconn-t99w368-t99w373-product.patch @@ -0,0 +1,66 @@ +From 4d9488b294e1f8353bbcadc4c7172a7f7490199b Mon Sep 17 00:00:00 2001 +From: Slark Xiao +Date: Wed, 23 Aug 2023 15:57:51 +0800 +Subject: USB: serial: option: add FOXCONN T99W368/T99W373 product + +From: Slark Xiao + +commit 4d9488b294e1f8353bbcadc4c7172a7f7490199b upstream. + +The difference of T99W368 and T99W373 is the chip solution. +T99W368 is designed based on Qualcomm SDX65 and T99W373 is SDX62. + +Test evidence as below: +T: Bus=01 Lev=02 Prnt=05 Port=00 Cnt=01 Dev#= 7 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=0489 ProdID=e0f0 Rev=05.04 +S: Manufacturer=FII +S: Product=OLYMPIC USB WWAN Adapter +S: SerialNumber=78ada8c4 +C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA +I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim +I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim +I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option +I: If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) +I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option +I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option + +T: Bus=01 Lev=02 Prnt=05 Port=00 Cnt=01 Dev#= 8 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=0489 ProdID=e0ee Rev=05.04 +S: Manufacturer=FII +S: Product=OLYMPIC USB WWAN Adapter +S: SerialNumber=78ada8d5 +C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA +I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim +I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim +I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option +I: If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) +I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option +I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option + +Both of them share the same port configuration: +0&1: MBIM, 2: Modem, 3:GNSS, 4:NMEA, 5:Diag +GNSS port don't use serial driver. + +Signed-off-by: Slark Xiao +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -2235,6 +2235,10 @@ static const struct usb_device_id option + .driver_info = RSVD(0) | RSVD(1) | RSVD(6) }, + { USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe0db, 0xff), /* Foxconn T99W265 MBIM */ + .driver_info = RSVD(3) }, ++ { USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe0ee, 0xff), /* Foxconn T99W368 MBIM */ ++ .driver_info = RSVD(3) }, ++ { USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe0f0, 0xff), /* Foxconn T99W373 MBIM */ ++ .driver_info = RSVD(3) }, + { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 (IOT version) */ + .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, + { USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */ diff --git a/queue-5.4/usb-serial-option-add-quectel-em05g-variant-0x030e.patch b/queue-5.4/usb-serial-option-add-quectel-em05g-variant-0x030e.patch new file mode 100644 index 00000000000..f2b9dc4d121 --- /dev/null +++ b/queue-5.4/usb-serial-option-add-quectel-em05g-variant-0x030e.patch @@ -0,0 +1,65 @@ +From 873854c02364ebb991fc06f7148c14dfb5419e1b Mon Sep 17 00:00:00 2001 +From: Martin Kohn +Date: Thu, 27 Jul 2023 22:23:00 +0000 +Subject: USB: serial: option: add Quectel EM05G variant (0x030e) + +From: Martin Kohn + +commit 873854c02364ebb991fc06f7148c14dfb5419e1b upstream. + +Add Quectel EM05G with product ID 0x030e. +Interface 4 is used for qmi. + +T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=2c7c ProdID=030e Rev= 3.18 +S: Manufacturer=Quectel +S: Product=Quectel EM05-G +C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan +E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms +E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + +Signed-off-by: Martin Kohn +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -259,6 +259,7 @@ static void option_instat_callback(struc + #define QUECTEL_PRODUCT_EM05G 0x030a + #define QUECTEL_PRODUCT_EM060K 0x030b + #define QUECTEL_PRODUCT_EM05G_CS 0x030c ++#define QUECTEL_PRODUCT_EM05GV2 0x030e + #define QUECTEL_PRODUCT_EM05CN_SG 0x0310 + #define QUECTEL_PRODUCT_EM05G_SG 0x0311 + #define QUECTEL_PRODUCT_EM05CN 0x0312 +@@ -1190,6 +1191,8 @@ static const struct usb_device_id option + .driver_info = RSVD(6) | ZLP }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_GR, 0xff), + .driver_info = RSVD(6) | ZLP }, ++ { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05GV2, 0xff), ++ .driver_info = RSVD(4) | ZLP }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_CS, 0xff), + .driver_info = RSVD(6) | ZLP }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_RS, 0xff), -- 2.47.3