From patchwork Fri Nov 9 14:06:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 150650 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp212172ljp; Fri, 9 Nov 2018 06:07:00 -0800 (PST) X-Google-Smtp-Source: AJdET5f0e95gLvH7T8yEOBBpB9Jw85YOEmAmPWVvXnUMOgZRkoW25bMSk0MLs6fXDQNKnkBUj7Fl X-Received: by 2002:a17:902:b943:: with SMTP id h3-v6mr8500559pls.124.1541772420540; Fri, 09 Nov 2018 06:07:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541772420; cv=none; d=google.com; s=arc-20160816; b=JQMggosy3sl8027qxARNAOaOiZMYUlbiDoBYetKE+phppW37KzSGRUriGVDUWJy3p4 3nMEC8VtXWHrbXEpS8rktXYWMGHo//jCvkwCdBO/rxDMACIBTFlqpPuJSUc95O3rtdK+ P+AhqficAkPUkHZKicvHJVt94nLB11JE4cjmOyEpy0Q/KyMINgA02RqNBm0KUha17Fgf 4/4mQyZp0zySQxEz5xCKph0f0eLWksw6mTQj14mfquhCTke5Y6JHaZhN5zIt12VQfgGy H8425Mwy5YXywN3AMIHQDFnZCE1vPVfgUxEJAD/zdtzRtFoiZ7S0i+r4wRPKA6Z48JML zoAg== 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=Ws2YXea5CUGZyi2UpAVjM+A/Gn51IVmfwiReEsf2QrY=; b=N7SSPry6Y4lSmTEzmsrEtSZ/yNNdnZyTUGXOjH/1w+qn2VJm2QO4lkLD2XWtUr4yTw PvBs3eDSRrxcC8FZGwfJqbk77U3S9UYLbatCqXyR4Xt/UVSm4HvxFncrPz+MnpV2v69W lbzzBnIQPvXd3E1eS+29bU2oVck8VEndB3iAD0vUYFaHXQClqzhLd4uRWpl9PAJze5mz puDFIQ4X224+3H7uoNuCRkZeURU96HjoBOuA7mlupcn0oVgBVMgwT6DMLDipcDD0Nso0 uGNXsAzVFxKOr44iZfERvRplaGfcVC+rBt47i98WkaFrrXUWIiPW/2cDdpkB78MMOXUr W/rg== 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 l184si6806759pgd.523.2018.11.09.06.06.44; Fri, 09 Nov 2018 06:07:00 -0800 (PST) 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 S1728351AbeKIXp7 (ORCPT + 32 others); Fri, 9 Nov 2018 18:45:59 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:47734 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728026AbeKIXpx (ORCPT ); Fri, 9 Nov 2018 18:45:53 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id DD0B255EAAD; Fri, 9 Nov 2018 22:05:04 +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; Fri, 9 Nov 2018 22:04:54 +0800 From: John Garry To: , CC: , , , Xiang Chen , John Garry Subject: [PATCH 1/5] scsi: hisi_sas: Create separate host attributes per HBA Date: Fri, 9 Nov 2018 22:06:32 +0800 Message-ID: <1541772396-161814-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1541772396-161814-1-git-send-email-john.garry@huawei.com> References: <1541772396-161814-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 all the three HBA (v1/v2/v3 HW) share the same host attribute. To support each HBA having separate attributes in future, create per-HBA attributes. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 6 ------ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 7 ++++++- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 7 ++++++- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 7 ++++++- 5 files changed, 18 insertions(+), 10 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 0ddb53c..94a9e13 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -468,7 +468,6 @@ extern int hisi_sas_probe(struct platform_device *pdev, 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 struct device_attribute *host_attrs[]; extern int hisi_sas_host_reset(struct Scsi_Host *shost, int reset_type); 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, diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index b3f01d5..8633ff9 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1994,12 +1994,6 @@ void hisi_sas_kill_tasklets(struct hisi_hba *hisi_hba) struct scsi_transport_template *hisi_sas_stt; EXPORT_SYMBOL_GPL(hisi_sas_stt); -struct device_attribute *host_attrs[] = { - &dev_attr_phy_event_threshold, - NULL, -}; -EXPORT_SYMBOL_GPL(host_attrs); - static struct sas_domain_function_template hisi_sas_transport_ops = { .lldd_dev_found = hisi_sas_dev_found, .lldd_dev_gone = hisi_sas_dev_gone, diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index f0e457e..d24342b 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1799,6 +1799,11 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba) return 0; } +static struct device_attribute *host_attrs_v1_hw[] = { + &dev_attr_phy_event_threshold, + NULL +}; + static struct scsi_host_template sht_v1_hw = { .name = DRV_NAME, .module = THIS_MODULE, @@ -1817,7 +1822,7 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba) .eh_target_reset_handler = sas_eh_target_reset_handler, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, - .shost_attrs = host_attrs, + .shost_attrs = host_attrs_v1_hw, }; 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 cc36b64..e78a97e 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -3554,6 +3554,11 @@ static void wait_cmds_complete_timeout_v2_hw(struct hisi_hba *hisi_hba, dev_dbg(dev, "wait commands complete %dms\n", time); } +struct device_attribute *host_attrs_v2_hw[] = { + &dev_attr_phy_event_threshold, + NULL +}; + static struct scsi_host_template sht_v2_hw = { .name = DRV_NAME, .module = THIS_MODULE, @@ -3572,7 +3577,7 @@ static void wait_cmds_complete_timeout_v2_hw(struct hisi_hba *hisi_hba, .eh_target_reset_handler = sas_eh_target_reset_handler, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, - .shost_attrs = host_attrs, + .shost_attrs = host_attrs_v2_hw, }; 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 bd4ce38..68a6ec2 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2091,6 +2091,11 @@ static void wait_cmds_complete_timeout_v3_hw(struct hisi_hba *hisi_hba, dev_dbg(dev, "wait commands complete %dms\n", time); } +struct device_attribute *host_attrs_v3_hw[] = { + &dev_attr_phy_event_threshold, + NULL +}; + static struct scsi_host_template sht_v3_hw = { .name = DRV_NAME, .module = THIS_MODULE, @@ -2109,7 +2114,7 @@ static void wait_cmds_complete_timeout_v3_hw(struct hisi_hba *hisi_hba, .eh_target_reset_handler = sas_eh_target_reset_handler, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, - .shost_attrs = host_attrs, + .shost_attrs = host_attrs_v3_hw, .tag_alloc_policy = BLK_TAG_ALLOC_RR, };