| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
is done in ugen(4).
Found by Grant Czajkowski during the GSoC 2015.
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
|
|
|
| |
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
detached, in order to prevent a deadlock situation.
This situation can occur if the thread detaching a device is sleeping,
waiting for all submitted transfers to finish, and the device's pipes
have not yet been aborted. This can happen when a USB Ethernet device
is being detached while a userland program is doing an ioctl(2).
Abort tasks need to be able to run in such case since timed out transfers
rely on them to be properly completed.
ok deraadt@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
should be considered as dead. In such condition the stack no longer
submits I/O or schedules any USB task for its bus.
However we need an explore task to detach the root hub since only the
task thread is supposed to discover buses and attach/detach devices in
order to avoid races.
So reset the bus' dying flag when marking it as disconnecting in order
to let the task be scheduled. This should be safe because a detached
or halted HC should not trigger any new interrupt.
Fix a panic when detaching USB PCMCIA cards reported by Tilo Stritzky.
|
|
|
|
| |
with the correct ipl to prevent your CPU from locking against itself.
|
|
|
|
| |
to help integrating super speed hubs that use a different descriptor.
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
| |
whitespaces while here.
|
|
|
|
|
|
|
|
|
| |
even knows your children! So let him handle the seperation correctly.
Do not rewrite your own custom config_detach_children(9) and as a bonus
start removing the usbd_port tentacles from the stack.
ok pirofti@, yuo@, miod@, deraadt@
|
|
|
|
|
|
|
|
|
|
|
| |
the boot process, USB devices must be attached or detached from the usb
task thread in order to avoid races with periodical explorations issued
by uhub(4) interrupts.
Respect this rule when detaching root hubs during a suspend/resume cycle
and avoid some hangs due to the aforementioned race.
Tested by Mattieu Baptiste, thanks!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
delicate. HC drivers do not always accept to be left alone.
I don't know if it is a love crisis, but apparently receiving a root
hub status change interrupt before having an uhub(4) attached breaks
resume.
So make sure the root hub is re-attached before interrupt get enabled.
It is safe to do it during DVACT_RESUME since attaching root hubs do
not require any USB transfer.
Based on a diff from yasuoka@, fix a regression introduced in last
commit an reported by Abel Abraham Camarillo Ojeda on tech@ and Nils
R on bugs@.
|
|
|
|
|
|
|
|
|
|
| |
before suspending the machine.
Prior to this commit, devices were logically disconnected after
resuming the machine leading to funny races since the controller
was reset in between.
ok deraadt@
|
|
|
|
|
| |
the correct speed. This has no effect for the moment since there is no
such driver in our tree, but something tells me it might change soon.
|
|
|
|
|
|
|
|
| |
kernel resumes normal (non-cold, able to run processes, etc) operation.
Previously we were relying on specific DVACT_RESUME op's in drivers
creating callback/threads themselves, but that has become too common,
indicating the need for a built-in mechanism.
ok dlg kettenis, tested by a sufficient amount of people
|
|
|
|
|
|
| |
cleaning up some shutdown-hook related code on the way.
(A few drivers related to sparc are still skipped at kettenis' request)
ok kettenis mlarkin, tested by many others too
|
|
|
|
|
|
|
|
|
|
| |
smaller than the requested one. From ws@NetBSD via miod@.
This problem can only occur when the USBD_SHORT_XFER_OK flag is set,
otherwise completed transfers with a length smaller than the one
submitted are treated as errors.
ok miod@
|
|
|
|
|
|
|
| |
for functions related to the usb(4) driver and keep usbd_* for generic
USB layer functions.
ok mglocker@
|
| |
|
|
|
|
|
|
| |
there. Some spacing while here.
Suggested and ok mpi@
|
|
|
|
|
|
| |
device descriptor.
Help and ok mpi@
|
|
|
|
|
|
|
|
|
| |
definitions instead. We don't change usb.h for now to stay compatible
with userland.
Tested by mpi@ on macppc and myself on i386.
ok mpi@
|
|
|
|
|
|
|
| |
Those are the equivalents for ugen(4)'s USB_GET_CONFIG_DESC and
USB_GET_FULL_DESC.
Help and OK mpi@, jmc@
|
| |
|
|
|
|
|
| |
absolutely do not need to include vnode.h because it includes uvm_extern.h
and you want the idiotic TRUE FALSE defines from uvm.
|
|
|
|
| |
ok deraadt@
|
|
|
|
|
|
| |
number. No functional change.
ok miod@
|
|
|
|
|
|
| |
is invalid or valid but with no device found.
ok miod@
|
|
|
|
| |
Might help a few laptops resume their usb devices better.
|
|
|
|
|
|
|
| |
sys/kthread.h, use sys/timeout.h explicitly. Noted by Michael
Knudsen.
ok deraadt@ kettenis@ guenther@
|
|
|
|
|
|
|
|
| |
that's ever used it, and it's long since been changed to use
DVACT_{QUIESCE,SUSPEND,RESUME} instead.
ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it
up a few weeks ago
|
|
|
|
|
|
|
|
|
|
|
|
| |
used to "do things later" and was potentially sleeping in swapper
context. the latter is really bad, because it might never wake up.
instead, move the things that usb_first_explore() was doing to the
first run of the explore task. since tasks are run in a kthread,
they are in process context and ok to sleep.
fixes boot hang noticed by jsg@, which mikeb@ debugged and found
usb_first_explore() to be sleeping swapper context
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
date: 2011/02/04 08:21:39; author: jakemsr; state: Exp; lines: +85 -34
* merge 'onqueue' and 'running' members of struct usb_task into
a new member, 'state'.
* add new function 'usb_wait_task()', which waits for queued or running
usb_tasks to complete.
* in the USB_DEVICEINFO ioctl, fill struct usb_device_info in a
usb_task, thereby avoiding races against driver attach/detach.
but this time make the state a bitmask, since it is valid to be added
to the task queue while the task is running. also be more careful
about waking up the task when state changes.
ok miod@
|
|
|
|
| |
this is causing problems with suspend/resume for some people.
|
|
|
|
|
|
|
|
|
|
| |
a new member, 'state'.
* add new function 'usb_wait_task()', which waits for queued or running
usb_tasks to complete.
* in the USB_DEVICEINFO ioctl, fill struct usb_device_info in a
usb_task, thereby avoiding races against driver attach/detach.
ok miod@
|
|
|
|
|
|
| |
them from userland, and nothing in the kernel uses them.
ok krw@, miod@
|
|
|
|
|
|
|
| |
* fill 'udi_serial' with the serial number in usbd_fill_deviceinfo().
* add compatability ioctl/struct so old binaries continue to work.
discussed with deraadt and miod
|
|
|
|
|
|
| |
free it's resources
* use usbd_is_dying() instead of directly checking the device's
bus dying flag
|
|
|
|
|
|
|
|
|
|
|
| |
be run from the generic task kthread, because xfers that need to be
aborted block newly queued tasks from running (i.e. the xfer to be aborted
blocks the abort of that task). as there are now three types of usb
tasks, add an argument to usb_init_task() and another member to struct
usb_task to specify the task type.
fixes boot hangs that are showing up because we now use usb tasks to
attach/detach usb devices.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* usbd_device_handle dev - the device responsible for the task. use
this to not run the task if the device's hub is dying.
* int running - a flag to be set when the task is running.
add usb_rem_wait_task(), a wrapper for usb_rem_task() that waits for
the task to complete if the task is already running.
s/usb_rem_task/usb_rem_wait_task/ in usb_detach(). probably most
drivers using usb_tasks should do this as well. although device
attach/detach is serialized in normal cases, in the special case
where the usb bus is hotpluggable (like cardbus/pcmcia), devices
are not detached in the task thread.
|
|
|
|
|
|
|
|
|
| |
is dying, instead of setting a flag in struct usb_softc. as
usbd_device_handle has a pointer to the usbd_bus it's attached to,
usb devices, and functions they run or functions run on their behalf,
can now easily check if their bus is dying. use this to stop
usbd_do_request* from running and the usb task thread from adding
new tasks when a device's bus is dying.
|
|
|
|
|
|
|
| |
hubs before their first port explore, check how long it's actually
been since power up and only wait as necessary. saves a little time
on boot, especially now that explore tasks are serialized.
ok yuo@
|
|
|
|
|
|
|
| |
USB bus, make usb_explore() a usb_task. reduces races during normal
USB device detach, since now usb_tasks and detach happen in the same
process.
ok yuo@, matthew@ helped with the task thread loop
|
|
|
|
| |
OK krw
|
|
|
|
|
|
| |
for sub-devices, return the last error return value instead of |'ing the
failures together and creating some value that is non-0 (bravo!) but
potentially loses the specific error value...
|
|
|
|
|
|
|
|
|
|
| |
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).
Based on a diff from tedu.
ok deraadt
|
|
|
|
| |
ok jsing@, miod@
|
|
|
|
|
|
|
| |
calls can go directly into selwakeup() safely
long discussion with nicm, murmers of consent from tedu and miod, noone
else seems to care of kqueue is busted as long as it makes their sockets
move data fast... pretty sad.
|
|
|
|
|
|
| |
This is needed for the addition of further suspend/resume actions.
Okay deraadt@, marco@.
|