Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp548104pxb; Thu, 17 Feb 2022 09:25:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgevTISQOyzk9/0+OzPtbw1PX3o7gW0zlQViKNhDdZI2L8ybw/d/9oyhZtr4RjYMYBjoYZ X-Received: by 2002:aa7:cdd3:0:b0:410:8042:4549 with SMTP id h19-20020aa7cdd3000000b0041080424549mr3693063edw.335.1645118740296; Thu, 17 Feb 2022 09:25:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645118740; cv=none; d=google.com; s=arc-20160816; b=YhfIPxQpz5szfMTkdeJlbsN2EmSxdo6CwjigZogxYocRCbGXz14psBg8i/4/nCl1vz EjQzmLRKdo+sFJZzuiuZ5HNPMLN6GGfImMlBXz3Np4FwapuXx8PFY5se/MQJJftSxtXQ kuhQTy4FJq/oWeYeTEOYkVIdSjffmfSWBDxAx7hG/j/YLZet7GMn5szlsD3H9gby2Aeg B7f32fl3VmJSwsnFebmMlKLLMvMSI2OeC4F+dI2rvDs5RfPFxQM1cP8XnLHQh81U4uqs NCHm9Qqde7+MQQ+RghcAldAIDSjE09VI62sOrA+86ctkdwAZeoin3IfZ/3IroDRoHxl9 iqgw== 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=ocJoamn99ScVrualbrI8mWc09GFITYoPkQun2MAh0CA=; b=EHS/JhoFTNQT6Y25MM9PmcRlSk/7l9+ZZo5XGkQnYtguoaXTZrWVlsskMg5UdhcWij yP65YJMHGxWl9zUr8+QVx6wccVx9kGwC0oidNDdnZNuJnL2lXP74XKAl7WhyIEZ6Z7Hc gVt0YyBfcawS6A8Kz6ShxZAemE8OeyA5ei0Kwf293WpzoXUaKx1lP98iyDI9iDygvGFu IFXoPDICwfCBGzgtiSnJDj/79RZQXk0ql4KvtwCzNbzGe97AfTLkqu9z67AE2AIPwuU7 7jrqQ2/Xo+C0qMyEFPbEA9Mmb4ONJQmcxEjhzTZk99QHZblZfuO5NBca8yo/PG4rQYjO /abg== 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 d24si4099830edv.364.2022.02.17.09.25.15; Thu, 17 Feb 2022 09:25:40 -0800 (PST) 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 S242510AbiBQPsr (ORCPT + 99 others); Thu, 17 Feb 2022 10:48:47 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:58202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239842AbiBQPsm (ORCPT ); Thu, 17 Feb 2022 10:48:42 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E970615C9F1; Thu, 17 Feb 2022 07:48:27 -0800 (PST) Received: from fraeml711-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JzzdR1HMtz67NkB; Thu, 17 Feb 2022 23:43:55 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml711-chm.china.huawei.com (10.206.15.60) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 17 Feb 2022 16:48:25 +0100 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 17 Feb 2022 15:48:21 +0000 From: John Garry To: , , , , , , CC: , , , , , , , , John Garry Subject: [PATCH v2 01/18] scsi: libsas: Handle non-TMF codes in sas_scsi_find_task() Date: Thu, 17 Feb 2022 23:42:29 +0800 Message-ID: <1645112566-115804-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1645112566-115804-1-git-send-email-john.garry@huawei.com> References: <1645112566-115804-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: dggems704-chm.china.huawei.com (10.3.19.181) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 LLDD TMF callbacks may return linux or other error codes instead of TMF codes. This may cause problems in sas_scsi_find_task() -> .lldd_query_task(), as only TMF codes are handled there. As such, we may not return a task_disposition type from sas_scsi_find_task(). Function sas_eh_handle_sas_errors() only handles that type, and will only progress error handling for those recognised types. Return TASK_ABORT_FAILED upon exit on the assumption that the command may still be alive and error handling should be escalated. Signed-off-by: John Garry --- drivers/scsi/libsas/sas_scsi_host.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index bcb391b0c7ed..19cb954afd80 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -316,11 +316,13 @@ static enum task_disposition sas_scsi_find_task(struct sas_task *task) pr_notice("%s: task 0x%p failed to abort\n", __func__, task); return TASK_ABORT_FAILED; + default: + pr_notice("%s: task 0x%p result code %d not handled\n", + __func__, task, res); } - } } - return res; + return TASK_ABORT_FAILED; } static int sas_recover_lu(struct domain_device *dev, struct scsi_cmnd *cmd) -- 2.26.2