From: Greg Kroah-Hartman Date: Fri, 23 Sep 2022 17:29:00 +0000 (+0200) Subject: 5.19-stable patches X-Git-Tag: v4.9.330~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4bfa3b5bd76627e21b8c703ac7f547ae5aefae2;p=thirdparty%2Fkernel%2Fstable-queue.git 5.19-stable patches added patches: alsa-core-fix-double-free-at-snd_card_new.patch alsa-hda-tegra-set-depop-delay-for-tegra.patch drivers-base-fix-unsigned-comparison-to-1-in-cpumap_file_max_bytes.patch revert-alsa-usb-audio-split-endpoint-setups-for-hw_params-and-prepare.patch usb-core-fix-rst-error-in-hub.c.patch usb-serial-option-add-quectel-bg95-0x0203-composition.patch usb-serial-option-add-quectel-rm520n.patch --- diff --git a/queue-5.19/alsa-core-fix-double-free-at-snd_card_new.patch b/queue-5.19/alsa-core-fix-double-free-at-snd_card_new.patch new file mode 100644 index 00000000000..75bff36e29c --- /dev/null +++ b/queue-5.19/alsa-core-fix-double-free-at-snd_card_new.patch @@ -0,0 +1,65 @@ +From c3afa2a402d1ecefa59f88d55d9e765f52f75bd9 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 19 Sep 2022 14:35:16 +0200 +Subject: ALSA: core: Fix double-free at snd_card_new() + +From: Takashi Iwai + +commit c3afa2a402d1ecefa59f88d55d9e765f52f75bd9 upstream. + +During the code change to add the support for devres-managed card +instance, we put an explicit kfree(card) call at the error path in +snd_card_new(). This is needed for the early error path before the +card is initialized with the device, but is rather superfluous and +causes a double-free at the error path after the card instance is +initialized, as the destructor of the card object already contains a +kfree() call. + +This patch fixes the double-free situation by removing the superfluous +kfree(). Meanwhile we need to call kfree() explicitly for the early +error path, so it's added there instead. + +Fixes: e8ad415b7a55 ("ALSA: core: Add managed card creation") +Reported-by: Rondreis +Cc: +Link: https://lore.kernel.org/r/CAB7eexL1zBnB636hwS27d-LdPYZ_R1-5fJS_h=ZbCWYU=UPWJg@mail.gmail.com +Link: https://lore.kernel.org/r/20220919123516.28222-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/core/init.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/sound/core/init.c ++++ b/sound/core/init.c +@@ -178,10 +178,8 @@ int snd_card_new(struct device *parent, + return -ENOMEM; + + err = snd_card_init(card, parent, idx, xid, module, extra_size); +- if (err < 0) { +- kfree(card); +- return err; +- } ++ if (err < 0) ++ return err; /* card is freed by error handler */ + + *card_ret = card; + return 0; +@@ -231,7 +229,7 @@ int snd_devm_card_new(struct device *par + card->managed = true; + err = snd_card_init(card, parent, idx, xid, module, extra_size); + if (err < 0) { +- devres_free(card); ++ devres_free(card); /* in managed mode, we need to free manually */ + return err; + } + +@@ -293,6 +291,8 @@ static int snd_card_init(struct snd_card + mutex_unlock(&snd_card_mutex); + dev_err(parent, "cannot find the slot for index %d (range 0-%i), error: %d\n", + idx, snd_ecards_limit - 1, err); ++ if (!card->managed) ++ kfree(card); /* manually free here, as no destructor called */ + return err; + } + set_bit(idx, snd_cards_lock); /* lock it */ diff --git a/queue-5.19/alsa-hda-tegra-set-depop-delay-for-tegra.patch b/queue-5.19/alsa-hda-tegra-set-depop-delay-for-tegra.patch new file mode 100644 index 00000000000..5b736fafe66 --- /dev/null +++ b/queue-5.19/alsa-hda-tegra-set-depop-delay-for-tegra.patch @@ -0,0 +1,31 @@ +From 3c4d8c24fb6c44f426e447b04800b0ed61a7b5ae Mon Sep 17 00:00:00 2001 +From: Mohan Kumar +Date: Tue, 13 Sep 2022 11:06:41 +0530 +Subject: ALSA: hda/tegra: set depop delay for tegra + +From: Mohan Kumar + +commit 3c4d8c24fb6c44f426e447b04800b0ed61a7b5ae upstream. + +Reduce the suspend time by setting depop delay to 10ms for +tegra. + +Signed-off-by: Mohan Kumar +Cc: +Link: https://lore.kernel.org/r/20220913053641.23299-1-mkumard@nvidia.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_hdmi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -3984,6 +3984,7 @@ static int tegra_hdmi_init(struct hda_co + + generic_hdmi_init_per_pins(codec); + ++ codec->depop_delay = 10; + codec->patch_ops.build_pcms = tegra_hdmi_build_pcms; + spec->chmap.ops.chmap_cea_alloc_validate_get_type = + nvhdmi_chmap_cea_alloc_validate_get_type; diff --git a/queue-5.19/drivers-base-fix-unsigned-comparison-to-1-in-cpumap_file_max_bytes.patch b/queue-5.19/drivers-base-fix-unsigned-comparison-to-1-in-cpumap_file_max_bytes.patch new file mode 100644 index 00000000000..92024354ae2 --- /dev/null +++ b/queue-5.19/drivers-base-fix-unsigned-comparison-to-1-in-cpumap_file_max_bytes.patch @@ -0,0 +1,61 @@ +From d7f06bdd6ee87fbefa05af5f57361d85e7715b11 Mon Sep 17 00:00:00 2001 +From: Phil Auld +Date: Tue, 6 Sep 2022 16:35:42 -0400 +Subject: drivers/base: Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES + +From: Phil Auld + +commit d7f06bdd6ee87fbefa05af5f57361d85e7715b11 upstream. + +As PAGE_SIZE is unsigned long, -1 > PAGE_SIZE when NR_CPUS <= 3. +This leads to very large file sizes: + +topology$ ls -l +total 0 +-r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 core_cpus +-r--r--r-- 1 root root 4096 Sep 5 11:59 core_cpus_list +-r--r--r-- 1 root root 4096 Sep 5 10:58 core_id +-r--r--r-- 1 root root 18446744073709551615 Sep 5 10:10 core_siblings +-r--r--r-- 1 root root 4096 Sep 5 11:59 core_siblings_list +-r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 die_cpus +-r--r--r-- 1 root root 4096 Sep 5 11:59 die_cpus_list +-r--r--r-- 1 root root 4096 Sep 5 11:59 die_id +-r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 package_cpus +-r--r--r-- 1 root root 4096 Sep 5 11:59 package_cpus_list +-r--r--r-- 1 root root 4096 Sep 5 10:58 physical_package_id +-r--r--r-- 1 root root 18446744073709551615 Sep 5 10:10 thread_siblings +-r--r--r-- 1 root root 4096 Sep 5 11:59 thread_siblings_list + +Adjust the inequality to catch the case when NR_CPUS is configured +to a small value. + +Fixes: 7ee951acd31a ("drivers/base: fix userspace break from using bin_attributes for cpumap and cpulist") +Cc: Greg Kroah-Hartman +Cc: "Rafael J. Wysocki" +Cc: Yury Norov +Cc: stable@vger.kernel.org +Cc: feng xiangjun +Reported-by: feng xiangjun +Signed-off-by: Phil Auld +Signed-off-by: Yury Norov +Link: https://lore.kernel.org/r/20220906203542.1796629-1-pauld@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/cpumask.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/include/linux/cpumask.h ++++ b/include/linux/cpumask.h +@@ -1083,9 +1083,10 @@ cpumap_print_list_to_buf(char *buf, cons + * cover a worst-case of every other cpu being on one of two nodes for a + * very large NR_CPUS. + * +- * Use PAGE_SIZE as a minimum for smaller configurations. ++ * Use PAGE_SIZE as a minimum for smaller configurations while avoiding ++ * unsigned comparison to -1. + */ +-#define CPUMAP_FILE_MAX_BYTES ((((NR_CPUS * 9)/32 - 1) > PAGE_SIZE) \ ++#define CPUMAP_FILE_MAX_BYTES (((NR_CPUS * 9)/32 > PAGE_SIZE) \ + ? (NR_CPUS * 9)/32 - 1 : PAGE_SIZE) + #define CPULIST_FILE_MAX_BYTES (((NR_CPUS * 7)/2 > PAGE_SIZE) ? (NR_CPUS * 7)/2 : PAGE_SIZE) + diff --git a/queue-5.19/revert-alsa-usb-audio-split-endpoint-setups-for-hw_params-and-prepare.patch b/queue-5.19/revert-alsa-usb-audio-split-endpoint-setups-for-hw_params-and-prepare.patch new file mode 100644 index 00000000000..1e2f4a6d73f --- /dev/null +++ b/queue-5.19/revert-alsa-usb-audio-split-endpoint-setups-for-hw_params-and-prepare.patch @@ -0,0 +1,154 @@ +From 79764ec772bc1346441ae1c4b1f3bd1991d634e8 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 20 Sep 2022 13:39:29 +0200 +Subject: Revert "ALSA: usb-audio: Split endpoint setups for hw_params and prepare" + +From: Takashi Iwai + +commit 79764ec772bc1346441ae1c4b1f3bd1991d634e8 upstream. + +This reverts commit ff878b408a03bef5d610b7e2302702e16a53636e. + +Unfortunately the recent fix seems bringing another regressions with +PulseAudio / pipewire, at least for Steinberg and MOTU devices. + +As a temporary solution, do a straight revert. The issue for Android +will be revisited again later by another different fix (if any). + +Fixes: ff878b408a03 ("ALSA: usb-audio: Split endpoint setups for hw_params and prepare") +Cc: +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216500 +Link: https://lore.kernel.org/r/20220920113929.25162-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/endpoint.c | 23 ++++++++++++++--------- + sound/usb/endpoint.h | 6 ++---- + sound/usb/pcm.c | 14 ++++---------- + 3 files changed, 20 insertions(+), 23 deletions(-) + +--- a/sound/usb/endpoint.c ++++ b/sound/usb/endpoint.c +@@ -758,8 +758,7 @@ bool snd_usb_endpoint_compatible(struct + * The endpoint needs to be closed via snd_usb_endpoint_close() later. + * + * Note that this function doesn't configure the endpoint. The substream +- * needs to set it up later via snd_usb_endpoint_set_params() and +- * snd_usb_endpoint_prepare(). ++ * needs to set it up later via snd_usb_endpoint_configure(). + */ + struct snd_usb_endpoint * + snd_usb_endpoint_open(struct snd_usb_audio *chip, +@@ -1293,13 +1292,12 @@ out_of_memory: + /* + * snd_usb_endpoint_set_params: configure an snd_usb_endpoint + * +- * It's called either from hw_params callback. + * Determine the number of URBs to be used on this endpoint. + * An endpoint must be configured before it can be started. + * An endpoint that is already running can not be reconfigured. + */ +-int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, +- struct snd_usb_endpoint *ep) ++static int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, ++ struct snd_usb_endpoint *ep) + { + const struct audioformat *fmt = ep->cur_audiofmt; + int err; +@@ -1382,18 +1380,18 @@ static int init_sample_rate(struct snd_u + } + + /* +- * snd_usb_endpoint_prepare: Prepare the endpoint ++ * snd_usb_endpoint_configure: Configure the endpoint + * + * This function sets up the EP to be fully usable state. +- * It's called either from prepare callback. ++ * It's called either from hw_params or prepare callback. + * The function checks need_setup flag, and performs nothing unless needed, + * so it's safe to call this multiple times. + * + * This returns zero if unchanged, 1 if the configuration has changed, + * or a negative error code. + */ +-int snd_usb_endpoint_prepare(struct snd_usb_audio *chip, +- struct snd_usb_endpoint *ep) ++int snd_usb_endpoint_configure(struct snd_usb_audio *chip, ++ struct snd_usb_endpoint *ep) + { + bool iface_first; + int err = 0; +@@ -1414,6 +1412,9 @@ int snd_usb_endpoint_prepare(struct snd_ + if (err < 0) + goto unlock; + } ++ err = snd_usb_endpoint_set_params(chip, ep); ++ if (err < 0) ++ goto unlock; + goto done; + } + +@@ -1441,6 +1442,10 @@ int snd_usb_endpoint_prepare(struct snd_ + if (err < 0) + goto unlock; + ++ err = snd_usb_endpoint_set_params(chip, ep); ++ if (err < 0) ++ goto unlock; ++ + err = snd_usb_select_mode_quirk(chip, ep->cur_audiofmt); + if (err < 0) + goto unlock; +--- a/sound/usb/endpoint.h ++++ b/sound/usb/endpoint.h +@@ -17,10 +17,8 @@ snd_usb_endpoint_open(struct snd_usb_aud + bool is_sync_ep); + void snd_usb_endpoint_close(struct snd_usb_audio *chip, + struct snd_usb_endpoint *ep); +-int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, +- struct snd_usb_endpoint *ep); +-int snd_usb_endpoint_prepare(struct snd_usb_audio *chip, +- struct snd_usb_endpoint *ep); ++int snd_usb_endpoint_configure(struct snd_usb_audio *chip, ++ struct snd_usb_endpoint *ep); + int snd_usb_endpoint_get_clock_rate(struct snd_usb_audio *chip, int clock); + + bool snd_usb_endpoint_compatible(struct snd_usb_audio *chip, +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -443,17 +443,17 @@ static int configure_endpoints(struct sn + if (stop_endpoints(subs, false)) + sync_pending_stops(subs); + if (subs->sync_endpoint) { +- err = snd_usb_endpoint_prepare(chip, subs->sync_endpoint); ++ err = snd_usb_endpoint_configure(chip, subs->sync_endpoint); + if (err < 0) + return err; + } +- err = snd_usb_endpoint_prepare(chip, subs->data_endpoint); ++ err = snd_usb_endpoint_configure(chip, subs->data_endpoint); + if (err < 0) + return err; + snd_usb_set_format_quirk(subs, subs->cur_audiofmt); + } else { + if (subs->sync_endpoint) { +- err = snd_usb_endpoint_prepare(chip, subs->sync_endpoint); ++ err = snd_usb_endpoint_configure(chip, subs->sync_endpoint); + if (err < 0) + return err; + } +@@ -551,13 +551,7 @@ static int snd_usb_hw_params(struct snd_ + subs->cur_audiofmt = fmt; + mutex_unlock(&chip->mutex); + +- if (subs->sync_endpoint) { +- ret = snd_usb_endpoint_set_params(chip, subs->sync_endpoint); +- if (ret < 0) +- goto unlock; +- } +- +- ret = snd_usb_endpoint_set_params(chip, subs->data_endpoint); ++ ret = configure_endpoints(chip, subs); + + unlock: + if (ret < 0) diff --git a/queue-5.19/series b/queue-5.19/series index 367fc746904..a5659dd62e8 100644 --- a/queue-5.19/series +++ b/queue-5.19/series @@ -24,3 +24,10 @@ block-remove-queue_flag_dead.patch block-stop-setting-the-nomerges-flags-in-blk_cleanup.patch block-simplify-disk-shutdown.patch scsi-core-fix-a-use-after-free.patch +drivers-base-fix-unsigned-comparison-to-1-in-cpumap_file_max_bytes.patch +usb-core-fix-rst-error-in-hub.c.patch +usb-serial-option-add-quectel-bg95-0x0203-composition.patch +usb-serial-option-add-quectel-rm520n.patch +revert-alsa-usb-audio-split-endpoint-setups-for-hw_params-and-prepare.patch +alsa-core-fix-double-free-at-snd_card_new.patch +alsa-hda-tegra-set-depop-delay-for-tegra.patch diff --git a/queue-5.19/usb-core-fix-rst-error-in-hub.c.patch b/queue-5.19/usb-core-fix-rst-error-in-hub.c.patch new file mode 100644 index 00000000000..eb3aed8cb34 --- /dev/null +++ b/queue-5.19/usb-core-fix-rst-error-in-hub.c.patch @@ -0,0 +1,34 @@ +From 766a96dc558385be735a370db867e302c8f22153 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Thu, 1 Sep 2022 10:36:34 -0400 +Subject: USB: core: Fix RST error in hub.c + +From: Alan Stern + +commit 766a96dc558385be735a370db867e302c8f22153 upstream. + +A recent commit added an invalid RST expression to a kerneldoc comment +in hub.c. The fix is trivial. + +Fixes: 9c6d778800b9 ("USB: core: Prevent nested device-reset calls") +Cc: +Reported-by: Stephen Rothwell +Reviewed-by: Bagas Sanjaya +Signed-off-by: Alan Stern +Link: https://lore.kernel.org/r/YxDDcsLtRZ7c20pq@rowland.harvard.edu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/core/hub.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -6049,7 +6049,7 @@ re_enumerate: + * + * Return: The same as for usb_reset_and_verify_device(). + * However, if a reset is already in progress (for instance, if a +- * driver doesn't have pre_ or post_reset() callbacks, and while ++ * driver doesn't have pre_reset() or post_reset() callbacks, and while + * being unbound or re-bound during the ongoing reset its disconnect() + * or probe() routine tries to perform a second, nested reset), the + * routine returns -EINPROGRESS. diff --git a/queue-5.19/usb-serial-option-add-quectel-bg95-0x0203-composition.patch b/queue-5.19/usb-serial-option-add-quectel-bg95-0x0203-composition.patch new file mode 100644 index 00000000000..9cb7998916e --- /dev/null +++ b/queue-5.19/usb-serial-option-add-quectel-bg95-0x0203-composition.patch @@ -0,0 +1,59 @@ +From f8f67eff6847f9b8d753fa029723bcc54296055a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Carl=20Yin=28=E6=AE=B7=E5=BC=A0=E6=88=90=29?= + +Date: Fri, 2 Sep 2022 09:49:43 +0000 +Subject: USB: serial: option: add Quectel BG95 0x0203 composition + +From: Carl Yin(殷张成) + +commit f8f67eff6847f9b8d753fa029723bcc54296055a upstream. + +Add support for the following Quectel BG95 composition: + +0x0203: Diag + GNSS + Modem + ECM + +usb-devices output: +T: Bus=01 Lev=01 Prnt=01 Port=03 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=0203 Rev= 0.00 +S: Manufacturer=Quectel, Incorporated +S: Product=Quectel LPWA Module +S: SerialNumber=71d3a21b +C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA +A: FirstIf#= 3 IfCount= 2 Cls=02(comm.) Sub=00 Prot=00 +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 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= 2 Cls=ff(vend.) Sub=ff Prot=60 Driver=option +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=ff Prot=ff Driver=option +E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +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= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether +E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +I: If#= 4 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether +I:* If#= 4 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether +E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + +Signed-off-by: Carl Yin +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -1138,6 +1138,8 @@ static const struct usb_device_id option + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff), + .driver_info = NUMEP2 }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) }, ++ { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, 0x0203, 0xff), /* BG95-M3 */ ++ .driver_info = ZLP }, + { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), + .driver_info = RSVD(4) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), diff --git a/queue-5.19/usb-serial-option-add-quectel-rm520n.patch b/queue-5.19/usb-serial-option-add-quectel-rm520n.patch new file mode 100644 index 00000000000..6bb30fdacc7 --- /dev/null +++ b/queue-5.19/usb-serial-option-add-quectel-rm520n.patch @@ -0,0 +1,68 @@ +From d640c4cb8f2f933c0ca896541f9de7fb1ae245f4 Mon Sep 17 00:00:00 2001 +From: jerry meng +Date: Mon, 5 Sep 2022 14:35:33 +0800 +Subject: USB: serial: option: add Quectel RM520N + +From: jerry meng + +commit d640c4cb8f2f933c0ca896541f9de7fb1ae245f4 upstream. + +add support for Quectel RM520N which is based on Qualcomm SDX62 chip. + +0x0801: DIAG + NMEA + AT + MODEM + RMNET + +T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 10 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=2c7c ProdID=0801 Rev= 5.04 +S: Manufacturer=Quectel +S: Product=RM520N-GL +S: SerialNumber=384af524 +C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 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=88(I) Atr=03(Int.) MxPS= 8 Ivl=32ms +E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + +Signed-off-by: jerry meng +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 +@@ -256,6 +256,7 @@ static void option_instat_callback(struc + #define QUECTEL_PRODUCT_EM060K 0x030b + #define QUECTEL_PRODUCT_EM12 0x0512 + #define QUECTEL_PRODUCT_RM500Q 0x0800 ++#define QUECTEL_PRODUCT_RM520N 0x0801 + #define QUECTEL_PRODUCT_EC200S_CN 0x6002 + #define QUECTEL_PRODUCT_EC200T 0x6026 + #define QUECTEL_PRODUCT_RM500K 0x7001 +@@ -1161,6 +1162,9 @@ static const struct usb_device_id option + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), + .driver_info = ZLP }, ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0xff, 0x30) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0x40) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) },