{"id":2198035,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2198035/?format=json","project":{"id":13,"url":"http://patchwork.ozlabs.org/api/1.0/projects/13/?format=json","name":"Linux IDE development","link_name":"linux-ide","list_id":"linux-ide.vger.kernel.org","list_email":"linux-ide@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260219062312.1030867-6-dlemoal@kernel.org>","date":"2026-02-19T06:23:12","name":"[5/5] ata: libata-scsi: rename and improve ata_qc_done()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"d749b8e3ce8dc1045306df82fadd2427514a94f9","submitter":{"id":86188,"url":"http://patchwork.ozlabs.org/api/1.0/people/86188/?format=json","name":"Damien Le Moal","email":"dlemoal@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ide/patch/20260219062312.1030867-6-dlemoal@kernel.org/mbox/","series":[{"id":492640,"url":"http://patchwork.ozlabs.org/api/1.0/series/492640/?format=json","date":"2026-02-19T06:23:07","name":"libata cleanups","version":1,"mbox":"http://patchwork.ozlabs.org/series/492640/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2198035/checks/","tags":{},"headers":{"Return-Path":"\n <linux-ide+bounces-5020-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ide@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=C8+n2VA8;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-ide+bounces-5020-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"C8+n2VA8\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGk3N3Cr8z1xy4\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 17:28:32 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id AF06D300F1A8\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 06:28:30 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7A74A2DC339;\n\tThu, 19 Feb 2026 06:28:30 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 58A3C285CB3\n\tfor <linux-ide@vger.kernel.org>; Thu, 19 Feb 2026 06:28:30 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id D91D7C19421;\n\tThu, 19 Feb 2026 06:28:29 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1771482510; cv=none;\n b=uNlnAAopCh/QqtGYzbBiIOH+MOdJ3q+1v3phzXJVdQhRZrat0oNYccK1aGUlOT5i7KDo8sWN5N/JXQIELteGRGy5fOH3FEJDcPB4L/LG21xkOzTHgKModyRY9uNx150hQ6ghYcafkv95tKX+lvU0fSmy5awKxfE8MJi4qHkwjxU=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1771482510; c=relaxed/simple;\n\tbh=wZLlL1KwtSO1kMsJvBEU+MBFbevqcaCRJwDuymA53Tg=;\n\th=From:To:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=AVsS2B3fahWQQP4BaMfyoRziAyJfgbccJBZBxKEStPAi5mElfn/gxkzua8UYrRyotmXIYjoG0ft4JLPkMOlTDvCvf1Vm3alU8XPMiTzvszP11WB9iRXV91QvKZaljpYUAz8LwTXDkWRF8xNikMa80xTYvyjv7TqWUr9CwDbbehw=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=C8+n2VA8; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1771482510;\n\tbh=wZLlL1KwtSO1kMsJvBEU+MBFbevqcaCRJwDuymA53Tg=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=C8+n2VA8INZ/65qDMTZMPxhcCc7BIMQ3EB3ktU6kP3NCmWkZdvh6MoRLmYDcQisM3\n\t Na1c4vnhz+XZOjWRcFyDZKZXu43zAlxHFKfcWIsMyRgVKL8f19a99hqGHS1DVc+cKW\n\t d7wOk9IUk6X5lklilvu6bAkvwb+Vr6IRc75g1Z4YRbCvM4jz9KTT1GQuSZD9jAXRnu\n\t 0wzzKm8Q8m94DJRoSq94JowUE5rJV4SQwBVBPWbtAXnf2V7A9pw9xc2xBaIivIRaMD\n\t K4YdZKg8QLuy/1weEvUk52RcNDgAiEBNXMQqvfN3LAyWagd0Z2Gm7BdxUGYmuuFQuZ\n\t hmi8TxXxIiVhA==","From":"Damien Le Moal <dlemoal@kernel.org>","To":"linux-ide@vger.kernel.org,\n\tNiklas Cassel <cassel@kernel.org>","Subject":"[PATCH 5/5] ata: libata-scsi: rename and improve ata_qc_done()","Date":"Thu, 19 Feb 2026 15:23:12 +0900","Message-ID":"<20260219062312.1030867-6-dlemoal@kernel.org>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260219062312.1030867-1-dlemoal@kernel.org>","References":"<20260219062312.1030867-1-dlemoal@kernel.org>","Precedence":"bulk","X-Mailing-List":"linux-ide@vger.kernel.org","List-Id":"<linux-ide.vger.kernel.org>","List-Subscribe":"<mailto:linux-ide+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ide+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"Rename ata_qc_done() to ata_scsi_qc_done() and allow to pass a scsi\ncommand result value to set for the completed command to simplify the\ncaller sites.\n\nNo functional changes.\n\nSigned-off-by: Damien Le Moal <dlemoal@kernel.org>\n---\n drivers/ata/libata-scsi.c | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)","diff":"diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c\nindex ad628b398fc3..4225c6d7ff35 100644\n--- a/drivers/ata/libata-scsi.c\n+++ b/drivers/ata/libata-scsi.c\n@@ -1649,12 +1649,16 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc)\n \treturn 1;\n }\n \n-static void ata_qc_done(struct ata_queued_cmd *qc)\n+static void ata_scsi_qc_done(struct ata_queued_cmd *qc, bool set_result,\n+\t\t\t     u32 scmd_result)\n {\n \tstruct scsi_cmnd *cmd = qc->scsicmd;\n \tvoid (*done)(struct scsi_cmnd *) = qc->scsidone;\n \n \tata_qc_free(qc);\n+\n+\tif (set_result)\n+\t\tcmd->result = scmd_result;\n \tdone(cmd);\n }\n \n@@ -1693,12 +1697,10 @@ void ata_scsi_requeue_deferred_qc(struct ata_port *ap)\n \t * do not try to be smart about what to do with this deferred command\n \t * and simply retry it by completing it with DID_SOFT_ERROR.\n \t */\n-\tif (!qc)\n-\t\treturn;\n-\n-\tap->deferred_qc = NULL;\n-\tqc->scsicmd->result = (DID_SOFT_ERROR << 16);\n-\tata_qc_done(qc);\n+\tif (qc) {\n+\t\tap->deferred_qc = NULL;\n+\t\tata_scsi_qc_done(qc, true, DID_SOFT_ERROR << 16);\n+\t}\n }\n \n static void ata_scsi_schedule_deferred_qc(struct ata_port *ap)\n@@ -1754,7 +1756,7 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)\n \t\tata_scsi_set_sense_information(qc);\n \t}\n \n-\tata_qc_done(qc);\n+\tata_scsi_qc_done(qc, false, 0);\n \n \tata_scsi_schedule_deferred_qc(ap);\n }\n@@ -2913,17 +2915,15 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)\n \t\tif (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev)\n \t\t\tqc->dev->sdev->locked = 0;\n \n-\t\tqc->scsicmd->result = SAM_STAT_CHECK_CONDITION;\n-\t\tata_qc_done(qc);\n+\t\tata_scsi_qc_done(qc, true, SAM_STAT_CHECK_CONDITION);\n \t\treturn;\n \t}\n \n \t/* successful completion path */\n \tif (cmd->cmnd[0] == INQUIRY && (cmd->cmnd[1] & 0x03) == 0)\n \t\tatapi_fixup_inquiry(cmd);\n-\tcmd->result = SAM_STAT_GOOD;\n \n-\tata_qc_done(qc);\n+\tata_scsi_qc_done(qc, true, SAM_STAT_GOOD);\n }\n /**\n  *\tatapi_xlat - Initialize PACKET taskfile\n","prefixes":["5/5"]}