Commit 7ebd8c5a authored by Damien Le Moal's avatar Damien Le Moal
Browse files

ata: libata: Use QUIRK instead of HORKAGE

According to Wiktionary, the verb "hork" is computing slang defined as
"To foul up; to be occupied with difficulty, tangle, or unpleasantness;
to be broken" (https://en.wiktionary.org/wiki/hork#Verb

). libata uses
this with the term "horkage" to refer to broken device features. Given
that this term is not widely used and its meaning unknown to many,
rename it to the more commonly used term "quirk", similar to many other
places in the kernel.

The renaming done is:
1) Rename all ATA_HORKAGE_XXX flags to ATA_QUIRK_XXX
2) Rename struct ata_device horkage field to quirks
3) Rename struct ata_blacklist_entry to struct ata_dev_quirks_entry. The
   array of these structures defining quirks for known devices is
   renamed __ata_dev_quirks.
4) The functions ata_dev_blacklisted() and ata_force_horkage() are
   renamed to ata_dev_quirks() and ata_force_quirks() respectively.
5) All the force_horkage_xxx() macros are renamed to force_quirk_xxx()

And while at it, make sure that the type "unsigned int" is used
consistantly for quirk flags variables and data structure fields.

Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarNiklas Cassel <cassel@kernel.org>
Reviewed-by: default avatarIgor Pylypiv <ipylypiv@google.com>
parent f209d8ed
Loading
Loading
Loading
Loading
+245 −245

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -818,7 +818,7 @@ static ssize_t ata_scsi_lpm_store(struct device *device,

	ata_for_each_link(link, ap, EDGE) {
		ata_for_each_dev(dev, &ap->link, ENABLED) {
			if (dev->horkage & ATA_HORKAGE_NOLPM) {
			if (dev->quirks & ATA_QUIRK_NOLPM) {
				count = -EOPNOTSUPP;
				goto out_unlock;
			}
+4 −5
Original line number Diff line number Diff line
@@ -2083,7 +2083,7 @@ static unsigned int ata_scsiop_inq_b0(struct ata_scsi_args *args, u8 *rbuf)
	if (ata_id_has_trim(args->id)) {
		u64 max_blocks = 65535 * ATA_MAX_TRIM_RNUM;

		if (dev->horkage & ATA_HORKAGE_MAX_TRIM_128M)
		if (dev->quirks & ATA_QUIRK_MAX_TRIM_128M)
			max_blocks = 128 << (20 - SECTOR_SHIFT);

		put_unaligned_be64(max_blocks, &rbuf[36]);
@@ -2561,11 +2561,11 @@ static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf)
		rbuf[15] = lowest_aligned;

		if (ata_id_has_trim(args->id) &&
		    !(dev->horkage & ATA_HORKAGE_NOTRIM)) {
		    !(dev->quirks & ATA_QUIRK_NOTRIM)) {
			rbuf[14] |= 0x80; /* LBPME */

			if (ata_id_has_zero_after_trim(args->id) &&
			    dev->horkage & ATA_HORKAGE_ZERO_AFTER_TRIM) {
			    dev->quirks & ATA_QUIRK_ZERO_AFTER_TRIM) {
				ata_dev_info(dev, "Enabling discard_zeroes_data\n");
				rbuf[14] |= 0x40; /* LBPRZ */
			}
@@ -3229,8 +3229,7 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
	}
	scsi_16_lba_len(cdb, &block, &n_block);

	if (!unmap ||
	    (dev->horkage & ATA_HORKAGE_NOTRIM) ||
	if (!unmap || (dev->quirks & ATA_QUIRK_NOTRIM) ||
	    !ata_id_has_trim(dev->id)) {
		fp = 1;
		bp = 3;
+5 −5
Original line number Diff line number Diff line
@@ -970,7 +970,7 @@ int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
			 * We ignore ERR here to workaround and proceed sending
			 * the CDB.
			 */
			if (!(qc->dev->horkage & ATA_HORKAGE_STUCK_ERR)) {
			if (!(qc->dev->quirks & ATA_QUIRK_STUCK_ERR)) {
				ata_ehi_push_desc(ehi, "ST_FIRST: "
					"DRQ=1 with device error, "
					"dev_stat 0x%X", status);
@@ -1045,8 +1045,8 @@ int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
					 * IDENTIFY, it's likely a phantom
					 * device.  Mark hint.
					 */
					if (qc->dev->horkage &
					    ATA_HORKAGE_DIAGNOSTIC)
					if (qc->dev->quirks &
					    ATA_QUIRK_DIAGNOSTIC)
						qc->err_mask |=
							AC_ERR_NODEV_HINT;
				} else {
@@ -1762,7 +1762,7 @@ unsigned int ata_sff_dev_classify(struct ata_device *dev, int present,
	/* see if device passed diags: continue and warn later */
	if (err == 0)
		/* diagnostic fail : do nothing _YET_ */
		dev->horkage |= ATA_HORKAGE_DIAGNOSTIC;
		dev->quirks |= ATA_QUIRK_DIAGNOSTIC;
	else if (err == 1)
		/* do nothing */ ;
	else if ((dev->devno == 0) && (err == 0x81))
@@ -1781,7 +1781,7 @@ unsigned int ata_sff_dev_classify(struct ata_device *dev, int present,
		 * device signature is invalid with diagnostic
		 * failure.
		 */
		if (present && (dev->horkage & ATA_HORKAGE_DIAGNOSTIC))
		if (present && (dev->quirks & ATA_QUIRK_DIAGNOSTIC))
			class = ATA_DEV_ATA;
		else
			class = ATA_DEV_NONE;
+3 −3
Original line number Diff line number Diff line
@@ -617,9 +617,9 @@ show_ata_dev_trim(struct device *dev,

	if (!ata_id_has_trim(ata_dev->id))
		mode = "unsupported";
	else if (ata_dev->horkage & ATA_HORKAGE_NOTRIM)
	else if (ata_dev->quirks & ATA_QUIRK_NOTRIM)
		mode = "forced_unsupported";
	else if (ata_dev->horkage & ATA_HORKAGE_NO_NCQ_TRIM)
	else if (ata_dev->quirks & ATA_QUIRK_NO_NCQ_TRIM)
		mode = "forced_unqueued";
	else if (ata_fpdma_dsm_supported(ata_dev))
		mode = "queued";
Loading