From patchwork Wed Jun 7 15:20:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 103286 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1798492obh; Wed, 7 Jun 2017 07:56:04 -0700 (PDT) X-Received: by 10.84.193.3 with SMTP id e3mr29200838pld.178.1496847364526; Wed, 07 Jun 2017 07:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496847364; cv=none; d=google.com; s=arc-20160816; b=eblQNHC2rBineZo2gLeTEMPNJcXyXj+0Ev09hC0OmUyi09jKizANXIQTkl7BuYKBX4 MZ8/jUgy1Z6CQSTm160EVwtutY/KL84qT98x6YE3ru2tJI93aqRdc8IZtzMkGI8XndVk pTgW6kGKXDmze0nb+PQm8FkODvgEH2Fqh8SZM0tv+zovA6SbwOrZ7TKuxBAu25DoxSts wztzR+PxJcfg07hHLZq8kAQDZhrX8DBeGijsX0xe6PgqQpCYhO7ORwftXXKIRKQrHplA bwskMLTgFRGvE1YpynO44CcsVvYdwTf6ccvPxrwte2yShvUGQ5g5JAQuO/46ZkE1M5aF PQkA== 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=gHwyhyYl2RkBM4Ke0rAxNKSPVyoQfMscVNI2Ci8ZX1Pb/+9+6AoXEMMhJ9MxmFqyVQ JBndf+5riiK3OA5baWnIiVMvX/ZCsTiO98mgPOQ6pilT2b8ITQAM8qXeu+TCmfMiI2PV JGZy4uQMi0QuRiSffm7I428aKO2J+j9+E+v644ZW+Lr0IOqrtgB7z+iK4b9GpVpn1Md5 wrkzvFMMkVIPNg7TjsosQsVjzlOY3fcHEtf+5xH6+rfQ+IpBwZyG4pGbKVrbd+pATIJs y/Owmo35898dyd/a59D1IuWyO2XdS1Ctr3g4jsWocwP3mo4R48LhG7ZrCyrff5vAmLy+ Z3+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 h34si1963421pld.85.2017.06.07.07.56.04; Wed, 07 Jun 2017 07:56:04 -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 S1751906AbdFGOzn (ORCPT + 25 others); Wed, 7 Jun 2017 10:55:43 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7323 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbdFGOwB (ORCPT ); Wed, 7 Jun 2017 10:52:01 -0400 Received: from 172.30.72.55 (EHLO DGGEML403-HUB.china.huawei.com) ([172.30.72.55]) by dggrg02-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AOX57453; Wed, 07 Jun 2017 22:50:56 +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; Wed, 7 Jun 2017 22:50:44 +0800 From: John Garry To: , CC: , , , , , John Garry Subject: [PATCH v4 02/23] scsi: hisi_sas: define hisi_sas_device.device_id as int Date: Wed, 7 Jun 2017 23:20:05 +0800 Message-ID: <1496848826-20534-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496848826-20534-1-git-send-email-john.garry@huawei.com> References: <1496848826-20534-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.0A020205.593812D0.02A3, 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: 458497f7218dd6a51e5573f9a8de1aa1 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) {