15 Jan, 2012

1 commit

  • Introduce a wrapper around scsi_cmd_ioctl that takes a block device.

    The function will then be enhanced to detect partition block devices
    and, in that case, subject the ioctls to whitelisting.

    Cc: linux-scsi@vger.kernel.org
    Cc: Jens Axboe
    Cc: James Bottomley
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Linus Torvalds

    Paolo Bonzini
     

22 Apr, 2011

1 commit

  • In-kernel disk event polling doesn't matter for legacy/fringe drivers
    and may lead to infinite event loop if ->check_events() implementation
    generates events on level condition instead of edge.

    Now that block layer supports suppressing exporting unlisted events,
    simply leaving disk->events cleared allows these drivers to keep the
    internal revalidation behavior intact while avoiding weird
    interactions with userland event handler.

    Signed-off-by: Tejun Heo
    Cc: Kay Sievers
    Signed-off-by: Jens Axboe

    Tejun Heo
     

10 Mar, 2011

1 commit

  • Convert from ->media_changed() to ->check_events().

    ub buffers media changed state and clears it on revalidation. It will
    behave correctly with kernel event polling.

    Signed-off-by: Tejun Heo
    Cc: Jens Axboe
    Cc: Kay Sievers
    Cc: Pete Zaitcev

    Tejun Heo
     

23 Oct, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (141 commits)
    USB: mct_u232: fix broken close
    USB: gadget: amd5536udc.c: fix error path
    USB: imx21-hcd - fix off by one resource size calculation
    usb: gadget: fix Kconfig warning
    usb: r8a66597-udc: Add processing when USB was removed.
    mxc_udc: add workaround for ENGcm09152 for i.MX35
    USB: ftdi_sio: add device ids for ScienceScope
    USB: musb: AM35x: Workaround for fifo read issue
    USB: musb: add musb support for AM35x
    USB: AM35x: Add musb support
    usb: Fix linker errors with CONFIG_PM=n
    USB: ohci-sh - use resource_size instead of defining its own resource_len macro
    USB: isp1362-hcd - use resource_size instead of defining its own resource_len macro
    USB: isp116x-hcd - use resource_size instead of defining its own resource_len macro
    USB: xhci: Fix compile error when CONFIG_PM=n
    USB: accept some invalid ep0-maxpacket values
    USB: xHCI: PCI power management implementation
    USB: xHCI: bus power management implementation
    USB: xHCI: port remote wakeup implementation
    USB: xHCI: port power management implementation
    ...

    Manually fix up (non-data) conflict: the SCSI merge gad renamed the
    'hw_sector_size' member to 'physical_block_size', and the USB tree
    brought a new use of it.

    Linus Torvalds
     
  • This commit changes prefix for some of the USB mass storage
    class related macros (ie. USB_SC_ for subclass and USB_PR_
    for class).

    Signed-off-by: Michal Nazarewicz
    Cc: Alan Stern
    Cc: Matthew Wilcox
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     

05 Oct, 2010

1 commit

  • The block device drivers have all gained new lock_kernel
    calls from a recent pushdown, and some of the drivers
    were already using the BKL before.

    This turns the BKL into a set of per-driver mutexes.
    Still need to check whether this is safe to do.

    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

    Arnd Bergmann
     

08 Aug, 2010

4 commits

  • The open and release block_device_operations are currently
    called with the BKL held. In order to change that, we must
    first make sure that all drivers that currently rely
    on this have no regressions.

    This blindly pushes the BKL into all .open and .release
    operations for all block drivers to prepare for the
    next step. The drivers can subsequently replace the BKL
    with their own locks or remove it completely when it can
    be shown that it is not needed.

    The functions blkdev_get and blkdev_put are the only
    remaining users of the big kernel lock in the block
    layer, besides a few uses in the ioctl code, none
    of which need to serialize with blkdev_{get,put}.

    Most of these two functions is also under the protection
    of bdev->bd_mutex, including the actual calls to
    ->open and ->release, and the common code does not
    access any global data structures that need the BKL.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • As a preparation for the removal of the big kernel
    lock in the block layer, this removes the BKL
    from the common ioctl handling code, moving it
    into every single driver still using it.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     
  • Remove all the trivial wrappers for the cmd_type and cmd_flags fields in
    struct requests. This allows much easier grepping for different request
    types instead of unwinding through macros.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

