Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2021-09-29 Thread Alexey Kardashevskiy
On 09/09/2020 17:58, Christoph Hellwig wrote: > On Tue, Sep 08, 2020 at 11:10:03PM +1000, Alexey Kardashevskiy wrote: a-ha, this makes more sense, thanks. Then I guess we need to revert that one bit from yours f1565c24b596, do not we? >>> >>> Why? The was the original intent of the

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-24 Thread Christoph Hellwig
On Thu, Sep 24, 2020 at 05:03:11PM +1000, Alexey Kardashevskiy wrote: > May be... The current behavior is not wrong (after the fix) but not > optimal either. Even with legacy PCI it should just result in failing > attempt to set 64bit mask which drivers should still handle, i.e. choose > a shorter

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-24 Thread Alexey Kardashevskiy
On 24/09/2020 00:10, Christoph Hellwig wrote: > On Tue, Sep 22, 2020 at 12:26:18PM +1000, Alexey Kardashevskiy wrote: >>> Well, the original intent of dma_get_required_mask is to return the >>> mask that the driver then uses to figure out what to set, so what aacraid >>> does fits that use

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-23 Thread Christoph Hellwig
On Tue, Sep 22, 2020 at 12:26:18PM +1000, Alexey Kardashevskiy wrote: > > Well, the original intent of dma_get_required_mask is to return the > > mask that the driver then uses to figure out what to set, so what aacraid > > does fits that use case. > > What was the original intent exactly? The

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-21 Thread Alexey Kardashevskiy
On 15/09/2020 16:50, Christoph Hellwig wrote: > On Wed, Sep 09, 2020 at 07:36:04PM +1000, Alexey Kardashevskiy wrote: >> I want dma_get_required_mask() to return the bigger mask always. >> >> Now it depends on (in dma_alloc_direct()): >> 1. dev->dma_ops_bypass: set via

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-15 Thread Christoph Hellwig
On Wed, Sep 09, 2020 at 07:36:04PM +1000, Alexey Kardashevskiy wrote: > I want dma_get_required_mask() to return the bigger mask always. > > Now it depends on (in dma_alloc_direct()): > 1. dev->dma_ops_bypass: set via pci_set_(coherent_)dma_mask(); > 2. dev->coherent_dma_mask - the same; > 3.

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-10 Thread Michael Ellerman
On Tue, 8 Sep 2020 11:51:06 +1000, Alexey Kardashevskiy wrote: > There are 2 problems with it: > 1. "<" vs expected "<<" > 2. the shift number is an IOMMU page number mask, not an address mask > as the IOMMU page shift is missing. > > This did not hit us before f1565c24b596 ("powerpc: use the

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-09 Thread Alexey Kardashevskiy
On 09/09/2020 17:58, Christoph Hellwig wrote: > On Tue, Sep 08, 2020 at 11:10:03PM +1000, Alexey Kardashevskiy wrote: a-ha, this makes more sense, thanks. Then I guess we need to revert that one bit from yours f1565c24b596, do not we? >>> >>> Why? The was the original intent of the

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-08 Thread Christoph Hellwig
On Tue, Sep 08, 2020 at 10:06:56PM +1000, Alexey Kardashevskiy wrote: > On 08/09/2020 15:44, Christoph Hellwig wrote: >> On Tue, Sep 08, 2020 at 11:51:06AM +1000, Alexey Kardashevskiy wrote: >>> What is dma_get_required_mask() for anyway? What "requires" what here? >> >> Yes, it is a really odd

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-08 Thread Alexey Kardashevskiy
On 08/09/2020 15:44, Christoph Hellwig wrote: On Tue, Sep 08, 2020 at 11:51:06AM +1000, Alexey Kardashevskiy wrote: What is dma_get_required_mask() for anyway? What "requires" what here? Yes, it is a really odd API. It comes from classic old PCI where 64-bit addressing required an

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-08 Thread Cédric Le Goater
On 9/8/20 3:51 AM, Alexey Kardashevskiy wrote: > There are 2 problems with it: > 1. "<" vs expected "<<" > 2. the shift number is an IOMMU page number mask, not an address mask > as the IOMMU page shift is missing. > > This did not hit us before f1565c24b596 ("powerpc: use the generic >

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-08 Thread Michael Ellerman
Alexey Kardashevskiy writes: > There are 2 problems with it: > 1. "<" vs expected "<<" > 2. the shift number is an IOMMU page number mask, not an address mask > as the IOMMU page shift is missing. > > This did not hit us before f1565c24b596 ("powerpc: use the generic > dma_ops_bypass mode")

Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-07 Thread Christoph Hellwig
On Tue, Sep 08, 2020 at 11:51:06AM +1000, Alexey Kardashevskiy wrote: > What is dma_get_required_mask() for anyway? What "requires" what here? Yes, it is a really odd API. It comes from classic old PCI where 64-bit addressing required an additional bus cycle, and various devices had different

[PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask

2020-09-07 Thread Alexey Kardashevskiy
There are 2 problems with it: 1. "<" vs expected "<<" 2. the shift number is an IOMMU page number mask, not an address mask as the IOMMU page shift is missing. This did not hit us before f1565c24b596 ("powerpc: use the generic dma_ops_bypass mode") because we had there additional code to handle