From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 621B61A76B3; Tue, 30 Jul 2024 17:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722360015; cv=none; b=Mr+4LP6oN/aL/MG8wKU0M0FYoEe61dbMRJfZ5+SOB7Plv5pO2DjRubd919JkpTsG5tZc9kEkCb1fti1nnqso+GReUNAvBJzsbQWqXCAw686neeXzqLtxcsTql+rsigswyYAJAXfVZYNXQe/PfuCRdpedkoU/31rCqy1H8Oqhtd4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722360015; c=relaxed/simple; bh=7FVNhjk4IBIoXClQySHqX2Rh4jwfkv5/5D8oudYQ6nE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dkx03WOOJ6vao0aOKuu/pZuDEzt/ie3LSJqjwBIKK8sDQXazivkA1LKZ+j0RUxBdoWc8Sto8VWygW7NtDEdJKaZIMEOZwyFPqZ+xI44Bcka5tTEuNyIAUAm0exfVy/eurABxLAe/Ro7cDmn+Lv44bf0VsrMRZP/avD7GTiRoJXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FZedVn3e; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FZedVn3e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC65AC32782; Tue, 30 Jul 2024 17:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722360015; bh=7FVNhjk4IBIoXClQySHqX2Rh4jwfkv5/5D8oudYQ6nE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZedVn3eMHWTjcjNokJUBBm+E6LWNUf7y8AJZdYNxh0nrpdLIJpPcWoT6+9OdoIxE HYJ3Zy0lOJyvOd8n+p+SJvwwc6eiUXZg8y2RkuSYFxUEy5I/WpxeE4FVEl1sNYiGkI 0R6mV7TcTmMq5RxrxOFhLSoTpgvsvaxQTiekjwmQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Niklas Cassel , Igor Pylypiv , Hannes Reinecke Subject: [PATCH 6.10 571/809] ata: libata-scsi: Honor the D_SENSE bit for CK_COND=1 and no error Date: Tue, 30 Jul 2024 17:47:27 +0200 Message-ID: <20240730151747.329223708@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240730151724.637682316@linuxfoundation.org> References: <20240730151724.637682316@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Igor Pylypiv commit 28ab9769117ca944cb6eb537af5599aa436287a4 upstream. SAT-5 revision 8 specification removed the text about the ANSI INCITS 431-2007 compliance which was requiring SCSI/ATA Translation (SAT) to return descriptor format sense data for the ATA PASS-THROUGH commands regardless of the setting of the D_SENSE bit. Let's honor the D_SENSE bit for ATA PASS-THROUGH commands while generating the "ATA PASS-THROUGH INFORMATION AVAILABLE" sense data. SAT-5 revision 7 ================ 12.2.2.8 Fixed format sense data Table 212 shows the fields returned in the fixed format sense data (see SPC-5) for ATA PASS-THROUGH commands. SATLs compliant with ANSI INCITS 431-2007, SCSI/ATA Translation (SAT) return descriptor format sense data for the ATA PASS-THROUGH commands regardless of the setting of the D_SENSE bit. SAT-5 revision 8 ================ 12.2.2.8 Fixed format sense data Table 211 shows the fields returned in the fixed format sense data (see SPC-5) for ATA PASS-THROUGH commands. Cc: stable@vger.kernel.org # 4.19+ Reported-by: Niklas Cassel Closes: https://lore.kernel.org/linux-ide/Zn1WUhmLglM4iais@ryzen.lan Reviewed-by: Niklas Cassel Signed-off-by: Igor Pylypiv Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20240702024735.1152293-4-ipylypiv@google.com Signed-off-by: Niklas Cassel Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libata-scsi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -941,11 +941,8 @@ static void ata_gen_passthru_sense(struc &sense_key, &asc, &ascq); ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq); } else { - /* - * ATA PASS-THROUGH INFORMATION AVAILABLE - * Always in descriptor format sense. - */ - scsi_build_sense(cmd, 1, RECOVERED_ERROR, 0, 0x1D); + /* ATA PASS-THROUGH INFORMATION AVAILABLE */ + ata_scsi_set_sense(qc->dev, cmd, RECOVERED_ERROR, 0, 0x1D); } }