]> Git Repo - J-linux.git/commitdiff
Merge tag 'usb-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
authorLinus Torvalds <[email protected]>
Thu, 26 Sep 2024 16:45:36 +0000 (09:45 -0700)
committerLinus Torvalds <[email protected]>
Thu, 26 Sep 2024 16:45:36 +0000 (09:45 -0700)
Pull USB/Thunderbolt updates from Greg KH:
 "Here is the large set of USB and Thunderbolt changes for 6.12-rc1.

  Nothing "major" in here, except for a new 9p network gadget that has
  been worked on for a long time (all of the needed acks are here)

  Other than that, it's the usual set of:

   - Thunderbolt / USB4 driver updates and additions for new hardware

   - dwc3 driver updates and new features added

   - xhci driver updates

   - typec driver updates

   - USB gadget updates and api additions to make some gadgets more
     configurable by userspace

   - dwc2 driver updates

   - usb phy driver updates

   - usbip feature additions

   - other minor USB driver updates

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

* tag 'usb-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (145 commits)
  sub: cdns3: Use predefined PCI vendor ID constant
  sub: cdns2: Use predefined PCI vendor ID constant
  USB: misc: yurex: fix race between read and write
  USB: misc: cypress_cy7c63: check for short transfer
  USB: appledisplay: close race between probe and completion handler
  USB: class: CDC-ACM: fix race between get_serial and set_serial
  usb: r8a66597-hcd: make read-only const arrays static
  usb: typec: ucsi: Fix busy loop on ASUS VivoBooks
  usb: dwc3: rtk: Clean up error code in __get_dwc3_maximum_speed()
  usb: storage: ene_ub6250: Fix right shift warnings
  usb: roles: Improve the fix for a false positive recursive locking complaint
  locking/mutex: Introduce mutex_init_with_key()
  locking/mutex: Define mutex_init() once
  net/9p/usbg: fix CONFIG_USB_GADGET dependency
  usb: xhci: fix loss of data on Cadence xHC
  usb: xHCI: add XHCI_RESET_ON_RESUME quirk for Phytium xHCI host
  usb: dwc3: imx8mp: disable SS_CON and U3 wakeup for system sleep
  usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode
  usb: host: xhci-plat: Parse xhci-missing_cas_quirk and apply quirk
  usb: misc: onboard_usb_dev: add Microchip usb5744 SMBus programming support
  ...

1  2 
Documentation/filesystems/9p.rst
drivers/usb/typec/anx7411.c
drivers/usb/typec/tipd/core.c

index d270a0aa8d55eae7aacac5b29154053a6b7cdc5e,514ed13a0122b04bb06bc32c8c136299e35caf2a..2bbf68b56b0d716f7c42b57feb74349149c8d45d
@@@ -31,7 -31,7 +31,7 @@@ Other applications are described in th
        * PROSE I/O: Using 9p to enable Application Partitions
          http://plan9.escet.urjc.es/iwp9/cready/PROSE_iwp9_2006.pdf
        * VirtFS: A Virtualization Aware File System pass-through
 -        http://goo.gl/3WPDg
 +        https://kernel.org/doc/ols/2010/ols2010-pages-109-120.pdf
  
  Usage
  =====
@@@ -48,11 -48,66 +48,66 @@@ For server running on QEMU host with vi
  
        mount -t 9p -o trans=virtio <mount_tag> /mnt/9
  
- where mount_tag is the tag associated by the server to each of the exported
+ where mount_tag is the tag generated by the server to each of the exported
  mount points. Each 9P export is seen by the client as a virtio device with an
  associated "mount_tag" property. Available mount tags can be
  seen by reading /sys/bus/virtio/drivers/9pnet_virtio/virtio<n>/mount_tag files.
  
