aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c52
1 files changed, 31 insertions, 21 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2e8ca652c0d9..5c2e581bf990 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1540,6 +1540,8 @@ int ata_dev_configure(struct ata_device *dev)
1540 const u16 *id = dev->id; 1540 const u16 *id = dev->id;
1541 unsigned int xfer_mask; 1541 unsigned int xfer_mask;
1542 char revbuf[7]; /* XYZ-99\0 */ 1542 char revbuf[7]; /* XYZ-99\0 */
1543 char fwrevbuf[ATA_ID_FW_REV_LEN+1];
1544 char modelbuf[ATA_ID_PROD_LEN+1];
1543 int rc; 1545 int rc;
1544 1546
1545 if (!ata_dev_enabled(dev) && ata_msg_info(ap)) { 1547 if (!ata_dev_enabled(dev) && ata_msg_info(ap)) {
@@ -1594,6 +1596,16 @@ int ata_dev_configure(struct ata_device *dev)
1594 1596
1595 dev->n_sectors = ata_id_n_sectors(id); 1597 dev->n_sectors = ata_id_n_sectors(id);
1596 1598
1599 /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */
1600 ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV_OFS,
1601 sizeof(fwrevbuf));
1602
1603 ata_id_c_string(dev->id, modelbuf, ATA_ID_PROD_OFS,
1604 sizeof(modelbuf));
1605
1606 if (dev->id[59] & 0x100)
1607 dev->multi_count = dev->id[59] & 0xff;
1608
1597 if (ata_id_has_lba(id)) { 1609 if (ata_id_has_lba(id)) {
1598 const char *lba_desc; 1610 const char *lba_desc;
1599 char ncq_desc[20]; 1611 char ncq_desc[20];
@@ -1613,13 +1625,16 @@ int ata_dev_configure(struct ata_device *dev)
1613 ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc)); 1625 ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc));
1614 1626
1615 /* print device info to dmesg */ 1627 /* print device info to dmesg */
1616 if (ata_msg_drv(ap) && print_info) 1628 if (ata_msg_drv(ap) && print_info) {
1617 ata_dev_printk(dev, KERN_INFO, "%s, " 1629 ata_dev_printk(dev, KERN_INFO,
1618 "max %s, %Lu sectors: %s %s\n", 1630 "%s: %s, %s, max %s\n",
1619 revbuf, 1631 revbuf, modelbuf, fwrevbuf,
1620 ata_mode_string(xfer_mask), 1632 ata_mode_string(xfer_mask));
1633 ata_dev_printk(dev, KERN_INFO,
1634 "%Lu sectors, multi %u: %s %s\n",
1621 (unsigned long long)dev->n_sectors, 1635 (unsigned long long)dev->n_sectors,
1622 lba_desc, ncq_desc); 1636 dev->multi_count, lba_desc, ncq_desc);
1637 }
1623 } else { 1638 } else {
1624 /* CHS */ 1639 /* CHS */
1625 1640
@@ -1636,22 +1651,17 @@ int ata_dev_configure(struct ata_device *dev)
1636 } 1651 }
1637 1652
1638 /* print device info to dmesg */ 1653 /* print device info to dmesg */
1639 if (ata_msg_drv(ap) && print_info) 1654 if (ata_msg_drv(ap) && print_info) {
1640 ata_dev_printk(dev, KERN_INFO, "%s, "
1641 "max %s, %Lu sectors: CHS %u/%u/%u\n",
1642 revbuf,
1643 ata_mode_string(xfer_mask),
1644 (unsigned long long)dev->n_sectors,
1645 dev->cylinders, dev->heads,
1646 dev->sectors);
1647 }
1648
1649 if (dev->id[59] & 0x100) {
1650 dev->multi_count = dev->id[59] & 0xff;
1651 if (ata_msg_drv(ap) && print_info)
1652 ata_dev_printk(dev, KERN_INFO, 1655 ata_dev_printk(dev, KERN_INFO,
1653 "ata%u: dev %u multi count %u\n", 1656 "%s: %s, %s, max %s\n",
1654 ap->id, dev->devno, dev->multi_count); 1657 revbuf, modelbuf, fwrevbuf,
1658 ata_mode_string(xfer_mask));
1659 ata_dev_printk(dev, KERN_INFO,
1660 "%Lu sectors, multi %u, CHS %u/%u/%u\n",
1661 (unsigned long long)dev->n_sectors,
1662 dev->multi_count, dev->cylinders,
1663 dev->heads, dev->sectors);
1664 }
1655 } 1665 }
1656 1666
1657 dev->cdb_len = 16; 1667 dev->cdb_len = 16;