From patchwork Thu Oct 24 14:21:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 177521 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2265532ill; Thu, 24 Oct 2019 07:25:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHxwm5T1gTFfMBcfMmykpHYenaVXEu8VT+lPprtS3nXgLZs5nSY3uZ1aPTZ4yB1E/BoSgZ X-Received: by 2002:a05:6402:1a55:: with SMTP id bf21mr20823211edb.61.1571927099954; Thu, 24 Oct 2019 07:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571927099; cv=none; d=google.com; s=arc-20160816; b=HXZXjpezttc+ko5BpOsaCviIGYPNGX/PDtXnDP6O7Cn4ui+oL+Y+p87XcW/FNrBqQd ZxNn6b5S2R2k4+Fs02BaR+8uy99mpAfvn7jOICmwCffFunpLxXvpAq/Fx7hLVn/aAfN8 mtn8Vw+amSCRxzrhOW2Lujfyf0j0UXj7Dmrz8T88m6vI6D/RlUv9sFWgku3hZ2R8GMcM hHVR+edZW52QzCSCZnfYRgtMgnlawKjGZb5rMlJsaoc+M58JJ8BlKQyw2A0zlxHqN7YR LnTI5Wo4Piid10v4I606fMSpNaDqUHl+UkBYxuLbL5l0EyC+SaD3Ebk2oKKpvCfkGZ7b z9Cg== 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=YWnviruY8vK+DMfnPrsbc3t9oUQJB4wDk2zM3T7WYVQ=; b=U2oho3X9dA3EoOSUYlb5ASaFj6PzFCNFor0CGdAOwsdlUqW/6qyV+GOpSn8V87EYyq lwzqHltRz9Qjo27YpA1K4F+eGNoO23+pjoWvNZaK+RQsLDnOtFDOJ5o9h4tRyPnajDnM cfeEhKd0Cdxj3Wd5Ue1KwpGEo2hMQ1b9KyNLC8dWLJuOQ9dRk65qIWol4qeRKnSM0MRy 8Bi7frSDt/XWKleeJOubH2el0wSJeADfhrtx0EXwZ4lpKSObY+ZIzFUFiqBCHdKL6Djt KnB8jl19s9c38GfoWnh5s2c1rBOou4tR92PQCy6MazugAiU2lHn3GL16sTAUeT5B+x25 5bug== 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 w56si4031696eda.376.2019.10.24.07.24.59; Thu, 24 Oct 2019 07:24:59 -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 S2409441AbfJXOYz (ORCPT + 26 others); Thu, 24 Oct 2019 10:24:55 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4759 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2409390AbfJXOYx (ORCPT ); Thu, 24 Oct 2019 10:24:53 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 97E4D15FBED8605D361F; 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 3/6] scsi: hisi_sas: Add bitmaps_alloc_v3_hw() Date: Thu, 24 Oct 2019 22:21:18 +0800 Message-ID: <1571926881-75524-4-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We will want to make this non-generic in future. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 2ae7070db41a..a46717efb870 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -556,6 +556,13 @@ static u32 hisi_sas_phy_read32(struct hisi_hba *hisi_hba, readl_poll_timeout_atomic(regs, val, cond, delay_us, timeout_us);\ }) +static int bitmaps_alloc_v3_hw(struct hisi_hba *hisi_hba) +{ + return sbitmap_init_node(&hisi_hba->slot_index_tags, + HISI_SAS_UNRESERVED_IPTT, -1, + GFP_KERNEL, dev_to_node(hisi_hba->dev)); +} + static void init_reg_v3_hw(struct hisi_hba *hisi_hba) { int i; @@ -3083,6 +3090,7 @@ static struct scsi_host_template sht_v3_hw = { static const struct hisi_sas_hw hisi_sas_v3_hw = { .hw_init = hisi_sas_v3_init, .setup_itct = setup_itct_v3_hw, + .bitmaps_alloc = bitmaps_alloc_v3_hw, .get_wideport_bitmap = get_wideport_bitmap_v3_hw, .complete_hdr_size = sizeof(struct hisi_sas_complete_v3_hdr), .clear_itct = clear_itct_v3_hw,