1. 19 2月, 2016 2 次提交
  2. 11 2月, 2016 2 次提交
  3. 26 1月, 2016 2 次提交
    • T
      libata: disable forced PORTS_IMPL for >= AHCI 1.3 · 566d1827
      Tejun Heo 提交于
      Some early controllers incorrectly reported zero ports in PORTS_IMPL
      register and the ahci driver fabricates PORTS_IMPL from the number of
      ports in those cases.  This hasn't mattered but with the new nvme
      controllers there are cases where zero PORTS_IMPL is valid and should
      be honored.
      
      Disable the workaround for >= AHCI 1.3.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NAndy Lutomirski <luto@amacapital.net>
      Link: http://lkml.kernel.org/g/CALCETrU7yMvXEDhjAUShoHEhDwifJGapdw--BKxsP0jmjKGmRw@mail.gmail.com
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Cc: stable@vger.kernel.org
      566d1827
    • 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
  4. 07 12月, 2015 1 次提交
  5. 30 11月, 2015 1 次提交
    • X
      AHCI: Fix softreset failed issue of Port Multiplier · 023113d2
      Xiangliang Yu 提交于
      Current code doesn't update port value of Port Multiplier(PM) when
      sending FIS of softreset to device, command will fail if FBS is
      enabled.
      
      There are two ways to fix the issue: the first is to disable FBS
      before sending softreset command to PM device and the second is
      to update port value of PM when sending command.
      
      For the first way, i can't find any related rule in AHCI Spec. The
      second way can avoid disabling FBS and has better performance.
      Signed-off-by: NXiangliang Yu <Xiangliang.Yu@amd.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      023113d2
  6. 17 11月, 2015 2 次提交
  7. 31 10月, 2015 2 次提交
  8. 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
  9. 03 6月, 2015 1 次提交
    • R
      ahci: Store irq number in struct ahci_host_priv · 21bfd1aa
      Robert Richter 提交于
      Currently, ahci supports only msi and intx. To also support msix the
      handling of the irq number need to be changed. The irq number for msix
      devices is taken from msi_list instead of pci_dev. Thus, the irq
      number of a device needs to be stored in struct ahci_host_priv now.
      This allows the host controller to be activated in a generic way.
      
      This change is only intended for ahci drivers. For that reason the irq
      number is stored in struct ahci_host_priv used only by ahci drivers.
      Thus, the ABI changes only for ahci_host_activate(), but existing ata
      drivers (about 50) are unaffected and keep unchanged. All users of
      ahci_host_activate() have been updated.
      
      While touching drivers/ata/libahci.c, doing a small code cleanup in
      ahci_port_start().
      Signed-off-by: NRobert Richter <rrichter@cavium.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      21bfd1aa
  10. 10 5月, 2015 2 次提交
  11. 26 4月, 2015 1 次提交
  12. 10 1月, 2015 1 次提交
  13. 28 10月, 2014 2 次提交
  14. 06 10月, 2014 6 次提交
  15. 31 7月, 2014 1 次提交
  16. 08 7月, 2014 1 次提交
  17. 15 5月, 2014 1 次提交
  18. 24 4月, 2014 1 次提交
  19. 27 3月, 2014 1 次提交
  20. 23 2月, 2014 1 次提交
    • H
      libahci: Allow drivers to override start_engine · 039ece38
      Hans de Goede 提交于
      Allwinner A10 and A20 ARM SoCs have an AHCI sata controller which needs a
      special register to be poked before starting the DMA engine.
      
      This register gets reset on an ahci_stop_engine call, so there is no other
      place then ahci_start_engine where this poking can be done.
      
      This commit allows drivers to override ahci_start_engine behavior for use by
      the Allwinner AHCI driver (and potentially other drivers in the future).
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      039ece38
  21. 20 2月, 2014 2 次提交
  22. 14 2月, 2014 1 次提交
  23. 15 12月, 2013 1 次提交
  24. 27 10月, 2013 1 次提交
    • X
      ahci: disabled FBS prior to issuing software reset · 89dafa20
      xiangliang yu 提交于
      Tested with Marvell 88se9125, attached with one port mulitplier(5 ports)
      and one disk, we will get following boot log messages if using current
      code:
      
        ata8: SATA link up 6.0 Gbps (SStatus 133 SControl 330)
        ata8.15: Port Multiplier 1.2, 0x1b4b:0x9715 r160, 5 ports, feat 0x1/0x1f
        ahci 0000:03:00.0: FBS is enabled
        ata8.00: hard resetting link
        ata8.00: SATA link down (SStatus 0 SControl 330)
        ata8.01: hard resetting link
        ata8.01: SATA link down (SStatus 0 SControl 330)
        ata8.02: hard resetting link
        ata8.02: SATA link down (SStatus 0 SControl 330)
        ata8.03: hard resetting link
        ata8.03: SATA link up 6.0 Gbps (SStatus 133 SControl 133)
        ata8.04: hard resetting link
        ata8.04: failed to resume link (SControl 133)
        ata8.04: failed to read SCR 0 (Emask=0x40)
        ata8.04: failed to read SCR 0 (Emask=0x40)
        ata8.04: failed to read SCR 1 (Emask=0x40)
        ata8.04: failed to read SCR 0 (Emask=0x40)
        ata8.03: native sectors (2) is smaller than sectors (976773168)
        ata8.03: ATA-8: ST3500413AS, JC4B, max UDMA/133
        ata8.03: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32)
        ata8.03: configured for UDMA/133
        ata8.04: failed to IDENTIFY (I/O error, err_mask=0x100)
        ata8.15: hard resetting link
        ata8.15: SATA link up 6.0 Gbps (SStatus 133 SControl 330)
        ata8.15: Port Multiplier vendor mismatch '0x1b4b' != '0x133'
        ata8.15: PMP revalidation failed (errno=-19)
        ata8.15: hard resetting link
        ata8.15: SATA link up 6.0 Gbps (SStatus 133 SControl 330)
        ata8.15: Port Multiplier vendor mismatch '0x1b4b' != '0x133'
        ata8.15: PMP revalidation failed (errno=-19)
        ata8.15: limiting SATA link speed to 3.0 Gbps
        ata8.15: hard resetting link
        ata8.15: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
        ata8.15: Port Multiplier vendor mismatch '0x1b4b' != '0x133'
        ata8.15: PMP revalidation failed (errno=-19)
        ata8.15: failed to recover PMP after 5 tries, giving up
        ata8.15: Port Multiplier detaching
        ata8.03: disabled
        ata8.00: disabled
        ata8: EH complete
      
      The reason is that current detection code doesn't follow AHCI spec:
      
      First,the port multiplier detection process look like this:
      
      	ahci_hardreset(link, class, deadline)
      	if (class == ATA_DEV_PMP) {
      		sata_pmp_attach(dev)	/* will enable FBS */
      		sata_pmp_init_links(ap, nr_ports);
      		ata_for_each_link(link, ap, EDGE) {
      			sata_std_hardreset(link, class, deadline);
      			if (link_is_online)	/* do soft reset */
      				ahci_softreset(link, class, deadline);
      		}
      	}
      But, according to chapter 9.3.9 in AHCI spec: Prior to issuing software
      reset, software shall clear PxCMD.ST to '0' and then clear PxFBS.EN to
      '0'.
      
      The patch test ok with kernel 3.11.1.
      
      tj: Patch white space contaminated, applied manually with trivial
          updates.
      Signed-off-by: NXiangliang Yu <yuxiangl@marvell.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      89dafa20
  25. 15 10月, 2013 2 次提交
    • L
      libahci: fix turning on LEDs in ahci_start_port() · fa070ee6
      Lukasz Dorau 提交于
      If EM Transmit bit is busy during init ata_msleep() is called.  It is
      wrong - msleep() should be used instead of ata_msleep(), because if EM
      Transmit bit is busy for one port, it will be busy for all other ports
      too, so using ata_msleep() causes wasting tries for another ports.
      
      The most common scenario looks like that now
      (six ports try to transmit a LED meaasege):
      - port #0 tries for the 1st time and succeeds
      - ports #1-5 try for the 1st time and sleeps
      - port #1 tries for the 2nd time and succeeds
      - ports #2-5 try for the 2nd time and sleeps
      - port #2 tries for the 3rd time and succeeds
      - ports #3-5 try for the 3rd time and sleeps
      - port #3 tries for the 4th time and succeeds
      - ports #4-5 try for the 4th time and sleeps
      - port #4 tries for the 5th time and succeeds
      - port #5 tries for the 5th time and sleeps
      
      At this moment port #5 wasted all its five tries and failed to
      initialize.  Because there are only 5 (EM_MAX_RETRY) tries available
      usually only five ports succeed to initialize. The sixth port and next
      ones usually will fail.
      
      If msleep() is used instead of ata_msleep() the first port succeeds to
      initialize in the first try and next ones usually succeed to
      initialize in the second try.
      
      tj: updated comment
      Signed-off-by: NLukasz Dorau <lukasz.dorau@intel.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      fa070ee6
    • R
      ahci: imx: setup power saving methods · 8b789d89
      Richard Zhu 提交于
      In order to save power consumption as much as possible.
      
      * Disable sata phy internal pll reference clock when sysetem enter
        into suspend mode, enable it after resume.
      
      * Setup module parameter used to enable imx ahci test power down
        mode(PDDQ) or not, when there is no device detected on the port
      
      * minor modifications:
        - The format of the copyright is changed, because that the original
          one can't pass fsl internal patch reivew without the character
          '(c)'.
        - Exports ahci_platform_ops and ahci_error_handler().
      
      NOTE:
      * The hot-plug can't be supported when PDDQ mode is ever enabled.
      
      * module parameter usage how-to:
        - default: enable PDDQ mode when no device detected.
        - add "ahci-imx.hotplug=1" into kernel command line if your don't
          want to enable PDDQ mode when no device detected on the port.
      
      tj: Slightly updated description and comments.
      Signed-off-by: NRichard Zhu <r65037@freescale.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      8b789d89
  26. 23 9月, 2013 1 次提交