* [PATCH] libata: fix non-uniform ports handling
@ 2006-09-15 18:04 Tejun Heo
2006-09-15 18:32 ` Alan Cox
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tejun Heo @ 2006-09-15 18:04 UTC (permalink / raw)
To: Jeff Garzik
Cc: linux-kernel, Andrew Morton, linux-ide@vger.kernel.org, alan,
Nelson A. de Oliveira
Non-uniform ports handling got broken while updating libata to handle
those in the same host. Only separate irq for the non-uniform
secondary port was implemented while all other fields (host flags,
transfer mode...) of the secondary port simply shared those of the
first.
For ata_piix combined mode, which ATM is the only user of non-uniform
ports, this causes the secondary port assume the wrong type. This can
cause PATA port to use SATA ops, which results in bogus check on PCS
and detection failure.
This patch adds ata_probe_ent->pinfo2 which points to optional
port_info for the secondary port. For the time being, this seems to
be the simplest solution. This workaround will be removed together
with ata_probe_ent itself after init model is updated to allow more
flexibility.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Nelson A. de Oliveira <naoliv@gmail.com>
---
drivers/ata/libata-core.c | 18 +++++++++++++-----
drivers/ata/libata-sff.c | 2 ++
include/linux/libata.h | 8 ++++++++
3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 1c93154..bb66a12 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5269,11 +5269,19 @@ void ata_port_init(struct ata_port *ap,
ap->host = host;
ap->dev = ent->dev;
ap->port_no = port_no;
- ap->pio_mask = ent->pio_mask;
- ap->mwdma_mask = ent->mwdma_mask;
- ap->udma_mask = ent->udma_mask;
- ap->flags |= ent->port_flags;
- ap->ops = ent->port_ops;
+ if (port_no == 1 && ent->pinfo2) {
+ ap->pio_mask = ent->pinfo2->pio_mask;
+ ap->mwdma_mask = ent->pinfo2->mwdma_mask;
+ ap->udma_mask = ent->pinfo2->udma_mask;
+ ap->flags |= ent->pinfo2->flags;
+ ap->ops = ent->pinfo2->port_ops;
+ } else {
+ ap->pio_mask = ent->pio_mask;
+ ap->mwdma_mask = ent->mwdma_mask;
+ ap->udma_mask = ent->udma_mask;
+ ap->flags |= ent->port_flags;
+ ap->ops = ent->port_ops;
+ }
ap->hw_sata_spd_limit = UINT_MAX;
ap->active_tag = ATA_TAG_POISON;
ap->last_ctl = 0xFF;
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 7605028..e72ed8d 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -858,6 +858,7 @@ ata_pci_init_native_mode(struct pci_dev
probe_ent->port[p].bmdma_addr = bmdma;
}
ata_std_ports(&probe_ent->port[p]);
+ probe_ent->pinfo2 = port[1];
p++;
}
@@ -907,6 +908,7 @@ static struct ata_probe_ent *ata_pci_ini
probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
}
ata_std_ports(&probe_ent->port[1]);
+ probe_ent->pinfo2 = port[1];
} else
probe_ent->dummy_port_mask |= ATA_PORT_SECONDARY;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 8715305..ff67e75 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -361,6 +361,14 @@ struct ata_probe_ent {
unsigned long _host_flags;
void __iomem *mmio_base;
void *private_data;
+
+ /* port_info for the secondary port. Together with irq2, it's
+ * used to implement non-uniform secondary port. Currently,
+ * the only user is ata_piix combined mode. This workaround
+ * will be removed together with ata_probe_ent when init model
+ * is updated.
+ */
+ const struct ata_port_info *pinfo2;
};
struct ata_host {
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] libata: fix non-uniform ports handling
2006-09-15 18:04 [PATCH] libata: fix non-uniform ports handling Tejun Heo
@ 2006-09-15 18:32 ` Alan Cox
2006-09-15 22:29 ` Andrew Morton
2006-09-19 4:29 ` Jeff Garzik
2 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2006-09-15 18:32 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, linux-kernel, Andrew Morton,
linux-ide@vger.kernel.org, Nelson A. de Oliveira
Ar Sad, 2006-09-16 am 03:04 +0900, ysgrifennodd Tejun Heo:
> Non-uniform ports handling got broken while updating libata to handle
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Cc: Nelson A. de Oliveira <naoliv@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libata: fix non-uniform ports handling
2006-09-15 18:04 [PATCH] libata: fix non-uniform ports handling Tejun Heo
2006-09-15 18:32 ` Alan Cox
@ 2006-09-15 22:29 ` Andrew Morton
2006-09-19 4:29 ` Jeff Garzik
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2006-09-15 22:29 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, linux-kernel, linux-ide@vger.kernel.org, alan,
Nelson A. de Oliveira
On Sat, 16 Sep 2006 03:04:15 +0900
Tejun Heo <htejun@gmail.com> wrote:
> @@ -5269,11 +5269,19 @@ void ata_port_init(struct ata_port *ap,
> ap->host = host;
> ap->dev = ent->dev;
> ap->port_no = port_no;
> - ap->pio_mask = ent->pio_mask;
> - ap->mwdma_mask = ent->mwdma_mask;
> - ap->udma_mask = ent->udma_mask;
> - ap->flags |= ent->port_flags;
> - ap->ops = ent->port_ops;
> + if (port_no == 1 && ent->pinfo2) {
> + ap->pio_mask = ent->pinfo2->pio_mask;
> + ap->mwdma_mask = ent->pinfo2->mwdma_mask;
> + ap->udma_mask = ent->pinfo2->udma_mask;
> + ap->flags |= ent->pinfo2->flags;
> + ap->ops = ent->pinfo2->port_ops;
> + } else {
> + ap->pio_mask = ent->pio_mask;
> + ap->mwdma_mask = ent->mwdma_mask;
> + ap->udma_mask = ent->udma_mask;
> + ap->flags |= ent->port_flags;
> + ap->ops = ent->port_ops;
> + }
Same problem: the git-libata-all which I pulled 30 seconds ago
has:
ap->flags |= ent->port_flags | ent->_port_flags[port_no];
and not
ap->flags |= ent->port_flags;
which is what your patch expects.
Oh well, hopefully Jeff will sort it out.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] libata: fix non-uniform ports handling
2006-09-15 18:04 [PATCH] libata: fix non-uniform ports handling Tejun Heo
2006-09-15 18:32 ` Alan Cox
2006-09-15 22:29 ` Andrew Morton
@ 2006-09-19 4:29 ` Jeff Garzik
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2006-09-19 4:29 UTC (permalink / raw)
To: Tejun Heo
Cc: linux-kernel, Andrew Morton, linux-ide@vger.kernel.org, alan,
Nelson A. de Oliveira
applied
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-09-19 4:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15 18:04 [PATCH] libata: fix non-uniform ports handling Tejun Heo
2006-09-15 18:32 ` Alan Cox
2006-09-15 22:29 ` Andrew Morton
2006-09-19 4:29 ` 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).