26 Feb, 2010

2 commits


11 Jan, 2010

1 commit

  • The id_table field of the struct usb_device_id is constant in
    so it is worth to make ub_usb_ids also constant.

    The semantic match that finds this kind of pattern is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r@
    disable decl_init,const_decl_init;
    identifier I1, I2, x;
    @@
    struct I1 {
    ...
    const struct I2 *x;
    ...
    };
    @s@
    identifier r.I1, y;
    identifier r.x, E;
    @@
    struct I1 y = {
    .x = E,
    };
    @c@
    identifier r.I2;
    identifier s.E;
    @@
    const struct I2 E[] = ... ;
    @depends on !c@
    identifier r.I2;
    identifier s.E;
    @@
    + const
    struct I2 E[] = ...;
    //

    Signed-off-by: Márton Németh
    Cc: Julia Lawall
    Cc: cocci@diku.dk
    Signed-off-by: Jens Axboe

    Márton Németh
     

22 Sep, 2009

1 commit


23 May, 2009

1 commit

  • Until now we have had a 1:1 mapping between storage device physical
    block size and the logical block sized used when addressing the device.
    With SATA 4KB drives coming out that will no longer be the case. The
    sector size will be 4KB but the logical block size will remain
    512-bytes. Hence we need to distinguish between the physical block size
    and the logical ditto.

    This patch renames hardsect_size to logical_block_size.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

19 May, 2009

2 commits

  • In commit c3a4d78c580de4edc9ef0f7c59812fb02ceb037f, while introducing
    rq->resid_len, the default value of residue count was changed from
    full count to zero. The conversion was done under the assumption that
    when a request fails residue count wasn't defined. However, Boaz and
    James pointed out that this wasn't true and the residue count should
    be preserved for failed requests too.

    This patchset restores the original behavior by setting rq->resid_len
    to blk_rq_bytes(rq) on request start and restoring explicit clearing
    in affected drivers. While at it, take advantage of the fact that
    rq->resid_len is set to full count where applicable.

    * ide-cd: rq->resid_len cleared on pc success

    * mptsas: req->resid_len cleared on success

    * sas_expander: rsp/req->resid_len cleared on success

    * mpt2sas_transport: req->resid_len cleared on success

    * ide-cd, ide-tape, mptsas, sas_host_smp, mpt2sas_transport, ub: take
    advantage of initial full count to simplify code

    Boaz Harrosh spotted bug in resid_len initialization. Fixed as
    suggested.

    Signed-off-by: Tejun Heo
    Acked-by: Borislav Petkov
    Cc: Boaz Harrosh
    Cc: James Bottomley
    Cc: Pete Zaitcev
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Sergei Shtylyov
    Cc: Eric Moore
    Cc: Darrick J. Wong
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • ub_end_rq() always tries to complete full request. The @cmd_len
    parameter was there because rq->data_len used to be overwritten with
    residue count. Drop @cmd_len and use __blk_end_request_all().

    Signed-off-by: Tejun Heo
    Cc: Pete Zaitcev
    Signed-off-by: Jens Axboe

    Tejun Heo
     

11 May, 2009