+ USBG Usage
+ ==========
+ To mount a 9p FS on a USB Host accessible via the gadget at runtime::
+       mount -t 9p -o trans=usbg,aname=/path/to/fs <device> /mnt/9
+ To mount a 9p FS on a USB Host accessible via the gadget as root filesystem::
+       root=<device> rootfstype=9p rootflags=trans=usbg,cache=loose,uname=root,access=0,dfltuid=0,dfltgid=0,aname=/path/to/rootfs
+ where <device> is the tag associated by the usb gadget transport.
+ It is defined by the configfs instance name.
+ USBG Example
+ ============
+ The USB host exports a filesystem, while the gadget on the USB device
+ side makes it mountable.
+ Diod (9pfs server) and the forwarder are on the development host, where
+ the root filesystem is actually stored. The gadget is initialized during
+ boot (or later) on the embedded board. Then the forwarder will find it
+ on the USB bus and start forwarding requests.
+ In this case the 9p requests come from the device and are handled by the
+ host. The reason is that USB device ports are normally not available on
+ PCs, so a connection in the other direction would not work.
+ When using the usbg transport, for now there is no native usb host
+ service capable to handle the requests from the gadget driver. For
+ this we have to use the extra python tool p9_fwd.py from tools/usb.
+ Just start the 9pfs capable network server like diod/nfs-ganesha e.g.::
+         $ diod -f -n -d 0 -S -l 0.0.0.0:9999 -e $PWD
+ Optionaly scan your bus if there are more then one usbg gadgets to find their path::
+         $ python $kernel_dir/tools/usb/p9_fwd.py list
+         Bus | Addr | Manufacturer     | Product          | ID        | Path
+         --- | ---- | ---------------- | ---------------- | --------- | ----
+           2 |   67 | unknown          | unknown          | 1d6b:0109 | 2-1.1.2
+           2 |   68 | unknown          | unknown          | 1d6b:0109 | 2-1.1.3
+ Then start the python transport::
+         $ python $kernel_dir/tools/usb/p9_fwd.py --path 2-1.1.2 connect -p 9999
+ After that the gadget driver can be used as described above.
+ One use-case is to use it as an alternative to NFS root booting during
+ the development of embedded Linux devices.
  Options
  =======
  
                        virtio    connect to the next virtio channel available
                                  (from QEMU with trans_virtio module)
                        rdma      connect to a specified RDMA channel
+                       usbg      connect to a specified usb gadget channel
                        ========  ============================================
  
    uname=name  user name to attempt mount as on the remote server.  The
index 31e3e9544bc0f454455b6fd6eb2c201f8dbb2242,06d88e9caeaf176ccbbc9e2714b21673a0e67794..d1e7c487ddfbb55aded01dfaa93721c26bc8c17e
@@@ -6,6 -6,7 +6,7 @@@
   * Copyright(c) 2022, Analogix Semiconductor. All rights reserved.
   *
   */
+ #include <linux/bitfield.h>
  #include <linux/gpio/consumer.h>
  #include <linux/i2c.h>
  #include <linux/interrupt.h>
@@@ -884,8 -885,8 +885,8 @@@ static void anx7411_chip_standby(struc
                                OCM_RESET);
        ret |= anx7411_reg_write(ctx->tcpc_client, ANALOG_CTRL_10, 0x80);
        /* Set TCPC to RD and DRP enable */
-       cc1 = TCPC_ROLE_CTRL_CC_RD << TCPC_ROLE_CTRL_CC1_SHIFT;
-       cc2 = TCPC_ROLE_CTRL_CC_RD << TCPC_ROLE_CTRL_CC2_SHIFT;
+       cc1 = FIELD_PREP(TCPC_ROLE_CTRL_CC1, TCPC_ROLE_CTRL_CC_RD);
+       cc2 = FIELD_PREP(TCPC_ROLE_CTRL_CC2, TCPC_ROLE_CTRL_CC_RD);
        ret |= anx7411_reg_write(ctx->tcpc_client, TCPC_ROLE_CTRL,
                                 TCPC_ROLE_CTRL_DRP | cc1 | cc2);
  
