1. 26 8月, 2015 14 次提交
  2. 24 7月, 2015 19 次提交
  3. 11 7月, 2015 2 次提交
  4. 10 7月, 2015 1 次提交
    • J
      ACPI / PCI: Fix regressions caused by resource_size_t overflow with 32-bit kernel · 1fb01ca9
      Jiang Liu 提交于
      Zoltan Boszormenyi reported this regression:
        "There's a Realtek RTL8111/8168/8411 (PCI ID 10ec:8168, Subsystem ID
         1565:230e) network chip on the mainboard. After the r8169 driver loaded
         the IRQs in the machine went berserk. Keyboard keypressed arrived with
         considerable latency and duplicated, so no real work was possible.
         The machine responded to the power button but didn't actually power
         down. It just stuck at the powering down message. I had to press the
         power button for 4 seconds to power it down.
      
         The computer is a POS machine with a big battery inside. Because of this,
         either ACPI or the Realtek chip kept the bad state and after rebooting,
         the network chip didn't even show up in lspci. Not even the PXE ROM
         announced itself during boot. I had to disconnect the battery to beat
         some sense back to the computer.
      
         The regression happens with 4.0.5, 4.1.0-rc8 and 4.1.0-final. 3.18.16 was
         good."
      
      The regression is caused by commit 593669c2 (x86/PCI/ACPI: Use common
      ACPI resource interfaces to simplify implementation). Since commit
      593669c2, x86 PCI ACPI host bridge driver validates ACPI resources by
      first converting an ACPI resource to a 'struct resource' structure and
      then applying checks against the converted resource structure. The 'start'
      and 'end' fields in 'struct resource' are defined to be type of
      resource_size_t, which may be 32 bits or 64 bits depending on
      CONFIG_PHYS_ADDR_T_64BIT.
      
      This may cause incorrect resource validation results with 32-bit kernels
      because 64-bit ACPI resource descriptors may get truncated when converting
      to 32-bit 'start' and 'end' fields in 'struct resource'. It eventually
      affects PCI resource allocation subsystem and makes some PCI devices and
      the system behave abnormally due to incorrect resource assignment.
      
      So enhance the ACPI resource parsing interfaces to ignore ACPI resource
      descriptors with address/offset above 4G when running in 32-bit mode.
      
      With the fix applied, the behavior of the machine was restored to how
      3.18.16 worked, i.e. the memory range that is over 4GB is ignored again,
      and lspci -vvxxx shows that everything is at the same memory window as
      they were with 3.18.16.
      Reported-and-tested-by: NBoszormenyi Zoltan <zboszor@pr.hu>
      Fixes: 593669c2 (x86/PCI/ACPI: Use common ACPI resource interfaces to simplify implementation)
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: 4.0+ <stable@vger.kernel.org> # 4.0+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1fb01ca9
  5. 07 7月, 2015 3 次提交
    • S
      ACPI / scan: Add support for ACPI _CLS device matching · 26095a01
      Suthikulpanit, Suravee 提交于
      Device drivers typically use ACPI _HIDs/_CIDs listed in struct device_driver
      acpi_match_table to match devices. However, for generic drivers, we do not
      want to list _HID for all supported devices. Also, certain classes of devices
      do not have _CID (e.g. SATA, USB). Instead, we can leverage ACPI _CLS,
      which specifies PCI-defined class code (i.e. base-class, subclass and
      programming interface). This patch adds support for matching ACPI devices using
      the _CLS method.
      
      To support loadable module, current design uses _HID or _CID to match device's
      modalias. With the new way of matching with _CLS this would requires modification
      to the current ACPI modalias key to include _CLS. This patch appends PCI-defined
      class-code to the existing ACPI modalias as following.
      
          acpi:<HID>:<CID1>:<CID2>:..:<CIDn>:<bbsspp>:
      E.g:
          # cat /sys/devices/platform/AMDI0600:00/modalias
          acpi:AMDI0600:010601:
      
      where bb is th base-class code, ss is te sub-class code, and pp is the
      programming interface code
      
      Since there would not be _HID/_CID in the ACPI matching table of the driver,
      this patch adds a field to acpi_device_id to specify the matching _CLS.
      
          static const struct acpi_device_id ahci_acpi_match[] = {
              { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) },
              {},
          };
      
      In this case, the corresponded entry in modules.alias file would be:
      
          alias acpi*:010601:* ahci_platform
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      26095a01
    • R
      ACPI / LPSS: Fix up acpi_lpss_create_device() · d3e13ff3
      Rafael J. Wysocki 提交于
      Fix a return value (which should be a negative error code) and a
      memory leak (the list allocated by acpi_dev_get_resources() needs
      to be freed on ioremap() errors too) in acpi_lpss_create_device()
      introduced by commit 4483d59e 'ACPI / LPSS: check the result
      of ioremap()'.
      
      Fixes: 4483d59e 'ACPI / LPSS: check the result of ioremap()'
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: 4.0+ <stable@vger.kernel.org> # 4.0+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d3e13ff3
    • R
      ACPI / PNP: Reserve ACPI resources at the fs_initcall_sync stage · 0294112e
      Rafael J. Wysocki 提交于
      This effectively reverts the following three commits:
      
       7bc10388 ACPI / resources: free memory on error in add_region_before()
       0f1b414d ACPI / PNP: Avoid conflicting resource reservations
       b9a5e5e1 ACPI / init: Fix the ordering of acpi_reserve_resources()
      
      (commit b9a5e5e1 introduced regressions some of which, but not
      all, were addressed by commit 0f1b414d and commit 7bc10388
      was a fixup on top of the latter) and causes ACPI fixed hardware
      resources to be reserved at the fs_initcall_sync stage of system
      initialization.
      
      The story is as follows.  First, a boot regression was reported due
      to an apparent resource reservation ordering change after a commit
      that shouldn't lead to such changes.  Investigation led to the
      conclusion that the problem happened because acpi_reserve_resources()
      was executed at the device_initcall() stage of system initialization
      which wasn't strictly ordered with respect to driver initialization
      (and with respect to the initialization of the pcieport driver in
      particular), so a random change causing the device initcalls to be
      run in a different order might break things.
      
      The response to that was to attempt to run acpi_reserve_resources()
      as soon as we knew that ACPI would be in use (commit b9a5e5e1).
      However, that turned out to be too early, because it caused resource
      reservations made by the PNP system driver to fail on at least one
      system and that failure was addressed by commit 0f1b414d.
      
      That fix still turned out to be insufficient, though, because
      calling acpi_reserve_resources() before the fs_initcall stage of
      system initialization caused a boot regression to happen on the
      eCAFE EC-800-H20G/S netbook.  That meant that we only could call
      acpi_reserve_resources() at the fs_initcall initialization stage
      or later, but then we might just as well call it after the PNP
      initalization in which case commit 0f1b414d wouldn't be
      necessary any more.
      
      For this reason, the changes made by commit 0f1b414d are reverted
      (along with a memory leak fixup on top of that commit), the changes
      made by commit b9a5e5e1 that went too far are reverted too and
      acpi_reserve_resources() is changed into fs_initcall_sync, which
      will cause it to be executed after the PNP subsystem initialization
      (which is an fs_initcall) and before device initcalls (including
      the pcieport driver initialization) which should avoid the initial
      issue.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=100581
      Link: http://marc.info/?t=143092384600002&r=1&w=2
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=99831
      Link: http://marc.info/?t=143389402600001&r=1&w=2
      Fixes: b9a5e5e1 "ACPI / init: Fix the ordering of acpi_reserve_resources()"
      Reported-by: NRoland Dreier <roland@purestorage.com>
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0294112e
  6. 03 7月, 2015 1 次提交