5 commits

  • Till now block layer allowed two separate modes of request execution.
    A request is always acquired from the request queue via
    elv_next_request(). After that, drivers are free to either dequeue it
    or process it without dequeueing. Dequeue allows elv_next_request()
    to return the next request so that multiple requests can be in flight.

    Executing requests without dequeueing has its merits mostly in
    allowing drivers for simpler devices which can't do sg to deal with
    segments only without considering request boundary. However, the
    benefit this brings is dubious and declining while the cost of the API
    ambiguity is increasing. Segment based drivers are usually for very
    old or limited devices and as converting to dequeueing model isn't
    difficult, it doesn't justify the API overhead it puts on block layer
    and its more modern users.

    Previous patches converted all block low level drivers to dequeueing
    model. This patch completes the API transition by...

    * renaming elv_next_request() to blk_peek_request()

    * renaming blkdev_dequeue_request() to blk_start_request()

    * adding blk_fetch_request() which is combination of peek and start

    * disallowing completion of queued (not started) requests

    * applying new API to all LLDs

    Renamings are for consistency and to break out of tree code so that
    it's apparent that out of tree drivers need updating.

    [ Impact: block request issue API cleanup, no functional change ]

    Signed-off-by: Tejun Heo
    Cc: Rusty Russell
    Cc: James Bottomley
    Cc: Mike Miller
    Cc: unsik Kim
    Cc: Paul Clements
    Cc: Tim Waugh
    Cc: Geert Uytterhoeven
    Cc: David S. Miller
    Cc: Laurent Vivier
    Cc: Jeff Garzik
    Cc: Jeremy Fitzhardinge
    Cc: Grant Likely
    Cc: Adrian McMenamin
    Cc: Stephen Rothwell
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Alex Dubov
    Cc: Pierre Ossman
    Cc: David Woodhouse
    Cc: Markus Lidel
    Cc: Stefan Weinhuber
    Cc: Martin Schwidefsky
    Cc: Pete Zaitcev
    Cc: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • With the previous changes, the followings are now guaranteed for all
    requests in any valid state.

    * blk_rq_sectors() == blk_rq_bytes() >> 9
    * blk_rq_cur_sectors() == blk_rq_cur_bytes() >> 9

    Clean up accessor usages. Notable changes are

    * nbd,i2o_block: end_all used instead of explicit byte count
    * scsi_lib: unnecessary conditional on request type removed

    [ Impact: cleanup ]

    Signed-off-by: Tejun Heo
    Cc: Paul Clements
    Cc: Pete Zaitcev
    Cc: Alex Dubov
    Cc: Markus Lidel
    Cc: David Woodhouse
    Cc: James Bottomley
    Cc: Boaz Harrosh
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • With recent unification of fields, it's now guaranteed that
    rq->data_len always equals blk_rq_bytes(). Convert all non-IDE direct
    users to accessors. IDE will be converted in a separate patch.

    Boaz: spotted incorrect data_len/resid_len conversion in osd.

    [ Impact: convert direct rq->data_len usages to blk_rq_bytes() ]

    Signed-off-by: Tejun Heo
    Acked-by: Sergei Shtylyov
    Cc: Pete Zaitcev
    Cc: Eric Moore
    Cc: Markus Lidel
    Cc: Darrick J. Wong
    Cc: James Bottomley
    Cc: Eric Moore
    Cc: Boaz Harrosh
    Cc: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • With recent cleanups, there is no place where low level driver
    directly manipulates request fields. This means that the 'hard'
    request fields always equal the !hard fields. Convert all
    rq->sectors, nr_sectors and current_nr_sectors references to
    accessors.

    While at it, drop superflous blk_rq_pos() < 0 test in swim.c.

    [ Impact: use pos and nr_sectors accessors ]

    Signed-off-by: Tejun Heo
    Acked-by: Geert Uytterhoeven
    Tested-by: Grant Likely
    Acked-by: Grant Likely
    Tested-by: Adrian McMenamin
    Acked-by: Adrian McMenamin
    Acked-by: Mike Miller
    Cc: James Bottomley
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Eric Moore
    Cc: Alan Stern
    Cc: FUJITA Tomonori
    Cc: Pete Zaitcev
    Cc: Stephen Rothwell
    Cc: Paul Clements
    Cc: Tim Waugh
    Cc: Jeff Garzik
    Cc: Jeremy Fitzhardinge
    Cc: Alex Dubov
    Cc: David Woodhouse
    Cc: Martin Schwidefsky
    Cc: Dario Ballabio
    Cc: David S. Miller
    Cc: Rusty Russell
    Cc: unsik Kim
    Cc: Laurent Vivier
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • rq->data_len served two purposes - the length of data buffer on issue
    and the residual count on completion. This duality creates some
    headaches.

    First of all, block layer and low level drivers can't really determine
    what rq->data_len contains while a request is executing. It could be
    the total request length or it coulde be anything else one of the
    lower layers is using to keep track of residual count. This
    complicates things because blk_rq_bytes() and thus
    [__]blk_end_request_all() relies on rq->data_len for PC commands.
    Drivers which want to report residual count should first cache the
    total request length, update rq->data_len and then complete the
    request with the cached data length.

    Secondly, it makes requests default to reporting full residual count,
    ie. reporting that no data transfer occurred. The residual count is
    an exception not the norm; however, the driver should clear
    rq->data_len to zero to signify the normal cases while leaving it
    alone means no data transfer occurred at all. This reverse default
    behavior complicates code unnecessarily and renders block PC on some
    drivers (ide-tape/floppy) unuseable.

    This patch adds rq->resid_len which is used only for residual count.

    While at it, remove now unnecessasry blk_rq_bytes() caching in
    ide_pc_intr() as rq->data_len is not changed anymore.

    Boaz : spotted missing conversion in osd
    Sergei : spotted too early conversion to blk_rq_bytes() in ide-tape

    [ Impact: cleanup residual count handling, report 0 resid by default ]

    Signed-off-by: Tejun Heo
    Cc: James Bottomley
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Mike Miller
    Cc: Eric Moore
    Cc: Alan Stern
    Cc: FUJITA Tomonori
    Cc: Doug Gilbert
    Cc: Mike Miller
    Cc: Eric Moore
    Cc: Darrick J. Wong
    Cc: Pete Zaitcev
    Cc: Boaz Harrosh
    Signed-off-by: Jens Axboe

    Tejun Heo
     

18 Apr, 2009

1 commit

  • Wireless USB endpoint state has a sequence number and a current
    window and not just a single toggle bit. So allow HCDs to provide a
    endpoint_reset method and call this or clear the software toggles as
    required (after a clear halt, set configuration etc.).

    usb_settoggle() and friends are then HCD internal and are moved into
    core/hcd.h and all device drivers call usb_reset_endpoint() instead.

    If the device endpoint state has been reset (with a clear halt) but
    the host endpoint state has not then subsequent data transfers will
    not complete. The device will only work again after it is reset or
    disconnected.

    Signed-off-by: David Vrabel
    Signed-off-by: Greg Kroah-Hartman

    David Vrabel
     

25 Mar, 2009

2 commits

  • This patch (as1206) is the first step in converting usb-storage's
    subdrivers into separate modules. It makes the following large-scale
    changes:

    Remove a bunch of unnecessary #ifdef's from usb_usual.h.
    Not truly necessary, but it does clean things up.

    Move the USB device-ID table (which is duplicated between
    libusual and usb-storage) into its own source file,
    usual-tables.c, and arrange for this to be linked with
    either libusual or usb-storage according to whether
    USB_LIBUSUAL is configured.

    Add to usual-tables.c a new usb_usual_ignore_device()
    function to detect whether a particular device needs to be
    managed by a subdriver and not by the standard handlers
    in usb-storage.

    Export a whole bunch of functions in usb-storage, renaming
    some of them because their names don't already begin with
    "usb_stor_". These functions will be needed by the new
    subdriver modules.

    Split usb-storage's probe routine into two functions.
    The subdrivers will call the probe1 routine, then fill in
    their transport and protocol settings, and then call the
    probe2 routine.

    Take the default cases and error checking out of
    get_transport() and get_protocol(), which run during
    probe1, and instead put a check for invalid transport
    or protocol values into the probe2 function.

    Add a new probe routine to be used for standard devices,
    i.e., those that don't need a subdriver. This new routine
    checks whether the device should be ignored (because it
    should be handled by ub or by a subdriver), and if not,
    calls the probe1 and probe2 functions.

    Signed-off-by: Alan Stern
    CC: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This set of patches introduces calls to the following set of functions:

    usb_endpoint_dir_in(epd)
    usb_endpoint_dir_out(epd)
    usb_endpoint_is_bulk_in(epd)
    usb_endpoint_is_bulk_out(epd)
    usb_endpoint_is_int_in(epd)
    usb_endpoint_is_int_out(epd)
    usb_endpoint_num(epd)
    usb_endpoint_type(epd)
    usb_endpoint_xfer_bulk(epd)
    usb_endpoint_xfer_control(epd)
    usb_endpoint_xfer_int(epd)
    usb_endpoint_xfer_isoc(epd)

    In some cases, introducing one of these functions is not possible, and it
    just replaces an explicit integer value by one of the following constants:

    USB_ENDPOINT_XFER_BULK
    USB_ENDPOINT_XFER_CONTROL
    USB_ENDPOINT_XFER_INT
    USB_ENDPOINT_XFER_ISOC

    An extract of the semantic patch that makes these changes is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r1@ struct usb_endpoint_descriptor *epd; @@

    - ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
    - \(USB_ENDPOINT_XFER_CONTROL\|0\))
    + usb_endpoint_xfer_control(epd)

    @r5@ struct usb_endpoint_descriptor *epd; @@

    - ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
    - \(USB_DIR_IN\|0x80\))
    + usb_endpoint_dir_in(epd)

    @inc@
    @@

    #include

    @depends on !inc && (r1||r5)@
    @@

    + #include
    #include
    //

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

    Julia Lawall
     