@@@ -1339,6 -1340,12 +1340,6 @@@ static void anx7411_get_gpio_irq(struc
                dev_err(dev, "failed to get GPIO IRQ\n");
  }
  
 -static enum power_supply_usb_type anx7411_psy_usb_types[] = {
 -      POWER_SUPPLY_USB_TYPE_C,
 -      POWER_SUPPLY_USB_TYPE_PD,
 -      POWER_SUPPLY_USB_TYPE_PD_PPS,
 -};
 -
  static enum power_supply_property anx7411_psy_props[] = {
        POWER_SUPPLY_PROP_USB_TYPE,
        POWER_SUPPLY_PROP_ONLINE,
@@@ -1416,9 -1423,8 +1417,9 @@@ static int anx7411_psy_register(struct 
  
        psy_desc->name = psy_name;
        psy_desc->type = POWER_SUPPLY_TYPE_USB;
 -      psy_desc->usb_types = anx7411_psy_usb_types;
 -      psy_desc->num_usb_types = ARRAY_SIZE(anx7411_psy_usb_types);
 +      psy_desc->usb_types = BIT(POWER_SUPPLY_USB_TYPE_C)  |
 +                            BIT(POWER_SUPPLY_USB_TYPE_PD) |
 +                            BIT(POWER_SUPPLY_USB_TYPE_PD_PPS);
        psy_desc->properties = anx7411_psy_props;
        psy_desc->num_properties = ARRAY_SIZE(anx7411_psy_props);
  
@@@ -1571,6 -1577,7 +1572,7 @@@ static const struct of_device_id anx_ma
        {.compatible = "analogix,anx7411",},
        {},
  };
+ MODULE_DEVICE_TABLE(of, anx_match_table);
  
  static struct i2c_driver anx7411_driver = {
        .driver = {
index d532670885e4567d3cbcfd909ff581389b9b6563,256b0c054e9a95f5139db358e2c74f58c5dca785..7ee721a877c12d9d0380cec8a04e4aa0ae6b22af
@@@ -150,6 -150,11 +150,6 @@@ static enum power_supply_property tps65
        POWER_SUPPLY_PROP_ONLINE,
  };
  
 -static enum power_supply_usb_type tps6598x_psy_usb_types[] = {
 -      POWER_SUPPLY_USB_TYPE_C,
 -      POWER_SUPPLY_USB_TYPE_PD,
 -};
 -
  static const char *tps6598x_psy_name_prefix = "tps6598x-source-psy-";
  
  /*
@@@ -822,8 -827,8 +822,8 @@@ static int devm_tps6598_psy_register(st
  
        tps->psy_desc.name = psy_name;
        tps->psy_desc.type = POWER_SUPPLY_TYPE_USB;
 -      tps->psy_desc.usb_types = tps6598x_psy_usb_types;
 -      tps->psy_desc.num_usb_types = ARRAY_SIZE(tps6598x_psy_usb_types);
 +      tps->psy_desc.usb_types = BIT(POWER_SUPPLY_USB_TYPE_C) |
 +                                BIT(POWER_SUPPLY_USB_TYPE_PD);
        tps->psy_desc.properties = tps6598x_psy_props;
        tps->psy_desc.num_properties = ARRAY_SIZE(tps6598x_psy_props);
        tps->psy_desc.get_property = tps6598x_psy_get_prop;
@@@ -1460,8 -1465,9 +1460,9 @@@ static void tps6598x_remove(struct i2c_
  
        if (!client->irq)
                cancel_delayed_work_sync(&tps->wq_poll);
+       else
+               devm_free_irq(tps->dev, client->irq, tps);
  
-       devm_free_irq(tps->dev, client->irq, tps);
        tps6598x_disconnect(tps, 0);
        typec_unregister_port(tps->port);
        usb_role_switch_put(tps->role_sw);
This page took 0.076762 seconds and 4 git commands to generate.