From 4e8b49b325927d1dd13e9732a6dc9db8469f524f Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Wed, 12 Mar 2025 21:39:54 +0800 Subject: [PATCH] ata: libata: Improve return value of atapi_check_dma() atapi_check_dma() allows a LLD to filter ATAPI commands, returning a status indicating whether or not it is OK to use DMA for the supplied ATAPI command. Change atapi_check_dma() to return -EOPNOTSUPP instead of 1 for an ATAPI command that is not allowed to use DMA. Signed-off-by: Huacai Chen Link: https://lore.kernel.org/r/20250312133954.6666-1-chenhuacai@loongson.cn [cassel: improve commit log] Signed-off-by: Niklas Cassel Signed-off-by: maoxiaochuan --- drivers/ata/libata-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c085dd81e..2f5af295e 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4544,7 +4544,7 @@ int atapi_check_dma(struct ata_queued_cmd *qc) */ if (!(qc->dev->quirks & ATA_QUIRK_ATAPI_MOD16_DMA) && unlikely(qc->nbytes & 15)) - return 1; + return -EOPNOTSUPP; if (ap->ops->check_atapi_dma) return ap->ops->check_atapi_dma(qc);