projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull mca-check-psp into release branch
[powerpc.git]
/
drivers
/
scsi
/
ahci.c
diff --git
a/drivers/scsi/ahci.c
b/drivers/scsi/ahci.c
index
cbab586
..
10c470e
100644
(file)
--- a/
drivers/scsi/ahci.c
+++ b/
drivers/scsi/ahci.c
@@
-41,8
+41,9
@@
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/dma-mapping.h>
-#include
"scsi.h"
+#include
<linux/device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_host.h>
+#include <scsi/scsi_cmnd.h>
#include <linux/libata.h>
#include <asm/io.h>
#include <linux/libata.h>
#include <asm/io.h>
@@
-192,11
+193,10
@@
static void ahci_port_stop(struct ata_port *ap);
static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
static void ahci_qc_prep(struct ata_queued_cmd *qc);
static u8 ahci_check_status(struct ata_port *ap);
static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
static void ahci_qc_prep(struct ata_queued_cmd *qc);
static u8 ahci_check_status(struct ata_port *ap);
-static u8 ahci_check_err(struct ata_port *ap);
static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
static void ahci_remove_one (struct pci_dev *pdev);
static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
static void ahci_remove_one (struct pci_dev *pdev);
-static
Scsi_Host_T
emplate ahci_sht = {
+static
struct scsi_host_t
emplate ahci_sht = {
.module = THIS_MODULE,
.name = DRV_NAME,
.ioctl = ata_scsi_ioctl,
.module = THIS_MODULE,
.name = DRV_NAME,
.ioctl = ata_scsi_ioctl,
@@
-221,7
+221,6
@@
static const struct ata_port_operations ahci_ops = {
.check_status = ahci_check_status,
.check_altstatus = ahci_check_status,
.check_status = ahci_check_status,
.check_altstatus = ahci_check_status,
- .check_err = ahci_check_err,
.dev_select = ata_noop_dev_select,
.tf_read = ahci_tf_read,
.dev_select = ata_noop_dev_select,
.tf_read = ahci_tf_read,
@@
-308,21
+307,22
@@
static int ahci_port_start(struct ata_port *ap)
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
void *mem;
dma_addr_t mem_dma;
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
void *mem;
dma_addr_t mem_dma;
+ int rc;
pp = kmalloc(sizeof(*pp), GFP_KERNEL);
if (!pp)
return -ENOMEM;
memset(pp, 0, sizeof(*pp));
pp = kmalloc(sizeof(*pp), GFP_KERNEL);
if (!pp)
return -ENOMEM;
memset(pp, 0, sizeof(*pp));
-
ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ, &ap->pad_dma, GFP_KERNEL
);
- if (
!ap->pad
) {
+
rc = ata_pad_alloc(ap, dev
);
+ if (
rc
) {
kfree(pp);
kfree(pp);
- return
-ENOMEM
;
+ return
rc
;
}
mem = dma_alloc_coherent(dev, AHCI_PORT_PRIV_DMA_SZ, &mem_dma, GFP_KERNEL);
if (!mem) {
}
mem = dma_alloc_coherent(dev, AHCI_PORT_PRIV_DMA_SZ, &mem_dma, GFP_KERNEL);
if (!mem) {
-
dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma
);
+
ata_pad_free(ap, dev
);
kfree(pp);
return -ENOMEM;
}
kfree(pp);
return -ENOMEM;
}
@@
-398,7
+398,7
@@
static void ahci_port_stop(struct ata_port *ap)
ap->private_data = NULL;
dma_free_coherent(dev, AHCI_PORT_PRIV_DMA_SZ,
pp->cmd_slot, pp->cmd_slot_dma);
ap->private_data = NULL;
dma_free_coherent(dev, AHCI_PORT_PRIV_DMA_SZ,
pp->cmd_slot, pp->cmd_slot_dma);
-
dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma
);
+
ata_pad_free(ap, dev
);
kfree(pp);
}
kfree(pp);
}
@@
-466,13
+466,6
@@
static u8 ahci_check_status(struct ata_port *ap)
return readl(mmio + PORT_TFDATA) & 0xFF;
}
return readl(mmio + PORT_TFDATA) & 0xFF;
}
-static u8 ahci_check_err(struct ata_port *ap)
-{
- void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr;
-
- return (readl(mmio + PORT_TFDATA) >> 8) & 0xFF;
-}
-
static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
{
struct ahci_port_priv *pp = ap->private_data;
static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
{
struct ahci_port_priv *pp = ap->private_data;
@@
-617,7
+610,7
@@
static void ahci_eng_timeout(struct ata_port *ap)
* not being called from the SCSI EH.
*/
qc->scsidone = scsi_finish_command;
* not being called from the SCSI EH.
*/
qc->scsidone = scsi_finish_command;
- ata_qc_complete(qc, A
TA_ER
R);
+ ata_qc_complete(qc, A
C_ERR_OTHE
R);
}
spin_unlock_irqrestore(&host_set->lock, flags);
}
spin_unlock_irqrestore(&host_set->lock, flags);
@@
-646,7
+639,7
@@
static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc)
if (status & PORT_IRQ_FATAL) {
ahci_intr_error(ap, status);
if (qc)
if (status & PORT_IRQ_FATAL) {
ahci_intr_error(ap, status);
if (qc)
- ata_qc_complete(qc, A
TA_ER
R);
+ ata_qc_complete(qc, A
C_ERR_OTHE
R);
}
return 1;
}
return 1;
@@
-691,10
+684,10
@@
static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
if (!ahci_host_intr(ap, qc))
if (ata_ratelimit()) {
struct pci_dev *pdev =
if (!ahci_host_intr(ap, qc))
if (ata_ratelimit()) {
struct pci_dev *pdev =
- to_pci_dev(ap->host_set->dev);
- printk(KERN_WARNING
- "
ahci(%s):
unhandled interrupt on port %u\n",
-
pci_name(pdev),
i);
+
to_pci_dev(ap->host_set->dev);
+ dev_printk(KERN_WARNING, &pdev->dev,
+ "unhandled interrupt on port %u\n",
+ i);
}
VPRINTK("port %u\n", i);
}
VPRINTK("port %u\n", i);
@@
-702,10
+695,9
@@
static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
VPRINTK("port %u (no irq)\n", i);
if (ata_ratelimit()) {
struct pci_dev *pdev =
VPRINTK("port %u (no irq)\n", i);
if (ata_ratelimit()) {
struct pci_dev *pdev =
- to_pci_dev(ap->host_set->dev);
- printk(KERN_WARNING
- "ahci(%s): interrupt on disabled port %u\n",
- pci_name(pdev), i);
+ to_pci_dev(ap->host_set->dev);
+ dev_printk(KERN_WARNING, &pdev->dev,
+ "interrupt on disabled port %u\n", i);
}
}
}
}
@@
-777,8
+769,8
@@
static int ahci_host_init(struct ata_probe_ent *probe_ent)
tmp = readl(mmio + HOST_CTL);
if (tmp & HOST_RESET) {
tmp = readl(mmio + HOST_CTL);
if (tmp & HOST_RESET) {
-
printk(KERN_ERR DRV_NAME "(%s): controller reset failed (0x%x)\n"
,
-
pci_name(pdev)
, tmp);
+
dev_printk(KERN_ERR, &pdev->dev
,
+
"controller reset failed (0x%x)\n"
, tmp);
return -EIO;
}
return -EIO;
}
@@
-806,22
+798,22
@@
static int ahci_host_init(struct ata_probe_ent *probe_ent)
if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
-
printk(KERN_ERR DRV_NAME "(%s): 64-bit DMA enable failed\n"
,
-
pci_name(pdev)
);
+
dev_printk(KERN_ERR, &pdev->dev
,
+
"64-bit DMA enable failed\n"
);
return rc;
}
}
} else {
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
return rc;
}
}
} else {
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
-
printk(KERN_ERR DRV_NAME "(%s): 32-bit DMA enable failed\n"
,
-
pci_name(pdev)
);
+
dev_printk(KERN_ERR, &pdev->dev
,
+
"32-bit DMA enable failed\n"
);
return rc;
}
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
return rc;
}
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
-
printk(KERN_ERR DRV_NAME "(%s): 32-bit consistent DMA enable failed\n"
,
-
pci_name(pdev)
);
+
dev_printk(KERN_ERR, &pdev->dev
,
+
"32-bit consistent DMA enable failed\n"
);
return rc;
}
}
return rc;
}
}
@@
-924,10
+916,10
@@
static void ahci_print_info(struct ata_probe_ent *probe_ent)
else
scc_s = "unknown";
else
scc_s = "unknown";
- printk(KERN_INFO DRV_NAME "(%s) AHCI %02x%02x.%02x%02x "
+ dev_printk(KERN_INFO, &pdev->dev,
+ "AHCI %02x%02x.%02x%02x "
"%u slots %u ports %s Gbps 0x%x impl %s mode\n"
,
"%u slots %u ports %s Gbps 0x%x impl %s mode\n"
,
- pci_name(pdev),
(vers >> 24) & 0xff,
(vers >> 16) & 0xff,
(vers >> 24) & 0xff,
(vers >> 16) & 0xff,
@@
-940,11
+932,11
@@
static void ahci_print_info(struct ata_probe_ent *probe_ent)
impl,
scc_s);
impl,
scc_s);
- printk(KERN_INFO DRV_NAME "(%s) flags: "
+ dev_printk(KERN_INFO, &pdev->dev,
+ "flags: "
"%s%s%s%s%s%s"
"%s%s%s%s%s%s%s\n"
,
"%s%s%s%s%s%s"
"%s%s%s%s%s%s%s\n"
,
- pci_name(pdev),
cap & (1 << 31) ? "64bit " : "",
cap & (1 << 30) ? "ncq " : "",
cap & (1 << 31) ? "64bit " : "",
cap & (1 << 30) ? "ncq " : "",
@@
-977,7
+969,7
@@
static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
VPRINTK("ENTER\n");
if (!printed_version++)
VPRINTK("ENTER\n");
if (!printed_version++)
-
printk(KERN_DEBUG DRV_NAME "
version " DRV_VERSION "\n");
+
dev_printk(KERN_DEBUG, &pdev->dev, "
version " DRV_VERSION "\n");
rc = pci_enable_device(pdev);
if (rc)
rc = pci_enable_device(pdev);
if (rc)