Skip to content

Commit 37ebb54

Browse files
pmladekgregkh
authored andcommitted
usb: hub: rename khubd to hub_wq in documentation and comments
USB hub has started to use a workqueue instead of kthread. Let's update the documentation and comments here and there. This patch mostly just replaces "khubd" with "hub_wq". There are only few exceptions where the whole sentence was updated. These more complicated changes can be found in the following files: Documentation/usb/hotplug.txt drivers/net/usb/usbnet.c drivers/usb/core/hcd.c drivers/usb/host/ohci-hcd.c drivers/usb/host/xhci.c Signed-off-by: Petr Mladek <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 59d48b3 commit 37ebb54

29 files changed

+89
-86
lines changed

Documentation/DocBook/usb.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ for (;;) {
593593
Each device has one control endpoint (endpoint zero)
594594
which supports a limited RPC style RPC access.
595595
Devices are configured
596-
by khubd (in the kernel) setting a device-wide
596+
by hub_wq (in the kernel) setting a device-wide
597597
<emphasis>configuration</emphasis> that affects things
598598
like power consumption and basic functionality.
599599
The endpoints are part of USB <emphasis>interfaces</emphasis>,

Documentation/usb/WUSB-Design-overview.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ HC picks the /DN_Connect/ out (nep module sends to notif.c for delivery
308308
into /devconnect/). This process starts the authentication process for
309309
the device. First we allocate a /fake port/ and assign an
310310
unauthenticated address (128 to 255--what we really do is
311-
0x80 | fake_port_idx). We fiddle with the fake port status and /khubd/
311+
0x80 | fake_port_idx). We fiddle with the fake port status and /hub_wq/
312312
sees a new connection, so he moves on to enable the fake port with a reset.
313313

314314
So now we are in the reset path -- we know we have a non-yet enumerated
@@ -317,7 +317,7 @@ device with an unauthorized address; we ask user space to authenticate
317317
exchange (FIXME: not yet done) and issue a /set address 0/ to bring the
318318
device to the default state. Device is authenticated.
319319

320-
From here, the USB stack takes control through the usb_hcd ops. khubd
320+
From here, the USB stack takes control through the usb_hcd ops. hub_wq
321321
has seen the port status changes, as we have been toggling them. It will
322322
start enumerating and doing transfers through usb_hcd->urb_enqueue() to
323323
read descriptors and move our data.
@@ -331,7 +331,7 @@ Keep Alive IE; it responds with a /DN_Alive/ pong during the DNTS (this
331331
arrives to us as a notification through
332332
devconnect.c:wusb_handle_dn_alive(). If a device times out, we
333333
disconnect it from the system (cleaning up internal information and
334-
toggling the bits in the fake hub port, which kicks khubd into removing
334+
toggling the bits in the fake hub port, which kicks hub_wq into removing
335335
the rest of the stuff).
336336

337337
This is done through devconnect:__wusb_check_devs(), which will scan the

Documentation/usb/hotplug.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ USB POLICY AGENT
5858

5959
The USB subsystem currently invokes /sbin/hotplug when USB devices
6060
are added or removed from system. The invocation is done by the kernel
61-
hub daemon thread [khubd], or else as part of root hub initialization
61+
hub workqueue [hub_wq], or else as part of root hub initialization
6262
(done by init, modprobe, kapmd, etc). Its single command line parameter
6363
is the string "usb", and it passes these environment variables:
6464

drivers/net/usb/usbnet.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@
6969
// reawaken network queue this soon after stopping; else watchdog barks
7070
#define TX_TIMEOUT_JIFFIES (5*HZ)
7171

72-
// throttle rx/tx briefly after some faults, so khubd might disconnect()
73-
// us (it polls at HZ/4 usually) before we report too many false errors.
72+
/* throttle rx/tx briefly after some faults, so hub_wq might disconnect()
73+
* us (it polls at HZ/4 usually) before we report too many false errors.
74+
*/
7475
#define THROTTLE_JIFFIES (HZ/8)
7576

7677
// between wakeups
@@ -595,9 +596,9 @@ static void rx_complete (struct urb *urb)
595596
"rx shutdown, code %d\n", urb_status);
596597
goto block;
597598

