1. 12 10月, 2007 1 次提交
    • B
      ide: add ide_set{_max}_pio() (take 4) · 26bcb879
      Bartlomiej Zolnierkiewicz 提交于
      * Add IDE_HFLAG_ABUSE_{PREFETCH,FAST_DEVSEL,DMA_MODES} flags
        and set them in ht6560, cmd640, cmd64x and sc1200 host drivers.
      
      * Add set_pio_mode_abuse() for checking if host driver has a non-standard
        ->tuneproc() implementation and use it in do_special().
      
      * Add ide_set_pio() for setting PIO mode (it uses hwif->pio_mask to find
        the maximum PIO mode supported by the host), also add ide_set_max_pio()
        wrapper for ide_set_pio() to use for auto-tuning.  Convert users of
        ->tuneproc to use ide_set{_max}_pio() where possible.  This leaves only
        do_special(), set_using_pio(), ide_hwif_restore() and ide_set_pio() as
        a direct users of ->tuneproc.
      
      * Remove no longer needed ide_get_best_pio_mode() calls and printk-s
        reporting PIO mode selected from ->tuneproc implementations.
      
      * Rename ->tuneproc hook to ->set_pio_mode and make 'pio' argument const.
      
      * Remove stale comment from ide_config_drive_speed().
      
      v2:
      * Fix "ata_" prefix (Noticed by Jeff).
      
      v3:
      * Minor cleanups/fixups per Sergei's suggestions.
      
      v4:
      * Fix compile problem in drivers/ide/pci/cmd640.c
        (Noticed by Andrew Morton).
      
      * Improve some ->set_pio_mode comments.
      Reviewed-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      26bcb879
  2. 24 7月, 2007 1 次提交
  3. 20 7月, 2007 2 次提交
  4. 10 7月, 2007 2 次提交
  5. 16 5月, 2007 1 次提交
  6. 10 5月, 2007 1 次提交
  7. 11 4月, 2007 1 次提交
    • S
      ide: correctly prevent IDE timer expiry function to run if request was already handled · 23450319
      Suleiman Souhlal 提交于
      It is possible for the timer expiry function to run even though the
      request has already been handled: ide_timer_expiry() only checks that
      the handler is not NULL, but it is possible that we have handled a
      request (thus clearing the handler) and then started a new request
      (thus starting the timer again, and setting a handler). 
      
      A simple way to exhibit this is to set the DMA timeout to 1 jiffy and
      run dd: The kernel will panic after a few minutes because
      ide_timer_expiry() tries to add a timer when it's already active.
      
      To fix this, we simply add a request generation count that gets
      incremented at every interrupt, and check in ide_timer_expiry() that
      we have not already handled a new interrupt before running the expiry
      function.
      Signed-off-by: NSuleiman Souhlal <suleiman@google.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      23450319
  8. 27 3月, 2007 1 次提交
    • S
      ide: use correct IDE error recovery · 513daadd
      Suleiman Souhlal 提交于
      IDE error recovery is using IDLE IMMEDIATE if the drive is busy or has DRQ set.
      This violates the ATA spec (can only send IDLE IMMEDIATE when drive is not
      busy) and really hoses up some drives (modern drives will not be able to
      recover using this error handling).  The correct thing to do is issue a SRST
      followed by a SET FEATURES command.  This is what Western Digital recommends
      for error recovery and what Western Digital says Windows does.  It also does
      not violate the ATA spec as far as I can tell.
      
      Bart:
      * port the patch over the current tree
      * undo the recalibration code removal
      * send SET FEATURES command after checking for good drive status
      * don't check whether the current request is of REQ_TYPE_ATA_{CMD,TASK}
        type because we need to send SET FEATURES before handling any requests
      * some pre-ATA4 drives require INITIALIZE DEVICE PARAMETERS command before
        other commands (except IDENTIFY) so send SET FEATURES only if there are
        no pending drive->special requests
      * update comments and patch description
      * any bugs introduced by this patch are mine and not Suleiman's :-)
      Signed-off-by: NSuleiman Souhlal <suleiman@google.com>
      Acked-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      513daadd
  9. 17 2月, 2007 3 次提交
    • B
      ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2) · 7469aaf6
      Bartlomiej Zolnierkiewicz 提交于
      * since ide_hwif_t.ide_dma_{host_off,off_quietly} always return '0'
        make these functions void and while at it drop "ide_" prefix
      * fix comment for __ide_dma_off_quietly()
      * make __ide_dma_{host_off,off_quietly,off}() void and drop "__" prefix
      
      v2:
      * while at it rename atiixp_ide_dma_host_off() to atiixp_dma_host_off(),
        sgiioc4_ide_dma_{host_off,off_quietly}() to sgiioc4_dma_{host_off,off_quietly}()
        and sl82c105_ide_dma_off_quietly() to sl82c105_dma_off_quietly()
        [ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ]
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      7469aaf6
    • B
      ide: add ide_set_dma() helper (v2) · 3608b5d7
      Bartlomiej Zolnierkiewicz 提交于
      * add ide_set_dma() helper and make ide_hwif_t.ide_dma_check return
        -1 when DMA needs to be disabled (== need to call ->ide_dma_off_quietly)
         0 when DMA needs to be enabled  (== need to call ->ide_dma_on)
         1 when DMA setting shouldn't be changed
      * fix IDE code to use ide_set_dma() instead if using ->ide_dma_check directly
      
      v2:
      * updated for scc_pata
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      3608b5d7
    • A
      ide: clear bmdma status in ide_intr() for ICHx controllers (revised #4) · f0dd8712
      Albert Lee 提交于
      patch 1/2 (revised):
      - Fix drive->waiting_for_dma to work with CDB-intr devices.
      - Do the dma status clearing in ide_intr() and add a new
        hwif->ide_dma_clear_irq for Intel ICHx controllers.
      
      Revised per Alan, Sergei and Bart's advice.
      
      Patch against 2.6.20-rc6. Tested ok on my ICH4 and pdc20275 adapters.
      Please review/apply, thanks.
      Signed-off-by: NAlbert Lee <albertcc@tw.ibm.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: "Adam W. Hawks" <awhawks@us.ibm.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      f0dd8712
  10. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      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: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  11. 03 10月, 2006 2 次提交
    • J
      [PATCH] ide: reprogram disk pio timings on resume · 8c2c0118
      Jason Lunz 提交于
      Add a step to the IDE PM state machine that reprograms disk PIO timings
      as the first step on resume. This prevents ide deadlock on
      resume-from-ram on my nforce3-based laptop.
      
      An earlier implementation was written entirely within the amd74xx ide
      driver, but Alan helpfully pointed out that this is the correct thing to
      do globally. Still, I'm only calling hwif->tuneproc() for disks, based
      on two things:
      
       - The existing state machine is already passed over for non-disk drives
       - Previous testing on my laptop shows that the hangs are related only
         to the disk - suspend/resume from a livecd showed that there's no
         need for this on the cdrom.
      Signed-off-by: NJason Lunz <lunz@falooley.org>
      Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Brad Campbell <brad@wasp.net.au>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8c2c0118
    • H
      [PATCH] IDE error handling fixes · ce42f191
      Hua Zhong 提交于
      In 2.6.15.1 I encountered some IDE crashes when unplugging IDE cables to
      emulate disk errors.  Below is a patch against 2.6.16 which I think still
      applies.
      
      1.  The first BUG_ON could trigger when a PREFLUSH IO fails (it would
         fail the original barrier request which hasn't been marked REQ_STARTED
         yet).
      
      2. the rq could have been dequeued already (same as 1).
      
      3.  HWGROUP(drive)->rq could be NULL because of the ide_error() several
         lines earlier.
      Signed-off-by: NHua Zhong <hzhong@gmail.com>
      Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ce42f191
  12. 01 10月, 2006 3 次提交
  13. 04 7月, 2006 2 次提交
  14. 01 7月, 2006 1 次提交
  15. 29 6月, 2006 1 次提交
  16. 27 6月, 2006 2 次提交
  17. 26 6月, 2006 1 次提交
    • A
      [PATCH] IDE CD end-of media error fix · dbe217af
      Alan Cox 提交于
      This is a patch from Alan that fixes a real ide-cd.c regression causing
      bogus "Media Check" failures for perfectly valid Fedora install ISOs, on
      certain CD-ROM drives.
      
      This is a forward port to 2.6.16 (from RHEL) of the minimal changes for the
      end of media problem.  It may not be sufficient for some controllers
      (promise notably) and it does not touch the locking so the error path
      locking is as horked as in mainstream.
      
      From: Ingo Molnar <mingo@elte.hu>
      
      I have ported the patch to 2.6.17-rc4 and tested it by provoking
      end-of-media IO errors with an unaligned ISO image.  Unlike the vanilla
      kernel, the patched kernel interpreted the error condition correctly with
      512 byte granularity:
      
       hdc: command error: status=0x51 { DriveReady SeekComplete Error }
       hdc: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
       ide: failed opcode was: unknown
       ATAPI device hdc:
         Error: Illegal request -- (Sense key=0x05)
         Illegal mode for this track or incompatible medium -- (asc=0x64, ascq=0x00)
         The failed "Read 10" packet command was:
         "28 00 00 04 fb 78 00 00 06 00 00 00 00 00 00 00 "
       end_request: I/O error, dev hdc, sector 1306080
       Buffer I/O error on device hdc, logical block 163260
       Buffer I/O error on device hdc, logical block 163261
       Buffer I/O error on device hdc, logical block 163262
      
      the unpatched kernel produces an incorrect error dump:
      
       hdc: command error: status=0x51 { DriveReady SeekComplete Error }
       hdc: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
       ide: failed opcode was: unknown
       end_request: I/O error, dev hdc, sector 1306080
       Buffer I/O error on device hdc, logical block 163260
       hdc: command error: status=0x51 { DriveReady SeekComplete Error }
       hdc: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
       ide: failed opcode was: unknown
       end_request: I/O error, dev hdc, sector 1306088
       Buffer I/O error on device hdc, logical block 163261
       hdc: command error: status=0x51 { DriveReady SeekComplete Error }
       hdc: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
       ide: failed opcode was: unknown
       end_request: I/O error, dev hdc, sector 1306096
       Buffer I/O error on device hdc, logical block 163262
      
      I do not have the right type of CD-ROM drive to reproduce the end-of-media
      data corruption bug myself, but this same patch in RHEL solved it.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
      Cc: Jens Axboe <axboe@suse.de>
      Cc: Matt Mackall <mpm@selenic.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      dbe217af
  18. 23 6月, 2006 1 次提交
  19. 04 2月, 2006 1 次提交
  20. 13 1月, 2006 1 次提交
  21. 11 1月, 2006 1 次提交
  22. 09 1月, 2006 1 次提交
  23. 06 1月, 2006 2 次提交
    • T
      [BLOCK] update IDE to use new blk_ordered for barriers · 3e087b57
      Tejun Heo 提交于
      Update IDE to use new blk_ordered.  This change makes the
      following behavior changes.
      
      * Partial completion of the barrier request is handled as
        failure of the whole ordered sequence.  No more partial
        completion for barrier requests.
      
      * Any failure of pre or post flush request results in failure
        of the whole ordered sequence.
      
      So, successfully completed ordered sequence guarantees that
      all requests prior to the barrier made to physical medium and,
      then, the while barrier request made to the physical medium.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJens Axboe <axboe@suse.de>
      3e087b57
    • T
      [BLOCK] add @uptodate to end_that_request_last() and @error to rq_end_io_fn() · 8ffdc655
      Tejun Heo 提交于
      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: Ntejun heo <htejun@gmail.com>
      Signed-Off-By: NJens Axboe <axboe@suse.de>
      8ffdc655
  24. 20 11月, 2005 1 次提交
  25. 10 10月, 2005 1 次提交
    • B
      [PATCH] ide: Workaround PM problem · 867f8b4e
      Benjamin Herrenschmidt 提交于
      The logic in ide_do_request() doesn't guarantee that both drives will be
      serviced after a call.  It may "forget" to service one in some
      circumstances, including when one of the drive is suspended (it will
      eventually fail to service the slave when the master is suspended for
      example).  This prevents the wakeup requests that gets queued on wakeup
      from sleep from beeing serviced in some cases when 2 drives are sharing
      an IDE bus.
      
      The problem is deep enough in the way this code works (and there are
      probably a few other problematic but rare corner cases) and fixing it
      would require some major rethinking of the way IDE decides which channel
      to service.  This is not 2.6.14 material.  However, in the meantime,
      Bart has accepted this simple workaround that will fix the crash on
      wakeup from sleep since this specific corner case is actually hitting
      users to get into 2.6.14.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      867f8b4e
  26. 11 9月, 2005 1 次提交
  27. 05 9月, 2005 1 次提交
  28. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4