1. 05 3月, 2011 2 次提交
    • J
      PCI: add more checking to ICH region quirks · cdb97558
      Jiri Slaby 提交于
      Per ICH4 and ICH6 specs, ACPI and GPIO regions are valid iff ACPI_EN
      and GPIO_EN bits are set to 1. Add checks for these bits into the
      quirks prior to the region creation.
      
      While at it, name the constants by macros.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Thomas Renninger <trenn@suse.de>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      cdb97558
    • P
      PCI: aer-inject: Override PCIe AER Mask Registers · 457d9d08
      Prarit Bhargava 提交于
      I have several systems which have the same problem:  The PCIe AER
      corrected and uncorrected masks have all the error bits set.  This
      results in the inablility to test with the aer_inject module & utility
      on those systems.
      
      Add the 'aer_mask_override' module parameter which will override the
      corrected or uncorrected masks for a PCI device.  The mask will have the
      bit corresponding to the status passed into the aer_inject() function.
      
      After this patch it is possible to successfully use the aer_inject
      utility on those PCI slots.
      
      Successfully tested by me on a Dell and Intel whitebox which exhibited
      the mask problem.
      Signed-off-by: NPrarit Bhargava <prarit@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      457d9d08
  2. 17 2月, 2011 1 次提交
  3. 09 2月, 2011 2 次提交
  4. 21 1月, 2011 1 次提交
    • D
      kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT · 6a108a14
      David Rientjes 提交于
      The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
      is used to configure any non-standard kernel with a much larger scope than
      only small devices.
      
      This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
      references to the option throughout the kernel.  A new CONFIG_EMBEDDED
      option is added that automatically selects CONFIG_EXPERT when enabled and
      can be used in the future to isolate options that should only be
      considered for embedded systems (RISC architectures, SLOB, etc).
      
      Calling the option "EXPERT" more accurately represents its intention: only
      expert users who understand the impact of the configuration changes they
      are making should enable it.
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NDavid Woodhouse <david.woodhouse@intel.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: Greg KH <gregkh@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Robin Holt <holt@sgi.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6a108a14
  5. 15 1月, 2011 4 次提交
  6. 11 1月, 2011 1 次提交
  7. 06 1月, 2011 1 次提交
  8. 24 12月, 2010 9 次提交
  9. 18 12月, 2010 2 次提交
  10. 17 12月, 2010 1 次提交
  11. 14 12月, 2010 2 次提交
  12. 25 11月, 2010 1 次提交
    • C
      pci root complex: support for tile architecture · f02cbbe6
      Chris Metcalf 提交于
      This change enables PCI root complex support for TILEPro.  Unlike
      TILE-Gx, TILEPro has no support for memory-mapped I/O, so the PCI
      support consists of hypervisor upcalls for PIO, DMA, etc.  However,
      the performance is fine for the devices we have tested with so far
      (1Gb Ethernet, SATA, etc.).
      
      The <asm/io.h> header was tweaked to be a little bit more aggressive
      about disabling attempts to map/unmap IO port space.  The hacky
      <asm/pci-bridge.h> header was rolled into the <asm/pci.h> header
      and the result was simplified.  Both of the latter two headers were
      preliminary versions not meant for release before now - oh well.
      
      There is one quirk for our TILEmpower platform, which accidentally
      negotiates up to 5GT and needs to be kicked down to 2.5GT.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      f02cbbe6
  13. 18 11月, 2010 1 次提交
  14. 17 11月, 2010 1 次提交
    • D
      PCI: fix offset check for sysfs mmapped files · 8c05cd08
      Darrick J. Wong 提交于
      I just loaded 2.6.37-rc2 on my machines, and I noticed that X no longer starts.
      Running an strace of the X server shows that it's doing this:
      
      open("/sys/bus/pci/devices/0000:07:00.0/resource0", O_RDWR) = 10
      mmap(NULL, 16777216, PROT_READ|PROT_WRITE, MAP_SHARED, 10, 0) = -1 EINVAL (Invalid argument)
      
      This code seems to be asking for a shared read/write mapping of 16MB worth of
      BAR0 starting at file offset 0, and letting the kernel assign a starting
      address.  Unfortunately, this -EINVAL causes X not to start.  Looking into
      dmesg, there's a complaint like so:
      
      process "Xorg" tried to map 0x01000000 bytes at page 0x00000000 on 0000:07:00.0 BAR 0 (start 0x        96000000, size 0x         1000000)
      
      ...with the following code in pci_mmap_fits:
      
      	pci_start = (mmap_api == PCI_MMAP_SYSFS) ?
      		pci_resource_start(pdev, resno) >> PAGE_SHIFT : 0;
              if (start >= pci_start && start < pci_start + size &&
                              start + nr <= pci_start + size)
      
      It looks like the logic here is set up such that when the mmap call comes via
      sysfs, the check in pci_mmap_fits wants vma->vm_pgoff to be between the
      resource's start and end address, and the end of the vma to be no farther than
      the end.  However, the sysfs PCI resource files always start at offset zero,
      which means that this test always fails for programs that mmap the sysfs files.
      Given the comment in the original commit
      3b519e4e, I _think_ the old procfs files
      require that the file offset be equal to the resource's base address when
      mmapping.
      
      I think what we want here is for pci_start to be 0 when mmap_api ==
      PCI_MMAP_PROCFS.  The following patch makes that change, after which the Matrox
      and Mach64 X drivers work again.
      Acked-by: NMartin Wilck <martin.wilck@ts.fujitsu.com>
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      8c05cd08
  15. 16 11月, 2010 1 次提交
  16. 13 11月, 2010 1 次提交
    • B
      PCI: fix pci_bus_alloc_resource() hang, prefer positive decode · 82e3e767
      Bjorn Helgaas 提交于
      When a PCI bus has two resources with the same start/end, e.g.,
      
          pci_bus 0000:04: resource 2 [mem 0xd0000000-0xd7ffffff pref]
          pci_bus 0000:04: resource 7 [mem 0xd0000000-0xd7ffffff]
      
      the previous pci_bus_find_resource_prev() implementation would alternate
      between them forever:
      
          pci_bus_find_resource_prev(... [mem 0xd0000000-0xd7ffffff pref])
              returns [mem 0xd0000000-0xd7ffffff]
          pci_bus_find_resource_prev(... [mem 0xd0000000-0xd7ffffff])
              returns [mem 0xd0000000-0xd7ffffff pref]
          pci_bus_find_resource_prev(... [mem 0xd0000000-0xd7ffffff pref])
              returns [mem 0xd0000000-0xd7ffffff]
          ...
      
      This happened because there was no ordering between two resources with the
      same start and end.  A resource that had the same start and end as the
      cursor, but was not itself the cursor, was considered to be before the
      cursor.
      
      This patch fixes the hang by making a fixed ordering between any two
      resources.
      
      In addition, it tries to allocate from positively decoded regions before
      using any subtractively decoded resources.  This means we will use a
      positive decode region before a subtractive decode one, even if it means
      using a smaller address.
      
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=22062Reported-by: NBorislav Petkov <bp@amd64.org>
      Tested-by: NBorislav Petkov <bp@amd64.org>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      82e3e767
  17. 12 11月, 2010 3 次提交
    • J
      PCI: read current power state at enable time · 97c145f7
      Jesse Barnes 提交于
      When we enable a PCI device, we avoid doing a lot of the initial setup
      work if the device's enable count is non-zero.  If we don't fetch the
      power state though, we may later fail to set up MSI due to the unknown
      status.  So pick it up before we short circuit the rest due to a
      pre-existing enable or mismatched enable/disable pair (as happens with
      VGA devices, which are special in a special way).
      Tested-by: NJesse Brandeburg <jesse.brandeburg@gmail.com>
      Reported-by: NDave Airlie <airlied@linux.ie>
      Tested-by: NDave Airlie <airlied@linux.ie>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      97c145f7
    • M
      PCI: fix size checks for mmap() on /proc/bus/pci files · 3b519e4e
      Martin Wilck 提交于
      The checks for valid mmaps of PCI resources made through /proc/bus/pci files
      that were introduced in 9eff02e2 have several
      problems:
      
      1. mmap() calls on /proc/bus/pci files are made with real file offsets > 0,
      whereas under /sys/bus/pci/devices, the start of the resource corresponds
      to offset 0. This may lead to false negatives in pci_mmap_fits(), which
      implicitly assumes the /sys/bus/pci/devices layout.
      
      2. The loop in proc_bus_pci_mmap doesn't skip empty resouces. This leads
      to false positives, because pci_mmap_fits() doesn't treat empty resources
      correctly (the calculated size is 1 << (8*sizeof(resource_size_t)-PAGE_SHIFT)
      in this case!).
      
      3. If a user maps resources with BAR > 0, pci_mmap_fits will emit bogus
      WARNINGS for the first resources that don't fit until the correct one is found.
      
      On many controllers the first 2-4 BARs are used, and the others are empty.
      In this case, an mmap attempt will first fail on the non-empty BARs
      (including the "right" BAR because of 1.) and emit bogus WARNINGS because
      of 3., and finally succeed on the first empty BAR because of 2.
      This is certainly not the intended behaviour.
      
      This patch addresses all 3 issues.
      Updated with an enum type for the additional parameter for pci_mmap_fits().
      
      Cc: stable@kernel.org
      Signed-off-by: NMartin Wilck <martin.wilck@ts.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      3b519e4e
    • S
      PCI hotplug: ibmphp: Add check to prevent reading beyond mapped area · ac3abf2c
      Steven Rostedt 提交于
      While testing various randconfigs with ktest.pl, I hit the following panic:
      
      BUG: unable to handle kernel paging request at f7e54b03
      IP: [<c0d63409>] ibmphp_access_ebda+0x101/0x19bb
      
      Adding printks, I found that the loop that reads the ebda blocks
      can move out of the mapped section.
      
      ibmphp_access_ebda: start=f7e44c00 size=5120 end=f7e46000
      ibmphp_access_ebda: io_mem=f7e44d80 offset=384
      ibmphp_access_ebda: io_mem=f7e54b03 offset=65283
      
      The start of the iomap was at f7e44c00 and had a size of 5120,
      making the end f7e46000. We start with an offset of 0x180 or
      384, giving the first read at 0xf7e44d80. Reading that location
      yields 65283, which is much bigger than the 5120 that was allocated
      and makes the next read at f7e54b03 which is outside the mapped area.
      
      Perhaps this is a bug in the driver, or buggy hardware, but this patch
      is more about not crashing my box on start up and just giving a warning
      if it detects this error.
      
      This patch at least lets my box boot with just a warning.
      
      Cc: Chandru Siddalingappa <chandru@linux.vnet.ibm.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      ac3abf2c
  18. 09 11月, 2010 2 次提交
  19. 28 10月, 2010 1 次提交
  20. 27 10月, 2010 1 次提交
    • B
      PCI: allocate bus resources from the top down · b126b470
      Bjorn Helgaas 提交于
      Allocate space from the highest-address PCI bus resource first, then work
      downward.
      
      Previously, we looked for space in PCI host bridge windows in the order
      we discovered the windows.  For example, given the following windows
      (discovered via an ACPI _CRS method):
      
          pci_root PNP0A03:00: host bridge window [mem 0x000a0000-0x000bffff]
          pci_root PNP0A03:00: host bridge window [mem 0x000c0000-0x000effff]
          pci_root PNP0A03:00: host bridge window [mem 0x000f0000-0x000fffff]
          pci_root PNP0A03:00: host bridge window [mem 0xbff00000-0xf7ffffff]
          pci_root PNP0A03:00: host bridge window [mem 0xff980000-0xff980fff]
          pci_root PNP0A03:00: host bridge window [mem 0xff97c000-0xff97ffff]
          pci_root PNP0A03:00: host bridge window [mem 0xfed20000-0xfed9ffff]
      
      we attempted to allocate from [mem 0x000a0000-0x000bffff] first, then
      [mem 0x000c0000-0x000effff], and so on.
      
      With this patch, we allocate from [mem 0xff980000-0xff980fff] first, then
      [mem 0xff97c000-0xff97ffff], [mem 0xfed20000-0xfed9ffff], etc.
      
      Allocating top-down follows Windows practice, so we're less likely to
      trip over BIOS defects in the _CRS description.
      
      On the machine above (a Dell T3500), the [mem 0xbff00000-0xbfffffff] region
      doesn't actually work and is likely a BIOS defect.  The symptom is that we
      move the AHCI controller to 0xbff00000, which leads to "Boot has failed,
      sleeping forever," a BUG in ahci_stop_engine(), or some other boot failure.
      
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=16228#c43
      Reference: https://bugzilla.redhat.com/show_bug.cgi?id=620313
      Reference: https://bugzilla.redhat.com/show_bug.cgi?id=629933Reported-by: NBrian Bloniarz <phunge0@hotmail.com>
      Reported-and-tested-by: NStefan Becker <chemobejk@gmail.com>
      Reported-by: NDenys Vlasenko <dvlasenk@redhat.com>
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b126b470
  21. 18 10月, 2010 2 次提交