From patchwork Thu Apr 11 12:46:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162058 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7377410jan; Thu, 11 Apr 2019 05:47:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5OaMSWeKTDFzk0EOsGy5Qsyq4ut2XU/FajlY1dcfbTgHlnq1QoXNBK2UmbNOb2dqukEtg X-Received: by 2002:a17:902:463:: with SMTP id 90mr17152318ple.140.1554986851320; Thu, 11 Apr 2019 05:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554986851; cv=none; d=google.com; s=arc-20160816; b=vOvlatJCYJbhR37VqXd5cZdt9vhSbdwmI0rljqarhnvaFg16qGfON/307TSX4z/uqO nK84wlxinVAZsm6ja6qx4WgWzjbPqUnMiCBsDQQdrJfwmZ3KbC1XsWqiH8nd+IJkzMfT lh/AGFRfrI7W0d5+y30S0lHzceR9rnVl9wNOHwvtmweyqaPOytUISzK+Q40OKDvkdVSK QA0TXAP/YN4O4UFE8Hk8EvWRa0+YHAAQdeX7Dra0fH77EHCQHZuWNI89VTyQHBLReu5N 79uyzL2o+4c5M7OeVre4+ud4xLe7dTeeezngq1NN783UxuZsLR0xFc1pAEWBMNA2zaMl PCpA== 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=qk4YSj0D8vYZ2LHkosZbuvdLmr7uwLTqXxvC6O/Aokc=; b=TQAQZGqBSYGsJE5pDxIM82+XTQThPTIVb65LRP4mi9v+evbk2KeXP2eA4J4ulYSwrD rOZnnD3+sv1ShgF7+aFEJ7IxVZDNJ7DL+ikyZuDS+ccQF0MYbeXbBy40vwtGijJn4Fwn OrSHIF7tzFj6Cg/H+RyYcZUjgO9nNMO4/Co3EiedX+NQyQQ+gwD4hgkds12ihuiBB8Zt AT6bgNchIC/qIkHwQqMOkAYz7YRlqMYwLvsUjbqfUYNU+ikqa1YE6sw8qyJBBZeWIjZ6 5/SU2hf76YhbRByGrPDovfSrJz0kXCLNU4uz2lRloz6j2zJzkJt/s1GAv3NXisJzoVS7 9eKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 r15si34751598pgi.27.2019.04.11.05.47.31; Thu, 11 Apr 2019 05:47:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726770AbfDKMr3 (ORCPT + 31 others); Thu, 11 Apr 2019 08:47:29 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6727 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726656AbfDKMr3 (ORCPT ); Thu, 11 Apr 2019 08:47:29 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 9EA6360F8D3040CCEE90; Thu, 11 Apr 2019 20:47:24 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Apr 2019 20:47:18 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 1/9] scsi: hisi_sas: add host reset interface for test Date: Thu, 11 Apr 2019 20:46:36 +0800 Message-ID: <1554986804-233706-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com> References: <1554986804-233706-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen Add host reset interface to make it easier for testing the host reset feature. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 13 +++++++++++++ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 1 + drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 1 + drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + 4 files changed, 16 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 14bac4966c87..a1eaddcf740d 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2234,6 +2234,19 @@ void hisi_sas_kill_tasklets(struct hisi_hba *hisi_hba) } EXPORT_SYMBOL_GPL(hisi_sas_kill_tasklets); +int hisi_sas_host_reset(struct Scsi_Host *shost, int reset_type) +{ + struct hisi_hba *hisi_hba = shost_priv(shost); + + if (reset_type != SCSI_ADAPTER_RESET) + return -EOPNOTSUPP; + + queue_work(hisi_hba->wq, &hisi_hba->rst_work); + + return 0; +} +EXPORT_SYMBOL_GPL(hisi_sas_host_reset); + struct scsi_transport_template *hisi_sas_stt; EXPORT_SYMBOL_GPL(hisi_sas_stt); diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 293807443480..078ddd3871f2 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1823,6 +1823,7 @@ static struct scsi_host_template sht_v1_hw = { .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, .shost_attrs = host_attrs_v1_hw, + .host_reset = hisi_sas_host_reset, }; static const struct hisi_sas_hw hisi_sas_v1_hw = { diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 89160ab3efb0..33b72c7f72c5 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -3599,6 +3599,7 @@ static struct scsi_host_template sht_v2_hw = { .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, .shost_attrs = host_attrs_v2_hw, + .host_reset = hisi_sas_host_reset, }; static const struct hisi_sas_hw hisi_sas_v2_hw = { diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 086695a4099f..e8323d038d53 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2678,6 +2678,7 @@ static struct scsi_host_template sht_v3_hw = { .ioctl = sas_ioctl, .shost_attrs = host_attrs_v3_hw, .tag_alloc_policy = BLK_TAG_ALLOC_RR, + .host_reset = hisi_sas_host_reset, }; static const struct hisi_sas_hw hisi_sas_v3_hw = { From patchwork Thu Apr 11 12:46:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162067 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7378334jan; Thu, 11 Apr 2019 05:48:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwBARDeutqHg57s9I6KY5UztCoMrfsmfcjwYamy0nZoTHBO0aN8eQ6PxKbKX2Ji/9KKGPb X-Received: by 2002:a63:c61:: with SMTP id 33mr43159235pgm.293.1554986909579; Thu, 11 Apr 2019 05:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554986909; cv=none; d=google.com; s=arc-20160816; b=JQSqr0AX+y7so+Cb9p3zhQaevRvDpelxtmaSpWXoaBFou7OShB1RpVrkdilm/19RUH 4eWDas8KoyGfdIdO/1E7Tj/W9i6LdB6Jkep4H7Kkzc+mZPlZnp1yqt9R1/7sg3RLaZQ2 oQ424Ua6aqqqjhVb678eBpqyJffrRBjLNbWAdjjTsx1+El1sSZNOk/NOxNvW420kjqY1 5YSthbQGjs+bc18YH/BDkWPNG0Jtwgfce0YLZQgb09nE8ycgmHjSnDsEsd5JeOCeii2K Ugl79P9YhUilrF4Xt+2mMRYT8uvbHUcbyt+oEUMijzINh8YwK56LZsEY66oQzgcWpjFI NEbA== 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=gOllWPR7dqlM/BvUtZ0HJlupNJBPq4xHsZcVTV07Qvc=; b=lPzBvwn4Uxtjc3JBIe+2biLpp8B8PQtD86YVXfw6vj0Lkf8vJGwNrhRRTWwpWXAZ7s 23thHM+HPrrdyI0nBN6ncJdwJ4+j2DdaqexeKLtCL3jw8en0uaq88HbhfKBPRgnEUVnP T9FK/hl69KmwRHfmz1SIM6/RVouN39TOa6ddmx0e7/AMxhuxMY3IJGLYRJ2CM7wxT5zj +NmhAHScIiPYoLECY2For8I89LeGDFDMHzZS0wHpZ+NKMYFvauO7NR1Fz/EAp3krMYmP 98I2PivjK/c5i7tucpF0rxse46dKtnrxmeFs3WYhFJs8W4x1qh+6FwD7gd2YuVfoa+vp lR+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 f36si34678726pgf.332.2019.04.11.05.48.29; Thu, 11 Apr 2019 05:48:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727212AbfDKMs2 (ORCPT + 31 others); Thu, 11 Apr 2019 08:48:28 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6728 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726538AbfDKMra (ORCPT ); Thu, 11 Apr 2019 08:47:30 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A37E31944EADB8149C1D; Thu, 11 Apr 2019 20:47:24 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Apr 2019 20:47:18 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 2/9] scsi: hisi_sas: Remedy inconsistent PHY down state in software Date: Thu, 11 Apr 2019 20:46:37 +0800 Message-ID: <1554986804-233706-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com> References: <1554986804-233706-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen Currently there are two scenarioes which may cause PHY state of hardware (which is 0) is inconsistent with the state held in software: - Unplug SAS wire before get_phys_state when SAS controller reset, then the interrupts of phy down are ignored, phy state is 0 before reset, and it also gets 0 after reset, so phy down doesn't occur even if unpluged SAS wire; - For v3 hw later version, it will close bus when 2 bit ECC error occur. So if unplug SAS wire at that time, interrupts of phy down also not occur. So at last it will cause host reset. It also get phy state 0 before and after reset, the same issue occurs. To solve it, use hisi_sas_phy_down() directly in rescan topology function. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index a1eaddcf740d..e7401e2bea27 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1427,9 +1427,9 @@ static void hisi_sas_rescan_topology(struct hisi_hba *hisi_hba, u32 old_state, sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD); } - } else if (old_state & (1 << phy_no)) - /* PHY down but was up before */ + } else { hisi_sas_phy_down(hisi_hba, phy_no, 0); + } } } From patchwork Thu Apr 11 12:46:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162063 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7377661jan; Thu, 11 Apr 2019 05:47:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWXf0VMlvj7iurh0gbCt3tkOkDHE51nM/Q0ysMkTTtNqDnBJzTKY9Yt78DndE+xOLlYI0L X-Received: by 2002:a62:e50a:: with SMTP id n10mr49654075pff.55.1554986868177; Thu, 11 Apr 2019 05:47:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554986868; cv=none; d=google.com; s=arc-20160816; b=UNwxIjceWlDeyL/GhsdGEOuxSyMi/NBzLFKv7z5+5OCEkcXPmWUQJt2CeIB54Qrp8n kCuf1fv4XbzLen58df36yXwg1bQYw6bIi04PUPWyxdEFEZBxvVWRRC6U0o+H83jrppKz ZPLOB8THcMxGCM2d1DS+uKoufNW7ZzkXlIy1L7hLQuwma66HXRn15aVWRIeOqSCOb032 gPSUMgqI5Js/JInUgDvereG1XGIxaoXYJNYYoqn8qPvWBMqOLVRM3+6jahlhC6tsaekV /QYgdimSk9lhajGnV9vtLAYKuMhIyLVzIzRNVlefhy4S5+xz5MkDI2dMsGXJ43s7zrQk 21+w== 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=DfmNPOUDe21t4nmzude7W3DXf/CtXhmPU1InQagWsZ4=; b=bDYnYKZR0sGcbD/nmOXtbXLu4bYAuhUTqFxhtQXF0TRpWyw3ldN2gS5jMDhKvjWFwl eEOCrYq2PwU/3sHKy2LItSrT3RR5Hna5ymczM8m4VTMsa1yc7qxHobXsKXjw+oY/LXme HAD8IzszNmWcSIkEWfI+QwcRiumHYqJQpTRVyBcnJ4VGizFMGaxUsBiY7GIJPwsfdkjb Yb/4E9hZ/w9CcQmLy3nHWGfDqe4KXk0U9O3bwTF1bTt42nIIp1oojAQrn57dfTjuTMYc Uq0Qj2C4Poi8IsnrX2iTH3W2npmCK5U9lH0KhDOuhg7oKBGgGSEsWAYZOCETcLF4jzmA WKVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 13si15811200pgz.9.2019.04.11.05.47.47; Thu, 11 Apr 2019 05:47:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbfDKMrq (ORCPT + 31 others); Thu, 11 Apr 2019 08:47:46 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41650 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726884AbfDKMro (ORCPT ); Thu, 11 Apr 2019 08:47:44 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C42A1BD3D086657F26F9; Thu, 11 Apr 2019 20:47:29 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Apr 2019 20:47:19 +0800 From: John Garry To: , CC: , , , John Garry Subject: [PATCH 3/9] scsi: hisi_sas: Fix for setting the PHY linkrate when disconnected Date: Thu, 11 Apr 2019 20:46:38 +0800 Message-ID: <1554986804-233706-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com> References: <1554986804-233706-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In commit efdcad62e7b8 ("scsi: hisi_sas: Set PHY linkrate when disconnected"), we use the sas_phy_data.enable flag to track whether the PHY was enabled or not, so that we know if we should set the PHY negotiated linkrate at SAS_LINK_RATE_UNKNOWN or SAS_PHY_DISABLED. However, it is not proper to use sas_phy_data.enable, since it is only set when libsas attempts to set the PHY disabled/enabled; hence, it may not even have an initial value. As a solution to this problem, introduce hisi_sas_phy.enable to track whether the PHY is enabled or not, so that we can set the negotiated linkrate properly when the PHY comes down. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 3 ++ drivers/scsi/hisi_sas/hisi_sas_main.c | 43 ++++++++++++++++++++------ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 11 ++----- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 6 ++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 6 ++-- 5 files changed, 46 insertions(+), 23 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 9bfa9f12d81e..fc87994b5d73 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -170,6 +170,7 @@ struct hisi_sas_phy { u32 code_violation_err_count; enum sas_linkrate minimum_linkrate; enum sas_linkrate maximum_linkrate; + int enable; }; struct hisi_sas_port { @@ -551,6 +552,8 @@ extern int hisi_sas_slave_configure(struct scsi_device *sdev); extern int hisi_sas_scan_finished(struct Scsi_Host *shost, unsigned long time); extern void hisi_sas_scan_start(struct Scsi_Host *shost); extern int hisi_sas_host_reset(struct Scsi_Host *shost, int reset_type); +extern void hisi_sas_phy_enable(struct hisi_hba *hisi_hba, int phy_no, + int enable); extern void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy); extern void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task, diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index e7401e2bea27..d4da537f9a45 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -10,7 +10,6 @@ */ #include "hisi_sas.h" -#include "../libsas/sas_internal.h" #define DRV_NAME "hisi_sas" #define DEV_IS_GONE(dev) \ @@ -171,7 +170,7 @@ void hisi_sas_stop_phys(struct hisi_hba *hisi_hba) int phy_no; for (phy_no = 0; phy_no < hisi_hba->n_phy; phy_no++) - hisi_hba->hw->phy_disable(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 0); } EXPORT_SYMBOL_GPL(hisi_sas_stop_phys); @@ -976,6 +975,30 @@ static void hisi_sas_phy_init(struct hisi_hba *hisi_hba, int phy_no) timer_setup(&phy->timer, hisi_sas_wait_phyup_timedout, 0); } +/* Wrapper to ensure we track hisi_sas_phy.enable properly */ +void hisi_sas_phy_enable(struct hisi_hba *hisi_hba, int phy_no, int enable) +{ + struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no]; + struct asd_sas_phy *aphy = &phy->sas_phy; + struct sas_phy *sphy = aphy->phy; + unsigned long flags; + + spin_lock_irqsave(&phy->lock, flags); + + if (enable) { + /* We may have been enabled already; if so, don't touch */ + if (!phy->enable) + sphy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN; + hisi_hba->hw->phy_start(hisi_hba, phy_no); + } else { + sphy->negotiated_linkrate = SAS_PHY_DISABLED; + hisi_hba->hw->phy_disable(hisi_hba, phy_no); + } + phy->enable = enable; + spin_unlock_irqrestore(&phy->lock, flags); +} +EXPORT_SYMBOL_GPL(hisi_sas_phy_enable); + static void hisi_sas_port_notify_formed(struct asd_sas_phy *sas_phy) { struct sas_ha_struct *sas_ha = sas_phy->ha; @@ -1112,10 +1135,10 @@ static int hisi_sas_phy_set_linkrate(struct hisi_hba *hisi_hba, int phy_no, sas_phy->phy->maximum_linkrate = max; sas_phy->phy->minimum_linkrate = min; - hisi_hba->hw->phy_disable(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 0); msleep(100); hisi_hba->hw->phy_set_linkrate(hisi_hba, phy_no, &_r); - hisi_hba->hw->phy_start(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 1); return 0; } @@ -1133,13 +1156,13 @@ static int hisi_sas_control_phy(struct asd_sas_phy *sas_phy, enum phy_func func, break; case PHY_FUNC_LINK_RESET: - hisi_hba->hw->phy_disable(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 0); msleep(100); - hisi_hba->hw->phy_start(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 1); break; case PHY_FUNC_DISABLE: - hisi_hba->hw->phy_disable(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 0); break; case PHY_FUNC_SET_LINK_RATE: @@ -2172,16 +2195,18 @@ static void hisi_sas_phy_disconnected(struct hisi_sas_phy *phy) { struct asd_sas_phy *sas_phy = &phy->sas_phy; struct sas_phy *sphy = sas_phy->phy; - struct sas_phy_data *d = sphy->hostdata; + unsigned long flags; phy->phy_attached = 0; phy->phy_type = 0; phy->port = NULL; - if (d->enable) + spin_lock_irqsave(&phy->lock, flags); + if (phy->enable) sphy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN; else sphy->negotiated_linkrate = SAS_PHY_DISABLED; + spin_unlock_irqrestore(&phy->lock, flags); } void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 078ddd3871f2..717972283acf 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -798,16 +798,11 @@ static void start_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) enable_phy_v1_hw(hisi_hba, phy_no); } -static void stop_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) -{ - disable_phy_v1_hw(hisi_hba, phy_no); -} - static void phy_hard_reset_v1_hw(struct hisi_hba *hisi_hba, int phy_no) { - stop_phy_v1_hw(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 0); msleep(100); - start_phy_v1_hw(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 1); } static void start_phys_v1_hw(struct timer_list *t) @@ -817,7 +812,7 @@ static void start_phys_v1_hw(struct timer_list *t) for (i = 0; i < hisi_hba->n_phy; i++) { hisi_sas_phy_write32(hisi_hba, i, CHL_INT2_MSK, 0x12a); - start_phy_v1_hw(hisi_hba, i); + hisi_sas_phy_enable(hisi_hba, i, 1); } } diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 33b72c7f72c5..3696cfe48574 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -1546,14 +1546,14 @@ static void phy_hard_reset_v2_hw(struct hisi_hba *hisi_hba, int phy_no) struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no]; u32 txid_auto; - disable_phy_v2_hw(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 0); if (phy->identify.device_type == SAS_END_DEVICE) { txid_auto = hisi_sas_phy_read32(hisi_hba, phy_no, TXID_AUTO); hisi_sas_phy_write32(hisi_hba, phy_no, TXID_AUTO, txid_auto | TX_HARDRST_MSK); } msleep(100); - start_phy_v2_hw(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 1); } static void phy_get_events_v2_hw(struct hisi_hba *hisi_hba, int phy_no) @@ -1586,7 +1586,7 @@ static void phys_init_v2_hw(struct hisi_hba *hisi_hba) if (!sas_phy->phy->enabled) continue; - start_phy_v2_hw(hisi_hba, i); + hisi_sas_phy_enable(hisi_hba, i, 1); } } diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index e8323d038d53..3b33816ea6e6 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -856,14 +856,14 @@ static void phy_hard_reset_v3_hw(struct hisi_hba *hisi_hba, int phy_no) struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no]; u32 txid_auto; - disable_phy_v3_hw(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 0); if (phy->identify.device_type == SAS_END_DEVICE) { txid_auto = hisi_sas_phy_read32(hisi_hba, phy_no, TXID_AUTO); hisi_sas_phy_write32(hisi_hba, phy_no, TXID_AUTO, txid_auto | TX_HARDRST_MSK); } msleep(100); - start_phy_v3_hw(hisi_hba, phy_no); + hisi_sas_phy_enable(hisi_hba, phy_no, 1); } static enum sas_linkrate phy_get_max_linkrate_v3_hw(void) @@ -882,7 +882,7 @@ static void phys_init_v3_hw(struct hisi_hba *hisi_hba) if (!sas_phy->phy->enabled) continue; - start_phy_v3_hw(hisi_hba, i); + hisi_sas_phy_enable(hisi_hba, i, 1); } } From patchwork Thu Apr 11 12:46:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162060 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7377487jan; Thu, 11 Apr 2019 05:47:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLD5TBdlPHNDVJ4zPF1fsn6/OZn5oSiMCM0SJXkOqC6YERJQiBaEjqw3rFvmx1ME6f0HkD X-Received: by 2002:a17:902:6b8b:: with SMTP id p11mr26294970plk.225.1554986855886; Thu, 11 Apr 2019 05:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554986855; cv=none; d=google.com; s=arc-20160816; b=IqmzCTQJkkfk1Ck95ytFsUwRYhTbUAeXKHz2Ey0liZGaVXz6VuxHaIl+xs1U7KmOgN ua52VezmUnFjOyII62TSaoOvc1SJCNVT9RY4Xcj2Mw1QB47ARfpK76lvJRARI2YPkUlp 89m6GpNHAAGcA4xr/98gxqwJb0KWYQFXH54503s8z5sSHcXtcRkynaP2MAC+UqjXV0+j JS7LgtKaSJyJ07f8/+safrmO6SNEdrDO3U9PRc/11C2YK56D7OdfFUgy/MUW7I7ggan4 52r/kCgq9kEIkNB3lIUqCkIolgN/a5DvEYtRiyP3F6s42KtGLx2WAU91G33XJLKvV/Gb qthA== 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=lqpODlkG2dhidMTC5JGdMOoK40J3RliOfmJ4JHj5Ekw=; b=J/oqlRoCYuYprURU+GWXGmO6xSiEzOLrKpuIaS7xTxcCDRdtnFJKnnC5PhPTJzixFf AxvVKXsx9Z6UDadWbfVHAVIJzGfYY3QtNE3/Va8jt7wgwOySelTXsuimXHgsbota8uTP 038DakbPtWqVQ0HLI/A5WsQjZSxfsEJJ94On9O7YrlnxOsZijapP4dQ7vjSEBumQFuET MTsbVx/VIcTt0v7DvgyTuD75yjTuC2/OithPssC1RHAJ6VND3Apc2ExX2qE3fgm4kYUl zvLMSj7y9JvILH1k/kuZ+X2u/BE60UWGAKlX5+mShThC1EfznWocKtBhAp/NCAyZBMbm Nnvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z64si35071179pgd.106.2019.04.11.05.47.35; Thu, 11 Apr 2019 05:47:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726886AbfDKMre (ORCPT + 31 others); Thu, 11 Apr 2019 08:47:34 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41556 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726827AbfDKMrc (ORCPT ); Thu, 11 Apr 2019 08:47:32 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id AF97162032A070E7F36E; Thu, 11 Apr 2019 20:47:29 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Apr 2019 20:47:19 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 4/9] scsi: hisi_sas: Adjust the printk format of functions hisi_sas_init_device() Date: Thu, 11 Apr 2019 20:46:39 +0800 Message-ID: <1554986804-233706-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com> References: <1554986804-233706-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen In function hisi_sas_init_device(), the log is as follows when error for hardreset: hisi_sas_v3_hw 0000:74:02.0: SATA disk hardreset fail: 0xffffffed Actually if hardreset failed, its return value is negative, so change the print format from %x to %d. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index d4da537f9a45..ede812759991 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -769,8 +769,7 @@ static int hisi_sas_init_device(struct domain_device *device) } sas_put_local_phy(local_phy); if (rc) { - dev_warn(dev, "SATA disk hardreset fail: 0x%x\n", - rc); + dev_warn(dev, "SATA disk hardreset fail: %d\n", rc); return rc; } From patchwork Thu Apr 11 12:46:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162066 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7378090jan; Thu, 11 Apr 2019 05:48:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzb+YYQpqkkjmx3TKQyyt89X/rKN/h4MI0Bfu0Mcg7BupUd3Fv5CZZ+fwwckq8spPIAXd4h X-Received: by 2002:a17:902:b089:: with SMTP id p9mr25152262plr.185.1554986894965; Thu, 11 Apr 2019 05:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554986894; cv=none; d=google.com; s=arc-20160816; b=OjeTIgqDF/eG+zbAPYSq3rDbLoJJNP2o53VlE7HGCzb+K9KXLiN024wRZ8M1uDPDaD 1ELK0B9rb2x15z/vPkJ+iDQ8Lhg228AWE9NnaUsIC4F6nnchNsCphSU2H1GxFZ2QNykO lAN9ZGV0jjJWGkJT9zzEpjLEXCcWcfoYu58HCMl7muAvy25dBfHWo6TuLhpzRupPv8mi 0h3BLL94DBrIwF0/xhTRK5saVpQ6nZWvRSDyueui5tWhzzMC6zPih+vLJRjdQAO7NIAX oo9zZBImyEmGtxwTIVmxtQgW2JMKL3R2X0viOoh/xdKHaNfwKL8lgUkslDrkLQpDuvHr RwLw== 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=MJ8PDENSE2AMjMRy0Qo2jIRIrsnorkp0eiLOqU78jIw=; b=vjQ8szx10lKcd6pdQMhHCClpRmJd63ozsTtO5r3ZEtG5xyjXSSZ4geDgTyDoEwzLJd Vbs1dEWWp2zb9Z9S41iJlCigcJES2iPVnW6gVqbWlnWm9ZfJsLAOYvR8sIShDmP3czVx iO5UgxQYpF9eLnTHNBJc/ZwhvyiqPSE4Ulaf2d2arVdYNm4RGLJaL4F/aM/WIp4JLtfK X0iJ0yHST6kIoEE3pDVJxduZdStcvczg2uCrC/FhIzL5Fxs2fKU3zRVa5HMwfc7Ufp1P BZ3XzBod2SpTyRdtgVuFXV/F/Br/4djZsi2vCnnseRBenoXnf+UuioRhky0KGJZTGtHQ ziyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 e5si14029109plb.249.2019.04.11.05.48.14; Thu, 11 Apr 2019 05:48:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727019AbfDKMr4 (ORCPT + 31 others); Thu, 11 Apr 2019 08:47:56 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6165 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726585AbfDKMrc (ORCPT ); Thu, 11 Apr 2019 08:47:32 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D5A563E6FF00AA29964B; Thu, 11 Apr 2019 20:47:29 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Apr 2019 20:47:20 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 7/9] scsi: hisi_sas: Don't hard reset disk during controller reset Date: Thu, 11 Apr 2019 20:46:42 +0800 Message-ID: <1554986804-233706-8-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com> References: <1554986804-233706-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luo Jiaxing In the function of hisi_sas_init_device(), we added ops->hardreset() to clear affiliation of STP target port or handle [STP pending] state. Function hisi_sas_init_device() will be called when a device is found or during controller reset. At controller reset, we call hisi_sas_init_device() to re-init the disks, so calling hardreset() is unnecessary and it also will cause some delay at controller reset. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index ede812759991..c02cf78a20c7 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -754,7 +754,8 @@ static int hisi_sas_init_device(struct domain_device *device) * STP target port */ local_phy = sas_get_local_phy(device); - if (!scsi_is_sas_phy_local(local_phy)) { + if (!scsi_is_sas_phy_local(local_phy) && + !test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) { unsigned long deadline = ata_deadline(jiffies, 20000); struct sata_device *sata_dev = &device->sata_dev; struct ata_host *ata_host = sata_dev->ata_host; From patchwork Thu Apr 11 12:46:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162065 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7377869jan; Thu, 11 Apr 2019 05:48:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYrYJAwei7s80eA5yHHtEFv3Kqb0rbrGrYbDS5vAlLHznqGu1ksJVKSgpk5r81RlH19Dy7 X-Received: by 2002:a62:5ec2:: with SMTP id s185mr49130293pfb.16.1554986882345; Thu, 11 Apr 2019 05:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554986882; cv=none; d=google.com; s=arc-20160816; b=mD0WXTcXuOSVn+/Gqqu6spzLPOHkbGtpqmy7HVlzFTmkHZvx+ZHDZdZqtuI+S/KUKM PHfIot9FiAbD64iU+HmPHAhIddZb8baNCOagDWO6D4FuX27HALd5p06NBghpMVLNcaj0 q47eB8kzEgdALal/htWcHNzi17jyeMLT5lxNqLd5S1sQik9T0LSIKPE1b1zZwmbYg9vF 584B0FMFPBVG0BqEGNBkvx/45QwKGE07bNqmBBeUNliQvu5JB9oKIe8IyJHzothWRENR tTDOeqoTFTlQgZjEJBwhRiZ4tcvreQwGpUqswD9kjKHpBvA5Shkq5BqkXbBQEJy28nia YZpw== 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=PhbbTDDBSAqmOzU5V880Ih3J7BbqsZO6H3QD2U6qO9I=; b=IcJjBLpHfnQDdW+VU/kQ9dmby2MYb5LbW+iwrPsuOrfJGqJ7mCnrLAnI9do16gQiCB JhCJbhdFQ9SVCMn3RGWIBAl4Dv6X+5cXISprTk6d8N4oMOKB4cS2X8h8SFAZsKnO7t8K l96C6D6QfY+Z2fRugWsA4/Jdnuz25j/k34au/mNck81Of8fzrHv5YOuOE54IKt3/LvsS PtaV5Gnej/tGCXOjVayPL3SNOM1rRN9wzTPkfkXdbYsH+vmpjHkmOE06VoHFaXLdDOvR QqnkfN04cYBDQniZDhrv3wV21yUmF92YughLWbhC2M/uzPVrczPYk5CC9EoXzN0zbxpF J5Ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 m7si10673696pls.114.2019.04.11.05.48.02; Thu, 11 Apr 2019 05:48:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727081AbfDKMsA (ORCPT + 31 others); Thu, 11 Apr 2019 08:48:00 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41564 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726832AbfDKMrc (ORCPT ); Thu, 11 Apr 2019 08:47:32 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B8F72D4F651B2AC100F5; Thu, 11 Apr 2019 20:47:29 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Apr 2019 20:47:21 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 8/9] scsi: hisi_sas: Don't fail IT nexus reset for Open Reject timeout Date: Thu, 11 Apr 2019 20:46:43 +0800 Message-ID: <1554986804-233706-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com> References: <1554986804-233706-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luo Jiaxing Currently we call hisi_sas_softreset_ata_disk() in hisi_sas_I_T_nexus_reset(). If this fails for open reject reason, there is no reason to fail the IT nexus reset, so only fail for TMF_RESP_FUNC_FAILED. Some other strings spilled over multiple lines are reunited. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index c02cf78a20c7..ebeec7a52ddc 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1287,8 +1287,7 @@ static int hisi_sas_exec_internal_tmf_task(struct domain_device *device, /* no error, but return the number of bytes of * underrun */ - dev_warn(dev, "abort tmf: task to dev %016llx " - "resp: 0x%x sts 0x%x underrun\n", + dev_warn(dev, "abort tmf: task to dev %016llx resp: 0x%x sts 0x%x underrun\n", SAS_ADDR(device->sas_addr), task->task_status.resp, task->task_status.stat); @@ -1303,10 +1302,16 @@ static int hisi_sas_exec_internal_tmf_task(struct domain_device *device, break; } - dev_warn(dev, "abort tmf: task to dev " - "%016llx resp: 0x%x status 0x%x\n", - SAS_ADDR(device->sas_addr), task->task_status.resp, - task->task_status.stat); + if (task->task_status.resp == SAS_TASK_COMPLETE && + task->task_status.stat == SAS_OPEN_REJECT) { + dev_warn(dev, "abort tmf: open reject failed\n"); + res = -EIO; + } else { + dev_warn(dev, "abort tmf: task to dev %016llx resp: 0x%x status 0x%x\n", + SAS_ADDR(device->sas_addr), + task->task_status.resp, + task->task_status.stat); + } sas_free_task(task); task = NULL; } @@ -1826,7 +1831,7 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device) if (dev_is_sata(device)) { rc = hisi_sas_softreset_ata_disk(device); - if (rc) + if (rc == TMF_RESP_FUNC_FAILED) return TMF_RESP_FUNC_FAILED; } @@ -2123,10 +2128,8 @@ _hisi_sas_internal_task_abort(struct hisi_hba *hisi_hba, } exit: - dev_dbg(dev, "internal task abort: task to dev %016llx task=%p " - "resp: 0x%x sts 0x%x\n", - SAS_ADDR(device->sas_addr), - task, + dev_dbg(dev, "internal task abort: task to dev %016llx task=%p resp: 0x%x sts 0x%x\n", + SAS_ADDR(device->sas_addr), task, task->task_status.resp, /* 0 is complete, -1 is undelivered */ task->task_status.stat); sas_free_task(task); From patchwork Thu Apr 11 12:46:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162062 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7377618jan; Thu, 11 Apr 2019 05:47:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCaABfhfQNswjZseKAsAvvLzEd9qZnv212Oam42tgDfIXBcP5mopdxZp5WiWDawLGksuQN X-Received: by 2002:a17:902:1003:: with SMTP id b3mr48832265pla.306.1554986865035; Thu, 11 Apr 2019 05:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554986865; cv=none; d=google.com; s=arc-20160816; b=A0iRT14Hsw7dqu14Ux3VY7LZlK45sjUNIqnya3XIJWdUyC+H9nFuDOmGMCP4n9UAfe pPN8QpBlYgOZvszmSLgNXtd1w5eqyZ8hNi0BDUWotC153R9B0B5uZPhkNopW6RX52XN0 48ciIXm6/zaM+Y8TtrkRzhvlFGP7c9gSCa8GVoLhSV5+HhV5DYMut72RH4sIqWPs4POd 5i4jLmUc4M/ZLQLOma+JDaUKccefQBTEf1TYhy6P1DHPh/Jp2sGGLL+Z6Efo+5RzuGSz 2sAXaPk/H8t9+Q6Jj7F5M1AwVE4tUWG45YiXw4REmNfIsZxyilQ6zr6/ZxggOP0C6Ylv dGlg== 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=kXXTDIsriBs/ZiytBrWyFDN9JXorMf4yTIPDM62ERvs=; b=i7UuQG3X5sPPkhPDd/UkNGOANKtXa7Hr+u1FpsWa1S57731cXvfqt6idVnWj+lAeEy JQuRBfEQJGJHBGEjNPt29c5zyYzlN31E3MEVXnlUBjWnBdZYUjIIwMRJ57XnEWdGLEr1 Abktj9KmGR2niU9zDSb4eLXImFtGHjfw3GGKa2DUa/NmJMrYOX8HQHv8SLVXpOYMLevk 9t8Gqx5t0Zcpb2J/ceRR+PT3QmpIhJGE3C6xxAgLeMSe/lVkCD9qe/7BPu43JS8bxbvD kqGxbquXbQaFXB7fNY9kOJd4wQjqcvLaJX5TcbWKWubnm4zKjpvPRdMNXCVcpnERKLg4 iNKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 13si15811200pgz.9.2019.04.11.05.47.44; Thu, 11 Apr 2019 05:47:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbfDKMrn (ORCPT + 31 others); Thu, 11 Apr 2019 08:47:43 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41568 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726843AbfDKMrg (ORCPT ); Thu, 11 Apr 2019 08:47:36 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id BDE48C7695B25473E2F2; Thu, 11 Apr 2019 20:47:29 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Apr 2019 20:47:21 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 9/9] scsi: hisi_sas: Some misc tidy-up Date: Thu, 11 Apr 2019 20:46:44 +0800 Message-ID: <1554986804-233706-10-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com> References: <1554986804-233706-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen Do some minor tidy-up. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 13 +++----- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 9 ++---- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 42 +++++++++++--------------- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 27 ++++++++--------- 4 files changed, 38 insertions(+), 53 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index ebeec7a52ddc..8a7feb8ed8d6 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -683,7 +683,7 @@ static void hisi_sas_bytes_dmaed(struct hisi_hba *hisi_hba, int phy_no) id->initiator_bits = SAS_PROTOCOL_ALL; id->target_bits = phy->identify.target_port_protocols; } else if (phy->phy_type & PORT_TYPE_SATA) { - /*Nothing*/ + /* Nothing */ } sas_phy->frame_rcvd_size = phy->frame_rcvd_size; @@ -1739,7 +1739,7 @@ static int hisi_sas_abort_task_set(struct domain_device *device, u8 *lun) struct hisi_hba *hisi_hba = dev_to_hisi_hba(device); struct device *dev = hisi_hba->dev; struct hisi_sas_tmf_task tmf_task; - int rc = TMF_RESP_FUNC_FAILED; + int rc; rc = hisi_sas_internal_task_abort(hisi_hba, device, HISI_SAS_INT_ABT_DEV, 0); @@ -2532,22 +2532,19 @@ int hisi_sas_get_fw_info(struct hisi_hba *hisi_hba) if (device_property_read_u32(dev, "ctrl-reset-reg", &hisi_hba->ctrl_reset_reg)) { - dev_err(dev, - "could not get property ctrl-reset-reg\n"); + dev_err(dev, "could not get property ctrl-reset-reg\n"); return -ENOENT; } if (device_property_read_u32(dev, "ctrl-reset-sts-reg", &hisi_hba->ctrl_reset_sts_reg)) { - dev_err(dev, - "could not get property ctrl-reset-sts-reg\n"); + dev_err(dev, "could not get property ctrl-reset-sts-reg\n"); return -ENOENT; } if (device_property_read_u32(dev, "ctrl-clock-ena-reg", &hisi_hba->ctrl_clock_ena_reg)) { - dev_err(dev, - "could not get property ctrl-clock-ena-reg\n"); + dev_err(dev, "could not get property ctrl-clock-ena-reg\n"); return -ENOENT; } } diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 717972283acf..78fe7d344848 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1690,8 +1690,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba) for (j = 0; j < HISI_SAS_PHY_INT_NR; j++, idx++) { irq = platform_get_irq(pdev, idx); if (!irq) { - dev_err(dev, - "irq init: fail map phy interrupt %d\n", + dev_err(dev, "irq init: fail map phy interrupt %d\n", idx); return -ENOENT; } @@ -1699,8 +1698,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba) rc = devm_request_irq(dev, irq, phy_interrupts[j], 0, DRV_NAME " phy", phy); if (rc) { - dev_err(dev, "irq init: could not request " - "phy interrupt %d, rc=%d\n", + dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n", irq, rc); return -ENOENT; } @@ -1737,8 +1735,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba) rc = devm_request_irq(dev, irq, fatal_interrupts[i], 0, DRV_NAME " fatal", hisi_hba); if (rc) { - dev_err(dev, - "irq init: could not request fatal interrupt %d, rc=%d\n", + dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n", irq, rc); return -ENOENT; } diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 3696cfe48574..d4650bed8274 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -2423,14 +2423,12 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) slot_err_v2_hw(hisi_hba, task, slot, 2); if (ts->stat != SAS_DATA_UNDERRUN) - dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d " - "CQ hdr: 0x%x 0x%x 0x%x 0x%x " - "Error info: 0x%x 0x%x 0x%x 0x%x\n", - slot->idx, task, sas_dev->device_id, - complete_hdr->dw0, complete_hdr->dw1, - complete_hdr->act, complete_hdr->dw3, - error_info[0], error_info[1], - error_info[2], error_info[3]); + dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d CQ hdr: 0x%x 0x%x 0x%x 0x%x Error info: 0x%x 0x%x 0x%x 0x%x\n", + slot->idx, task, sas_dev->device_id, + complete_hdr->dw0, complete_hdr->dw1, + complete_hdr->act, complete_hdr->dw3, + error_info[0], error_info[1], + error_info[2], error_info[3]); if (unlikely(slot->abort)) return ts->stat; @@ -2502,7 +2500,7 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) spin_lock_irqsave(&device->done_lock, flags); if (test_bit(SAS_HA_FROZEN, &ha->state)) { spin_unlock_irqrestore(&device->done_lock, flags); - dev_info(dev, "slot complete: task(%p) ignored\n ", + dev_info(dev, "slot complete: task(%p) ignored\n", task); return sts; } @@ -2935,7 +2933,7 @@ static irqreturn_t int_chnl_int_v2_hw(int irq_no, void *p) if (irq_value2 & BIT(CHL_INT2_SL_IDAF_TOUT_CONF_OFF)) { dev_warn(dev, "phy%d identify timeout\n", - phy_no); + phy_no); hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET); } @@ -3036,7 +3034,7 @@ static const struct hisi_sas_hw_error axi_error[] = { { .msk = BIT(5), .msg = "SATA_AXI_R_ERR" }, { .msk = BIT(6), .msg = "DQE_AXI_R_ERR" }, { .msk = BIT(7), .msg = "CQE_AXI_W_ERR" }, - {}, + {} }; static const struct hisi_sas_hw_error fifo_error[] = { @@ -3045,7 +3043,7 @@ static const struct hisi_sas_hw_error fifo_error[] = { { .msk = BIT(10), .msg = "GETDQE_FIFO" }, { .msk = BIT(11), .msg = "CMDP_FIFO" }, { .msk = BIT(12), .msg = "AWTCTRL_FIFO" }, - {}, + {} }; static const struct hisi_sas_hw_error fatal_axi_errors[] = { @@ -3109,12 +3107,12 @@ static irqreturn_t fatal_axi_int_v2_hw(int irq_no, void *p) if (!(err_value & sub->msk)) continue; dev_err(dev, "%s (0x%x) found!\n", - sub->msg, irq_value); + sub->msg, irq_value); queue_work(hisi_hba->wq, &hisi_hba->rst_work); } } else { dev_err(dev, "%s (0x%x) found!\n", - axi_error->msg, irq_value); + axi_error->msg, irq_value); queue_work(hisi_hba->wq, &hisi_hba->rst_work); } } @@ -3258,7 +3256,7 @@ static irqreturn_t sata_int_v2_hw(int irq_no, void *p) /* check ERR bit of Status Register */ if (fis->status & ATA_ERR) { dev_warn(dev, "sata int: phy%d FIS status: 0x%x\n", phy_no, - fis->status); + fis->status); hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET); res = IRQ_NONE; goto end; @@ -3349,8 +3347,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba) rc = devm_request_irq(dev, irq, phy_interrupts[i], 0, DRV_NAME " phy", hisi_hba); if (rc) { - dev_err(dev, "irq init: could not request " - "phy interrupt %d, rc=%d\n", + dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n", irq, rc); rc = -ENOENT; goto free_phy_int_irqs; @@ -3364,8 +3361,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba) rc = devm_request_irq(dev, irq, sata_int_v2_hw, 0, DRV_NAME " sata", phy); if (rc) { - dev_err(dev, "irq init: could not request " - "sata interrupt %d, rc=%d\n", + dev_err(dev, "irq init: could not request sata interrupt %d, rc=%d\n", irq, rc); rc = -ENOENT; goto free_sata_int_irqs; @@ -3377,8 +3373,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba) rc = devm_request_irq(dev, irq, fatal_interrupts[fatal_no], 0, DRV_NAME " fatal", hisi_hba); if (rc) { - dev_err(dev, - "irq init: could not request fatal interrupt %d, rc=%d\n", + dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n", irq, rc); rc = -ENOENT; goto free_fatal_int_irqs; @@ -3393,8 +3388,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba) rc = devm_request_irq(dev, irq, cq_interrupt_v2_hw, 0, DRV_NAME " cq", cq); if (rc) { - dev_err(dev, - "irq init: could not request cq interrupt %d, rc=%d\n", + dev_err(dev, "irq init: could not request cq interrupt %d, rc=%d\n", irq, rc); rc = -ENOENT; goto free_cq_int_irqs; @@ -3546,7 +3540,7 @@ static int write_gpio_v2_hw(struct hisi_hba *hisi_hba, u8 reg_type, break; default: dev_err(dev, "write gpio: unsupported or bad reg type %d\n", - reg_type); + reg_type); return -EINVAL; } diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 9cf46b3d4f1c..49620c2411df 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1010,7 +1010,7 @@ get_free_slot_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_dq *dq) DLVRY_Q_0_RD_PTR + (queue * 0x14)); if (r == (w+1) % HISI_SAS_QUEUE_SLOTS) { dev_warn(dev, "full queue=%d r=%d w=%d\n", - queue, r, w); + queue, r, w); return -EAGAIN; } @@ -1950,7 +1950,7 @@ static const struct hisi_sas_hw_error axi_error[] = { { .msk = BIT(5), .msg = "SATA_AXI_R_ERR" }, { .msk = BIT(6), .msg = "DQE_AXI_R_ERR" }, { .msk = BIT(7), .msg = "CQE_AXI_W_ERR" }, - {}, + {} }; static const struct hisi_sas_hw_error fifo_error[] = { @@ -1959,7 +1959,7 @@ static const struct hisi_sas_hw_error fifo_error[] = { { .msk = BIT(10), .msg = "GETDQE_FIFO" }, { .msk = BIT(11), .msg = "CMDP_FIFO" }, { .msk = BIT(12), .msg = "AWTCTRL_FIFO" }, - {}, + {} }; static const struct hisi_sas_hw_error fatal_axi_error[] = { @@ -2207,13 +2207,11 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) slot_err_v3_hw(hisi_hba, task, slot); if (ts->stat != SAS_DATA_UNDERRUN) - dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d " - "CQ hdr: 0x%x 0x%x 0x%x 0x%x " - "Error info: 0x%x 0x%x 0x%x 0x%x\n", - slot->idx, task, sas_dev->device_id, - dw0, dw1, complete_hdr->act, dw3, - error_info[0], error_info[1], - error_info[2], error_info[3]); + dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d CQ hdr: 0x%x 0x%x 0x%x 0x%x Error info: 0x%x 0x%x 0x%x 0x%x\n", + slot->idx, task, sas_dev->device_id, + dw0, dw1, complete_hdr->act, dw3, + error_info[0], error_info[1], + error_info[2], error_info[3]); if (unlikely(slot->abort)) return ts->stat; goto out; @@ -2446,8 +2444,7 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) cq_interrupt_v3_hw, irqflags, DRV_NAME " cq", cq); if (rc) { - dev_err(dev, - "could not request cq%d interrupt, rc=%d\n", + dev_err(dev, "could not request cq%d interrupt, rc=%d\n", i, rc); rc = -ENOENT; goto free_cq_irqs; @@ -2603,7 +2600,7 @@ static int write_gpio_v3_hw(struct hisi_hba *hisi_hba, u8 reg_type, break; default: dev_err(dev, "write gpio: unsupported or bad reg type %d\n", - reg_type); + reg_type); return -EINVAL; } @@ -3042,7 +3039,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) hisi_hba->regs = pcim_iomap(pdev, 5, 0); if (!hisi_hba->regs) { - dev_err(dev, "cannot map register.\n"); + dev_err(dev, "cannot map register\n"); rc = -ENOMEM; goto err_out_ha; } @@ -3258,7 +3255,7 @@ static int hisi_sas_v3_resume(struct pci_dev *pdev) pci_power_t device_state = pdev->current_state; dev_warn(dev, "resuming from operating state [D%d]\n", - device_state); + device_state); pci_set_power_state(pdev, PCI_D0); pci_enable_wake(pdev, PCI_D0, 0); pci_restore_state(pdev);