Finished removing usages of "pci-dma-compat.h" KPI
Subsystems (14)
PATCH 7/7 Finished removing usages of "pci-dma-compat.h" KPI
Im sorry to the kernel maintainers. TLDR; this patch came to early and I didnt expect to be working on the kernel at 1 am.
https://lkml.org/lkml/2022/2/23/11 deals with much of the reasons of this commit and part of what should have been included here but is now included here(ie. this should have been 2 parts). If you have the time I plead that you commit that, this and another commit removing pci-dma-compat.h, removing the refrence at pci.h and replace it with a include to <linux/dma-mapping.h>. If you dont have the time to do this then I will do it during the next -rc but make sure it compiles finishes just in case(ive compiled the kernel 3 times to be sure but you never know). If there are any problems with this patch, tell me and ill send a follow up that will fix the issues.
--- drivers/char/agp/intel-gtt.c | 23 ++++++++++++----------- drivers/dma/dw/pci.c | 1 + drivers/dma/idxd/device.c | 1 + drivers/dma/ptdma/ptdma-dmaengine.c | 1 + drivers/fpga/dfl-pci.c | 15 +++++---------- drivers/media/pci/cx18/cx18-queue.h | 4 ++-- drivers/media/pci/ivtv/ivtv-queue.h | 22 +++++++++++----------- drivers/media/pci/ivtv/ivtv-udma.h | 8 ++++---- drivers/pci/probe.c | 1 + drivers/video/fbdev/hyperv_fb.c | 1 + drivers/video/fbdev/via/via-core.c | 1 + drivers/virtio/virtio_pci_legacy_dev.c | 1 + drivers/virtio/virtio_pci_modern_dev.c | 1 + sound/pci/ctxfi/cthw20k1.c | 1 + sound/pci/ctxfi/cthw20k2.c | 1 + sound/pci/lx6464es/lx6464es.c | 1 + 16 files changed, 45 insertions(+), 38 deletions(-)
drivers/char/agp/intel-gtt.c +12 -11
@@ -15,6 +15,7 @@* /fairy-tale-mode off */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h>
@@ -111,8 +112,8 @@ static int intel_gtt_map_memory(struct page **pages,for_each_sg (st->sgl, sg, num_entries, i)sg_set_page (sg, pages[i],PAGE_SIZE ,0 ); -if (!pci_map_sg (intel_private.pcidev, - st->sgl, st->nents,PCI_DMA_BIDIRECTIONAL )) +if (!dma_map_sg (&intel_private.pcidev->dev, + st->sgl, st->nents,DMA_BIDIRECTIONAL )) goto err;return 0 ;
@@ -127,8 +128,8 @@ static void intel_gtt_unmap_memory(struct scatterlist *sg_list, int num_sg)struct sg_table st;DBG ("try unmapping %lu pages\n" , (unsigned long )mem->page_count); -pci_unmap_sg (intel_private.pcidev, sg_list, - num_sg,PCI_DMA_BIDIRECTIONAL ); +dma_unmap_sg (&intel_private.pcidev->dev, sg_list, + num_sg,DMA_BIDIRECTIONAL ); st.sgl = sg_list; st.orig_nents = st.nents = num_sg;
@@ -303,9 +304,9 @@ static int intel_gtt_setup_scratch_page(void)set_pages_uc (page,1 );if (intel_private.needs_dmar) { - dma_addr =pci_map_page (intel_private.pcidev, page,0 , -PAGE_SIZE ,PCI_DMA_BIDIRECTIONAL ); -if (pci_dma_mapping_error (intel_private.pcidev, dma_addr)) { + dma_addr =dma_map_page (&intel_private.pcidev->dev, page,0 , +PAGE_SIZE ,DMA_BIDIRECTIONAL ); +if (dma_mapping_error (&intel_private.pcidev->dev, dma_addr)) {__free_page (page);return -EINVAL ; }
@@ -552,9 +553,9 @@ static void intel_gtt_teardown_scratch_page(void) {set_pages_wb (intel_private.scratch_page,1 );if (intel_private.needs_dmar) -pci_unmap_page (intel_private.pcidev, +dma_unmap_page (&intel_private.pcidev->dev, intel_private.scratch_page_dma, -PAGE_SIZE ,PCI_DMA_BIDIRECTIONAL ); +PAGE_SIZE ,DMA_BIDIRECTIONAL );__free_page (intel_private.scratch_page); }
@@ -1412,12 +1413,12 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev,if (bridge) { mask = intel_private.driver->dma_mask_size; -if (pci_set_dma_mask (intel_private.pcidev,DMA_BIT_MASK (mask))) +if (dma_set_mask (&intel_private.pcidev->dev,DMA_BIT_MASK (mask)))dev_err (&intel_private.pcidev->dev,"set gfx device dma mask %d-bit failed!\n" , mask);else -pci_set_consistent_dma_mask (intel_private.pcidev, +dma_set_coherent_mask (&intel_private.pcidev->dev,DMA_BIT_MASK (mask)); }
drivers/dma/dw/pci.c +1 -0
@@ -6,6 +6,7 @@* Author: Andy Shevchenko <[email protected]> */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/device.h>
drivers/dma/idxd/device.c +1 -0
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2019 Intel Corporation. All rights rsvd. */ +#include <linux/dma-mapping.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h>
drivers/dma/ptdma/ptdma-dmaengine.c +1 -0
@@ -9,6 +9,7 @@* Author: Gary R Hook <[email protected]> */ +#include <linux/dma-mapping.h> #include "ptdma.h" #include "../dmaengine.h" #include "../virt-dma.h"
drivers/fpga/dfl-pci.c +5 -10
@@ -15,6 +15,7 @@*/ #include <linux/pci.h> +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -354,16 +355,10 @@ int cci_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *pcidevid)pci_set_master (pcidev); -if (!pci_set_dma_mask (pcidev,DMA_BIT_MASK (64 ))) { - ret =pci_set_consistent_dma_mask (pcidev,DMA_BIT_MASK (64 )); -if (ret) - goto disable_error_report_exit; - }else if (!pci_set_dma_mask (pcidev,DMA_BIT_MASK (32 ))) { - ret =pci_set_consistent_dma_mask (pcidev,DMA_BIT_MASK (32 )); -if (ret) - goto disable_error_report_exit; - }else { - ret = -EIO ; + ret =dma_set_mask_and_coherent (&pcidev->dev,DMA_BIT_MASK (64 )); +if (ret) + ret =dma_set_mask_and_coherent (&pcidev->dev,DMA_BIT_MASK (32 )); +if (ret) {dev_err (&pcidev->dev,"No suitable DMA support available.\n" ); goto disable_error_report_exit; }
drivers/media/pci/cx18/cx18-queue.h +2 -2
@@ -15,14 +15,14 @@static inline void cx18_buf_sync_for_cpu (struct cx18_stream *s,struct cx18_buffer *buf) { -pci_dma_sync_single_for_cpu (s->cx->pci_dev, buf->dma_handle, +dma_sync_single_for_cpu (&s->cx->pci_dev->dev, buf->dma_handle, s->buf_size, s->dma); }static inline void cx18_buf_sync_for_device (struct cx18_stream *s,struct cx18_buffer *buf) { -pci_dma_sync_single_for_device (s->cx->pci_dev, buf->dma_handle, +dma_sync_single_for_device (&s->cx->pci_dev->dev, buf->dma_handle, s->buf_size, s->dma); }
drivers/media/pci/ivtv/ivtv-queue.h +11 -11
@@ -17,20 +17,20 @@static inline int ivtv_might_use_pio (struct ivtv_stream *s) { -return s->dma ==PCI_DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI ); +return s->dma ==DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI ); }static inline int ivtv_use_pio (struct ivtv_stream *s) {struct ivtv *itv = s->itv; -return s->dma ==PCI_DMA_NONE || +return s->dma ==DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI && itv->vbi.sliced_in->service_set); }static inline int ivtv_might_use_dma (struct ivtv_stream *s) { -return s->dma !=PCI_DMA_NONE ; +return s->dma !=DMA_NONE ; }static inline int ivtv_use_dma (struct ivtv_stream *s)
@@ -41,15 +41,15 @@ static inline int ivtv_use_dma(struct ivtv_stream *s)static inline void ivtv_buf_sync_for_cpu (struct ivtv_stream *s,struct ivtv_buffer *buf) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_cpu (s->itv->pdev, buf->dma_handle, - s->buf_size +256 , s->dma); +dma_sync_single_for_cpu (&s->itv->pdev->dev, buf->dma_handle, + s->buf_size +256 , (enum dma_data_direction )s->dma); }static inline void ivtv_buf_sync_for_device (struct ivtv_stream *s,struct ivtv_buffer *buf) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_device (s->itv->pdev, buf->dma_handle, - s->buf_size +256 , s->dma); +dma_sync_single_for_device (&s->itv->pdev->dev, buf->dma_handle, + s->buf_size +256 , (enum dma_data_direction )s->dma); }int ivtv_buf_copy_from_user (struct ivtv_stream *s,struct ivtv_buffer *buf,const char __user *src,int copybytes);
@@ -70,15 +70,15 @@ void ivtv_stream_free(struct ivtv_stream *s);static inline void ivtv_stream_sync_for_cpu (struct ivtv_stream *s) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_cpu (s->itv->pdev, s->sg_handle, -sizeof (struct ivtv_sg_element ),PCI_DMA_TODEVICE ); +dma_sync_single_for_cpu (&s->itv->pdev->dev, s->sg_handle, +sizeof (struct ivtv_sg_element ),DMA_TO_DEVICE ); }static inline void ivtv_stream_sync_for_device (struct ivtv_stream *s) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_device (s->itv->pdev, s->sg_handle, -sizeof (struct ivtv_sg_element ),PCI_DMA_TODEVICE ); +dma_sync_single_for_device (&s->itv->pdev->dev, s->sg_handle, +sizeof (struct ivtv_sg_element ),DMA_TO_DEVICE ); }#endif
drivers/media/pci/ivtv/ivtv-udma.h +4 -4
@@ -23,14 +23,14 @@ void ivtv_udma_start(struct ivtv *itv);static inline void ivtv_udma_sync_for_device (struct ivtv *itv) { -pci_dma_sync_single_for_device (itv->pdev, itv->udma.SG_handle, -sizeof (itv->udma.SGarray),PCI_DMA_TODEVICE ); +dma_sync_single_for_device (&itv->pdev->dev, itv->udma.SG_handle, +sizeof (itv->udma.SGarray),DMA_TO_DEVICE ); }static inline void ivtv_udma_sync_for_cpu (struct ivtv *itv) { -pci_dma_sync_single_for_cpu (itv->pdev, itv->udma.SG_handle, -sizeof (itv->udma.SGarray),PCI_DMA_TODEVICE ); +dma_sync_single_for_cpu (&itv->pdev->dev, itv->udma.SG_handle, +sizeof (itv->udma.SGarray),DMA_TO_DEVICE ); }#endif
drivers/pci/probe.c +1 -0
@@ -3,6 +3,7 @@* PCI detection and setup code */ +#include <linux/dma-mapping.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/init.h>
drivers/video/fbdev/hyperv_fb.c +1 -0
@@ -45,6 +45,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/vmalloc.h>
drivers/video/fbdev/via/via-core.c +1 -0
@@ -8,6 +8,7 @@/* * Core code for the Via multifunction framebuffer device. */ +#include <linux/dma-mapping.h> #include <linux/via-core.h> #include <linux/via_i2c.h> #include <linux/via-gpio.h>
drivers/virtio/virtio_pci_legacy_dev.c +1 -0
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/dma-mapping.h> #include "linux/virtio_pci.h" #include <linux/virtio_pci_legacy.h> #include <linux/module.h>
drivers/virtio/virtio_pci_modern_dev.c +1 -0
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/dma-mapping.h> #include <linux/virtio_pci_modern.h> #include <linux/module.h> #include <linux/pci.h>
sound/pci/ctxfi/cthw20k1.c +1 -0
@@ -11,6 +11,7 @@* @Date Jun 24 2008 */ +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/pci.h>
sound/pci/ctxfi/cthw20k2.c +1 -0
@@ -11,6 +11,7 @@* @Date May 14 2008 */ +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/pci.h>
sound/pci/lx6464es/lx6464es.c +1 -0
@@ -6,6 +6,7 @@* Copyright (c) 2008, 2009 Tim Blechmann <[email protected]> */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h>
Signature · 1 line
2.25.1
This isnt the 7th patch of anything!!!!!!!!! Im such a mess!
Quoted 387 lines · Yusuf Khan
Im sorry to the kernel maintainers. TLDR; this patch came to early and I didnt expect to be working on the kernel at 1 am.
https://lkml.org/lkml/2022/2/23/11 deals with much of the reasons of this commit and part of what should have been included here but is now included here(ie. this should have been 2 parts). If you have the time I plead that you commit that, this and another commit removing
pci-dma-compat.h, removing the refrence atpci.hand replace it with a include to <linux/dma-mapping.h>. If you dont have the time to do this then I will do it during the next -rc but make sure it compiles finishes just in case(ive compiled the kernel 3 times to be sure but you never know). If there are any problems with this patch, tell me and ill send a follow up that will fix the issues.Signed-off-by Yusuf Khan <[email protected]>--- drivers/char/agp/intel-gtt.c | 23 ++++++++++++----------- drivers/dma/dw/pci.c | 1 + drivers/dma/idxd/device.c | 1 + drivers/dma/ptdma/ptdma-dmaengine.c | 1 + drivers/fpga/dfl-pci.c | 15 +++++---------- drivers/media/pci/cx18/cx18-queue.h | 4 ++-- drivers/media/pci/ivtv/ivtv-queue.h | 22 +++++++++++----------- drivers/media/pci/ivtv/ivtv-udma.h | 8 ++++---- drivers/pci/probe.c | 1 + drivers/video/fbdev/hyperv_fb.c | 1 + drivers/video/fbdev/via/via-core.c | 1 + drivers/virtio/virtio_pci_legacy_dev.c | 1 + drivers/virtio/virtio_pci_modern_dev.c | 1 + sound/pci/ctxfi/cthw20k1.c | 1 + sound/pci/ctxfi/cthw20k2.c | 1 + sound/pci/lx6464es/lx6464es.c | 1 + 16 files changed, 45 insertions(+), 38 deletions(-)drivers/char/agp/intel-gtt.c +12
-11@@ -15,6 +15,7 @@* /fairy-tale-mode off */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h> @@ -111,8 +112,8 @@ static int intel_gtt_map_memory(struct page **pages,for_each_sg (st->sgl, sg, num_entries, i)sg_set_page (sg, pages[i],PAGE_SIZE ,0 ); -if (!pci_map_sg (intel_private.pcidev, - st->sgl, st->nents,PCI_DMA_BIDIRECTIONAL )) +if (!dma_map_sg (&intel_private.pcidev->dev, + st->sgl, st->nents,DMA_BIDIRECTIONAL )) goto err;return 0 ;@@ -127,8 +128,8 @@ static void intel_gtt_unmap_memory(struct scatterlist *sg_list, int num_sg)struct sg_table st;DBG ("try unmapping %lu pages\n" , (unsigned long )mem->page_count); -pci_unmap_sg (intel_private.pcidev, sg_list, - num_sg,PCI_DMA_BIDIRECTIONAL ); +dma_unmap_sg (&intel_private.pcidev->dev, sg_list, + num_sg,DMA_BIDIRECTIONAL ); st.sgl = sg_list; st.orig_nents = st.nents = num_sg;@@ -303,9 +304,9 @@ static int intel_gtt_setup_scratch_page(void)set_pages_uc (page,1 );if (intel_private.needs_dmar) { - dma_addr =pci_map_page (intel_private.pcidev, page,0 , -PAGE_SIZE ,PCI_DMA_BIDIRECTIONAL ); -if (pci_dma_mapping_error (intel_private.pcidev, dma_addr)) { + dma_addr =dma_map_page (&intel_private.pcidev->dev, page,0 , +PAGE_SIZE ,DMA_BIDIRECTIONAL ); +if (dma_mapping_error (&intel_private.pcidev->dev, dma_addr)) {__free_page (page);return -EINVAL ; }@@ -552,9 +553,9 @@ static void intel_gtt_teardown_scratch_page(void) {set_pages_wb (intel_private.scratch_page,1 );if (intel_private.needs_dmar) -pci_unmap_page (intel_private.pcidev, +dma_unmap_page (&intel_private.pcidev->dev, intel_private.scratch_page_dma, -PAGE_SIZE ,PCI_DMA_BIDIRECTIONAL ); +PAGE_SIZE ,DMA_BIDIRECTIONAL );__free_page (intel_private.scratch_page); }@@ -1412,12 +1413,12 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev,if (bridge) { mask = intel_private.driver->dma_mask_size; -if (pci_set_dma_mask (intel_private.pcidev,DMA_BIT_MASK (mask))) +if (dma_set_mask (&intel_private.pcidev->dev,DMA_BIT_MASK (mask)))dev_err (&intel_private.pcidev->dev,"set gfx device dma mask %d-bit failed!\n" , mask);else -pci_set_consistent_dma_mask (intel_private.pcidev, +dma_set_coherent_mask (&intel_private.pcidev->dev,DMA_BIT_MASK (mask)); }drivers/dma/dw/pci.c +1
-0@@ -6,6 +6,7 @@* Author: Andy Shevchenko <[email protected]> */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/device.h> drivers/dma/idxd/device.c +1
-0@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2019 Intel Corporation. All rights rsvd. */ +#include <linux/dma-mapping.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> drivers/dma/ptdma/ptdma-dmaengine.c +1
-0@@ -9,6 +9,7 @@* Author: Gary R Hook <[email protected]> */ +#include <linux/dma-mapping.h> #include "ptdma.h" #include "../dmaengine.h" #include "../virt-dma.h" drivers/fpga/dfl-pci.c +5
-10@@ -15,6 +15,7 @@*/ #include <linux/pci.h> +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/module.h> @@ -354,16 +355,10 @@ int cci_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *pcidevid)pci_set_master (pcidev); -if (!pci_set_dma_mask (pcidev,DMA_BIT_MASK (64 ))) { - ret =pci_set_consistent_dma_mask (pcidev,DMA_BIT_MASK (64 )); -if (ret) - goto disable_error_report_exit; - }else if (!pci_set_dma_mask (pcidev,DMA_BIT_MASK (32 ))) { - ret =pci_set_consistent_dma_mask (pcidev,DMA_BIT_MASK (32 )); -if (ret) - goto disable_error_report_exit; - }else { - ret = -EIO ; + ret =dma_set_mask_and_coherent (&pcidev->dev,DMA_BIT_MASK (64 )); +if (ret) + ret =dma_set_mask_and_coherent (&pcidev->dev,DMA_BIT_MASK (32 )); +if (ret) {dev_err (&pcidev->dev,"No suitable DMA support available.\n" ); goto disable_error_report_exit; }drivers/media/pci/cx18/cx18-queue.h +2
-2@@ -15,14 +15,14 @@static inline void cx18_buf_sync_for_cpu (struct cx18_stream *s,struct cx18_buffer *buf) { -pci_dma_sync_single_for_cpu (s->cx->pci_dev, buf->dma_handle, +dma_sync_single_for_cpu (&s->cx->pci_dev->dev, buf->dma_handle, s->buf_size, s->dma); }static inline void cx18_buf_sync_for_device (struct cx18_stream *s,struct cx18_buffer *buf) { -pci_dma_sync_single_for_device (s->cx->pci_dev, buf->dma_handle, +dma_sync_single_for_device (&s->cx->pci_dev->dev, buf->dma_handle, s->buf_size, s->dma); }drivers/media/pci/ivtv/ivtv-queue.h +11
-11@@ -17,20 +17,20 @@static inline int ivtv_might_use_pio (struct ivtv_stream *s) { -return s->dma ==PCI_DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI ); +return s->dma ==DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI ); }static inline int ivtv_use_pio (struct ivtv_stream *s) {struct ivtv *itv = s->itv; -return s->dma ==PCI_DMA_NONE || +return s->dma ==DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI && itv->vbi.sliced_in->service_set); }static inline int ivtv_might_use_dma (struct ivtv_stream *s) { -return s->dma !=PCI_DMA_NONE ; +return s->dma !=DMA_NONE ; }static inline int ivtv_use_dma (struct ivtv_stream *s)@@ -41,15 +41,15 @@ static inline int ivtv_use_dma(struct ivtv_stream *s)static inline void ivtv_buf_sync_for_cpu (struct ivtv_stream *s,struct ivtv_buffer *buf) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_cpu (s->itv->pdev, buf->dma_handle, - s->buf_size +256 , s->dma); +dma_sync_single_for_cpu (&s->itv->pdev->dev, buf->dma_handle, + s->buf_size +256 , (enum dma_data_direction )s->dma); }static inline void ivtv_buf_sync_for_device (struct ivtv_stream *s,struct ivtv_buffer *buf) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_device (s->itv->pdev, buf->dma_handle, - s->buf_size +256 , s->dma); +dma_sync_single_for_device (&s->itv->pdev->dev, buf->dma_handle, + s->buf_size +256 , (enum dma_data_direction )s->dma); }int ivtv_buf_copy_from_user (struct ivtv_stream *s,struct ivtv_buffer *buf,const char __user *src,int copybytes);@@ -70,15 +70,15 @@ void ivtv_stream_free(struct ivtv_stream *s);static inline void ivtv_stream_sync_for_cpu (struct ivtv_stream *s) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_cpu (s->itv->pdev, s->sg_handle, -sizeof (struct ivtv_sg_element ),PCI_DMA_TODEVICE ); +dma_sync_single_for_cpu (&s->itv->pdev->dev, s->sg_handle, +sizeof (struct ivtv_sg_element ),DMA_TO_DEVICE ); }static inline void ivtv_stream_sync_for_device (struct ivtv_stream *s) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_device (s->itv->pdev, s->sg_handle, -sizeof (struct ivtv_sg_element ),PCI_DMA_TODEVICE ); +dma_sync_single_for_device (&s->itv->pdev->dev, s->sg_handle, +sizeof (struct ivtv_sg_element ),DMA_TO_DEVICE ); }#endif drivers/media/pci/ivtv/ivtv-udma.h +4
-4@@ -23,14 +23,14 @@ void ivtv_udma_start(struct ivtv *itv);static inline void ivtv_udma_sync_for_device (struct ivtv *itv) { -pci_dma_sync_single_for_device (itv->pdev, itv->udma.SG_handle, -sizeof (itv->udma.SGarray),PCI_DMA_TODEVICE ); +dma_sync_single_for_device (&itv->pdev->dev, itv->udma.SG_handle, +sizeof (itv->udma.SGarray),DMA_TO_DEVICE ); }static inline void ivtv_udma_sync_for_cpu (struct ivtv *itv) { -pci_dma_sync_single_for_cpu (itv->pdev, itv->udma.SG_handle, -sizeof (itv->udma.SGarray),PCI_DMA_TODEVICE ); +dma_sync_single_for_cpu (&itv->pdev->dev, itv->udma.SG_handle, +sizeof (itv->udma.SGarray),DMA_TO_DEVICE ); }#endif drivers/pci/probe.c +1
-0@@ -3,6 +3,7 @@* PCI detection and setup code */ +#include <linux/dma-mapping.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/init.h> drivers/video/fbdev/hyperv_fb.c +1
-0@@ -45,6 +45,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/vmalloc.h> drivers/video/fbdev/via/via-core.c +1
-0@@ -8,6 +8,7 @@/* * Core code for the Via multifunction framebuffer device. */ +#include <linux/dma-mapping.h> #include <linux/via-core.h> #include <linux/via_i2c.h> #include <linux/via-gpio.h> drivers/virtio/virtio_pci_legacy_dev.c +1
-0@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/dma-mapping.h> #include "linux/virtio_pci.h" #include <linux/virtio_pci_legacy.h> #include <linux/module.h> drivers/virtio/virtio_pci_modern_dev.c +1
-0@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/dma-mapping.h> #include <linux/virtio_pci_modern.h> #include <linux/module.h> #include <linux/pci.h> sound/pci/ctxfi/cthw20k1.c +1
-0@@ -11,6 +11,7 @@* @Date Jun 24 2008 */ +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/pci.h> sound/pci/ctxfi/cthw20k2.c +1
-0@@ -11,6 +11,7 @@* @Date May 14 2008 */ +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/pci.h> sound/pci/lx6464es/lx6464es.c +1
-1@@ -6,6 +6,7 @@* Copyright (c) 2008, 2009 Tim Blechmann <[email protected]> */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> --2.25.1
This isnt the 7th patch of anything!!!!!!!!! Im such a mess!
Quoted 387 lines · Yusuf Khan
Im sorry to the kernel maintainers. TLDR; this patch came to early and I didnt expect to be working on the kernel at 1 am.
https://lkml.org/lkml/2022/2/23/11 deals with much of the reasons of this commit and part of what should have been included here but is now included here(ie. this should have been 2 parts). If you have the time I plead that you commit that, this and another commit removing
pci-dma-compat.h, removing the refrence atpci.hand replace it with a include to <linux/dma-mapping.h>. If you dont have the time to do this then I will do it during the next -rc but make sure it compiles finishes just in case(ive compiled the kernel 3 times to be sure but you never know). If there are any problems with this patch, tell me and ill send a follow up that will fix the issues.Signed-off-by Yusuf Khan <[email protected]>--- drivers/char/agp/intel-gtt.c | 23 ++++++++++++----------- drivers/dma/dw/pci.c | 1 + drivers/dma/idxd/device.c | 1 + drivers/dma/ptdma/ptdma-dmaengine.c | 1 + drivers/fpga/dfl-pci.c | 15 +++++---------- drivers/media/pci/cx18/cx18-queue.h | 4 ++-- drivers/media/pci/ivtv/ivtv-queue.h | 22 +++++++++++----------- drivers/media/pci/ivtv/ivtv-udma.h | 8 ++++---- drivers/pci/probe.c | 1 + drivers/video/fbdev/hyperv_fb.c | 1 + drivers/video/fbdev/via/via-core.c | 1 + drivers/virtio/virtio_pci_legacy_dev.c | 1 + drivers/virtio/virtio_pci_modern_dev.c | 1 + sound/pci/ctxfi/cthw20k1.c | 1 + sound/pci/ctxfi/cthw20k2.c | 1 + sound/pci/lx6464es/lx6464es.c | 1 + 16 files changed, 45 insertions(+), 38 deletions(-)drivers/char/agp/intel-gtt.c +12
-11@@ -15,6 +15,7 @@* /fairy-tale-mode off */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h> @@ -111,8 +112,8 @@ static int intel_gtt_map_memory(struct page **pages,for_each_sg (st->sgl, sg, num_entries, i)sg_set_page (sg, pages[i],PAGE_SIZE ,0 ); -if (!pci_map_sg (intel_private.pcidev, - st->sgl, st->nents,PCI_DMA_BIDIRECTIONAL )) +if (!dma_map_sg (&intel_private.pcidev->dev, + st->sgl, st->nents,DMA_BIDIRECTIONAL )) goto err;return 0 ;@@ -127,8 +128,8 @@ static void intel_gtt_unmap_memory(struct scatterlist *sg_list, int num_sg)struct sg_table st;DBG ("try unmapping %lu pages\n" , (unsigned long )mem->page_count); -pci_unmap_sg (intel_private.pcidev, sg_list, - num_sg,PCI_DMA_BIDIRECTIONAL ); +dma_unmap_sg (&intel_private.pcidev->dev, sg_list, + num_sg,DMA_BIDIRECTIONAL ); st.sgl = sg_list; st.orig_nents = st.nents = num_sg;@@ -303,9 +304,9 @@ static int intel_gtt_setup_scratch_page(void)set_pages_uc (page,1 );if (intel_private.needs_dmar) { - dma_addr =pci_map_page (intel_private.pcidev, page,0 , -PAGE_SIZE ,PCI_DMA_BIDIRECTIONAL ); -if (pci_dma_mapping_error (intel_private.pcidev, dma_addr)) { + dma_addr =dma_map_page (&intel_private.pcidev->dev, page,0 , +PAGE_SIZE ,DMA_BIDIRECTIONAL ); +if (dma_mapping_error (&intel_private.pcidev->dev, dma_addr)) {__free_page (page);return -EINVAL ; }@@ -552,9 +553,9 @@ static void intel_gtt_teardown_scratch_page(void) {set_pages_wb (intel_private.scratch_page,1 );if (intel_private.needs_dmar) -pci_unmap_page (intel_private.pcidev, +dma_unmap_page (&intel_private.pcidev->dev, intel_private.scratch_page_dma, -PAGE_SIZE ,PCI_DMA_BIDIRECTIONAL ); +PAGE_SIZE ,DMA_BIDIRECTIONAL );__free_page (intel_private.scratch_page); }@@ -1412,12 +1413,12 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev,if (bridge) { mask = intel_private.driver->dma_mask_size; -if (pci_set_dma_mask (intel_private.pcidev,DMA_BIT_MASK (mask))) +if (dma_set_mask (&intel_private.pcidev->dev,DMA_BIT_MASK (mask)))dev_err (&intel_private.pcidev->dev,"set gfx device dma mask %d-bit failed!\n" , mask);else -pci_set_consistent_dma_mask (intel_private.pcidev, +dma_set_coherent_mask (&intel_private.pcidev->dev,DMA_BIT_MASK (mask)); }drivers/dma/dw/pci.c +1
-0@@ -6,6 +6,7 @@* Author: Andy Shevchenko <[email protected]> */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/device.h> drivers/dma/idxd/device.c +1
-0@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2019 Intel Corporation. All rights rsvd. */ +#include <linux/dma-mapping.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> drivers/dma/ptdma/ptdma-dmaengine.c +1
-0@@ -9,6 +9,7 @@* Author: Gary R Hook <[email protected]> */ +#include <linux/dma-mapping.h> #include "ptdma.h" #include "../dmaengine.h" #include "../virt-dma.h" drivers/fpga/dfl-pci.c +5
-10@@ -15,6 +15,7 @@*/ #include <linux/pci.h> +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/module.h> @@ -354,16 +355,10 @@ int cci_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *pcidevid)pci_set_master (pcidev); -if (!pci_set_dma_mask (pcidev,DMA_BIT_MASK (64 ))) { - ret =pci_set_consistent_dma_mask (pcidev,DMA_BIT_MASK (64 )); -if (ret) - goto disable_error_report_exit; - }else if (!pci_set_dma_mask (pcidev,DMA_BIT_MASK (32 ))) { - ret =pci_set_consistent_dma_mask (pcidev,DMA_BIT_MASK (32 )); -if (ret) - goto disable_error_report_exit; - }else { - ret = -EIO ; + ret =dma_set_mask_and_coherent (&pcidev->dev,DMA_BIT_MASK (64 )); +if (ret) + ret =dma_set_mask_and_coherent (&pcidev->dev,DMA_BIT_MASK (32 )); +if (ret) {dev_err (&pcidev->dev,"No suitable DMA support available.\n" ); goto disable_error_report_exit; }drivers/media/pci/cx18/cx18-queue.h +2
-2@@ -15,14 +15,14 @@static inline void cx18_buf_sync_for_cpu (struct cx18_stream *s,struct cx18_buffer *buf) { -pci_dma_sync_single_for_cpu (s->cx->pci_dev, buf->dma_handle, +dma_sync_single_for_cpu (&s->cx->pci_dev->dev, buf->dma_handle, s->buf_size, s->dma); }static inline void cx18_buf_sync_for_device (struct cx18_stream *s,struct cx18_buffer *buf) { -pci_dma_sync_single_for_device (s->cx->pci_dev, buf->dma_handle, +dma_sync_single_for_device (&s->cx->pci_dev->dev, buf->dma_handle, s->buf_size, s->dma); }drivers/media/pci/ivtv/ivtv-queue.h +11
-11@@ -17,20 +17,20 @@static inline int ivtv_might_use_pio (struct ivtv_stream *s) { -return s->dma ==PCI_DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI ); +return s->dma ==DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI ); }static inline int ivtv_use_pio (struct ivtv_stream *s) {struct ivtv *itv = s->itv; -return s->dma ==PCI_DMA_NONE || +return s->dma ==DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI && itv->vbi.sliced_in->service_set); }static inline int ivtv_might_use_dma (struct ivtv_stream *s) { -return s->dma !=PCI_DMA_NONE ; +return s->dma !=DMA_NONE ; }static inline int ivtv_use_dma (struct ivtv_stream *s)@@ -41,15 +41,15 @@ static inline int ivtv_use_dma(struct ivtv_stream *s)static inline void ivtv_buf_sync_for_cpu (struct ivtv_stream *s,struct ivtv_buffer *buf) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_cpu (s->itv->pdev, buf->dma_handle, - s->buf_size +256 , s->dma); +dma_sync_single_for_cpu (&s->itv->pdev->dev, buf->dma_handle, + s->buf_size +256 , (enum dma_data_direction )s->dma); }static inline void ivtv_buf_sync_for_device (struct ivtv_stream *s,struct ivtv_buffer *buf) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_device (s->itv->pdev, buf->dma_handle, - s->buf_size +256 , s->dma); +dma_sync_single_for_device (&s->itv->pdev->dev, buf->dma_handle, + s->buf_size +256 , (enum dma_data_direction )s->dma); }int ivtv_buf_copy_from_user (struct ivtv_stream *s,struct ivtv_buffer *buf,const char __user *src,int copybytes);@@ -70,15 +70,15 @@ void ivtv_stream_free(struct ivtv_stream *s);static inline void ivtv_stream_sync_for_cpu (struct ivtv_stream *s) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_cpu (s->itv->pdev, s->sg_handle, -sizeof (struct ivtv_sg_element ),PCI_DMA_TODEVICE ); +dma_sync_single_for_cpu (&s->itv->pdev->dev, s->sg_handle, +sizeof (struct ivtv_sg_element ),DMA_TO_DEVICE ); }static inline void ivtv_stream_sync_for_device (struct ivtv_stream *s) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_device (s->itv->pdev, s->sg_handle, -sizeof (struct ivtv_sg_element ),PCI_DMA_TODEVICE ); +dma_sync_single_for_device (&s->itv->pdev->dev, s->sg_handle, +sizeof (struct ivtv_sg_element ),DMA_TO_DEVICE ); }#endif drivers/media/pci/ivtv/ivtv-udma.h +4
-4@@ -23,14 +23,14 @@ void ivtv_udma_start(struct ivtv *itv);static inline void ivtv_udma_sync_for_device (struct ivtv *itv) { -pci_dma_sync_single_for_device (itv->pdev, itv->udma.SG_handle, -sizeof (itv->udma.SGarray),PCI_DMA_TODEVICE ); +dma_sync_single_for_device (&itv->pdev->dev, itv->udma.SG_handle, +sizeof (itv->udma.SGarray),DMA_TO_DEVICE ); }static inline void ivtv_udma_sync_for_cpu (struct ivtv *itv) { -pci_dma_sync_single_for_cpu (itv->pdev, itv->udma.SG_handle, -sizeof (itv->udma.SGarray),PCI_DMA_TODEVICE ); +dma_sync_single_for_cpu (&itv->pdev->dev, itv->udma.SG_handle, +sizeof (itv->udma.SGarray),DMA_TO_DEVICE ); }#endif drivers/pci/probe.c +1
-0@@ -3,6 +3,7 @@* PCI detection and setup code */ +#include <linux/dma-mapping.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/init.h> drivers/video/fbdev/hyperv_fb.c +1
-0@@ -45,6 +45,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/vmalloc.h> drivers/video/fbdev/via/via-core.c +1
-0@@ -8,6 +8,7 @@/* * Core code for the Via multifunction framebuffer device. */ +#include <linux/dma-mapping.h> #include <linux/via-core.h> #include <linux/via_i2c.h> #include <linux/via-gpio.h> drivers/virtio/virtio_pci_legacy_dev.c +1
-0@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/dma-mapping.h> #include "linux/virtio_pci.h" #include <linux/virtio_pci_legacy.h> #include <linux/module.h> drivers/virtio/virtio_pci_modern_dev.c +1
-0@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/dma-mapping.h> #include <linux/virtio_pci_modern.h> #include <linux/module.h> #include <linux/pci.h> sound/pci/ctxfi/cthw20k1.c +1
-0@@ -11,6 +11,7 @@* @Date Jun 24 2008 */ +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/pci.h> sound/pci/ctxfi/cthw20k2.c +1
-0@@ -11,6 +11,7 @@* @Date May 14 2008 */ +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/pci.h> sound/pci/lx6464es/lx6464es.c +1
-1@@ -6,6 +6,7 @@* Copyright (c) 2008, 2009 Tim Blechmann <[email protected]> */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> --2.25.1
Wowza! The 2 patches both rely on
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/patch/?id=ada3caabaf6135150077c3f729bb06e8f3b5b8f6.
The linux-next branch compiles with errors currently.
Quoted 391 lines · Yusuf Khan
This isnt the 7th patch of anything!!!!!!!!! Im such a mess!
Quoted 387 lines · Yusuf Khan
Im sorry to the kernel maintainers. TLDR; this patch came to early and I didnt expect to be working on the kernel at 1 am.
https://lkml.org/lkml/2022/2/23/11 deals with much of the reasons of this commit and part of what should have been included here but is now included here(ie. this should have been 2 parts). If you have the time I plead that you commit that, this and another commit removing
pci-dma-compat.h, removing the refrence atpci.hand replace it with a include to <linux/dma-mapping.h>. If you dont have the time to do this then I will do it during the next -rc but make sure it compiles finishes just in case(ive compiled the kernel 3 times to be sure but you never know). If there are any problems with this patch, tell me and ill send a follow up that will fix the issues.Signed-off-by Yusuf Khan <[email protected]>--- drivers/char/agp/intel-gtt.c | 23 ++++++++++++----------- drivers/dma/dw/pci.c | 1 + drivers/dma/idxd/device.c | 1 + drivers/dma/ptdma/ptdma-dmaengine.c | 1 + drivers/fpga/dfl-pci.c | 15 +++++---------- drivers/media/pci/cx18/cx18-queue.h | 4 ++-- drivers/media/pci/ivtv/ivtv-queue.h | 22 +++++++++++----------- drivers/media/pci/ivtv/ivtv-udma.h | 8 ++++---- drivers/pci/probe.c | 1 + drivers/video/fbdev/hyperv_fb.c | 1 + drivers/video/fbdev/via/via-core.c | 1 + drivers/virtio/virtio_pci_legacy_dev.c | 1 + drivers/virtio/virtio_pci_modern_dev.c | 1 + sound/pci/ctxfi/cthw20k1.c | 1 + sound/pci/ctxfi/cthw20k2.c | 1 + sound/pci/lx6464es/lx6464es.c | 1 + 16 files changed, 45 insertions(+), 38 deletions(-)drivers/char/agp/intel-gtt.c +12
-11@@ -15,6 +15,7 @@* /fairy-tale-mode off */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h> @@ -111,8 +112,8 @@ static int intel_gtt_map_memory(struct page **pages,for_each_sg (st->sgl, sg, num_entries, i)sg_set_page (sg, pages[i],PAGE_SIZE ,0 ); -if (!pci_map_sg (intel_private.pcidev, - st->sgl, st->nents,PCI_DMA_BIDIRECTIONAL )) +if (!dma_map_sg (&intel_private.pcidev->dev, + st->sgl, st->nents,DMA_BIDIRECTIONAL )) goto err;return 0 ;@@ -127,8 +128,8 @@ static void intel_gtt_unmap_memory(struct scatterlist *sg_list, int num_sg)struct sg_table st;DBG ("try unmapping %lu pages\n" , (unsigned long )mem->page_count); -pci_unmap_sg (intel_private.pcidev, sg_list, - num_sg,PCI_DMA_BIDIRECTIONAL ); +dma_unmap_sg (&intel_private.pcidev->dev, sg_list, + num_sg,DMA_BIDIRECTIONAL ); st.sgl = sg_list; st.orig_nents = st.nents = num_sg;@@ -303,9 +304,9 @@ static int intel_gtt_setup_scratch_page(void)set_pages_uc (page,1 );if (intel_private.needs_dmar) { - dma_addr =pci_map_page (intel_private.pcidev, page,0 , -PAGE_SIZE ,PCI_DMA_BIDIRECTIONAL ); -if (pci_dma_mapping_error (intel_private.pcidev, dma_addr)) { + dma_addr =dma_map_page (&intel_private.pcidev->dev, page,0 , +PAGE_SIZE ,DMA_BIDIRECTIONAL ); +if (dma_mapping_error (&intel_private.pcidev->dev, dma_addr)) {__free_page (page);return -EINVAL ; }@@ -552,9 +553,9 @@ static void intel_gtt_teardown_scratch_page(void) {set_pages_wb (intel_private.scratch_page,1 );if (intel_private.needs_dmar) -pci_unmap_page (intel_private.pcidev, +dma_unmap_page (&intel_private.pcidev->dev, intel_private.scratch_page_dma, -PAGE_SIZE ,PCI_DMA_BIDIRECTIONAL ); +PAGE_SIZE ,DMA_BIDIRECTIONAL );__free_page (intel_private.scratch_page); }@@ -1412,12 +1413,12 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev,if (bridge) { mask = intel_private.driver->dma_mask_size; -if (pci_set_dma_mask (intel_private.pcidev,DMA_BIT_MASK (mask))) +if (dma_set_mask (&intel_private.pcidev->dev,DMA_BIT_MASK (mask)))dev_err (&intel_private.pcidev->dev,"set gfx device dma mask %d-bit failed!\n" , mask);else -pci_set_consistent_dma_mask (intel_private.pcidev, +dma_set_coherent_mask (&intel_private.pcidev->dev,DMA_BIT_MASK (mask)); }drivers/dma/dw/pci.c +1
-0@@ -6,6 +6,7 @@* Author: Andy Shevchenko <[email protected]> */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/device.h> drivers/dma/idxd/device.c +1
-0@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2019 Intel Corporation. All rights rsvd. */ +#include <linux/dma-mapping.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> drivers/dma/ptdma/ptdma-dmaengine.c +1
-0@@ -9,6 +9,7 @@* Author: Gary R Hook <[email protected]> */ +#include <linux/dma-mapping.h> #include "ptdma.h" #include "../dmaengine.h" #include "../virt-dma.h" drivers/fpga/dfl-pci.c +5
-10@@ -15,6 +15,7 @@*/ #include <linux/pci.h> +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/module.h> @@ -354,16 +355,10 @@ int cci_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *pcidevid)pci_set_master (pcidev); -if (!pci_set_dma_mask (pcidev,DMA_BIT_MASK (64 ))) { - ret =pci_set_consistent_dma_mask (pcidev,DMA_BIT_MASK (64 )); -if (ret) - goto disable_error_report_exit; - }else if (!pci_set_dma_mask (pcidev,DMA_BIT_MASK (32 ))) { - ret =pci_set_consistent_dma_mask (pcidev,DMA_BIT_MASK (32 )); -if (ret) - goto disable_error_report_exit; - }else { - ret = -EIO ; + ret =dma_set_mask_and_coherent (&pcidev->dev,DMA_BIT_MASK (64 )); +if (ret) + ret =dma_set_mask_and_coherent (&pcidev->dev,DMA_BIT_MASK (32 )); +if (ret) {dev_err (&pcidev->dev,"No suitable DMA support available.\n" ); goto disable_error_report_exit; }drivers/media/pci/cx18/cx18-queue.h +2
-2@@ -15,14 +15,14 @@static inline void cx18_buf_sync_for_cpu (struct cx18_stream *s,struct cx18_buffer *buf) { -pci_dma_sync_single_for_cpu (s->cx->pci_dev, buf->dma_handle, +dma_sync_single_for_cpu (&s->cx->pci_dev->dev, buf->dma_handle, s->buf_size, s->dma); }static inline void cx18_buf_sync_for_device (struct cx18_stream *s,struct cx18_buffer *buf) { -pci_dma_sync_single_for_device (s->cx->pci_dev, buf->dma_handle, +dma_sync_single_for_device (&s->cx->pci_dev->dev, buf->dma_handle, s->buf_size, s->dma); }drivers/media/pci/ivtv/ivtv-queue.h +11
-11@@ -17,20 +17,20 @@static inline int ivtv_might_use_pio (struct ivtv_stream *s) { -return s->dma ==PCI_DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI ); +return s->dma ==DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI ); }static inline int ivtv_use_pio (struct ivtv_stream *s) {struct ivtv *itv = s->itv; -return s->dma ==PCI_DMA_NONE || +return s->dma ==DMA_NONE || (SLICED_VBI_PIO && s->type ==IVTV_ENC_STREAM_TYPE_VBI && itv->vbi.sliced_in->service_set); }static inline int ivtv_might_use_dma (struct ivtv_stream *s) { -return s->dma !=PCI_DMA_NONE ; +return s->dma !=DMA_NONE ; }static inline int ivtv_use_dma (struct ivtv_stream *s)@@ -41,15 +41,15 @@ static inline int ivtv_use_dma(struct ivtv_stream *s)static inline void ivtv_buf_sync_for_cpu (struct ivtv_stream *s,struct ivtv_buffer *buf) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_cpu (s->itv->pdev, buf->dma_handle, - s->buf_size +256 , s->dma); +dma_sync_single_for_cpu (&s->itv->pdev->dev, buf->dma_handle, + s->buf_size +256 , (enum dma_data_direction )s->dma); }static inline void ivtv_buf_sync_for_device (struct ivtv_stream *s,struct ivtv_buffer *buf) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_device (s->itv->pdev, buf->dma_handle, - s->buf_size +256 , s->dma); +dma_sync_single_for_device (&s->itv->pdev->dev, buf->dma_handle, + s->buf_size +256 , (enum dma_data_direction )s->dma); }int ivtv_buf_copy_from_user (struct ivtv_stream *s,struct ivtv_buffer *buf,const char __user *src,int copybytes);@@ -70,15 +70,15 @@ void ivtv_stream_free(struct ivtv_stream *s);static inline void ivtv_stream_sync_for_cpu (struct ivtv_stream *s) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_cpu (s->itv->pdev, s->sg_handle, -sizeof (struct ivtv_sg_element ),PCI_DMA_TODEVICE ); +dma_sync_single_for_cpu (&s->itv->pdev->dev, s->sg_handle, +sizeof (struct ivtv_sg_element ),DMA_TO_DEVICE ); }static inline void ivtv_stream_sync_for_device (struct ivtv_stream *s) {if (ivtv_use_dma (s)) -pci_dma_sync_single_for_device (s->itv->pdev, s->sg_handle, -sizeof (struct ivtv_sg_element ),PCI_DMA_TODEVICE ); +dma_sync_single_for_device (&s->itv->pdev->dev, s->sg_handle, +sizeof (struct ivtv_sg_element ),DMA_TO_DEVICE ); }#endif drivers/media/pci/ivtv/ivtv-udma.h +4
-4@@ -23,14 +23,14 @@ void ivtv_udma_start(struct ivtv *itv);static inline void ivtv_udma_sync_for_device (struct ivtv *itv) { -pci_dma_sync_single_for_device (itv->pdev, itv->udma.SG_handle, -sizeof (itv->udma.SGarray),PCI_DMA_TODEVICE ); +dma_sync_single_for_device (&itv->pdev->dev, itv->udma.SG_handle, +sizeof (itv->udma.SGarray),DMA_TO_DEVICE ); }static inline void ivtv_udma_sync_for_cpu (struct ivtv *itv) { -pci_dma_sync_single_for_cpu (itv->pdev, itv->udma.SG_handle, -sizeof (itv->udma.SGarray),PCI_DMA_TODEVICE ); +dma_sync_single_for_cpu (&itv->pdev->dev, itv->udma.SG_handle, +sizeof (itv->udma.SGarray),DMA_TO_DEVICE ); }#endif drivers/pci/probe.c +1
-0@@ -3,6 +3,7 @@* PCI detection and setup code */ +#include <linux/dma-mapping.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/init.h> drivers/video/fbdev/hyperv_fb.c +1
-0@@ -45,6 +45,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/vmalloc.h> drivers/video/fbdev/via/via-core.c +1
-0@@ -8,6 +8,7 @@/* * Core code for the Via multifunction framebuffer device. */ +#include <linux/dma-mapping.h> #include <linux/via-core.h> #include <linux/via_i2c.h> #include <linux/via-gpio.h> drivers/virtio/virtio_pci_legacy_dev.c +1
-0@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/dma-mapping.h> #include "linux/virtio_pci.h" #include <linux/virtio_pci_legacy.h> #include <linux/module.h> drivers/virtio/virtio_pci_modern_dev.c +1
-0@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/dma-mapping.h> #include <linux/virtio_pci_modern.h> #include <linux/module.h> #include <linux/pci.h> sound/pci/ctxfi/cthw20k1.c +1
-0@@ -11,6 +11,7 @@* @Date Jun 24 2008 */ +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/pci.h> sound/pci/ctxfi/cthw20k2.c +1
-0@@ -11,6 +11,7 @@* @Date May 14 2008 */ +#include <linux/dma-mapping.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/pci.h> sound/pci/lx6464es/lx6464es.c +1
-1@@ -6,6 +6,7 @@* Copyright (c) 2008, 2009 Tim Blechmann <[email protected]> */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> --2.25.1