Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4169015rwi; Mon, 17 Oct 2022 02:27:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BjsERh0+qSsv+5I9ab2AaVOSEQvtzrtlwuTYGcSmkeWDYo2Hfp/aV1IIjLbbMa8mEviE8 X-Received: by 2002:a05:6402:5cd:b0:446:5965:f4af with SMTP id n13-20020a05640205cd00b004465965f4afmr9336985edx.12.1665998841895; Mon, 17 Oct 2022 02:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665998841; cv=none; d=google.com; s=arc-20160816; b=tPbJR7PoNoiPPnhuy+R8+z9CzFL8N8g7jxdahaVJu+WH311v9rN5oXHI1bswiL7TM9 mChvYRptr1vrmWEHLrv2K0YPh/e5WjRy+HKpLi8A/f9geKxCgtqe+ggYAeQPtiY7zxsq QT4UdA9xUBaEISBa0v0rH36OSwn75QfCDNE6TzJEMXuCQwub8yqZKP1b1E1oUstXt0Tm 6VSIXseIJ/p8XqQKZT+bn2Aw3Zb1bvbFO7+W7fx8DjJvYkpsfUTJG4bY1FWVWQ3JvjdP iPOzHELHVYuZ/C2ANABTe09UHgvH5/FqxkpUE0ogzqrij5j9ef9n2R1I7EG6lyWD8YzG Vetw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wv2-20020a170907080200b007808a356cb9si9153539ejb.627.2022.10.17.02.26.56; Mon, 17 Oct 2022 02:27:21 -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 Content-Type: text/plain 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 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 --- 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 */ } } -- 2.35.3