Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp857670ybh; Tue, 10 Mar 2020 09:32:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vujg+qnLXx58vg/pBsKFhLRxsGMYdkREd2V0jNkvRbLViLRe573n+KQOvqRRRm9g7VdtODk X-Received: by 2002:a9d:6446:: with SMTP id m6mr16852781otl.122.1583857930726; Tue, 10 Mar 2020 09:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583857930; cv=none; d=google.com; s=arc-20160816; b=Ibg6B6n4te3s4/yVkycM9zwTFNe2wEMTsj87GQX/3HTNrnxFNHo41Fb7A9Us+ts5w8 sxiGdSTUH7qFNHzr4wZnqG1m1HJZK0aicOQnNCio2mPF5mHnIszMnTlE8DqoOclRm+yZ HSWeLI7WMXlHWKLxYFTAYHgM+AYP/FcAG5mde2Zq/70mB2DlH04FpBrBTd422YSnfz/b syRoPcY3CdsfLEVIzDgqUSUtAZdNofkPpwYoRxXczsNiShNXvShoHgSi3Q2w38T5TlUX HWRVTeED7Kzn1vSufCLB8OUTEVfB+kls/1xIofadFxoI7cU7InRCli/XAXUslDVNxCFo YGQQ== 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=jGZFp2pbhcNLLuNEpLOb/CvB0VNL9MCYBS6Z2VmIWro=; b=qabbYg3YdwaMh73ImVfwhz8YXCNAFI4zyHKZHhNiceBd7tXBvA7nMusZnJupFgTwBU OBx/o9pXTF4QNnFkysztQQx4bNPu7b7g5gAlfNvQ/w2q8PI/L2Og36plb4jeUnOygQSY B40y8ibl+Cui6LYD8+kcL3Kty/c5y82t5d1G83VAcrCK9JmclKYRJ2xeAzOw3Sqt9Q2D rpD/NMC8H6oQa2aqLUipXTgQ29KrTCLMi3vtpuFwqk6V8G7VmdYuQ7ldzayFvcTT1lQN kwG2Re/OxV3oNOlhqtcQRb9dxCo/4Soluls8puxXh3ioEpKU5UzIGsUUexUFuER94Gbu ldAA== 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 f15si5809534otp.314.2020.03.10.09.31.58; Tue, 10 Mar 2020 09:32:10 -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 S1727492AbgCJQbS (ORCPT + 99 others); Tue, 10 Mar 2020 12:31:18 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:11219 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727464AbgCJQbQ (ORCPT ); Tue, 10 Mar 2020 12:31:16 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C9E836DEA0F079C9BFAD; Wed, 11 Mar 2020 00:30:38 +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.487.0; Wed, 11 Mar 2020 00:30:32 +0800 From: John Garry To: , , , , , , CC: , , , , , , John Garry Subject: [PATCH RFC v2 24/24] scsi: hisi_sas: Use libsas slow task SCSI command Date: Wed, 11 Mar 2020 00:25:50 +0800 Message-ID: <1583857550-12049-25-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1583857550-12049-1-git-send-email-john.garry@huawei.com> References: <1583857550-12049-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain 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 Now that a SCSI command can be allocated for a libsas slow tasks, make the task prep code use it. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 ++++- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index c7951ac8b075..61039f3608c8 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -476,8 +476,10 @@ static int hisi_sas_task_prep(struct sas_task *task, } else { scsi_cmnd = task->uldd_task; } + } else if (task->slow_task) { + scsi_cmnd = task->slow_task->scmd; } - rc = hisi_sas_slot_index_alloc(hisi_hba, scsi_cmnd); + rc = hisi_sas_slot_index_alloc(hisi_hba, scsi_cmnd); } if (rc < 0) goto err_out_dif_dma_unmap; @@ -2650,6 +2652,7 @@ int hisi_sas_probe(struct platform_device *pdev, } else { shost->can_queue = HISI_SAS_UNRESERVED_IPTT; shost->cmd_per_lun = HISI_SAS_UNRESERVED_IPTT; + shost->nr_reserved_cmds = HISI_SAS_RESERVED_IPTT; } sha->sas_ha_name = DRV_NAME; diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index a2debe0c8185..44530f8c0319 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -3237,8 +3237,9 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) shost->max_lun = ~0; shost->max_channel = 1; shost->max_cmd_len = 16; - shost->can_queue = HISI_SAS_UNRESERVED_IPTT; - shost->cmd_per_lun = HISI_SAS_UNRESERVED_IPTT; + shost->can_queue = HISI_SAS_MAX_COMMANDS; + shost->cmd_per_lun = HISI_SAS_MAX_COMMANDS; + shost->nr_reserved_cmds = HISI_SAS_RESERVED_IPTT; sha->sas_ha_name = DRV_NAME; sha->dev = dev; -- 2.17.1