13 Oct, 2014

1 commit

  • Pull vfs updates from Al Viro:
    "The big thing in this pile is Eric's unmount-on-rmdir series; we
    finally have everything we need for that. The final piece of prereqs
    is delayed mntput() - now filesystem shutdown always happens on
    shallow stack.

    Other than that, we have several new primitives for iov_iter (Matt
    Wilcox, culled from his XIP-related series) pushing the conversion to
    ->read_iter()/ ->write_iter() a bit more, a bunch of fs/dcache.c
    cleanups and fixes (including the external name refcounting, which
    gives consistent behaviour of d_move() wrt procfs symlinks for long
    and short names alike) and assorted cleanups and fixes all over the
    place.

    This is just the first pile; there's a lot of stuff from various
    people that ought to go in this window. Starting with
    unionmount/overlayfs mess... ;-/"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (60 commits)
    fs/file_table.c: Update alloc_file() comment
    vfs: Deduplicate code shared by xattr system calls operating on paths
    reiserfs: remove pointless forward declaration of struct nameidata
    don't need that forward declaration of struct nameidata in dcache.h anymore
    take dname_external() into fs/dcache.c
    let path_init() failures treated the same way as subsequent link_path_walk()
    fix misuses of f_count() in ppp and netlink
    ncpfs: use list_for_each_entry() for d_subdirs walk
    vfs: move getname() from callers to do_mount()
    gfs2_atomic_open(): skip lookups on hashed dentry
    [infiniband] remove pointless assignments
    gadgetfs: saner API for gadgetfs_create_file()
    f_fs: saner API for ffs_sb_create_file()
    jfs: don't hash direct inode
    [s390] remove pointless assignment of ->f_op in vmlogrdr ->open()
    ecryptfs: ->f_op is never NULL
    android: ->f_op is never NULL
    nouveau: __iomem misannotations
    missing annotation in fs/file.c
    fs: namespace: suppress 'may be used uninitialized' warnings
    ...

    Linus Torvalds
     

09 Oct, 2014

