Skip to content

Commit

Permalink
Merge tag 'usb-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/gregkh/usb

Pull USB/PHY fixes from Greg KH:
 "Here are a number of small USB and PHY driver fixes for 4.15-rc6.

  Nothing major, but there are a number of regression fixes in here that
  resolve issues that have been reported a bunch. There are also the
  usual xhci fixes as well as a number of new usb serial device ids.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'usb-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: xhci: Add XHCI_TRUST_TX_LENGTH for Renesas uPD720201
  xhci: Fix use-after-free in xhci debugfs
  xhci: Fix xhci debugfs NULL pointer dereference in resume from hibernate
  USB: serial: ftdi_sio: add id for Airbus DS P8GR
  usb: Add device quirk for Logitech HD Pro Webcam C925e
  usb: add RESET_RESUME for ELSA MicroLink 56K
  usbip: fix usbip bind writing random string after command in match_busid
  usbip: stub_rx: fix static checker warning on unnecessary checks
  usbip: prevent leaking socket pointer address in messages
  usbip: stub: stop printing kernel pointer addresses in messages
  usbip: vhci: stop printing kernel pointer addresses in messages
  USB: Fix off by one in type-specific length check of BOS SSP capability
  USB: serial: option: adding support for YUGA CLM920-NC5
  phy: rcar-gen3-usb2: select USB_COMMON
  phy: rockchip-typec: add pm_runtime_disable in err case
  phy: cpcap-usb: Fix platform_get_irq_byname's error checking.
  phy: tegra: fix device-tree node lookups
  USB: serial: qcserial: add Sierra Wireless EM7565
  USB: serial: option: add support for Telit ME910 PID 0x1101
  USB: chipidea: msm: fix ulpi-node lookup
  • Loading branch information
