04 Sep, 2010

3 commits

  • Please find attached patch for
    https://bugzilla.kernel.org/show_bug.cgi?id=16023 problem.

    Signed-off-by: Maxim Osipov
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Maxim Osipov
     
  • This patch removes the following section mismatch warning,
    by moving the function rndis_init() from .init.text to .text.

    WARNING: vmlinux.o(.text+0x1aeca5a): Section mismatch in reference from the function rndis_bind_config() to the function .init.text:rndis_init()
    The function rndis_bind_config() references
    the function __init rndis_init().
    This is often because rndis_bind_config lacks a __init
    annotation or the annotation of rndis_init is wrong.

    Signed-off-by: Henrik Kretzschmar
    Signed-off-by: Greg Kroah-Hartman

    Henrik Kretzschmar
     
  • DEBUG is defined unconditionally, remove it as this clutters the message log.

    Signed-off-by: Maurus Cuelenaere
    Signed-off-by: Greg Kroah-Hartman

    Maurus Cuelenaere
     

24 Aug, 2010

4 commits

  • In this code, 0 is returned on memory allocation failure, even though other
    failures return -ENOMEM or other similar values.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression ret;
    expression x,e1,e2,e3;
    @@

    ret = 0
    ... when != ret = e1
    *x = \(kmalloc\|kcalloc\|kzalloc\)(...)
    ... when != ret = e2
    if (x == NULL) { ... when != ret = e3
    return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     
  • Warning(include/linux/usb/composite.h:284): No description found for parameter 'disconnect'
    Warning(drivers/usb/gadget/composite.c:744): No description found for parameter 'c'
    Warning(drivers/usb/gadget/composite.c:744): Excess function parameter 'cdev' description in 'usb_string_ids_n'

    Signed-off-by: Randy Dunlap
    Cc: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • Signed-off-by: Axel Lin
    Signed-off-by: Greg Kroah-Hartman

    Axel Lin
     
  • We're trying to test for the the end of the loop here. "format" is
    never NULL. We don't know what "format->fcc" is because we're past the
    end of the loop and I think "fmt->fmt.pix.pixelformat" comes from the
    user so we don't know what that is either. It works, but it's cleaner
    to just test to see if (i == ARRAY_SIZE(uvc_formats).

    Signed-off-by: Dan Carpenter
    Acked-by: Laurent Pinchart
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

13 Aug, 2010

1 commit


11 Aug, 2010

32 commits

  • Moved the serial parameter handling code out of "#ifdef
    CONFIG_USB_FILE_STORAGE_TEST".

    This modifies Yann Cantin's commit "USB: Add a serial number
    parameter to g_file_storage" module as per Alan Stern's request.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Acked-by: Alan Stern
    Tested-by: Anand Gadiyar
    Cc: David Brownell
    Cc: Yann Cantin

    Michal Nazarewicz
     
  • This patch adds support for clock gating of the HS/OTG block. On S5PV210
    otg gating clock is initally disabled so the driver needs to get and
    enable it before it can access its registers.

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Marek Szyprowski
     
  • S5PV210 SoCs has 2 USB PHY interfaces, both enabled by writing zero to
    S3C_PHYPWR register. HS/OTG driver uses only PHY0, so do not touch bits
    related to PHY1.

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Marek Szyprowski
     
  • drivers/usb/gadget/s3c-hsotg.c: In function ‘s3c_hsotg_otgreset’:
    drivers/usb/gadget/s3c-hsotg.c:2816: error: ‘MHZ’ undeclared (first use in this function)
    drivers/usb/gadget/s3c-hsotg.c:2816: error: (Each undeclared identifier is reported only once
    drivers/usb/gadget/s3c-hsotg.c:2816: error: for each function it appears in.)

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Marek Szyprowski
     
  • The PLL that drives the USB clock supports 3 input clocks: 12, 24 and 48Mhz.
    This patch adds support to the USB driver for setting the correct register bit
    according to the given clock.

    This depends on the following patch:
    [PATCH] ARM: S3C64XX: Add USB external clock definition

    Signed-off-by: Maurus Cuelenaere
    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Maurus Cuelenaere
     
  • If there is more data in the request than we could fit into a single
    hardware request, then check when the OutDone event is received if
    we have more data, and if so, schedule the new data instead of trying
    to complete the request (and in the case of EP0, sending a 0 packet
    in the middle of a transfer).

    Also, move the debug message about the current transfer state before
    the warning about a bad transfer.

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • The EP0 out limit is the same as the IN limit, so make them the same.

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • The maximum length for any EP0 IN request on EP0 is 127 bytes, not 128
    as the driver currently has it.

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • Before trying a new setup transaction after getting an EP0 in complete
    interrupt, check that the driver did not try and send more EP0 IN data
    before enqueing a new setup transaction.

    This fixes a bug where we cannot send all of the IN data in one go
    so split the transfer, but then fail to send all the data as we start
    waiting for a new OUT transaction

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • Limit the IN FIFO write to a single packet per attempt at writing,
    as per the specifications and ensure that we don't return fifo-full
    so that we can continue writing packets if we have the space.

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • Add support for the dedicated FIFO mode on newer SoCs such as the S5PV210
    partly to improve support and to fix the bug where any non-EP0 IN endpoint
    requires its own FIFO allocation.

    To fix this, we ensure that any non-zero IN endpoint is given a TXFIFO
    using the same allocation method as the periodic case (all our current
    hardware has enough FIFOs and FIFO memory for a 1:1 mapping) and ensure
    that the necessary transmission done interrupt is enabled.

    The default settings from reset for the core point all EPs at FIFO0,
    used for the control endpoint. However, the controller documentation
    states that all IN endpoints _must_ have a unique FIFO to avoid any
    contention during transmission.

    Note, this leaves us with a large IN FIFO for EP0 (which re-uses the
    old NPTXFIFO) for an endpoint which cannot shift more than a pair of
    packets at a time... this is a waste, but it looks like we cannot
    re-allocate space to the individual IN FIFOs as they are already
    maxed out (to be confirmed).

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • The USB documentation suggest that the FIFOs should be reset when a
    bus reset event happens. Use the s3c_hsotg_init_fifo() to ensure that
    the FIFO layout is correct and that the FIFOs are flushed before
    acknowledging the reset.

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • In shared fifo mode (used on older SoCs) the periodic in fifo beahves
    much more like a packet buffer, discarding old data when writing new
    data. Avoid this by ensuring that we do not load new transactions in
    when there is data sitting already in the FIFO.

    Note, this may not be an observed bug, we are fixing the case that this
    may happen.

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • Fix a problem where we have been underestimating the space available in
    the IN PTX/NPTX FIFOs by assuming that they where simply word aligned
    instead of in number-of-words. This means all length calculations need
    to be multiplied-by-4.

    Note, we do not change the information about fifo size or start addresses
    available to userspace as we assume the user can multiply by four easily
    and is already knows these values are in words.

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • Up the FIFO size for the TX to 1024 entries, as this now seems to work
    with all the cores. This fixes a problem when using large packets on
    a core with MPS set to 512 can hang due to insufficient space for the
    writes.

    The hang arises due to getting the non-periodic FIFO empty IRQ but
    not being able to satisfy any requests since there is never enough
    space to write 512 bytes into the buffer. This means we end up with
    a stream of interrupt requests.

    It is easier to up the TX FIFO to fill the space we left for it
    than to try and fix the positions in the code where we should have
    limited the max-packet size to < TXFIFOSIZE, since the TXFIFOSIZE
    depends on how the TX FIFOs have been setup.

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • MS Windows mounts removable storage in "Removal optimized mode" by
    default. All the writes to the media are synchronous which is achieved
    by setting FUA (Force Unit Access) bit in SCSI WRITE(10,12) commands.
    This prevents I/O requests aggregation in block layer dramatically
    decreasing performance.

    This patch brings an option to accept or ignore mentioned bit
    a) via specifying module parameter "nofua", or
    b) through sysfs entry
    /sys/devices/platform/_UDC_/gadget/gadget-lunX/nofua
    (_UDC_ is the name of the USB Device Controller driver)

    Patch is based on the work that was done by Denis Karpov for Maemo 5
    platform.

    Signed-off-by: Andy Shevchenko
    Acked-by: Alan Stern
    Cc: Denis Karpov
    Cc: Adrian Hunter
    Cc: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • Bring a strict way to get the 'ro' parameter from the user.

    The patch followed by this one adds another boolean parameter. To be consistent
    Michał Nazarewicz proposed to use simple_strtol() in both cases (correspondend
    discussion in LKML [1]). Due to simple_strtol() doesn't return error in a good
    way and we have a boolean parameter the strict_strtoul() is used.

    [1] http://lkml.org/lkml/2010/7/14/169

    Signed-off-by: Andy Shevchenko
    Acked-by: Alan Stern
    Cc: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • Removed entry referencing g_eth_ffs.c file from Makefile.
    The file never existed and the line was a leftover from a
    developing process.

    Signed-off-by: Michal Nazarewicz
    Reported-by: Robert P. J. Day
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • This is a patch that implements an USB EHCI Debug Device using the
    Gadget API. This patch applies to a 2.6.35-rc3 kernel.

    The gadget needs a compliant usb controller that forwards the
    USB_DEVICE_DEBUG_MODE feature to its gadget.

    The gadget provides two configuration modes, one that only printk() the
    received data, and one that exposes a serial device to userland
    (/dev/ttyGSxxx).

    The gadget has been tested on an IGEPv2 board running a 2.6.35-rc1
    kernel. The debug port was fed on the host side by a 2.6.34 kernel.

    Signed-off-by: Stephane Duverger
    Cc: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    stephane duverger
     
  • Signed-off-by: Joe Perches
    Signed-off-by: Greg Kroah-Hartman

    Joe Perches
     
  • All these files use the big kernel lock in a trivial
    way to serialize their private file operations,
    typically resulting from an earlier semi-automatic
    pushdown from VFS.

    None of these drivers appears to want to lock against
    other code, and they all use the BKL as the top-level
    lock in their file operations, meaning that there
    is no lock-order inversion problem.

    Consequently, we can remove the BKL completely,
    replacing it with a per-file mutex in every case.
    Using a scripted approach means we can avoid
    typos.

    file=$1
    name=$2
    if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
    sed -i '/include.*/d' ${file}
    else
    sed -i 's/include.*.*$/include /g' ${file}
    fi
    sed -i ${file} \
    -e "/^#include.*linux.mutex.h/,$ {
    1,/^\(static\|int\|long\)/ {
    /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

    } }" \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[ ]*cycle_kernel_lock();/d'
    else
    sed -i -e '/include.*\/d' ${file} \
    -e '/cycle_kernel_lock()/d'
    fi

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • Updated comment to describe why printing macros are needed even
    thought they are copied form the composite.h. Also, made multiline
    comments follow the coding standard.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • Here is the patch for the following issue:

    drivers/usb/gadget/u_serial.c: In function ‘gs_start_tx’:
    drivers/usb/gadget/u_serial.c:369: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
    drivers/usb/gadget/u_serial.c:369: error: (Each undeclared identifier is reported only once
    drivers/usb/gadget/u_serial.c:369: error: for each function it appears in.)
    drivers/usb/gadget/u_serial.c: In function ‘gs_rx_push’:
    drivers/usb/gadget/u_serial.c:546: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
    drivers/usb/gadget/u_serial.c: In function ‘gs_close’:
    drivers/usb/gadget/u_serial.c:857: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
    drivers/usb/gadget/u_serial.c:857: error: implicit declaration of function ‘signal_pending’
    drivers/usb/gadget/u_serial.c:857: error: implicit declaration of function ‘schedule_timeout’
    drivers/usb/gadget/u_serial.c: In function ‘gserial_cleanup’:
    drivers/usb/gadget/u_serial.c:1190: error: ‘TASK_UNINTERRUPTIBLE’ undeclared (first use in this function)
    drivers/usb/gadget/u_serial.c:1190: error: implicit declaration of function ‘schedule’
    drivers/usb/gadget/u_serial.c: In function ‘gserial_disconnect’:
    drivers/usb/gadget/u_serial.c:1311: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)

    Signed-off-by: Stephane Duverger
    Signed-off-by: Greg Kroah-Hartman

    stephane duverger
     
  • This commit cleans the g_fs gadget hopefully making it more
    readable. This is achieved by usage of the usb_string_ids_tab()
    function for batch string IDs registration as well as
    generalising configuration so that a single routine is
    used to add each configuration and bind interfaces. As an
    effect, the code is shorter and has fewer #ifdefs.

    Moreover, in some circumstances previous code #defined
    CONFIG_USB_FUNCTIONFS_GENERIC macro to prevent a situation
    where gadget with no configurations is built. This code removes
    the #define form source code and achieves the same effect using
    select in Kconfig.

    This patch also changes wording and names of the Kconfig options.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • This patch (as1393) converts several of the single-bit fields in
    struct usb_hcd to atomic flags. This is for safety's sake; not all
    CPUs can update bitfield values atomically, and these flags are used
    in multiple contexts.

    The flag fields that are set only during registration or removal can
    remain as they are, since non-atomic accesses at those times will not
    cause any problems.

    (Strictly speaking, the authorized_default flag should become atomic
    as well. I didn't bother with it because it gets changed only via
    sysfs. It can be done later, if anyone wants.)

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

    Alan Stern
     
  • In may gadgets bind and bind like functions were in a init section
    as they were only run during initialisation. However, being
    callback functions they were referenced from structures in “normal”
    sections. Changing the tag from “__init” to “__ref” fixes the
    warnings.

    Signed-off-by: Michal Nazarewicz
    Cc: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • Added pre_eject() and post_eject() callbacks which are
    called before and after removable logical unit is ejected.
    The first can prevent logical unit from being ejected.

    This commit also changes the way callbacks are passed to
    the function from gadget. A fsg_operations structure has
    been created which lists all callbacks -- this is passed
    to the fsg_config.

    This is important because it changes the way thread_exits()
    callback is passed.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • Added a disconnect() callback to composite devices which
    is called by composite glue when its disconnect callback
    is called by gadget.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Acked-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • The Multifunction Composite Gadget have been cleaned up
    and refactored so hopefully it looks prettier and works
    at least as good as before changes.

    A Kconfig has also been fixed to make it impossible to build
    FunctionFS gadget with no configurations. With this patch, if
    RNDIS is not chosen by the user CDC is force-selected.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • The ep0req_name was never used in f_mass_storage hence it may
    be safely removed from the code. It was a leftover from File
    Storage Gadget which used it for debug messages.

    Signed-off-by: Michal Nazarewicz
    Cc: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • Use usb_string_ids_n() function to simplify string ids
    registeration.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • usb_string_ids_tab() and usb_string_ids_n() functions added to
    the composite framework. The first accepts an array of
    usb_string object and for each registeres a string id and the
    second registeres a given number of ids and returns the first.

    This may simplify string ids registration since gadgets and
    composite functions won't have to call usb_string_id() several
    times and each time check for errer status -- all this will be
    done with a single call.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz