- 23 Jul, 2020 27 commits
-
-
Mathias Nyman authored
Use a void pointer that any function driver can use instead. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-28-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
dbc should not be aware of, or use any dbctty specific variables. currenly dbc driver reads the port->registered flag to see if the callbacks should be called. Only makes these decisions based on dbc internal state instead. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-27-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
Don't call dbctty driver functions directly from dbc core code. Introduce a new dbc_driver structure that contains function pointers for disconnect and configure operations. The driver (ttydbc) must provide these opeations when creating a dbc. Name the structure dbc_driver instead of dbc_ops as we plan to add more driver configureable values here, such as vid and pid. Decouples dbc and dbctty. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-26-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
Split the dbc tty driver registrations function into separate init and probe parts. The init part will register the tty driver, and should in the future be called from module_init(). The probe part will become the normal probe function, but for now it is called from the init part. The unregister function is s likewise split into remove and exit parts. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-25-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
dbctty no longer needs references directly to dbc endpoints, so remove them Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-24-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
Don't pass endpoint pointer, dbctty should not be aware of struct dbc_ep, knowing the direction is enough. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-23-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
xhci_dbc_start() and xhci_dbc_stop() functions only used xhci_hcd pointer to get the dbc pointer. Pass the dbc pointer instead of the xhci_hcd pointer as a parameter No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-22-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
Dbc mem_init and mem_cleanup functions used xhci_hcd to get to the device pointer. The device pointer can be accessed directly from dbc structure, so pass a pointer to dbc as a parameter instead. No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-21-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
The generic xhci ring allocations code needs struct xhci_hcd pointer, and it allocates memory for the rings from dma pools created for the xhci device. In order to decouple xhci and DbC we have to create our own ring allocation and free routines for DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-20-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
The DbC context is different from the xhci device context. It's a lot smaller as it only contains three 64 bytes sub-contexts; the info, endpoint-out, and endpoint-in contexts. In total 192 bytes. The context size (CSZ) field in HCCPARAMS1 xhci register does not alter DbC context size like it does for xhci device contexts. So don't use the geneic xhci context memory allocation, or the dma pool that is intended for xhci device contexts. In addition to saving memory this also helps decoupleing xhci and dbc code. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-19-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
The dbc request completion callback doesn't need a xhci_hcd pointer. The only user of the xhci_hcd pointer in dbgtty request callback was the xhci_warn() function. Change it to dev_warn() instead. While changing the callback function parameter to dbc in struct xhci_requeset, move the struct xhci_request declaraion down a bit in the header file to avoid compiler warinings No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-18-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
Pass dbc pointer instead of struct xhci_hcd pointer to the get_in_ep() and get_out_ep() helper functions. No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-17-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
Pass dbc pointer to the xhci_dbc_tty_register_device() and xhci_dbc_tty_unregister_device() functions instead of xhci_hcd pointer These functions don't need a xhci_hcd pointer anymore, only use case was the xhci_err() function, which is now changed to a dev_err() instead. No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-16-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
The event handling function only used xhci pointer to get the dbc pointer. Pass the dbc pointer instead as a parameter No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-15-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
Pass the dbc pointer instead of xhci_hcd pointer in order to decouple xhci and dbc. xhci_do_dbc_stop() only used xhci to get the dbc pointer. Pass the dbc pointer instead as a parameter No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-14-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
struct xhci_hcd pointer is not needed for dbc endpoint init and exit, it was only used to get to the dbc structure. Pass the dbc pointer as a parameter to these functions instead. No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-13-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
dbc_ep_do_queue() can now get the device pointer directly from dbc structure instead of going through the xhci_hcd structure. No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-12-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
xhci_dbc_init_context() no longer needs the struct xhci_hcd pointer. Pass the dbc pointer directly instead. No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-11-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
xhci_write_64() is essentially a wrapper for lo_hi_writeq(), but it requires struct xhci_hcd * as a parameter. Use lo_hi_writeq() directly instead No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-10-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
To make this change possible we also need to change dbc_handle_port_status() to take dbc pointer as parameter instead of xhci_hcd pointer. Note that xhci_info() used xhci_to_hcd(xhci)->self.controller as the device while for dev_info we use xhci_to_hcd(xhci)->self.sysdev. In many cases those are the same, but not for some device where a dwc3 controller creates a xhci platform device. In th this case self.controller may be the platform device while self.sysdev is the actual device known to firmware (dwc3). This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-9-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
Currently the dbc structure contains a pointer to struct xhci_hcd, and dbc functions use that to dig up the underlying device pointer. We are trying to decouple xhci and dbc code, and prepare for code that use dbc such as dbctty into into real device drivers. This is one step along the way. Keep functionality the same and keep the xhci pointer, and let the new device pointer point to the xhci device for now. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-8-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
dbc_dma_free_coherent() takes struct xhci_hcd pointer as a parameter, but does nothing more than calls dma_free_coherent(). Remove it and call dma_free_coherent() directly instead. No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-7-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
dbc_dma_alloc_coherent() takes struct xhci_hcd pointer as an parameter, but does nothing more than calls dma_alloc_coherent(). Remove it and call dma_alloc_coherent() directly instead. No functional changes This change helps decoupling xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-6-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
The generic erst allocation and free functions take struct xhci_hcd pointer as a parameter. Create own erst helpers for DbC in order to decouple xhci and DbC Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-5-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
It's only used to dig out if we need to set a chain flag for specific hosts. Pass the flag directly as a parameter instead. No functional changes. xhci_link_seg() is also used by DbC code, this change helps decoupling xhci and DbC. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-4-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
The generic inc_deq() helper takes struct xhci_hcd pointer as a parameter, and is a lot more complex than needed for the DbC usecase. In order to decouple xhci and DbC we have to create our own small inc_evt_deq() helper, not relying on xhci. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-3-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Kai-Heng Feng authored
Current xhci debug message doesn't always output bus number, so it's hard to figure out it's from USB2 or USB3 root hub. In addition to that, some port numbers are offset to 0 and others are offset to 1. Use the latter to match the USB core. So use "bus number - port index + 1" to make debug message consistent. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-2-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 22 Jul, 2020 1 commit
-
-
Christoph Hellwig authored
Just switch the low-level routines to take kernel structures, and do the conversion from the compat to the native structure on that. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20200722073655.220011-1-hch@lst.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 21 Jul, 2020 12 commits
-
-
Greg Kroah-Hartman authored
Merge tag 'thunderbolt-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: thunderbolt: Changes for v5.9 merge window This includes following Thunderbolt/USB4 changes for v5.9 merge window: * Improvements around NHI (Native Host Interface) HopID allocation * Improvements to tunneling and USB3 bandwidth management support * Add KUnit tests for path walking and tunneling * Initial support for USB4 retimer firmware upgrade * Implement Thunderbolt device firmware upgrade mechanism that runs the NVM image authentication when the device is disconnected. * A couple of small non-critical fixes * tag 'thunderbolt-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (32 commits) thunderbolt: Fix old style declaration warning thunderbolt: Add support for authenticate on disconnect thunderbolt: Add support for separating the flush to SPI and authenticate thunderbolt: Ensure left shift of 512 does not overflow a 32 bit int thunderbolt: Add support for on-board retimers thunderbolt: Implement USB4 port sideband operations for retimer access thunderbolt: Retry USB4 block read operation thunderbolt: Generalize usb4_switch_do_[read|write]_data() thunderbolt: Split common NVM functionality into a separate file thunderbolt: Add Intel USB-IF ID to the NVM upgrade supported list thunderbolt: Add KUnit tests for tunneling thunderbolt: Add USB3 bandwidth management thunderbolt: Make tb_port_get_link_speed() available to other files thunderbolt: Implement USB3 bandwidth negotiation routines thunderbolt: Increase DP DPRX wait timeout thunderbolt: Report consumed bandwidth in both directions thunderbolt: Make usb4_switch_map_pcie_down() also return enabled ports thunderbolt: Make usb4_switch_map_usb3_down() also return enabled ports thunderbolt: Do not tunnel USB3 if link is not USB4 thunderbolt: Add DP IN resources for all routers ...
-
Linus Walleij authored
The OMAP1 OHCI driver is using the legacy GPIO API to grab some random GPIO lines. One is from the TPS65010 chip and used for power, another one is for overcurrent and while the driver picks this line it doesn't watch it at all. Convert the driver and the OMAP1 OSK board file to pass these two GPIOs as machine described GPIO descriptors. I noticed the overcurrent GPIO line is not really used in the code so dropped in a little comment for other developers. Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com> Cc: Tony Lindgren <tony@atomide.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20200720135524.100374-2-linus.walleij@linaro.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Linus Walleij authored
The OMAP1 was using static locals to hold the clock handles which is uncommon and does not scale. Create a private data struct and use that to hold the clocks. Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com> Cc: Tony Lindgren <tony@atomide.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20200720135524.100374-1-linus.walleij@linaro.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Xu Wang authored
usb_free_coherent() is safe with NULL addr and this check is not required. Signed-off-by: Xu Wang <vulab@iscas.ac.cn> Link: https://lore.kernel.org/r/20200720052456.7610-1-vulab@iscas.ac.cnSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Alexander A. Klimov authored
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Link: https://lore.kernel.org/r/20200719160910.60018-1-grandmaster@al2klimov.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Bixuan Cui authored
Fix the warning: [-Werror=-Wframe-larger-than=] drivers/usb/misc/usbtest.c: In function 'test_queue': drivers/usb/misc/usbtest.c:2148:1: warning: the frame size of 1232 bytes is larger than 1024 bytes Reported-by: kbuild test robot <lkp@intel.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Bixuan Cui <cuibixuan@huawei.com> Link: https://lore.kernel.org/r/ffa85702-86ab-48d7-4da2-2efcc94b05d3@huawei.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Badhri Jagan Sridharan authored
Port starts to toggle when transitioning to unattached state. This is incorrect while in BIST mode. 6.4.3.1 BIST Carrier Mode Upon receipt of a BIST Message, with a BIST Carrier Mode BIST Data Object, the UUT Shall send out a continuous string of BMC encoded alternating "1"s and “0”s. The UUT Shall exit the Continuous BIST Mode within tBISTContMode of this Continuous BIST Mode being enabled(see Section 6.6.7.2). 6.4.3.2 BIST Test Data Upon receipt of a BIST Message, with a BIST Test Data BIST Data Object, the UUT Shall return a GoodCRC Message and Shall enter a test mode in which it sends no further Messages except for GoodCRC Messages in response to received Messages. See Section 5.9.2 for the definition of the Test Data Frame. The test Shall be ended by sending Hard Reset Signaling to reset the UUT. Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200716034128.1251728-3-badhri@google.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Badhri Jagan Sridharan authored
Quoting from TCPCI spec: "Setting this bit to 1 is intended to be used only when a USB compliance tester is using USB BIST Test Data to test the PHY layer of the TCPC. The TCPM should clear this bit when a disconnect is detected. 0: Normal Operation. Incoming messages enabled by RECEIVE_DETECT passed to TCPM via Alert. 1: BIST Test Mode. Incoming messages enabled by RECEIVE_DETECT result in GoodCRC response but may not be passed to the TCPM via Alert." Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200716034128.1251728-2-badhri@google.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Badhri Jagan Sridharan authored
TCPM supports BIST carried mode. PD compliance tests require BIST Test Data to be supported as well. Introducing set_bist_data callback to signal tcpc driver for configuring the port controller hardware to enable/disable BIST Test Data mode. Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200716034128.1251728-1-badhri@google.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Kyle Tso authored
typec_partner_register_altmode returns ERR_PTR. Reset the pointer altmode to NULL on failure. Signed-off-by: Kyle Tso <kyletso@google.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200714033453.4044482-3-kyletso@google.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Kyle Tso authored
typec_register_altmode returns ERR_PTR on failure. Signed-off-by: Kyle Tso <kyletso@google.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200714033453.4044482-2-kyletso@google.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Prashant Malani authored
When pmc_usb_mux_set() is invoked when a device is disconnected, a valid scenario is for state->alt == NULL and state->mode == TYPEC_STATE_USB. In such cases, if a pmc_usb_disconnect() has already been issued (from either pmc_usb_set_orientation() when orientation == TYPEC_ORIENTATION_NONE, or pmc_usb_set_role() when role == USB_ROLE_NONE), a pmc_usb_connect() will be issued despite no peripheral being present. This confuses the PMC and leads to all subsequent PMC IPC requests returning errors due to timeout. To prevent this, return early if the port orientation or role is already set to none. Cc: Benson Leung <bleung@chromium.org> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com> Cc: Rajmohan Mani <rajmohan.mani@intel.com> Fixes: f3c1c41e ("usb: typec: intel_pmc_mux: Add support for USB4") Signed-off-by: Prashant Malani <pmalani@chromium.org> Link: https://lore.kernel.org/r/20200709002441.1309189-1-pmalani@chromium.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-