From patchwork Thu Aug 10 16:09:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 109834 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp2567867obb; Thu, 10 Aug 2017 08:49:12 -0700 (PDT) X-Received: by 10.99.52.135 with SMTP id b129mr11739201pga.241.1502380152038; Thu, 10 Aug 2017 08:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502380152; cv=none; d=google.com; s=arc-20160816; b=xBCxD6XTI0VvOwlrW2jitlpcFrBhpgflf0JxycSp7NlE4sVjX8s3SiXm3+8uRtOBIb 6+EjKohnda2Sj3eEZPl5rAqYRuxMM4gp7MkHrRYZyrjPwCdNPSSGMUy5vCdM7wceC0nx A0ZJvnlwVGhNEPSmR+1lVIkNoQbusiohY+wckWXokJmvlSFIH1HqpLXLCQtHv6VyiQiB EUc5KdW+Ig6KF/G+me1ta/4y3J7uNJV+ai1phKvystLD/HSAXtBqGRxSqJcNjywqsGLu tu9t2L7m7rKw6yQmJg2JjGRUid+EtRHuAilCHPNx25rE3ZTIPLku6hMpTlfIiiyZI8kf LRMg== 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=Sro/AJLmZM8tChHAmgCp2csC6rb/DoRdqNWMcQPI1Mg=; b=rZ7IHMZydPYfl308/fjCCf3Q52F7qrurTWiPuv/IywN7FirA5iipD5yJXuRw6Kk/wm 20qTYmJXL/6FlZqjTH2UP4IBTuiP89splkrJwymrxK0Q2A1JNNJh6qxaB7fC9DTjCmz/ Fx69Sm83CCJDZ30mVtcGdfeHsn6zpfynImYRAEphqiRkYCe7G+1XPd2khwUNgfz2sNMe xpBvTAwK20mMXY3guq9kBBfp/0e7XcjdKKwe60PL2d7RzNELGw3hOY29bJAlxf9j3iqE SvY+6TyPSTCwet7hA+jYwEthifnmg81CRjDn76jQWmgjyQCgVCi3KTgwd8pd2utIpxcD +9+g== 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 g127si4089705pgc.537.2017.08.10.08.49.11; Thu, 10 Aug 2017 08:49:12 -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 S1753243AbdHJPtI (ORCPT + 25 others); Thu, 10 Aug 2017 11:49:08 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3051 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752895AbdHJPmu (ORCPT ); Thu, 10 Aug 2017 11:42:50 -0400 Received: from 172.30.72.59 (EHLO DGGEMS402-HUB.china.huawei.com) ([172.30.72.59]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DEY38518; Thu, 10 Aug 2017 23:42:46 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.301.0; Thu, 10 Aug 2017 23:42:38 +0800 From: John Garry To: , CC: , , , , Xiang Chen , John Garry Subject: [PATCH 10/19] scsi: hisi_sas: add status and command buffer for internal abort Date: Fri, 11 Aug 2017 00:09:35 +0800 Message-ID: <1502381384-219889-11-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502381384-219889-1-git-send-email-john.garry@huawei.com> References: <1502381384-219889-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.0A090206.598C7EF8.0065, 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: 8ff28d3c738211d9190e98dd8786b899 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, internal abort function required status and command buffer to be set, so add necessary code for this. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 86868ec..7e642c8 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1363,12 +1363,21 @@ static int hisi_sas_query_task(struct sas_task *task) slot->port = port; task->lldd_task = slot; + slot->buf = dma_pool_alloc(hisi_hba->buffer_pool, + GFP_ATOMIC, &slot->buf_dma); + if (!slot->buf) { + rc = -ENOMEM; + goto err_out_tag; + } + memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr)); + memset(hisi_sas_cmd_hdr_addr_mem(slot), 0, HISI_SAS_COMMAND_TABLE_SZ); + memset(hisi_sas_status_buf_addr_mem(slot), 0, HISI_SAS_STATUS_BUF_SZ); rc = hisi_sas_task_prep_abort(hisi_hba, slot, device_id, abort_flag, task_tag); if (rc) - goto err_out_tag; + goto err_out_buf; list_add_tail(&slot->entry, &sas_dev->list); @@ -1386,6 +1395,9 @@ static int hisi_sas_query_task(struct sas_task *task) return 0; +err_out_buf: + dma_pool_free(hisi_hba->buffer_pool, slot->buf, + slot->buf_dma); err_out_tag: spin_lock_irqsave(&hisi_hba->lock, flags); hisi_sas_slot_index_free(hisi_hba, slot_idx);