mbox series

[v2,0/3] Converting m68k WD33C93 drivers to DMA API

Message ID 20220630033302.3183-1-schmitzmic@gmail.com (mailing list archive)
Headers show
Series Converting m68k WD33C93 drivers to DMA API | expand

Message

Michael Schmitz June 30, 2022, 3:32 a.m. UTC
This series was precipitated by Arnd removing CONFIG_VIRT_TO_BUS. The
m68k WD33C93 still used virt_to_bus to convert virtual addresses to
physical addresses suitable for the DMA engines (note m68k does not
have an IOMMU and uses a direct mapping for DMA addresses). 

Arnd suggested to use dma_map_single() to set up dma mappings instead
of open-coding much the same in every driver dma_setup() function.

DMA setup on a3000 host adapters can be kept as-is (bounce
buffers are used only where the input buffer isn't cache line
aligned). Cache management is now taken care of by dma_map_single().
Note that I've restored bounce buffer allocation (dropped in v1) in
order to make minimal changes to the core logic.

On gvp11 and a2091 host adapters, only the lowest 16 MB of physical
memory can be directy addressed by DMA, and bounce buffers from that
space must be used (possibly allocated from chip RAM using the
custom allocator) if buffers are located in the higher memory regions.
No cache management is required for chip RAM bounce buffers.

The m68k VME mvme147 driver has no DMA addressing or alignment
restrictions and can be converted in the same way as the Amiga a3000
one, but will require conversion to a platform device driver first.

Only compile tested so far, and hardware testing might be hard to do.

Cheers,

   Michael

Comments

Martin K. Petersen July 7, 2022, 9:01 p.m. UTC | #1
Michael,

> This series was precipitated by Arnd removing CONFIG_VIRT_TO_BUS. The
> m68k WD33C93 still used virt_to_bus to convert virtual addresses to
> physical addresses suitable for the DMA engines (note m68k does not
> have an IOMMU and uses a direct mapping for DMA addresses). 

Applied to 5.20/scsi-staging, thanks!
Michael Schmitz July 8, 2022, 8:49 a.m. UTC | #2
Martin,

Am 08.07.2022 um 09:01 schrieb Martin K. Petersen:
>
> Michael,
>
>> This series was precipitated by Arnd removing CONFIG_VIRT_TO_BUS. The
>> m68k WD33C93 still used virt_to_bus to convert virtual addresses to
>> physical addresses suitable for the DMA engines (note m68k does not
>> have an IOMMU and uses a direct mapping for DMA addresses).
>
> Applied to 5.20/scsi-staging, thanks!

Thanks - I'll have the mvme147_scsi conversion out for review shortly.

Cheers,

	Michael
Martin K. Petersen July 14, 2022, 4:22 a.m. UTC | #3
On Thu, 30 Jun 2022 15:32:59 +1200, Michael Schmitz wrote:

> This series was precipitated by Arnd removing CONFIG_VIRT_TO_BUS. The
> m68k WD33C93 still used virt_to_bus to convert virtual addresses to
> physical addresses suitable for the DMA engines (note m68k does not
> have an IOMMU and uses a direct mapping for DMA addresses).
> 
> Arnd suggested to use dma_map_single() to set up dma mappings instead
> of open-coding much the same in every driver dma_setup() function.
> 
> [...]

Applied to 5.20/scsi-queue, thanks!

[1/3] scsi - a3000.c: convert m68k WD33C93 drivers to DMA API
      https://git.kernel.org/mkp/scsi/c/e214806d52b8
[2/3] scsi - a2091.c: convert m68k WD33C93 drivers to DMA API
      https://git.kernel.org/mkp/scsi/c/479accbbb839
[3/3] scsi - gvp11.c: convert m68k WD33C93 drivers to DMA API
      https://git.kernel.org/mkp/scsi/c/158da6bcae7a