Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-30 Thread Michael Schmitz
Hi Christoph, On 29/06/22 18:25, Christoph Hellwig wrote: On Wed, Jun 29, 2022 at 09:38:00AM +1200, Michael Schmitz wrote: That's one of the 'liberties' I alluded to. The reason I left these in is that I'm none too certain what device feature the DMA API uses to decide a device isn't

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-30 Thread Michael Schmitz
Hi Christoph, On 29/06/22 18:21, Christoph Hellwig wrote: On Wed, Jun 29, 2022 at 11:09:00AM +1200, Michael Schmitz wrote: And all SCSI buffers are allocated using kmalloc? No way at all for user space to pass unaligned data? Most that you will see actually comes from the page allocator. But

RE: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-30 Thread David Laight
From: Christophe Leroy > Sent: 30 June 2022 10:40 > > Le 30/06/2022 à 10:04, David Laight a écrit : > > From: Michael Schmitz > >> Sent: 29 June 2022 00:09 > >> > >> Hi Arnd, > >> > >> On 29/06/22 09:50, Arnd Bergmann wrote: > >>> On Tue, Jun 28, 2022 at 11:03 PM Michael Schmitz > >>> wrote: >

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-30 Thread Christophe Leroy
Le 30/06/2022 à 10:04, David Laight a écrit : > From: Michael Schmitz >> Sent: 29 June 2022 00:09 >> >> Hi Arnd, >> >> On 29/06/22 09:50, Arnd Bergmann wrote: >>> On Tue, Jun 28, 2022 at 11:03 PM Michael Schmitz >>> wrote: On 28/06/22 19:03, Geert Uytterhoeven wrote: >> The driver

