1. 24 3月, 2014 1 次提交
  2. 20 3月, 2014 6 次提交
    • B
      PCI: Log IDE resource quirk in dmesg · 075eb9e3
      Bjorn Helgaas 提交于
      Make a note in dmesg when we overwrite legacy IDE BAR info.  We previously
      logged something like this:
      
        pci 0000:00:1f.1: reg 0x10: [io  0x0000-0x0007]
      
      and then silently overwrote the resource.  There's an example in the
      bugzilla below.  This doesn't fix the bugzilla; it just makes what's going
      on more obvious.
      
      No functional change; merely adds some dev_info() calls.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=48451Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      075eb9e3
    • B
      PCI: Change pci_bus_alloc_resource() type_mask to unsigned long · 664c2848
      Bjorn Helgaas 提交于
      The pci_bus_alloc_resource() "type_mask" parameter is used to compare with
      the "flags" member of a struct resource, so it should be the same type,
      namely "unsigned long".
      
      No functional change because all current IORESOURCE_* flags fit in 32 bits.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      664c2848
    • B
      PCI: Check all IORESOURCE_TYPE_BITS in pci_bus_alloc_from_region() · aa11fc58
      Bjorn Helgaas 提交于
      When allocating space from a bus resource, i.e., from apertures leading to
      this bus, make sure the entire resource type matches.  The previous code
      assumed the IORESOURCE_TYPE_BITS field was a bitmask with only a single bit
      set, but this is not true.  IORESOURCE_TYPE_BITS is really an enumeration,
      and we have to check all the bits.
      
      See 72dcb119 ("resources: Add register address resource type").
      
      No functional change.  If we used this path for allocating IRQs, DMA
      channels, or bus numbers, this would fix a bug because those types are
      indistinguishable when masked by IORESOURCE_IO | IORESOURCE_MEM.  But we
      don't, so this shouldn't make any difference.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      aa11fc58
    • B
      PCI: Don't check resource_size() in pci_bus_alloc_resource() · e20fa660
      Bjorn Helgaas 提交于
      Paul reported that after f75b99d5 ("PCI: Enforce bus address limits in
      resource allocation") on a 32-bit kernel (CONFIG_PHYS_ADDR_T_64BIT not
      set), intel-gtt complained "can't ioremap flush page - no chipset
      flushing".  In addition, other PCI resource allocations, e.g., for bridge
      windows, failed.
      
      This happens because we incorrectly skip bus resources of
      [mem 0x00000000-0xffffffff] because we think they are of size zero.
      When resource_size_t is 32 bits wide, resource_size() on
      [mem 0x00000000-0xffffffff] returns 0 because (r->end - r->start + 1)
      overflows.
      
      Therefore, we can't use "resource_size() == 0" to decide that allocation
      from this resource will fail.  allocate_resource() should fail anyway if it
      can't satisfy the address constraints, so we should just depend on that.
      
      A [mem 0x00000000-0xffffffff] bus resource is obviously not really valid,
      but we do fall back to it as a default when we don't have information about
      host bridge apertures.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=71611
      Fixes: f75b99d5 PCI: Enforce bus address limits in resource allocation
      Reported-and-tested-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      e20fa660
    • B
      PCI: Add "weak" generic pcibios_enable_device() implementation · 8a9d5609
      Bjorn Helgaas 提交于
      Many architectures implement pcibios_enable_device() the same way, so
      provide a default implementation in the core.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      8a9d5609
    • B
      PCI: Don't enable decoding if BAR hasn't been assigned an address · 3cedcc36
      Bjorn Helgaas 提交于
      Don't enable memory or I/O decoding if we haven't assigned or claimed the
      BAR's resource.
      
      If we enable decoding for a BAR that hasn't been assigned an address, we'll
      likely cause bus conflicts.  This declines to enable decoding for resources
      with IORESOURCE_UNSET.
      
      Note that drivers can use pci_enable_device_io() or pci_enable_device_mem()
      if they only care about specific types of BARs.  In that case, we don't
      bother checking whether the corresponding resources are assigned or
      claimed.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      3cedcc36
  3. 13 3月, 2014 2 次提交
    • B
      PCI: Don't check resource_size() in pci_bus_alloc_resource() · ac93ac74
      Bjorn Helgaas 提交于
      Paul reported that after f75b99d5 ("PCI: Enforce bus address limits in
      resource allocation") on a 32-bit kernel (CONFIG_PHYS_ADDR_T_64BIT not
      set), intel-gtt complained "can't ioremap flush page - no chipset
      flushing".  In addition, other PCI resource allocations, e.g., for bridge
      windows, failed.
      
      This happens because we incorrectly skip bus resources of
      [mem 0x00000000-0xffffffff] because we think they are of size zero.
      When resource_size_t is 32 bits wide, resource_size() on
      [mem 0x00000000-0xffffffff] returns 0 because (r->end - r->start + 1)
      overflows.
      
      Therefore, we can't use "resource_size() == 0" to decide that allocation
      from this resource will fail.  allocate_resource() should fail anyway if it
      can't satisfy the address constraints, so we should just depend on that.
      
      A [mem 0x00000000-0xffffffff] bus resource is obviously not really valid,
      but we do fall back to it as a default when we don't have information about
      host bridge apertures.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=71611
      Fixes: f75b99d5 PCI: Enforce bus address limits in resource allocation
      Reported-and-tested-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      ac93ac74
    • B
      PCI: Enable INTx in pci_reenable_device() only when MSI/MSI-X not enabled · 3cdeb713
      Bjorn Helgaas 提交于
      Andreas reported that after 1f42db78 ("PCI: Enable INTx if BIOS left
      them disabled"), pciehp surprise removal stopped working.
      
      This happens because pci_reenable_device() on the hotplug bridge (used in
      the pciehp_configure_device() path) clears the Interrupt Disable bit, which
      apparently breaks the bridge's MSI hotplug event reporting.
      
      Previously we cleared the Interrupt Disable bit in do_pci_enable_device(),
      which is used by both pci_enable_device() and pci_reenable_device().  But
      we use pci_reenable_device() after the driver may have enabled MSI or
      MSI-X, and we *set* Interrupt Disable as part of enabling MSI/MSI-X.
      
      This patch clears Interrupt Disable only when MSI/MSI-X has not been
      enabled.
      
      Fixes: 1f42db78 PCI: Enable INTx if BIOS left them disabled
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=71691Reported-and-tested-by: NAndreas Noever <andreas.noever@gmail.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: stable@vger.kernel.org
      CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      3cdeb713
  4. 08 3月, 2014 1 次提交
    • B
      PCI: Enable INTx in pci_reenable_device() only when MSI/MSI-X not enabled · 866d5417
      Bjorn Helgaas 提交于
      Andreas reported that after 1f42db78 ("PCI: Enable INTx if BIOS left
      them disabled"), pciehp surprise removal stopped working.
      
      This happens because pci_reenable_device() on the hotplug bridge (used in
      the pciehp_configure_device() path) clears the Interrupt Disable bit, which
      apparently breaks the bridge's MSI hotplug event reporting.
      
      Previously we cleared the Interrupt Disable bit in do_pci_enable_device(),
      which is used by both pci_enable_device() and pci_reenable_device().  But
      we use pci_reenable_device() after the driver may have enabled MSI or
      MSI-X, and we *set* Interrupt Disable as part of enabling MSI/MSI-X.
      
      This patch clears Interrupt Disable only when MSI/MSI-X has not been
      enabled.
      
      Fixes: 1f42db78 PCI: Enable INTx if BIOS left them disabled
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=71691Reported-and-tested-by: NAndreas Noever <andreas.noever@gmail.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: stable@vger.kernel.org
      CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      866d5417
  5. 05 3月, 2014 2 次提交
  6. 04 3月, 2014 1 次提交
    • R
      PCI / PM: Resume runtime-suspended devices later during system suspend · 7cd0602d
      Rafael J. Wysocki 提交于
      Runtime-suspended devices are resumed during system suspend by
      pci_pm_prepare() for two reasons: First, because they may need
      to be reprogrammed in order to change their wakeup settings and,
      second, because they may need to be operatonal for their children
      to be successfully suspended.  That is a problem, though, if there
      are many runtime-suspended devices that need to be resumed this
      way during system suspend, because the .prepare() PM callbacks of
      devices are executed sequentially and the times taken by them
      accumulate, which may increase the total system suspend time quite
      a bit.
      
      For this reason, move the resume of runtime-suspended devices up
      to the next phase of device suspend (during system suspend), except
      for the ones that have power.ignore_children set.  The exception is
      made, because the devices with power.ignore_children set may still
      be necessary for their children to be successfully suspended (during
      system suspend) and they won't be resumed automatically as a result
      of the runtime resume of their children.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      7cd0602d
  7. 28 2月, 2014 7 次提交
    • B
      PCI: Mark 64-bit resource as IORESOURCE_UNSET if we only support 32-bit · c83bd900
      Bjorn Helgaas 提交于
      If we don't support 64-bit addresses, i.e., CONFIG_PHYS_ADDR_T_64BIT is not
      set, we can't deal with BARs above 4GB.  In this case we already pretend
      the BAR contained zero; this patch also sets IORESOURCE_UNSET so we can try
      to reallocate it later.
      
      I don't think this is exactly correct: what we care about here are *bus*
      addresses, not CPU addresses, so the tests of sizeof(resource_size_t)
      probably should be on sizeof(dma_addr_t) instead.  But this is what's been
      in -next, so we'll fix that later.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      c83bd900
    • B
      PCI: Don't try to claim IORESOURCE_UNSET resources · 29003beb
      Bjorn Helgaas 提交于
      If the IORESOURCE_UNSET bit is set, it means we haven't assigned an address
      yet, so don't try to claim the region.
      
      Also, make the error messages more uniform and add info about which BAR is
      involved.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      29003beb
    • B
      PCI: Check IORESOURCE_UNSET before updating BAR · cd8a4d36
      Bjorn Helgaas 提交于
      Check to make sure we don't update a BAR with an address we haven't
      assigned.
      
      If we haven't assigned an address to a resource, we shouldn't write it to a
      BAR.  This isn't a problem for the usual path via pci_assign_resource(),
      which clears IORESOURCE_UNSET before calling pci_update_resource(), but
      paths like pci_restore_bars() can call this for resources we haven't
      assigned.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      cd8a4d36
    • B
      PCI: Don't clear IORESOURCE_UNSET when updating BAR · 434aafc1
      Bjorn Helgaas 提交于
      Clear IORESOURCE_UNSET when we assign an address to a resource, not when we
      write the address to the BAR.
      
      Also, drop the "BAR %d: set to %pR" message; this is mostly redundant with
      the "BAR %d: assigned %pR" message from pci_assign_resource().
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      434aafc1
    • B
      PCI: Mark resources as IORESOURCE_UNSET if we can't assign them · bd064f0a
      Bjorn Helgaas 提交于
      When assigning addresses to resources, mark them with IORESOURCE_UNSET
      before we start and clear IORESOURCE_UNSET if assignment is successful.
      That means that if we print the resource during assignment, we will show
      the size, not a meaningless address.
      
      Also, clear IORESOURCE_UNSET if we do assign an address, so we print the
      address when it is valid.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      bd064f0a
    • B
      PCI: Remove pci_find_parent_resource() use for allocation · f44116ae
      Bjorn Helgaas 提交于
      If the resource hasn't been allocated yet, pci_find_parent_resource() is
      documented as returning the region "where it should be allocated from."
      This is impossible in general because there may be several candidates: a
      prefetchable BAR can be put in either a prefetchable or non-prefetchable
      window, a transparent bridge may have overlapping positively- and
      subtractively-decoded windows, and a root bus may have several windows of
      the same type.
      
      Allocation should be done by pci_bus_alloc_resource(), which iterates
      through all bus resources and looks for the best match, e.g., one with the
      desired prefetchability attributes, and falls back to less-desired
      possibilities.
      
      The only valid use of pci_find_parent_resource() is to find the parent of
      an already-allocated resource so we can claim it via request_resource(),
      and all we need for that is a bus region of the correct type that contains
      the resource.
      
      Note that like 8c8def26 ("PCI: allow matching of prefetchable resources
      to non-prefetchable windows"), this depends on pci_bus_for_each_resource()
      iterating through positively-decoded regions before subtractively-decoded
      ones.  We prefer not to return a subtractively-decoded region because
      requesting from it will likely conflict with the overlapping positively-
      decoded window (see Launchpad report below).
      
      Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/424142Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: Linus Torvalds <torvalds@linux-foundation.org>
      f44116ae
    • H
      x86, platforms: Remove SGI Visual Workstation · c5f9ee3d
      H. Peter Anvin 提交于
      The SGI Visual Workstation seems to be dead; remove support so we
      don't have to continue maintaining it.
      
      Cc: Andrey Panin <pazke@donpac.ru>
      Cc: Michael Reed <mdr@sgi.com>
      Link: http://lkml.kernel.org/r/530CFD6C.7040705@zytor.comSigned-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      c5f9ee3d
  8. 27 2月, 2014 2 次提交
    • B
      resource: Add resource_contains() · 5edb93b8
      Bjorn Helgaas 提交于
      We have two identical copies of resource_contains() already, and more
      places that could use it.  This moves it to ioport.h where it can be
      shared.
      
      resource_contains(struct resource *r1, struct resource *r2) returns true
      iff r1 and r2 are the same type (most callers already checked this
      separately) and the r1 address range completely contains r2.
      
      In addition, the new resource_contains() checks that both r1 and r2 have
      addresses assigned to them.  If a resource is IORESOURCE_UNSET, it doesn't
      have a valid address and can't contain or be contained by another resource.
      Some callers already check this or for res->start.
      
      No functional change.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      5edb93b8
    • M
      PCI: rcar: Make the Kconfig dependencies more generic · ef4741e9
      Magnus Damm 提交于
      Update the R-Car Generation 2 PCI driver Kconfig dependencies to follow
      same style as other drivers - no SoC dependencies.
      
      Also, update the COMPILE_TEST bits to depend on ARM. This since the DMA
      bounce buffer and dma_ops handling code is ARM specific.
      
      [bhelgaas: adjust context after dropping DMABOUNCE patches]
      Signed-off-by: NMagnus Damm <damm@opensource.se>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NSimon Horman <horms+renesas@verge.net.au>
      ef4741e9
  9. 21 2月, 2014 5 次提交
  10. 20 2月, 2014 5 次提交
  11. 19 2月, 2014 7 次提交
  12. 16 2月, 2014 1 次提交
    • R
      ACPI / hotplug / PCI: Add ACPIPHP contexts to devices handled by PCIeHP · cc6254e0
      Rafael J. Wysocki 提交于
      Currently, ACPIPHP does not add hotplug context to devices that
      should be handled by the native PCI hotplug (PCIeHP) code.  The
      reason why was because PCIeHP didn't know about the devices'
      connections with ACPI and would not clean up things properly
      during an eject of an ACPI-backed device, for example.
      
      However, after recent changes that made the ACPI core create struct
      acpi_device objects for all namespace nodes regardless of the
      underlying devices' status and added PCI rescan-remove locking to
      both ACPIPHP and PCIeHP, that concern is not valid any more.
      Namely, after those changes PCIeHP need not care about the ACPI
      side of things any more and it should be serialized with respect to
      ACPIPHP and they won't be running concurrently with each other in
      any case.
      
      For this reason, make ACPIPHP to add its hotplug context to
      all devices with ACPI companions, even the ones that should be
      handled by PCIeHP in principle.  That may work around hotplug
      issues on some systems where PCIeHP is supposed to work, but it
      doesn't and the ACPI hotplug signaling works instead.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cc6254e0