From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F153C2DA759 for ; Sun, 12 Apr 2026 16:32:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776011541; cv=none; b=d8nBtvDAxK8mgzbnshMikyEXesrryjkJd+tLxvMvdQL05orxJn6rVlt7sDCvq/Lar36a45M1fAnTXb5oSb1f0rrZpHjyVG2lbBzi6VdmBkRKk9kTMwgj3diY/EXm/WsHWSiHkNZ8bcTwBT3Iq8mZF0wClJPDqolHgdnL3Cm8kwM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776011541; c=relaxed/simple; bh=N9zrlSTKQS45AFKICqF0j/XBy6/Y0wUUsIg3ODDjpBI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Zq1OxmT5+XPK768D9ZYnG+BSEzDcKV20vNtqboAqPy9zZK+R4+WkdSUAAZ16BSI8K+62Yyz7nVCdwcDwGZMNRbYIVtARZy1X12URTOlhmU78VpYgL1pkJR69tpw4lbAFwHwUy8vS7cOZcWKfYyNqHSgs0o2Ida3+HdSrvESr+5A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nNtzmO+s; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nNtzmO+s" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-38ddd8d3b7fso26565641fa.3 for ; Sun, 12 Apr 2026 09:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776011538; x=1776616338; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/bcpisGuz2lQhjFsaoHWs5e0zfTCqxg+SMoBVOvRKSw=; b=nNtzmO+sg74EDsBMxCiY4TW5o7PwzRa9giC0oVY8OTrEpNT/hr+3Nupw3WCQ1T74Gd k4kjjfihGQ4BGeEPZ5AG2VSRVvTQrpk7+HdyoEJ1m5iwzPp2H8DS9rMZgIqdI1JAQ1sd GlMukWuqpVwAz6cFfp6HsFz9CtS0LY8gjmDSVW7MTOHWwGDP5TRj0e4mzsMgqjpWuXfB s1dUCFKMEIBIkGekrxFbePm8fhn8AMJ34pJDnUY7Qv4fwflDWG5PrLubyNm3awnKt6jd noMiLp5ij3xx1c7Ued85usI9QfoOkmVSV5u8wxfrhwJII29wzJK9BMgHGPPP8s5kddM2 CkwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776011538; x=1776616338; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/bcpisGuz2lQhjFsaoHWs5e0zfTCqxg+SMoBVOvRKSw=; b=fwTZT1WvBk211bsSR2oobYXdDsbKULQIlu9tL+5124vtIk0ilvUBd9ivuv8xr+HObB 0OsRgVpr1Q82BBM1H0npD2AQp74FgxM0oPAO2w3XSAmSkeFkhXzUoat1Qbi8f9/5UNUL Tz2WYXNYNk7Y91O+532AiJ6cibTr2RbewhDVA43l1Ljy76awXynmQ5vCxCAINesHzw91 FhRMVnsDjAuKcan1pUBcRAN5hSPA7tutKLbCXzbAgHw1qGnJy0uX5BIg0lZ5HB5fPvJY GDfRLPaQc53nFmfsw1J5awfyQQq55cgRrOW66MjqMcNmaGTPsM5nkUGw4NmODJIJ4NeI tPvA== X-Forwarded-Encrypted: i=1; AFNElJ++J43w/6TaAIetfrKiIY7/B0tRoQGXT6uL6e6+PmnFoKNpZkkqCI1rr2Cski1RavzM5yMoMU+zM7wWQh8=@vger.kernel.org X-Gm-Message-State: AOJu0YzsW/nSYjoBcWeGQsnmvyjbHdf6tlAK67xwlvVCMxmfDqJ2X7Vx GPwFs90AXbmfOWOhc2t2I0oCq44kCIKApkon7bKKpEDM0DX5lmogIera X-Gm-Gg: AeBDietpI2v9Wx5FokUhsAU1kfxvZ6VC6TLY0O+qiU8UqYKbo2FjohryqeL3XTomj7Q HhDAyMTwPzPfdBwcVXcS+WUJR+iYU6HmYwSpOpaGDD4KFinQ3xeqkK5SNljLk1bpPY1/ZE8JgK6 l+TU+OLOZmFGwB9kzCUFUlg8DL+ZDOh9KD1aOjYdqt+SbjrWF9HYlWyVMDmX8z6ZHJklJ5PVpSg 9T1SrRQ8HH7eoHXIpHGWB74XetKu5AAjYCMQbPonWeX1fiIS/VT/lGT2FNEzgOmj9Ynkge8We2C NbMVUAgqbUFO9+uvnvuXXRIm/fNyFa9iczC6ag8S3MYUuH9P4oL4SckQv26FMSms67M4mOueB1z vnjfPFLIfBIPFc8QdmOdNqSiRFdMDrPvMS6416CCBJ6VoUX3/bvp4y6+jSXFMNVy1nvfmALGBtR gosALCUj9o5e/+rEDI3/OvA20N+8sDGogi401sujhYb2rxkgB62/cbezSrCyZcsMQb0P4lO9HWK 5PyT/c= X-Received: by 2002:a2e:8a87:0:b0:38e:2de3:f8ad with SMTP id 38308e7fff4ca-38e4bdcac07mr32216401fa.4.1776011537827; Sun, 12 Apr 2026 09:32:17 -0700 (PDT) Received: from ?IPV6:2a00:1fa0:2f6:3ecd:1aeb:dc21:a8b0:f47f? ([2a00:1fa0:2f6:3ecd:1aeb:dc21:a8b0:f47f]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-38e495ae96fsm17725851fa.39.2026.04.12.09.32.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Apr 2026 09:32:17 -0700 (PDT) Message-ID: <7cf53a95-76a2-4be9-a57b-0887a28bbe3a@gmail.com> Date: Sun, 12 Apr 2026 19:32:15 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v=2] ata: libata-scsi: fix requeue of deferred ATA PASS-THROUGH commands To: Igor Pylypiv , Damien Le Moal , Niklas Cassel Cc: "Martin K. Petersen" , John Garry , Xingui Yang , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260412153637.475606-1-ipylypiv@google.com> Content-Language: en-US From: Sergey Shtylyov In-Reply-To: <20260412153637.475606-1-ipylypiv@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/12/26 6:36 PM, Igor Pylypiv wrote: > Commit 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation") > introduced ata_scsi_requeue_deferred_qc() to handle commands deferred > during resets or NCQ failures. This deferral logic completed commands > with DID_SOFT_ERROR to trigger a retry in the SCSI mid-layer. > > However, DID_SOFT_ERROR is subject to scsi_cmd_retry_allowed() checks. > ATA PASS-THROUGH commands sent via SG_IO ioctl have scmd->allowed set > to zero. This causes the mid-layer to fail the command immediately > instead of retrying, even though the command was never actually issued > to the hardware. > > Switch to DID_REQUEUE to ensure these commands are inserted back into > the request queue regardless of retry limits. > > Fixes: 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation") > Reviewed-by: Damien Le Moal > Signed-off-by: Igor Pylypiv > --- > > Changes from v1: > - Dropped the usage of set_host_byte() because it is logically a separate > change from what this commit is fixing. set_host_byte() does not clear > the status byte and the ML byte. > > drivers/ata/libata-scsi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c > index 3b65df914ebb..cd607911d724 100644 > --- a/drivers/ata/libata-scsi.c > +++ b/drivers/ata/libata-scsi.c [...] > @@ -1701,7 +1701,7 @@ void ata_scsi_requeue_deferred_qc(struct ata_port *ap) > ap->deferred_qc = NULL; > cancel_work(&ap->deferred_qc_work); > ata_qc_free(qc); > - scmd->result = (DID_SOFT_ERROR << 16); > + scmd->result = (DID_REQUEUE << 16); You could drop the useless parens, while at it... > scsi_done(scmd); > } > MBR, Sergey