3 commits

  • return dentry, not inode. dev->inode is never used by anything,
    don't bother with storing it.

    Acked-by: Felipe Balbi
    Signed-off-by: Al Viro

    Al Viro
     
  • make it return dentry instead of inode

    Acked-by: Felipe Balbi
    Signed-off-by: Al Viro

    Al Viro
     
  • Pull networking updates from David Miller:
    "Most notable changes in here:

    1) By far the biggest accomplishment, thanks to a large range of
    contributors, is the addition of multi-send for transmit. This is
    the result of discussions back in Chicago, and the hard work of
    several individuals.

    Now, when the ->ndo_start_xmit() method of a driver sees
    skb->xmit_more as true, it can choose to defer the doorbell
    telling the driver to start processing the new TX queue entires.

    skb->xmit_more means that the generic networking is guaranteed to
    call the driver immediately with another SKB to send.

    There is logic added to the qdisc layer to dequeue multiple
    packets at a time, and the handling mis-predicted offloads in
    software is now done with no locks held.

    Finally, pktgen is extended to have a "burst" parameter that can
    be used to test a multi-send implementation.

    Several drivers have xmit_more support: i40e, igb, ixgbe, mlx4,
    virtio_net

    Adding support is almost trivial, so export more drivers to
    support this optimization soon.

    I want to thank, in no particular or implied order, Jesper
    Dangaard Brouer, Eric Dumazet, Alexander Duyck, Tom Herbert, Jamal
    Hadi Salim, John Fastabend, Florian Westphal, Daniel Borkmann,
    David Tat, Hannes Frederic Sowa, and Rusty Russell.

    2) PTP and timestamping support in bnx2x, from Michal Kalderon.

    3) Allow adjusting the rx_copybreak threshold for a driver via
    ethtool, and add rx_copybreak support to enic driver. From
    Govindarajulu Varadarajan.

    4) Significant enhancements to the generic PHY layer and the bcm7xxx
    driver in particular (EEE support, auto power down, etc.) from
    Florian Fainelli.

    5) Allow raw buffers to be used for flow dissection, allowing drivers
    to determine the optimal "linear pull" size for devices that DMA
    into pools of pages. The objective is to get exactly the
    necessary amount of headers into the linear SKB area pre-pulled,
    but no more. The new interface drivers use is eth_get_headlen().
    From WANG Cong, with driver conversions (several had their own
    by-hand duplicated implementations) by Alexander Duyck and Eric
    Dumazet.

    6) Support checksumming more smoothly and efficiently for
    encapsulations, and add "foo over UDP" facility. From Tom
    Herbert.

    7) Add Broadcom SF2 switch driver to DSA layer, from Florian
    Fainelli.

    8) eBPF now can load programs via a system call and has an extensive
    testsuite. Alexei Starovoitov and Daniel Borkmann.

    9) Major overhaul of the packet scheduler to use RCU in several major
    areas such as the classifiers and rate estimators. From John
    Fastabend.

    10) Add driver for Intel FM10000 Ethernet Switch, from Alexander
    Duyck.

    11) Rearrange TCP_SKB_CB() to reduce cache line misses, from Eric
    Dumazet.

    12) Add Datacenter TCP congestion control algorithm support, From
    Florian Westphal.

    13) Reorganize sk_buff so that __copy_skb_header() is significantly
    faster. From Eric Dumazet"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1558 commits)
    netlabel: directly return netlbl_unlabel_genl_init()
    net: add netdev_txq_bql_{enqueue, complete}_prefetchw() helpers
    net: description of dma_cookie cause make xmldocs warning
    cxgb4: clean up a type issue
    cxgb4: potential shift wrapping bug
    i40e: skb->xmit_more support
    net: fs_enet: Add NAPI TX
    net: fs_enet: Remove non NAPI RX
    r8169:add support for RTL8168EP
    net_sched: copy exts->type in tcf_exts_change()
    wimax: convert printk to pr_foo()
    af_unix: remove 0 assignment on static
    ipv6: Do not warn for informational ICMP messages, regardless of type.
    Update Intel Ethernet Driver maintainers list
    bridge: Save frag_max_size between PRE_ROUTING and POST_ROUTING
    tipc: fix bug in multicast congestion handling
    net: better IFF_XMIT_DST_RELEASE support
    net/mlx4_en: remove NETDEV_TX_BUSY
    3c59x: fix bad split of cpu_to_le32(pci_map_single())
    net: bcmgenet: fix Tx ring priority programming
    ...

    Linus Torvalds
     

08 Oct, 2014

