From patchwork Fri Jun 9 14:16:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 103526 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp2706478obh; Fri, 9 Jun 2017 06:54:51 -0700 (PDT) X-Received: by 10.101.77.14 with SMTP id i14mr19098383pgt.164.1497016491792; Fri, 09 Jun 2017 06:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497016491; cv=none; d=google.com; s=arc-20160816; b=RwtKB2TkeOcagPDhwJriI89rJkOwOrq+HK1dP6VzzfSLgY9wr2NTL18Po/qswUnFiA 5dj5B7yI8UULzIvDV+7rKhqC0I3F5HsiFYILZBPM7ac52kgrFhHhcsVLXfxj0SWLqShB +BNyp072tteeeMVdJ2bTCwWpSQRebVxtrS+ufGYg+408Sq4kz2xNvWIgQVtBiRNghooW 5fTGOR4xBA2nPGFWiEdrTdnCWt54UAUmm6i25Sffbdft2i+J+PFZAovS/A0hWS6ZmrPT ULV51Vt2bUAfz9aUb3dp/nuzyLKqtd3aCgsxF/J25aoahzEZhj9YQzo/IsSEWnrWE6IT 6gHg== 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=W3ZENiT6rbuOaL1qWYIvO/P+NXsy2fHe91r2sPp9dZ8=; b=hiDIRjVpcF91MD8Jykn6sFZSZl9vzGXl1XKg5UYCD7uvCU3r4IFYWqlB+YmhKFLVRA VHcGMYVdLZgdbhwDOuXiYeaXWgtT0g5wxX1iehMGE+Pq7NOv/Ncm1oSg76jbyfYY/hOT BVmUyDjm6E3HxIoBeqy38PTsp+34CRYs8gqJ8NbaROPSPwrNFHo5d6EtPVILz+yO0PIf XeMxrRO/8uDkxkwgnY71bsVUkss+5t/VO+zByK6sZOThfRTSG3kJV4z48/51GBtqtXZq 7jPFLaGmMwULqEw0wmZgr9kwL7QBtOEBi0mirBh5saL9s0CsEv/gWIl1iYoO8r4ecisv qFKw== 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 t2si4925216pgs.52.2017.06.09.06.54.51; Fri, 09 Jun 2017 06:54:51 -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 S1751775AbdFINtm (ORCPT + 25 others); Fri, 9 Jun 2017 09:49:42 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7355 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751572AbdFINti (ORCPT ); Fri, 9 Jun 2017 09:49:38 -0400 Received: from 172.30.72.56 (EHLO DGGEML403-HUB.china.huawei.com) ([172.30.72.56]) by dggrg02-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id APA64573; Fri, 09 Jun 2017 21:48:35 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEML403-HUB.china.huawei.com (10.3.17.33) with Microsoft SMTP Server id 14.3.301.0; Fri, 9 Jun 2017 21:48:27 +0800 From: John Garry To: , CC: , , , , , John Garry Subject: [PATCH v5 02/23] scsi: hisi_sas: define hisi_sas_device.device_id as int Date: Fri, 9 Jun 2017 22:16:15 +0800 Message-ID: <1497017796-105067-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497017796-105067-1-git-send-email-john.garry@huawei.com> References: <1497017796-105067-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.0A090204.593AA734.0106, 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: f3ee19c031e5884b69e86cbdfbbe6548 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently hisi_sas_device.device_id is a u64. This can create a problem in selecting the queue for a device, in that this code does a 64b division on device id. For some 32b systems, 64b division is slow and the lib reference must be explicitly included. The device id does not need to be 64b in size, so, as a solution, just make as an int. Also, struct hisi_sas_device elements are re-ordered to improve packing efficiency. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 8 ++++---- drivers/scsi/hisi_sas/hisi_sas_main.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 4e28f32..b4e96fa9 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -107,15 +107,15 @@ struct hisi_sas_dq { }; struct hisi_sas_device { - enum sas_device_type dev_type; struct hisi_hba *hisi_hba; struct domain_device *sas_device; + struct list_head list; u64 attached_phy; - u64 device_id; atomic64_t running_req; - struct list_head list; - u8 dev_status; + enum sas_device_type dev_type; + int device_id; int sata_idx; + u8 dev_status; }; struct hisi_sas_slot { diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 3605d28..54e0cf2 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -209,7 +209,7 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba, if (DEV_IS_GONE(sas_dev)) { if (sas_dev) - dev_info(dev, "task prep: device %llu not ready\n", + dev_info(dev, "task prep: device %d not ready\n", sas_dev->device_id); else dev_info(dev, "task prep: device %016llx not ready\n", @@ -627,9 +627,9 @@ static void hisi_sas_dev_gone(struct domain_device *device) struct hisi_sas_device *sas_dev = device->lldd_dev; struct hisi_hba *hisi_hba = dev_to_hisi_hba(device); struct device *dev = &hisi_hba->pdev->dev; - u64 dev_id = sas_dev->device_id; + int dev_id = sas_dev->device_id; - dev_info(dev, "found dev[%lld:%x] is gone\n", + dev_info(dev, "found dev[%d:%x] is gone\n", sas_dev->device_id, sas_dev->dev_type); hisi_sas_internal_task_abort(hisi_hba, device, @@ -1082,7 +1082,7 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun) } out: if (rc != TMF_RESP_FUNC_COMPLETE) - dev_err(dev, "lu_reset: for device[%llx]:rc= %d\n", + dev_err(dev, "lu_reset: for device[%d]:rc= %d\n", sas_dev->device_id, rc); return rc; } @@ -1129,7 +1129,7 @@ static int hisi_sas_query_task(struct sas_task *task) } static int -hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba, u64 device_id, +hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba, int device_id, struct sas_task *task, int abort_flag, int task_tag) {