Commit ffe75ef6 authored by Jeff Garzik's avatar Jeff Garzik

Merge branch 'upstream'

parents 9dc26323 e710245b
This diff is collapsed.
...@@ -672,19 +672,38 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs * ...@@ -672,19 +672,38 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
for (i = 0; i < host_set->n_ports; i++) { for (i = 0; i < host_set->n_ports; i++) {
struct ata_port *ap; struct ata_port *ap;
u32 tmp;
VPRINTK("port %u\n", i); if (!(irq_stat & (1 << i)))
continue;
ap = host_set->ports[i]; ap = host_set->ports[i];
tmp = irq_stat & (1 << i); if (ap) {
if (tmp && ap) {
struct ata_queued_cmd *qc; struct ata_queued_cmd *qc;
qc = ata_qc_from_tag(ap, ap->active_tag); qc = ata_qc_from_tag(ap, ap->active_tag);
if (ahci_host_intr(ap, qc)) if (!ahci_host_intr(ap, qc))
irq_ack |= (1 << i); 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);
}
VPRINTK("port %u\n", i);
} else {
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);
} }
} }
irq_ack |= (1 << i);
}
if (irq_ack) { if (irq_ack) {
writel(irq_ack, mmio + HOST_IRQ_STAT); writel(irq_ack, mmio + HOST_IRQ_STAT);
handled = 1; handled = 1;
......
This diff is collapsed.
This diff is collapsed.
...@@ -39,6 +39,7 @@ struct ata_scsi_args { ...@@ -39,6 +39,7 @@ struct ata_scsi_args {
/* libata-core.c */ /* libata-core.c */
extern int atapi_enabled; extern int atapi_enabled;
extern int ata_qc_complete_noop(struct ata_queued_cmd *qc, u8 drv_stat);
extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
struct ata_device *dev); struct ata_device *dev);
extern void ata_qc_free(struct ata_queued_cmd *qc); extern void ata_qc_free(struct ata_queued_cmd *qc);
...@@ -53,6 +54,9 @@ extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg); ...@@ -53,6 +54,9 @@ extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
/* libata-scsi.c */ /* libata-scsi.c */
extern void atapi_request_sense(struct ata_port *ap, struct ata_device *dev,
struct scsi_cmnd *cmd);
extern void ata_scsi_scan_host(struct ata_port *ap);
extern int ata_scsi_error(struct Scsi_Host *host); extern int ata_scsi_error(struct Scsi_Host *host);
extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf, extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
unsigned int buflen); unsigned int buflen);
...@@ -77,18 +81,10 @@ extern unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf, ...@@ -77,18 +81,10 @@ extern unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf,
extern void ata_scsi_badcmd(struct scsi_cmnd *cmd, extern void ata_scsi_badcmd(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *), void (*done)(struct scsi_cmnd *),
u8 asc, u8 ascq); u8 asc, u8 ascq);
extern void ata_scsi_set_sense(struct scsi_cmnd *cmd,
u8 sk, u8 asc, u8 ascq);
extern void ata_scsi_rbuf_fill(struct ata_scsi_args *args, extern void ata_scsi_rbuf_fill(struct ata_scsi_args *args,
unsigned int (*actor) (struct ata_scsi_args *args, unsigned int (*actor) (struct ata_scsi_args *args,
u8 *rbuf, unsigned int buflen)); u8 *rbuf, unsigned int buflen));
static inline void ata_bad_scsiop(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{
ata_scsi_badcmd(cmd, done, 0x20, 0x00);
}
static inline void ata_bad_cdb(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{
ata_scsi_badcmd(cmd, done, 0x24, 0x00);
}
#endif /* __LIBATA_H__ */ #endif /* __LIBATA_H__ */
This diff is collapsed.
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
* NV-specific details such as register offsets, SATA phy location, * NV-specific details such as register offsets, SATA phy location,
* hotplug info, etc. * hotplug info, etc.
* *
* 0.09
* - Fixed bug introduced by 0.08's MCP51 and MCP55 support.
* *
* 0.08 * 0.08
* - Added support for MCP51 and MCP55. * - Added support for MCP51 and MCP55.
...@@ -132,9 +134,7 @@ enum nv_host_type ...@@ -132,9 +134,7 @@ enum nv_host_type
GENERIC, GENERIC,
NFORCE2, NFORCE2,
NFORCE3, NFORCE3,
CK804, CK804
MCP51,
MCP55
}; };
static struct pci_device_id nv_pci_tbl[] = { static struct pci_device_id nv_pci_tbl[] = {
...@@ -153,13 +153,13 @@ static struct pci_device_id nv_pci_tbl[] = { ...@@ -153,13 +153,13 @@ static struct pci_device_id nv_pci_tbl[] = {
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP51 }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP51 }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP55 }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP55 }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC },
{ PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC }, PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC },
...@@ -405,7 +405,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -405,7 +405,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
rc = -ENOMEM; rc = -ENOMEM;
ppi = &nv_port_info; ppi = &nv_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi); probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) if (!probe_ent)
goto err_out_regions; goto err_out_regions;
......
...@@ -263,7 +263,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -263,7 +263,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_regions; goto err_out_regions;
ppi = &sis_port_info; ppi = &sis_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi); probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) { if (!probe_ent) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_out_regions; goto err_out_regions;
......
...@@ -202,7 +202,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -202,7 +202,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_regions; goto err_out_regions;
ppi = &uli_port_info; ppi = &uli_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi); probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) { if (!probe_ent) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_out_regions; goto err_out_regions;
......
...@@ -212,7 +212,7 @@ static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev) ...@@ -212,7 +212,7 @@ static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev)
struct ata_probe_ent *probe_ent; struct ata_probe_ent *probe_ent;
struct ata_port_info *ppi = &svia_port_info; struct ata_port_info *ppi = &svia_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi); probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) if (!probe_ent)
return NULL; return NULL;
......
...@@ -132,6 +132,7 @@ enum { ...@@ -132,6 +132,7 @@ enum {
ATA_CMD_PACKET = 0xA0, ATA_CMD_PACKET = 0xA0,
ATA_CMD_VERIFY = 0x40, ATA_CMD_VERIFY = 0x40,
ATA_CMD_VERIFY_EXT = 0x42, ATA_CMD_VERIFY_EXT = 0x42,
ATA_CMD_INIT_DEV_PARAMS = 0x91,
/* SETFEATURES stuff */ /* SETFEATURES stuff */
SETFEATURES_XFER = 0x03, SETFEATURES_XFER = 0x03,
...@@ -146,14 +147,14 @@ enum { ...@@ -146,14 +147,14 @@ enum {
XFER_MW_DMA_2 = 0x22, XFER_MW_DMA_2 = 0x22,
XFER_MW_DMA_1 = 0x21, XFER_MW_DMA_1 = 0x21,
XFER_MW_DMA_0 = 0x20, XFER_MW_DMA_0 = 0x20,
XFER_SW_DMA_2 = 0x12,
XFER_SW_DMA_1 = 0x11,
XFER_SW_DMA_0 = 0x10,
XFER_PIO_4 = 0x0C, XFER_PIO_4 = 0x0C,
XFER_PIO_3 = 0x0B, XFER_PIO_3 = 0x0B,
XFER_PIO_2 = 0x0A, XFER_PIO_2 = 0x0A,
XFER_PIO_1 = 0x09, XFER_PIO_1 = 0x09,
XFER_PIO_0 = 0x08, XFER_PIO_0 = 0x08,
XFER_SW_DMA_2 = 0x12,
XFER_SW_DMA_1 = 0x11,
XFER_SW_DMA_0 = 0x10,
XFER_PIO_SLOW = 0x00, XFER_PIO_SLOW = 0x00,
/* ATAPI stuff */ /* ATAPI stuff */
...@@ -181,6 +182,7 @@ enum { ...@@ -181,6 +182,7 @@ enum {
ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
}; };
enum ata_tf_protocols { enum ata_tf_protocols {
...@@ -250,6 +252,18 @@ struct ata_taskfile { ...@@ -250,6 +252,18 @@ struct ata_taskfile {
((u64) (id)[(n) + 1] << 16) | \ ((u64) (id)[(n) + 1] << 16) | \
((u64) (id)[(n) + 0]) ) ((u64) (id)[(n) + 0]) )
static inline int ata_id_current_chs_valid(u16 *id)
{
/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
has not been issued to the device then the values of
id[54] to id[56] are vendor specific. */
return (id[53] & 0x01) && /* Current translation valid */
id[54] && /* cylinders in current translation */
id[55] && /* heads in current translation */
id[55] <= 16 &&
id[56]; /* sectors in current translation */
}
static inline int atapi_cdb_len(u16 *dev_id) static inline int atapi_cdb_len(u16 *dev_id)
{ {
u16 tmp = dev_id[0] & 0x3; u16 tmp = dev_id[0] & 0x3;
......
...@@ -97,6 +97,7 @@ enum { ...@@ -97,6 +97,7 @@ enum {
ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */
ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */
ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */
ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */
ATA_DEV_UNKNOWN = 0, /* unknown device */ ATA_DEV_UNKNOWN = 0, /* unknown device */
ATA_DEV_ATA = 1, /* ATA device */ ATA_DEV_ATA = 1, /* ATA device */
...@@ -154,17 +155,21 @@ enum { ...@@ -154,17 +155,21 @@ enum {
ATA_SHIFT_UDMA = 0, ATA_SHIFT_UDMA = 0,
ATA_SHIFT_MWDMA = 8, ATA_SHIFT_MWDMA = 8,
ATA_SHIFT_PIO = 11, ATA_SHIFT_PIO = 11,
/* Masks for port functions */
ATA_PORT_PRIMARY = (1 << 0),
ATA_PORT_SECONDARY = (1 << 1),
}; };
enum pio_task_states { enum hsm_task_states {
PIO_ST_UNKNOWN, HSM_ST_UNKNOWN,
PIO_ST_IDLE, HSM_ST_IDLE,
PIO_ST_POLL, HSM_ST_POLL,
PIO_ST_TMOUT, HSM_ST_TMOUT,
PIO_ST, HSM_ST,
PIO_ST_LAST, HSM_ST_LAST,
PIO_ST_LAST_POLL, HSM_ST_LAST_POLL,
PIO_ST_ERR, HSM_ST_ERR,
}; };
/* forward declarations */ /* forward declarations */
...@@ -282,6 +287,11 @@ struct ata_device { ...@@ -282,6 +287,11 @@ struct ata_device {
u8 xfer_protocol; /* taskfile xfer protocol */ u8 xfer_protocol; /* taskfile xfer protocol */
u8 read_cmd; /* opcode to use on read */ u8 read_cmd; /* opcode to use on read */
u8 write_cmd; /* opcode to use on write */ u8 write_cmd; /* opcode to use on write */
/* for CHS addressing */
u16 cylinders; /* Number of cylinders */
u16 heads; /* Number of heads */
u16 sectors; /* Number of sectors per track */
}; };
struct ata_port { struct ata_port {
...@@ -319,7 +329,7 @@ struct ata_port { ...@@ -319,7 +329,7 @@ struct ata_port {
struct work_struct packet_task; struct work_struct packet_task;
struct work_struct pio_task; struct work_struct pio_task;
unsigned int pio_task_state; unsigned int hsm_task_state;
unsigned long pio_task_timeout; unsigned long pio_task_timeout;
void *private_data; void *private_data;
...@@ -400,6 +410,8 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn ...@@ -400,6 +410,8 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn
extern int ata_scsi_error(struct Scsi_Host *host); extern int ata_scsi_error(struct Scsi_Host *host);
extern int ata_scsi_release(struct Scsi_Host *host); extern int ata_scsi_release(struct Scsi_Host *host);
extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
extern int ata_ratelimit(void);
/* /*
* Default driver ops implementations * Default driver ops implementations
*/ */
...@@ -452,7 +464,7 @@ struct pci_bits { ...@@ -452,7 +464,7 @@ struct pci_bits {
extern void ata_pci_host_stop (struct ata_host_set *host_set); extern void ata_pci_host_stop (struct ata_host_set *host_set);
extern struct ata_probe_ent * extern struct ata_probe_ent *
ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment