From: Greg Kroah-Hartman Date: Sun, 7 Feb 2021 15:37:39 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v4.4.257~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f72f12235b899ba2fa006c319c8b37373a295143;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: usb-host-xhci-mvebu-make-usb-3.0-phy-optional-for-armada-3720.patch usb-serial-cp210x-add-new-vid-pid-for-supporting-teraoka-ad2000.patch usb-serial-cp210x-add-pid-vid-for-wsda-200-usb.patch usb-serial-option-adding-support-for-cinterion-mv31.patch --- diff --git a/queue-5.10/usb-host-xhci-mvebu-make-usb-3.0-phy-optional-for-armada-3720.patch b/queue-5.10/usb-host-xhci-mvebu-make-usb-3.0-phy-optional-for-armada-3720.patch new file mode 100644 index 00000000000..379bc860fa2 --- /dev/null +++ b/queue-5.10/usb-host-xhci-mvebu-make-usb-3.0-phy-optional-for-armada-3720.patch @@ -0,0 +1,194 @@ +From 3241929b67d28c83945d3191c6816a3271fd6b85 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Mon, 1 Feb 2021 16:08:03 +0100 +Subject: usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +commit 3241929b67d28c83945d3191c6816a3271fd6b85 upstream. + +Older ATF does not provide SMC call for USB 3.0 phy power on functionality +and therefore initialization of xhci-hcd is failing when older version of +ATF is used. In this case phy_power_on() function returns -EOPNOTSUPP. + +[ 3.108467] mvebu-a3700-comphy d0018300.phy: unsupported SMC call, try updating your firmware +[ 3.117250] phy phy-d0018300.phy.0: phy poweron failed --> -95 +[ 3.123465] xhci-hcd: probe of d0058000.usb failed with error -95 + +This patch introduces a new plat_setup callback for xhci platform drivers +which is called prior calling usb_add_hcd() function. This function at its +beginning skips PHY init if hcd->skip_phy_initialization is set. + +Current init_quirk callback for xhci platform drivers is called from +xhci_plat_setup() function which is called after chip reset completes. +It happens in the middle of the usb_add_hcd() function and therefore this +callback cannot be used for setting if PHY init should be skipped or not. + +For Armada 3720 this patch introduce a new xhci_mvebu_a3700_plat_setup() +function configured as a xhci platform plat_setup callback. This new +function calls phy_power_on() and in case it returns -EOPNOTSUPP then +XHCI_SKIP_PHY_INIT quirk is set to instruct xhci-plat to skip PHY +initialization. + +This patch fixes above failure by ignoring 'not supported' error in +xhci-hcd driver. In this case it is expected that phy is already power on. + +It fixes initialization of xhci-hcd on Espressobin boards where is older +Marvell's Arm Trusted Firmware without SMC call for USB 3.0 phy power. + +This is regression introduced in commit bd3d25b07342 ("arm64: dts: marvell: +armada-37xx: link USB hosts with their PHYs") where USB 3.0 phy was defined +and therefore xhci-hcd on Espressobin with older ATF started failing. + +Fixes: bd3d25b07342 ("arm64: dts: marvell: armada-37xx: link USB hosts with their PHYs") +Cc: # 5.1+: ea17a0f153af: phy: marvell: comphy: Convert internal SMCC firmware return codes to errno +Cc: # 5.1+: f768e718911e: usb: host: xhci-plat: add priv quirk for skip PHY initialization +Tested-by: Tomasz Maciej Nowak +Tested-by: Yoshihiro Shimoda # On R-Car +Reviewed-by: Yoshihiro Shimoda # xhci-plat +Acked-by: Mathias Nyman +Signed-off-by: Pali Rohár +Link: https://lore.kernel.org/r/20210201150803.7305-1-pali@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-mvebu.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + drivers/usb/host/xhci-mvebu.h | 6 ++++++ + drivers/usb/host/xhci-plat.c | 20 +++++++++++++++++++- + drivers/usb/host/xhci-plat.h | 1 + + 4 files changed, 68 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-mvebu.c ++++ b/drivers/usb/host/xhci-mvebu.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -73,6 +74,47 @@ int xhci_mvebu_mbus_init_quirk(struct us + + return 0; + } ++ ++int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd) ++{ ++ struct xhci_hcd *xhci = hcd_to_xhci(hcd); ++ struct device *dev = hcd->self.controller; ++ struct phy *phy; ++ int ret; ++ ++ /* Old bindings miss the PHY handle */ ++ phy = of_phy_get(dev->of_node, "usb3-phy"); ++ if (IS_ERR(phy) && PTR_ERR(phy) == -EPROBE_DEFER) ++ return -EPROBE_DEFER; ++ else if (IS_ERR(phy)) ++ goto phy_out; ++ ++ ret = phy_init(phy); ++ if (ret) ++ goto phy_put; ++ ++ ret = phy_set_mode(phy, PHY_MODE_USB_HOST_SS); ++ if (ret) ++ goto phy_exit; ++ ++ ret = phy_power_on(phy); ++ if (ret == -EOPNOTSUPP) { ++ /* Skip initializatin of XHCI PHY when it is unsupported by firmware */ ++ dev_warn(dev, "PHY unsupported by firmware\n"); ++ xhci->quirks |= XHCI_SKIP_PHY_INIT; ++ } ++ if (ret) ++ goto phy_exit; ++ ++ phy_power_off(phy); ++phy_exit: ++ phy_exit(phy); ++phy_put: ++ of_phy_put(phy); ++phy_out: ++ ++ return 0; ++} + + int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd) + { +--- a/drivers/usb/host/xhci-mvebu.h ++++ b/drivers/usb/host/xhci-mvebu.h +@@ -12,12 +12,18 @@ struct usb_hcd; + + #if IS_ENABLED(CONFIG_USB_XHCI_MVEBU) + int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd); ++int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd); + int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd); + #else + static inline int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd) + { + return 0; + } ++ ++static inline int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd) ++{ ++ return 0; ++} + + static inline int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd) + { +--- a/drivers/usb/host/xhci-plat.c ++++ b/drivers/usb/host/xhci-plat.c +@@ -44,6 +44,16 @@ static void xhci_priv_plat_start(struct + priv->plat_start(hcd); + } + ++static int xhci_priv_plat_setup(struct usb_hcd *hcd) ++{ ++ struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); ++ ++ if (!priv->plat_setup) ++ return 0; ++ ++ return priv->plat_setup(hcd); ++} ++ + static int xhci_priv_init_quirk(struct usb_hcd *hcd) + { + struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); +@@ -111,6 +121,7 @@ static const struct xhci_plat_priv xhci_ + }; + + static const struct xhci_plat_priv xhci_plat_marvell_armada3700 = { ++ .plat_setup = xhci_mvebu_a3700_plat_setup, + .init_quirk = xhci_mvebu_a3700_init_quirk, + }; + +@@ -330,7 +341,14 @@ static int xhci_plat_probe(struct platfo + + hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node); + xhci->shared_hcd->tpl_support = hcd->tpl_support; +- if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT)) ++ ++ if (priv) { ++ ret = xhci_priv_plat_setup(hcd); ++ if (ret) ++ goto disable_usb_phy; ++ } ++ ++ if ((xhci->quirks & XHCI_SKIP_PHY_INIT) || (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))) + hcd->skip_phy_initialization = 1; + + if (priv && (priv->quirks & XHCI_SG_TRB_CACHE_SIZE_QUIRK)) +--- a/drivers/usb/host/xhci-plat.h ++++ b/drivers/usb/host/xhci-plat.h +@@ -13,6 +13,7 @@ + struct xhci_plat_priv { + const char *firmware_name; + unsigned long long quirks; ++ int (*plat_setup)(struct usb_hcd *); + void (*plat_start)(struct usb_hcd *); + int (*init_quirk)(struct usb_hcd *); + int (*suspend_quirk)(struct usb_hcd *); diff --git a/queue-5.10/usb-serial-cp210x-add-new-vid-pid-for-supporting-teraoka-ad2000.patch b/queue-5.10/usb-serial-cp210x-add-new-vid-pid-for-supporting-teraoka-ad2000.patch new file mode 100644 index 00000000000..8df9b0575f5 --- /dev/null +++ b/queue-5.10/usb-serial-cp210x-add-new-vid-pid-for-supporting-teraoka-ad2000.patch @@ -0,0 +1,31 @@ +From 43377df70480f82919032eb09832e9646a8a5efb Mon Sep 17 00:00:00 2001 +From: Chenxin Jin +Date: Wed, 13 Jan 2021 16:59:05 +0800 +Subject: USB: serial: cp210x: add new VID/PID for supporting Teraoka AD2000 + +From: Chenxin Jin + +commit 43377df70480f82919032eb09832e9646a8a5efb upstream. + +Teraoka AD2000 uses the CP210x driver, but the chip VID/PID is +customized with 0988/0578. We need the driver to support the new +VID/PID. + +Signed-off-by: Chenxin Jin +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/cp210x.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -64,6 +64,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ + { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ + { USB_DEVICE(0x0908, 0x01FF) }, /* Siemens RUGGEDCOM USB Serial Console */ ++ { USB_DEVICE(0x0988, 0x0578) }, /* Teraoka AD2000 */ + { USB_DEVICE(0x0B00, 0x3070) }, /* Ingenico 3070 */ + { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */ + { USB_DEVICE(0x0BED, 0x1101) }, /* MEI series 2000 Combo Acceptor */ diff --git a/queue-5.10/usb-serial-cp210x-add-pid-vid-for-wsda-200-usb.patch b/queue-5.10/usb-serial-cp210x-add-pid-vid-for-wsda-200-usb.patch new file mode 100644 index 00000000000..a23be185c8c --- /dev/null +++ b/queue-5.10/usb-serial-cp210x-add-pid-vid-for-wsda-200-usb.patch @@ -0,0 +1,32 @@ +From 3c4f6ecd93442f4376a58b38bb40ee0b8c46e0e6 Mon Sep 17 00:00:00 2001 +From: Pho Tran +Date: Mon, 25 Jan 2021 09:26:54 +0000 +Subject: USB: serial: cp210x: add pid/vid for WSDA-200-USB + +From: Pho Tran + +commit 3c4f6ecd93442f4376a58b38bb40ee0b8c46e0e6 upstream. + +Information pid/vid of WSDA-200-USB, Lord corporation company: +vid: 199b +pid: ba30 + +Signed-off-by: Pho Tran +[ johan: amend comment with product name ] +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/cp210x.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -204,6 +204,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ + { USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */ + { USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */ ++ { USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */ + { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ + { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ + { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ diff --git a/queue-5.10/usb-serial-option-adding-support-for-cinterion-mv31.patch b/queue-5.10/usb-serial-option-adding-support-for-cinterion-mv31.patch new file mode 100644 index 00000000000..4a028cca0c4 --- /dev/null +++ b/queue-5.10/usb-serial-option-adding-support-for-cinterion-mv31.patch @@ -0,0 +1,70 @@ +From e478d6029dca9d8462f426aee0d32896ef64f10f Mon Sep 17 00:00:00 2001 +From: Christoph Schemmel +Date: Wed, 27 Jan 2021 20:58:46 +0100 +Subject: USB: serial: option: Adding support for Cinterion MV31 + +From: Christoph Schemmel + +commit e478d6029dca9d8462f426aee0d32896ef64f10f upstream. + +Adding support for Cinterion device MV31 for enumeration with +PID 0x00B3 and 0x00B7. + +usb-devices output for 0x00B3 +T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 6 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 +P: Vendor=1e2d ProdID=00b3 Rev=04.14 +S: Manufacturer=Cinterion +S: Product=Cinterion PID 0x00B3 USB Mobile Broadband +S: SerialNumber=b3246eed +C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA +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=00 Prot=00 Driver=option +I: If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=cdc_wdm +I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option + +usb-devices output for 0x00B7 +T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 +P: Vendor=1e2d ProdID=00b7 Rev=04.14 +S: Manufacturer=Cinterion +S: Product=Cinterion PID 0x00B3 USB Mobile Broadband +S: SerialNumber=b3246eed +C: #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=896mA +I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan +I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#=0x3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option + +Signed-off-by: Christoph Schemmel +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -425,6 +425,8 @@ static void option_instat_callback(struc + #define CINTERION_PRODUCT_AHXX_2RMNET 0x0084 + #define CINTERION_PRODUCT_AHXX_AUDIO 0x0085 + #define CINTERION_PRODUCT_CLS8 0x00b0 ++#define CINTERION_PRODUCT_MV31_MBIM 0x00b3 ++#define CINTERION_PRODUCT_MV31_RMNET 0x00b7 + + /* Olivetti products */ + #define OLIVETTI_VENDOR_ID 0x0b3c +@@ -1914,6 +1916,10 @@ static const struct usb_device_id option + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_MBIM, 0xff), ++ .driver_info = RSVD(3)}, ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff), ++ .driver_info = RSVD(0)}, + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100), + .driver_info = RSVD(4) }, + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),