From patchwork Fri Sep 6 12:55:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 173237 Delivered-To: patch@linaro.org Received: by 2002:ac9:19ad:0:0:0:0:0 with SMTP id d45csp601093oce; Fri, 6 Sep 2019 05:59:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvxjsNzLokiHtOMSWVKAZzCNim4O1tMytA4IR+i23DsC1mIdAPs3Hwcrk2reDGiXryc6Vo X-Received: by 2002:a17:90a:e281:: with SMTP id d1mr9867066pjz.72.1567774757304; Fri, 06 Sep 2019 05:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567774757; cv=none; d=google.com; s=arc-20160816; b=OxwicvzC5vkSzTihsRCdEUcZYFGoZ1+EYgSt0Bp7ojj2Krjf4RZIfptEJ6aCQLsDYt enNCrDY8QgQsgvNBarq8jf2dt5drJ4OpbSdcaq6CxdrHsQ0YIaC13DT5K8ype9Zj3PwL JX6PzctQy7mV0gEcwhGEQd8GKsZc7Koae5R2/dn1nxGbnYDhP80zBgkNi8HtLJrfzzQG 9hgLYsJhngs9ERxBYRE70004y3i9MtxlwzHHNJz5YFfGWfK0sDzjXwge8604S5H4ci// O2Mw+ZQt/etZmExywQSrulS4jATHNDQKvEwCwWmEx7OYn25ABHP0W9Vs3t7VnvuGM8gF 04Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=iWgaJ9VJYju1ndB1+bKxvfh5oZI5SzfE+pqa0PXE810=; b=sQYeVWV3E5Xl7Lye3YjxFWAPaWfGTfiRBAMEIsDX3Dlc6YP85wS/aDyeKWenchRS4f A6OjbYbrZW5oXl3lWfdXvhwYmp4JTxew5j3mgRzU/ZBsRqGP2IARa9xS7K0YGCxnWnk+ NIO1PIt1Uj6Ilf868YT+BKQFBafVQvb/f/ma03BRGY+dj0IZRJCrPkd0H6ofLQjL2oF2 mc+cc6Sm2y+C02iYT9uqbe6v4uTuq6JZGGFpEsWF7uc1KWW0lDOhLabxm9mxidr04xqw ofEkFFL7ZNiNRQFYFU5F6xgREElEYaRB7aytBE8eyPTP9LCAlpKTUDEOvNpfI8JZcKWC xyjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 132si4334929pgc.134.2019.09.06.05.59.17 for ; Fri, 06 Sep 2019 05:59:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404942AbfIFM7Q (ORCPT ); Fri, 6 Sep 2019 08:59:16 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6696 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404884AbfIFM6N (ORCPT ); Fri, 6 Sep 2019 08:58:13 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C61FA35816A01BA2A796; Fri, 6 Sep 2019 20:58:10 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Fri, 6 Sep 2019 20:58:01 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , "John Garry" Subject: [PATCH 03/13] scsi: hisi_sas: Directly return when running I_T_nexus reset if phy disabled Date: Fri, 6 Sep 2019 20:55:27 +0800 Message-ID: <1567774537-20003-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1567774537-20003-1-git-send-email-john.garry@huawei.com> References: <1567774537-20003-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing At hisi_sas_debug_I_T_nexus_reset(), we call sas_phy_reset() to reset a phy. But if the phy is disabled, sas_phy_reset() will directly return -ENODEV without issue a phy reset request. If so, We can directly return -ENODEV to libsas before issue a phy reset. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 47faa283312e..5642c53cccae 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1752,6 +1752,11 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device) DECLARE_COMPLETION_ONSTACK(phyreset); int rc, reset_type; + if (!local_phy->enabled) { + sas_put_local_phy(local_phy); + return -ENODEV; + } + if (scsi_is_sas_phy_local(local_phy)) { struct asd_sas_phy *sas_phy = sas_ha->sas_phy[local_phy->number];