17 Oct, 2007

1 commit

  • This patch contains the following cleanups that are now possible:
    - remove the unused security_operations->inode_xattr_getsuffix
    - remove the no longer used security_operations->unregister_security
    - remove some no longer required exit code
    - remove a bunch of no longer used exports

    Signed-off-by: Adrian Bunk
    Acked-by: James Morris
    Cc: Chris Wright
    Cc: Stephen Smalley
    Cc: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

16 Oct, 2007

1 commit

  • Fix USB docbook warnings.

    Warning(linux-2.6.23-git8//include/linux/usb/gadget.h:487): No description found for parameter 'g'
    Warning(linux-2.6.23-git8//include/linux/usb/gadget.h:506): No description found for parameter 'g'

    Warning(linux-2.6.23-git8//drivers/usb/core/hub.c:1416): No description found for parameter 'usb_dev'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

13 Oct, 2007

38 commits

  • * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (75 commits)
    PM: merge device power-management source files
    sysfs: add copyrights
    kobject: update the copyrights
    kset: add some kerneldoc to help describe what these strange things are
    Driver core: rename ktype_edd and ktype_efivar
    Driver core: rename ktype_driver
    Driver core: rename ktype_device
    Driver core: rename ktype_class
    driver core: remove subsystem_init()
    sysfs: move sysfs file poll implementation to sysfs_open_dirent
    sysfs: implement sysfs_open_dirent
    sysfs: move sysfs_dirent->s_children into sysfs_dirent->s_dir
    sysfs: make sysfs_root a regular directory dirent
    sysfs: open code sysfs_attach_dentry()
    sysfs: make s_elem an anonymous union
    sysfs: make bin attr open get active reference of parent too
    sysfs: kill unnecessary NULL pointer check in sysfs_release()
    sysfs: kill unnecessary sysfs_get() in open paths
    sysfs: reposition sysfs_dirent->s_mode.
    sysfs: kill sysfs_update_file()
    ...

    Linus Torvalds
     
  • This patch (as1002) fixes a small race which can occur when a driver
    expects usbcore to reschedule an autosuspend request. If the request
    arrives too late, it won't be rescheduled. The patch adds an extra
    argument to autosuspend_check(), indicating that a reschedule is
    needed no matter how much time has elapsed.

    It also tries to avoid letting asynchronous changes to the value of
    jiffies cause a delay to become negative, by caching a local copy of
    the current time.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • System suspends and hibernation are supposed to be as transparent as
    possible. By this reasoning, if a USB device is already autosuspended
    before the system sleep begins then it should remain autosuspended
    after the system wakes up.

    This patch (as1001) adds a skip_sys_resume flag to the usb_device
    structure and uses it to avoid waking up devices which were suspended
    when a system sleep began.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as999) fixes a problem that sometimes shows up when host
    controller driver modules are loaded in the wrong order. If ehci-hcd
    happens to initialize an EHCI controller while the companion OHCI or
    UHCI controller is in the middle of a port reset, the reset can fail
    and the companion may get very confused. The patch adds an
    rw-semaphore and uses it to keep EHCI initialization and port resets
    mutually exclusive.

    Signed-off-by: Alan Stern
    Acked-by: David Brownell
    Cc: David Miller
    Cc: Dely L Sy
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • powertop currently tracks interrupts generated by uhci, ehci, and ohci,
    but it has no way of telling which USB device to blame USB bus activity on.
    This patch exports the number of URBs that are submitted for a given device.
    Cat the file 'urbnum' in /sys/bus/usb/devices/.../

    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Sarah Sharp
     
  • This patch (as995) cleans up the remains of the former NO_AUTOSUSPEND
    quirk. Since autosuspend is disabled by default, we will let
    userspace worry about which devices can safely be suspended. Thus the
    lengthy series of quirk entries is no longer needed, and neither is
    the quirk ID. I suppose someone might eventually run across a hub
    that can't be suspended; let's ignore the possibility for now.

    The patch also cleans up the hasty way in which autosuspend gets
    disabled. Setting udev->autosuspend_delay to -1 wasn't quite right,
    because the value is always supposed to be a multiple of HZ. It's
    better to leave the delay value alone and set autosuspend_disabled,
    which is what the quirk routine used to do.

    Signed-off-by: Alan Stern
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as992) fixes a recently-added bug. During a FREEZE or
    PRETHAW suspend notification, non-root devices don't actually get
    suspended. So we shouldn't tell their parent hubs that they did.

    (This code path used to be skipped over, until the FREEZE/PRETHAW test
    got moved out of usb_suspend_both() into generic_suspend().)

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (jx001) fixes a variable assignment mistake in hub driver.
    limited_power should be set to 0 if the hub is self-powered,and 1 if
    the hub is bus-powered.

    However, the effect of the code was exactly opposite to the spec's
    statement for the Local Power Source field. The spec says, this field
    is 1 meaning Local power supply lost while this field is 0 indicating
    Local power supply good.(This statement is very confusing.)

    So this patch switchs the 0 and 1.

    Signed-off-by: Jason Xiao
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    jidong xiao
     
  • This patch (as989) makes usbcore flush all outstanding URBs for each
    device as the device is suspended. This will be true even when
    CONFIG_USB_SUSPEND is not enabled.

    In addition, an extra can_submit flag is added to the usb_device
    structure. That flag will be turned off whenever a suspend request
    has been received for the device, even if the device isn't actually
    suspended because CONFIG_USB_SUSPEND isn't set.

    It's no longer necessary to check for the device state being equal to
    USB_STATE_SUSPENDED during URB submission; that check can be replaced
    by a check of the can_submit flag. This also permits us to remove
    some questionable references to the deprecated power.power_state field.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as988) breaks usb_hcd_endpoint_disable() apart into two
    routines. The first, usb_hcd_flush_endpoint() does the -ESHUTDOWN
    unlinking of all URBs in the endpoint's queue and waits for them to
    complete. The second, usb_hcd_disable_endpoint() -- renamed for
    better grammatical style -- merely calls the HCD's endpoint_disable
    method. The changeover is easy because the routine currently has only
    one caller.

    This separation of function will be exploited in the following patch:
    When a device is suspended, the core will be able to cancel all
    outstanding URBs for that device while leaving the HCD's
    endpoint-related data structures intact for later.

    As an added benefit, HCDs no longer need to check for existing URBs in
    their endpoint_disable methods. It is now guaranteed that there will
    be none.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as987) changes the way FREEZE and PRETHAW suspend events
    are handled in usbcore. The decision about whether or not to ignore
    them for non-root devices is pushed down into the USB-device driver,
    instead of being made in the core code.

    This is appropriate, since devices exported to a virtualized guest or
    over a network may indeed need to handle these types of suspend, even
    though normal devices don't.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as990) removes an annoying debugging message. Nobody
    really cares when endpoint pseudo-devices are released.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as981) removes the remaining nontrivial usages of
    urb->status from usbcore.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Now that urb->status isn't used, urb->lock doesn't protect anything.
    This patch (as980) removes it and replaces it with a private mutex in
    the one remaining place it was still used: usb_kill_urb.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as979) removes the last vestiges of urb->status from the
    host controller drivers and the root-hub emulator. Now the field
    doesn't get set until just before the URB's completion routine is
    called.

    Signed-off-by: Alan Stern
    CC: David Brownell
    CC: Olav Kongas
    CC: Yoshihiro Shimoda
    CC: Tony Olech
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as978) reorganizes the way usbmon uses urb->status. It
    now accepts the status value as an argument.

    Signed-off-by: Alan Stern
    Acked-by: Pete Zaitcev
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as971) fixes a small mistake: The URB's completion status
    needs to be adjusted before the URB is passed to usmon_urb_complete(),
    not afterward.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as970) adds a new urb->unlinked field, which is used to
    store the status of unlinked URBs since we can't use urb->status for
    that purpose any more. To help simplify the HCDs, usbcore will check
    urb->unlinked before calling the completion handler; if the value is
    set it will automatically override the status reported by the HCD.

    Signed-off-by: Alan Stern
    CC: David Brownell
    CC: Olav Kongas
    CC: Yoshihiro Shimoda
    CC: Tony Olech
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as969) continues the ongoing changes to the way HCDs
    report URB statuses. The programming interface has been simplified by
    making usbcore responsible for clearing urb->hcpriv and for setting
    -EREMOTEIO status when an URB with the URB_SHORT_NOT_OK flag ends up
    as a short transfer.

    By moving the work out of the HCDs, this removes a fair amount of
    repeated code.

    Signed-off-by: Alan Stern
    CC: David Brownell
    CC: Olav Kongas
    CC: Yoshihiro Shimoda
    CC: Tony Olech
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as955) prevents the interface-related sysfs files and
    endpoint pseudo-devices from being deleted and recreated when a call
    to usb_set_interface() specifies the current altsetting. Since the
    altsetting doesn't get changed, there's no need to do anything.

    Furthermore, avoiding changes to the endpoint devices will be
    necessary in the future. This code is called from usb_reset_device(),
    which gets invoked for reset-resume processing, but upcoming changes
    to the PM and driver cores will make it impossible to register devices
    while a suspend/resume transition is in progress. Since we don't need
    to re-register those endpoint devices anyhow, it's best to skip the
    whole thing.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as954) implements a suggestion of David Brownell's. Now
    the host controller drivers are responsible for linking and unlinking
    URBs to/from their endpoint queues. This eliminates the possiblity of
    strange situations where usbcore thinks an URB is linked but the HCD
    thinks it isn't. It also means HCDs no longer have to check for URBs
    being dequeued before they were fully enqueued.

    In addition to the core changes, this requires changing every host
    controller driver and the root-hub URB handler. For the most part the
    required changes are fairly small; drivers have to call
    usb_hcd_link_urb_to_ep() in their urb_enqueue method,
    usb_hcd_check_unlink_urb() in their urb_dequeue method, and
    usb_hcd_unlink_urb_from_ep() before giving URBs back. A few HCDs make
    matters more complicated by the way they split up the flow of control.

    In addition some method interfaces get changed. The endpoint argument
    for urb_enqueue is now redundant so it is removed. The unlink status
    is required by usb_hcd_check_unlink_urb(), so it has been added to
    urb_dequeue.

    Signed-off-by: Alan Stern
    CC: David Brownell
    CC: Olav Kongas
    CC: Tony Olech
    CC: Yoshihiro Shimoda
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • No one else calls it, this makes sparse happy.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • As it is global, give it a usb specific name in the global namespace.

    Cc: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Makes it possible to control the authorization of USB devices through
    sysfs's /sys/usb/devices/*/authorize.

    Update: per Adrian Bunk's suggestion, make dev_attr_authorized_default static

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • These USB API functions will do the full authorization/deauthorization
    to be used for a device. When authorized we effectively allow a
    configuration to be set. Reverse that when deauthorized.

    Effectively this means that we have to clean all the configuration
    descriptors on deauthorize and reload them when we authorized. We could
    do without throwing them out for wired devices, but for wireless, we can
    read them only after authenticating, and thus, when authorizing an
    authenticated device we would need to read them. So to simplify, always
    release them on deauthorize(), re-read them on authorize().

    Also fix leak reported by Ragner Magalhaes; in usb_deauthorize_device(),
    bNumConfigurations was being set to zero before the for loop, and thus
    the different raw descriptors where never being freed.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • This patch takes hub.c:usb_new_device() and splits it in three parts:

    - The actual actions of adding a new device (quirk detection,
    announcement and autoresume tracking)

    - Actual discovery and probing of the configuration and interfaces
    (split into __usb_configure_device())

    - Configuration of the On-the-go parameters (split into
    __usb_configure_device_otg()).

    The fundamental reasons for doing this split are clarity (smaller
    functions are easier to maintain) and to allow part of the code to be
    reused when authorizing devices to connect.

    When a device is authorized connection, we need to run through the
    hoops we didn't run when it was connected but not authorized, which is
    basically parsing the configurations and probing
    them. usb_configure_device() will do that for us.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • If called and the device is not authorized to be used, then we won't
    choose a configuration (as they are not a concept that exists for an
    unauthorized device). However, the device is added to the system.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • If called and the device is not authorized to be used, it won't
    configure the interface and print a message saying so.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • If called and the device is not authorized to be used, then we don't
    allow reading the configurations.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • Will refuse to configure a non-authorized device.

    Update: simplified if statement--thanks to Ragner Magalhaes for the
    heads up.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • This path cleans the exit paths of usb_register_bus() [to use a goto
    schema], maximum line length (keeping it under ~75).

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • This introduces /sys/bus/devices/usb*/authorized_default; it dictates
    what is going to be the default authorization state for devices
    connected to the host. User space can set that using the sysfs file.

    We hook to the root hub instead of to the device controller as it is
    quite easy to get to it in sysfs from the device structure (device
    5-4.3 is usb5) vs. backtracking to the controller device.

    By default it is set to be 'authorized' (!0) for normal, wired USB
    devices and 'unauthorized' (0) for Wireless USB devices.

    As suggested by Adrian Bunk, make authorized_default static

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • This patch (as953) separates out three key portions from
    usb_hcd_submit_urb(), usb_hcd_unlink_urb(), and usb_hcd_giveback_urb()
    and puts them in separate functions of their own. In the next patch,
    these functions will be called directly by host controller drivers
    while holding their private spinlocks, which will remove the
    possibility of some unpleasant races.

    The code responsible for mapping and unmapping DMA buffers is also
    placed into a couple of separate subroutines, for the sake of
    cleanliness and consistency.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as952) adjusts the spinlock usage in the root-hub
    emulation part of usbcore, to make it match more closely the pattern
    used by regular host controller drivers. To wit: The private lock
    (usb_hcd_root_hub_lock) is held throughout the important parts, and it
    is dropped temporarily without re-enabling interrupts around the call
    to usb_hcd_giveback_urb().

    A nice side effect is that the code now avoids calling
    local_irq_save(), thereby becoming more RT-friendly.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as951) cleans up a few loose ends from earlier patches.
    Redundant checks for non-NULL urb->dev are removed, as are checks of
    urb->dev->bus (which can never be NULL). Conversely, a check for
    non-NULL urb->ep is added to the unlink paths.

    A homegrown round-down-to-power-of-2 loop is simplified by using the
    ilog2 routine. The comparison in usb_urb_dir_in() is made more
    transparent.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as948) removes most of the references to urb->pipe from
    the usbfs routines in devio.c. The one tricky aspect is in
    snoop_urb(), which can be called before the URB is submitted and which
    uses usb_urb_dir_in(). For this to work properly, the URB's direction
    flag must be set manually in proc_do_submiturb().

    The patch also fixes a minor bug; the wValue, wIndex, and wLength
    fields were snooped in proc_do_submiturb() without conversion from
    le16 to CPU-byte-ordering.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as947) changes the device initialization and enumeration
    code in hub.c; now udev->devnum will be set to 0 while the device is
    being accessed at address 0. Until now this wasn't needed because the
    address value was passed as part of urb->pipe; without that field the
    device address must be stored elsewhere.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern