1. 01 5月, 2007 12 次提交
    • T
      libata: add deadline support to prereset and reset methods · d4b2bab4
      Tejun Heo 提交于
      Add @deadline to prereset and reset methods and make them honor it.
      ata_wait_ready() which directly takes @deadline is implemented to be
      used as the wait function.  This patch is in preparation for EH timing
      improvements.
      
      * ata_wait_ready() never does busy sleep.  It's only used from EH and
        no wait in EH is that urgent.  This function also prints 'be
        patient' message automatically after 5 secs of waiting if more than
        3 secs is remaining till deadline.
      
      * ata_bus_post_reset() now fails with error code if any of its wait
        fails.  This is important because earlier reset tries will have
        shorter timeout than the spec requires.  If a device fails to
        respond before the short timeout, reset should be retried with
        longer timeout rather than silently ignoring the device.
      
        There are three behavior differences.
      
        1. Timeout is applied to both devices at once, not separately.  This
           is more consistent with what the spec says.
      
        2. When a device passes devchk but fails to become ready before
           deadline.  Previouly, post_reset would just succeed and let
           device classification remove the device.  New code fails the
           reset thus causing reset retry.  After a few times, EH will give
           up disabling the port.
      
        3. When slave device passes devchk but fails to become accessible
           (TF-wise) after reset.  Original code disables dev1 after 30s
           timeout and continues as if the device doesn't exist, while the
           patched code fails reset.  When this happens, new code fails
           reset on whole port rather than proceeding with only the primary
           device.
      
        If the failing device is suffering transient problems, new code
        retries reset which is a better behavior.  If the failing device is
        actually broken, the net effect is identical to it, but not to the
        other device sharing the channel.  In the previous code, reset would
        have succeeded after 30s thus detecting the working one.  In the new
        code, reset fails and whole port gets disabled.  IMO, it's a
        pathological case anyway (broken device sharing bus with working
        one) and doesn't really matter.
      
      * ata_bus_softreset() is changed to return error code from
        ata_bus_post_reset().  It used to return 0 unconditionally.
      
      * Spin up waiting is to be removed and not converted to honor
        deadline.
      
      * To be on the safe side, deadline is set to 40s for the time being.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d4b2bab4
    • L
      libata: honour host controllers that want just one host · dc87c398
      Linus Torvalds 提交于
      The Marvell IDE interface on my machine would hit a BUG_ON() in
      lib/iomem.c because it was calling ata_pci_init_one() specifying just a
      single port on the host, but that would actually end up trying to
      initialize two ports, the second one with bogus information.
      
      This fixes "ata_pci_init_one()" so that it actually passes down the
      n_ports variable that it got from the low-level driver to the host
      allocation routine ("ata_host_alloc_pinfo()"), which results in the ATA
      layer actually having the correct port number information.
      
      And in order to make it all work, I also needed to fix a few places that
      had incorrectly hard-coded the fact that a host always had exactly two
      ports (both ata_pci_init_bmdma() and ata_request_legacy_irqs() would
      just always iterate over both ports).
      Acked-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dc87c398
    • D
      pm: include EIO from errno-base.h · 14e38ac8
      David Rientjes 提交于
      For backwards compatibility, call_platform_enable_wakeup() can return 0
      instead of -EIO since we aren't guaranteed to have errno defined.
      
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      14e38ac8
    • J
      Add kvasprintf() · 11443ec7
      Jeremy Fitzhardinge 提交于
      Add a kvasprintf() function to complement kasprintf().
      
      No in-tree users yet, but I have some coming up.
      
      [akpm@linux-foundation.org: EXPORT it]
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Keir Fraser <keir@xensource.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      11443ec7
    • J
      power management: force pm_ops.valid callback to be assigned · 9684e51c
      Johannes Berg 提交于
      This patch changes the docs and behaviour from "all states valid" to "no
      states valid" if no .valid callback is assigned.  Users of pm_ops that only
      need mem sleep can assign pm_valid_only_mem without any overhead, others
      will require more elaborate callbacks.
      
      Now that all users of pm_ops have a .valid callback this is a safe thing to
      do and prevents things from getting messy again as they were before.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Looks-okay-to: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: <linux-pm@lists.linux-foundation.org>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9684e51c
    • J
      power management: implement pm_ops.valid for everybody · e8c9c502
      Johannes Berg 提交于
      Almost all users of pm_ops only support mem sleep, don't check in .valid and
      don't reject any others in .prepare so users can be confused if they check
      /sys/power/state, especially when new states are added (these would then
      result in s-t-r although they're supposed to be something different).
      
      This patch implements a generic pm_valid_only_mem function that is then
      exported for users and puts it to use in almost all existing pm_ops.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Cc: David Brownell <david-b@pacbell.net>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Cc: linux-pm@lists.linux-foundation.org
      Cc: Len Brown <lenb@kernel.org>
      Acked-by: NRussell King <rmk@arm.linux.org.uk>
      Cc: Greg KH <greg@kroah.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e8c9c502
    • J
      power management: remove firmware disk mode · 11d77d0c
      Johannes Berg 提交于
      This patch removes the firmware disk suspend mode which is the wrong approach,
      it is supposed to be used for implementing firmware-based disk suspend but
      cannot actually be used for that.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Cc: <linux-pm@lists.linux-foundation.org>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Len Brown <lenb@kernel.org>
      Acked-by: NRussell King <rmk@arm.linux.org.uk>
      Cc: Greg KH <greg@kroah.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      11d77d0c
    • J
      rework pm_ops pm_disk_mode, kill misuse · fe0c935a
      Johannes Berg 提交于
      This patch series cleans up some misconceptions about pm_ops.  Some users of
      the pm_ops structure attempt to use it to stop the user from entering suspend
      to disk, this, however, is not possible since the user can always use
      "shutdown" in /sys/power/disk and then the pm_ops are never invoked.  Also,
      platforms that don't support suspend to disk simply should not allow
      configuring SOFTWARE_SUSPEND (read the help text on it, it only selects
      suspend to disk and nothing else, all the other stuff depends on PM).
      
      The pm_ops structure is actually intended to provide a way to enter
      platform-defined sleep states (currently supported states are "standby" and
      "mem" (suspend to ram)) and additionally (if SOFTWARE_SUSPEND is configured)
      allows a platform to support a platform specific way to enter low-power mode
      once everything has been saved to disk.  This is currently only used by ACPI
      (S4).
      
      This patch:
      
      The pm_ops.pm_disk_mode is used in totally bogus ways since nobody really
      seems to understand what it actually does.
      
      This patch clarifies the pm_disk_mode description.
      
      It also removes all the arm and sh users that think they can veto suspend to
      disk via pm_ops; not so since the user can always do echo shutdown >
      /sys/power/disk, they need to find a better way involving Kconfig or such.
      
      ACPI is the only user left with a non-zero pm_disk_mode.
      
      The patch also sets the default mode to shutdown again, but when a new pm_ops
      is registered its pm_disk_mode is selected as default, that way the default
      stays for ACPI where it is apparently required.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Cc: David Brownell <david-b@pacbell.net>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Cc: <linux-pm@lists.linux-foundation.org>
      Cc: Len Brown <lenb@kernel.org>
      Acked-by: NRussell King <rmk@arm.linux.org.uk>
      Cc: Greg KH <greg@kroah.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fe0c935a
    • J
      reiserfs: suppress lockdep warning · 1173a729
      Jeff Mahoney 提交于
      We're getting lockdep warnings due to a post-2.6.21-rc7 bugfix.
      
      The xattr_sem can never be taken in the manner described. Internal inodes
      are protected by I_PRIVATE.  Add the appropriate annotation.
      
      Cc: <stable@kernel.org>
      Cc: "Antonino A. Daplas" <adaplas@pol.net>
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1173a729
    • R
      Extend print_symbol capability · 42e38083
      Robert Peterson 提交于
      Today's print_symbol function dumps a kernel symbol with printk.  This
      patch extends the functionality of kallsyms.c so that the symbol lookup
      function may be used without the printk.  This is useful for modules that
      want to dump symbols elsewhere, for example, to debugfs.  I intend to use
      the new function call in the GFS2 file system (which will be a separate
      patch).
      
      [akpm@linux-foundation.org: build fix]
      [clameter@sgi.com: sprint_symbol should return length of string like sprintf]
      Signed-off-by: NRobert Peterson <rpeterso@redhat.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Acked-by: NPaulo Marques <pmarques@grupopie.com>
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      42e38083
    • D
      [UDP]: Do not allow specific bind when wildcard bind exists. · de34ed91
      David S. Miller 提交于
      When allocating local ports, do not allow a bind to a port
      with a specific local address when a bind to that port with
      a wildcard local address already exists.
      
      Noticed by Linus.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de34ed91
    • D
      [IPV4] UDP: Fix endianness bugs in hashing changes. · b7b5f487
      David S. Miller 提交于
      I accidently applied an earlier version of Eric Dumazet's patch, from
      March 21st.  His version from March 30th didn't have these bugs, so
      this just interdiffs to the correct patch.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7b5f487
  2. 30 4月, 2007 28 次提交