1. 30 7月, 2018 1 次提交
    • S
      ata: ahci: Support state with min power but Partial low power state · a5ec5a7b
      Srinivas Pandruvada 提交于
      Currently when min_power policy is selected, the partial low power state
      is not entered and link will try aggressively enter to only slumber state.
      Add a new policy which still enable DEVSLP but also try to enter partial
      low power state. This policy is presented as "min_power_with_partial".
      
      For information the difference between partial and slumber
      Partial – PHY logic is powered up, and in a reduced power state. The link
      PM exit latency to active state maximum is 10 ns.
      Slumber – PHY logic is powered up, and in a reduced power state. The link
      PM exit latency to active state maximum is 10 ms.
      Devslp – PHY logic is powered down. The link PM exit latency from this
      state to active state maximum is 20 ms, unless otherwise specified by
      DETO.
      Suggested-and-reviewed-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      a5ec5a7b
  2. 12 7月, 2018 1 次提交
    • S
      libata: remove ata_sff_data_xfer_noirq() · 23ebda2f
      Sebastian Andrzej Siewior 提交于
      ata_sff_data_xfer_noirq() is invoked via the ->sff_data_xfer hook. The
      latter is invoked by ata_pio_sector(), atapi_send_cdb() and
      __atapi_pio_bytes() which in turn is invoked by ata_sff_hsm_move().
      The latter function requires that the "ap->lock" lock is held which
      needs to be taken with disabled interrupts.
      
      There is no need have to have ata_sff_data_xfer_noirq() which invokes
      ata_sff_data_xfer32() with disabled interrupts because at this point the
      interrupts are already disabled.
      Remove the function and its references to it and replace all callers
      with ata_sff_data_xfer32().
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      23ebda2f
  3. 29 5月, 2018 1 次提交
  4. 12 5月, 2018 4 次提交
  5. 19 4月, 2018 1 次提交
    • J
      scsi: libsas: add transport class for ATA devices · b6240a4d
      Jason Yan 提交于
      Now ata devices attached with sas controller do not have transport
      class, so that we can not see any information of these ata devices in
      /sys/class/ata_port(or ata_link or ata_device).
      
      Add transport class for the ata devices attached with sas controller.
      The /sys/class directory will show the infomation of the ata devices
      as follows:
      
      localhost:/sys/class # ls ata*
      ata_device:
      dev1.0  dev2.0
      
      ata_link:
      link1  link2
      
      ata_port:
      ata1  ata2
      
      No functional change of the device scanning and io path. The ata
      transport class was deleted when destroying the sas devices.
      Signed-off-by: NJason Yan <yanaijie@huawei.com>
      CC: Dan Williams <dan.j.williams@intel.com>
      CC: Tejun Heo <tj@kernel.org>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      b6240a4d
  6. 14 3月, 2018 1 次提交
    • T
      libata: add refcounting to ata_host · 2623c7a5
      Taras Kondratiuk 提交于
      After commit 9a6d6a2d ("ata: make ata port as parent device of scsi
      host") manual driver unbind/remove causes use-after-free.
      
      Unbind unconditionally invokes devres_release_all() which calls
      ata_host_release() and frees ata_host/ata_port memory while it is still
      being referenced as a parent of SCSI host. When SCSI host is finally
      released scsi_host_dev_release() calls put_device(parent) and accesses
      freed ata_port memory.
      
      Add reference counting to make sure that ata_host lives long enough.
      
      Bug report: https://lkml.org/lkml/2017/11/1/945
      Fixes: 9a6d6a2d ("ata: make ata port as parent device of scsi host")
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Lin Ming <minggr@gmail.com>
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NTaras Kondratiuk <takondra@cisco.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      2623c7a5
  7. 19 9月, 2017 1 次提交
    • H
      libata: Add new med_power_with_dipm link_power_management_policy setting · f4ac6476
      Hans de Goede 提交于
      As described by Matthew Garret quite a while back:
      https://mjg59.dreamwidth.org/34868.html
      
      Intel CPUs starting with the Haswell generation need SATA links to power
      down for the "package" part of the CPU to reach low power-states like
      PC7 / P8 which bring a significant power-saving with them.
      
      The default max_performance lpm policy does not allow for these high
      PC states, both the medium_power and min_power policies do allow this.
      
      The min_power policy saves significantly more power, but there are some
      reports of some disks / SSDs not liking min_power leading to system
      crashes and in some cases even data corruption has been reported.
      
      Matthew has found a document documenting the default settings of
      Intel's IRST Windows driver with which most laptops ship:
      https://www-ssl.intel.com/content/dam/doc/reference-guide/sata-devices-implementation-recommendations.pdf
      
      Matthew wrote a patch changing med_power to match those defaults, but
      that never got anywhere as some people where reporting issues with the
      patch-set that patch was a part of.
      
      This commit is another attempt to make the default IRST driver settings
      available under Linux, but instead of changing medium_power and
      potentially introducing regressions, this commit adds a new
      med_power_with_dipm setting which is identical to the existing
      medium_power accept that it enables dipm on top, which makes it match
      the Windows IRST driver settings, which should hopefully be safe to
      use on most devices.
      
      The med_power_with_dipm setting is close to min_power, except that:
      a) It does not use host-initiated slumber mode (ASP not set),
         but it does allow device-initiated slumber
      b) It does not enable DevSlp mode
      
      On my T440s test laptop I get the following power savings when idle:
      medium_power		0.9W
      med_power_with_dipm	1.2W
      min_power		1.2W
      Suggested-by: NMatthew Garrett <mjg59@srcf.ucam.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      f4ac6476
  8. 29 8月, 2017 2 次提交
  9. 11 7月, 2017 1 次提交
    • D
      libata: Cleanup ata_read_log_page() · 7cfdfdc8
      Damien Le Moal 提交于
      The warning message "READ LOG DMA EXT failed, trying unqueued" in
      ata_read_log_page() as well as the macro name ATA_HORKAGE_NO_NCQ_LOG
      are confusing: the command READ LOG DMA EXT is not an queued NCQ command
      unless it is encapsulated in a RECEIVE FPDMA QUEUED command.
      From ACS-4 READ LOG DMA EXT description:
      
      "The device processes the READ LOG DMA EXT command in the NCQ feature
      set environment (see 4.13.6) if the READ LOG DMA EXT command is
      encapsulated in a RECEIVE FPDMA QUEUED command (see 7.30) with the
      inputs encapsulated as shown in 7.23.6."
      
      To avoid confusion, fix the warning messsage to mention switching to PIO and
      not "unqueued" and rename the macro ATA_HORKAGE_NO_NCQ_LOG to
      ATA_HORKAGE_NO_DMA_LOG.
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      7cfdfdc8
  10. 06 6月, 2017 1 次提交
  11. 16 5月, 2017 2 次提交
  12. 07 2月, 2017 1 次提交
  13. 11 1月, 2017 1 次提交
  14. 20 10月, 2016 2 次提交
  15. 22 9月, 2016 1 次提交
  16. 19 7月, 2016 3 次提交
  17. 15 7月, 2016 1 次提交
  18. 14 7月, 2016 1 次提交
  19. 10 5月, 2016 5 次提交
  20. 05 4月, 2016 1 次提交
  21. 26 2月, 2016 1 次提交
    • H
      libata: Align ata_device's id on a cacheline · 4ee34ea3
      Harvey Hunt 提交于
      The id buffer in ata_device is a DMA target, but it isn't explicitly
      cacheline aligned. Due to this, adjacent fields can be overwritten with
      stale data from memory on non coherent architectures. As a result, the
      kernel is sometimes unable to communicate with an ATA device.
      
      Fix this by ensuring that the id buffer is cacheline aligned.
      
      This issue is similar to that fixed by Commit 84bda12a
      ("libata: align ap->sector_buf").
      Signed-off-by: NHarvey Hunt <harvey.hunt@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: <stable@vger.kernel.org> # 2.6.18
      Signed-off-by: NTejun Heo <tj@kernel.org>
      4ee34ea3
  22. 26 1月, 2016 1 次提交
    • D
      drivers: ata: wake port before DMA stop for ALPM · fb329633
      Danesh Petigara 提交于
      The AHCI driver code stops and starts port DMA engines at will
      without considering the power state of the particular port. The
      AHCI specification isn't very clear on how to handle this scenario,
      leaving implementation open to interpretation.
      
      Broadcom's STB SATA host controller is unable to handle port DMA
      controller restarts when the port in question is in low power mode.
      When a port enters partial or slumber mode, its PHY is powered down.
      When a controller restart is requested, the controller's internal
      state machine expects the PHY to be brought back up by software which
      never happens in this case, resulting in failures.
      
      To avoid this situation, logic is added to manually wake up the port
      just before its DMA engine is stopped, if the port happens to be in
      a low power state. HBA initiated power management ensures that the port
      eventually returns to its configured low power state, when the link is
      idle (as per the conditions listed in the spec). A new host flag is also
      added to ensure this logic is only exercised for hosts with the above
      limitation.
      
      tj: Formatting changes.
      Signed-off-by: NDanesh Petigara <dpetigara@broadcom.com>
      Reviewed-by: NMarkus Mayer <mmayer@broadcom.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      fb329633
  23. 09 1月, 2016 1 次提交
  24. 07 12月, 2015 1 次提交
  25. 01 10月, 2015 1 次提交
    • M
      ata: ahci: find eSATA ports and flag them as removable · 8a3e33cf
      Manuel Lauss 提交于
      If the AHCI ports' HPCP or ESP bits are set, the port
      should be considered external (e.g. eSATA) and is marked
      as removable.  Userspace tools like udisks then treat it
      like an usb drive.
      
      With this patch applied, when I plug a drive into the esata port,
      KDE pops up a window asking what to do with the drives(s), just
      like it does for any random USB stick.
      
      Removability is indicated to the upper layers by way of the
      SCSI RMB bit, as I haven't found another way to signal
      userspace to treat a sata disk like any usb stick.
      Signed-off-by: NManuel Lauss <manuel.lauss@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      8a3e33cf
  26. 15 7月, 2015 2 次提交
  27. 01 6月, 2015 1 次提交