Skip to content

Commit 0a0b96b

Browse files
committed
Merge tag 'usb-5.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are some small USB fixes for 5.7-rc5 to resolve some reported issues: - syzbot found problems fixed - usbfs dma mapping fix - typec bugfixs - chipidea bugfix - usb4/thunderbolt fix - new device ids/quirks All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: chipidea: msm: Ensure proper controller reset using role switch API usb: typec: mux: intel: Handle alt mode HPD_HIGH usb: usbfs: correct kernel->user page attribute mismatch usb: typec: intel_pmc_mux: Fix the property names USB: core: Fix misleading driver bug report USB: serial: qcserial: Add DW5816e support USB: uas: add quirk for LaCie 2Big Quadra thunderbolt: Check return value of tb_sw_read() in usb4_switch_op() USB: serial: garmin_gps: add sanity checking for data length
2 parents 775a8e0 + 91edf63 commit 0a0b96b

File tree

8 files changed

+24
-10
lines changed

8 files changed

+24
-10
lines changed

drivers/thunderbolt/usb4.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ static int usb4_switch_op(struct tb_switch *sw, u16 opcode, u8 *status)
182182
return ret;
183183

184184
ret = tb_sw_read(sw, &val, TB_CFG_SWITCH, ROUTER_CS_26, 1);
185+
if (ret)
186+
return ret;
187+
185188
if (val & ROUTER_CS_26_ONS)
186189
return -EOPNOTSUPP;
187190

drivers/usb/chipidea/ci_hdrc_msm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
114114
hw_write_id_reg(ci, HS_PHY_GENCONFIG_2,
115115
HS_PHY_ULPI_TX_PKT_EN_CLR_FIX, 0);
116116

117-
if (!IS_ERR(ci->platdata->vbus_extcon.edev)) {
117+
if (!IS_ERR(ci->platdata->vbus_extcon.edev) || ci->role_switch) {
118118
hw_write_id_reg(ci, HS_PHY_GENCONFIG_2,
119119
HS_PHY_SESS_VLD_CTRL_EN,
120120
HS_PHY_SESS_VLD_CTRL_EN);

drivers/usb/core/devio.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma)
217217
{
218218
struct usb_memory *usbm = NULL;
219219
struct usb_dev_state *ps = file->private_data;
220+
struct usb_hcd *hcd = bus_to_hcd(ps->dev->bus);
220221
size_t size = vma->vm_end - vma->vm_start;
221222
void *mem;
222223
unsigned long flags;
@@ -250,9 +251,7 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma)
250251
usbm->vma_use_count = 1;
251252
INIT_LIST_HEAD(&usbm->memlist);
252253

253-
if (remap_pfn_range(vma, vma->vm_start,
254-
virt_to_phys(usbm->mem) >> PAGE_SHIFT,
255-
size, vma->vm_page_prot) < 0) {
254+
if (dma_mmap_coherent(hcd->self.sysdev, vma, mem, dma_handle, size)) {
256255
dec_usb_memory_use_count(usbm, &usbm->vma_use_count);
257256
return -EAGAIN;
258257
}

drivers/usb/core/message.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,11 +1144,11 @@ void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,
11441144

11451145
if (usb_endpoint_out(epaddr)) {
11461146
ep = dev->ep_out[epnum];
1147-
if (reset_hardware)
1147+
if (reset_hardware && epnum != 0)
11481148
dev->ep_out[epnum] = NULL;
11491149
} else {
11501150
ep = dev->ep_in[epnum];
1151-
if (reset_hardware)
1151+
if (reset_hardware && epnum != 0)
11521152
dev->ep_in[epnum] = NULL;
11531153
}
11541154
if (ep) {

drivers/usb/serial/garmin_gps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,8 +1138,8 @@ static void garmin_read_process(struct garmin_data *garmin_data_p,
11381138
send it directly to the tty port */
11391139
if (garmin_data_p->flags & FLAGS_QUEUING) {
11401140
pkt_add(garmin_data_p, data, data_length);
1141-
} else if (bulk_data ||
1142-
getLayerId(data) == GARMIN_LAYERID_APPL) {
1141+
} else if (bulk_data || (data_length >= sizeof(u32) &&
1142+
getLayerId(data) == GARMIN_LAYERID_APPL)) {
11431143

11441144
spin_lock_irqsave(&garmin_data_p->lock, flags);
11451145
garmin_data_p->flags |= APP_RESP_SEEN;

drivers/usb/serial/qcserial.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ static const struct usb_device_id id_table[] = {
173173
{DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
174174
{DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */
175175
{DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */
176+
{DEVICE_SWI(0x413c, 0x81cc)}, /* Dell Wireless 5816e */
176177
{DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */
177178
{DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */
178179
{DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */

drivers/usb/storage/unusual_uas.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
* and don't forget to CC: the USB development list <[email protected]>
2929
*/
3030

31+
/* Reported-by: Julian Groß <[email protected]> */
32+
UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999,
33+
"LaCie",
34+
"2Big Quadra USB3",
35+
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
36+
US_FL_NO_REPORT_OPCODES),
37+
3138
/*
3239
* Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
3340
* commands in UAS mode. Observed with the 1.28 firmware; are there others?

drivers/usb/typec/mux/intel_pmc_mux.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state)
157157
req.mode_data |= (state->mode - TYPEC_STATE_MODAL) <<
158158
PMC_USB_ALTMODE_DP_MODE_SHIFT;
159159

160+
if (data->status & DP_STATUS_HPD_STATE)
161+
req.mode_data |= PMC_USB_DP_HPD_LVL <<
162+
PMC_USB_ALTMODE_DP_MODE_SHIFT;
163+
160164
return pmc_usb_command(port, (void *)&req, sizeof(req));
161165
}
162166

@@ -298,11 +302,11 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index,
298302
struct typec_mux_desc mux_desc = { };
299303
int ret;
300304

301-
ret = fwnode_property_read_u8(fwnode, "usb2-port", &port->usb2_port);
305+
ret = fwnode_property_read_u8(fwnode, "usb2-port-number", &port->usb2_port);
302306
if (ret)
303307
return ret;
304308

305-
ret = fwnode_property_read_u8(fwnode, "usb3-port", &port->usb3_port);
309+
ret = fwnode_property_read_u8(fwnode, "usb3-port-number", &port->usb3_port);
306310
if (ret)
307311
return ret;
308312

0 commit comments

Comments
 (0)