From patchwork Tue Oct 24 15:51:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 116966 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5916849qgn; Tue, 24 Oct 2017 08:09:06 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SWFDOi3mXuwBL+Ea8Nkcn7afy88D80MZxC5qpvmU+oMIN/iDiR++U/gaKhcvXQGPdpX+YB X-Received: by 10.84.229.5 with SMTP id b5mr8360184plk.405.1508857746633; Tue, 24 Oct 2017 08:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508857746; cv=none; d=google.com; s=arc-20160816; b=UGE4qTXpq+qOzIbDrtLzejiWbj+dbHFUc9s48DyCq++nzt1QIGQxDEci5L2gR5I+SN gggOYTAQgkbT1mny0PCuOk+iqaKSOYUBVI44jabUHFeWF3+igdcBcDDUveMNDfKpty2D eT4ZEBKo8msR5uArmNmL2FaW76DXHY/TWUaGIilv1Mkqv9mzlG7cHMorjSYPbE3i7uKb xTsgg8qBsYbphDGG4XGZWHqlSt/99V8q4c9hsyqmRLHa8SC7Q2AIIRG0K/xtG/y8WwoP x4QGkk6HNHFcRHvhh32ZNmlUB3GKCIz2ZPZJoCzmcqZvfQb9As/tsNJF37o0aG3MveIn 5ENw== 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:arc-authentication-results; bh=rmUkAoLLLYHRsz5qRdhfa17c2NjKjuxg+9I80WlY0s8=; b=Mxm4nvNSUD9696z9uAodpJSsplirQDtLS8cLIiHL4ezsnkPsjceJDemG55+ZwlpS9c BZtRbza2EHidCjb02yfzlD3jHZIe17bC2Veh8KkL+veTmNta4tivVaRvEkkqcZNCo2BE SxvyEF6LamGYJGzXCjy/Kti2Y05+oXsIbMnUn0XurAn8FV4a0cH6DajCilZpyxdxn1qI u14rsTk86cgKIlOkRmzFfsVoh8O/M3u0qF3tBjCtR1d/JiGfFChLuNLEiv8onF0ga9Kj E/TLJFLyNVv479aizmVCOQMu+nBDfHRSbHhsLNL6EhzJOLJ97brR30q/rljz3UbIbBQS t9aQ== 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 q81si356780pfg.32.2017.10.24.08.09.06; Tue, 24 Oct 2017 08:09:06 -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 S1751964AbdJXPJD (ORCPT + 27 others); Tue, 24 Oct 2017 11:09:03 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9044 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751686AbdJXPI5 (ORCPT ); Tue, 24 Oct 2017 11:08:57 -0400 Received: from 172.30.72.58 (EHLO DGGEMS406-HUB.china.huawei.com) ([172.30.72.58]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DJW29926; Tue, 24 Oct 2017 23:05:31 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.361.1; Tue, 24 Oct 2017 23:05:20 +0800 From: John Garry To: , CC: , , , , Xiaofei Tan , John Garry Subject: [PATCH 15/19] scsi: hisi_sas: add hisi_hba.rst_work init for v3 hw Date: Tue, 24 Oct 2017 23:51:45 +0800 Message-ID: <1508860309-212397-16-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508860309-212397-1-git-send-email-john.garry@huawei.com> References: <1508860309-212397-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0208.59EF56BB.01A9, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b8755e3473696631e480efc50ede9111 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiaofei Tan Add init code of hisi_hba->rst_work for v3 hw. Because v3 hw also need it to recover controller when some hw errors occurs. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 58bc69e..00fefea 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -434,4 +434,5 @@ extern void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task, struct hisi_sas_slot *slot); extern void hisi_sas_init_mem(struct hisi_hba *hisi_hba); +extern void hisi_sas_rst_work_handler(struct work_struct *work); #endif diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 6b4dabde..1d417a4 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1785,13 +1785,14 @@ void hisi_sas_free(struct hisi_hba *hisi_hba) } EXPORT_SYMBOL_GPL(hisi_sas_free); -static void hisi_sas_rst_work_handler(struct work_struct *work) +void hisi_sas_rst_work_handler(struct work_struct *work) { struct hisi_hba *hisi_hba = container_of(work, struct hisi_hba, rst_work); hisi_sas_controller_reset(hisi_hba); } +EXPORT_SYMBOL_GPL(hisi_sas_rst_work_handler); int hisi_sas_get_fw_info(struct hisi_hba *hisi_hba) { diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 818bd575..1f8995b 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1840,6 +1840,7 @@ static int soft_reset_v3_hw(struct hisi_hba *hisi_hba) } hisi_hba = shost_priv(shost); + INIT_WORK(&hisi_hba->rst_work, hisi_sas_rst_work_handler); hisi_hba->hw = &hisi_sas_v3_hw; hisi_hba->pci_dev = pdev; hisi_hba->dev = dev;