* [PATCH 2.6.22-rc5] ahci: fix PORTS_IMPL override
@ 2007-06-19 9:52 Tejun Heo
2007-06-20 23:57 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2007-06-19 9:52 UTC (permalink / raw)
To: Jeff Garzik, linux-ide
If PORTS_IMPL register is zero, ahci initialize it to full mask
corresponding to nr_ports in the CAP register. hpriv->cap, which is
initialized at the end of the function, is incorrectly used as value
of CAP causing ahci to always override PORTS_IMPL to 0x1 if it's zero.
Fix it.
This fixes a bug where early ich6 ahci can only access the first port.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/ata/ahci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 545f330..ca5229d 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -527,7 +527,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
/* fixup zero port_map */
if (!port_map) {
- port_map = (1 << ahci_nr_ports(hpriv->cap)) - 1;
+ port_map = (1 << ahci_nr_ports(cap)) - 1;
dev_printk(KERN_WARNING, &pdev->dev,
"PORTS_IMPL is zero, forcing 0x%x\n", port_map);
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 2.6.22-rc5] ahci: fix PORTS_IMPL override
2007-06-19 9:52 [PATCH 2.6.22-rc5] ahci: fix PORTS_IMPL override Tejun Heo
@ 2007-06-20 23:57 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-06-20 23:57 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide
Tejun Heo wrote:
> If PORTS_IMPL register is zero, ahci initialize it to full mask
> corresponding to nr_ports in the CAP register. hpriv->cap, which is
> initialized at the end of the function, is incorrectly used as value
> of CAP causing ahci to always override PORTS_IMPL to 0x1 if it's zero.
> Fix it.
>
> This fixes a bug where early ich6 ahci can only access the first port.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> drivers/ata/ahci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index 545f330..ca5229d 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -527,7 +527,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
>
> /* fixup zero port_map */
> if (!port_map) {
> - port_map = (1 << ahci_nr_ports(hpriv->cap)) - 1;
> + port_map = (1 << ahci_nr_ports(cap)) - 1;
> dev_printk(KERN_WARNING, &pdev->dev,
good catch, applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-20 23:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-19 9:52 [PATCH 2.6.22-rc5] ahci: fix PORTS_IMPL override Tejun Heo
2007-06-20 23:57 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).