24 Jul, 2007

1 commit

  • Some of the code has been gradually transitioned to using the proper
    struct request_queue, but there's lots left. So do a full sweet of
    the kernel and get rid of this typedef and replace its uses with
    the proper type.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

16 Jul, 2007

1 commit

  • bsg uses scsi_cmd_ioctl() for some SCSI/sg ioctl
    commands. scsi_cmd_ioctl() gets a request queue from a gendisk
    arguement. This prevents bsg being bound to SCSI devices that don't
    have a gendisk (like OSD). This adds a request_queue argument to
    scsi_cmd_ioctl(). The SCSI/sg ioctl commands doesn't use a gendisk so
    it's safe for any SCSI devices to use scsi_cmd_ioctl().

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     

13 Jul, 2007

1 commit


28 Apr, 2007

1 commit


22 Nov, 2006

1 commit


05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

28 Sep, 2006

1 commit

  • The command "cdrecord dev=/dev/uba x.iso" prints nasty garbage if a blank
    is not in the drive. This happens because drivers have to set req->errors
    separately from just returning zero uptodate with end_that_request_first,
    end_that_request_last. These functions only set error in BIO, but sg_io()
    ignores it.

    Since we're on it, let cdrecord access a device when ->changed is set.
    It's useful if someone wants to know device capabilities without burning
    anything.

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

    Pete Zaitcev
     

27 Jun, 2006

4 commits


22 Jun, 2006

3 commits

  • Remove some silly messages and cast in stone "temporary" messages which
    we keep around. Also, I am hesitant to remove the initialization retries
    without having the hardware to test (anyone who was at KS04 has a spare?)

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

    Pete Zaitcev
     
  • I am taling about this: "if (disk->flags & GENHD_FL_UP) del_gendisk(disk);"
    If del_gendisk() undoes add_disk() like viro just said, why is it conditional?
    huh?
    add_disk() sets the damn flag
    So, I should not need to check ever
    so the above is "if I've called add_disk(), call gendisk()"
    which might be what you want, of course
    but usually you know if you'd done add_disk() on that puppy anyway

    In ub, nobody upstream should ever see half-constructed disks before
    they were passed to add_disk. To that end, only add the struct lun to
    the list on the path of no return. With that fix in place, we do
    not need to test GENHD_FL_UP.

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

    Pete Zaitcev
     
  • Remove the check for NULL which makes no sense. Suggested by Al.

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

    Pete Zaitcev
     

09 May, 2006

1 commit

  • In kernel 2.6.16, if a mounted storage device is removed, an oops happens
    because ub supplies an interface device (and kobject) to the block layer,
    but neglects to pin it. And apparently, the block layer expects its users
    to pin device structures.

    The code in ub was broken this way for years. But the bug was exposed only
    by 2.6.16 when it started to call block_uevent on close, which traverses
    device structures (kobjects actually).

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

    Pete Zaitcev
     

21 Mar, 2006

4 commits

  • Matt mentioned that a very old ZIP-100 actually does need this, but I am
    yet to see anyone who actually has one still working and uses ub with it.
    He/she must be a retrocomputing geek, who can easily bias it to usb-storage
    with libusual, if needed. Meanwhile, common folks have trouble with poorly
    designed USB keys and some el-cheapo European music players. I think we
    better drop this for now.

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

    Pete Zaitcev
     
  • Remove the "diag" file from the sysfs. The usbmon is good enough these days
    so I do not need this feature anymore. Also, sysfs is a pain. Al Viro caught
    a race in this, which I thought too bothersome to fix.

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

    Pete Zaitcev
     
  • The first_open was long overdue for removal, but I wanted to keep this
    separate for other changes in case of regressions.

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

    Pete Zaitcev
     
  • Switch from kmalloc+memset to kzalloc.

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

    Pete Zaitcev
     

01 Feb, 2006

3 commits

  • For crying out loud, they have devices which do not like port resets.
    So, do what usb-storage does and try both bulk and port resets.
    We start with a port reset (which usb-storage does at the end of transport),
    then do a Bulk reset, then a port reset again. This seems to work for me.

    The code is getting dirtier and dirtier here, but I swear that I'll
    do something about it (see those two new XXX). Honest.

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

    Pete Zaitcev
     
  • If SCSI commands are submitted while other commands are still processed,
    the dispatch loop turns, and we stop the work_timer. Then, if URB fails
    to complete, ub hangs until the device is unplugged.

    This does not happen often, becase we only allow one SCSI command per
    block device, but does happen (on multi-LUN devices, for example).

    The fix is to stop timer only when we actually going to change the state.

    The nicest code would be to have the timer stopped in URB callback, but
    this is impossible, because it can be called from inside a timer, through
    the urb_unlink. Then we get BUG in timer.c:cascade(). So, we do it a
    little dirtier.

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

    Pete Zaitcev
     
  • The blk_cleanup_queue does not necesserily destroy the queue. When we
    destroy the corresponding ub_dev, it may leave the queue spinlock pointer
    dangling.

    This patch moves spinlocks from ub_dev to static memory. The locking
    scheme is not changed. These spinlocks are still separate from the ub_lock.

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

    Pete Zaitcev
     

06 Jan, 2006

1 commit

  • add @uptodate argument to end_that_request_last() and @error
    to rq_end_io_fn(). there's no generic way to pass error code
    to request completion function, making generic error handling
    of non-fs request difficult (rq->errors is driver-specific and
    each driver uses it differently). this patch adds @uptodate
    to end_that_request_last() and @error to rq_end_io_fn().

    for fs requests, this doesn't really matter, so just using the
    same uptodate argument used in the last call to
    end_that_request_first() should suffice. imho, this can also
    help the generic command-carrying request jens is working on.

    Signed-off-by: tejun heo
    Signed-Off-By: Jens Axboe

    Tejun Heo
     

05 Jan, 2006

5 commits


29 Oct, 2005

1 commit

  • When building on a 64-bit platform, gcc produces a warning
    "cast of a pointer to an integer of a different size".
    The scatterlist.offset on the LHS is unsigned int, so I used
    that originally.

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

    drivers/block/ub.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    Pete Zaitcev
     

22 Sep, 2005

2 commits

  • This code appears to be more trouble than it's worth, considering that
    no normal users reload drivers. So, we comment it for now. It is not
    removed outright for the benefit of hackers (that is, myself).

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

    Pete Zaitcev
     
  • This patch fixes a few problems with ub and cleans up a couple of things:

    - Bump UB_MAX_REQ_SG, this allows to burn CDs
    - Drop initialization of urb.transfer_flags,
    now that URB_UNLINK_ASYNC is gone
    - Add forgotten processing of stalls at GetMaxLUN
    - Remove a few more P3-tagged printks whose time has come
    - Correct comment about ZIP-100

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

    drivers/block/ub.c | 53 +++++++++++++++++++++++++++--------------------------
    1 file changed, 27 insertions(+), 26 deletions(-)

    Pete Zaitcev
     

09 Sep, 2005

5 commits

  • 29 July 2005, Cambridge, MA:

    This afternoon Alan Stern submitted a patch to remove the URB_ASYNC_UNLINK
    flag from the Linux kernel. Mr. Stern explained, "This flag is a relic
    from an earlier, less-well-designed system. For over a year it hasn't
    been used for anything other than printing warning messages."

    An anonymous spokesman for the Linux kernel development community
    commented, "This is exactly the sort of thing we see happening all the
    time. As the kernel evolves, support for old techniques and old code can
    be jettisoned and replaced by newer, better approaches. Proprietary
    operating systems do not have the freedom or flexibility to change so
    quickly."

    Mr. Stern, a staff member at Harvard University's Rowland Institute who
    works on Linux only as a hobby, noted that the patch (labelled as548) did
    not update two files, keyspan.c and option.c, in the USB drivers' "serial"
    subdirectory. "Those files need more extensive changes," he remarked.
    "They examine the status field of several URBs at times when they're not
    supposed to. That will need to be fixed before the URB_ASYNC_UNLINK flag
    is removed."

    Greg Kroah-Hartman, the kernel maintainer responsible for overseeing all
    of Linux's USB drivers, did not respond to our inquiries or return our
    calls. His only comment was "Applied, thanks."

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

    Alan Stern
     
  • Back out Axboe-style quasi-S/G and replace it with one command and
    repeated URBs. This is similar to what usb-storage does, only instead
    of a few URBs allocated together, one URB is reused.

    Jens's idea was very nice, but it collapsed when I had to support
    packet commads for CD burning. I cannot issue two or more packet
    commands where application expected only one.

    However, burning does not work completely yet. The cdrecord starts,
    recognizes the device, then aborts without writing a TOC.

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

    Pete Zaitcev
     
  • When Al Viro saw the ub.c, he observed that it was a proof positive of
    Linus not reading patches anymore: names like fo_ob_ar_ba_2 used to
    cause serious fireworks. In my defence, any good scheme can be pushed
    to the realm of absurd if pushed far enough.

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

    Pete Zaitcev
     
  • Evidently, Yani Ioannou's display is wider than mine.

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

    Pete Zaitcev
     
  • This the quasi-S/G patch for ub as suggested by Jens Axboe at OLS and
    implemented that night before 4 a.m. Surprisingly, it worked right away...
    Alas, I had to skip some OLS partying, but it was for the good cause.
    Now the speed of ub is quite acceptable even on partitions with small
    block size.

    The ub does not really support S/G. Instead, it just tells the block
    layer that it does. Then, most of the time, the block layer merges
    requests and passes single-segmnent requests down to ub; everything
    works as before. Very rarely ub gets an unmerged S/G request. In such
    case, it issues several commands to the device.

    I added a small array of counters to monitor the merging (sg_stat).
    This may be dropped later.

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

    Pete Zaitcev
     

28 Jul, 2005

1 commit

  • This patch fixes a microcode lockup in my CD-ROM adapters when a blank CD
    is inserted. However, do not try to burn CDs yet! I'm pretty sure that
    trying it will end in coasters.

    - Fix a few cases where we were unable to resynchronize with replies
    for previous commands. The main thing is to keep reading replies
    in case of a stall. This is done with the new state CLRRS.
    - Since I am forgetting the basic state machine already, document it.
    - Move counter increments in the looping path in its own function.
    - Fix a harmless buglet in case CSW read fails to submit: do not
    override state.
    - Implement the Alan Stern's idea for adaptive signature checking.

    Signed-off-by: Pete Zaitcev
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pete Zaitcev
     

21 Jun, 2005

1 commit


09 Jun, 2005

1 commit

  • This smoothes two imperfections:
    - Increase number of LUNs per device from 4 to 9. The best solution
    would be to remove this limit altogether, but that has to wait until
    the time when more than 26 hosts are allowed.
    - Replace mdelay with msleep in a probing routine.

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

    Pete Zaitcev
     

03 Jun, 2005

1 commit