1. 22 Feb, 2010 2 commits
  2. 21 Dec, 2009 1 commit
  3. 04 Nov, 2009 1 commit
  4. 23 Sep, 2009 1 commit
    • KAMEZAWA Hiroyuki's avatar
      walk system ram range · 908eedc6
      KAMEZAWA Hiroyuki authored
      
      Originally, walk_memory_resource() was introduced to traverse all memory
      of "System RAM" for detecting memory hotplug/unplug range.  For doing so,
      flags of IORESOUCE_MEM|IORESOURCE_BUSY was used and this was enough for
      memory hotplug.
      
      But for using other purpose, /proc/kcore, this may includes some firmware
      area marked as IORESOURCE_BUSY | IORESOUCE_MEM.  This patch makes the
      check strict to find out busy "System RAM".
      
      Note: PPC64 keeps their own walk_memory_resouce(), which walk through
      ppc64's lmb informaton.  Because old kclist_add() is called per lmb, this
      patch makes no difference in behavior, finally.
      
      And this patch removes CONFIG_MEMORY_HOTPLUG check from this function.
      Because pfn_valid() just show "there is memmap or not* and cannot be used
      for "there is physical memory or not", this function is useful in generic
      to scan physical memory range.
      Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: WANG Cong <xiyou.wangcong@gmail.com>
      Cc: Américo Wang <xiyou.wangcong@gmail.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Roland Dreier <rolandd@cisco.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      908eedc6
  5. 30 Jun, 2009 1 commit
  6. 19 Apr, 2009 1 commit
  7. 15 Jan, 2009 1 commit
  8. 07 Jan, 2009 1 commit
    • Arjan van de Ven's avatar
      resource: allow MMIO exclusivity for device drivers · e8de1481
      Arjan van de Ven authored
      
      Device drivers that use pci_request_regions() (and similar APIs) have a
      reasonable expectation that they are the only ones accessing their device.
      As part of the e1000e hunt, we were afraid that some userland (X or some
      bootsplash stuff) was mapping the MMIO region that the driver thought it
      had exclusively via /dev/mem or via various sysfs resource mappings.
      
      This patch adds the option for device drivers to cause their reserved
      regions to the "banned from /dev/mem use" list, so now both kernel memory
      and device-exclusive MMIO regions are banned.
      NOTE: This is only active when CONFIG_STRICT_DEVMEM is set.
      
      In addition to the config option, a kernel parameter iomem=relaxed is
      provided for the cases where developers want to diagnose, in the field,
      drivers issues from userspace.
      Reviewed-by: default avatarMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      e8de1481
  9. 16 Dec, 2008 1 commit
    • Arjan van de Ven's avatar
      resources: skip sanity check of busy resources · 3ac52669
      Arjan van de Ven authored
      
      Impact: reduce false positives in iomem_map_sanity_check()
      
      Some drivers (vesafb) only map/reserve a portion of a resource.
      If then some other driver comes in and maps the whole resource,
      the current code WARN_ON's. This is not the intent of the checks
      in iomem_map_sanity_check(); rather these checks want to
      warn when crossing *hardware* resources only.
      
      This patch skips BUSY resources as suggested by Linus.
      
      Note: having two drivers talk to the same hardware at the same
      time is obviously not optimal behavior, but that's a separate story.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      3ac52669
  10. 01 Nov, 2008 1 commit
  11. 28 Oct, 2008 1 commit
    • Suresh Siddha's avatar
      resources: fix x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs · d68612b2
      Suresh Siddha authored
      
      Impact: avoid false-positive WARN_ON()
      
      Andi Kleen reported:
      > When running x86info on a 2.6.27-git8 system I get
      >
      > resource map sanity check conflict: 0x9e000 0x9efff 0x10000 0x9e7ff System RAM
      > ------------[ cut here ]------------
      > WARNING: at /home/lsrc/linux/arch/x86/mm/ioremap.c:226 __ioremap_caller+0xf2/0x2d6()
      > ...
      
      Some of the pages below the 1MB ISA addresses will be shared typically by both
      BIOS and system usable RAM. For example:
      	BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
      	BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
      
      x86info reads the low physical address using /dev/mem, which internally
      uses ioremap() for accessing non RAM pages. ioremap() of such low
      pages conflicts with multiple resource entities leading to the
      above warning.
      
      Change the iomem_map_sanity_check() to allow mapping a page spanning multiple
      resource entities (minimum granularity that one can map is a page anyhow).
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d68612b2
  12. 23 Oct, 2008 1 commit
  13. 16 Oct, 2008 1 commit
  14. 26 Sep, 2008 2 commits
    • Ingo Molnar's avatar
      IO resources, x86: ioremap sanity check to catch mapping requests exceeding, fix · 13eb8375
      Ingo Molnar authored
      
      fix this build error:
      
       kernel/resource.c: In function 'iomem_map_sanity_check':
       kernel/resource.c:842: error: implicit declaration of function 'r_next'
       kernel/resource.c:842: warning: assignment makes pointer from integer without a cast
      
      r_next() was only available if CONFIG_PROCFS was enabled.
      
      and fix this build warning:
      
       kernel/resource.c:855: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'resource_size_t'
       kernel/resource.c:855: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int'
       kernel/resource.c:855: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'resource_size_t'
       kernel/resource.c:855: warning: format '%llx' expects type 'long long unsigned int', but argument 5 has type 'resource_size_t'
      
      resource_t can be 32 bits.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      13eb8375
    • Suresh Siddha's avatar
      IO resources, x86: ioremap sanity check to catch mapping requests exceeding the BAR sizes · 379daf62
      Suresh Siddha authored
      
      Go through the iomem resource tree to check if any of the ioremap()
      requests span more than any slot in the iomem resource tree and do
      a WARN_ON() if we hit this check.
      
      This will raise a red-flag, if some driver is mapping more than what
      is needed. And hopefully identify possible corruptions much earlier.
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      379daf62
  15. 04 Sep, 2008 2 commits
    • Ingo Molnar's avatar
      IO resources: fix/remove printk · 1cf44baa
      Ingo Molnar authored
      
      Andrew Morton noticed that the printk in kernel/resource.c was buggy:
      
      | start and end have type resource_size_t.  Such types CANNOT be printed
      | unless cast to a known type.
      |
      | Because there is a %s following an incorrect %lld, the above code will
      | crash the machine.
      
      ... and it's probably quite unneeded as well, so remove it.
      Reported-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      1cf44baa
    • Yinghai Lu's avatar
      IO resources: add reserve_region_with_split() · 268364a0
      Yinghai Lu authored
      
      add reserve_region_with_split() to not lose e820 reserved entries if
      they overlap with existing IO regions:
      
      with test case by extend 0xe0000000 - 0xeffffff to 0xdd800000 -
      we get:
      	e0000000-efffffff : PCI MMCONFIG 0
      		 e0000000-efffffff : reserved
      
      and in /proc/iomem we get:
      	found conflict for reserved [dd800000, efffffff], try to reserve with split
      	    __reserve_region_with_split: (PCI Bus #80) [dd000000, ddffffff], res: (reserved) [dd800000, efffffff]
      	    __reserve_region_with_split: (PCI Bus #00) [de000000, dfffffff], res: (reserved) [de000000, efffffff]
      	initcall pci_subsys_init+0x0/0x121 returned 0 after 381 msecs
      in dmesg
      
      various fixes and improvements suggested by Linus.
      Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      268364a0
  16. 02 Sep, 2008 1 commit
  17. 29 Aug, 2008 1 commit
  18. 30 Jul, 2008 1 commit
  19. 29 Apr, 2008 1 commit
  20. 21 Apr, 2008 1 commit
    • Ivan Kokshaysky's avatar
      PCI: clean up resource alignment management · 88452565
      Ivan Kokshaysky authored
      
      Done per Linus' request and suggestions. Linus has explained that
      better than I'll be able to explain:
      
      On Thu, Mar 27, 2008 at 10:12:10AM -0700, Linus Torvalds wrote:
      > Actually, before we go any further, there might be a less intrusive
      > alternative: add just a couple of flags to the resource flags field (we
      > still have something like 8 unused bits on 32-bit), and use those to
      > implement a generic "resource_alignment()" routine.
      >
      > Two flags would do it:
      >
      >  - IORESOURCE_SIZEALIGN: size indicates alignment (regular PCI device
      >    resources)
      >
      >  - IORESOURCE_STARTALIGN: start field is alignment (PCI bus resources
      >    during probing)
      >
      > and then the case of both flags zero (or both bits set) would actually be
      > "invalid", and we would also clear the IORESOURCE_STARTALIGN flag when we
      > actually allocate the resource (so that we don't use the "start" field as
      > alignment incorrectly when it no longer indicates alignment).
      >
      > That wouldn't be totally generic, but it would have the nice property of
      > automatically at least add sanity checking for that whole "res->start has
      > the odd meaning of 'alignment' during probing" and remove the need for a
      > new field, and it would allow us to have a generic "resource_alignment()"
      > routine that just gets a resource pointer.
      
      Besides, I removed IORESOURCE_BUS_HAS_VGA flag which was unused for ages.
      Signed-off-by: default avatarIvan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Gary Hade <garyhade@us.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      88452565
  21. 08 Feb, 2008 1 commit
  22. 14 Nov, 2007 1 commit
  23. 16 Oct, 2007 1 commit
  24. 28 Apr, 2007 1 commit
    • Jeff Garzik's avatar
      libata/IDE: remove combined mode quirk · 8cdfb29c
      Jeff Garzik authored
      
      Both old-IDE and libata should be able handle all controllers and
      devices found using normal resource reservation methods.
      
      This eliminates the awful, low-performing split-driver configuration
      where old-IDE drove the PATA portion of a PCI device, in PIO-only mode,
      and libata drove the SATA portion of the /same/ PCI device, in DMA mode.
      Typically vendors would ship SATA hard drive / PATA optical
      configuration, which would lend itself to slow (PIO-only) CD-ROM
      performance.
      
      For Intel users running in combined mode, it is now wholly dependent on
      your driver choice (potentially link order, if you compile both drivers
      in) whether old-IDE or libata will drive your hardware.
      
      In either case, you will get full performance from both SATA and PATA
      ports now, without having to pass a kernel command line parameter.
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      8cdfb29c
  25. 14 Feb, 2007 1 commit
    • Tim Schmielau's avatar
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau authored
      
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: default avatarTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  26. 09 Feb, 2007 1 commit
    • Tejun Heo's avatar
      devres: device resource management · 9ac7849e
      Tejun Heo authored
      
      Implement device resource management, in short, devres.  A device
      driver can allocate arbirary size of devres data which is associated
      with a release function.  On driver detach, release function is
      invoked on the devres data, then, devres data is freed.
      
      devreses are typed by associated release functions.  Some devreses are
      better represented by single instance of the type while others need
      multiple instances sharing the same release function.  Both usages are
      supported.
      
      devreses can be grouped using devres group such that a device driver
      can easily release acquired resources halfway through initialization
      or selectively release resources (e.g. resources for port 1 out of 4
      ports).
      
      This patch adds devres core including documentation and the following
      managed interfaces.
      
      * alloc/free	: devm_kzalloc(), devm_kzfree()
      * IO region	: devm_request_region(), devm_release_region()
      * IRQ		: devm_request_irq(), devm_free_irq()
      * DMA		: dmam_alloc_coherent(), dmam_free_coherent(),
      		  dmam_declare_coherent_memory(), dmam_pool_create(),
      		  dmam_pool_destroy()
      * PCI		: pcim_enable_device(), pcim_pin_device(), pci_is_managed()
      * iomap		: devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
      		  devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
      		  pcim_iomap(), pcim_iounmap()
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      9ac7849e
  27. 07 Dec, 2006 1 commit
  28. 03 Oct, 2006 1 commit
  29. 26 Sep, 2006 1 commit
  30. 06 Aug, 2006 2 commits
  31. 12 Jul, 2006 1 commit
  32. 30 Jun, 2006 1 commit
  33. 27 Jun, 2006 4 commits