Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1357488pxb; Sun, 22 Aug 2021 14:27:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsyWe2tfQquJnTjyfdT0YboNOYbwtFe5CAEJBqJlLnk81Jpd5HbxNaTPyridyKjXftpdUv X-Received: by 2002:a17:907:9688:: with SMTP id hd8mr32871386ejc.484.1629667657829; Sun, 22 Aug 2021 14:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629667657; cv=none; d=google.com; s=arc-20160816; b=vGjIe6W5a4b2wC6Stxmw7es3AXHqzP3Y2PqXn+Yyp6Ef0GDTumk4KSNwcibdxGyW+K IFaRufarmgtMGP53lTh3nxcBxPbgfQDXOvN11NNagQa29swoirt4YaoAiycG6xMpMx2u ebBjNKQLUPMn+MjGCfwhEus45TjDLaG3014W0X9Gr1eAICO1lFkivA/Htr3R7PS5q4qH 0poHt1FCMHfjwxZiMU76bTkO8O7n0/BgdsYuBHTC6GI+v6/oIcwPvUSjSF9QdkcTRHSz f286+9gWpb6GM54XcqyqrYAupl6r4bAnbVZhXsEsn/tHesRSHYkN6OpEkZff/lXyXScz ZYcQ== 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 :message-id:date:subject:cc:to:from; bh=32FNDXCclPR+3V31xjmJ2xuldBiDerb2SV8NBS8uQ64=; b=dIv56W9uqy9PY39x9i/ONFWZamyEMLD0gYDaJCWTnppSWqcxzpb0YUAy6H73senMkg evkaTHar4WpazrFw7xf10ThREFahykNbNtONLm9yp64UOQz7ZSzEPtTsDehocxCrLH0P Nq9sSZzKxByFoucvEgKYDOMWPJ7+W3pCeaXp1sz6prYNLI13vHtwtxXLB3FN5APjLy7Y SJrs9LlpEBxG11kRXa0yuACRv2r3/Hf29al6No7+3WBTHLQHOCtuV2d3NJdYAVyuXi4m Ni9N2Ugp09puIVeXQWwpSyveUSYXzXjM49OOYNKk1QkxW+pegLqmIojBv2h5EkZms0j9 tC3g== 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 r21si14972502ejo.47.2021.08.22.14.27.15; Sun, 22 Aug 2021 14:27:37 -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 S233180AbhHVVYK (ORCPT + 99 others); Sun, 22 Aug 2021 17:24:10 -0400 Received: from out02.smtpout.orange.fr ([193.252.22.211]:29268 "EHLO out.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233187AbhHVVYJ (ORCPT ); Sun, 22 Aug 2021 17:24:09 -0400 Received: from pop-os.home ([90.126.253.178]) by mwinf5d51 with ME id klPS250073riaq203lPSkT; Sun, 22 Aug 2021 23:23:27 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 22 Aug 2021 23:23:27 +0200 X-ME-IP: 90.126.253.178 From: Christophe JAILLET To: alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] drm/radeon: switch from 'pci_' to 'dma_' API Date: Sun, 22 Aug 2021 23:23:25 +0200 Message-Id: <1187ca1dbaa74ca4a87db9496061243e9a810faa.1629667363.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.30.2 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 patch has been generated with the coccinelle script below. It has been compile tested. @@ @@ - 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 --- If needed, see post from Christoph Hellwig on the kernel-janitors ML: https://marc.info/?l=kernel-janitors&m=158745678307186&w=4 --- drivers/gpu/drm/radeon/radeon_device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index ac8c3251b616..4f0fbf667431 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -785,7 +785,7 @@ int radeon_dummy_page_init(struct radeon_device *rdev) if (rdev->dummy_page.page == NULL) return -ENOMEM; rdev->dummy_page.addr = dma_map_page(&rdev->pdev->dev, rdev->dummy_page.page, - 0, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); + 0, PAGE_SIZE, DMA_BIDIRECTIONAL); if (dma_mapping_error(&rdev->pdev->dev, rdev->dummy_page.addr)) { dev_err(&rdev->pdev->dev, "Failed to DMA MAP the dummy page\n"); __free_page(rdev->dummy_page.page); @@ -808,8 +808,8 @@ void radeon_dummy_page_fini(struct radeon_device *rdev) { if (rdev->dummy_page.page == NULL) return; - pci_unmap_page(rdev->pdev, rdev->dummy_page.addr, - PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); + dma_unmap_page(&rdev->pdev->dev, rdev->dummy_page.addr, PAGE_SIZE, + DMA_BIDIRECTIONAL); __free_page(rdev->dummy_page.page); rdev->dummy_page.page = NULL; } -- 2.30.2