Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0f79f7a authored by Christian Borntraeger's avatar Christian Borntraeger Committed by Jeff Garzik
Browse files

ata: fix wrong WARN_ON_ONCE



This patch fixes a wrong WARN_ON that was triggered by 32bit PIO support:
WARNING: at drivers/ata/libata-sff.c:1017 ata_sff_hsm_move+0x45e/0x750()

__atapi_pio_bytes simply doesnt know enough to decide if there is a bug.

Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 37a76bd4
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -1013,9 +1013,12 @@ static int __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
		qc->cursg_ofs = 0;
		qc->cursg_ofs = 0;
	}
	}


	/* consumed can be larger than count only for the last transfer */
	/*
	WARN_ON_ONCE(qc->cursg && count != consumed);
	 * There used to be a  WARN_ON_ONCE(qc->cursg && count != consumed);

	 * Unfortunately __atapi_pio_bytes doesn't know enough to do the WARN
	 * check correctly as it doesn't know if it is the last request being
	 * made. Somebody should implement a proper sanity check.
	 */
	if (bytes)
	if (bytes)
		goto next_sg;
		goto next_sg;
	return 0;
	return 0;