1. 08 1月, 2009 1 次提交
    • A
      resource: allow MMIO exclusivity for device drivers · e8de1481
      Arjan van de Ven 提交于
      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: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      e8de1481
  2. 17 12月, 2008 1 次提交
    • A
      resources: skip sanity check of busy resources · 3ac52669
      Arjan van de Ven 提交于
      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: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3ac52669
  3. 02 11月, 2008 1 次提交
  4. 29 10月, 2008 1 次提交
    • S
      resources: fix x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs · d68612b2
      Suresh Siddha 提交于
      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: NSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d68612b2
  5. 24 10月, 2008 1 次提交
  6. 17 10月, 2008 1 次提交
  7. 26 9月, 2008 2 次提交
    • I
      IO resources, x86: ioremap sanity check to catch mapping requests exceeding, fix · 13eb8375
      Ingo Molnar 提交于
      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: NIngo Molnar <mingo@elte.hu>
      13eb8375
    • S
      IO resources, x86: ioremap sanity check to catch mapping requests exceeding the BAR sizes · 379daf62
      Suresh Siddha 提交于
      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: NSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      379daf62
  8. 05 9月, 2008 2 次提交
    • I
      IO resources: fix/remove printk · 1cf44baa
      Ingo Molnar 提交于
      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: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1cf44baa
    • Y
      IO resources: add reserve_region_with_split() · 268364a0
      Yinghai Lu 提交于
      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: NYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      268364a0
  9. 03 9月, 2008 1 次提交
  10. 30 8月, 2008 1 次提交
  11. 31 7月, 2008 1 次提交
  12. 29 4月, 2008 1 次提交
  13. 21 4月, 2008 1 次提交
    • I
      PCI: clean up resource alignment management · 88452565
      Ivan Kokshaysky 提交于
      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: NIvan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Gary Hade <garyhade@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      88452565
  14. 08 2月, 2008 1 次提交
  15. 15 11月, 2007 1 次提交
  16. 17 10月, 2007 1 次提交
  17. 29 4月, 2007 1 次提交
    • J
      libata/IDE: remove combined mode quirk · 8cdfb29c
      Jeff Garzik 提交于
      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: NJeff Garzik <jeff@garzik.org>
      8cdfb29c
  18. 15 2月, 2007 1 次提交
    • T
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau 提交于
      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: NTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  19. 10 2月, 2007 1 次提交
    • T
      devres: device resource management · 9ac7849e
      Tejun Heo 提交于
      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: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9ac7849e
  20. 08 12月, 2006 1 次提交
  21. 03 10月, 2006 1 次提交
  22. 27 9月, 2006 1 次提交
  23. 06 8月, 2006 2 次提交
  24. 13 7月, 2006 1 次提交
  25. 01 7月, 2006 1 次提交
  26. 28 6月, 2006 4 次提交
  27. 11 1月, 2006 1 次提交
  28. 08 9月, 2005 1 次提交
  29. 26 6月, 2005 1 次提交
  30. 17 4月, 2005 2 次提交
    • L
      [PATCH] pci enumeration on ixp2000: overflow in kernel/resource.c · b52402c7
      Lennert Buytenhek 提交于
      IXP2000 (ARM-based) platforms use a separate 'struct resource' for PCI MEM
      space.  Resource allocation for PCI BARs always fails because the 'root'
      resource (the IXP2000 PCI MEM resource) always has the entire address space
      (00000000-ffffffff) free, and find_resource() calculates the size of that
      range as ffffffff-00000000+1=0, so all allocations fail because it thinks
      there is no space.
      
      (akpm: pls. double-check)
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b52402c7
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4