aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)AuthorFilesLines
2018-05-15usb: mtu3: avoid TX data length truncated in SS/SSP modeChunfeng Yun1-1/+1
The variable of 'count' is declared as u8, this will cause an issue due to value truncated when works in SS or SSP mode and data length is greater than 255, so change it as u32. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-15usb: phy: simplify getting .drvdataWolfram Sang1-4/+2
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-15usb: mtu3: simplify getting .drvdataWolfram Sang1-4/+2
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Acked-by: Chunfeng Yun <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-15usb: phy: Add Kconfig entry for Tegra PHY driverDmitry Osipenko3-4/+11
Tegra's EHCI driver has a build dependency on Tegra's PHY driver and currently Tegra's PHY driver is built only when Tegra's EHCI driver is built. Add own Kconfig entry for the Tegra's PHY driver so that drivers other than ehci-tegra (like ChipIdea UDC) could work with ehci-tegra driver being disabled in kernels config by allowing user to manually select the PHY driver. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-15usb: tegra: Move utmi-pads reset from ehci-tegra to tegra-phyDmitry Osipenko2-53/+113
UTMI pads are shared by USB controllers and reset of UTMI pads is shared with the reset of USB1 controller. Currently reset of UTMI pads is done by the EHCI driver and ChipIdea UDC works because EHCI driver always happen to be probed first. Move reset controls from ehci-tegra to tegra-phy in order to resolve the problem. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-15usb: phy: tegra: Cleanup error messagesDmitry Osipenko1-28/+41
Tegra's PHY driver has a mix of pr_err() and dev_err(), let's switch to dev_err() and use common errors message formatting across the driver for consistency. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-15usb: gadget: f_fs: Add compat_ioctl to epfilesJerry Zhang1-0/+11
This allows 32 bit owners of ffs endpoints to make ioctls into a 64 bit kernel. All of the current epfile ioctls can be handled with the same struct definitions as regular ioctl. Acked-by: Michał Nazarewicz <[email protected]> Signed-off-by: Jerry Zhang <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-15usb: gadget: f_midi: Use refcount when freeing f_midi_optsJerry Zhang1-6/+20
Currently, the midi function is not freed until it is both removed from the config and released by the user. Since the user could take a long time to release the card, it's possible that the function could be unlinked and thus f_midi_opts would be null when freeing f_midi. Thus, refcount f_midi_opts and only free it when it is unlinked and all f_midis have been freed. Signed-off-by: Jerry Zhang <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-15usb/gadget: Add driver for Aspeed SoC virtual hubBenjamin Herrenschmidt10-0/+3700
The Aspeed BMC SoCs support a "virtual hub" function. It provides some HW support for a top-level USB2 hub behind which sit 5 gadget "ports". This driver adds support for the full functionality, emulating the hub standard requests and exposing 5 UDC gadget drivers corresponding to the ports. The hub itself has HW provided dedicated EP0 and EP1 (the latter for hub interrupts). It also has dedicated EP0s for each function. For other endpoints, there's a pool of 15 "generic" endpoints that are shared among the ports. The driver relies on my previous patch adding a "dispose" EP op to handle EP allocation between ports. EPs are allocated from the shared pool in the UDC "match_ep" callback and assigned to the UDC instance (added to the gadget ep_list). When the composite driver gets unbound, the new hook will allow the UDC to clean things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-15usb/gadget: Constify usb_gadget_get_string "table" argumentBenjamin Herrenschmidt1-1/+1
The table is never modified by the function. This allows us to use it on a statically defined table that is marked const. Signed-off-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-05-14usb: musb: fix remote wakeup racing with suspendDaniel Glöckner3-13/+24
It has been observed that writing 0xF2 to the power register while it reads as 0xF4 results in the register having the value 0xF0, i.e. clearing RESUME and setting SUSPENDM in one go does not work. It might also violate the USB spec to transition directly from resume to suspend, especially when not taking T_DRSMDN into account. But this is what happens when a remote wakeup occurs between SetPortFeature USB_PORT_FEAT_SUSPEND on the root hub and musb_bus_suspend being called. This commit returns -EBUSY when musb_bus_suspend is called while remote wakeup is signalled and thus avoids to reset the RESUME bit. Ignoring this error when musb_port_suspend is called from musb_hub_control is ok. Signed-off-by: Daniel Glöckner <[email protected]> Signed-off-by: Bin Liu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-14xhci: Fix USB3 NULL pointer dereference at logical disconnect.Mathias Nyman1-1/+1
Hub driver will try to disable a USB3 device twice at logical disconnect, racing with xhci_free_dev() callback from the first port disable. This can be triggered with "udisksctl power-off --block-device <disk>" or by writing "1" to the "remove" sysfs file for a USB3 device in 4.17-rc4. USB3 devices don't have a similar disabled link state as USB2 devices, and use a U3 suspended link state instead. In this state the port is still enabled and connected. hub_port_connect() first disconnects the device, then later it notices that device is still enabled (due to U3 states) it will try to disable the port again (set to U3). The xhci_free_dev() called during device disable is async, so checking for existing xhci->devs[i] when setting link state to U3 the second time was successful, even if device was being freed. The regression was caused by, and whole thing revealed by, Commit 44a182b9d177 ("xhci: Fix use-after-free in xhci_free_virt_device") which sets xhci->devs[i]->udev to NULL before xhci_virt_dev() returned. and causes a NULL pointer dereference the second time we try to set U3. Fix this by checking xhci->devs[i]->udev exists before setting link state. The original patch went to stable so this fix needs to be applied there as well. Fixes: 44a182b9d177 ("xhci: Fix use-after-free in xhci_free_virt_device") Cc: <[email protected]> Reported-by: Jordan Glover <[email protected]> Tested-by: Jordan Glover <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-08Merge 4.17-rc4 into usb-nextGreg Kroah-Hartman16-57/+132
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-04Merge tag 'usb-serial-4.17-rc4' of ↵Greg Kroah-Hartman2-34/+40
https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for v4.17-rc4 Here's a fix for a long-standing issue in the visor driver, which could have security implications. Included is also a new modem device id. Both commits have been in linux-next for a couple of days with no reported issues. Signed-off-by: Johan Hovold <[email protected]>
2018-05-04Revert "usb: host: ehci: Use dma_pool_zalloc()"Greg Kroah-Hartman2-3/+6
This reverts commit 22072e83ebd510fb6a090aef9d65ccfda9b1e7e4 as it is broken. Alan writes: What you can't see just from reading the patch is that in both cases (ehci->itd_pool and ehci->sitd_pool) there are two allocation paths -- the two branches of an "if" statement -- and only one of the paths calls dma_pool_[z]alloc. However, the memset is needed for both paths, and so it can't be eliminated. Given that it must be present, there's no advantage to calling dma_pool_zalloc rather than dma_pool_alloc. Reported-by: Erick Cafferata <[email protected]> Cc: Alan Stern <[email protected]> Cc: Souptick Joarder <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-03usbip: usbip_host: run rebind from exit when module is removedShuah Khan (Samsung OSG)2-14/+52
After removing usbip_host module, devices it releases are left without a driver. For example, when a keyboard or a mass storage device are bound to usbip_host when it is removed, these devices are no longer bound to any driver. Fix it to run device_attach() from the module exit routine to restore the devices to their original drivers. This includes cleanup changes and moving device_attach() code to a common routine to be called from rebind_store() and usbip_host_exit(). Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-03usbip: usbip_host: delete device from busid_table after rebindShuah Khan (Samsung OSG)1-0/+6
Device is left in the busid_table after unbind and rebind. Rebind initiates usb bus scan and the original driver claims the device. After rescan the device should be deleted from the busid_table as it no longer belongs to usbip_host. Fix it to delete the device after device_attach() succeeds. Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-03usb: typec: tps6598x: handle block reads separately with plain-I2C adaptersHeikki Krogerus1-8/+39
If the I2C adapter that the PD controller is attached to does not support SMBus protocol, the driver needs to handle block reads separately. The first byte returned in block read protocol will show the total number of bytes. It needs to be stripped away. This is handled separately in the driver only because right now we have no way of requesting the used protocol with regmap-i2c. This is in practice a workaround for what is really a problem in regmap-i2c. The other option would have been to register custom regmap, or not use regmap at all, however, since the solution is very simple, I choose to use it in this case for convenience. It is easy to remove once we figure out how to handle this kind of cases in regmap-i2c. Fixes: 0a4c005bd171 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers") Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-03usb: typec: tcpm: Release the role mux when exitingHeikki Krogerus1-0/+1
The ref count for the USB role switch device must be released after we are done using the switch. Fixes: c6962c29729c ("usb: typec: tcpm: Set USB role switch to device mode when configured as such") Signed-off-by: Heikki Krogerus <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-03USB: Accept bulk endpoints with 1024-byte maxpacketAlan Stern1-1/+3
Some non-compliant high-speed USB devices have bulk endpoints with a 1024-byte maxpacket size. Although such endpoints don't work with xHCI host controllers, they do work with EHCI controllers. We used to accept these invalid sizes (with a warning), but we no longer do because of an unintentional change introduced by commit aed9d65ac327 ("USB: validate wMaxPacketValue entries in endpoint descriptors"). This patch restores the old behavior, so that people with these peculiar devices can use them without patching their kernels by hand. Signed-off-by: Alan Stern <[email protected]> Suggested-by: Elvinas <[email protected]> Fixes: aed9d65ac327 ("USB: validate wMaxPacketValue entries in endpoint descriptors") CC: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-03xhci: Fix use-after-free in xhci_free_virt_deviceMathias Nyman1-0/+1
KASAN found a use-after-free in xhci_free_virt_device+0x33b/0x38e where xhci_free_virt_device() sets slot id to 0 if udev exists: if (dev->udev && dev->udev->slot_id) dev->udev->slot_id = 0; dev->udev will be true even if udev is freed because dev->udev is not set to NULL. set dev->udev pointer to NULL in xhci_free_dev() The original patch went to stable so this fix needs to be applied there as well. Fixes: a400efe455f7 ("xhci: zero usb device slot_id member when disabling and freeing a xhci slot") Cc: <[email protected]> Reported-by: Guenter Roeck <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-05-02USB: serial: visor: handle potential invalid device configurationGreg Kroah-Hartman1-34/+35
If we get an invalid device configuration from a palm 3 type device, we might incorrectly parse things, and we have the potential to crash in "interesting" ways. Fix this up by verifying the size of the configuration passed to us by the device, and only if it is correct, will we handle it. Note that this also fixes an information leak of slab data. Reported-by: Andrey Konovalov <[email protected]> Reviewed-by: Andrey Konovalov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> [ johan: add comment about the info leak ] Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
2018-05-02USB: serial: option: adding support for ublox R410MSZ Lin (林上智)1-0/+5
This patch adds support for ublox R410M PID 0x90b2 USB modem to option driver, this module supports LTE Cat M1 / NB1. Interface layout: 0: QCDM/DIAG 1: ADB 2: AT 3: RMNET Signed-off-by: SZ Lin (林上智) <[email protected]> Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
2018-05-02USB: serial: option: blacklist unused dwm-158 interfacesGiuseppe Lippolis1-1/+2
The dwm-158 interface 4 and 5 doesn't answer to the AT commands and doesn't appears a option interface. Tested on openwrt distribution (kernel 4.14 using the old blacklist definitions). Lars Melin also writes: Blacklisting interface 4 and 5 is correct because: MI_00 D-Link Mobile Broadband Device (cdc_ether) MI_02 D-Link HSPA+DataCard Diagnostics Interface (also ppp modem) MI_03 D-Link HSPA+DataCard NMEA Device MI_04 D-Link HSPA+DataCard Speech Port MI_05 D-Link HSPA+DataCard Debug Port MI_06 USB Mass Storage Device Signed-off-by: Giuseppe Lippolis <[email protected]> [ johan: add Lars's comment on the interface layout and reword summary ] Cc: Lars Melin <[email protected]> Cc: Dan Williams <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
2018-04-30usb: musb: trace: fix NULL pointer dereference in musb_g_tx()Bin Liu1-1/+2
The usb_request pointer could be NULL in musb_g_tx(), where the tracepoint call would trigger the NULL pointer dereference failure when parsing the members of the usb_request pointer. Move the tracepoint call to where the usb_request pointer is already checked to solve the issue. Fixes: fc78003e5345 ("usb: musb: gadget: add usb-request tracepoints") Cc: [email protected] # v4.8+ Signed-off-by: Bin Liu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-30usb: musb: host: fix potential NULL pointer dereferenceBin Liu1-1/+3
musb_start_urb() doesn't check the pass-in parameter if it is NULL. But in musb_bulk_nak_timeout() the parameter passed to musb_start_urb() is returned from first_qh(), which could be NULL. So wrap the musb_start_urb() call here with a if condition check to avoid the potential NULL pointer dereference. Fixes: f283862f3b5c ("usb: musb: NAK timeout scheme on bulk TX endpoint") Cc: [email protected] # v3.7+ Signed-off-by: Bin Liu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-30typec: tcpm: Fix incorrect 'and' operatorGustavo A. R. Silva1-1/+1
Currently, logical and is being used instead of *bitwise* and. Fix this by using a proper bitwise and operator. Addresses-Coverity-ID: 1468455 ("Logical vs. bitwise operator") Fixes: 64f7c494a3c0 ("typec: tcpm: Add support for sink PPS related messages") Signed-off-by: Gustavo A. R. Silva <[email protected]> Acked-by: Adam Thomson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-30Merge tag 'fixes-for-v4.17-rc3' of ↵Greg Kroah-Hartman6-9/+37
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: usb: fixes for v4.17-rc3 Not much this time around: A list_del corruption on dwc3_ep_dequeue(), sparse warning fix also on dwc3, build issues with f_phonet. Apart from these three, some other minor fixes. Signed-off-by: Felipe Balbi <[email protected]>
2018-04-30Merge 4.17-rc3 into usb-nextGreg Kroah-Hartman21-48/+153
This resolves the merge issue with drivers/usb/core/hcd.c Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-29usb-misc: sisusbvga: fix spelling mistake: "asymmeric" -> "asymmetric"Colin Ian King1-1/+1
Trivial fix to spelling mistake in text string Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-26Merge tag 'usb-serial-4.17-rc3' of ↵Greg Kroah-Hartman4-1/+11
https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for v4.17-rc3 Here are a few device ids for -rc3, including a new "simple driver". All have been in linux-next with no reported issues. Signed-off-by: Johan Hovold <[email protected]>
2018-04-25typec: tcpm: fix compiler warning about stupid thingsGreg Kroah-Hartman1-1/+2
gcc thinks it is too smart and gives off a "you might be using this variable before it is initialized" warning in tcpm_pd_build_request(), because it can not follow the logic through the tcpm_pd_select_pdo() call. So just make gcc quiet by initializing things to 0, to prevent the myriad of people complaining that we now have a build warning. Cc: Adam Thomson <[email protected]> Cc: Heikki Krogerus <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-25typec: tcpm: Add support for sink PPS related messagesAdam Thomson1-9/+134
This commit adds sink side support for Get_Status, Status, Get_PPS_Status and PPS_Status handling. As there's the potential for a partner to respond with Not_Supported, handling of this message is also added. Sending of Not_Supported is added to handle messagescreceived but not yet handled. Signed-off-by: Adam Thomson <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-25typec: tcpm: Represent source supply through power_supplyAdam Thomson4-66/+251
This commit adds a power_supply class instance to represent a PD source's voltage and current properties. This provides an interface for reading these properties from user-space or other drivers. For PPS enabled Sources, this also provides write access to set the current and voltage and allows for swapping between standard PDO and PPS APDO. As this represents a superset of the information provided in the fusb302 driver, the power_supply instance in that code is removed as part of this change, so reverting the commit titled 'typec: tcpm: Represent source supply through power_supply class' Signed-off-by: Adam Thomson <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-25typec: tcpm: Add core support for sink side PPSAdam Thomson1-14/+555
This commit adds code to handle requesting of PPS APDOs. Switching between standard PDOs and APDOs, and re-requesting an APDO to modify operating voltage/current will be triggered by an external call into TCPM. Signed-off-by: Adam Thomson <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-25usb: do not reset if a low-speed or full-speed device timed outMaxim Moseychuk1-1/+3
Some low-speed and full-speed devices (for example, bluetooth) do not have time to initialize. For them, ETIMEDOUT is a valid error. We need to give them another try. Otherwise, they will never be initialized correctly and in dmesg will be messages "Bluetooth: hci0 command 0x1002 tx timeout" or similars. Fixes: 264904ccc33c ("usb: retry reset if a device times out") Cc: stable <[email protected]> Signed-off-by: Maxim Moseychuk <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-25usb: dwc3: gadget: Fix list_del corruption in dwc3_ep_dequeueMayank Rana1-1/+1
dwc3_ep_dequeue() waits for completion of End Transfer command using wait_event_lock_irq(), which will release the dwc3->lock while waiting and reacquire after completion. This allows a potential race condition with ep_disable() which also removes all requests from started_list and pending_list. The check for NULL r->trb should catch this but currently it exits to the wrong 'out1' label which calls dwc3_gadget_giveback(). Since its list entry was already removed, if CONFIG_DEBUG_LIST is enabled a 'list_del corruption' bug is thrown since its next/prev pointers are already LIST_POISON1/2. If r->trb is NULL it should simply exit to 'out0'. Fixes: cf3113d893d4 ("usb: dwc3: gadget: properly increment dequeue pointer on ep_dequeue") Cc: [email protected] # v4.12+ Signed-off-by: Mayank Rana <[email protected]> Signed-off-by: Jack Pham <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-04-25usb: dwc3: gadget: dwc3_gadget_del_and_unmap_request() can be staticWei Yongjun1-1/+1
Fixes the following sparse warning: drivers/usb/dwc3/gadget.c:169:6: warning: symbol 'dwc3_gadget_del_and_unmap_request' was not declared. Should it be static? Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-04-25usb: dwc2: pci: Fix error return code in dwc2_pci_probe()Wei Yongjun1-1/+3
Fix to return error code -ENOMEM from the alloc fail error handling case instead of 0, as done elsewhere in this function. Fixes: ecd29dabb2ba ("usb: dwc2: pci: Handle error cleanup in probe") Reviewed-by: Grigor Tovmasyan <[email protected]> Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-04-25usb: dwc2: WA for Full speed ISOC IN in DDMA mode.Artur Petrosyan2-0/+23
By clearing NAK status of EP, core will send ZLP to IN token and assert NAK interrupt relying on TxFIFO status only. The WA applies only to core versions from 2.72a to 4.00a (including both). Also for FS_IOT_1.00a and HS_IOT_1.00a. Signed-off-by: Artur Petrosyan <[email protected]> Signed-off-by: Minas Harutyunyan <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-04-25usb: dwc2: dwc2_vbus_supply_init: fix error checkTomeu Vizoso1-5/+8
devm_regulator_get_optional returns -ENODEV if the regulator isn't there, so if that's the case we have to make sure not to leave -ENODEV in the regulator pointer. Also, make sure we return 0 in that case, but correctly propagate any other errors. Also propagate the error from _dwc2_hcd_start. Fixes: 531ef5ebea96 ("usb: dwc2: add support for host mode external vbus supply") Cc: Amelie Delaunay <[email protected]> Reviewed-by: Amelie Delaunay <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Reviewed-by: Grigor Tovmasyan <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-04-25usb: gadget: f_phonet: fix pn_net_xmit()'s return typeLuc Van Oostenryck1-1/+1
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-04-23USB: musb: dsps: drop duplicate phy initialisationJohan Hovold1-2/+0
Since commit 39cee200c23e ("usb: musb: core: call init and shutdown for the usb phy") the musb USB phy is initialised by musb_core, but the original initialisation in the dsps-glue init callback was left in place resulting in two calls to phy init during probe (and similarly, two shutdowns on remove). Drop the duplicate phy init and shutdown calls from the dsps glue in favour of the ones in musb core, which other glue drivers rely on. Note however that any generic phy is still initialised in the glue init callback (just as for the other drivers). Cc: Uwe Kleine-König <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Bin Liu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-23USB: musb: host: prevent core phy initialisationJohan Hovold1-0/+1
Set the new HCD flag which prevents USB core from trying to manage our phys. This is needed to be able to associate the controller platform device with the glue device device-tree node on the BBB which uses legacy USB phys. Otherwise, the generic phy lookup in usb_phy_roothub_init() and thus HCD registration fails repeatedly with -EPROBE_DEFER (see commit 178a0bce05cb ("usb: core: hcd: integrate the PHY wrapper into the HCD core")). Note that a related phy-lookup issue was recently worked around in the phy core by commit b7563e2796f8 ("phy: work around 'phys' references to usb-nop-xceiv devices"). Something similar may now be needed for other USB phys, and in particular if we eventually want to let USB core manage musb generic phys. Cc: Arnd Bergmann <[email protected]> Cc: Martin Blumenstingl <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Bin Liu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-23usb: core: hcd: mark expected switch fall-throughGustavo A. R. Silva1-0/+1
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1468266 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-23usb: gadget: udc: core: Document the relation between usb_ep_queue() and ↵Alan Stern1-0/+6
completion callback Improve the kerneldoc for usb_ep_queue() to note explicitly that the request's completion routine will be called if and only if the return value is 0. The corresponding fact about usb_submit_urb() for the host-side API has long been documented, and this has always been the intention for the gadget API. But until now, documentation seems to have been lacking. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-04-23usb: phy: Add Kconfig entry for Tegra PHY driverDmitry Osipenko3-4/+11
Tegra's EHCI driver has a build dependency on Tegra's PHY driver and currently Tegra's PHY driver is built only when Tegra's EHCI driver is built. Add own Kconfig entry for the Tegra's PHY driver so that drivers other than ehci-tegra (like ChipIdea UDC) could work with ehci-tegra driver being disabled in kernels config by allowing user to manually select the PHY driver. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-23usb: tegra: Move utmi-pads reset from ehci-tegra to tegra-phyDmitry Osipenko2-53/+113
UTMI pads are shared by USB controllers and reset of UTMI pads is shared with the reset of USB1 controller. Currently reset of UTMI pads is done by the EHCI driver and ChipIdea UDC works because EHCI driver always happen to be probed first. Move reset controls from ehci-tegra to tegra-phy in order to resolve the problem. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-23usb: phy: tegra: Cleanup error messagesDmitry Osipenko1-28/+41
Tegra's PHY driver has a mix of pr_err() and dev_err(), let's switch to dev_err() and use common errors message formatting across the driver for consistency. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-04-23usb: core: phy: add the SPDX-License-Identifier and include guardMartin Blumenstingl1-0/+12
This clarifies the license of the code. While here also add an include guard to the header file. Fixes: 07dbff0ddbd86c ("usb: core: add a wrapper for the USB PHYs on the HCD") Suggested-by: Masahiro Yamada <[email protected]> Signed-off-by: Martin Blumenstingl <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>