4 commits

  • Pull tty/serial driver updates from Greg KH:
    "Here's the big tty/serial driver patchset for 3.18-rc1.

    Lots of little things in here, some good work from Peter Hurley on the
    tty core, and in lots of drivers. There are also lots of other driver
    updates in here as well, full details in the changelogs.

    All have been in the linux-next tree for a while"

    * tag 'tty-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (99 commits)
    Revert "serial/core: Initialize the console pm state"
    tty: serial: 8250: use 32bit variable for rpm_tx_active
    tty: serial: msm: Add earlycon support
    serial/core: Initialize the console pm state
    serial: asc: Conditionally use readl_relaxed (COMPILE_TEST)
    serial: of-serial: add PM suspend/resume support
    m68k: AMIGA_BUILTIN_SERIAL should depend on TTY
    asm/uapi: Add definition of TIOC[SG]RS485
    tty/metag_da: Add console_poll module parameter
    serial: 8250_pci: remove rts_n override from Baytrail quirk
    serial: cadence: Add generic earlycon support
    serial: imx: change the wait even to interruptiable
    serial: imx: terminate the RX DMA when the UART is suspending
    serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control
    serial: 8250: Add Quark X1000 to 8250_pci.c
    tty: omap-serial: pull out calculation from baud_is_mode16
    tty: omap-serial: fix division by zero
    xen_hvc: no reason to write the type key on xenstore
    tty: serial: 8250_core: remove UART_IER_RDI in serial8250_stop_rx()
    tty: serial: 8250_core: use the ->line argument as a hint in serial8250_find_match_or_unused()
    ...

    Linus Torvalds
     
  • Pull USB updates from Greg KH:
    "Here's the big USB patchset for 3.18-rc1. Also in here is the PHY
    tree, as it seems to fit well with the USB tree for various reasons...

    Anyway, lots of little changes in here, all over the place, full
    details in the changelog

    All have been in the linux-next tree for a while with no issues"

    * tag 'usb-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (244 commits)
    USB: host: st: fix typo 'CONFIG_USB_EHCI_HCD_ST'
    uas: Reduce number of function arguments for uas_alloc_foo functions
    xhci: Allow xHCI drivers to be built as separate modules
    xhci: Export symbols used by host-controller drivers
    xhci: Check for XHCI_COMP_MODE_QUIRK when disabling D3cold
    xhci: Introduce xhci_init_driver()
    usb: hcd: add generic PHY support
    usb: rename phy to usb_phy in HCD
    usb: gadget: uvc: fix up uvcg_v4l2_get_unmapped_area typo
    USB: host: st: fix ehci/ohci driver selection
    usb: host: ehci-exynos: Remove unnecessary usb-phy support
    usb: core: return -ENOTSUPP for all targeted hosts
    USB: Remove .owner field for driver
    usb: core: log higher level message on malformed LANGID descriptor
    usb: Add LED triggers for USB activity
    usb: Rename usb-common.c
    usb: gadget: Refactor request completion
    usb: gadget: Introduce usb_gadget_giveback_request()
    usb: dwc2/gadget: move phy bus legth initialization
    phy: remove .owner field for drivers using module_platform_driver
    ...

    Linus Torvalds
     
  • Pull SCSI updates from James Bottomley:
    "This patch set consists of the usual driver updates (megaraid_sas,
    arcmsr, be2iscsi, lpfc, mpt2sas, mpt3sas, qla2xxx, ufs) plus several
    assorted fixes and miscellaneous updates (including the
    pci_msix_enable_range() changes that have been pending for a while)"

    * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (202 commits)
    scsi: add a CONFIG_SCSI_MQ_DEFAULT option
    ufs: definitions for phy interface
    ufs: tune bkops while power managment events
    ufs: Add support for clock scaling using devfreq framework
    ufs: Add freq-table-hz property for UFS device
    ufs: Add support for clock gating
    ufs: refactor configuring power mode
    ufs: add UFS power management support
    ufs: introduce well known logical unit in ufs
    ufs: manually add well known logical units
    ufs: Active Power Mode - configuring bActiveICCLevel
    ufs: improve init sequence
    ufs: refactor query descriptor API support
    ufs: add voting support for host controller power
    ufs: Add clock initialization support
    ufs: Add regulator enable support
    ufs: Allow vendor specific initialization
    scsi: don't add scsi_device if its already visible
    scsi: fix the type for well known LUs
    scsi: fix comment in struct Scsi_Host definition
    ...

    Linus Torvalds
     
  • Pull "trivial tree" updates from Jiri Kosina:
    "Usual pile from trivial tree everyone is so eagerly waiting for"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Remove MN10300_PROC_MN2WS0038
    mei: fix comments
    treewide: Fix typos in Kconfig
    kprobes: update jprobe_example.c for do_fork() change
    Documentation: change "&" to "and" in Documentation/applying-patches.txt
    Documentation: remove obsolete pcmcia-cs from Changes
    Documentation: update links in Changes
    Documentation: Docbook: Fix generated DocBook/kernel-api.xml
    score: Remove GENERIC_HAS_IOMAP
    gpio: fix 'CONFIG_GPIO_IRQCHIP' comments
    tty: doc: Fix grammar in serial/tty
    dma-debug: modify check_for_stack output
    treewide: fix errors in printk
    genirq: fix reference in devm_request_threaded_irq comment
    treewide: fix synchronize_rcu() in comments
    checkstack.pl: port to AArch64
    doc: queue-sysfs: minor fixes
    init/do_mounts: better syntax description
    MIPS: fix comment spelling
    powerpc/simpleboot: fix comment
    ...

    Linus Torvalds
     

06 Oct, 2014

1 commit

  • Pull SCSI fixes from James Bottomley:
    "This is a set of two small fixes, both to code which went in during
    the merge window: cxgb4i has a scheduling in atomic bug in its new
    ipv6 code and uas fails to work properly with the new scsi-mq code"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    [SCSI] uas: disable use of blk-mq I/O path
    [SCSI] cxgb4i: avoid holding mutex in interrupt context

    Linus Torvalds
     

04 Oct, 2014

