{"id":2198033,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2198033/?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-2-dlemoal@kernel.org>","date":"2026-02-19T06:23:08","name":"[1/5] ata: libata-core: improve tag checks in ata_qc_issue()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"95b3a02b50ccbd0fc9d3b9ae18f8a4a28636a9cd","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-2-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/2198033/checks/","tags":{},"headers":{"Return-Path":"\n <linux-ide+bounces-5016-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=oAq27e2F;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ide+bounces-5016-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=\"oAq27e2F\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::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 4fGk3M5CsYz1xxd\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 17:28:31 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 7EA7630214EB\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 06:28:28 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id E5C81285CB3;\n\tThu, 19 Feb 2026 06:28:27 +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 C39F72F3C37\n\tfor <linux-ide@vger.kernel.org>; Thu, 19 Feb 2026 06:28:27 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 50CF9C19421;\n\tThu, 19 Feb 2026 06:28:27 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1771482507; cv=none;\n b=n42oo/tmK5aEIMJ/TphbDu3FsKbMr2DcjW5wI+D3kXpo0sH5XyudqLXKBaJYfpmH/1fhXYSN1BKh7O+MyIRX9uotWOWHbr/Rw2x6GUknIgEla7N0RjWe1qIimXCjhy/x/Z2Jk8wRKdXv9grQzj6RrxZlLBghZHSemYaT/K0vH6w=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1771482507; c=relaxed/simple;\n\tbh=f8wWBUccu3jEQHtV1Ysifyz36R8Ez5+wCy0Z8BRc+xs=;\n\th=From:To:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=qn0SWmD1MS8yuOcwxucbH/5owC2IQObTb+YyiL3FKSHPfgAPIpa6RTchAj5DPEgE91Bpwqhj1o0SxAI+5HWHESGZlT7Ojn/SGQ69msLrFxUUpNhiV7mJFxELyXhVjv29Jy+gVlItZEefDIBW7CpjOQ/fED9iW5z1PIIX3O7GqWE=","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=oAq27e2F; 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=1771482507;\n\tbh=f8wWBUccu3jEQHtV1Ysifyz36R8Ez5+wCy0Z8BRc+xs=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=oAq27e2FG0Mq7a9sa6rLJTBox9Pk1Z17uPJrhgkavsVp4PVTmxcm3vhSaqRtYxcNj\n\t EVmvkAhhy5bERAzWe0RiEBPetcGR9A6oU1+jjDt2B5jPFggFfcae2C1P/v1yEVcV1X\n\t BYjpOFQY2gTXtwGU07wFYxNhW5q+WOcZz9+EK3vQIvj9OAfw7f18Wq+r8Ps5JsMRIH\n\t KbkYtLpziIc2D6X/xLR2+3MyvZJmXX6UVd3P9D1HKYCU41vHXzUGwW/T5cy9QA+ZaD\n\t Z1I73YO2onz5wcFzuoy3rcx5J7v4jubnxx9N3NhM1oxplRXMG/EZfel39hmuovCwA4\n\t /SBE6fNrjQXog==","From":"Damien Le Moal <dlemoal@kernel.org>","To":"linux-ide@vger.kernel.org,\n\tNiklas Cassel <cassel@kernel.org>","Subject":"[PATCH 1/5] ata: libata-core: improve tag checks in ata_qc_issue()","Date":"Thu, 19 Feb 2026 15:23:08 +0900","Message-ID":"<20260219062312.1030867-2-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":"Make sure to check that the tag of a queued command is valid when\nata_qc_issue() is called, and fail the QC if the tag is not valid, or if\nthere is an on-going non-NCQ command already on the link.\n\nSigned-off-by: Damien Le Moal <dlemoal@kernel.org>\n---\n drivers/ata/libata-core.c | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)","diff":"diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c\nindex beb6984b379a..0c42fb74eaf1 100644\n--- a/drivers/ata/libata-core.c\n+++ b/drivers/ata/libata-core.c\n@@ -5146,8 +5146,13 @@ void ata_qc_issue(struct ata_queued_cmd *qc)\n \tstruct ata_link *link = qc->dev->link;\n \tu8 prot = qc->tf.protocol;\n \n-\t/* Make sure only one non-NCQ command is outstanding. */\n-\tWARN_ON_ONCE(ata_tag_valid(link->active_tag));\n+\t/*\n+\t * Make sure we have a valid tag and that only one non-NCQ command is\n+\t * outstanding.\n+\t */\n+\tif (WARN_ON_ONCE(!ata_tag_valid(qc->tag)) ||\n+\t    WARN_ON_ONCE(ata_tag_valid(link->active_tag)))\n+\t\tgoto sys_err;\n \n \tif (ata_is_ncq(prot)) {\n \t\tWARN_ON_ONCE(link->sactive & (1 << qc->hw_tag));\n","prefixes":["1/5"]}