]> bbs.cooldavid.org Git - net-next-2.6.git/commit
sata_promise: mmio access cleanups
authorMikael Pettersson <mikpe@it.uu.se>
Sat, 17 May 2008 16:48:15 +0000 (18:48 +0200)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 19 May 2008 21:31:26 +0000 (17:31 -0400)
commit821d22cdcd3c2944b93ac5f217ec0b6593ae6f48
tree32940fdc3924b2b02de10ed68fd3c22bd15fb23a
parenta13db78e2209ebfe1898207f53c353ed836d4a53
sata_promise: mmio access cleanups

This patch cleans up sata_promise's mmio accesses.

In sata_promise there are three distinct mmio address spaces:
1. global registers, offsets from host->iomap[PDC_MMIO_BAR]
2. per-port ATA registers, offsets from ap->ioaddr.cmd_addr
3. per-port SATA registers, offsets from ap->ioaddr.scr_addr

The driver currently often fails to indicate which address space
a given mmio base pointer refers to, which is a source of bugs
and confusion (see recent pdc_thaw() irq clearing bug; it's also
been an obstacle for the pending NCQ extensions).

To reduce these problems, adopt a coding style where the name of
a base pointer always indicates which address space it refers to:
1. global registers: host_mmio
2. per-port ATA registers: ata_mmio
3. per-port SATA registers: sata_mmio

Also rearrange register offset definitions to clearly indicate
which address space they belong to, and add a symbolic definition
for the previously hard-coded PHYMODE4 register.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/sata_promise.c