aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index c5ba15af87d3..5c84fb5c3372 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1043,8 +1043,8 @@ const char *sata_spd_string(unsigned int spd)
1043 * None. 1043 * None.
1044 * 1044 *
1045 * RETURNS: 1045 * RETURNS:
1046 * Device type, %ATA_DEV_ATA, %ATA_DEV_ATAPI, %ATA_DEV_PMP or 1046 * Device type, %ATA_DEV_ATA, %ATA_DEV_ATAPI, %ATA_DEV_PMP,
1047 * %ATA_DEV_UNKNOWN the event of failure. 1047 * %ATA_DEV_ZAC, or %ATA_DEV_UNKNOWN the event of failure.
1048 */ 1048 */
1049unsigned int ata_dev_classify(const struct ata_taskfile *tf) 1049unsigned int ata_dev_classify(const struct ata_taskfile *tf)
1050{ 1050{
@@ -1089,6 +1089,11 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
1089 return ATA_DEV_SEMB; 1089 return ATA_DEV_SEMB;
1090 } 1090 }
1091 1091
1092 if ((tf->lbam == 0xcd) && (tf->lbah == 0xab)) {
1093 DPRINTK("found ZAC device by sig\n");
1094 return ATA_DEV_ZAC;
1095 }
1096
1092 DPRINTK("unknown device\n"); 1097 DPRINTK("unknown device\n");
1093 return ATA_DEV_UNKNOWN; 1098 return ATA_DEV_UNKNOWN;
1094} 1099}
@@ -1329,7 +1334,7 @@ static int ata_hpa_resize(struct ata_device *dev)
1329 int rc; 1334 int rc;
1330 1335
1331 /* do we need to do it? */ 1336 /* do we need to do it? */
1332 if (dev->class != ATA_DEV_ATA || 1337 if ((dev->class != ATA_DEV_ATA && dev->class != ATA_DEV_ZAC) ||
1333 !ata_id_has_lba(dev->id) || !ata_id_hpa_enabled(dev->id) || 1338 !ata_id_has_lba(dev->id) || !ata_id_hpa_enabled(dev->id) ||
1334 (dev->horkage & ATA_HORKAGE_BROKEN_HPA)) 1339 (dev->horkage & ATA_HORKAGE_BROKEN_HPA))
1335 return 0; 1340 return 0;
@@ -1889,6 +1894,7 @@ retry:
1889 case ATA_DEV_SEMB: 1894 case ATA_DEV_SEMB:
1890 class = ATA_DEV_ATA; /* some hard drives report SEMB sig */ 1895 class = ATA_DEV_ATA; /* some hard drives report SEMB sig */
1891 case ATA_DEV_ATA: 1896 case ATA_DEV_ATA:
1897 case ATA_DEV_ZAC:
1892 tf.command = ATA_CMD_ID_ATA; 1898 tf.command = ATA_CMD_ID_ATA;
1893 break; 1899 break;
1894 case ATA_DEV_ATAPI: 1900 case ATA_DEV_ATAPI:
@@ -1980,7 +1986,7 @@ retry:
1980 rc = -EINVAL; 1986 rc = -EINVAL;
1981 reason = "device reports invalid type"; 1987 reason = "device reports invalid type";
1982 1988
1983 if (class == ATA_DEV_ATA) { 1989 if (class == ATA_DEV_ATA || class == ATA_DEV_ZAC) {
1984 if (!ata_id_is_ata(id) && !ata_id_is_cfa(id)) 1990 if (!ata_id_is_ata(id) && !ata_id_is_cfa(id))
1985 goto err_out; 1991 goto err_out;
1986 if (ap->host->flags & ATA_HOST_IGNORE_ATA && 1992 if (ap->host->flags & ATA_HOST_IGNORE_ATA &&
@@ -2015,7 +2021,8 @@ retry:
2015 goto retry; 2021 goto retry;
2016 } 2022 }
2017 2023
2018 if ((flags & ATA_READID_POSTRESET) && class == ATA_DEV_ATA) { 2024 if ((flags & ATA_READID_POSTRESET) &&
2025 (class == ATA_DEV_ATA || class == ATA_DEV_ZAC)) {
2019 /* 2026 /*
2020 * The exact sequence expected by certain pre-ATA4 drives is: 2027 * The exact sequence expected by certain pre-ATA4 drives is:
2021 * SRST RESET 2028 * SRST RESET
@@ -2280,7 +2287,7 @@ int ata_dev_configure(struct ata_device *dev)
2280 sizeof(modelbuf)); 2287 sizeof(modelbuf));
2281 2288
2282 /* ATA-specific feature tests */ 2289 /* ATA-specific feature tests */
2283 if (dev->class == ATA_DEV_ATA) { 2290 if (dev->class == ATA_DEV_ATA || dev->class == ATA_DEV_ZAC) {
2284 if (ata_id_is_cfa(id)) { 2291 if (ata_id_is_cfa(id)) {
2285 /* CPRM may make this media unusable */ 2292 /* CPRM may make this media unusable */
2286 if (id[ATA_ID_CFA_KEY_MGMT] & 1) 2293 if (id[ATA_ID_CFA_KEY_MGMT] & 1)
@@ -4033,6 +4040,7 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
4033 if (ata_class_enabled(new_class) && 4040 if (ata_class_enabled(new_class) &&
4034 new_class != ATA_DEV_ATA && 4041 new_class != ATA_DEV_ATA &&
4035 new_class != ATA_DEV_ATAPI && 4042 new_class != ATA_DEV_ATAPI &&
4043 new_class != ATA_DEV_ZAC &&
4036 new_class != ATA_DEV_SEMB) { 4044 new_class != ATA_DEV_SEMB) {
4037 ata_dev_info(dev, "class mismatch %u != %u\n", 4045 ata_dev_info(dev, "class mismatch %u != %u\n",
4038 dev->class, new_class); 4046 dev->class, new_class);