08 Jan, 2009

1 commit

  • This patch (as1161) changes the interface to
    usb_lock_device_for_reset(). The existing interface is apparently not
    very clear, judging from the fact that several of its callers don't
    use it correctly. The new interface always returns 0 for success and
    it always requires the caller to unlock the device afterward.

    The new routine will not return immediately if it is called while the
    driver's probe method is running. Instead it will wait until the
    probe is over and the device has been unlocked. This shouldn't cause
    any problems; I don't know of any cases where drivers call
    usb_lock_device_for_reset() during probe.

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

    Alan Stern
     

14 Nov, 2008

1 commit

  • Due to recent changes to usb_reset_device, the following hang occurs:

    events/0 D 0000000000000000 0 6 2
    ffff880037477cc0 0000000000000046 ffff880037477c50 ffffffff80237434
    ffffffff80574c80 00000001000a015c 0000000000000286 ffff8800374757d0
    ffff88002a31c860 ffff880037475a00 0000000036779140 ffff880037475a00
    Call Trace:
    [] try_to_del_timer_sync+0x52/0x5b
    [] dma_pool_free+0x1a7/0x1ec
    [] ub_disconnect+0x8e/0x1ad [ub]
    [] autoremove_wake_function+0x0/0x2e
    [] usb_unbind_interface+0x5c/0xb7
    [] __device_release_driver+0x95/0xbd
    [] device_release_driver+0x21/0x2d
    [] usb_driver_release_interface+0x44/0x83
    [] usb_forced_unbind_intf+0x17/0x1d
    [] usb_reset_device+0x7d/0x114
    [] ub_reset_task+0x0/0x293 [ub]
    [] ub_reset_task+0x1c4/0x293 [ub]
    [] flush_to_ldisc+0x0/0x1cd
    [] ub_reset_task+0x0/0x293 [ub]
    [] run_workqueue+0x87/0x114
    [] worker_thread+0xd8/0xe7
    [] autoremove_wake_function+0x0/0x2e
    [] worker_thread+0x0/0xe7
    [] kthread+0x47/0x73
    [] schedule_tail+0x27/0x60
    [] child_rip+0xa/0x11
    [] kthread+0x0/0x73
    [] child_rip+0x0/0x11

    This is because usb_reset_device now unbinds, and that calls disconnect,
    which in case of ub waits until the reset completes... which deadlocks.
    Worse, this deadlocks keventd and this takes whole box down.

    I'm going to fix this properly later, but let's unbreak the driver
    quickly for non-composite devices at least.

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

    Pete Zaitcev
     

