Re: [BK PATCHES] 2.6.x libata fixes (mostly)

From: Alexey Dobriyan
Date: Wed Feb 23 2005 - 15:46:57 EST


On Wednesday 23 February 2005 21:57, Jeff Garzik wrote:

> This BK push includes additional hardware support, but that's only
> because it's (a) obviously low impact and (b) it was in the queue.

> --- a/drivers/scsi/ahci.c
> +++ b/drivers/scsi/ahci.c

> +static u8 ahci_check_err(struct ata_port *ap)
> +{
> + void *mmio = (void *) ap->ioaddr.cmd_addr;

void __iomem *

> + return (readl(mmio + PORT_TFDATA) >> 8) & 0xFF;

> --- a/drivers/scsi/libata-core.c
> +++ b/drivers/scsi/libata-core.c

> + * ata_qc_free - free unused ata_queued_cmd
> + * @qc: Command to complete

"Command to free"?

--- /dev/null
+++ b/drivers/scsi/sata_qstor.c

> + u8 *prd = pp->pkt + QS_CPB_BYTES;

> + for (nelem = 0; nelem < qc->n_elem; nelem++,sg++) {
> + u64 addr;
> + u32 len;

> + addr = sg_dma_address(sg);
> + *(u64 *)prd = cpu_to_le64(addr);

*(__le64 *) prd

> + prd += sizeof(u64);

> + len = sg_dma_len(sg);
> + *(u32 *)prd = cpu_to_le32(len);

*(__le32 *) prd

> + prd += sizeof(u64);

Should this be "prd += sizeof(u32)"? Looks suspicious.

> +static void qs_qc_prep(struct ata_queued_cmd *qc)
> +{

> + *(u32 *)(&buf[ 4]) = cpu_to_le32(qc->nsect * ATA_SECT_SIZE);
> + *(u32 *)(&buf[ 8]) = cpu_to_le32(qc->n_elem);

> + *(u64 *)(&buf[16]) = cpu_to_le64(addr);

__le* again...

> +static void qs_ata_setup_port(struct ata_ioports *port, unsigned long base)
> +{
> + port->cmd_addr =

> + port->error_addr =

> + port->status_addr =

> + port->altstatus_addr =

Oo-oops...

> +static int qs_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
> +{

> + if (have_64bit_bus &&
> + !pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
> + rc = pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL);
> + if (rc) {
> + rc = pci_set_consistent_dma_mask(pdev, 0xffffffffULL);

We already have DMA_{32,64}BIT_MASK.

> + } else {
> + rc = pci_set_dma_mask(pdev, 0xffffffffULL);

> + rc = pci_set_consistent_dma_mask(pdev, 0xffffffffULL);

Alexey
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/