Commit 6cd8adc3 authored by Conrad Kostecki's avatar Conrad Kostecki Committed by Niklas Cassel

ahci: asm1064: asm1166: don't limit reported ports

Previously, patches have been added to limit the reported count of SATA
ports for asm1064 and asm1166 SATA controllers, as those controllers do
report more ports than physically having.

While it is allowed to report more ports than physically having in CAP.NP,
it is not allowed to report more ports than physically having in the PI
(Ports Implemented) register, which is what these HBAs do.
(This is a AHCI spec violation.)

Unfortunately, it seems that the PMP implementation in these ASMedia HBAs
is also violating the AHCI and SATA-IO PMP specification.

What these HBAs do is that they do not report that they support PMP
(CAP.SPM (Supports Port Multiplier) is not set).

Instead, they have decided to add extra "virtual" ports in the PI register
that is used if a port multiplier is connected to any of the physical
ports of the HBA.

Enumerating the devices behind the PMP as specified in the AHCI and
SATA-IO specifications, by using PMP READ and PMP WRITE commands to the
physical ports of the HBA is not possible, you have to use the "virtual"
ports.

This is of course bad, because this gives us no way to detect the device
and vendor ID of the PMP actually connected to the HBA, which means that
we can not apply the proper PMP quirks for the PMP that is connected to
the HBA.

Limiting the port map will thus stop these controllers from working with
SATA Port Multipliers.

This patch reverts both patches for asm1064 and asm1166, so old behavior
is restored and SATA PMP will work again, but it will also reintroduce the
(minutes long) extra boot time for the ASMedia controllers that do not
have a PMP connected (either on the PCIe card itself, or an external PMP).

However, a longer boot time for some, is the lesser evil compared to some
other users not being able to detect their drives at all.

Fixes: 0077a504 ("ahci: asm1166: correct count of reported ports")
Fixes: 9815e396 ("ahci: asm1064: correct count of reported ports")
Cc: stable@vger.kernel.org
Reported-by: default avatarMatt <cryptearth@googlemail.com>
Signed-off-by: default avatarConrad Kostecki <conikost@gentoo.org>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
[cassel: rewrote commit message]
Signed-off-by: default avatarNiklas Cassel <cassel@kernel.org>
parent b3603fcb
...@@ -669,19 +669,6 @@ MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets"); ...@@ -669,19 +669,6 @@ MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets");
static void ahci_pci_save_initial_config(struct pci_dev *pdev, static void ahci_pci_save_initial_config(struct pci_dev *pdev,
struct ahci_host_priv *hpriv) struct ahci_host_priv *hpriv)
{ {
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA) {
switch (pdev->device) {
case 0x1166:
dev_info(&pdev->dev, "ASM1166 has only six ports\n");
hpriv->saved_port_map = 0x3f;
break;
case 0x1064:
dev_info(&pdev->dev, "ASM1064 has only four ports\n");
hpriv->saved_port_map = 0xf;
break;
}
}
if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) { if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) {
dev_info(&pdev->dev, "JMB361 has only one port\n"); dev_info(&pdev->dev, "JMB361 has only one port\n");
hpriv->saved_port_map = 1; hpriv->saved_port_map = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment