Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1937535pxj; Sun, 13 Jun 2021 03:31:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1xnvCu8u2yJ5MGxfZo43LCwSuJm0LgPJ1pTBB9qTmYwQXIWNJT22uS0glbpmy54be8EgO X-Received: by 2002:a05:6402:51:: with SMTP id f17mr3758068edu.359.1623580277505; Sun, 13 Jun 2021 03:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623580277; cv=none; d=google.com; s=arc-20160816; b=VFVyLD1TUtDXgTNaQr5eERJezEyceZps4SOV87kKEwVb30EFdDJZSZut3j48r/WI2e /FfpOcwJiEu9fK0/fETZpHsltebMAZ2vkeAcCik1Ikyzx36X6FbjhzQakZfs3QYXojxQ yDKX/o+wFlmF4EhDZ5yz3PdPsOzxxQemsZDN1Ke2fMRZC2Enn2/Ins80dCGnFPKqWGsC iUO9iLXgEzanEHI7X07zn/uPrjM8kxveUWr5XsWcilruVsTaeJPbZxw89/nCzIhVcfPY I3hRNwwZel8+8dEeg9gsqZ66yLbIBXOcowKCH0nXR569gK9Fdp02UW3QDPzjbVsGUcYc /kKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Aa4WbnaVGcGeGyBa692ntTIihKNgVGpavRSPW2rKnPI=; b=OmSmoHEuCAb/w1s4A8Z8FFxdSPj9pju0aKomcjjWKa03RSavlOE7YBghZ8putI3+Ek CgPB6SPfJOLb4F00Rdjo0JMFjpIQdo3TKSARs+r73f6QEMOToqDm9z41H1rXuCgHvo/G 3b5k0hGElN7xyG9j6TfxczTY56AR700enD4Tj6uciNd/d+5C301VHd19TUlRUSz178NO IQVFHoUxq6Cmsp157ZhClMahsR49x8yLB5z/k16GD5e3aIxu8nK3YEGsobOczBwq9YsC HhUx8zznLka2nR0elO/CHEeiYKEVGKfvyhDOSjTcJV8U5ybbDc1LBKYwEPOeIVZR4M43 Cziw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f22si9093446ejj.302.2021.06.13.03.30.54; Sun, 13 Jun 2021 03:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231738AbhFMK26 (ORCPT + 99 others); Sun, 13 Jun 2021 06:28:58 -0400 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:48306 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbhFMK24 (ORCPT ); Sun, 13 Jun 2021 06:28:56 -0400 Received: from localhost.localdomain ([86.243.172.93]) by mwinf5d10 with ME id GaSu2500G21Fzsu03aSuh8; Sun, 13 Jun 2021 12:26:54 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 13 Jun 2021 12:26:54 +0200 X-ME-IP: 86.243.172.93 From: Christophe JAILLET To: sathya.prakash@broadcom.com, sreekanth.reddy@broadcom.com, suganath-prabu.subramani@broadcom.com Cc: MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/2] scsi: mptsas: switch from 'pci_' to 'dma_' API in 'mptsas_exp_repmanufacture_info()' Date: Sun, 13 Jun 2021 12:26:53 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The wrappers in include/linux/pci-dma-compat.h should go away. The only caller of 'mptsas_exp_repmanufacture_info()' is 'mptsas_probe_one_phy()'. This function already calls 'sas_end_device_alloc()' or 'sas_expander_alloc()'. They both already use GFP_KERNEL. As no spin_lock is held at this point, it is safe to also use GFP_KERNEL here. While at it, also fix an ugly alignment issue in this function. Signed-off-by: Christophe JAILLET --- drivers/message/fusion/mptsas.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 1c898322316a..c6af453c7874 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -2896,7 +2896,8 @@ mptsas_exp_repmanufacture_info(MPT_ADAPTER *ioc, sz = sizeof(struct rep_manu_request) + sizeof(struct rep_manu_reply); - data_out = pci_alloc_consistent(ioc->pcidev, sz, &data_out_dma); + data_out = dma_alloc_coherent(&ioc->pcidev->dev, sz, &data_out_dma, + GFP_KERNEL); if (!data_out) { printk(KERN_ERR "Memory allocation failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -2935,7 +2936,7 @@ mptsas_exp_repmanufacture_info(MPT_ADAPTER *ioc, flagsLength = flagsLength << MPI_SGE_FLAGS_SHIFT; flagsLength |= sizeof(struct rep_manu_reply); ioc->add_sge(psge, flagsLength, data_out_dma + - sizeof(struct rep_manu_request)); + sizeof(struct rep_manu_request)); INITIALIZE_MGMT_STATUS(ioc->sas_mgmt.status) mpt_put_msg_frame(mptsasMgmtCtx, ioc, mf); @@ -2987,7 +2988,8 @@ mptsas_exp_repmanufacture_info(MPT_ADAPTER *ioc, } out_free: if (data_out_dma) - pci_free_consistent(ioc->pcidev, sz, data_out, data_out_dma); + dma_free_coherent(&ioc->pcidev->dev, sz, data_out, + data_out_dma); put_mf: if (mf) mpt_free_msg_frame(ioc, mf); -- 2.30.2