History

Merge tag 'usb-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB / Thunderbolt fixes from Greg KH: "Here are some small bugfixes and new device ids for USB and Thunderbolt drivers for 6.7-rc7. Included in here are: - new usb-serial device ids - thunderbolt driver fixes - typec driver fix - usb-storage driver quirk added - fotg210 driver fix All of these have been in linux-next with no reported issues" * tag 'usb-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: option: add Quectel EG912Y module support USB: serial: ftdi_sio: update Actisense PIDs constant names usb: fotg210-hcd: delete an incorrect bounds test usb-storage: Add quirk for incorrect WP on Kingston DT Ultimate 3.0 G3 usb: typec: ucsi: fix gpio-based orientation detection net: usb: ax88179_178a: avoid failed operations when device is disconnected USB: serial: option: add Quectel RM500Q R13 firmware support USB: serial: option: add Foxconn T99W265 with new baseline thunderbolt: Fix minimum allocated USB 3.x and PCIe bandwidth thunderbolt: Fix memory leak in margining_port_remove()

Linus Torvalds committed 2 years ago

Commit 4b2ee6d2 parents a0652eb ab241a09 files · +49 −19Browse files

Unified · Split

9 files
  1. drivers/net/usb/ax88179_178a.c +20 −3
  2. drivers/thunderbolt/debugfs.c +1 −1
  3. drivers/thunderbolt/usb4.c +5 −5
  4. drivers/usb/fotg210/fotg210-hcd.c +0 −3
  5. drivers/usb/serial/ftdi_sio.c +3 −3
  6. drivers/usb/serial/ftdi_sio_ids.h +3 −3
  7. drivers/usb/serial/option.c +5 −0
  8. drivers/usb/storage/unusual_devs.h +11 −0
  9. drivers/usb/typec/ucsi/ucsi_glink.c +1 −1