598-
/* we get controller i/o faults during khubd disconnect() delays.
599+
/* we get controller i/o faults during hub_wq disconnect() delays.
599600
* throttle down resubmits, to avoid log floods; just temporarily,
600-
* so we still recover when the fault isn't a khubd delay.
601+
* so we still recover when the fault isn't a hub_wq delay.
601602
*/
602603
case -EPROTO:
603604
case -ETIME:
@@ -1185,8 +1186,9 @@ static void tx_complete (struct urb *urb)
11851186
case -ESHUTDOWN: // hardware gone
11861187
break;
11871188

1188-
// like rx, tx gets controller i/o faults during khubd delays
1189-
// and so it uses the same throttling mechanism.
1189+
/* like rx, tx gets controller i/o faults during hub_wq
1190+
* delays and so it uses the same throttling mechanism.
1191+
*/
11901192
case -EPROTO:
11911193
case -ETIME:
11921194
case -EILSEQ:

drivers/usb/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Here is a list of what each subdirectory here is, and what is contained in
2424
them.
2525

2626
core/ - This is for the core USB host code, including the
27-
usbfs files and the hub class driver ("khubd").
27+
usbfs files and the hub class driver ("hub_wq").
2828

2929
host/ - This is for USB host controller drivers. This
3030
includes UHCI, OHCI, EHCI, and others that might

drivers/usb/core/hcd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,7 +2301,7 @@ EXPORT_SYMBOL_GPL(usb_hcd_resume_root_hub);
23012301
* Context: in_interrupt()
23022302
*
23032303
* Starts enumeration, with an immediate reset followed later by
2304-
* khubd identifying and possibly configuring the device.
2304+
* hub_wq identifying and possibly configuring the device.
23052305
* This is needed by OTG controller drivers, where it helps meet
23062306
* HNP protocol timing requirements for starting a port reset.
23072307
*
@@ -2320,7 +2320,7 @@ int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num)
23202320
if (port_num && hcd->driver->start_port_reset)
23212321
status = hcd->driver->start_port_reset(hcd, port_num);
23222322

