1. 29 9月, 2008 6 次提交
    • E
      libata: Implement disk shock protection support · 45fabbb7
      Elias Oltmanns 提交于
      On user request (through sysfs), the IDLE IMMEDIATE command with UNLOAD
      FEATURE as specified in ATA-7 is issued to the device and processing of
      the request queue is stopped thereafter until the specified timeout
      expires or user space asks to resume normal operation. This is supposed
      to prevent the heads of a hard drive from accidentally crashing onto the
      platter when a heavy shock is anticipated (like a falling laptop
      expected to hit the floor). In fact, the whole port stops processing
      commands until the timeout has expired in order to avoid any resets due
      to failed commands on another device.
      Signed-off-by: NElias Oltmanns <eo@nebensachen.de>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      45fabbb7
    • E
      [libata] Introduce ata_id_has_unload() · ea6ce53c
      Elias Oltmanns 提交于
      Add a function to check an ATA device's id for head unload support as
      specified in ATA-7.
      Signed-off-by: NElias Oltmanns <eo@nebensachen.de>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      ea6ce53c
    • T
      libata: implement slave_link · b1c72916
      Tejun Heo 提交于
      Explanation taken from the comment of ata_slave_link_init().
      
       In libata, a port contains links and a link contains devices.  There
       is single host link but if a PMP is attached to it, there can be
       multiple fan-out links.  On SATA, there's usually a single device
       connected to a link but PATA and SATA controllers emulating TF based
       interface can have two - master and slave.
      
       However, there are a few controllers which don't fit into this
       abstraction too well - SATA controllers which emulate TF interface
       with both master and slave devices but also have separate SCR
       register sets for each device.  These controllers need separate links
       for physical link handling (e.g. onlineness, link speed) but should
       be treated like a traditional M/S controller for everything else
       (e.g. command issue, softreset).
      
       slave_link is libata's way of handling this class of controllers
       without impacting core layer too much.  For anything other than
       physical link handling, the default host link is used for both master
       and slave.  For physical link handling, separate @ap->slave_link is
       used.  All dirty details are implemented inside libata core layer.
       From LLD's POV, the only difference is that prereset, hardreset and
       postreset are called once more for the slave link, so the reset
       sequence looks like the following.
      
       prereset(M) -> prereset(S) -> hardreset(M) -> hardreset(S) ->
       softreset(M) -> postreset(M) -> postreset(S)
      
       Note that softreset is called only for the master.  Softreset resets
       both M/S by definition, so SRST on master should handle both (the
       standard method will work just fine).
      
      As slave_link excludes PMP support and only code paths which deal with
      the attributes of physical link are affected, all the changes are
      localized to libata.h, libata-core.c and libata-eh.c.
      
       * ata_is_host_link() updated so that slave_link is considered as host
         link too.
      
       * iterator extended to iterate over the slave_link when using the
         underbarred version.
      
       * force param handling updated such that devno 16 is mapped to the
         slave link/device.
      
       * ata_link_on/offline() updated to return the combined result from
         master and slave link.  ata_phys_link_on/offline() are the direct
         versions.
      
       * EH autopsy and report are performed separately for master slave
         links.  Reset is udpated to implement the above described reset
         sequence.
      
      Except for reset update, most changes are minor, many of them just
      modifying dev->link to ata_dev_phys_link(dev) or using phys online
      test instead.
      
      After this update, LLDs can take full advantage of per-dev SCR
      registers by simply turning on slave link.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b1c72916
    • T
      libata: misc updates to prepare for slave link · b5b3fa38
      Tejun Heo 提交于
      * Add ATA_EH_ALL_ACTIONS.
      
      * Make sata_link_{on|off}_line() return bool instead of int.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b5b3fa38
    • T
      libata: reimplement link iterator · aadffb68
      Tejun Heo 提交于
      Implement __ata_port_next_link() and reimplement
      __ata_port_for_each_link() and ata_port_for_each_link() using it.
      This removes relatively large inlined code and makes iteration easier
      to extend.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      aadffb68
    • T
      libata: make SCR access ops per-link · 82ef04fb
      Tejun Heo 提交于
      Logically, SCR access ops should take @link; however, there was no
      compelling reason to convert all SCR access ops when adding @link
      abstraction as there's one-to-one mapping between a port and a non-PMP
      link.  However, that assumption won't hold anymore with the scheduled
      addition of slave link.
      
      Make SCR access ops per-link.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      82ef04fb
  2. 25 9月, 2008 1 次提交
  3. 23 9月, 2008 1 次提交
  4. 17 9月, 2008 2 次提交
  5. 16 9月, 2008 1 次提交
  6. 14 9月, 2008 4 次提交
    • A
      memstick: fix MSProHG 8-bit interface mode support · 8e82f8c3
      Alex Dubov 提交于
      - 8-bit interface mode never worked properly.  The only adapter I have
        which supports the 8b mode (the Jmicron) had some problems with its
        clock wiring and they discovered it only now.  We also discovered that
        ProHG media is more sensitive to the ordering of initialization
        commands.
      
      - Make the driver fall back to highest supported mode instead of always
        falling back to serial.  The driver will attempt the switch to 8b mode
        for any new MSPro card, but not all of them support it.  Previously,
        these new cards ended up in serial mode, which is not the best idea
        (they work fine with 4b, after all).
      
      - Edit some macros for better conformance to Sony documentation
      Signed-off-by: NAlex Dubov <oakad@yahoo.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8e82f8c3
    • M
      mm: mark the correct zone as full when scanning zonelists · 5bead2a0
      Mel Gorman 提交于
      The iterator for_each_zone_zonelist() uses a struct zoneref *z cursor when
      scanning zonelists to keep track of where in the zonelist it is.  The
      zoneref that is returned corresponds to the the next zone that is to be
      scanned, not the current one.  It was intended to be treated as an opaque
      list.
      
      When the page allocator is scanning a zonelist, it marks elements in the
      zonelist corresponding to zones that are temporarily full.  As the
      zonelist is being updated, it uses the cursor here;
      
        if (NUMA_BUILD)
              zlc_mark_zone_full(zonelist, z);
      
      This is intended to prevent rescanning in the near future but the zoneref
      cursor does not correspond to the zone that has been found to be full.
      This is an easy misunderstanding to make so this patch corrects the
      problem by changing zoneref cursor to be the current zone being scanned
      instead of the next one.
      Signed-off-by: NMel Gorman <mel@csn.ul.ie>
      Cc: Andy Whitcroft <apw@shadowen.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: <stable@kernel.org>		[2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5bead2a0
    • H
      include/linux/ioport.h: add missing macro argument for devm_release_* family · dea420ce
      Hiroshi DOYU 提交于
      akpm: these have no callers at this time, but they shall soon, so let's
      get them right.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NHiroshi DOYU <Hiroshi.DOYU@nokia.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dea420ce
    • T
      [libata] LBA28/LBA48 off-by-one bug in ata.h · 97b697a1
      Taisuke Yamada 提交于
      I recently bought 3 HGST P7K500-series 500GB SATA drives and
      had trouble accessing the block right on the LBA28-LBA48 border.
      Here's how it fails (same for all 3 drives):
      
        # dd if=/dev/sdc bs=512 count=1 skip=268435455 > /dev/null
        dd: reading `/dev/sdc': Input/output error
        0+0 records in
        0+0 records out
        0 bytes (0 B) copied, 0.288033 seconds, 0.0 kB/s
        # dmesg
        ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
        ata1.00: BMDMA stat 0x25
        ata1.00: cmd c8/00:08:f8:ff:ff/00:00:00:00:00/ef tag 0 dma 4096 in
        res 51/04:08:f8:ff:ff/00:00:00:00:00/ef Emask 0x1 (device error)
        ata1.00: status: { DRDY ERR }
        ata1.00: error: { ABRT }
        ata1.00: configured for UDMA/33
        ata1: EH complete
        ...
      
      After some investigations, it turned out this seems to be caused
      by misinterpretation of the ATA specification on LBA28 access.
      Following part is the code in question:
      
        === include/linux/ata.h ===
        static inline int lba_28_ok(u64 block, u32 n_block)
        {
          /* check the ending block number */
          return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256);
        }
      
      HGST drive (sometimes) fails with LBA28 access of {block = 0xfffffff,
      n_block = 1}, and this behavior seems to be comformant. Other drives,
      including other HGST drives are not that strict, through.
      
      >From the ATA specification:
      (http://www.t13.org/Documents/UploadedDocuments/project/d1410r3b-ATA-ATAPI-6.pdf)
      
        8.15.29  Word (61:60): Total number of user addressable sectors
        This field contains a value that is one greater than the total number
        of user addressable sectors (see 6.2). The maximum value that shall
        be placed in this field is 0FFFFFFFh.
      
      So the driver shouldn't use the value of 0xfffffff for LBA28 request
      as this exceeds maximum user addressable sector. The logical maximum
      value for LBA28 is 0xffffffe.
      
      The obvious fix is to cut "- 1" part, and the patch attached just do
      that. I've been using the patched kernel for about a month now, and
      the same fix is also floating on the net for some time. So I believe
      this fix works reliably.
      
      Just FYI, many Windows/Intel platform users also seems to be struck
      by this, and HGST has issued a note pointing to Intel ICH8/9 driver.
      
        "28-bit LBA command is being used to access LBAs 29-bits in length"
      http://www.hitachigst.com/hddt/knowtree.nsf/cffe836ed7c12018862565b000530c74/b531b8bce8745fb78825740f00580e23
      
      Also, *BSDs seems to have similar fix included sometime around ~2004,
      through I have not checked out exact portion of the code.
      Signed-off-by: NTaisuke Yamada <tai@rakugaki.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      97b697a1
  7. 11 9月, 2008 1 次提交
  8. 07 9月, 2008 1 次提交
    • M
      sched: arch_reinit_sched_domains() must destroy domains to force rebuild · dfb512ec
      Max Krasnyansky 提交于
      What I realized recently is that calling rebuild_sched_domains() in
      arch_reinit_sched_domains() by itself is not enough when cpusets are enabled.
      partition_sched_domains() code is trying to avoid unnecessary domain rebuilds
      and will not actually rebuild anything if new domain masks match the old ones.
      
      What this means is that doing
           echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
      on a system with cpusets enabled will not take affect untill something changes
      in the cpuset setup (ie new sets created or deleted).
      
      This patch fixes restore correct behaviour where domains must be rebuilt in
      order to enable MC powersaving flags.
      
      Test on quad-core Core2 box with both CONFIG_CPUSETS and !CONFIG_CPUSETS.
      Also tested on dual-core Core2 laptop. Lockdep is happy and things are working
      as expected.
      Signed-off-by: NMax Krasnyansky <maxk@qualcomm.com>
      Tested-by: NVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dfb512ec
  9. 06 9月, 2008 3 次提交
  10. 05 9月, 2008 2 次提交
    • K
      Fix conditional export of kvh.h and a.out.h to userspace. · afbc8d8e
      Khem Raj 提交于
      Some architectures have moved the asm/ into arch/ and some have not.
      This patch checks for a.out.h and kvh.h in both places before exporting
      the corresponding file from linux/
      
      [dwmw2: simplified a little]
      Signed-off-by: NKhem Raj <raj.khem@gmail.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      afbc8d8e
    • V
      clockevents: prevent clockevent event_handler ending up handler_noop · 7c1e7689
      Venkatesh Pallipadi 提交于
      There is a ordering related problem with clockevents code, due to which
      clockevents_register_device() called after tickless/highres switch
      will not work. The new clockevent ends up with clockevents_handle_noop as
      event handler, resulting in no timer activity.
      
      The problematic path seems to be
      
      * old device already has hrtimer_interrupt as the event_handler
      * new clockevent device registers with a higher rating
      * tick_check_new_device() is called
        * clockevents_exchange_device() gets called
          * old->event_handler is set to clockevents_handle_noop
        * tick_setup_device() is called for the new device
          * which sets new->event_handler using the old->event_handler which is noop.
      
      Change the ordering so that new device inherits the proper handler.
      
      This does not have any issue in normal case as most likely all the clockevent
      devices are setup before the highres switch. But, can potentially be affecting
      some corner case where HPET force detect happens after the highres switch.
      This was a problem with HPET in MSI mode code that we have been experimenting
      with.
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7c1e7689
  11. 04 9月, 2008 4 次提交
  12. 03 9月, 2008 3 次提交
  13. 01 9月, 2008 1 次提交
    • V
      debugobjects: fix lockdep warning · 673d62cc
      Vegard Nossum 提交于
      Daniel J. Blueman reported:
      > =======================================================
      > [ INFO: possible circular locking dependency detected ]
      > 2.6.27-rc4-224c #1
      > -------------------------------------------------------
      > hald/4680 is trying to acquire lock:
      >  (&n->list_lock){++..}, at: [<ffffffff802bfa26>] add_partial+0x26/0x80
      >
      > but task is already holding lock:
      >  (&obj_hash[i].lock){++..}, at: [<ffffffff8041cfdc>]
      > debug_object_free+0x5c/0x120
      
      We fix it by moving the actual freeing to outside the lock (the lock
      now only protects the list).
      
      The pool lock is also promoted to irq-safe (suggested by Dan). It's
      necessary because free_pool is now called outside the irq disabled
      region. So we need to protect against an interrupt handler which calls
      debug_object_init().
      
      [tglx@linutronix.de: added hlist_move_list helper to avoid looping
      		     through the list twice]
      Reported-by: NDaniel J Blueman <daniel.blueman@gmail.com>
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      673d62cc
  14. 30 8月, 2008 2 次提交
    • L
      Resource handling: add 'insert_resource_expand_to_fit()' function · bef69ea0
      Linus Torvalds 提交于
      Not used anywhere yet, but this complements the existing plain
      'insert_resource()' functionality with a version that can expand the
      resource we are adding in order to fix up any conflicts it has with
      existing resources.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bef69ea0
    • D
      net: Unbreak userspace usage of linux/mroute.h · 7c19a3d2
      David S. Miller 提交于
      Nothing in linux/pim.h should be exported to userspace.
      
      This should fix the XORP build failure reported by
      Jose Calhariz, the debain package maintainer.
      
      Nothing originally in linux/mroute.h was exported to userspace
      ever, but some of this stuff started to be when it was moved into
      this new linux/pim.h, and that was wrong.  If we didn't provide these
      definitions for 10 years we can reasonably expect that applications
      defined this stuff locally or used GLIBC headers providing the
      protocol definitions.  And as such the only result of this can
      be conflict and userland build breakage.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c19a3d2
  15. 28 8月, 2008 1 次提交
  16. 27 8月, 2008 4 次提交
  17. 25 8月, 2008 3 次提交