From patchwork Mon Oct 12 15:20:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 54793 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id A622723001 for ; Mon, 12 Oct 2015 15:11:07 +0000 (UTC) Received: by wibzt1 with SMTP id zt1sf16795279wib.0 for ; Mon, 12 Oct 2015 08:11:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=FkF5u8SQ+kkXNA0GCO3nkKP2kE7IK/VDlItD/reIQw0=; b=UR5D+kcPjVCjjdgYJ0ADWVfgAA/tdLZOeEQe7pZaun41oLexIYFNXwEMY9/Cz4gb8p BtIC1u/D6VWvSuR8vCdK9f+WQRENBZNdIdmURRWMH8POSpJB6MHSxQRtL3b7DlDvIeR7 wzdEISjQWL4KLTcbTwRiNin/7WTgGNe+IDIPkIVfS/1F8WOU8tCxK2M+dQx544QPV4L6 GEKafhRa9BAMyyek0j+cg6irENi+sE79P0oaV1pnHwji3LSX/XpwH+YO+bEVqa1IZfP5 q62tFBTQqgrXRBCNCv4iqfMAOJBWAfNOtCi338tHp8FUwYTVADfDPJxUtTeIRk0urrBr S0qw== X-Gm-Message-State: ALoCoQmlH6olYHBvxgbVOhIhZaIie4OJM0t8dgGRsDax7DtV1sEA8jvAxPRjopxYPoXpz6R09C0h X-Received: by 10.181.29.103 with SMTP id jv7mr3026455wid.0.1444662666994; Mon, 12 Oct 2015 08:11:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.169.198 with SMTP id s189ls482805lfe.87.gmail; Mon, 12 Oct 2015 08:11:06 -0700 (PDT) X-Received: by 10.25.164.7 with SMTP id n7mr2429916lfe.3.1444662666839; Mon, 12 Oct 2015 08:11:06 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id h21si11535611lfb.104.2015.10.12.08.11.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2015 08:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbwr8 with SMTP id r8so144609670lbw.2 for ; Mon, 12 Oct 2015 08:11:06 -0700 (PDT) X-Received: by 10.112.146.104 with SMTP id tb8mr12967090lbb.35.1444662666600; Mon, 12 Oct 2015 08:11:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1602340lbq; Mon, 12 Oct 2015 08:11:04 -0700 (PDT) X-Received: by 10.60.70.40 with SMTP id j8mr15921321oeu.78.1444662664393; Mon, 12 Oct 2015 08:11:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si9051158oih.5.2015.10.12.08.11.04 for ; Mon, 12 Oct 2015 08:11:04 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752140AbbJLPK7 (ORCPT ); Mon, 12 Oct 2015 11:10:59 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:13446 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbbJLPK6 (ORCPT ); Mon, 12 Oct 2015 11:10:58 -0400 Received: from 172.24.1.51 (EHLO szxeml432-hub.china.huawei.com) ([172.24.1.51]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUB61509; Mon, 12 Oct 2015 23:05:09 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by szxeml432-hub.china.huawei.com (10.82.67.209) with Microsoft SMTP Server id 14.3.235.1; Mon, 12 Oct 2015 23:05:01 +0800 From: John Garry To: CC: , , , , , , , , , John Garry Subject: [PATCH 08/25] scsi: hisi_sas: add cq structure initialization Date: Mon, 12 Oct 2015 23:20:20 +0800 Message-ID: <1444663237-238302-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444663237-238302-1-git-send-email-john.garry@huawei.com> References: <1444663237-238302-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-scsi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.garry@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Each completion queue has a structure. This is mainly for passing to irq handler so we know which queue the irq occured on. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 6 ++++++ drivers/scsi/hisi_sas/hisi_sas_init.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 5f72d98..6c5d22a 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -44,6 +44,10 @@ struct hisi_sas_port { struct asd_sas_port sas_port; }; +struct hisi_sas_cq { + struct hisi_hba *hisi_hba; + int id; +}; struct hisi_sas_slot { struct list_head entry; @@ -92,6 +96,8 @@ struct hisi_hba { /* SCSI/SAS glue */ struct sas_ha_struct sha; struct Scsi_Host *shost; + + struct hisi_sas_cq cq[HISI_SAS_MAX_QUEUES]; struct hisi_sas_phy phy[HISI_SAS_MAX_PHYS]; struct hisi_sas_port port[HISI_SAS_MAX_PHYS]; int id; diff --git a/drivers/scsi/hisi_sas/hisi_sas_init.c b/drivers/scsi/hisi_sas/hisi_sas_init.c index 8f1e856..44fc524 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_init.c +++ b/drivers/scsi/hisi_sas/hisi_sas_init.c @@ -42,6 +42,12 @@ static int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost) struct device *dev = &hisi_hba->pdev->dev; for (i = 0; i < hisi_hba->queue_count; i++) { + struct hisi_sas_cq *cq = &hisi_hba->cq[i]; + + /* Completion queue structure */ + cq->id = i; + cq->hisi_hba = hisi_hba; + /* Delivery queue */ s = sizeof(struct hisi_sas_cmd_hdr) * HISI_SAS_QUEUE_SLOTS; hisi_hba->cmd_hdr[i] = dma_alloc_coherent(dev, s,