diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-24 23:07:00 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-24 23:07:00 +0300 |
commit | 72bffe7e1eb6cb82b90aa14cd786f3f5ede9e0ae (patch) | |
tree | 4af7472d4342f61bba8d86e8d376bbd049ee8126 /drivers/thunderbolt/ctl.c | |
parent | ab7362d04d7c14923420c1e19e889da512a65cd7 (diff) | |
parent | 1243741f6b02b5f2c06bca910f894c333838f994 (diff) | |
download | linux-72bffe7e1eb6cb82b90aa14cd786f3f5ede9e0ae.tar.xz |
Merge tag 'usb-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB / Thunderbolt driver updates from Greg KH:
"Here is the big set of USB and Thunderbolt driver changes for 6.3-rc1.
Nothing major in here, just lots of good development, including:
- Thunderbolt additions for new device support and features
- xhci driver updates and cleanups
- USB gadget media driver updates (includes media core changes that
were acked by the v4l2 maintainers)
- lots of other USB gadget driver updates for new features
- dwc3 driver updates and fixes
- minor debugfs leak fixes
- typec driver updates and additions
- dt-bindings conversions to yaml
- other small bugfixes and driver updates
All have been in linux-next for a while with no reported issues"
* tag 'usb-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (237 commits)
usb: dwc3: xilinx: Remove unused of_gpio,h
usb: typec: pd: Add higher capability sysfs for sink PDO
usb: typec: pd: Remove usb_suspend_supported sysfs from sink PDO
usb: dwc3: pci: add support for the Intel Meteor Lake-M
usb: gadget: u_ether: Don't warn in gether_setup_name_default()
usb: gadget: u_ether: Convert prints to device prints
usb: gadget: u_serial: Add null pointer check in gserial_resume
usb: gadget: uvc: fix missing mutex_unlock() if kstrtou8() fails
xhci: host: potential NULL dereference in xhci_generic_plat_probe()
dt-bindings: usb: amlogic,meson-g12a-usb-ctrl: make G12A usb3-phy0 optional
usb: host: fsl-mph-dr-of: reuse device_set_of_node_from_dev
of: device: Do not ignore error code in of_device_uevent_modalias
of: device: Ignore modalias of reused nodes
usb: gadget: configfs: Fix set but not used variable warning
usb: gadget: uvc: Use custom strings if available
usb: gadget: uvc: Allow linking function to string descs
usb: gadget: uvc: Pick up custom string descriptor IDs
usb: gadget: uvc: Allow linking XUs to string descriptors
usb: gadget: configfs: Attach arbitrary strings to cdev
usb: gadget: configfs: Support arbitrary string descriptors
...
Diffstat (limited to 'drivers/thunderbolt/ctl.c')
-rw-r--r-- | drivers/thunderbolt/ctl.c | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 0c661a706160..6e7d28e8d81a 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -230,7 +230,6 @@ static int check_config_address(struct tb_cfg_address addr, static struct tb_cfg_result decode_error(const struct ctl_pkg *response) { struct cfg_error_pkg *pkg = response->buffer; - struct tb_ctl *ctl = response->ctl; struct tb_cfg_result res = { 0 }; res.response_route = tb_cfg_get_route(&pkg->header); res.response_port = 0; @@ -239,13 +238,6 @@ static struct tb_cfg_result decode_error(const struct ctl_pkg *response) if (res.err) return res; - if (pkg->zero1) - tb_ctl_warn(ctl, "pkg->zero1 is %#x\n", pkg->zero1); - if (pkg->zero2) - tb_ctl_warn(ctl, "pkg->zero2 is %#x\n", pkg->zero2); - if (pkg->zero3) - tb_ctl_warn(ctl, "pkg->zero3 is %#x\n", pkg->zero3); - res.err = 1; res.tb_error = pkg->error; res.response_port = pkg->port; @@ -416,6 +408,7 @@ static int tb_async_error(const struct ctl_pkg *pkg) case TB_CFG_ERROR_LINK_ERROR: case TB_CFG_ERROR_HEC_ERROR_DETECTED: case TB_CFG_ERROR_FLOW_CONTROL_ERROR: + case TB_CFG_ERROR_DP_BW: return true; default: @@ -736,6 +729,47 @@ void tb_ctl_stop(struct tb_ctl *ctl) /* public interface, commands */ /** + * tb_cfg_ack_notification() - Ack notification + * @ctl: Control channel to use + * @route: Router that originated the event + * @error: Pointer to the notification package + * + * Call this as response for non-plug notification to ack it. Returns + * %0 on success or an error code on failure. + */ +int tb_cfg_ack_notification(struct tb_ctl *ctl, u64 route, + const struct cfg_error_pkg *error) +{ + struct cfg_ack_pkg pkg = { + .header = tb_cfg_make_header(route), + }; + const char *name; + + switch (error->error) { + case TB_CFG_ERROR_LINK_ERROR: + name = "link error"; + break; + case TB_CFG_ERROR_HEC_ERROR_DETECTED: + name = "HEC error"; + break; + case TB_CFG_ERROR_FLOW_CONTROL_ERROR: + name = "flow control error"; + break; + case TB_CFG_ERROR_DP_BW: + name = "DP_BW"; + break; + default: + name = "unknown"; + break; + } + + tb_ctl_dbg(ctl, "acking %s (%#x) notification on %llx\n", name, + error->error, route); + + return tb_ctl_tx(ctl, &pkg, sizeof(pkg), TB_CFG_PKG_NOTIFY_ACK); +} + +/** * tb_cfg_ack_plug() - Ack hot plug/unplug event * @ctl: Control channel to use * @route: Router that originated the event @@ -754,7 +788,7 @@ int tb_cfg_ack_plug(struct tb_ctl *ctl, u64 route, u32 port, bool unplug) .pg = unplug ? TB_CFG_ERROR_PG_HOT_UNPLUG : TB_CFG_ERROR_PG_HOT_PLUG, }; - tb_ctl_dbg(ctl, "acking hot %splug event on %llx:%x\n", + tb_ctl_dbg(ctl, "acking hot %splug event on %llx:%u\n", unplug ? "un" : "", route, port); return tb_ctl_tx(ctl, &pkg, sizeof(pkg), TB_CFG_PKG_ERROR); } |