6 commits

  • Signed-off-by: Paul Bolle
    Fixes: 905e300e1043 ("USB: host: st: fix ehci/ohci driver selection")
    Signed-off-by: Greg Kroah-Hartman

    Paul Bolle
     
  • The stream_id and pipe are already present in uas_cmd_info resp uas_dev_info,
    so there is no need to pass a copy along.

    Signed-off-by: Hans de Goede
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • Instead of building all of the xHCI code into a single module, separate
    it out into the core (xhci-hcd), PCI (xhci-pci, now selected by the new
    config option CONFIG_USB_XHCI_PCI), and platform (xhci-plat) drivers.
    Also update the PCI/platform drivers with module descriptions/licenses
    and have them register their respective drivers in their initcalls.

    Signed-off-by: Andrew Bresticker
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Andrew Bresticker
     
  • In preparation for allowing the xHCI host controller drivers to be built
    as separate modules, export symbols from the xHCI core that may be used
    by the host controller drivers.

    Signed-off-by: Andrew Bresticker
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Andrew Bresticker
     
  • Instead of calling xhci_compliance_mode_recovery_timer_quirk_check() again
    in the PCI suspend path, just check for XHCI_COMP_MODE_QUIRK which will
    have been set based on xhci_compliance_mode_recovery_timer_quirk_check()
    in xhci_init().

    Signed-off-by: Andrew Bresticker
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Andrew Bresticker
     
  • Since the struct hc_driver is mostly the same across the xhci-pci,
    xhci-plat, and the upcoming xhci-tegra driver, introduce the function
    xhci_init_driver() which will populate the hc_driver with the default
    xHCI operations. The caller must supply a setup function which will
    be used as the hc_driver's reset callback.

    Note that xhci-plat also overrides the default ->start() callback so
    that it can do rcar-specific initialization.

    Signed-off-by: Andrew Bresticker
    Signed-off-by: Mathias Nyman
    Signed-off-by: Greg Kroah-Hartman

    Andrew Bresticker
     

03 Oct, 2014

1 commit

  • The uas driver uses the block layer tag for USB3 stream IDs. With
    blk-mq we can get larger tag numbers that the queue depth, which breaks
    this assumption. A fix is under way for 3.18, but sits on top of
    large changes so can't easily be backported. Set the disable_blk_mq
    path so that a uas device can't easily crash the system when using
    blk-mq for SCSI.

    Signed-off-by: Christoph Hellwig
    Acked-by: Hans de Goede
    Signed-off-by: James Bottomley

    Christoph Hellwig
     

29 Sep, 2014