RE: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-30 Thread David Laight
From: Michael Schmitz > Sent: 29 June 2022 00:09 > > Hi Arnd, > > On 29/06/22 09:50, Arnd Bergmann wrote: > > On Tue, Jun 28, 2022 at 11:03 PM Michael Schmitz > > wrote: > >> On 28/06/22 19:03, Geert Uytterhoeven wrote: > The driver allocates bounce buffers using kmalloc if it hits an >

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-29 Thread Christoph Hellwig
On Wed, Jun 29, 2022 at 09:38:00AM +1200, Michael Schmitz wrote: > That's one of the 'liberties' I alluded to. The reason I left these in is > that I'm none too certain what device feature the DMA API uses to decide a > device isn't cache-coherent. The DMA API does not look at device features at

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-29 Thread Christoph Hellwig
On Wed, Jun 29, 2022 at 11:09:00AM +1200, Michael Schmitz wrote: > And all SCSI buffers are allocated using kmalloc? No way at all for user > space to pass unaligned data? Most that you will see actually comes from the page allocator. But the block layer has a dma_alignment limit, and when

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Michael Schmitz
Hi Bart, On 29/06/22 12:01, Michael Schmitz wrote: An example of a user space application that passes an SG I/O data buffer to the kernel that is aligned to a four byte boundary but not to an eight byte boundary if the -s (scattered) command line option is used:

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Michael Schmitz
Hi Bart, On 29/06/22 11:50, Bart Van Assche wrote: On 6/28/22 16:09, Michael Schmitz wrote: On 29/06/22 09:50, Arnd Bergmann wrote: On Tue, Jun 28, 2022 at 11:03 PM Michael Schmitz wrote: On 28/06/22 19:03, Geert Uytterhoeven wrote: The driver allocates bounce buffers using kmalloc if it

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Bart Van Assche
On 6/28/22 16:09, Michael Schmitz wrote: On 29/06/22 09:50, Arnd Bergmann wrote: On Tue, Jun 28, 2022 at 11:03 PM Michael Schmitz wrote: On 28/06/22 19:03, Geert Uytterhoeven wrote: The driver allocates bounce buffers using kmalloc if it hits an unaligned data buffer - can such buffers still

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Michael Schmitz
Hi Arnd, On 29/06/22 09:55, Arnd Bergmann wrote: On Tue, Jun 28, 2022 at 11:38 PM Michael Schmitz wrote: On 28/06/22 19:08, Arnd Bergmann wrote: I see two other problems with your patch though: a) you still duplicate the cache handling: the cache_clear()/cache_push() is supposed to already

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Michael Schmitz
Hi Arnd, On 29/06/22 09:50, Arnd Bergmann wrote: On Tue, Jun 28, 2022 at 11:03 PM Michael Schmitz wrote: On 28/06/22 19:03, Geert Uytterhoeven wrote: The driver allocates bounce buffers using kmalloc if it hits an unaligned data buffer - can such buffers still even happen these days? No

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Arnd Bergmann
On Tue, Jun 28, 2022 at 11:38 PM Michael Schmitz wrote: > On 28/06/22 19:08, Arnd Bergmann wrote: > > I see two other problems with your patch though: > > > > a) you still duplicate the cache handling: the cache_clear()/cache_push() > > is supposed to already be done by dma_map_single() when the

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Arnd Bergmann
On Tue, Jun 28, 2022 at 11:03 PM Michael Schmitz wrote: > On 28/06/22 19:03, Geert Uytterhoeven wrote: > >> The driver allocates bounce buffers using kmalloc if it hits an > >> unaligned data buffer - can such buffers still even happen these days? > > No idea. > Hmmm - I think I'll stick a

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Michael Schmitz
Hi Arnd, On 28/06/22 19:08, Arnd Bergmann wrote: On Tue, Jun 28, 2022 at 5:25 AM Michael Schmitz wrote: Am 28.06.2022 um 09:12 schrieb Michael Schmitz: Leaving the bounce buffer handling in place, and taking a few other liberties - this is what converting the easiest case (a3000 SCSI) might

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Michael Schmitz
Hi Geert, On 28/06/22 19:03, Geert Uytterhoeven wrote: Leaving the bounce buffer handling in place, and taking a few other liberties - this is what converting the easiest case (a3000 SCSI) might look like. Any obvious mistakes? The mvme147 driver would be very similar to handle (after

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Geert Uytterhoeven
Hi Michael, On Tue, Jun 28, 2022 at 5:26 AM Michael Schmitz wrote: > Am 28.06.2022 um 09:12 schrieb Michael Schmitz: > > On 27/06/22 20:26, Geert Uytterhoeven wrote: > >> On Sat, Jun 18, 2022 at 3:06 AM Michael Schmitz > >> wrote: > >>> Am 18.06.2022 um 00:57 schrieb Arnd Bergmann: > From:

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-28 Thread Arnd Bergmann
On Tue, Jun 28, 2022 at 5:25 AM Michael Schmitz wrote: > Am 28.06.2022 um 09:12 schrieb Michael Schmitz: > > Leaving the bounce buffer handling in place, and taking a few other > liberties - this is what converting the easiest case (a3000 SCSI) might > look like. Any obvious mistakes? The mvme147

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-27 Thread Michael Schmitz
Hii Geert Am 28.06.2022 um 09:12 schrieb Michael Schmitz: Hi Geert, On 27/06/22 20:26, Geert Uytterhoeven wrote: Hi Michael, On Sat, Jun 18, 2022 at 3:06 AM Michael Schmitz wrote: Am 18.06.2022 um 00:57 schrieb Arnd Bergmann: From: Arnd Bergmann All architecture-independent users of

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-27 Thread Michael Schmitz
Hi Geert, On 27/06/22 20:26, Geert Uytterhoeven wrote: Hi Michael, On Sat, Jun 18, 2022 at 3:06 AM Michael Schmitz wrote: Am 18.06.2022 um 00:57 schrieb Arnd Bergmann: From: Arnd Bergmann All architecture-independent users of virt_to_bus() and bus_to_virt() have been fixed to use the dma

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-27 Thread Geert Uytterhoeven
Hi Michael, On Sat, Jun 18, 2022 at 3:06 AM Michael Schmitz wrote: > Am 18.06.2022 um 00:57 schrieb Arnd Bergmann: > > From: Arnd Bergmann > > > > All architecture-independent users of virt_to_bus() and bus_to_virt() > > have been fixed to use the dma mapping interfaces or have been > > removed

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-27 Thread Michael Schmitz
Arnd, Am 26.06.2022 um 20:36 schrieb Arnd Bergmann: There are no platform specific header files other than asm/amigahw.h and asm/mvme147hw.h, currently only holding register address definitions. Would it be OK to add m68k_virt_to_bus() in there if it can't remain in asm/virtconvert.h, Geert?

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-26 Thread Arnd Bergmann
(On Sun, Jun 26, 2022 at 7:21 AM Michael Schmitz wrote: > > The same could be done for the two vme drivers (scsi/mvme147.c > > and ethernet/82596.c), which do the cache management but > > apparently don't need swiotlb bounce buffering. > > > > Rewriting the drivers to modern APIs is of course

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-25 Thread Michael Schmitz
Arnd, Am 24.06.2022 um 21:10 schrieb Arnd Bergmann: On Sat, Jun 18, 2022 at 3:06 AM Michael Schmitz wrote: Am 18.06.2022 um 00:57 schrieb Arnd Bergmann: All architecture-independent users of virt_to_bus() and bus_to_virt() have been fixed to use the dma mapping interfaces or have been

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-24 Thread Arnd Bergmann
On Sat, Jun 18, 2022 at 3:06 AM Michael Schmitz wrote: > Am 18.06.2022 um 00:57 schrieb Arnd Bergmann: > > > > All architecture-independent users of virt_to_bus() and bus_to_virt() > > have been fixed to use the dma mapping interfaces or have been > > removed now. This means the definitions on

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-17 Thread Michael Schmitz
Arnd, Am 18.06.2022 um 00:57 schrieb Arnd Bergmann: From: Arnd Bergmann All architecture-independent users of virt_to_bus() and bus_to_virt() have been fixed to use the dma mapping interfaces or have been removed now. This means the definitions on most architectures, and the