From patchwork Thu Oct 24 14:21:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 177525 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2265910ill; Thu, 24 Oct 2019 07:25:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzxKG5KphDvERuXhbzrMiOb1zd7b93Sn/r7t6cNRjp+/7PAEO3PuhTRM7ERI5eVvf1NsLU X-Received: by 2002:a17:906:6a14:: with SMTP id o20mr37307387ejr.230.1571927114364; Thu, 24 Oct 2019 07:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571927114; cv=none; d=google.com; s=arc-20160816; b=i/yEqu+ICKVozudzhbfyIBUwemHp7jY66lDtq/9aJsnrbxm8D1Cf0KN4YPpDK5AqG8 28MxKccoNK18qcN9P+RqzGtgjYnKHbCGdnv2CecIljfSTifWXwmyMOxqcLEHy0FtAOtd 5fYCtH/3xxIIGJKKOLKumNSHkr5WZIH8wUFYVmEKbX3wbd3TAQGDoslhNTlZbHoNnHp0 Nqoynssap9z07QBdpM0i5gQJp+PX0t4RasvM8ibRFNxHS4wMloMl3oNO/qFqsDipL4z1 fua+KY4k7kUJSYlxX9JAlGWwUHJOnqaCKKmVvsaq5G7DgRwk5eRm8+KSuqNswO0jvWF7 BC9A== 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=oqmjIuMCuYFWyPQXG8wWN1U/5UrgFNLBfZrybLi1/Z4=; b=NKiRIjjPSM06WcnGyJ6h8G3R0nan2denLpGVJHtXQ1jfZKEIbb5lJJGpNRYWnYQ+yS ioOG3y0SUcvABiRBmi3yWkpS4CJM/7N3spRn8Y0RbBhl2NWXlrOzvvCOEfvtLWqvbgx1 a0HyqNLhf41TBsDof7RuOiS5PxumagHryMutyfmqY5N9ORL/5m0RbnfF7xw3N2a/np58 P3jpzZYm/n/Xe3oS/DX25KcS+iWNN5SLhISwmHYEHGQcto3bXqy+RQtJr+H8b96xEKcp BuMWzqF/YZuWLI7tKlB6P8GEaC+nExo0qrK/DX7Jml5X06tWSM7nULfjoA6T+2w6zUDU Jmqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 l22si14480470ejr.149.2019.10.24.07.25.14 for ; Thu, 24 Oct 2019 07:25:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502832AbfJXOZK (ORCPT ); Thu, 24 Oct 2019 10:25:10 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:32862 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2409438AbfJXOZJ (ORCPT ); Thu, 24 Oct 2019 10:25:09 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4B66193F067BE1EE2EF5; Thu, 24 Oct 2019 22:24:50 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Thu, 24 Oct 2019 22:24:40 +0800 From: John Garry To: , CC: , , , , , "John Garry" Subject: [PATCH 2/6] scsi: hisi_sas: Pass scsi_cmnd pointer to hisi_sas_hw.slot_index_alloc Date: Thu, 24 Oct 2019 22:21:17 +0800 Message-ID: <1571926881-75524-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1571926881-75524-1-git-send-email-john.garry@huawei.com> References: <1571926881-75524-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In future we will want to pass both the domain_device and scsi_cmnd pointers to hisi_sas_hw.slot_index_alloc. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 3 ++- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index fbfaa92765cf..4eb8f1c53f78 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -278,7 +278,8 @@ struct hisi_sas_hw { void (*setup_itct)(struct hisi_hba *hisi_hba, struct hisi_sas_device *device); int (*slot_index_alloc)(struct hisi_hba *hisi_hba, - struct domain_device *device); + struct domain_device *device, + struct scsi_cmnd *scmd); void (*slot_index_free)(struct hisi_hba *hisi_hba, int slot_idx); int (*bitmaps_alloc)(struct hisi_hba *hisi_hba); struct hisi_sas_device *(*alloc_dev)(struct domain_device *device); diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index f4937da9baf8..53802c1cc1d0 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -438,7 +438,7 @@ static int hisi_sas_task_prep(struct sas_task *task, } if (hisi_hba->hw->slot_index_alloc) - rc = hisi_hba->hw->slot_index_alloc(hisi_hba, device); + rc = hisi_hba->hw->slot_index_alloc(hisi_hba, device, NULL); else { struct scsi_cmnd *scsi_cmnd = NULL; @@ -1929,7 +1929,7 @@ hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba, int device_id, /* simply get a slot and send abort command */ if (hisi_hba->hw->slot_index_alloc) - rc = hisi_hba->hw->slot_index_alloc(hisi_hba, device); + rc = hisi_hba->hw->slot_index_alloc(hisi_hba, device, NULL); else rc = hisi_sas_slot_index_alloc(hisi_hba, NULL); if (rc < 0) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 683e1b99c9ae..b98ae960964b 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -791,7 +791,8 @@ static int bitmaps_alloc_v2_hw(struct hisi_hba *hisi_hba) static int slot_index_alloc_quirk_v2_hw(struct hisi_hba *hisi_hba, - struct domain_device *device) + struct domain_device *device, + struct scsi_cmnd *scmd) { struct sbitmap *slot_index_tags; int sata_dev = dev_is_sata(device);