8 commits

  • Add the generic PHY support, analogous to the USB PHY support. Intended it to be
    used with the PCI EHCI/OHCI drivers and the xHCI platform driver.

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Greg Kroah-Hartman

    Sergei Shtylyov
     
  • The USB PHY member of the HCD structure is renamed to 'usb_phy' and
    modifications are done in all drivers accessing it.
    This is in preparation to adding the generic PHY support.

    Signed-off-by: Antoine Tenart
    [Sergei: added missing 'drivers/usb/misc/lvstest.c' file, resolved rejects,
    updated changelog.]
    Signed-off-by: Sergei Shtylyov
    Acked-by: Alan Stern
    Acked-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Antoine Tenart
     
  • Patch "usb: gadget: uvc: rename functions to avoid conflicts with host uvc"
    renamed a lot of symbols but missed one references that was inside of
    an #ifdef:

    drivers/usb/gadget/function/uvc_v4l2.c:363:23: error: 'uvcg_v4l2_get_unmapped_area' undeclared here (not in a function)
    .get_unmapped_area = uvcg_v4l2_get_unmapped_area,
    ^
    drivers/usb/gadget/function/uvc_v4l2.c:344:22: warning: 'uvc_v4l2_get_unmapped_area' defined but not used [-Wunused-function]
    static unsigned long uvc_v4l2_get_unmapped_area(struct file *file,
    ^

    This renames the reference according the changed function name.

    Signed-off-by: Arnd Bergmann
    Fixes: 7ea95b110811 ("usb: gadget: uvc: rename functions to avoid conflicts with host uvc")
    Cc: Andrzej Pietrasiewicz
    Cc: Michael Grzeschik
    Acked-by: Laurent Pinchart
    Cc: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • The newly added sti ehci and ohci drivers come with a single
    Kconfig entry that does not depend on either of the base drivers,
    which leads to a link error when they are disabled:

    drivers/built-in.o: In function `ohci_platform_init':
    :(.init.text+0x14788): undefined reference to `ohci_init_driver'

    To fix that, this patch introduces two separate Kconfig options
    with proper dependencies, which avoids the problem and is also
    more consistent with the other glue drivers.

    Signed-off-by: Arnd Bergmann
    Fixes: d115837259ada ("usb: host: ohci-st: Add OHCI driver support for ST STB devices")
    Cc: Peter Griffin
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • Now that we have completely moved from older USB-PHY drivers
    to newer GENERIC-PHY drivers for PHYs available with USB controllers
    on Exynos series of SoCs, we can remove the support for the same
    in our host drivers too.

    We also defer the probe for our host in case we end up getting
    EPROBE_DEFER error when getting PHYs.

    Signed-off-by: Vivek Gautam
    Acked-by: Jingoo Han
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Vivek Gautam
     
  • The current code only returns -ENOTSUPP for OTG host, but in fact,
    embedded host also needs to returns -ENOTSUPP if the peripheral
    is not at TPL.

    Signed-off-by: Peter Chen
    Signed-off-by: Greg Kroah-Hartman

    Peter Chen
     
  • There is no need to init .owner field.

    Based on the patch from Peter Griffin
    "mmc: remove .owner field for drivers using module_platform_driver"

    This patch removes the superflous .owner field for drivers which
    use the module_platform_driver API, as this is overriden in
    platform_driver_register anyway."

    Signed-off-by: Kiran Padwal
    Reviewed-by: Ivan T. Ivanov
    Signed-off-by: Greg Kroah-Hartman

    Kiran Padwal
     
  • Commit 0cce2eda19923e5e5ccc8b042dec5af87b3ffad0
    USB: fix LANGID=0 regression

    defaults to a langid of 0x0409 if it's not properly implemented by the
    device. Explain with a higher level error message what this means.

    Signed-off-by: Scot Doyle
    Signed-off-by: Greg Kroah-Hartman

    Scot Doyle
     

27 Sep, 2014

1 commit

  • …inville/wireless-next

    John W. Linville says:

    ====================
    pull request: wireless-next 2014-09-22

    Please pull this batch of updates intended for the 3.18 stream...

    For the mac80211 bits, Johannes says:

    "This time, I have some rate minstrel improvements, support for a very
    small feature from CCX that Steinar reverse-engineered, dynamic ACK
    timeout support, a number of changes for TDLS, early support for radio
    resource measurement and many fixes. Also, I'm changing a number of
    places to clear key memory when it's freed and Intel claims copyright
    for code they developed."

    For the bluetooth bits, Johan says:

    "Here are some more patches intended for 3.18. Most of them are cleanups
    or fixes for SMP. The only exception is a fix for BR/EDR L2CAP fixed
    channels which should now work better together with the L2CAP
    information request procedure."

    For the iwlwifi bits, Emmanuel says:

    "I fix here dvm which was broken by my last pull request. Arik
    continues to work on TDLS and Luca solved a few issues in CT-Kill. Eyal
    keeps digging into rate scaling code, more to come soon. Besides this,
    nothing really special here."

    Beyond that, there are the usual big batches of updates to ath9k, b43,
    mwifiex, and wil6210 as well as a handful of other bits here and there.
    Also, rtlwifi gets some btcoexist attention from Larry.

    Please let me know if there are problems!
    ====================

    Had to adjust the wil6210 code to comply with Joe Perches's recent
    change in net-next to make the netdev_*() routines return void instead
    of 'int'.

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     

26 Sep, 2014

1 commit


25 Sep, 2014

6 commits

  • With this patch, USB activity can be signaled by blinking a LED. There
    are two triggers, one for activity on USB host and one for USB gadget.

    Both triggers should work with all host/device controllers. Tested only
    with musb.

    Performace: I measured performance overheads on ARM Cortex-A8 (TI
    AM335x) running on 600 MHz.

    Duration of usb_led_activity():
    - with no LED attached to the trigger: 2 ± 1 µs
    - with one GPIO LED attached to the trigger: 2 ± 1 µs or 8 ± 2 µs (two peaks in histogram)

    Duration of functions calling usb_led_activity() (with this patch
    applied and no LED attached to the trigger):
    - __usb_hcd_giveback_urb(): 10 - 25 µs
    - usb_gadget_giveback_request(): 2 - 6 µs

    Signed-off-by: Michal Sojka
    Acked-by: Felipe Balbi
    Tested-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Michal Sojka
     
  • In the next commit, we will want the usb-common module to be composed of
    two object files. Since Kbuild cannot "append" another object to an
    existing one, we need to rename usb-common.c to something
    else (common.c) and create usb-common.o by linking the wanted objects
    together. Currently, usb-common.o comprises only common.o.

    Signed-off-by: Michal Sojka
    Acked-by: Felipe Balbi
    Tested-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Michal Sojka
     
  • Use the recently introduced usb_gadget_giveback_request() in favor of
    direct invocation of the completion routine.

    All places in drivers/usb/ matching "[-.]complete(" were replaced with a
    call to usb_gadget_giveback_request(). This was compile-tested with all
    ARM drivers enabled and runtime-tested for musb.

    Signed-off-by: Michal Sojka
    Acked-by: Felipe Balbi
    Tested-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Michal Sojka
     
  • All USB peripheral controller drivers call completion routines directly.
    This patch adds usb_gadget_giveback_request() which will be used instead
    of direct invocation in the next patch. The goal here is to have a place
    where common functionality can be added.

    Signed-off-by: Michal Sojka
    Acked-by: Felipe Balbi
    Tested-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Michal Sojka
     
  • This patch moves the part of code that initializes the PHY bus width.
    This results in simpler code and removes the need to check whether
    the Generic PHY Framework is used.

    Signed-off-by: Kamil Debski
    Signed-off-by: Marek Szyprowski
    Signed-off-by: Robert Baldyga
    Signed-off-by: Greg Kroah-Hartman

    Kamil Debski
     
  • …it/johan/usb-serial into usb-next

    Johan writes:

    USB-serial fixes for v3.17

    Here are two more device IDs for v3.17.

    Signed-off-by: Johan Hovold <johan@kernel.org>

    Greg Kroah-Hartman
     

24 Sep, 2014

8 commits

  • It seems that only choose_devnum() was not ready to process more hub
    events at the same time.

    All should be fine if we take bus->usb_address0_mutex there. It will
    make sure that more devnums will not be chosen for the given bus and
    the related devices at the same time.

    Signed-off-by: Petr Mladek
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Petr Mladek
     
  • 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
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Petr Mladek
     
  • USB hub started to use a workqueue instead of kthread. Let's make it clear from
    the function names.

    Signed-off-by: Petr Mladek
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Petr Mladek
     
  • There is no need to have separate kthread for handling USB hub events.
    It is more elegant to use the workqueue framework.

    The workqueue is allocated as freezable because the original thread was
    freezable as well.

    Also it is allocated as ordered because the code is not ready for parallel
    processing of hub events, see choose_devnum().

    struct usb_hub is passed via the work item. Therefore we do not need
    hub_event_list.

    Also hub_thread() is not longer needed. It would call only hub_event().
    The rest of the code did manipulate the kthread and it is handled by the
    workqueue framework now.

    kick_khubd is renamed to kick_hub_wq() to make the function clear. And the
    protection against races is done another way, see below.

    hub_event_lock has been removed. It cannot longer be used to protect struct
    usb_hub between hub_event() and hub_disconnect(). Instead we need to get
    hub->kref already in kick_hub_wq().

    The lock is not really needed for the other scenarios as well. queue_work()
    returns whether it succeeded. We could revert the needed operations
    accordingly. This is enough to avoid duplicity and inconsistencies.

    Yes, the removed lock causes that there is not longer such a strong
    synchronization between scheduling the work and manipulating
    hub->disconnected.

    But kick_hub_wq() must never be called together with hub_disconnect()
    otherwise even the original code would have failed. Any callers are
    responsible for this.

    Therefore the only problem is that hub_disconnect() could be called in parallel
    with hub_event(). But this was possible even in the past. struct usb_hub is
    still guarded by hub->kref and released in hub_events() when needed.

    Note that the source file is still full of the obsolete "khubd" strings.
    Let's remove them in a follow up patch. This patch already is complex enough.

    Thanks a lot Alan Stern for code review, many useful
    tips and guidance. Also thanks to Tejun Heo for hints how to
    allocate the workqueue.

    Signed-off-by: Petr Mladek
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Petr Mladek
     
  • We would like to convert khubd kthread to a workqueue. As a result hub_events()
    will handle only one event per call.

    In fact, we could do this already now because there is another cycle in
    hub_thread(). It calls hub_events() until hub_event_list is empty.

    This patch renames the function to hub_event(), removes the while cycle, and
    renames the goto targets from loop* to out*.

    When touching the code, it fixes also formatting of dev_err() and dev_dbg()
    calls to make checkpatch.pl happy :-)

    Signed-off-by: Petr Mladek
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Petr Mladek
     
  • This is just a small optimization of the fix from the commit c605f3cdff53a743f6
    ("usb: hub: take hub->hdev reference when processing from eventlist).

    We do not need to take the reference for each event. Instead we could get it
    when struct usb_hub is allocated and put it when it is released. By other words,
    we could handle it the same way as the reference for hub->intfdev.

    The motivation is that it will make the life easier when switching from khubd
    kthread to a workqueue.

    Suggested-by: Alan Stern
    Signed-off-by: Petr Mladek
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Petr Mladek
     
  • There is apparently another SCM USB-SCSI converter with ID 04E6:000F. It
    is listed along with 04E6:000B in the Windows INF file for the Startech
    ICUSBSCSI2 as "eUSB SCSI Adapter (Bus Powered)". The quirk allows
    devices with SCSI ID other than 0 to be accessed.

    Also make a couple of existing SCM product IDs lower case to be
    consistent with other entries.

    Signed-off-by: Mark Knibbs
    Signed-off-by: Greg Kroah-Hartman

    Mark Knibbs
     
  • Castlewood Systems supplied various models of USB-SCSI converter with their
    ORB external removable-media drive. The ORB Windows and Macintosh drivers
    support six USB IDs:
    084B:A001 [VID 084B is Castlewood Systems]
    04E6:0002 (*) ORB USB Smart Cable P/N 88205-001 (generic SCM ID)
    2027:A001 Double-H Technology DH-2000SC
    1822:0001 (*) Ariston iConnect/iSCSI
    07AF:0004 (*) Microtech XpressSCSI (25-pin)
    07AF:0005 (*) Microtech XpressSCSI (50-pin)

    *: quirk already in unusual-devs.h

    [Apparently the official VID for Double-H Technology is 0x07EB = 2027
    decimal. That's another hex/decimal mix-up with these SCM-based products
    (in addition to the Ariston and Entrega ones). Perhaps the USB-IF informed
    companies of their allocated VID in decimal, but they assumed it was hex?
    It seems all Entrega products used VID 0x1645, not just the USB-SCSI
    converter.]

    Double-H Technology Co., Ltd. produced a USB-SCSI converter, model
    DH-2000SC, which is probably the one supported by the ORB drivers. Perhaps
    the Castlewood-bundled product had a different label or PID though?
    Castlewood mentioned Conmate as being one type of USB-SCSI converter.
    Conmate and Double-H seem related somehow; both company addresses in the
    same road, and at one point the Conmate web site mentioned DH-2000H4,
    DH-200D4/DH-2000C4 as models of USB hub (DH short for Double-H presumably).
    Conmate did show a USB-SCSI converter model CM-660 on their web site at one
    point. My guess is that was identical to the DH-2000SC.

    Mention of the Double-H product:
    http://web.archive.org/web/20010221010141/http://www.doubleh.com.tw/dh-2000sc.htm
    The only picture I could find is at
    http://jp.acesuppliers.com/catalog/j64/component/page03.html
    The casing design looks the same as my ORB USB Smart Cable which has ID
    04E6:0002.

    Anyway, that's enough rambling. Here's the patch.

    storage: Add quirks for Castlewood and Double-H USB-SCSI converters

    Add quirks for two SCM-based USB-SCSI converters which were bundled with
    some Castlewood ORB removable drives. Without the quirk only the (single)
    drive with SCSI ID 0 can be accessed.

    Signed-off-by: Mark Knibbs
    Signed-off-by: Greg Kroah-Hartman

    Mark Knibbs