1. 24 1月, 2017 1 次提交
  2. 03 1月, 2017 1 次提交
    • R
      ACPI / scan: Prefer devices without _HID/_CID for _ADR matching · c2a6bbaf
      Rafael J. Wysocki 提交于
      The way acpi_find_child_device() works currently is that, if there
      are two (or more) devices with the same _ADR value in the same
      namespace scope (which is not specifically allowed by the spec and
      the OS behavior in that case is not defined), the first one of them
      found to be present (with the help of _STA) will be returned.
      
      This covers the majority of cases, but is not sufficient if some of
      the devices in question have a _HID (or _CID) returning some valid
      ACPI/PNP device IDs (which is disallowed by the spec) and the
      ASL writers' expectation appears to be that the OS will match
      devices without a valid ACPI/PNP device ID against a given bus
      address first.
      
      To cover this special case as well, modify find_child_checks()
      to prefer devices without ACPI/PNP device IDs over devices that
      have them.
      Suggested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NHans de Goede <hdegoede@redhat.com>
      c2a6bbaf
  3. 27 12月, 2016 3 次提交
    • M
      ACPI / watchdog: Print out error number when device creation fails · c6e2c1e1
      Mika Westerberg 提交于
      If the platform device creation fails for whichever reason the driver
      prints out something like:
      
        [    0.978837] ACPI: watchdog: Failed to create platform device
      
      However, that is quite confusing and does not include any information
      why it failed. To make it more understandable, reword it like:
      
        [    0.978837] ACPI: watchdog: Device creation failed: -16
      
      Which tells that we failed to create the watchdog device because some of
      the resources were already reserved (-EBUSY).
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c6e2c1e1
    • L
      ACPI / sysfs: Provide quirk mechanism to prevent GPE flooding · 9c4aa1ee
      Lv Zheng 提交于
      Sometimes, the users may require a quirk to be provided from ACPI subsystem
      core to prevent a GPE from flooding.
      Normally, if a GPE cannot be dispatched, ACPICA core automatically prevents
      the GPE from firing. But there are cases the GPE is dispatched by _Lxx/_Exx
      provided via AML table, and OSPM is lacking of the knowledge to get
      _Lxx/_Exx correctly executed to handle the GPE, thus the GPE flooding may
      still occur.
      
      The existing quirk mechanism can be enabled/disabled using the following
      commands to prevent such kind of GPE flooding during runtime:
       # echo mask > /sys/firmware/acpi/interrupts/gpe00
       # echo unmask > /sys/firmware/acpi/interrupts/gpe00
      To avoid GPE flooding during boot, we need a boot stage mechanism.
      
      This patch provides such a boot stage quirk mechanism to stop this kind of
      GPE flooding. This patch doesn't fix any feature gap but since the new
      feature gaps could be found in the future endlessly, and can disappear if
      the feature gaps are filled, providing a boot parameter rather than a DMI
      table should suffice.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=53071
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=117481
      Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/887793Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9c4aa1ee
    • L
      ACPI: Drop misplaced acpi_dma_deconfigure() call from acpi_bind_one() · 709f94ff
      Lorenzo Pieralisi 提交于
      The acpi_bind_one() error return path can be hit either on physical node
      allocation failure or if the device being configured is already
      associated with an ACPI node and its ACPI companion does not match the
      one acpi_bind_one() is setting it up with. In both cases the error
      return path is executed before DMA is configured for a device therefore
      there is no need to call acpi_dma_deconfigure() on the function error
      return path.
      
      Furthermore, if acpi_bind_one() does configure DMA for a device (ie it
      successfully executes acpi_dma_configure()) acpi_bind_one() always
      completes execution successfully hence there is no need to add an exit
      path to deconfigure the DMA set-up (ie by calling acpi_dma_deconfigure()).
      
      Remove the misplaced acpi_dma_deconfigure() in acpi_bind_one() to
      reinstate its correct error return path behaviour.
      
      Fixes: d760a1ba (ACPI: Implement acpi_dma_configure)
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      709f94ff
  4. 25 12月, 2016 1 次提交
  5. 21 12月, 2016 4 次提交
    • L
      ACPI / osl: Remove deprecated acpi_get_table_with_size()/early_acpi_os_unmap_memory() · 8d3523fb
      Lv Zheng 提交于
      Since all users are cleaned up, remove the 2 deprecated APIs due to no
      users.
      As a Linux variable rather than an ACPICA variable, acpi_gbl_permanent_mmap
      is renamed to acpi_permanent_mmap to have a consistent coding style across
      entire Linux ACPI subsystem.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8d3523fb
    • L
      ACPI / osl: Remove acpi_get_table_with_size()/early_acpi_os_unmap_memory() users · 6b11d1d6
      Lv Zheng 提交于
      This patch removes the users of the deprectated APIs:
       acpi_get_table_with_size()
       early_acpi_os_unmap_memory()
      The following APIs should be used instead of:
       acpi_get_table()
       acpi_put_table()
      
      The deprecated APIs are invented to be a replacement of acpi_get_table()
      during the early stage so that the early mapped pointer will not be stored
      in ACPICA core and thus the late stage acpi_get_table() won't return a
      wrong pointer. The mapping size is returned just because it is required by
      early_acpi_os_unmap_memory() to unmap the pointer during early stage.
      
      But as the mapping size equals to the acpi_table_header.length
      (see acpi_tb_init_table_descriptor() and acpi_tb_validate_table()), when
      such a convenient result is returned, driver code will start to use it
      instead of accessing acpi_table_header to obtain the length.
      
      Thus this patch cleans up the drivers by replacing returned table size with
      acpi_table_header.length, and should be a no-op.
      Reported-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6b11d1d6
    • L
      ACPICA: Tables: Allow FADT to be customized with virtual address · 66360faa
      Lv Zheng 提交于
      ACPICA commit d98de9ca14891130efc5dcdc871b97eb27b4b0f5
      
      FADT parsing code requires FADT to be installed as
      ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, using new
      acpi_tb_get_table()/acpi_tb_put_table(), other address types can also be allowed,
      thus facilitates FADT customization with virtual address. Lv Zheng.
      
      Link: https://github.com/acpica/acpica/commit/d98de9caSigned-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      66360faa
    • L
      ACPICA: Tables: Back port acpi_get_table_with_size() and... · 174cc718
      Lv Zheng 提交于
      ACPICA: Tables: Back port acpi_get_table_with_size() and early_acpi_os_unmap_memory() from Linux kernel
      
      ACPICA commit cac6790954d4d752a083e6122220b8a22febcd07
      
      This patch back ports Linux acpi_get_table_with_size() and
      early_acpi_os_unmap_memory() into ACPICA upstream to reduce divergences.
      
      The 2 APIs are used by Linux as table management APIs for long time, it
      contains a hidden logic that during the early stage, the mapped tables
      should be unmapped before the early stage ends.
      
      During the early stage, tables are handled by the following sequence:
       acpi_get_table_with_size();
       parse the table
       early_acpi_os_unmap_memory();
      During the late stage, tables are handled by the following sequence:
       acpi_get_table();
       parse the table
      Linux uses acpi_gbl_permanent_mmap to distinguish the early stage and the
      late stage.
      
      The reasoning of introducing acpi_get_table_with_size() is: ACPICA will
      remember the early mapped pointer in acpi_get_table() and Linux isn't able to
      prevent ACPICA from using the wrong early mapped pointer during the late
      stage as there is no API provided from ACPICA to be an inverse of
      acpi_get_table() to forget the early mapped pointer.
      
      But how ACPICA can work with the early/late stage requirement? Inside of
      ACPICA, tables are ensured to be remained in "INSTALLED" state during the
      early stage, and they are carefully not transitioned to "VALIDATED" state
      until the late stage. So the same logic is in fact implemented inside of
      ACPICA in a different way. The gap is only that the feature is not provided
      to the OSPMs in an accessible external API style.
      
      It then is possible to fix the gap by providing an inverse of
      acpi_get_table() from ACPICA, so that the two Linux sequences can be
      combined:
       acpi_get_table();
       parse the table
       acpi_put_table();
      In order to work easier with the current Linux code, acpi_get_table() and
      acpi_put_table() is implemented in a usage counting based style:
       1. When the usage count of the table is increased from 0 to 1, table is
          mapped and .Pointer is set with the mapping address (VALIDATED);
       2. When the usage count of the table is decreased from 1 to 0, .Pointer
          is unset and the mapping address is unmapped (INVALIDATED).
      So that we can deploy the new APIs to Linux with minimal effort by just
      invoking acpi_get_table() in acpi_get_table_with_size() and invoking
      acpi_put_table() in early_acpi_os_unmap_memory(). Lv Zheng.
      
      Link: https://github.com/acpica/acpica/commit/cac67909Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      174cc718
  6. 15 12月, 2016 1 次提交
  7. 14 12月, 2016 1 次提交
  8. 13 12月, 2016 2 次提交
    • R
      ACPI / CPPC: Fix per-CPU pointer management in acpi_cppc_processor_probe() · 28076483
      Rafael J. Wysocki 提交于
      Fix a possible use-after-free scenario in acpi_cppc_processor_probe()
      that can happen if the function returns without cleaning up the
      per-CPU pointer set by it previously.
      Reported-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      28076483
    • S
      ACPI / CPPC: Fix crash in acpi_cppc_processor_exit() · 9e9d68da
      Sebastian Andrzej Siewior 提交于
      First I had crashed what I bisected down to de966cf4 (sched/x86: Change
      CONFIG_SCHED_ITMT to CONFIG_SCHED_MC_PRIO) because it made SCHED_ITMT the
      default.
      
      Then I run another bisect round and got here with the same backtrace:
      
      |BUG: unable to handle kernel NULL pointer dereference at           (null)
      |IP: [<ffffffff812aab6e>] acpi_cppc_processor_exit+0x40/0x60
      |PGD 0 [    0.577616]
      |Oops: 0000 [#1] SMP
      |Modules linked in:
      |CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.9.0-rc6-00146-g17669006 #51
      |task: ffff88003f878000 task.stack: ffffc90000008000
      |RIP: 0010:[<ffffffff812aab6e>]  [<ffffffff812aab6e>] acpi_cppc_processor_exit+0x40/0x60
      |RSP: 0000:ffffc9000000bd48  EFLAGS: 00010296
      |RAX: 00000000000137e0 RBX: 0000000000000000 RCX: 0000000000000001
      |RDX: ffff88003fc00000 RSI: 0000000000000000 RDI: ffff88003fbca130
      |RBP: ffffc9000000bd60 R08: 0000000000000514 R09: 0000000000000000
      |R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000002
      |R13: 0000000000000020 R14: ffffffff8167cb00 R15: 0000000000000000
      |FS:  0000000000000000(0000) GS:ffff88003fcc0000(0000) knlGS:0000000000000000
      |CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      |CR2: 0000000000000000 CR3: 0000000001618000 CR4: 00000000000406e0
      |Stack:
      | ffff88003f939848 ffff88003fbca130 0000000000000001 ffffc9000000bd80
      | ffffffff812a4ccb ffff88003fc0cee8 0000000000000000 ffffc9000000bdb8
      | ffffffff812dc20d ffff88003fc0cee8 ffffffff8167cb00 ffff88003fc0cf48
      |Call Trace:
      | [<ffffffff812a4ccb>] acpi_processor_stop+0xb2/0xc5
      | [<ffffffff812dc20d>] driver_probe_device+0x14d/0x2f0
      | [<ffffffff812dc41e>] __driver_attach+0x6e/0x90
      | [<ffffffff812da234>] bus_for_each_dev+0x54/0x90
      | [<ffffffff812dbbf9>] driver_attach+0x19/0x20
      | [<ffffffff812db6a6>] bus_add_driver+0xe6/0x200
      | [<ffffffff812dcb23>] driver_register+0x83/0xc0
      | [<ffffffff816f050a>] acpi_processor_driver_init+0x20/0x94
      | [<ffffffff81000487>] do_one_initcall+0x97/0x180
      | [<ffffffff816ccf5c>] kernel_init_freeable+0x112/0x1a6
      | [<ffffffff813a0fc9>] kernel_init+0x9/0xf0
      | [<ffffffff813acf35>] ret_from_fork+0x25/0x30
      |Code: 02 00 00 00 48 8b 14 d5 e0 c3 55 81 48 8b 1c 02 4c 8d 6b 20 eb 15 49 8b 7d 00 48 85 ff 74 05 e8 39 8c d9 ff 41 ff c4 49 83 c5 20 <44> 3b 23 72 e6 48 8d bb a0 02 00 00 e8 b1 6f f9 ff 48 89 df e8
      |RIP  [<ffffffff812aab6e>] acpi_cppc_processor_exit+0x40/0x60
      | RSP <ffffc9000000bd48>
      |CR2: 0000000000000000
      |---[ end trace 917a625107b09711 ]---
      
      Fix it.
      
      Fixes: 17669006 (cpufreq/intel_pstate: Use CPPC to get max performance)
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      [ rjw: Subject ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9e9d68da
  9. 10 12月, 2016 1 次提交
  10. 09 12月, 2016 1 次提交
  11. 07 12月, 2016 14 次提交
    • D
      tools/testing/nvdimm: unit test acpi_nfit_ctl() · a7de92da
      Dan Williams 提交于
      A recent flurry of bug discoveries in the nfit driver's DSM marshalling
      routine has highlighted the fact that we do not have unit test coverage
      for this routine. Add a self-test of acpi_nfit_ctl() routine before
      probing the "nfit_test.0" device. This mocks stimulus to acpi_nfit_ctl()
      and if any of the tests fail "nfit_test.0" will be unavailable causing
      the rest of the tests to not run / fail.
      
      This unit test will also be a place to land reproductions of quirky BIOS
      behavior discovered in the field and ensure the kernel does not regress
      against implementations it has seen in practice.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      a7de92da
    • D
      acpi, nfit: fix bus vs dimm confusion in xlat_status · d6eb270c
      Dan Williams 提交于
      Given dimms and bus commands share the same command number space we need
      to be careful that we are translating status in the correct context.
      Otherwise we can, for example, fail an ND_CMD_GET_CONFIG_SIZE command
      because max_xfer is zero. It fails because that condition erroneously
      correlates with the 'cleared == 0' failure of ND_CMD_CLEAR_ERROR.
      
      Cc: <stable@vger.kernel.org>
      Fixes: aef25338 ("libnvdimm, nfit: centralize command status translation")
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      d6eb270c
    • D
      acpi, nfit: validate ars_status output buffer size · 82aa37cf
      Dan Williams 提交于
      If an ARS Status command returns truncated output, do not process
      partial records or otherwise consume non-status fields.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 0caeef63 ("libnvdimm: Add a poison list and export badblocks")
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      82aa37cf
    • D
      acpi, nfit, libnvdimm: fix / harden ars_status output length handling · efda1b5d
      Dan Williams 提交于
      Given ambiguities in the ACPI 6.1 definition of the "Output (Size)"
      field of the ARS (Address Range Scrub) Status command, a firmware
      implementation may in practice return 0, 4, or 8 to indicate that there
      is no output payload to process.
      
      The specification states "Size of Output Buffer in bytes, including this
      field.". However, 'Output Buffer' is also the name of the entire
      payload, and earlier in the specification it states "Max Query ARS
      Status Output Buffer Size: Maximum size of buffer (including the Status
      and Extended Status fields)".
      
      Without this fix if the BIOS happens to return 0 it causes memory
      corruption as evidenced by this result from the acpi_nfit_ctl() unit
      test.
      
       ars_status00000000: 00020000 00000000                    ........
       BUG: stack guard page was hit at ffffc90001750000 (stack is ffffc9000174c000..ffffc9000174ffff)
       kernel stack overflow (page fault): 0000 [#1] SMP DEBUG_PAGEALLOC
       task: ffff8803332d2ec0 task.stack: ffffc9000174c000
       RIP: 0010:[<ffffffff814cfe72>]  [<ffffffff814cfe72>] __memcpy+0x12/0x20
       RSP: 0018:ffffc9000174f9a8  EFLAGS: 00010246
       RAX: ffffc9000174fab8 RBX: 0000000000000000 RCX: 000000001fffff56
       RDX: 0000000000000000 RSI: ffff8803231f5a08 RDI: ffffc90001750000
       RBP: ffffc9000174fa88 R08: ffffc9000174fab0 R09: ffff8803231f54b8
       R10: 0000000000000008 R11: 0000000000000001 R12: 0000000000000000
       R13: 0000000000000000 R14: 0000000000000003 R15: ffff8803231f54a0
       FS:  00007f3a611af640(0000) GS:ffff88033ed00000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: ffffc90001750000 CR3: 0000000325b20000 CR4: 00000000000406e0
       Stack:
        ffffffffa00bc60d 0000000000000008 ffffc90000000001 ffffc9000174faac
        0000000000000292 ffffffffa00c24e4 ffffffffa00c2914 0000000000000000
        0000000000000000 ffffffff00000003 ffff880331ae8ad0 0000000800000246
       Call Trace:
        [<ffffffffa00bc60d>] ? acpi_nfit_ctl+0x49d/0x750 [nfit]
        [<ffffffffa01f4fe0>] nfit_test_probe+0x670/0xb1b [nfit_test]
      
      Cc: <stable@vger.kernel.org>
      Fixes: 747ffe11 ("libnvdimm, tools/testing/nvdimm: fix 'ars_status' output buffer sizing")
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      efda1b5d
    • V
      acpi, nfit: fix extended status translations for ACPI DSMs · 9a901f54
      Vishal Verma 提交于
      ACPI DSMs can have an 'extended' status which can be non-zero to convey
      additional information about the command. In the xlat_status routine,
      where we translate the command statuses, we were returning an error for
      a non-zero extended status, even if the primary status indicated success.
      
      Return from each command's 'case' once we have verified both its status
      and extend status are good.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 11294d63 ("nfit: fail DSMs that return non-zero status by default")
      Signed-off-by: NVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      9a901f54
    • A
      ACPI / osl: Refactor acpi_os_get_root_pointer() to drop 'else':s · 2fb65f09
      Andy Shevchenko 提交于
      There are few 'else' keywords which are redundant in
      acpi_os_get_root_pointer(). Refactor function to get rid of them.
      
      While here, switch to pr_err() instead of printk(KERN_ERR ...).
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2fb65f09
    • A
      ACPI / osl: Propagate actual error code for kstrtoul() · 5dcb9ca8
      Andy Shevchenko 提交于
      There is no need to override the error code returned by kstrtoul().
      Propagate it directly to the caller.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5dcb9ca8
    • D
      PCI: Add MCFG quirks for X-Gene host controller · c5d46039
      Duc Dang 提交于
      PCIe controllers in X-Gene SoCs are not ECAM compliant: software needs to
      configure additional controller's register to address device at
      bus:dev:function.
      
      Add a quirk to discover controller MMIO register space and configure
      controller registers to select and address the target secondary device.
      
      The quirk will only be applied for X-Gene PCIe MCFG table with
      OEM revison 1, 2, 3 or 4 (PCIe controller v1 and v2 on X-Gene SoCs).
      Tested-by: NJon Masters <jcm@redhat.com>
      Signed-off-by: NDuc Dang <dhdang@apm.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      c5d46039
    • T
      PCI: Add MCFG quirks for Cavium ThunderX pass1.x host controller · 648d93fc
      Tomasz Nowicki 提交于
      ThunderX pass1.x requires to emulate the EA headers for on-chip devices
      hence it has to use custom pci_thunder_ecam_ops for accessing PCI config
      space (pci-thunder-ecam.c). Add new entries to MCFG quirk array where it
      can be applied while probing ACPI based PCI host controller.
      
      ThunderX pass1.x is using the same way for accessing off-chip devices
      (so-called PEM) as silicon pass-2.x so we need to add PEM quirk entries
      too.
      
      Quirk is considered for ThunderX silicon pass1.x only which is identified
      via MCFG revision 2.
      
      ThunderX pass 1.x requires the following accessors:
      
        NUMA node 0 PCI segments  0- 3: pci_thunder_ecam_ops (MCFG quirk)
        NUMA node 0 PCI segments  4- 9: thunder_pem_ecam_ops (MCFG quirk)
        NUMA node 1 PCI segments 10-13: pci_thunder_ecam_ops (MCFG quirk)
        NUMA node 1 PCI segments 14-19: thunder_pem_ecam_ops (MCFG quirk)
      
      [bhelgaas: change Makefile/ifdefs so quirk doesn't depend on
      CONFIG_PCI_HOST_THUNDER_ECAM]
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      648d93fc
    • T
      PCI: Add MCFG quirks for Cavium ThunderX pass2.x host controller · 44f22bd9
      Tomasz Nowicki 提交于
      ThunderX PCIe controller to off-chip devices (so-called PEM) is not fully
      compliant with ECAM standard. It uses non-standard configuration space
      accessors (see thunder_pem_ecam_ops) and custom configuration space
      granulation (see bus_shift = 24). In order to access configuration space
      and probe PEM as ACPI-based PCI host controller we need to add MCFG quirk
      infrastructure. This involves:
      1. A new thunder_pem_acpi_init() init function to locate PEM-specific
         register ranges using ACPI.
      2. Export PEM thunder_pem_ecam_ops structure so it is visible to MCFG quirk
         code.
      3. New quirk entries for each PEM segment. Each contains platform IDs,
         mentioned thunder_pem_ecam_ops and CFG resources.
      
      Quirk is considered for ThunderX silicon pass2.x only which is identified
      via MCFG revision 1.
      
      ThunderX pass 2.x requires the following accessors:
      
        NUMA Node 0 PCI segments  0- 3: pci_generic_ecam_ops (ECAM-compliant)
        NUMA Node 0 PCI segments  4- 9: thunder_pem_ecam_ops (MCFG quirk)
        NUMA Node 1 PCI segments 10-13: pci_generic_ecam_ops (ECAM-compliant)
        NUMA Node 1 PCI segments 14-19: thunder_pem_ecam_ops (MCFG quirk)
      
      [bhelgaas: adapt to use acpi_get_rc_resources(), update Makefile/ifdefs so
      quirk doesn't depend on CONFIG_PCI_HOST_THUNDER_PEM]
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      44f22bd9
    • D
      PCI: Add MCFG quirks for HiSilicon Hip05/06/07 host controllers · 5f00f1a0
      Dongdong Liu 提交于
      The PCIe controller in Hip05/Hip06/Hip07 SoCs is not completely
      ECAM-compliant.  It is non-ECAM only for the RC bus config space; for any
      other bus underneath the root bus it does support ECAM access.
      
      Add specific quirks for PCI config space accessors.  This involves:
      1. New initialization call hisi_pcie_init() to obtain RC base
      addresses from PNP0C02 at the root of the ACPI namespace (under \_SB).
      2. New entry in common quirk array.
      
      [bhelgaas: move to pcie-hisi.c and change Makefile/ifdefs so quirk doesn't
      depend on CONFIG_PCI_HISI]
      Signed-off-by: NDongdong Liu <liudongdong3@huawei.com>
      Signed-off-by: NGabriele Paoloni <gabriele.paoloni@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      5f00f1a0
    • C
      PCI: Add MCFG quirks for Qualcomm QDF2432 host controller · 2ca5b8dd
      Christopher Covington 提交于
      The Qualcomm Technologies QDF2432 SoC does not support accesses smaller
      than 32 bits to the PCI configuration space.  Register the appropriate
      quirk.
      
      [bhelgaas: add QCOM_ECAM32 macro, ifdef for ACPI and PCI_QUIRKS]
      Signed-off-by: NChristopher Covington <cov@codeaurora.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      2ca5b8dd
    • T
      PCI/ACPI: Check for platform-specific MCFG quirks · 5b69b85b
      Tomasz Nowicki 提交于
      The PCIe spec (r3.0, sec 7.2.2) specifies an "Enhanced Configuration Access
      Mechanism" (ECAM) for memory-mapped access to configuration space.  ECAM is
      required for PCIe systems unless there's a standard firmware interface for
      config access.
      
      In the absence of a firmware interface, we use pci_generic_ecam_ops, and on
      ACPI systems, we discover the ECAM space via the MCFG table and/or the _CBA
      method.
      
      Unfortunately some systems provide MCFG but don't implement ECAM according
      to spec, so we need a mechanism for quirks to make those systems work.
      
      Add an MCFG quirk mechanism to override the config accessor functions
      and/or the memory-mapped address space.
      
      A quirk is selected if it matches all of the following:
      
        - OEM ID
        - OEM Table ID
        - OEM Revision
        - PCI segment (from _SEG)
        - PCI bus number range (from _CRS, wildcard allowed)
      
      If the quirk specifies config accessor functions or a memory-mapped address
      range, these override the defaults.
      
      [bhelgaas: changelog, reorder quirk matching, fix oem_revision typo per
      Duc, add under #ifdef CONFIG_PCI_QUIRKS]
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Signed-off-by: NDongdong Liu <liudongdong3@huawei.com>
      Signed-off-by: NChristopher Covington <cov@codeaurora.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      5b69b85b
    • T
      PCI/ACPI: Extend pci_mcfg_lookup() to return ECAM config accessors · 13983eb8
      Tomasz Nowicki 提交于
      pci_mcfg_lookup() is the external interface to the generic MCFG code.
      Previously it merely looked up the ECAM base address for a given domain and
      bus range.  We want a way to add MCFG quirks, some of which may require
      special config accessors and adjustments to the ECAM address range.
      
      Extend pci_mcfg_lookup() so it can return a pointer to a pci_ecam_ops
      structure and a struct resource for the ECAM address space.  For now, it
      always returns &pci_generic_ecam_ops (the standard accessor) and the
      resource described by the MCFG.
      
      No functional changes intended.
      
      [bhelgaas: changelog]
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      13983eb8
  12. 06 12月, 2016 1 次提交
    • L
      ACPI/IORT: Make dma masks set-up IORT specific · 18b709be
      Lorenzo Pieralisi 提交于
      The introduction of acpi_dma_configure() allows to configure DMA
      and related IOMMU for any device that is DMA capable. To achieve
      that goal it ensures DMA masks are set-up to sane default values
      before proceeding with IOMMU and DMA ops configuration.
      
      On x86/ia64 systems, through acpi_bind_one(), acpi_dma_configure() is
      called for every device that has an ACPI companion, in that every device
      is considered DMA capable on x86/ia64 systems (ie acpi_get_dma_attr() API),
      which has the side effect of initializing dma masks also for
      pseudo-devices (eg CPUs and memory nodes) and potentially for devices
      whose dma masks were not set-up before the acpi_dma_configure() API was
      introduced, which may have noxious side effects.
      
      Therefore, in preparation for IORT firmware specific DMA masks set-up,
      wrap the default DMA masks set-up in acpi_dma_configure() inside an IORT
      specific wrapper that reverts to a NOP on x86/ia64 systems, restoring the
      default expected behaviour on x86/ia64 systems and keeping DMA default
      masks set-up on IORT based (ie ARM) arch configurations.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Tomasz Nowicki <tn@semihalf.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Sricharan R <sricharan@codeaurora.org>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      18b709be
  13. 02 12月, 2016 3 次提交
  14. 01 12月, 2016 6 次提交