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 = {