1. 15 5月, 2010 6 次提交
  2. 06 4月, 2010 1 次提交
  3. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit 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: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  4. 23 3月, 2010 1 次提交
    • T
      libata-sff: fix spurious IRQ handling · 332ac7ff
      Tejun Heo 提交于
      Commit 27943620 introduced spurious
      IRQ handling but it has a race condition where valid completion can be
      lost while trying to clear spurious IRQ leading to occassional command
      timeouts.
      
      This patch improves SFF interrupt handler such that
      
      1. Once BMDMA HSM is stopped, the condition is never considered
         spurious.  As there's no way to resume stopped BMDMA HSM, if device
         status doesn't agree with BMDMA status, the only way out is
         aborting the command (otherwise, it will just end up timing out).
      
      2. ap->ops->sff_check_status() can be safely called to clear spurious
         device IRQ as it atomically returns completion status but BMDMA IRQ
         status can't be cleared in safe way if command is in flight.  After
         a spurious IRQ, call ap->ops->sff_irq_clear() only if the
         respective device is idle and retry completion if
         sff_check_status() indicates command completion.
      
      Please note that ata_piix uses bmdma_status for sff_irq_check() and #2
      won't weaken spurious IRQ handling even with in-flight command because
      if bmdma_status indicates IRQ pending but device status is not on
      spurious check, the next IRQ handler invocation will abort the command
      due to #1.
      
      This fixes bko#15537.
      
         https://bugzilla.kernel.org/show_bug.cgi?id=15537Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Andrew Benton <b3nton@gmail.com>
      Cc: Petr Uzel <petr.uzel@centrum.cz>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      332ac7ff
  5. 02 3月, 2010 3 次提交
    • A
      libata: Pass host flags into the pci helper · 16ea0fc9
      Alan Cox 提交于
      This allows parallel scan and the like to be set without having to stop
      using the existing full helper functions. This patch merely adds the argument
      and fixes up the callers. It doesn't undo the special cases already in the
      tree or add any new parallel callers.
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      16ea0fc9
    • T
      libata: implement spurious irq handling for SFF and apply it to piix · 27943620
      Tejun Heo 提交于
      Traditional IDE interface sucks in that it doesn't have a reliable IRQ
      pending bit, so if the controller raises IRQ while the driver is
      expecting it not to, the IRQ won't be cleared and eventually the IRQ
      line will be killed by interrupt subsystem.  Some controllers have
      non-standard mechanism to indicate IRQ pending so that this condition
      can be detected and worked around.
      
      This patch adds an optional operation ->sff_irq_check() which will be
      called for each port from the ata_sff_interrupt() if an unexpected
      interrupt is received.  If the operation returns %true,
      ->sff_check_status() and ->sff_irq_clear() will be cleared for the
      port.  Note that this doesn't mark the interrupt as handled so it
      won't prevent IRQ subsystem from killing the IRQ if this mechanism
      fails to clear the spurious IRQ.
      
      This patch also implements ->sff_irq_check() for ata_piix.  Note that
      this adds slight overhead to shared IRQ operation as IRQs which are
      destined for other controllers will trigger extra register accesses to
      check whether IDE interrupt is pending but this solves rare screaming
      IRQ cases and for some curious reason also helps weird BIOS related
      glitch on Samsung n130 as reported in bko#14314.
      
        http://bugzilla.kernel.org/show_bug.cgi?id=14314
      
      * piix_base_ops dropped as suggested by Sergei.
      
      * Spurious IRQ detection doesn't kick in anymore if polling qc is in
        progress.  This provides less protection but some controllers have
        possible data corruption issues if the wrong register is accessed
        while a command is in progress.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NJohannes Stezenbach <js@sig21.net>
      Reported-by: NHans Werner <hwerner4@gmx.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      27943620
    • T
      libata: cleanup ata_sff_interrupt() · d88ec2e5
      Tejun Heo 提交于
      host->ports[i] is never NULL if i < host->n_ports and non-NULL return
      from ata_qc_from_tag() guarantees that the returned qc is active.
      Drop unnecessary tests.
      
      Superflous () dropped as suggested by Sergei.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      d88ec2e5
  6. 09 2月, 2010 1 次提交
  7. 04 2月, 2010 1 次提交
  8. 17 12月, 2009 1 次提交
  9. 09 12月, 2009 1 次提交
  10. 04 12月, 2009 1 次提交
  11. 03 12月, 2009 1 次提交
  12. 10 6月, 2009 1 次提交
    • S
      libata-sff: avoid byte swapping in ata_sff_data_xfer() · 2102d749
      Sergei Shtylyov 提交于
      Handling of the trailing byte in ata_sff_data_xfer() is suboptimal bacause:
      
      - it always initializes the padding buffer to 0 which is not really needed in
        both the read and write cases;
      
      - it has to use memcpy() to transfer a single byte from/to the padding buffer;
      
      - it uses io{read|write}16() accessors which swap bytes on the big endian CPUs
        and so have to additionally convert the data from/to the little endian format
        instead of using io{read|write}16_rep() accessors which are not supposed to
        change the byte ordering.
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      2102d749
  13. 17 4月, 2009 1 次提交
    • A
      ata: Report 16/32bit PIO as best we can · e3cf95dd
      Alan Cox 提交于
      The legacy old IDE ioctl API for this is a bit primitive so we try
      and map stuff sensibly onto it.
      
      - Set PIO over DMA devices to report 32bit
      - Add ability to change the PIO32 settings if the controller permits it
      - Add that functionality into the sff drivers
      - Add that functionality into the VLB legacy driver
      - Turn on the 32bit PIO on the ninja32 and add support there
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      e3cf95dd
  14. 25 3月, 2009 2 次提交
  15. 14 3月, 2009 1 次提交
    • S
      libata: Keep shadow last_ctl up to date during resets · e3e4385f
      Stuart MENEFY 提交于
      libata keeps a shadow copy of the ATA CTL register (which is write only),
      and only writes to the hardware when the required value doesn't match
      the shadow. However this copy wasn't being maintained when performing
      reset functions. This could cause problems for the first operation after
      a reset when the correct value might not be written to the CTL register.
      
      This problem was observed when hotplugging a drive: the identify command
      was being issued with interrupts enabled, when they should have been
      disabled.
      Signed-off-by: NStuart Menefy <stuart.menefy@st.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      e3e4385f
  16. 17 2月, 2009 1 次提交
    • S
      libata-sff: fix 32-bit PIO ATAPI regression · d1b3525b
      Sergei Shtylyov 提交于
      Commit 871af121 (libata: Add 32bit
      PIO support) has caused all kinds of errors on the ATAPI devices, so
      it has been empirically proven that one shouldn't try to read/write
      an extra data word when a device is not expecting it already. "Don't
      do it then"; however, still use a chance to do 32-bit read/write one
      last time when there are exactly 3 trailing bytes.
      
      Oh, and stop pointlessly swapping the bytes to and fro on big-endian
      machines by using io*_rep() accessors which shouldn't byte-swap.
      
      This patch should fix the kernel.org bug #12609.
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      d1b3525b
  17. 26 1月, 2009 2 次提交
  18. 13 1月, 2009 1 次提交
  19. 10 1月, 2009 1 次提交
  20. 09 1月, 2009 2 次提交
  21. 15 11月, 2008 1 次提交
    • T
      libata: improve phantom device detection · 6a6b97d3
      Tejun Heo 提交于
      Currently libata uses four methods to detect device presence.
      
      1. PHY status if available.
      2. TF register R/W test (only promotes presence, never demotes)
      3. device signature after reset
      4. IDENTIFY failure detection in SFF state machine
      
      Combination of the above works well in most cases but recently there
      have been a few reports where a phantom device causes unnecessary
      delay during probe.  In both cases, PHY status wasn't available.  In
      one case, it passed #2 and #3 and failed IDENTIFY with ATA_ERR which
      didn't qualify as #4.  The other failed #2 but as it passed #3 and #4,
      it still caused failure.
      
      In both cases, phantom device reported diagnostic failure, so these
      cases can be safely worked around by considering any !ATA_DRQ IDENTIFY
      failure as NODEV_HINT if diagnostic failure is set.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      6a6b97d3
  22. 23 10月, 2008 1 次提交
  23. 09 9月, 2008 1 次提交
  24. 15 7月, 2008 1 次提交
    • T
      libata: consistently use msecs for time durations · 341c2c95
      Tejun Heo 提交于
      libata has been using mix of jiffies and msecs for time druations.
      This is getting confusing.  As writing sub HZ values in jiffies is
      PITA and msecs_to_jiffies() can't be used as initializer, unify unit
      for all time durations to msecs.  So, durations are in msecs and
      deadlines are in jiffies.  ata_deadline() is added to compute deadline
      from a start time and duration in msecs.
      
      While at it, drop now superflous _msec suffix from arguments and
      rename @timeout to @deadline if it represents a fixed point in time
      rather than duration.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      341c2c95
  25. 04 7月, 2008 1 次提交
  26. 05 6月, 2008 1 次提交
  27. 04 6月, 2008 1 次提交
    • A
      libata-sff: Fix oops reported in kerneloops.org for pnp devices with no ctl · a57c1bad
      Alan Cox 提交于
      - Make ata_sff_altstatus private so nobody uses it by mistake
      - Drop the 400nS delay from it
      
      Add
      
      ata_sff_irq_status	-	encapsulates the IRQ check logic
      
      This function keeps the existing behaviour for altstatus using devices. I
      actually suspect the logic was wrong before the changes but -rc isn't the
      time to play with that
      
      ata_sff_sync		-	ensure writes hit the device
      
      Really we want an io* operation for 'is posted' eg ioisposted(ioaddr) so
      that we can fix the nasty delay this causes on most systems.
      
      - ata_sff_pause		-	400nS delay
      
      Ensure the command hit the device and delay 400nS
      
      - ata_sff_dma_pause
      
      Ensure the I/O hit the device and enforce an HDMA1:0 transition delay.
      Requires altstatus register exists, BUG if not so we don't risk
      corruption in MWDMA modes. (UDMA the checksum will save your backside in
      theory)
      
      The only other complication then is devices with their own handlers.
      rb532 can use dma_pause but scc needs to access its own altstatus
      register for internal errata workarounds so directly call the drivers own
      altstatus function.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      a57c1bad
  28. 06 5月, 2008 1 次提交
    • T
      libata: improve post-reset device ready test · 78ab88f0
      Tejun Heo 提交于
      Some controllers (jmb and inic162x) use 0x77 and 0x7f to indicate that
      the device isn't ready yet.  It looks like they use 0xff if device
      presence is detected but connection isn't established.  0x77 or 0x7f
      after connection is established and use the value from signature FIS
      after receiving it.
      
      This patch implements ata_check_ready(), which takes TF status value
      and determines whether the port is ready or not considering the above
      and other conditions, and use it in @check_ready() functions.  This is
      safe as both 0x77 and 0x7f aren't valid ready status value even though
      they have BSY bit cleared.
      
      This fixes hot plug detection failures which can be triggered with
      certain drives if they aren't already spun up when the data connector
      is hot plugged.
      
      Tested on sil, sil24, ahci (jmb/ich), piix and inic162x combined with
      eight drives from all major vendors.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      78ab88f0
  29. 25 4月, 2008 1 次提交
  30. 18 4月, 2008 1 次提交
    • T
      libata: move link onlineness check out of softreset methods · 45db2f6c
      Tejun Heo 提交于
      Currently, SATA softresets should do link onlineness check before
      actually performing SRST protocol but it doesn't really belong to
      softreset.
      
      This patch moves onlineness check in softreset to ata_eh_reset() and
      ata_eh_followup_srst_needed() to clean up code and help future sata_mv
      changes which need clear separation between SCR and TF accesses.
      
      sata_fsl is peculiar in that its softreset really isn't softreset but
      combination of hardreset and softreset.  This patch adds dummy private
      ->prereset to keep the current behavior but the driver really should
      implement separate hard and soft resets and return -EAGAIN from
      hardreset if it should be follwed by softreset.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      45db2f6c