aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c20
-rw-r--r--drivers/ata/libata-eh.c7
-rw-r--r--drivers/ata/libata-scsi.c5
-rw-r--r--drivers/ata/libata-transport.c1
4 files changed, 23 insertions, 10 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);
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index dad83df555c4..3dbec8954c86 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1809,6 +1809,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
1809 1809
1810 switch (qc->dev->class) { 1810 switch (qc->dev->class) {
1811 case ATA_DEV_ATA: 1811 case ATA_DEV_ATA:
1812 case ATA_DEV_ZAC:
1812 if (err & ATA_ICRC) 1813 if (err & ATA_ICRC)
1813 qc->err_mask |= AC_ERR_ATA_BUS; 1814 qc->err_mask |= AC_ERR_ATA_BUS;
1814 if (err & (ATA_UNC | ATA_AMNF)) 1815 if (err & (ATA_UNC | ATA_AMNF))
@@ -3792,7 +3793,8 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
3792 struct ata_eh_context *ehc = &link->eh_context; 3793 struct ata_eh_context *ehc = &link->eh_context;
3793 unsigned long tmp; 3794 unsigned long tmp;
3794 3795
3795 if (dev->class != ATA_DEV_ATA) 3796 if (dev->class != ATA_DEV_ATA &&
3797 dev->class != ATA_DEV_ZAC)
3796 continue; 3798 continue;
3797 if (!(ehc->i.dev_action[dev->devno] & 3799 if (!(ehc->i.dev_action[dev->devno] &
3798 ATA_EH_PARK)) 3800 ATA_EH_PARK))
@@ -3873,7 +3875,8 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
3873 3875
3874 /* retry flush if necessary */ 3876 /* retry flush if necessary */
3875 ata_for_each_dev(dev, link, ALL) { 3877 ata_for_each_dev(dev, link, ALL) {
3876 if (dev->class != ATA_DEV_ATA) 3878 if (dev->class != ATA_DEV_ATA &&
3879 dev->class != ATA_DEV_ZAC)
3877 continue; 3880 continue;
3878 rc = ata_eh_maybe_retry_flush(dev); 3881 rc = ata_eh_maybe_retry_flush(dev);
3879 if (rc) 3882 if (rc)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 0586f66d70fa..bea6e7f4ebf0 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -235,7 +235,8 @@ static ssize_t ata_scsi_park_store(struct device *device,
235 rc = -ENODEV; 235 rc = -ENODEV;
236 goto unlock; 236 goto unlock;
237 } 237 }
238 if (dev->class != ATA_DEV_ATA) { 238 if (dev->class != ATA_DEV_ATA &&
239 dev->class != ATA_DEV_ZAC) {
239 rc = -EOPNOTSUPP; 240 rc = -EOPNOTSUPP;
240 goto unlock; 241 goto unlock;
241 } 242 }
@@ -3412,7 +3413,7 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
3412 ata_xlat_func_t xlat_func; 3413 ata_xlat_func_t xlat_func;
3413 int rc = 0; 3414 int rc = 0;
3414 3415
3415 if (dev->class == ATA_DEV_ATA) { 3416 if (dev->class == ATA_DEV_ATA || dev->class == ATA_DEV_ZAC) {
3416 if (unlikely(!scmd->cmd_len || scmd->cmd_len > dev->cdb_len)) 3417 if (unlikely(!scmd->cmd_len || scmd->cmd_len > dev->cdb_len))
3417 goto bad_cdb_len; 3418 goto bad_cdb_len;
3418 3419
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index e37413228228..3227b7c8a05f 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -143,6 +143,7 @@ static struct {
143 { ATA_DEV_PMP_UNSUP, "pmp" }, 143 { ATA_DEV_PMP_UNSUP, "pmp" },
144 { ATA_DEV_SEMB, "semb" }, 144 { ATA_DEV_SEMB, "semb" },
145 { ATA_DEV_SEMB_UNSUP, "semb" }, 145 { ATA_DEV_SEMB_UNSUP, "semb" },
146 { ATA_DEV_ZAC, "zac" },
146 { ATA_DEV_NONE, "none" } 147 { ATA_DEV_NONE, "none" }
147}; 148};
148ata_bitfield_name_search(class, ata_class_names) 149ata_bitfield_name_search(class, ata_class_names)