1. 22 5月, 2011 8 次提交
    • J
      PCI: Don't use dmi_name_in_vendors in quirk · 9251bac9
      Jean Delvare 提交于
      Don't use the costly dmi_name_in_vendors() when we know the string we
      are looking for can only be in the DMI board name field. This is more
      robust and, more importantly, much faster.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      9251bac9
    • C
      PCI: remove unused AER functions · cbfddd20
      Chen Gong 提交于
      In the commit 28eb5f27, aer_osc_setup is removed but corresponding
      definiton information in the aerdrv.h is missed.
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NChen Gong <gong.chen@linux.intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      cbfddd20
    • Y
      PCI/sysfs: move bus cpuaffinity to class dev_attrs · dc2c2c9d
      Yinghai Lu 提交于
      Requested by Greg KH to fix a race condition in the creating of PCI bus
      cpuaffinity files.
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      dc2c2c9d
    • Y
      PCI: add rescan to /sys/.../pci_bus/.../ · b9d320fc
      Yinghai Lu 提交于
      After remove the device from /sys, we have to rescan all or
      find out the bridge and access /sys../device/rescan there.
      
      this patch add /sys/.../pci_bus/.../rescan. So user can rescan more easy.
      that is more clean and easy to understand.
      
      like after remove 0000:c4:00.0, you can rescan 0000:c4 directly.
      
      -v2: According to Jesse, use function instead of exposing attr, so could hide
      	#ifdef in header file.
           also add code to remove rescan file in remove path.
      -v3: GregKH pointed out that we should use dev_attrs to avoid racing.
           So add pcibus_attrs and make it to be member of pcibus_attrs.
      -v4: Change name to pcibus_dev_attrs according to GregKH
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b9d320fc
    • Y
      PCI: update bridge resources to get more big ranges when allocating space (again) · da7822e5
      Yinghai Lu 提交于
      With Ram's fixes, this should be safe to do again.  So let's give it
      another try.
      
      BIOS separates IO ranges between several IOHs, and on some slots, BIOS
      assigns resources to a bridge, but stops assigning resources to the
      device under that bridge, because the device needs a big resource.
      
      So:
      1. allocate resources and record the failed device resources
      2. clear the BIOS assigned resources of the parent bridge of failing device
      3. go back and call pci assign unassigned
      4. if it still fails, go up the tree, clear more bridges. and try again
      
      Now Ram's allocate requested resource already got into mainline. could
      put this one again.
      Reviewed-by: NRam Pai <linuxram@us.ibm.com>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      da7822e5
    • A
      PCI: Add interfaces to store and load the device saved state · ffbdd3f7
      Alex Williamson 提交于
      For KVM device assignment, we'd like to save off the state of a device
      prior to passing it to the guest and restore it later.  We also want
      to allow pci_reset_funciton() to be called while the device is owned
      by the guest.  This however overwrites and invalidates the struct pci_dev
      buffers, so we can't just manually call save and restore.  Add generic
      interfaces for the saved state to be stored and reloaded back into
      struct pci_dev at a later time.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      ffbdd3f7
    • A
      PCI: Track the size of each saved capability data area · 24a4742f
      Alex Williamson 提交于
      This will allow us to store and load it later.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      24a4742f
    • Y
      PCI/e1000e: Add and use pci_disable_link_state_locked() · 9f728f53
      Yinghai Lu 提交于
      Need to use it in _e1000e_disable_aspm.  This routine is used for error
      recovery, where the pci_bus_sem is already held, and we don't want
      pci_disable_link_state to try to take it again.  So add a locked variant
      for use in cases like this.
      
      Found lock up:
      
      [ 2374.654557] kworker/32:1    D ffff881027f6b0f0     0  6075      2 0x00000000
      [ 2374.654816]  ffff88503f099a68 0000000000000046 ffff88503f098000 0000000000004000
      [ 2374.654837]  00000000001d1ec0 ffff88503f099fd8 00000000001d1ec0 ffff88503f099fd8
      [ 2374.654860]  0000000000004000 00000000001d1ec0 ffff88503dcc8000 ffff88503f090000
      [ 2374.654880] Call Trace:
      [ 2374.654898]  [<ffffffff810b1302>] ? __lock_acquired+0x3a/0x224
      [ 2374.654914]  [<ffffffff81c2b59c>] ? _raw_spin_unlock_irq+0x30/0x36
      [ 2374.654925]  [<ffffffff810b069d>] ? trace_hardirqs_on_caller+0x1f/0x178
      [ 2374.654936]  [<ffffffff81c2ab24>] rwsem_down_failed_common+0xd3/0x103
      [ 2374.654945]  [<ffffffff810b158f>] ? __lock_contended+0x3a/0x2a2
      [ 2374.654955]  [<ffffffff81c2ab7b>] rwsem_down_read_failed+0x12/0x14
      [ 2374.654967]  [<ffffffff813371e4>] call_rwsem_down_read_failed+0x14/0x30
      [ 2374.654981]  [<ffffffff8135df20>] ? pci_disable_link_state+0x5f/0xf5
      [ 2374.654990]  [<ffffffff81c2a0e6>] ? down_read+0x7e/0x91
      [ 2374.654999]  [<ffffffff8135df20>] ? pci_disable_link_state+0x5f/0xf5
      [ 2374.655008]  [<ffffffff8135df20>] pci_disable_link_state+0x5f/0xf5
      [ 2374.655024]  [<ffffffff81661796>] e1000e_disable_aspm+0x55/0x5a
      [ 2374.655037]  [<ffffffff816677eb>] e1000_io_slot_reset+0x59/0xea
      [ 2374.655048]  [<ffffffff8135fe0d>] ? report_mmio_enabled+0x5d/0x5d
      [ 2374.655057]  [<ffffffff8135fe3b>] report_slot_reset+0x2e/0x5d
      [ 2374.655072]  [<ffffffff8135369e>] pci_walk_bus+0x8a/0xb7
      [ 2374.655081]  [<ffffffff8135fe0d>] ? report_mmio_enabled+0x5d/0x5d
      [ 2374.655091]  [<ffffffff813603be>] broadcast_error_message+0xa4/0xb2
      [ 2374.655101]  [<ffffffff81352c71>] ? pci_bus_read_config_dword+0x72/0x80
      [ 2374.655110]  [<ffffffff813606df>] do_recovery+0x9e/0xf9
      [ 2374.655120]  [<ffffffff81360786>] handle_error_source+0x4c/0x51
      [ 2374.655129]  [<ffffffff81360974>] aer_isr_one_error+0x1e9/0x21a
      [ 2374.655138]  [<ffffffff81360a6c>] aer_isr+0xc7/0xcc
      [ 2374.655147]  [<ffffffff813609a5>] ? aer_isr_one_error+0x21a/0x21a
      [ 2374.655159]  [<ffffffff81096d9f>] process_one_work+0x237/0x3ec
      [ 2374.655168]  [<ffffffff81096d10>] ? process_one_work+0x1a8/0x3ec
      [ 2374.655178]  [<ffffffff8109728d>] worker_thread+0x17c/0x240
      [ 2374.655186]  [<ffffffff810b0803>] ? trace_hardirqs_on+0xd/0xf
      [ 2374.655196]  [<ffffffff81097111>] ? manage_workers+0xab/0xab
      [ 2374.655209]  [<ffffffff8109c8ed>] kthread+0xa0/0xa8
      [ 2374.655223]  [<ffffffff81c332d4>] kernel_thread_helper+0x4/0x10
      [ 2374.655232]  [<ffffffff81c2b880>] ? retint_restore_args+0xe/0xe
      [ 2374.655243]  [<ffffffff8109c84d>] ? __init_kthread_worker+0x5b/0x5b
      [ 2374.655252]  [<ffffffff81c332d0>] ? gs_change+0xb/0xb
      
      when aer happens,
      pci_walk_bus already have down_read(&pci_bus_sem)...
      then report_slot_reset
              ==> e1000_io_slot_reset
                      ==> e1000e_disable_aspm
                              ==> pci_disable_link_state...
      
      We can not use pci_disable_link_state, and it will try to hold pci_bus_sem again.
      
      Try to have __pci_disable_link_state that will not need to hold pci_bus_sem.
      
      -v2: change name to pci_disable_link_state_locked() according to Jesse.
      
      [jbarnes: make sure new function is exported for modules]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      9f728f53
  2. 17 5月, 2011 1 次提交
    • Y
      PCI: Clear bridge resource flags if requested size is 0 · 93d2175d
      Yinghai Lu 提交于
      During pci remove/rescan testing found:
      
        pci 0000:c0:03.0: PCI bridge to [bus c4-c9]
        pci 0000:c0:03.0:   bridge window [io  0x1000-0x0fff]
        pci 0000:c0:03.0:   bridge window [mem 0xf0000000-0xf00fffff]
        pci 0000:c0:03.0:   bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref]
        pci 0000:c0:03.0: device not available (can't reserve [io  0x1000-0x0fff])
        pci 0000:c0:03.0: Error enabling bridge (-22), continuing
        pci 0000:c0:03.0: enabling bus mastering
        pci 0000:c0:03.0: setting latency timer to 64
        pcieport 0000:c0:03.0: device not available (can't reserve [io  0x1000-0x0fff])
        pcieport: probe of 0000:c0:03.0 failed with error -22
      
      This bug was caused by commit c8adf9a3 ("PCI: pre-allocate
      additional resources to devices only after successful allocation of
      essential resources.")
      
      After that commit, pci_hotplug_io_size is changed to additional_io_size
      from minium size.  So it will not go through resource_size(res) != 0
      path, and will not be reset.
      
      The root cause is: pci_bridge_check_ranges will set RESOURCE_IO flag for
      pci bridge, and later if children do not need IO resource.  those bridge
      resources will not need to be allocated.  but flags is still there.
      that will confuse the the pci_enable_bridges later.
      
      related code:
      
         static void assign_requested_resources_sorted(struct resource_list *head,
                                          struct resource_list_x *fail_head)
         {
                 struct resource *res;
                 struct resource_list *list;
                 int idx;
      
                 for (list = head->next; list; list = list->next) {
                         res = list->res;
                         idx = res - &list->dev->resource[0];
                         if (resource_size(res) && pci_assign_resource(list->dev, idx)) {
         ...
                                 reset_resource(res);
                         }
                 }
         }
      
      At last, We have to clear the flags in pbus_size_mem/io when requested
      size == 0 and !add_head.  becasue this case it will not go through
      adjust_resources_sorted().
      
      Just make size1 = size0 when !add_head. it will make flags get cleared.
      
      At the same time when requested size == 0, add_size != 0, will still
      have in head and add_list.  because we do not clear the flags for it.
      
      After this, we will get right result:
      
        pci 0000:c0:03.0: PCI bridge to [bus c4-c9]
        pci 0000:c0:03.0:   bridge window [io  disabled]
        pci 0000:c0:03.0:   bridge window [mem 0xf0000000-0xf00fffff]
        pci 0000:c0:03.0:   bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref]
        pci 0000:c0:03.0: enabling bus mastering
        pci 0000:c0:03.0: setting latency timer to 64
        pcieport 0000:c0:03.0: setting latency timer to 64
        pcieport 0000:c0:03.0: irq 160 for MSI/MSI-X
        pcieport 0000:c0:03.0: Signaling PME through PCIe PME interrupt
        pci 0000:c4:00.0: Signaling PME through PCIe PME interrupt
        pcie_pme 0000:c0:03.0:pcie01: service driver pcie_pme loaded
        aer 0000:c0:03.0:pcie02: service driver aer loaded
        pciehp 0000:c0:03.0:pcie04: Hotplug Controller:
      
      v3: more simple fix. also fix one typo in pbus_size_mem
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Reviewed-by: NRam Pai <linuxram@us.ibm.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      93d2175d
  3. 12 5月, 2011 4 次提交
  4. 11 5月, 2011 9 次提交
  5. 21 4月, 2011 1 次提交
    • J
      intel_iommu: disable all VT-d PMRs when TXT launched · 51a63e67
      Joseph Cihula 提交于
      Intel VT-d Protected Memory Regions (PMRs) are supposed to be disabled,
      on each VT-d engine, after DMA remapping is enabled on the engines.
      This is because the behavior of having both enabled is not deterministic
      and because, if TXT has been used to launch the kernel, the PMRs may be
      programmed to cover memory regions that will be used for DMA.
      
      Under some circumstances (certain quirks detected, lack of multiple
      devices, etc.), the current code does not set up DMA remapping on some
      VT-d engines.  In such cases it also skips disabling the PMRs.  This
      causes failures when the kernel is launched with TXT (most often this
      occurs on the graphics engine and results in colored vertical bars on
      the display).
      
      This patch detects when the kernel has been launched with TXT and then
      disables the PMRs on all VT-d engines.  In some cases where the reason
      that remapping is not being enabled is due to possible ACPI DMAR table
      errors, the VT-d engine addresses may not be correct and thus not able
      to be safely programmed even to disable PMRs.  Because part of the TXT
      launch process is the verification of these addresses, it will always be
      safe to disable PMRs if the TXT launch has succeeded and hence only
      doing this in such cases.
      Signed-off-by: NJoseph Cihula <joseph.cihula@intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      51a63e67
  6. 12 4月, 2011 3 次提交
  7. 11 4月, 2011 1 次提交
  8. 31 3月, 2011 1 次提交
  9. 29 3月, 2011 1 次提交
  10. 24 3月, 2011 2 次提交
    • S
      userns: security: make capabilities relative to the user namespace · 3486740a
      Serge E. Hallyn 提交于
      - Introduce ns_capable to test for a capability in a non-default
        user namespace.
      - Teach cap_capable to handle capabilities in a non-default
        user namespace.
      
      The motivation is to get to the unprivileged creation of new
      namespaces.  It looks like this gets us 90% of the way there, with
      only potential uid confusion issues left.
      
      I still need to handle getting all caps after creation but otherwise I
      think I have a good starter patch that achieves all of your goals.
      
      Changelog:
      	11/05/2010: [serge] add apparmor
      	12/14/2010: [serge] fix capabilities to created user namespaces
      	Without this, if user serge creates a user_ns, he won't have
      	capabilities to the user_ns he created.  THis is because we
      	were first checking whether his effective caps had the caps
      	he needed and returning -EPERM if not, and THEN checking whether
      	he was the creator.  Reverse those checks.
      	12/16/2010: [serge] security_real_capable needs ns argument in !security case
      	01/11/2011: [serge] add task_ns_capable helper
      	01/11/2011: [serge] add nsown_capable() helper per Bastian Blank suggestion
      	02/16/2011: [serge] fix a logic bug: the root user is always creator of
      		    init_user_ns, but should not always have capabilities to
      		    it!  Fix the check in cap_capable().
      	02/21/2011: Add the required user_ns parameter to security_capable,
      		    fixing a compile failure.
      	02/23/2011: Convert some macros to functions as per akpm comments.  Some
      		    couldn't be converted because we can't easily forward-declare
      		    them (they are inline if !SECURITY, extern if SECURITY).  Add
      		    a current_user_ns function so we can use it in capability.h
      		    without #including cred.h.  Move all forward declarations
      		    together to the top of the #ifdef __KERNEL__ section, and use
      		    kernel-doc format.
      	02/23/2011: Per dhowells, clean up comment in cap_capable().
      	02/23/2011: Per akpm, remove unreachable 'return -EPERM' in cap_capable.
      
      (Original written and signed off by Eric;  latest, modified version
      acked by him)
      
      [akpm@linux-foundation.org: fix build]
      [akpm@linux-foundation.org: export current_user_ns() for ecryptfs]
      [serge.hallyn@canonical.com: remove unneeded extra argument in selinux's task_has_capability]
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NSerge E. Hallyn <serge.hallyn@canonical.com>
      Acked-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Acked-by: NDaniel Lezcano <daniel.lezcano@free.fr>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Cc: James Morris <jmorris@namei.org>
      Signed-off-by: NSerge E. Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3486740a
    • R
      PCI / Intel IOMMU: Use syscore_ops instead of sysdev class and sysdev · 134fac3f
      Rafael J. Wysocki 提交于
      The Intel IOMMU subsystem uses a sysdev class and a sysdev for
      executing iommu_suspend() after interrupts have been turned off
      on the boot CPU (during system suspend) and for executing
      iommu_resume() before turning on interrupts on the boot CPU
      (during system resume).  However, since both of these functions
      ignore their arguments, the entire mechanism may be replaced with a
      struct syscore_ops object which is simpler.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NJoerg Roedel <joerg.roedel@amd.com>
      134fac3f
  11. 22 3月, 2011 6 次提交
    • H
      ACPI, APEI, Add PCIe AER error information printing support · c413d768
      Huang Ying 提交于
      The AER error information printing support is implemented in
      drivers/pci/pcie/aer/aer_print.c.  So some string constants, functions
      and macros definitions can be re-used without being exported.
      
      The original PCIe AER error information printing function is not
      re-used directly because the overall format is quite different.  And
      changing the original printing format may make some original users'
      scripts broken.
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      CC: Jesse Barnes <jbarnes@virtuousgeek.org>
      CC: Zhang Yanmin <yanmin.zhang@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      c413d768
    • H
      PCIe, AER, use pre-generated prefix in error information printing · b64a4414
      Huang Ying 提交于
      When printing PCIe AER error information, each line is prefixed with
      PCIe device and driver information.  In original implementation, the
      prefix is generated when each line is printed.  In fact, all lines
      share the same prefix.  So this patch pre-generated the prefix, and
      use that one when each line is printed.
      
      In addition to common prefix can be pre-generated, the trailing white
      spaces in string constants and NULLs in char * array constants can be
      removed too.  These can reduce the object file size further.
      
      The size of object file before and after changing is as follow:
      
                 text    data     bss     dec
      before:    3038       0       0    3038
      after:     2118       0       0    2118
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      CC: Jesse Barnes <jbarnes@virtuousgeek.org>
      CC: Zhang Yanmin <yanmin.zhang@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      b64a4414
    • N
      PCI: Disable ASPM when _OSC control is not granted for PCIe services · eca67315
      Naga Chumbalkar 提交于
      v3 -> v2: Added text to describe the problem
      v2 -> v1: Split this patch from v1
      v1	: Part of: http://marc.info/?l=linux-pci&m=130042212003242&w=2
      
      Disable ASPM when no _OSC control for PCIe services is granted
      by the BIOS. This is to protect systems with a buggy BIOS that
      did not set the ACPI FADT "ASPM Controls" bit even though the
      underlying HW can't do ASPM.
      
      To turn "on" ASPM the minimum the BIOS needs to do:
      1. Clear the ACPI FADT "ASPM Controls" bit.
      2. Support _OSC appropriately
      
      There is no _OSC Control bit for ASPM. However, we expect the BIOS to
      support _OSC for a Root Bridge that originates a PCIe hierarchy. If this
      is not the case - we are better off not enabling ASPM on that server.
      
      Commit 852972ac (ACPI: Disable ASPM if the
      Platform won't provide _OSC control for PCIe) describes the above scenario.
      To quote verbatim from there:
      [The PCI SIG documentation for the _OSC OS/firmware handshaking interface
      states:
      
      "If the _OSC control method is absent from the scope of a host bridge
      device, then the operating system must not enable or attempt to use any
      features defined in this section for the hierarchy originated by the host
      bridge."
      
      The obvious interpretation of this is that the OS should not attempt to use
      PCIe hotplug, PME or AER - however, the specification also notes that an
      _OSC method is *required* for PCIe hierarchies, and experimental validation
      with An Alternative OS indicates that it doesn't use any PCIe functionality
      if the _OSC method is missing. That arguably means we shouldn't be using
      MSI or extended config space, but right now our problems seem to be limited
      to vendors being surprised when ASPM gets enabled on machines when other
      OSs refuse to do so. So, for now, let's just disable ASPM if the _OSC
      method doesn't exist or refuses to hand over PCIe capability control.]
      Signed-off-by: NNaga Chumbalkar <nagananda.chumbalkar@hp.com>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      eca67315
    • N
      PCI: Changing ASPM policy, via /sys, to POWERSAVE could cause NMIs · bbfa306a
      Naga Chumbalkar 提交于
      v3 -> v2: Modified the text that describes the problem
      v2 -> v1: Returned -EPERM
      v1      : http://marc.info/?l=linux-pci&m=130013194803727&w=2
      
      For servers whose hardware cannot handle ASPM the BIOS ought to set the
      FADT bit shown below:
      In Sec 5.2.9.3 (IA-PC Boot Arch. Flags) of ACPI4.0a Specification, please
      see Table 5-11:
      PCIe ASPM Controls: If set, indicates to OSPM that it must not enable
      OPSM ASPM control on this platform.
      
      However there are shipping servers whose BIOS did not set this bit. (An
      example is the HP ProLiant DL385 G6. A Maintenance BIOS will fix that).
      For such servers even if a call is made via pci_no_aspm(), based on _OSC
      support in the BIOS, it may be too late because the ASPM code may have
      already allocated and filled its "link_list".
      
      So if a user sets the ASPM "policy" to "powersave" via /sys then
      pcie_aspm_set_policy() will run through the "link_list" and re-configure
      ASPM policy on devices that advertise ASPM L0s/L1 capability:
      # echo powersave > /sys/module/pcie_aspm/parameters/policy
      # cat /sys/module/pcie_aspm/parameters/policy
      default performance [powersave]
      
      That can cause NMIs since the hardware doesn't play well with ASPM:
      [ 1651.906015] NMI: PCI system error (SERR) for reason b1 on CPU 0.
      [ 1651.906015] Dazed and confused, but trying to continue
      
      Ideally, the BIOS should have set that FADT bit in the first place but we
      could be more robust - especially given the fact that Windows doesn't
      cause NMIs in the above scenario.
      
      There should be a sanity check to not allow a user to modify ASPM policy
      when aspm_disabled is set.
      Signed-off-by: NNaga Chumbalkar <nagananda.chumbalkar@hp.com>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      bbfa306a
    • N
      PCI: PCIe links may not get configured for ASPM under POWERSAVE mode · 1a680b7c
      Naga Chumbalkar 提交于
      v3 -> v2: Moved ASPM enabling logic to pci_set_power_state()
      v2 -> v1: Preserved the logic in pci_raw_set_power_state()
      	: Added ASPM enabling logic after scanning Root Bridge
      	: http://marc.info/?l=linux-pci&m=130046996216391&w=2
      v1	: http://marc.info/?l=linux-pci&m=130013164703283&w=2
      
      The assumption made in commit 41cd766b
      (PCI: Don't enable aspm before drivers have had a chance to veto it) that
      pci_enable_device() will result in re-configuring ASPM when aspm_policy is
      POWERSAVE is no longer valid.  This is due to commit
      97c145f7 (PCI: read current power state
      at enable time) which resets dev->current_state to D0. Due to this the
      call to pcie_aspm_pm_state_change() is never made. Note the equality check
      (below) that returns early:
      ./drivers/pci/pci.c: pci_raw_set_pci_power_state()
      546         /* Check if we're already there */
      547         if (dev->current_state == state)
      548                 return 0;
      
      Therefore OSPM never configures the PCIe links for ASPM to turn them "on".
      
      Fix it by configuring ASPM from the pci_enable_device() code path. This
      also allows a driver such as the e1000e networking driver a chance to
      disable ASPM (L0s, L1), if need be, prior to enabling the device. A
      driver may perform this action if the device is known to mis-behave
      wrt ASPM.
      Signed-off-by: NNaga Chumbalkar <nagananda.chumbalkar@hp.com>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      1a680b7c
    • R
      PCI/ACPI: Report ASPM support to BIOS if not disabled from command line · 8b8bae90
      Rafael J. Wysocki 提交于
      We need to distinguish the situation in which ASPM support is
      disabled from the command line or through .config from the situation
      in which it is disabled, because the hardware or BIOS can't handle
      it.  In the former case we should not report ASPM support to the BIOS
      through ACPI _OSC, but in the latter case we should do that.
      
      Introduce pcie_aspm_support_enabled() that can be used by
      acpi_pci_root_add() to determine whether or not it should report ASPM
      support to the BIOS through _OSC.
      
      Cc: stable@kernel.org
      References: https://bugzilla.kernel.org/show_bug.cgi?id=29722
      References: https://bugzilla.kernel.org/show_bug.cgi?id=20232Reported-and-tested-by: NOrtwin Glück <odi@odi.ch>
      Reviewed-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Tested-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      8b8bae90
  12. 17 3月, 2011 3 次提交