• Mikael Pettersson's avatar
    sata_promise: mmio access cleanups · 821d22cd
    Mikael Pettersson authored
    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: default avatarMikael Pettersson <mikpe@it.uu.se>
    Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
    821d22cd
sata_promise.c 30.1 KB