1. 16 10月, 2019 1 次提交
  2. 31 8月, 2019 1 次提交
    • D
      libata/ahci: Drop PCS quirk for Denverton and beyond · c312ef17
      Dan Williams 提交于
      The Linux ahci driver has historically implemented a configuration fixup
      for platforms / platform-firmware that fails to enable the ports prior
      to OS hand-off at boot. The fixup was originally implemented way back
      before ahci moved from drivers/scsi/ to drivers/ata/, and was updated in
      2007 via commit 49f29090 "ahci: update PCS programming". The quirk
      sets a port-enable bitmap in the PCS register at offset 0x92.
      
      This quirk could be applied generically up until the arrival of the
      Denverton (DNV) platform. The DNV AHCI controller architecture supports
      more than 6 ports and along with that the PCS register location and
      format were updated to allow for more possible ports in the bitmap. DNV
      AHCI expands the register to 32-bits and moves it to offset 0x94.
      
      As it stands there are no known problem reports with existing Linux
      trying to set bits at offset 0x92 which indicates that the quirk is not
      applicable. Likely it is not applicable on a wider range of platforms,
      but it is difficult to discern which platforms if any still depend on
      the quirk.
      
      Rather than try to fix the PCS quirk to consider the DNV register layout
      instead require explicit opt-in. The assumption is that the OS driver
      need not touch this register, and platforms can be added with a new
      boad_ahci_pcs7 board-id when / if problematic platforms are found in the
      future. The logic in ahci_intel_pcs_quirk() looks for all Intel AHCI
      instances with "legacy" board-ids and otherwise skips the quirk if the
      board was matched by class-code.
      Reported-by: NStephen Douthit <stephend@silicom-usa.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Reviewed-by: NStephen Douthit <stephend@silicom-usa.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      c312ef17
  3. 27 8月, 2019 1 次提交
  4. 21 5月, 2019 1 次提交
  5. 30 7月, 2018 1 次提交
    • S
      ata: ahci: Enable DEVSLP by default on x86 with SLP_S0 · b1a9585c
      Srinivas Pandruvada 提交于
      One of the requirement for modern x86 system to enter lowest power mode
      (SLP_S0) is SATA IP block to be off. This is true even during when
      platform is suspended to idle and not only in opportunistic (runtime)
      suspend.
      
      Several of these system don't have traditional ACPI S3, so it is
      important that they enter SLP_S0 state, to avoid draining battery even
      during suspend. So it is important that out of the box Linux installation
      reach this state.
      
      SATA IP block doesn't get turned off till SATA is in DEVSLP mode. Here
      user has to either use scsi-host sysfs or tools like powertop to set
      the sata-host link_power_management_policy to min_power.
      
      This change sets by default link power management policy to min_power
      with partial (preferred) or slumber support on idle for some platforms.
      
      To avoid regressions, the following conditions are used:
      - User didn't override the policy from module parameter
      - The kernel config is already set to use med_power_with_dipm or deeper
      - System is a SLP_S0 capable using ACPI low power idle flag
      This combination will make sure that systems are fairly recent and
      since getting shipped with SLP_S0 support, the DEVSLP function
      is already validated.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Reviewed-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      b1a9585c
  6. 02 7月, 2018 2 次提交
    • M
      ahci: Add Intel Ice Lake LP PCI ID · ba445791
      Mika Westerberg 提交于
      This should also be using the default LPM policy for mobile chipsets so
      add the PCI ID to the driver list of supported devices.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      ba445791
    • H
      ahci: Disable LPM on Lenovo 50 series laptops with a too old BIOS · 240630e6
      Hans de Goede 提交于
      There have been several reports of LPM related hard freezes about once
      a day on multiple Lenovo 50 series models. Strange enough these reports
      where not disk model specific as LPM issues usually are and some users
      with the exact same disk + laptop where seeing them while other users
      where not seeing these issues.
      
      It turns out that enabling LPM triggers a firmware bug somewhere, which
      has been fixed in later BIOS versions.
      
      This commit adds a new ahci_broken_lpm() function and a new ATA_FLAG_NO_LPM
      for dealing with this.
      
      The ahci_broken_lpm() function contains DMI match info for the 4 models
      which are known to be affected by this and the DMI BIOS date field for
      known good BIOS versions. If the BIOS date is older then the one in the
      table LPM will be disabled and a warning will be printed.
      
      Note the BIOS dates are for known good versions, some older versions may
      work too, but we don't know for sure, the table is using dates from BIOS
      versions for which users have confirmed that upgrading to that version
      makes the problem go away.
      
      Unfortunately I've been unable to get hold of the reporter who reported
      that BIOS version 2.35 fixed the problems on the W541 for him. I've been
      able to verify the DMI_SYS_VENDOR and DMI_PRODUCT_VERSION from an older
      dmidecode, but I don't know the exact BIOS date as reported in the DMI.
      Lenovo keeps a changelog with dates in their release notes, but the
      dates there are the release dates not the build dates which are in DMI.
      So I've chosen to set the date to which we compare to one day past the
      release date of the 2.34 BIOS. I plan to fix this with a follow up
      commit once I've the necessary info.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      240630e6
  7. 24 5月, 2018 1 次提交
  8. 27 4月, 2018 1 次提交
    • E
      libahci: Allow drivers to override stop_engine · fa89f53b
      Evan Wang 提交于
      Marvell armada37xx, armada7k and armada8k share the same
      AHCI sata controller IP, and currently there is an issue
      (Errata Ref#226)that the SATA can not be detected via SATA
      Port-MultiPlayer(PMP). After debugging, the reason is
      found that the value of Port-x FIS-based Switching Control
      (PxFBS@0x40) became wrong.
      According to design, the bits[11:8, 0] of register PxFBS
      are cleared when Port Command and Status (0x18) bit[0]
      changes its value from 1 to 0, i.e. falling edge of Port
      Command and Status bit[0] sends PULSE that resets PxFBS
      bits[11:8; 0].
      So it needs save the port PxFBS register before PxCMD
      ST write and restore the port PxFBS register afterwards
      in ahci_stop_engine().
      
      This commit allows drivers to override ahci_stop_engine
      behavior for use by the Marvell AHCI driver(and potentially
      other drivers in the future).
      Signed-off-by: NEvan Wang <xswang@marvell.com>
      Cc: Ofer Heifetz <oferh@marvell.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      fa89f53b
  9. 05 3月, 2018 1 次提交
  10. 12 1月, 2018 1 次提交
  11. 12 12月, 2017 1 次提交
    • H
      ahci: Allow setting a default LPM policy for mobile chipsets · ebb82e3c
      Hans de Goede 提交于
      On many laptops setting a different LPM policy then unknown /
      max_performance can lead to power-savings of 1.0 - 1.5 Watts (when idle).
      
      Modern ultrabooks idle around 6W (at 50% screen brightness), 1.0 - 1.5W
      is a significant chunk of this.
      
      There are some performance / latency costs to enabling LPM by default,
      so it is desirable to make it possible to set a different LPM policy
      for mobile / laptop variants of chipsets / "South Bridges" vs their
      desktop / server counterparts. Also enabling LPM by default is not
      entirely without risk of regressions. At least min_power is known to
      cause issues with some disks, including some reports of data corruption.
      
      This commits adds a new ahci.mobile_lpm_policy kernel cmdline option,
      which defaults to a new SATA_MOBILE_LPM_POLICY Kconfig option so that
      Linux distributions can choose to set a LPM policy for mobile chipsets
      by default.
      
      The reason to have both a kernel cmdline option and a Kconfig default
      value for it, is to allow easy overriding of the default to allow
      trouble-shooting without needing to rebuild the kernel.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      ebb82e3c
  12. 11 12月, 2017 2 次提交
  13. 11 10月, 2017 1 次提交
  14. 03 10月, 2017 1 次提交
    • A
      ahci: don't ignore result code of ahci_reset_controller() · d312fefe
      Ard Biesheuvel 提交于
      ahci_pci_reset_controller() calls ahci_reset_controller(), which may
      fail, but ignores the result code and always returns success. This
      may result in failures like below
      
        ahci 0000:02:00.0: version 3.0
        ahci 0000:02:00.0: enabling device (0000 -> 0003)
        ahci 0000:02:00.0: SSS flag set, parallel bus scan disabled
        ahci 0000:02:00.0: controller reset failed (0xffffffff)
        ahci 0000:02:00.0: failed to stop engine (-5)
          ... repeated many times ...
        ahci 0000:02:00.0: failed to stop engine (-5)
        Unable to handle kernel paging request at virtual address ffff0000093f9018
          ...
        PC is at ahci_stop_engine+0x5c/0xd8 [libahci]
        LR is at ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
          ...
        [<ffff000000a17014>] ahci_stop_engine+0x5c/0xd8 [libahci]
        [<ffff000000a196b4>] ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
        [<ffff000000a197d8>] ahci_init_controller+0x80/0x168 [libahci]
        [<ffff000000a260f8>] ahci_pci_init_controller+0x60/0x68 [ahci]
        [<ffff000000a26f94>] ahci_init_one+0x75c/0xd88 [ahci]
        [<ffff000008430324>] local_pci_probe+0x3c/0xb8
        [<ffff000008431728>] pci_device_probe+0x138/0x170
        [<ffff000008585e54>] driver_probe_device+0x2dc/0x458
        [<ffff0000085860e4>] __driver_attach+0x114/0x118
        [<ffff000008583ca8>] bus_for_each_dev+0x60/0xa0
        [<ffff000008585638>] driver_attach+0x20/0x28
        [<ffff0000085850b0>] bus_add_driver+0x1f0/0x2a8
        [<ffff000008586ae0>] driver_register+0x60/0xf8
        [<ffff00000842f9b4>] __pci_register_driver+0x3c/0x48
        [<ffff000000a3001c>] ahci_pci_driver_init+0x1c/0x1000 [ahci]
        [<ffff000008083918>] do_one_initcall+0x38/0x120
      
      where an obvious hardware level failure results in an unnecessary 15 second
      delay and a subsequent crash.
      
      So record the result code of ahci_reset_controller() and relay it, rather
      than ignoring it.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      d312fefe
  15. 06 9月, 2017 1 次提交
  16. 27 6月, 2017 1 次提交
  17. 16 5月, 2017 3 次提交
  18. 06 12月, 2016 1 次提交
    • C
      ahci: warn about remapped NVMe devices · aecec8b6
      Christoph Hellwig 提交于
      Some Intel ahci implementations have a completely broken remapping mode
      where they hide one or more NVMe devices behind the bar of an AHCI device.
      
      Intel refuses to let the OS reprogram the BIOS to switch out of this
      mode at runtime, and so far we're not come up with another good way
      to undo the mess that the Chipset people created.  So for now the only
      thing we can do is to alert users about this situation and switch to the
      faster and much saner so called "AHCI" mode insted of the RAID mode in
      the BIOS so that the BIOS does not hide the NVMe devices from us.
      
      The sitation is even worse as at least one vendor (thanks a lot Lenovo..)
      has started hardcoding their BIOS into the "RAID" mode even for laptops
      that don't use AHCI _at all_ and just have a single NVMe device.  For now
      there is an unspported Linux-only BIOS that undoes this braindamage,
      but we'll have to see if things are getting better or worse from here.
      
      Based on an earlier patch from Dan Williams <dan.j.williams@intel.com>.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      aecec8b6
  19. 22 11月, 2016 1 次提交
  20. 25 10月, 2016 1 次提交
  21. 21 10月, 2016 1 次提交
  22. 20 10月, 2016 1 次提交
  23. 07 9月, 2016 1 次提交
    • C
      ahci: use pci_alloc_irq_vectors · 0b9e2988
      Christoph Hellwig 提交于
      Use the new pci_alloc_irq_vectors API to allocate MSI-X and MSI vectors.
      The big advantage over the old code is that we can use the same API for
      MSI and MSI-X, and that we don't need to store the MSI-X vector mapping
      in driver-private data structures.
      
      This first conversion keeps the probe order as-is: MSI-X multi vector,
      MSI multi vector, MSI single vector, MSI-X single vector and last a
      single least legacy interrupt line.  There is one small change of
      behavior: we now check the "MSI Revert to Single Message" flag for
      MSI-X in addition to MSI.
      
      Because the API to find the Linux IRQ number for a MSI/MSI-X vector
      is PCI specific, but libahaci is bus-agnostic I had to a
      get_irq_vector function pointer to struct ahci_host_priv.  The
      alternative would be to move the multi-vector case of ahci_host_activate
      to ahci.c and just call ata_host_activate directly from the others
      users of ahci_host_activate.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      0b9e2988
  24. 27 5月, 2016 1 次提交
  25. 12 3月, 2016 1 次提交
  26. 01 3月, 2016 1 次提交
  27. 19 2月, 2016 3 次提交
  28. 11 2月, 2016 1 次提交
  29. 17 11月, 2015 3 次提交
  30. 04 11月, 2015 1 次提交
  31. 31 10月, 2015 1 次提交
  32. 25 8月, 2015 1 次提交
    • Z
      PCI: Disable async suspend/resume for JMicron multi-function SATA/AHCI · 91f15fb3
      Zhang Rui 提交于
      On multi-function JMicron SATA/PATA/AHCI devices, the PATA controller at
      function 1 doesn't work if it is powered on before the SATA controller at
      function 0.  The result is that PATA doesn't work after resume, and we
      print messages like this:
      
        pata_jmicron 0000:02:00.1: Refused to change power state, currently in D3
        irq 17: nobody cared (try booting with the "irqpoll" option)
      
      Async resume was introduced in v3.15 by 76569faa ("PM / sleep:
      Asynchronous threads for resume_noirq").  Prior to that, we powered on
      the functions in order, so this problem shouldn't happen.
      
      e6b7e41c ("ata: Disabling the async PM for JMicron chip 363/361")
      solved the problem for JMicron 361 and 363 devices.  With async suspend
      disabled, we always power on function 0 before function 1.
      
      Barto then reported the same problem with a JMicron 368 (see comment #57 in
      the bugzilla).
      
      Rather than extending the blacklist piecemeal, disable async suspend for
      all JMicron multi-function SATA/PATA/AHCI devices.
      
      This quirk could stay in the ahci and pata_jmicron drivers, but it's likely
      the problem will occur even if pata_jmicron isn't loaded until after the
      suspend/resume.  Making it a PCI quirk ensures that we'll preserve the
      power-on order even if the drivers aren't loaded.
      
      [bhelgaas: changelog, limit to multi-function, limit to IDE/ATA]
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=81551Reported-and-tested-by: NBarto <mister.freeman@laposte.net>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: stable@vger.kernel.org	# v3.15+
      91f15fb3