21 Oct, 2008

4 commits

  • Signed-off-by: Al Viro

    Al Viro
     
  • To keep the size of changesets sane we split the switch by drivers;
    to keep the damn thing bisectable we do the following:
    1) rename the affected methods, add ones with correct
    prototypes, make (few) callers handle both. That's this changeset.
    2) for each driver convert to new methods. *ALL* drivers
    are converted in this series.
    3) kill the old (renamed) methods.

    Note that it _is_ a flagday; all in-tree drivers are converted and by the
    end of this series no trace of old methods remain. The only reason why
    we do that this way is to keep the damn thing bisectable and allow per-driver
    debugging if anything goes wrong.

    New methods:
    open(bdev, mode)
    release(disk, mode)
    ioctl(bdev, mode, cmd, arg) /* Called without BKL */
    compat_ioctl(bdev, mode, cmd, arg)
    locked_ioctl(bdev, mode, cmd, arg) /* Called with BKL, legacy */

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • store needed information in f_mode

    Signed-off-by: Al Viro

    Al Viro
     

18 Oct, 2008

1 commit


03 May, 2008

4 commits

  • Fix a few comments and printk statements.

    Signed-off-by: Pete Zaitcev
    Signed-off-by: Greg Kroah-Hartman

    Pete Zaitcev
     
  • I hoped to continue to ignore this problem or use libusual, but these
    days it's simpler to work around than to deal with it. Let's attempt to
    use bad residue devices and hope that upper level integrity checks catch
    any problems (e.g. please use sha1sum on your backups).

    Signed-off-by: Pete Zaitcev
    Signed-off-by: Greg Kroah-Hartman

    Pete Zaitcev
     
  • Make ub to fail faster in hopeless cases.

    Signed-off-by: Pete Zaitcev
    Signed-off-by: Greg Kroah-Hartman

    Pete Zaitcev
     
  • The wodim says:
    "close track/session scsi sendcmd: cmd timeout after 5.000 (480) s"
    This happened because we ignored the supplied timeout and used 5s.

    It's not completely correct to apply a timeout meant for the complete
    command to any single URB, but we don't have many URBs per command, so
    this is simple and works.

    Signed-off-by: Pete Zaitcev
    Signed-off-by: Greg Kroah-Hartman

    Pete Zaitcev
     

29 Apr, 2008

1 commit


09 Apr, 2008

1 commit

  • When __blk_end_request returns nonzero, it means that the request was
    not completely processed and some BIOs are still attached. Since we
    have dequeued it by that time, it means leaking requests and hanging
    processes, which is why BUG() was in there. In ub this happens if
    a packet request ends normally, but with residue (e.g. when scsi_id
    issues INQUIRY).

    The fix is to make sure that arguments passed to __blk_end_request
    are correct: the full request length and not just transferred length.
    The transferred length is indicated to applications by adjusting
    rq->data_len with old, unchanged code outside of this patch.

    Signed-off-by: Pete Zaitcev
    Cc: Kiyoshi Ueda
    Cc: Greg KH
    Cc: Boaz Harrosh
    Cc: Martin Schwidefsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pete Zaitcev
     

10 Feb, 2008

1 commit