From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FEDBC433E1 for ; Thu, 27 Aug 2020 10:03:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52C2C2075B for ; Thu, 27 Aug 2020 10:03:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="bvGrXB2B" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728722AbgH0KDP (ORCPT ); Thu, 27 Aug 2020 06:03:15 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:42586 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728629AbgH0KDC (ORCPT ); Thu, 27 Aug 2020 06:03:02 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1598522580; h=Date: Message-Id: Cc: To: References: In-Reply-To: From: Subject: Content-Transfer-Encoding: MIME-Version: Content-Type: Sender; bh=I63dscgYJSrLMpras0ftM8tf/GYO8Uv6u9iExs3NyTU=; b=bvGrXB2BUdbxYn3ATnSUTT09K/39fZYEUMSKsAF+chL+o+owR9cMfdm6SYQp3MuvIogmclkq ZvhPh6VTTLQuVB3tGOOkj+UWeVYJ9N5ZJmleQkLgv4V7wFgOFPfwrwm4AKO5Hv0ozKo4XVaB /VBstvEHGc3VpMn/3x/RIuACP6c= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 5f4784a70c264e6b004770f6 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 27 Aug 2020 10:02:15 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 17B8AC433CB; Thu, 27 Aug 2020 10:02:15 +0000 (UTC) Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id C9715C433CA; Thu, 27 Aug 2020 10:02:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C9715C433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] rtw88: switch from 'pci_' to 'dma_' API From: Kalle Valo In-Reply-To: <20200820150643.148219-1-christophe.jaillet@wanadoo.fr> References: <20200820150643.148219-1-christophe.jaillet@wanadoo.fr> To: Christophe JAILLET Cc: yhchuang@realtek.com, davem@davemloft.net, kuba@kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET User-Agent: pwcli/0.1.0-git (https://github.com/kvalo/pwcli/) Python/3.5.2 Message-Id: <20200827100215.17B8AC433CB@smtp.codeaurora.org> Date: Thu, 27 Aug 2020 10:02:15 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Christophe JAILLET wrote: > The wrappers in include/linux/pci-dma-compat.h should go away. > > The patch has been generated with the coccinelle script below and has been > hand modified to replace GFP_ with a correct flag. > It has been compile tested. > > When memory is allocated in 'rtw_pci_init_tx_ring()' and > 'rtw_pci_init_rx_ring()' GFP_KERNEL can be used because both functions are > called from a probe function and no spinlock is taken. > > The call chain is: > rtw_pci_probe > --> rtw_pci_setup_resource > --> rtw_pci_init > --> rtw_pci_init_trx_ring > --> rtw_pci_init_tx_ring > --> rtw_pci_init_rx_ring > > > @@ > @@ > - PCI_DMA_BIDIRECTIONAL > + DMA_BIDIRECTIONAL > > @@ > @@ > - PCI_DMA_TODEVICE > + DMA_TO_DEVICE > > @@ > @@ > - PCI_DMA_FROMDEVICE > + DMA_FROM_DEVICE > > @@ > @@ > - PCI_DMA_NONE > + DMA_NONE > > @@ > expression e1, e2, e3; > @@ > - pci_alloc_consistent(e1, e2, e3) > + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) > > @@ > expression e1, e2, e3; > @@ > - pci_zalloc_consistent(e1, e2, e3) > + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_free_consistent(e1, e2, e3, e4) > + dma_free_coherent(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_map_single(e1, e2, e3, e4) > + dma_map_single(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_unmap_single(e1, e2, e3, e4) > + dma_unmap_single(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2, e3, e4, e5; > @@ > - pci_map_page(e1, e2, e3, e4, e5) > + dma_map_page(&e1->dev, e2, e3, e4, e5) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_unmap_page(e1, e2, e3, e4) > + dma_unmap_page(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_map_sg(e1, e2, e3, e4) > + dma_map_sg(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_unmap_sg(e1, e2, e3, e4) > + dma_unmap_sg(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) > + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_dma_sync_single_for_device(e1, e2, e3, e4) > + dma_sync_single_for_device(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) > + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2, e3, e4; > @@ > - pci_dma_sync_sg_for_device(e1, e2, e3, e4) > + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) > > @@ > expression e1, e2; > @@ > - pci_dma_mapping_error(e1, e2) > + dma_mapping_error(&e1->dev, e2) > > @@ > expression e1, e2; > @@ > - pci_set_dma_mask(e1, e2) > + dma_set_mask(&e1->dev, e2) > > @@ > expression e1, e2; > @@ > - pci_set_consistent_dma_mask(e1, e2) > + dma_set_coherent_mask(&e1->dev, e2) > > Signed-off-by: Christophe JAILLET Patch applied to wireless-drivers-next.git, thanks. 24712ea996d8 rtw88: switch from 'pci_' to 'dma_' API -- https://patchwork.kernel.org/patch/11726423/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches