1. 01 5月, 2009 3 次提交
  2. 24 4月, 2009 4 次提交
  3. 23 4月, 2009 5 次提交
    • B
      Merge branch 'for-linus' into for-next · 24fc484a
      Bartlomiej Zolnierkiewicz 提交于
      24fc484a
    • B
      mediabay: fix build for CONFIG_BLOCK=n · 83cff839
      Bartlomiej Zolnierkiewicz 提交于
      On Tuesday 14 April 2009 20:31:21 Subrata Modak wrote:
      > Observed the following build error:
      > ---
      > CC      drivers/macintosh/mediabay.o
      > In file included from drivers/macintosh/mediabay.c:21:
      > include/linux/ide.h:605: error: field ‘request_sense_rq’ has incomplete
      > type
      > make[2]: *** [drivers/macintosh/mediabay.o] Error 1
      > make[1]: *** [drivers/macintosh] Error 2
      > make: *** [drivers] Error 2
      > ---
      
      mediabay shouldn't include <linux/ide.h> unconditionally so
      remove the superfluous include from mediabay.c (<asm/mediabay.h>
      will pull <linux/ide.h> in for CONFIG_BLK_DEV_IDE_PMAC=y).
      Reported-by: NSubrata Modak <subrata@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      83cff839
    • B
      ide: Stop disks on reboot for laptop which cuts power · b0aedb04
      Bruno Prémont 提交于
      My laptop (Acer Travelmate 660) always cuts the power when rebooting
      which causes the disk to emergency-park it's head.
      
      Add a dmi check to stop disk as for shutdown on this laptop.
      Signed-off-by: NBruno Prémont <bonbons@linux-vserver.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      b0aedb04
    • H
      ide-cd: fix kernel crash on hppa regression · a1f9a89c
      Helge Deller 提交于
      With 2.6.30-rc2 I face a kernel crash on the 32bit hppa architecture 
      due to ide-cd when udev creates the device nodes at startup:
      
      Kernel Fault: Code=26 regs=8ed34c40 (Addr=00000024)
      IASQ: 00000000 00000000 IAOQ: 1034b5ac 1034b5b0
       IIR: 4ab30048    ISR: 00000000  IOR: 00000024
       CPU:        0   CR30: 8ed34000 CR31: ffff55ff
       ORIG_R28: 00000000
       IAOQ[0]: ide_complete_rq+0x2c/0x70
       IAOQ[1]: ide_complete_rq+0x30/0x70
       RP(r2): cdrom_newpc_intr+0x178/0x46c
      Backtrace:
       [<1035c608>] cdrom_newpc_intr+0x178/0x46c
       [<1034c494>] ide_intr+0x1b0/0x214
       [<1016d284>] handle_IRQ_event+0x70/0x150
       [<1016d4b0>] __do_IRQ+0x14c/0x1cc
       [<102f7864>] superio_interrupt+0x88/0xbc
       [<1016d284>] handle_IRQ_event+0x70/0x150
       [<1016d4b0>] __do_IRQ+0x14c/0x1cc
       [<10112efc>] do_cpu_irq_mask+0x9c/0xd0
       [<10116068>] intr_return+0x0/0x4
      
      This crash seems to happen due to an uninitialized variable "rc".
      The compiler even warns about that:
        CC      drivers/ide/ide-cd.o                                                         
      /mnt/sda4/home/cvs/parisc/git-kernel/linus-linux-2.6/drivers/ide/ide-cd.c: In function `cdrom_newpc_intr':
      /mnt/sda4/home/cvs/parisc/git-kernel/linus-linux-2.6/drivers/ide/ide-cd.c:612: warning: `rc' might be used uninitialized in this function
      
      After applying the trivial patch below, which just initializes 
      the variable to zero, the kernel doesn't crash any longer:
      
      Starting the hotplug events dispatcher: udevd.
      Synthesizing the initial hotplug events...
      hda: command error: status=0x51 { DriveReady SeekComplete Error }
      hda: command error: error=0x54 <3>{ AbortedCommand LastFailedSense=0x05 }
      ide: failed opcode was: unknown
      done.
      Signed-off-by: NHelge Deller <deller@gmx.de>
      Acked-by: NBorislav Petkov <petkovbb@gmail.com>
      Cc: Linus <torvalds@linux-foundation.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      a1f9a89c
    • D
      palm_bk3710: UDMA performance fix · db2f38c2
      David Brownell 提交于
      Fix UDMA throughput bug:  tCYC averages t2CYCTYP/2, but the code
      previously assumed it was the same as t2CYCTYP.  (That is, it was
      using just one clock edge, not both.)  Move the table's type
      declaration so it's adjacent to the table, making it more clear
      what those numbers mean.
      
      On one system this change increased throughput by almost 4x: UDMA/66
      sometimes topped 23 MB/sec (on a drive known to do much better).  On
      another system it was around a 10% win (UDMA/66 up to 7+ MB/sec).
      
      The difference might be caused by the ratio between memory and IDE
      clocks.  In the system with large speedup, this was exactly 2 (as a
      workaround for a rev 1.1 silicon bug).  The other system used a more
      standard ratio of 1.63 (and rev 2.1 silicon) ... clock domain synch
      might have some issues, they're not unheard-of.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      db2f38c2
  4. 21 4月, 2009 1 次提交
  5. 19 4月, 2009 25 次提交
    • T
      ide: drop rq->data handling from ide_map_sg() · 2c316bb5
      Tejun Heo 提交于
      Impact: remove code path which is no longer necessary
      
      All IDE data transfers now use rq->bio.  Simplify ide_map_sg()
      accordingly.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      2c316bb5
    • T
      ide-atapi: kill unused fields and callbacks · 6d700387
      Tejun Heo 提交于
      Impact: remove fields and code paths which are no longer necessary
      
      Now that ide-tape uses standard mechanisms to transfer data, special
      case handling for bh handling can be dropped from ide-atapi.  Drop the
      followings.
      
      * pc->cur_pos, b_count, bh and b_data
      * drive->pc_update_buffers() and pc_io_buffers().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      6d700387
    • T
      ide-tape: simplify read/write functions · 07bd9686
      Tejun Heo 提交于
      Impact: cleanup
      
      idetape_chrdev_read/write() functions are unnecessarily complex when
      everything can be handled in a single loop.  Collapse
      idetape_add_chrdev_read/write_request() into the rw functions and
      simplify the implementation.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      07bd9686
    • T
      ide-tape: use byte size instead of sectors on rw issue functions · 6bb11dd1
      Tejun Heo 提交于
      Impact: cleanup
      
      Byte size is what most issue functions deal with, make
      idetape_queue_rw_tail() and its wrappers take byte size instead of
      sector counts.  idetape_chrdev_read() and write() functions are
      converted to use tape->buffer_size instead of ctl from tape->cap.
      
      This cleans up code a little bit and will ease the next r/w
      reimplementation.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      6bb11dd1
    • T
      ide-tape: unify r/w init paths · 88f1b941
      Tejun Heo 提交于
      Impact: cleanup
      
      Read and write init paths are almost identical.  Unify them into
      idetape_init_rw().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      88f1b941
    • T
      ide-tape: kill idetape_bh · 963da55c
      Tejun Heo 提交于
      Impact: kill now unnecessary idetape_bh
      
      With everything using standard mechanisms, there is no need for
      idetape_bh anymore.  Kill it and use tape->buf, cur and valid to
      describe data buffer instead.
      
      Changes worth mentioning are...
      
      * idetape_queue_rq_tail() now always queue tape->buf and and adjusts
        buffer state properly before completion.
      
      * idetape_pad_zeros() clears the buffer only once.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      963da55c
    • T
      ide-tape: use standard data transfer mechanism · 21d9c5d2
      Tejun Heo 提交于
      Impact: use standard way to transfer data
      
      ide-tape uses rq in an interesting way.  For r/w requests, rq->special
      is used to carry a private buffer management structure idetape_bh and
      rq->nr_sectors and current_nr_sectors are initialized to the number of
      idetape blocks which isn't necessary 512 bytes.  Also,
      rq->current_nr_sectors is used to report back the residual count in
      units of idetape blocks.
      
      This peculiarity taxes both block layer and ide.  ide-atapi has
      different paths and hooks to accomodate it and what a rq means becomes
      quite confusing and making changes at the block layer becomes quite
      difficult and error-prone.
      
      This patch makes ide-tape use bio instead.  With the previous patch,
      ide-tape currently is using single contiguos buffer so replacing it
      isn't difficult.  Data buffer is mapped into bio using
      blk_rq_map_kern() in idetape_queue_rw_tail().  idetape_io_buffers()
      and idetape_update_buffers() are dropped and pc->bh is set to null to
      tell ide-atapi to use standard data transfer mechanism and idetape_bh
      byte counts are updated by the issuer on completion using the residual
      count.
      
      This change also nicely removes the FIXME in ide_pc_intr() where
      ide-tape rqs need to be completed using ide_rq_bytes() instead of
      blk_rq_bytes() (although this didn't really matter as the request
      didn't have bio).
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      21d9c5d2
    • T
      ide-tape: use single continuous buffer · 35ab8d32
      Tejun Heo 提交于
      Impact: simpler buffer allocation and handling, kills OOM, fix DMA transfers
      
      ide-tape has its own multiple buffer mechanism using struct
      idetape_bh.  It allocates buffer with decreasing order-of-two
      allocations so that it results in minimum number of segments.
      However, the implementation is quite complex and works in a way that
      no other block or ide driver works necessitating a lot of special case
      handling.
      
      The benefit this complex allocation scheme brings is questionable as
      PIO or DMA the number of segments (16 maximum) doesn't make any
      noticeable difference and it also doesn't negate the need for multiple
      order allocation which can fail under memory pressure or high
      fragmentation although it does lower the highest order necessary by
      one when the buffer size isn't power of two.
      
      As the first step to remove the custom buffer management, this patch
      makes ide-tape allocate single continous buffer.  The maximum order is
      four.  I doubt the change would cause any trouble but if it ever
      matters, it should be converted to regular sg mechanism like everyone
      else and even in that case dropping custom buffer handling and moving
      to standard mechanism first make sense as an intermediate step.
      
      This patch makes the first bh to contain the whole buffer and drops
      multi bh handling code.  Following patches will make further changes.
      
      This patch has the side effect of killing OOM triggered by allocation
      path and fixing DMA transfers.  Previously, bug in alloc path
      triggered OOM on command issue and commands were passed to DMA engine
      without DMA-mapping all the segments.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      35ab8d32
    • T
      ide-atapi,tape,floppy: allow ->pc_callback() to change rq->data_len · b3071d19
      Tejun Heo 提交于
      Impact: allow residual count implementation in ->pc_callback()
      
      rq->data_len has two duties - carrying the number of input bytes on
      issue and carrying residual count back to the issuer on completion.
      ide-atapi completion callback ->pc_callback() is the right place to do
      this but currently ide-atapi depends on rq->data_len carrying the
      original request size after calling ->pc_callback() to complete the pc
      request.
      
      This patch makes ide_pc_intr(), ide_tape_issue_pc() and
      ide_floppy_issue_pc() cache length to complete before calling
      ->pc_callback() so that it can modify rq->data_len as necessary.
      
      Note: As using rq->data_len for two purposes can make cases like this
            incorrect in subtle ways, future changes will introduce separate
            field for residual count.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      b3071d19
    • T
      ide-tape,floppy: fix failed command completion after request sense · ea7066af
      Tejun Heo 提交于
      Impact: fix infinite retry loop
      
      After a command failed, ide-tape and floppy inserts REQUEST_SENSE in
      front of the failed command and according to the result, sets
      pc->retries, flags and errors.  After REQUEST_SENSE is complete, the
      failed command is again at the front of the queue and if the verdict
      was to terminate the request, the issue functions tries to complete it
      directly by calling drive->pc_callback() and returning ide_stopped.
      
      However, drive->pc_callback() doesn't complete a request.  It only
      prepares for completion of the request.  As a result, this creates an
      infinite loop where the failed request is retried perpetually.
      
      Fix it by actually ending the request by calling ide_complete_rq().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      ea7066af
    • T
      ide-pm: don't abuse rq->data · fc38b521
      Tejun Heo 提交于
      Impact: cleanup rq->data usage
      
      ide-pm uses rq->data to carry pointer to struct request_pm_state
      through request queue and rq->special is used to carray pointer to
      local struct ide_cmd, which isn't necessary.  Use rq->special for
      request_pm_state instead and use local ide_cmd in
      ide_start_power_step().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      fc38b521
    • T
      ide-cd,atapi: use bio for internal commands · 5c4be572
      Tejun Heo 提交于
      Impact: unify request data buffer handling
      
      rq->data is used mostly to pass kernel buffer through request queue
      without using bio.  There are only a couple of places which still do
      this in kernel and converting to bio isn't difficult.
      
      This patch converts ide-cd and atapi to use bio instead of rq->data
      for request sense and internal pc commands.  With previous change to
      unify sense request handling, this is relatively easily achieved by
      adding blk_rq_map_kern() during sense_rq prep and PC issue.
      
      If blk_rq_map_kern() fails for sense, the error is deferred till sense
      issue and aborts the failed command which triggered the sense.  Note
      that this is a slim possibility as sense prep is done on each command
      issue, so for the above condition to actually trigger, all preps since
      the last sense issue till the issue of the request which would require
      a sense should fail.
      
      * do_request functions might sleep now.  This should be okay as ide
        request_fn - do_ide_request() - is invoked only from make_request
        and plug work.  Make sure this is the case by adding might_sleep()
        to do_ide_request().
      
      * Functions which access the read sense data before the sense request
        is complete now should access bio_data(sense_rq->bio) as the sense
        buffer might have been copied during blk_rq_map_kern().
      
      * ide-tape updated to map sg.
      
      * cdrom_do_block_pc() now doesn't have to deal with REQ_TYPE_ATA_PC
        special case.  Simplified.
      
      * tp_ops->output/input_data path dropped from ide_pc_intr().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      5c4be572
    • B
      ide-atapi: convert ide-{floppy,tape} to using preallocated sense buffer · 6b544fcc
      Borislav Petkov 提交于
      Since we're issuing REQ_TYPE_SENSE now we need to allow those types of
      rqs in the ->do_request callbacks. As a future improvement, sense_len
      assignment might be unified across all ATAPI devices. Borislav to
      check with specs and test.
      
      As a result, get rid of ide_queue_pc_head() and
      drive->request_sense_rq.
      
      tj: * Init request sense ide_atapi_pc from sense request.  In the
            longer timer, it would probably better to fold
            ide_create_request_sense_cmd() into its only current user -
            ide_floppy_get_format_progress().
      
          * ide_retry_pc() no longer takes @disk.
      
      CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      6b544fcc
    • B
      ide-cd: convert to using generic sense request · 746d5e43
      Borislav Petkov 提交于
      Preallocate a sense request in the ->do_request method and reinitialize
      it only on demand, in case it's been consumed in the IRQ handler path.
      The reason for this is that we don't want to be mapping rq to bio in
      the IRQ path and introduce all kinds of unnecessary hacks to the block
      layer.
      
      tj: * Both user and kernel PC requests expect sense data to be stored
            in separate storage other than drive->sense_data.  Copy sense
            data to rq->sense on completion if rq->sense is not NULL.  This
            fixes bogus sense data on PC requests.
      
      As a result, remove cdrom_queue_request_sense.
      
      CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      746d5e43
    • B
      ide: add helpers for preparing sense requests · a1df5169
      Borislav Petkov 提交于
      This is in preparation of removing the queueing of a sense request out
      of the IRQ handler path.
      
      Use struct request_sense as a general sense buffer for all ATAPI
      devices ide-{floppy,tape,cd}.
      
      tj: * blk_get_request(__GFP_WAIT) can't be called from do_request() as
            it can cause deadlock.  Converted to use inline struct request
            and blk_rq_init().
      
          * Added xfer / cdb len selection depending on device type.
      
          * All sense prep logics folded into ide_prep_sense() which never
            fails.
      
          * hwif->rq clearing and sense_rq used handling moved into
            ide_queue_sense_rq().
      
          * blk_rq_map_kern() conversion is moved to later patch.
      
      CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      a1df5169
    • T
      ide-cd: don't abuse rq->buffer · cbfd082a
      Tejun Heo 提交于
      Impact: rq->buffer usage cleanup
      
      ide-cd uses rq->buffer to carry pointer to the original request when
      issuing REQUEST_SENSE.  Use rq->special instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      cbfd082a
    • T
      ide-atapi: don't abuse rq->buffer · c267cc1c
      Tejun Heo 提交于
      Impact: rq->buffer usage cleanup
      
      ide-atapi uses rq->buffer as private opaque value for internal special
      requests.  rq->special isn't used for these cases (the only case where
      rq->special is used is for ide-tape rw requests).  Use rq->special
      instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      c267cc1c
    • T
      ide-taskfile: don't abuse rq->buffer · eace4cb0
      Tejun Heo 提交于
      Impact: rq->buffer usage cleanup
      
      ide_raw_taskfile() directly uses rq->buffer to carry pointer to the
      data buffer.  This complicates both block interface and ide backend
      request handling.  Use blk_rq_map_kern() instead and drop special
      handling for REQ_TYPE_ATA_TASKFILE from ide_map_sg().
      
      Note that REQ_RW setting is moved upwards as blk_rq_map_kern() uses it
      to initialize bio rw flag.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      eace4cb0
    • T
      ide-floppy: block pc always uses bio · 7f006dc2
      Tejun Heo 提交于
      Impact: remove unnecessary code path
      
      Block pc requests always use bio and rq->data is always NULL.  No need
      to worry about !rq->bio cases in idefloppy_block_pc_cmd().  Note that
      ide-atapi uses ide_pio_bytes() for bio PIO transfer which handle sg
      fine.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      7f006dc2
    • T
      ide-cd: clear sense buffer before issuing request sense · 1873b90c
      Tejun Heo 提交于
      Impact: code simplification
      
      ide_cd_request_sense_fixup() clears the tail of the sense buffer if
      the device didn't completely fill it.  This patch makes
      cdrom_queue_request_sense() clear the sense buffer before issuing the
      command instead of clearing it afterwards.  This simplifies code and
      eases future changes.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      1873b90c
    • T
      ide kill unused ide_cmd->special · 46a802e8
      Tejun Heo 提交于
      Impact: removal of unused field
      
      No one uses ide_cmd->special anymore.  Kill it.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      46a802e8
    • T
      ide: don't set REQ_SOFTBARRIER · 55f3f399
      Tejun Heo 提交于
      ide doesn't have to worry about REQ_SOFTBARRIER.  Don't set it.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      55f3f399
    • T
      ide: use blk_run_queue() instead of blk_start_queueing() · 853280a4
      Tejun Heo 提交于
      blk_start_queueing() is being phased out in favor of
      [__]blk_run_queue().  Switch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      853280a4
    • T
      ide-tape: remove back-to-back REQUEST_SENSE detection · 1e75540e
      Tejun Heo 提交于
      Impact: fix an oops which always triggers
      
      ide_tape_issue_pc() assumed drive->pc isn't NULL on invocation when
      checking for back-to-back request sense issues but drive->pc can be
      NULL and even when it's not NULL, it's not safe to dereference it once
      the previous command is complete because pc could have been freed or
      was on stack.  Kill back-to-back REQUEST_SENSE detection.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      1e75540e
    • T
      block: clear req->errors on bio completion only for fs requests · 6f41469c
      Tejun Heo 提交于
      Impact: subtle behavior change
      
      For fs requests, rq is only carrier of bios and rq error status as a
      whole doesn't mean much.  This is the reason why rq->errors is being
      cleared on each partial completion of a request as on each partial
      completion the error status is transferred to the respective bios.
      
      For pc requests, rq->errors is used to carry error status to the
      issuer and thus __end_that_request_first() doesn't clear it on such
      cases.
      
      The condition was fine till now as only fs and pc requests have used
      bio and thus the bio completion path.  However, future changes will
      unify data accesses to bio and all non fs users care about rq error
      status.  Clear rq->errors on bio completion only for fs requests.
      
      In general, the implicit clearing is a bit too subtle especially as
      the meaning of rq->errors is completely dependent on low level
      drivers.  Unifying / cleaning up rq->errors usage and letting llds
      manage it would be better.  TODO comment added.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NJens Axboe <axboe@kernel.dk>
      6f41469c
  6. 18 4月, 2009 2 次提交