1. 03 May, 2007 3 commits
    • Rolf Eike Beer's avatar
      DOC: Fix wrong identifier name in Documentation/driver-model/devres.txt · 3265b545
      Rolf Eike Beer authored
      Above and below we talk about my_midlayer_create_something, I assume that is
      also meant here.
      Signed-off-by: default avatarRolf Eike Beer <eike-kernel@sf-tec.de>
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3265b545
    • Jean Delvare's avatar
      platform: reorder platform_device_del · dc4c15d4
      Jean Delvare authored
      In platform_device_del(), we currently delete the device resources
      first, then we delete the device itself. This causes a (minor) bug to
      occur when one unregisters a platform device before unregistering its
      platform driver, and the driver is requesting (in .probe()) and
      releasing (in .remove()) a resource of the device. The device
      resources are already gone by the time the driver gets the chance to
      release the resources it had been requesting, causing an error like:
      Trying to free nonexistent resource <0000000000000295-0000000000000296>
      
      If the platform driver is unregistered first, the problem doesn't
      occur, as the driver will have the opportunity to release the
      resources it had requested before the device resources themselves are
      released. It's a bit odd that unregistering the driver first or the
      device first doesn't lead to the same result.
      
      So I believe that we should delete the device first in
      platform_device_del(). I've searched the git history and found that it
      used to be the case before 2.6.8, but was changed here:
      
      http://www.kernel.org/git/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commitdiff;h=96ef7b3689936ee1e64b711511342026a8ce459c
      
      > 2004/07/14 16:09:44-07:00 dtor_core
      > [PATCH] Driver core: Fix OOPS in device_platform_unregister
      > 
      > Driver core: platform_device_unregister should release resources first
      >              and only then call device_unregister, otherwise if there
      >              are no more references to the device it will be freed and
      >              the fucntion will try to access freed memory.  
      
      However we now have an explicit call to put_device() at the end of
      platform_device_unregister() so I guess the original problem no longer
      exists and it is safe to revert that change.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      dc4c15d4
    • Greg Kroah-Hartman's avatar
      Driver core: fix show_uevent from taking up way too much stack · c7308c81
      Greg Kroah-Hartman authored
      Declaring an array of PAGE_SIZE does bad things for people running with
      4k stacks...
      
      Thanks to Tilman Schmidt for tracking this down.
      
      Cc: Tilman Schmidt <tilman@imap.cc>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c7308c81
  2. 01 May, 2007 1 commit
    • Linus Torvalds's avatar
      libata: honour host controllers that want just one host · dc87c398
      Linus Torvalds authored
      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: default avatarJeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dc87c398
  3. 30 Apr, 2007 36 commits