提交 83d5a325 编写于 作者: L Linus Torvalds

Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  libata: Don't trust current capacity values in identify words 57-58
  libata: make sure port is thawed when skipping resets
  sata_nv: fix module parameter description
  ahci: Add the Device IDs for MCP89 and remove IDs of MCP7B to/from ahci.c
  libata: don't use on-stack sense buffer
  libata: align ap->sector_buf
  libata: fix dma_unmap_sg misuse
  libata: change drive ready wait after hard reset to 5s
...@@ -582,18 +582,18 @@ static const struct pci_device_id ahci_pci_tbl[] = { ...@@ -582,18 +582,18 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(NVIDIA, 0x0abd), board_ahci }, /* MCP79 */ { PCI_VDEVICE(NVIDIA, 0x0abd), board_ahci }, /* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0abe), board_ahci }, /* MCP79 */ { PCI_VDEVICE(NVIDIA, 0x0abe), board_ahci }, /* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0abf), board_ahci }, /* MCP79 */ { PCI_VDEVICE(NVIDIA, 0x0abf), board_ahci }, /* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0bc8), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d84), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bc9), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d85), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bca), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d86), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bcb), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d87), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bcc), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d88), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bcd), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d89), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bce), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d8a), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bcf), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d8b), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bc4), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d8c), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bc5), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d8d), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bc6), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d8e), board_ahci }, /* MCP89 */
{ PCI_VDEVICE(NVIDIA, 0x0bc7), board_ahci }, /* MCP7B */ { PCI_VDEVICE(NVIDIA, 0x0d8f), board_ahci }, /* MCP89 */
/* SiS */ /* SiS */
{ PCI_VDEVICE(SI, 0x1184), board_ahci }, /* SiS 966 */ { PCI_VDEVICE(SI, 0x1184), board_ahci }, /* SiS 966 */
......
...@@ -1322,14 +1322,16 @@ static u64 ata_id_n_sectors(const u16 *id) ...@@ -1322,14 +1322,16 @@ static u64 ata_id_n_sectors(const u16 *id)
{ {
if (ata_id_has_lba(id)) { if (ata_id_has_lba(id)) {
if (ata_id_has_lba48(id)) if (ata_id_has_lba48(id))
return ata_id_u64(id, 100); return ata_id_u64(id, ATA_ID_LBA_CAPACITY_2);
else else
return ata_id_u32(id, 60); return ata_id_u32(id, ATA_ID_LBA_CAPACITY);
} else { } else {
if (ata_id_current_chs_valid(id)) if (ata_id_current_chs_valid(id))
return ata_id_u32(id, 57); return id[ATA_ID_CUR_CYLS] * id[ATA_ID_CUR_HEADS] *
id[ATA_ID_CUR_SECTORS];
else else
return id[1] * id[3] * id[6]; return id[ATA_ID_CYLS] * id[ATA_ID_HEADS] *
id[ATA_ID_SECTORS];
} }
} }
...@@ -4612,7 +4614,7 @@ void ata_sg_clean(struct ata_queued_cmd *qc) ...@@ -4612,7 +4614,7 @@ void ata_sg_clean(struct ata_queued_cmd *qc)
VPRINTK("unmapping %u sg elements\n", qc->n_elem); VPRINTK("unmapping %u sg elements\n", qc->n_elem);
if (qc->n_elem) if (qc->n_elem)
dma_unmap_sg(ap->dev, sg, qc->n_elem, dir); dma_unmap_sg(ap->dev, sg, qc->orig_n_elem, dir);
qc->flags &= ~ATA_QCFLAG_DMAMAP; qc->flags &= ~ATA_QCFLAG_DMAMAP;
qc->sg = NULL; qc->sg = NULL;
...@@ -4727,7 +4729,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc) ...@@ -4727,7 +4729,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
return -1; return -1;
DPRINTK("%d sg elements mapped\n", n_elem); DPRINTK("%d sg elements mapped\n", n_elem);
qc->orig_n_elem = qc->n_elem;
qc->n_elem = n_elem; qc->n_elem = n_elem;
qc->flags |= ATA_QCFLAG_DMAMAP; qc->flags |= ATA_QCFLAG_DMAMAP;
......
...@@ -2423,11 +2423,14 @@ int ata_eh_reset(struct ata_link *link, int classify, ...@@ -2423,11 +2423,14 @@ int ata_eh_reset(struct ata_link *link, int classify,
} }
/* prereset() might have cleared ATA_EH_RESET. If so, /* prereset() might have cleared ATA_EH_RESET. If so,
* bang classes and return. * bang classes, thaw and return.
*/ */
if (reset && !(ehc->i.action & ATA_EH_RESET)) { if (reset && !(ehc->i.action & ATA_EH_RESET)) {
ata_for_each_dev(dev, link, ALL) ata_for_each_dev(dev, link, ALL)
classes[dev->devno] = ATA_DEV_NONE; classes[dev->devno] = ATA_DEV_NONE;
if ((ap->pflags & ATA_PFLAG_FROZEN) &&
ata_is_host_link(link))
ata_eh_thaw_port(ap);
rc = 0; rc = 0;
goto out; goto out;
} }
...@@ -2901,7 +2904,7 @@ static int atapi_eh_clear_ua(struct ata_device *dev) ...@@ -2901,7 +2904,7 @@ static int atapi_eh_clear_ua(struct ata_device *dev)
int i; int i;
for (i = 0; i < ATA_EH_UA_TRIES; i++) { for (i = 0; i < ATA_EH_UA_TRIES; i++) {
u8 sense_buffer[SCSI_SENSE_BUFFERSIZE]; u8 *sense_buffer = dev->link->ap->sector_buf;
u8 sense_key = 0; u8 sense_key = 0;
unsigned int err_mask; unsigned int err_mask;
......
...@@ -2523,7 +2523,7 @@ static void __exit nv_exit(void) ...@@ -2523,7 +2523,7 @@ static void __exit nv_exit(void)
module_init(nv_init); module_init(nv_init);
module_exit(nv_exit); module_exit(nv_exit);
module_param_named(adma, adma_enabled, bool, 0444); module_param_named(adma, adma_enabled, bool, 0444);
MODULE_PARM_DESC(adma, "Enable use of ADMA (Default: true)"); MODULE_PARM_DESC(adma, "Enable use of ADMA (Default: false)");
module_param_named(swncq, swncq_enabled, bool, 0444); module_param_named(swncq, swncq_enabled, bool, 0444);
MODULE_PARM_DESC(swncq, "Enable use of SWNCQ (Default: true)"); MODULE_PARM_DESC(swncq, "Enable use of SWNCQ (Default: true)");
...@@ -275,7 +275,7 @@ enum { ...@@ -275,7 +275,7 @@ enum {
* advised to wait only for the following duration before * advised to wait only for the following duration before
* doing SRST. * doing SRST.
*/ */
ATA_TMOUT_PMP_SRST_WAIT = 1000, ATA_TMOUT_PMP_SRST_WAIT = 5000,
/* ATA bus states */ /* ATA bus states */
BUS_UNKNOWN = 0, BUS_UNKNOWN = 0,
...@@ -530,6 +530,7 @@ struct ata_queued_cmd { ...@@ -530,6 +530,7 @@ struct ata_queued_cmd {
unsigned long flags; /* ATA_QCFLAG_xxx */ unsigned long flags; /* ATA_QCFLAG_xxx */
unsigned int tag; unsigned int tag;
unsigned int n_elem; unsigned int n_elem;
unsigned int orig_n_elem;
int dma_dir; int dma_dir;
...@@ -750,7 +751,8 @@ struct ata_port { ...@@ -750,7 +751,8 @@ struct ata_port {
acpi_handle acpi_handle; acpi_handle acpi_handle;
struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
#endif #endif
u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ /* owned by EH */
u8 sector_buf[ATA_SECT_SIZE] ____cacheline_aligned;
}; };
/* The following initializer overrides a method to NULL whether one of /* The following initializer overrides a method to NULL whether one of
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册