From patchwork Fri Dec 8 17:16:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 121212 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp868719qgn; Fri, 8 Dec 2017 08:36:09 -0800 (PST) X-Google-Smtp-Source: AGs4zMbLhXf7k2f/54WtFaJeyj+SVZhiAnAjh7udT8bzjTKTgFGzp3fTeeRVe+fxoL6IpBjnuMlZ X-Received: by 10.84.133.111 with SMTP id 102mr30892323plf.136.1512750969077; Fri, 08 Dec 2017 08:36:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512750969; cv=none; d=google.com; s=arc-20160816; b=rnfYfBLRvjxzXIp6XmgWoSMNzJ0UTvBhD5V+vBi5LrEM14rbMQygHUATnB5AEoOhgV 9Bzm2ctiCoPvNmqdMcOxHJiXhk5R/VWyIkFiHo8q4z5IQJckkICDmFRCILIoW7TBHJp7 qxmJgk/mO/JKzX+l5VFsGL71b7VlqWJD5aGWZc2e9+i2eXDHbke1+nHmNJjjrEUgcAi3 vYePrzv3iNSdKHM5hROzJ1yWwpjAzMwzic8hXGrmHvkw0LU20oRaYJiwTHgmKNH9pRCJ UZvm3hnstUVkQuWvGCVw+iXY9TTqAfESDWmNKGEXsv7ZuoTU3uqhd9jqeJi8KDH/LRFR DcAg== 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=TC2Vq8mXymsf+0BHNlgYJphR4qF9msTLE/fP0hyUTlA=; b=F/nGM+ia9yvkvH9DtNSxcjhjXWgtsh+wOwwHtEl3fwZ3jEbNEx1HjrPPcXrduJ1oK9 zA+BTUejehJGxbA+kUDWVEJJoNdQKElQljOQG0BP8s8Lxm9mHYp8KloBrMCyOYaIk9xu DKr3Y5rfxzSt74O+mr5yCNvqjxoTSSvyqcotCUa0dRW1FNMZovS0CLCZvyzTmgDWEQp5 fY6/IlVRPERUGYvp7QASI3WqR7cGqjdQwIlz2keBxAvQnzFI8FJdgkAZUI5sl5LWD3Kr jbaYxSa7Ynd07ukVrePIJxz23dLkNiwxd4yS+f4alvcIbPga/pyfXJhcHiQ1NPwFeO25 8jdA== 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 e3si5733821plb.426.2017.12.08.08.36.08; Fri, 08 Dec 2017 08:36:09 -0800 (PST) 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 S1753714AbdLHQgH (ORCPT + 18 others); Fri, 8 Dec 2017 11:36:07 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2225 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752914AbdLHQbA (ORCPT ); Fri, 8 Dec 2017 11:31:00 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7A502C07BCA2C; Sat, 9 Dec 2017 00:30:44 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.361.1; Sat, 9 Dec 2017 00:30:38 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 08/19] scsi: hisi_sas: change ncq process for v3 hw Date: Sat, 9 Dec 2017 01:16:39 +0800 Message-ID: <1512753410-50924-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1512753410-50924-1-git-send-email-john.garry@huawei.com> References: <1512753410-50924-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen For v3 hw, each NCQ will return a CQ, so it is no need to acquire IPTT from ITCT, just acquire it from IPTT field of CQ. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 40 +++++----------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 44f07bc..69aa7bc 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1653,9 +1653,8 @@ static void cq_tasklet_v3_hw(unsigned long val) struct hisi_sas_cq *cq = (struct hisi_sas_cq *)val; struct hisi_hba *hisi_hba = cq->hisi_hba; struct hisi_sas_slot *slot; - struct hisi_sas_itct *itct; struct hisi_sas_complete_v3_hdr *complete_queue; - u32 rd_point = cq->rd_point, wr_point, dev_id; + u32 rd_point = cq->rd_point, wr_point; int queue = cq->id; struct hisi_sas_dq *dq = &hisi_hba->dq[queue]; @@ -1671,38 +1670,11 @@ static void cq_tasklet_v3_hw(unsigned long val) complete_hdr = &complete_queue[rd_point]; - /* Check for NCQ completion */ - if (complete_hdr->act) { - u32 act_tmp = complete_hdr->act; - int ncq_tag_count = ffs(act_tmp); - - dev_id = (complete_hdr->dw1 & CMPLT_HDR_DEV_ID_MSK) >> - CMPLT_HDR_DEV_ID_OFF; - itct = &hisi_hba->itct[dev_id]; - - /* The NCQ tags are held in the itct header */ - while (ncq_tag_count) { - __le64 *ncq_tag = &itct->qw4_15[0]; - - ncq_tag_count -= 1; - iptt = (ncq_tag[ncq_tag_count / 5] - >> (ncq_tag_count % 5) * 12) & 0xfff; - - slot = &hisi_hba->slot_info[iptt]; - slot->cmplt_queue_slot = rd_point; - slot->cmplt_queue = queue; - slot_complete_v3_hw(hisi_hba, slot); - - act_tmp &= ~(1 << ncq_tag_count); - ncq_tag_count = ffs(act_tmp); - } - } else { - iptt = (complete_hdr->dw1) & CMPLT_HDR_IPTT_MSK; - slot = &hisi_hba->slot_info[iptt]; - slot->cmplt_queue_slot = rd_point; - slot->cmplt_queue = queue; - slot_complete_v3_hw(hisi_hba, slot); - } + iptt = (complete_hdr->dw1) & CMPLT_HDR_IPTT_MSK; + slot = &hisi_hba->slot_info[iptt]; + slot->cmplt_queue_slot = rd_point; + slot->cmplt_queue = queue; + slot_complete_v3_hw(hisi_hba, slot); if (++rd_point >= HISI_SAS_QUEUE_SLOTS) rd_point = 0;