From patchwork Mon Oct 17 09:20:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 3292 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1339195wrs; Mon, 17 Oct 2022 01:53:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM54IfUOvamBz9N0O/8hm4qK+oQ0+nMRcsRarDoj/ac2Kf5bCBYHnCpylnfPagGkdE/j68fT X-Received: by 2002:a05:6402:5510:b0:459:5ea:9bc0 with SMTP id fi16-20020a056402551000b0045905ea9bc0mr9111842edb.152.1665996795786; Mon, 17 Oct 2022 01:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665996795; cv=none; d=google.com; s=arc-20160816; b=kVfPZI2Bfula7yq2mmZJ/7DnjOvs6TdajuZzQOuwmoeGEpi79PEBWkNtHwZoRt8zNV 9RyrvR08C5eSdLuf5AfsxXBUXVXSDpjogOF2of4SPpJK0p9WwOjyHXIsa+Q4vojurxUD Xr/Y9pRb9NzlY0IQzG686iTVuu7hlFAnOasZRvQu22Zp3ayu28/0TK0M2yt2YJqrQVrz Qw3JS8do51IS6iKRLGjTxWguQpJ/Dwdnxe8ioonaN7+MptW+8/36yGr1EhsGew3l4py3 uPK9AX34UVfNa+kZdkmTSCCa0+Gy5tkPSFUNTqwxIhD4gsbedlQARv+HiNnZHYoGIKTZ sGew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=O+Gr85pMbCO2oB7cTgz0SSIjMaWUB4mvjec5qlUYs3E=; b=FIKr3Z6160AWp5LyfVg6KkFPi8/yuDPnf2OOHEsN57/OiaYp7VuPHQ2LlQYbIafH7t g8BekTPpQlfxI/KgS1weOKzD6BN3IgoPrxC/5lxk8exMwOlxfS4Qg480N0a9N7hVekWh YE+ZuZM5tjTjUi5Vab+DgEZruUmyjbNDSYs6D9vOeaM43zPFrJGDAptPx5mOjVO9FYDE EuUgkC8n8qePWTcCLjQFGV5Hk3Gp2Rp4RtAZdPcwE6K5Wbhyk2woLh3c8KSt06Y+cM4h z03OOwI/txJlluyIn3zm3ut9qxAhq61dpQSvaaBh/0oTAQyd7FOWXVxGneHrVwnUR1EH y5kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du6-20020a17090772c600b0078c0c866a18si9020159ejc.19.2022.10.17.01.52.45; Mon, 17 Oct 2022 01:53:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230268AbiJQIv2 (ORCPT + 99 others); Mon, 17 Oct 2022 04:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbiJQIut (ORCPT ); Mon, 17 Oct 2022 04:50:49 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C3603684E; Mon, 17 Oct 2022 01:50:37 -0700 (PDT) Received: from fraeml735-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MrVxG0P6bz6J65C; Mon, 17 Oct 2022 16:47:30 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml735-chm.china.huawei.com (10.206.15.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 17 Oct 2022 10:50:35 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 17 Oct 2022 09:50:31 +0100 From: John Garry To: , , , CC: , , , , , "John Garry" Subject: [PATCH v6 8/8] scsi: libsas: Update SATA dev FIS in sas_ata_task_done() Date: Mon, 17 Oct 2022 17:20:35 +0800 Message-ID: <1665998435-199946-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1665998435-199946-1-git-send-email-john.garry@huawei.com> References: <1665998435-199946-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746924255768881029?= X-GMAIL-MSGID: =?utf-8?q?1746924255768881029?= In sas_ata_task_done(), for commands which complete with error we set the SATA dev FIS status field with ATA_ERR. In ata_eh_analyze_tf() this would be interpreted as a HSM error. Set ATA_DRDY, which will lead libata to judge as a device error, which is a safer bet. Signed-off-by: John Garry Reviewed-by: Niklas Cassel --- drivers/scsi/libsas/sas_ata.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 61f64d54e67d..78e6046fb55a 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -139,8 +139,8 @@ static void sas_ata_task_done(struct sas_task *task) qc->flags |= ATA_QCFLAG_FAILED; } - dev->sata_dev.fis[3] = 0x04; /* status err */ - dev->sata_dev.fis[2] = ATA_ERR; + dev->sata_dev.fis[2] = ATA_ERR | ATA_DRDY; /* tf status */ + dev->sata_dev.fis[3] = ATA_ABORTED; /* tf error */ } }