2323-
/* run khubd shortly after (first) root port reset finishes;
2323+
/* allocate hub_wq shortly after (first) root port reset finishes;
23242324
* it may issue others, until at least 50 msecs have passed.
23252325
*/
23262326
if (status == 0)
@@ -2383,7 +2383,7 @@ void usb_hc_died (struct usb_hcd *hcd)
23832383
if (hcd->rh_registered) {
23842384
clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
23852385

2386-
/* make khubd clean up old urbs and devices */
2386+
/* make hub_wq clean up old urbs and devices */
23872387
usb_set_device_state (hcd->self.root_hub,
23882388
USB_STATE_NOTATTACHED);
23892389
usb_kick_hub_wq(hcd->self.root_hub);
@@ -2393,7 +2393,7 @@ void usb_hc_died (struct usb_hcd *hcd)
23932393
if (hcd->rh_registered) {
23942394
clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
23952395

2396-
/* make khubd clean up old urbs and devices */
2396+
/* make hub_wq clean up old urbs and devices */
23972397
usb_set_device_state(hcd->self.root_hub,
23982398
USB_STATE_NOTATTACHED);
23992399
usb_kick_hub_wq(hcd->self.root_hub);
@@ -2655,7 +2655,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
26552655
set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
26562656

26572657
/* HC is in reset state, but accessible. Now do the one-time init,
2658-
* bottom up so that hcds can customize the root hubs before khubd
2658+
* bottom up so that hcds can customize the root hubs before hub_wq
26592659
* starts talking to them. (Note, bus id is assigned early too.)
26602660
*/
26612661
if ((retval = hcd_buffer_create(hcd)) != 0) {

drivers/usb/core/hub.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ static void hub_irq(struct urb *urb)
652652
hub->error = status;
653653
/* FALL THROUGH */
654654

655-
/* let khubd handle things */
655+
/* let hub_wq handle things */
656656
case 0: /* we got data: port status changed */
657657
bits = 0;
658658
for (i = 0; i < urb->actual_length; ++i)
@@ -664,7 +664,7 @@ static void hub_irq(struct urb *urb)
664664

665665
hub->nerrors = 0;
666666

667-
/* Something happened, let khubd figure it out */
667+
/* Something happened, let hub_wq figure it out */
668668
kick_hub_wq(hub);
669669

670670
resubmit:
@@ -695,7 +695,7 @@ hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt)
695695
}
696696

697697
/*
698-
* enumeration blocks khubd for a long time. we use keventd instead, since
698+
* enumeration blocks hub_wq for a long time. we use keventd instead, since
699699
* long blocking there is the exception, not the rule. accordingly, HCDs
700700
* talking to TTs must queue control transfers (not just bulk and iso), so
701701
* both can talk to the same hub concurrently.
@@ -961,7 +961,7 @@ static int hub_port_disable(struct usb_hub *hub, int port1, int set_state)
961961

962962
/*
963963
* Disable a port and mark a logical connect-change event, so that some
964-
* time later khubd will disconnect() any existing usb_device on the port
964+
* time later hub_wq will disconnect() any existing usb_device on the port
965965
* and will re-enumerate if there actually is a device attached.
966966
*/
967967
static void hub_port_logical_disconnect(struct usb_hub *hub, int port1)
@@ -974,7 +974,7 @@ static void hub_port_logical_disconnect(struct usb_hub *hub, int port1)
974974
* - SRP saves power that way
975975
* - ... new call, TBD ...
976976
* That's easy if this hub can switch power per-port, and
977-
* khubd reactivates the port later (timer, SRP, etc).
977+
* hub_wq reactivates the port later (timer, SRP, etc).
978978
* Powerdown must be optional, because of reset/DFU.
979979
*/
980980

@@ -987,7 +987,7 @@ static void hub_port_logical_disconnect(struct usb_hub *hub, int port1)
987987
* @udev: device to be disabled and removed
988988
* Context: @udev locked, must be able to sleep.
989989
*
990-
* After @udev's port has been disabled, khubd is notified and it will
990+
* After @udev's port has been disabled, hub_wq is notified and it will
991991
* see that the device has been disconnected. When the device is
992992
* physically unplugged and something is plugged in, the events will
993993
* be received and processed normally.
@@ -1107,7 +1107,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
11071107
init2:
11081108

11091109
/*
1110-
* Check each port and set hub->change_bits to let khubd know
1110+
* Check each port and set hub->change_bits to let hub_wq know
11111111
* which ports need attention.
11121112
*/
11131113
for (port1 = 1; port1 <= hdev->maxchild; ++port1) {
@@ -1174,7 +1174,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
11741174
clear_bit(port1, hub->removed_bits);
11751175

11761176
if (!udev || udev->state == USB_STATE_NOTATTACHED) {
1177-
/* Tell khubd to disconnect the device or
1177+
/* Tell hub_wq to disconnect the device or
11781178
* check for a new connection
11791179
*/
11801180
if (udev || (portstatus & USB_PORT_STAT_CONNECTION) ||
@@ -1187,7 +1187,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
11871187
USB_SS_PORT_LS_U0;
11881188
/* The power session apparently survived the resume.
11891189
* If there was an overcurrent or suspend change
1190-
* (i.e., remote wakeup request), have khubd
1190+
* (i.e., remote wakeup request), have hub_wq
11911191
* take care of it. Look at the port link state
11921192
* for USB 3.0 hubs, since they don't have a suspend
11931193
* change bit, and they don't set the port link change
@@ -1208,18 +1208,18 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
12081208
set_bit(port1, hub->change_bits);
12091209

12101210
} else {
1211-
/* The power session is gone; tell khubd */
1211+
/* The power session is gone; tell hub_wq */
12121212
usb_set_device_state(udev, USB_STATE_NOTATTACHED);
12131213
set_bit(port1, hub->change_bits);
12141214
}
12151215
}
12161216

12171217
/* If no port-status-change flags were set, we don't need any
12181218
* debouncing. If flags were set we can try to debounce the
1219-
* ports all at once right now, instead of letting khubd do them
1219+
* ports all at once right now, instead of letting hub_wq do them
12201220
* one at a time later on.
12211221
*
1222-
* If any port-status changes do occur during this delay, khubd
1222+
* If any port-status changes do occur during this delay, hub_wq
12231223
* will see them later and handle them normally.
12241224
*/
12251225
if (need_debounce_delay) {
@@ -1280,7 +1280,7 @@ static void hub_quiesce(struct usb_hub *hub, enum hub_quiescing_type type)
12801280

12811281
cancel_delayed_work_sync(&hub->init_work);
12821282

1283-
/* khubd and related activity won't re-trigger */
1283+
/* hub_wq and related activity won't re-trigger */
12841284
hub->quiescing = 1;
12851285

12861286
if (type != HUB_SUSPEND) {
@@ -1291,7 +1291,7 @@ static void hub_quiesce(struct usb_hub *hub, enum hub_quiescing_type type)
12911291
}
12921292
}
12931293

1294-
/* Stop khubd and related activity */
1294+
/* Stop hub_wq and related activity */
12951295
usb_kill_urb(hub->urb);
12961296
if (hub->has_indicators)
12971297
cancel_delayed_work_sync(&hub->leds);
@@ -1613,7 +1613,7 @@ static int hub_configure(struct usb_hub *hub,
16131613
if (ret < 0)
16141614
goto fail;
16151615

1616-
/* Update the HCD's internal representation of this hub before khubd
1616+
/* Update the HCD's internal representation of this hub before hub_wq
16171617
* starts getting port status changes for devices under the hub.
16181618
*/
16191619
if (hcd->driver->update_hub_device) {
@@ -2045,7 +2045,7 @@ static void choose_devnum(struct usb_device *udev)
20452045
int devnum;
20462046
struct usb_bus *bus = udev->bus;
20472047

2048-
/* If khubd ever becomes multithreaded, this will need a lock */
2048+
/* If hub_wq ever becomes multithreaded, this will need a lock */
20492049
if (udev->wusb) {
20502050
devnum = udev->portnum + 1;
20512051
BUG_ON(test_bit(devnum, bus->devmap.devicemap));
@@ -3074,7 +3074,7 @@ static unsigned wakeup_enabled_descendants(struct usb_device *udev)
30743074
* Once VBUS drop breaks the circuit, the port it's using has to go through
30753075
* normal re-enumeration procedures, starting with enabling VBUS power.
30763076
* Other than re-initializing the hub (plug/unplug, except for root hubs),
3077-
* Linux (2.6) currently has NO mechanisms to initiate that: no khubd
3077+
* Linux (2.6) currently has NO mechanisms to initiate that: no hub_wq
30783078
* timer, no SRP, no requests through sysfs.
30793079
*
30803080
* If Runtime PM isn't enabled or used, non-SuperSpeed devices may not get
@@ -3216,7 +3216,7 @@ static int finish_port_resume(struct usb_device *udev)
32163216
/* usb ch9 identifies four variants of SUSPENDED, based on what
32173217
* state the device resumes to. Linux currently won't see the
32183218
* first two on the host side; they'd be inside hub_port_init()
3219-
* during many timeouts, but khubd can't suspend until later.
3219+
* during many timeouts, but hub_wq can't suspend until later.
32203220
*/
32213221
usb_set_device_state(udev, udev->actconfig
32223222
? USB_STATE_CONFIGURED
@@ -3581,7 +3581,7 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
35813581

35823582
dev_dbg(&intf->dev, "%s\n", __func__);
35833583

3584-
/* stop khubd and related activity */
3584+
/* stop hub_wq and related activity */
35853585
hub_quiesce(hub, HUB_SUSPEND);
35863586
return 0;
35873587
}
@@ -4977,10 +4977,10 @@ static void port_event(struct usb_hub *hub, int port1)
49774977
* On disconnect USB3 protocol ports transit from U0 to
49784978
* SS.Inactive to Rx.Detect. If this happens a warm-
49794979
* reset is not needed, but a (re)connect may happen
4980-
* before khubd runs and sees the disconnect, and the
4980+
* before hub_wq runs and sees the disconnect, and the
49814981
* device may be an unknown state.
49824982
*
4983-
* If the port went through SS.Inactive without khubd
4983+
* If the port went through SS.Inactive without hub_wq
49844984
* seeing it the C_LINK_STATE change flag will be set,
49854985
* and we reset the dev to put it in a known state.
49864986
*/
@@ -5290,7 +5290,7 @@ static int descriptors_changed(struct usb_device *udev,
52905290
* former operating configuration. If the reset fails, or the device's
52915291
* descriptors change from their values before the reset, or the original
52925292
* configuration and altsettings cannot be restored, a flag will be set
5293-
* telling khubd to pretend the device has been disconnected and then
5293+
* telling hub_wq to pretend the device has been disconnected and then
52945294
* re-connected. All drivers will be unbound, and the device will be
52955295
* re-enumerated and probed all over again.
52965296
*

drivers/usb/host/ehci-fsl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ static int ehci_start_port_reset(struct usb_hcd *hcd, unsigned port)
627627
if (!(status & PORT_CONNECT))
628628
return -ENODEV;
629629

630-
/* khubd will finish the reset later */
630+
/* hub_wq will finish the reset later */
631631
if (ehci_is_TDI(ehci)) {
632632
writel(PORT_RESET |
633633
(status & ~(PORT_CSC | PORT_PEC | PORT_OCC)),

drivers/usb/host/ehci-hcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
788788
continue;
789789

790790
/* start 20 msec resume signaling from this port,
791-
* and make khubd collect PORT_STAT_C_SUSPEND to
791+
* and make hub_wq collect PORT_STAT_C_SUSPEND to
792792
* stop that signaling. Use 5 ms extra for safety,
793793
* like usb_port_resume() does.
794794
*/

drivers/usb/host/ehci-hub.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
656656

657657
/*
658658
* Return status information even for ports with OWNER set.
659-
* Otherwise khubd wouldn't see the disconnect event when a
659+
* Otherwise hub_wq wouldn't see the disconnect event when a
660660
* high-speed device is switched over to the companion
661661
* controller by the user.
662662
*/
@@ -902,7 +902,7 @@ int ehci_hub_control(
902902

903903
/*
904904
* Even if OWNER is set, so the port is owned by the
905-
* companion controller, khubd needs to be able to clear
905+
* companion controller, hub_wq needs to be able to clear
906906
* the port-change status bits (especially
907907
* USB_PORT_STAT_C_CONNECTION).
908908
*/
@@ -1000,7 +1000,7 @@ int ehci_hub_control(
10001000
* However, not all EHCI implementations do this
10011001
* automatically, even if they _do_ support per-port
10021002
* power switching; they're allowed to just limit the
1003-
* current. khubd will turn the power back on.
1003+
* current. hub_wq will turn the power back on.
10041004
*/
10051005
if (((temp & PORT_OC) || (ehci->need_oc_pp_cycle))
10061006
&& HCS_PPC(ehci->hcs_params)) {
@@ -1085,7 +1085,7 @@ int ehci_hub_control(
10851085
}
10861086

10871087
/*
1088-
* Even if OWNER is set, there's no harm letting khubd
1088+
* Even if OWNER is set, there's no harm letting hub_wq
10891089
* see the wPortStatus values (they should all be 0 except
10901090
* for PORT_POWER anyway).
10911091
*/

0 commit comments

Comments
 (0)