From patchwork Sun Oct 14 15:59:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10640721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC245933 for ; Sun, 14 Oct 2018 16:01:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D791E29E19 for ; Sun, 14 Oct 2018 16:01:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9E1B29E29; Sun, 14 Oct 2018 16:01:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BFE929E19 for ; Sun, 14 Oct 2018 16:01:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbeJNXm1 (ORCPT ); Sun, 14 Oct 2018 19:42:27 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46988 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727351AbeJNXm0 (ORCPT ); Sun, 14 Oct 2018 19:42:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=38At5MiYUaeefdLaBJyCEesojrKeVesKjyv9+ed3hkY=; b=MQWSJ/4uwQTv81zhRgvQXBz4S Mmqmz7gN3YKp6wNPQdyGdFjEeLhsqlZlbEv+wdE4fvmvLdayF5VMQAvQxpYIfoNRrMPOUzqNB7xPH USiY6SvEnad5VvSq5tcA+vaOdLP04EWLwa7idfrK33DSZxYPRWfdR21URqzzJRhqULKj9VbA+Q4LZ ciKSj5CNpChiFazNVVDzf+OgpYE+kyCa3sd6iJaEISVzzteIMHLSLHrVwr84xpt5wDyB5ZYHHBKbw LMmNTuXLzc+pPSMJ5J5U/Abukl7Xn1rbsS8cCSG4/CI+34QCAUKbefF9olmPnEu6BMaq7th6Y4/vJ yoQh8kS1A==; Received: from 089144199123.atnat0008.highway.a1.net ([89.144.199.123] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBip8-00032A-Ic for linux-scsi@vger.kernel.org; Sun, 14 Oct 2018 16:00:58 +0000 From: Christoph Hellwig To: linux-scsi@vger.kernel.org Subject: [PATCH 20/28] qedi: fully convert to the generic DMA API Date: Sun, 14 Oct 2018 17:59:54 +0200 Message-Id: <20181014160002.8383-21-hch@lst.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181014160002.8383-1-hch@lst.de> References: <20181014160002.8383-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Acked-by: Manish Rangankar --- drivers/scsi/qedi/qedi_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index aa96bccb5a96..95d3fce994f6 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -806,11 +806,11 @@ static int qedi_set_iscsi_pf_param(struct qedi_ctx *qedi) memset(&qedi->pf_params.iscsi_pf_params, 0, sizeof(qedi->pf_params.iscsi_pf_params)); - qedi->p_cpuq = pci_alloc_consistent(qedi->pdev, + qedi->p_cpuq = dma_alloc_coherent(&qedi->pdev->dev, qedi->num_queues * sizeof(struct qedi_glbl_q_params), - &qedi->hw_p_cpuq); + &qedi->hw_p_cpuq, GFP_KERNEL); if (!qedi->p_cpuq) { - QEDI_ERR(&qedi->dbg_ctx, "pci_alloc_consistent fail\n"); + QEDI_ERR(&qedi->dbg_ctx, "pci_alloc_coherent fail\n"); rval = -1; goto err_alloc_mem; } @@ -871,7 +871,7 @@ static void qedi_free_iscsi_pf_param(struct qedi_ctx *qedi) if (qedi->p_cpuq) { size = qedi->num_queues * sizeof(struct qedi_glbl_q_params); - pci_free_consistent(qedi->pdev, size, qedi->p_cpuq, + dma_free_coherent(&qedi->pdev->dev, size, qedi->p_cpuq, qedi->hw_p_cpuq); }