drivers/net/usb/ax88179_178a.c+20−3
@@ -173,6 +173,7 @@ struct ax88179_data { · 172 unmodified lines
173173 u8 in_pm;
174174 u32 wol_supported;
175175 u32 wolopts;
176+ u8 disconnecting;
176177 };
177178
178179 struct ax88179_int_data {
@@ -208,6 +209,7 @@ static int __ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, · 29 unmodified lines
208209 {
209210 int ret;
210211 int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
212+ struct ax88179_data *ax179_data = dev->driver_priv;
211213
212214 BUG_ON(!dev);
213215
@@ -219,7 +221,7 @@ static int __ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, · 5 unmodified lines
219221 ret = fn(dev, cmd, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
220222 value, index, data, size);
221223
222− if (unlikely(ret < 0))
224+ if (unlikely((ret < 0) && !(ret == -ENODEV && ax179_data->disconnecting)))
223225 netdev_warn(dev->net, "Failed to read reg index 0x%04x: %d\n",
224226 index, ret);
225227
@@ -231,6 +233,7 @@ static int __ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, · 5 unmodified lines
231233 {
232234 int ret;
233235 int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
236+ struct ax88179_data *ax179_data = dev->driver_priv;
234237
235238 BUG_ON(!dev);
236239
@@ -242,7 +245,7 @@ static int __ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, · 5 unmodified lines
242245 ret = fn(dev, cmd, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
243246 value, index, data, size);
244247
245− if (unlikely(ret < 0))
248+ if (unlikely((ret < 0) && !(ret == -ENODEV && ax179_data->disconnecting)))
246249 netdev_warn(dev->net, "Failed to write reg index 0x%04x: %d\n",
247250 index, ret);
248251
@@ -492,6 +495,20 @@ static int ax88179_resume(struct usb_interface *intf) · 243 unmodified lines
492495 return usbnet_resume(intf);
493496 }
494497
498+static void ax88179_disconnect(struct usb_interface *intf)
499+{
500+ struct usbnet *dev = usb_get_intfdata(intf);
501+ struct ax88179_data *ax179_data;
502+
503+ if (!dev)
504+ return;
505+
506+ ax179_data = dev->driver_priv;
507+ ax179_data->disconnecting = 1;
508+
509+ usbnet_disconnect(intf);
510+}
511+
495512 static void
496513 ax88179_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
497514 {
@@ -1906,7 +1923,7 @@ static struct usb_driver ax88179_178a_driver = { · 1408 unmodified lines
19061923 .suspend = ax88179_suspend,
19071924 .resume = ax88179_resume,
19081925 .reset_resume = ax88179_resume,
1909− .disconnect = usbnet_disconnect,
1926+ .disconnect = ax88179_disconnect,
19101927 .supports_autosuspend = 1,
19111928 .disable_hub_initiated_lpm = 1,
19121929 };
drivers/thunderbolt/debugfs.c+1−1
@@ -959,7 +959,7 @@ static void margining_port_remove(struct tb_port *port) · 958 unmodified lines
959959 snprintf(dir_name, sizeof(dir_name), "port%d", port->port);
960960 parent = debugfs_lookup(dir_name, port->sw->debugfs_dir);
961961 if (parent)
962− debugfs_remove_recursive(debugfs_lookup("margining", parent));
962+ debugfs_lookup_and_remove("margining", parent);
963963
964964 kfree(port->usb4->margining);
965965 port->usb4->margining = NULL;
drivers/thunderbolt/usb4.c+5−5
@@ -2311,13 +2311,13 @@ int usb4_usb3_port_release_bandwidth(struct tb_port *port, int *upstream_bw, · 2310 unmodified lines
23112311 goto err_request;
23122312
23132313 /*
2314− * Always keep 1000 Mb/s to make sure xHCI has at least some
2314+ * Always keep 900 Mb/s to make sure xHCI has at least some
23152315 * bandwidth available for isochronous traffic.
23162316 */
2317− if (consumed_up < 1000)
2318− consumed_up = 1000;
2319− if (consumed_down < 1000)
2320− consumed_down = 1000;
2317+ if (consumed_up < 900)
2318+ consumed_up = 900;
2319+ if (consumed_down < 900)
2320+ consumed_down = 900;
23212321
23222322 ret = usb4_usb3_port_write_allocated_bandwidth(port, consumed_up,
23232323 consumed_down);
drivers/usb/fotg210/fotg210-hcd.c+0−3
@@ -428,8 +428,6 @@ static void qh_lines(struct fotg210_hcd *fotg210, struct fotg210_qh *qh, · 427 unmodified lines
428428 temp = size;
429429 size -= temp;
430430 next += temp;
431− if (temp == size)
432− goto done;
433431 }
434432
435433 temp = snprintf(next, size, "\n");
@@ -439,7 +437,6 @@ static void qh_lines(struct fotg210_hcd *fotg210, struct fotg210_qh *qh, · 3 unmodified lines
439437 size -= temp;
440438 next += temp;
441439
442−done:
443440 *sizep = size;
444441 *nextp = next;
445442 }
drivers/usb/serial/ftdi_sio.c+3−3
@@ -1033,9 +1033,9 @@ static const struct usb_device_id id_table_combined[] = { · 1032 unmodified lines
10331033 { USB_DEVICE(FTDI_VID, ACTISENSE_USG_PID) },
10341034 { USB_DEVICE(FTDI_VID, ACTISENSE_NGT_PID) },
10351035 { USB_DEVICE(FTDI_VID, ACTISENSE_NGW_PID) },
1036− { USB_DEVICE(FTDI_VID, ACTISENSE_D9AC_PID) },
1037− { USB_DEVICE(FTDI_VID, ACTISENSE_D9AD_PID) },
1038− { USB_DEVICE(FTDI_VID, ACTISENSE_D9AE_PID) },
1036+ { USB_DEVICE(FTDI_VID, ACTISENSE_UID_PID) },
1037+ { USB_DEVICE(FTDI_VID, ACTISENSE_USA_PID) },
1038+ { USB_DEVICE(FTDI_VID, ACTISENSE_NGX_PID) },
10391039 { USB_DEVICE(FTDI_VID, ACTISENSE_D9AF_PID) },
10401040 { USB_DEVICE(FTDI_VID, CHETCO_SEAGAUGE_PID) },
10411041 { USB_DEVICE(FTDI_VID, CHETCO_SEASWITCH_PID) },
drivers/usb/serial/ftdi_sio_ids.h+3−3
@@ -1568,9 +1568,9 @@ · 1567 unmodified lines
15681568 #define ACTISENSE_USG_PID 0xD9A9 /* USG USB Serial Adapter */
15691569 #define ACTISENSE_NGT_PID 0xD9AA /* NGT NMEA2000 Interface */
15701570 #define ACTISENSE_NGW_PID 0xD9AB /* NGW NMEA2000 Gateway */
1571−#define ACTISENSE_D9AC_PID 0xD9AC /* Actisense Reserved */
1572−#define ACTISENSE_D9AD_PID 0xD9AD /* Actisense Reserved */
1573−#define ACTISENSE_D9AE_PID 0xD9AE /* Actisense Reserved */
1571+#define ACTISENSE_UID_PID 0xD9AC /* USB Isolating Device */
1572+#define ACTISENSE_USA_PID 0xD9AD /* USB to Serial Adapter */
1573+#define ACTISENSE_NGX_PID 0xD9AE /* NGX NMEA2000 Gateway */
15741574 #define ACTISENSE_D9AF_PID 0xD9AF /* Actisense Reserved */
15751575 #define CHETCO_SEAGAUGE_PID 0xA548 /* SeaGauge USB Adapter */
15761576 #define CHETCO_SEASWITCH_PID 0xA549 /* SeaSwitch USB Adapter */
drivers/usb/serial/option.c+5−0
@@ -272,6 +272,7 @@ static void option_instat_callback(struct urb *urb); · 271 unmodified lines
272272 #define QUECTEL_PRODUCT_RM500Q 0x0800
273273 #define QUECTEL_PRODUCT_RM520N 0x0801
274274 #define QUECTEL_PRODUCT_EC200U 0x0901
275+#define QUECTEL_PRODUCT_EG912Y 0x6001
275276 #define QUECTEL_PRODUCT_EC200S_CN 0x6002
276277 #define QUECTEL_PRODUCT_EC200A 0x6005
277278 #define QUECTEL_PRODUCT_EM061K_LWW 0x6008
@@ -1232,6 +1233,7 @@ static const struct usb_device_id option_ids[] = { · 954 unmodified lines
12321233 { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, 0x0700, 0xff), /* BG95 */
12331234 .driver_info = RSVD(3) | ZLP },
12341235 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) },
1236+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0x40) },
12351237 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) },
12361238 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10),
12371239 .driver_info = ZLP },
@@ -1244,6 +1246,7 @@ static const struct usb_device_id option_ids[] = { · 6 unmodified lines
12441246 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) },
12451247 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
12461248 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
1249+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG912Y, 0xff, 0, 0) },
12471250 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) },
12481251
12491252 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
@@ -2242,6 +2245,8 @@ static const struct usb_device_id option_ids[] = { · 992 unmodified lines
22422245 .driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
22432246 { USB_DEVICE(0x0489, 0xe0b5), /* Foxconn T77W968 ESIM */
22442247 .driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
2248+ { USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe0da, 0xff), /* Foxconn T99W265 MBIM variant */
2249+ .driver_info = RSVD(3) | RSVD(5) },
22452250 { USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe0db, 0xff), /* Foxconn T99W265 MBIM */
22462251 .driver_info = RSVD(3) },
22472252 { USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe0ee, 0xff), /* Foxconn T99W368 MBIM */
drivers/usb/storage/unusual_devs.h+11−0
@@ -1305,6 +1305,17 @@ UNUSUAL_DEV( 0x090c, 0x6000, 0x0100, 0x0100, · 1304 unmodified lines
13051305 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
13061306 US_FL_INITIAL_READ10 ),
13071307
1308+/*
1309+ * Patch by Tasos Sahanidis <tasos@tasossah.com>
1310+ * This flash drive always shows up with write protect enabled
1311+ * during the first mode sense.
1312+ */
1313+UNUSUAL_DEV(0x0951, 0x1697, 0x0100, 0x0100,
1314+ "Kingston",
1315+ "DT Ultimate G3",
1316+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1317+ US_FL_NO_WP_DETECT),
1318+
13081319 /*
13091320 * This Pentax still camera is not conformant
13101321 * to the USB storage specification: -
drivers/usb/typec/ucsi/ucsi_glink.c+1−1
@@ -228,7 +228,7 @@ static void pmic_glink_ucsi_notify(struct work_struct *work) · 227 unmodified lines
228228
229229 con_num = UCSI_CCI_CONNECTOR(cci);
230230 if (con_num) {
231− if (con_num < PMIC_GLINK_MAX_PORTS &&
231+ if (con_num <= PMIC_GLINK_MAX_PORTS &&
232232 ucsi->port_orientation[con_num - 1]) {
233233 int orientation = gpiod_get_value(ucsi->port_orientation[con_num - 1]);
234234