torvalds committed Dec 31, 2017
2 parents c0b2390 + da99706 commit a9746e4
Show file tree
Hide file tree
Showing 23 changed files with 117 additions and 104 deletions.
2 changes: 1 addition & 1 deletion drivers/phy/motorola/phy-cpcap-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static int cpcap_usb_init_irq(struct platform_device *pdev,
int irq, error;

irq = platform_get_irq_byname(pdev, name);
if (!irq)
if (irq < 0)
return -ENODEV;

error = devm_request_threaded_irq(ddata->dev, irq, NULL,
Expand Down
2 changes: 2 additions & 0 deletions drivers/phy/renesas/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ config PHY_RCAR_GEN3_USB2
tristate "Renesas R-Car generation 3 USB 2.0 PHY driver"
depends on ARCH_RENESAS
depends on EXTCON
depends on USB_SUPPORT
select GENERIC_PHY
select USB_COMMON
help
Support for USB 2.0 PHY found on Renesas R-Car generation 3 SoCs.

Expand Down
2 changes: 2 additions & 0 deletions drivers/phy/rockchip/phy-rockchip-typec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
if (IS_ERR(phy)) {
dev_err(dev, "failed to create phy: %s\n",
child_np->name);
pm_runtime_disable(dev);
return PTR_ERR(phy);
}

Expand All @@ -1146,6 +1147,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
if (IS_ERR(phy_provider)) {
dev_err(dev, "Failed to register phy provider\n");
pm_runtime_disable(dev);
return PTR_ERR(phy_provider);
}

Expand Down
58 changes: 29 additions & 29 deletions drivers/phy/tegra/xusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,31 +75,31 @@ MODULE_DEVICE_TABLE(of, tegra_xusb_padctl_of_match);
static struct device_node *
tegra_xusb_find_pad_node(struct tegra_xusb_padctl *padctl, const char *name)
{
/*
* of_find_node_by_name() drops a reference, so make sure to grab one.
*/
struct device_node *np = of_node_get(padctl->dev->of_node);
struct device_node *pads, *np;

pads = of_get_child_by_name(padctl->dev->of_node, "pads");
if (!pads)
return NULL;

np = of_find_node_by_name(np, "pads");
if (np)
np = of_find_node_by_name(np, name);
np = of_get_child_by_name(pads, name);
of_node_put(pads);

return np;
}

static struct device_node *
tegra_xusb_pad_find_phy_node(struct tegra_xusb_pad *pad, unsigned int index)
{
/*
* of_find_node_by_name() drops a reference, so make sure to grab one.
*/
struct device_node *np = of_node_get(pad->dev.of_node);
struct device_node *np, *lanes;

np = of_find_node_by_name(np, "lanes");
if (!np)
lanes = of_get_child_by_name(pad->dev.of_node, "lanes");
if (!lanes)
return NULL;

return of_find_node_by_name(np, pad->soc->lanes[index].name);
np = of_get_child_by_name(lanes, pad->soc->lanes[index].name);
of_node_put(lanes);

return np;
}

static int
Expand Down Expand Up @@ -195,7 +195,7 @@ int tegra_xusb_pad_register(struct tegra_xusb_pad *pad,
unsigned int i;
int err;

children = of_find_node_by_name(pad->dev.of_node, "lanes");
children = of_get_child_by_name(pad->dev.of_node, "lanes");
if (!children)
return -ENODEV;

Expand Down Expand Up @@ -444,21 +444,21 @@ static struct device_node *
tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type,
unsigned int index)
{
/*
* of_find_node_by_name() drops a reference, so make sure to grab one.
*/
struct device_node *np = of_node_get(padctl->dev->of_node);
struct device_node *ports, *np;
char *name;

np = of_find_node_by_name(np, "ports");
if (np) {
char *name;
ports = of_get_child_by_name(padctl->dev->of_node, "ports");
if (!ports)
return NULL;

name = kasprintf(GFP_KERNEL, "%s-%u", type, index);
if (!name)
return ERR_PTR(-ENOMEM);
np = of_find_node_by_name(np, name);
kfree(name);
name = kasprintf(GFP_KERNEL, "%s-%u", type, index);
if (!name) {
of_node_put(ports);
return ERR_PTR(-ENOMEM);
}
np = of_get_child_by_name(ports, name);
kfree(name);
of_node_put(ports);

return np;
}
Expand Down Expand Up @@ -847,15 +847,15 @@ static void tegra_xusb_remove_ports(struct tegra_xusb_padctl *padctl)

static int tegra_xusb_padctl_probe(struct platform_device *pdev)
{
struct device_node *np = of_node_get(pdev->dev.of_node);
struct device_node *np = pdev->dev.of_node;
const struct tegra_xusb_padctl_soc *soc;
struct tegra_xusb_padctl *padctl;
const struct of_device_id *match;
struct resource *res;
int err;

/* for backwards compatibility with old device trees */
np = of_find_node_by_name(np, "pads");
np = of_get_child_by_name(np, "pads");
if (!np) {
dev_warn(&pdev->dev, "deprecated DT, using legacy driver\n");
return tegra_xusb_padctl_legacy_probe(pdev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/chipidea/ci_hdrc_msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev)
if (ret)
goto err_mux;

ulpi_node = of_find_node_by_name(of_node_get(pdev->dev.of_node), "ulpi");
ulpi_node = of_get_child_by_name(pdev->dev.of_node, "ulpi");
if (ulpi_node) {
phy_node = of_get_next_available_child(ulpi_node, NULL);
ci->hsic = of_device_is_compatible(phy_node, "qcom,usb-hsic-phy");
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ int usb_get_bos_descriptor(struct usb_device *dev)
case USB_SSP_CAP_TYPE:
ssp_cap = (struct usb_ssp_cap_descriptor *)buffer;
ssac = (le32_to_cpu(ssp_cap->bmAttributes) &
USB_SSP_SUBLINK_SPEED_ATTRIBS) + 1;
USB_SSP_SUBLINK_SPEED_ATTRIBS);
if (length >= USB_DT_USB_SSP_CAP_SIZE(ssac))
dev->bos->ssp_cap = ssp_cap;
break;
Expand Down
6 changes: 5 additions & 1 deletion drivers/usb/core/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ static const struct usb_device_id usb_quirk_list[] = {
/* Microsoft LifeCam-VX700 v2.0 */
{ USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },

/* Logitech HD Pro Webcams C920, C920-C and C930e */
/* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */
{ USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
{ USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT },
{ USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT },
{ USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT },

/* Logitech ConferenceCam CC3000e */
{ USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT },
Expand Down Expand Up @@ -149,6 +150,9 @@ static const struct usb_device_id usb_quirk_list[] = {
/* Genesys Logic hub, internally used by KY-688 USB 3.1 Type-C Hub */
{ USB_DEVICE(0x05e3, 0x0612), .driver_info = USB_QUIRK_NO_LPM },

/* ELSA MicroLink 56K */
{ USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_RESET_RESUME },

/* Genesys Logic hub, internally used by Moshi USB to Ethernet Adapter */
{ USB_DEVICE(0x05e3, 0x0616), .driver_info = USB_QUIRK_NO_LPM },

Expand Down
16 changes: 8 additions & 8 deletions drivers/usb/host/xhci-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static void xhci_debugfs_extcap_regset(struct xhci_hcd *xhci, int cap_id,
static int xhci_ring_enqueue_show(struct seq_file *s, void *unused)
{
dma_addr_t dma;
struct xhci_ring *ring = s->private;
struct xhci_ring *ring = *(struct xhci_ring **)s->private;

dma = xhci_trb_virt_to_dma(ring->enq_seg, ring->enqueue);
seq_printf(s, "%pad\n", &dma);
Expand All @@ -173,7 +173,7 @@ static int xhci_ring_enqueue_show(struct seq_file *s, void *unused)
static int xhci_ring_dequeue_show(struct seq_file *s, void *unused)
{
dma_addr_t dma;
struct xhci_ring *ring = s->private;
struct xhci_ring *ring = *(struct xhci_ring **)s->private;

dma = xhci_trb_virt_to_dma(ring->deq_seg, ring->dequeue);
seq_printf(s, "%pad\n", &dma);
Expand All @@ -183,7 +183,7 @@ static int xhci_ring_dequeue_show(struct seq_file *s, void *unused)

static int xhci_ring_cycle_show(struct seq_file *s, void *unused)
{
struct xhci_ring *ring = s->private;
struct xhci_ring *ring = *(struct xhci_ring **)s->private;

seq_printf(s, "%d\n", ring->cycle_state);

Expand Down Expand Up @@ -346,7 +346,7 @@ static void xhci_debugfs_create_files(struct xhci_hcd *xhci,
}

static struct dentry *xhci_debugfs_create_ring_dir(struct xhci_hcd *xhci,
struct xhci_ring *ring,
struct xhci_ring **ring,
const char *name,
struct dentry *parent)
{
Expand Down Expand Up @@ -387,7 +387,7 @@ void xhci_debugfs_create_endpoint(struct xhci_hcd *xhci,

snprintf(epriv->name, sizeof(epriv->name), "ep%02d", ep_index);
epriv->root = xhci_debugfs_create_ring_dir(xhci,
dev->eps[ep_index].new_ring,
&dev->eps[ep_index].new_ring,
epriv->name,
spriv->root);
spriv->eps[ep_index] = epriv;
Expand Down Expand Up @@ -423,7 +423,7 @@ void xhci_debugfs_create_slot(struct xhci_hcd *xhci, int slot_id)
priv->dev = dev;
dev->debugfs_private = priv;

xhci_debugfs_create_ring_dir(xhci, dev->eps[0].ring,
xhci_debugfs_create_ring_dir(xhci, &dev->eps[0].ring,
"ep00", priv->root);

xhci_debugfs_create_context_files(xhci, priv->root, slot_id);
Expand Down Expand Up @@ -488,11 +488,11 @@ void xhci_debugfs_init(struct xhci_hcd *xhci)
ARRAY_SIZE(xhci_extcap_dbc),
"reg-ext-dbc");

xhci_debugfs_create_ring_dir(xhci, xhci->cmd_ring,
xhci_debugfs_create_ring_dir(xhci, &xhci->cmd_ring,
"command-ring",
xhci->debugfs_root);

xhci_debugfs_create_ring_dir(xhci, xhci->event_ring,
xhci_debugfs_create_ring_dir(xhci, &xhci->event_ring,
"event-ring",
xhci->debugfs_root);

Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/host/xhci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
xhci->quirks |= XHCI_TRUST_TX_LENGTH;
xhci->quirks |= XHCI_BROKEN_STREAMS;
}
if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
pdev->device == 0x0014)
xhci->quirks |= XHCI_TRUST_TX_LENGTH;
if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
pdev->device == 0x0015)
xhci->quirks |= XHCI_RESET_ON_RESUME;
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/host/xhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3525,8 +3525,6 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
struct xhci_slot_ctx *slot_ctx;
int i, ret;

xhci_debugfs_remove_slot(xhci, udev->slot_id);

#ifndef CONFIG_USB_DEFAULT_PERSIST
/*
* We called pm_runtime_get_noresume when the device was attached.
Expand Down Expand Up @@ -3555,8 +3553,10 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
}

ret = xhci_disable_slot(xhci, udev->slot_id);
if (ret)
if (ret) {
xhci_debugfs_remove_slot(xhci, udev->slot_id);
xhci_free_virt_device(xhci, udev->slot_id);
}
}

int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id)
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ static const struct usb_device_id id_table_combined[] = {
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) },
{ USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) },
{ USB_DEVICE(AIRBUS_DS_VID, AIRBUS_DS_P8GR) },
{ } /* Terminating entry */
};

Expand Down
6 changes: 6 additions & 0 deletions drivers/usb/serial/ftdi_sio_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,12 @@
#define ICPDAS_I7561U_PID 0x0104
#define ICPDAS_I7563U_PID 0x0105

/*
* Airbus Defence and Space
*/
#define AIRBUS_DS_VID 0x1e8e /* Vendor ID */
#define AIRBUS_DS_P8GR 0x6001 /* Tetra P8GR */

/*
* RT Systems programming cables for various ham radios
*/
Expand Down
17 changes: 17 additions & 0 deletions drivers/usb/serial/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ static void option_instat_callback(struct urb *urb);
/* These Quectel products use Qualcomm's vendor ID */
#define QUECTEL_PRODUCT_UC20 0x9003
#define QUECTEL_PRODUCT_UC15 0x9090
/* These Yuga products use Qualcomm's vendor ID */
#define YUGA_PRODUCT_CLM920_NC5 0x9625

#define QUECTEL_VENDOR_ID 0x2c7c
/* These Quectel products use Quectel's vendor ID */
Expand Down Expand Up @@ -280,6 +282,7 @@ static void option_instat_callback(struct urb *urb);
#define TELIT_PRODUCT_LE922_USBCFG3 0x1043
#define TELIT_PRODUCT_LE922_USBCFG5 0x1045
#define TELIT_PRODUCT_ME910 0x1100
#define TELIT_PRODUCT_ME910_DUAL_MODEM 0x1101
#define TELIT_PRODUCT_LE920 0x1200
#define TELIT_PRODUCT_LE910 0x1201
#define TELIT_PRODUCT_LE910_USBCFG4 0x1206
Expand Down Expand Up @@ -645,6 +648,11 @@ static const struct option_blacklist_info telit_me910_blacklist = {
.reserved = BIT(1) | BIT(3),
};

static const struct option_blacklist_info telit_me910_dual_modem_blacklist = {
.sendsetup = BIT(0),
.reserved = BIT(3),
};

static const struct option_blacklist_info telit_le910_blacklist = {
.sendsetup = BIT(0),
.reserved = BIT(1) | BIT(2),
Expand Down Expand Up @@ -674,6 +682,10 @@ static const struct option_blacklist_info cinterion_rmnet2_blacklist = {
.reserved = BIT(4) | BIT(5),
};

static const struct option_blacklist_info yuga_clm920_nc5_blacklist = {
.reserved = BIT(1) | BIT(4),
};

static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
Expand Down Expand Up @@ -1178,6 +1190,9 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)},
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
/* Yuga products use Qualcomm vendor ID */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5),
.driver_info = (kernel_ulong_t)&yuga_clm920_nc5_blacklist },
/* Quectel products using Quectel vendor ID */
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
Expand Down Expand Up @@ -1244,6 +1259,8 @@ static const struct usb_device_id option_ids[] = {
.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
.driver_info = (kernel_ulong_t)&telit_me910_blacklist },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
.driver_info = (kernel_ulong_t)&telit_me910_dual_modem_blacklist },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
.driver_info = (kernel_ulong_t)&telit_le910_blacklist },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/serial/qcserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ static const struct usb_device_id id_table[] = {
{DEVICE_SWI(0x1199, 0x9079)}, /* Sierra Wireless EM74xx */
{DEVICE_SWI(0x1199, 0x907a)}, /* Sierra Wireless EM74xx QDL */
{DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */
{DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */
{DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */
{DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */
{DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */
{DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
Expand Down Expand Up @@ -342,6 +344,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
break;
case 2:
dev_dbg(dev, "NMEA GPS interface found\n");
sendsetup = true;
break;
case 3:
dev_dbg(dev, "Modem port found\n");
Expand Down
3 changes: 1 addition & 2 deletions drivers/usb/usbip/stub_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ static void stub_shutdown_connection(struct usbip_device *ud)
* step 1?
*/
if (ud->tcp_socket) {
dev_dbg(&sdev->udev->dev, "shutdown tcp_socket %p\n",
ud->tcp_socket);
dev_dbg(&sdev->udev->dev, "shutdown sockfd %d\n", ud->sockfd);
kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR);
}

Expand Down
Loading

0 comments on commit a9746e4

Please sign in to comment.