[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a24660a6-a9d7-ce97-5e2b-17928981551c@samsung.com>
Date: Wed, 16 Jan 2019 11:36:51 +0100
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: Robin Murphy <robin.murphy@....com>,
Thierry Reding <treding@...dia.com>
Cc: iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Christoph Hellwig <hch@....de>,
Russell King <rmk+kernel@...linux.org.uk>,
Ben Skeggs <bskeggs@...hat.com>,
Tobias Jakobi <tjakobi@...h.uni-bielefeld.de>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: Re: [PATCH] Revert
"ARM: dma-mapping: Set proper DMA ops in arm_iommu_detach_device()"
Hi Robin,
On 2019-01-14 17:38, Robin Murphy wrote:
> On 14/01/2019 16:09, Thierry Reding wrote:
>> On Mon, Jan 14, 2019 at 02:22:40PM +0100, Marek Szyprowski wrote:
>>> This reverts commit 1874619a7df4b14b23b14877e705ae15325773e3.
>>>
>>> That patch broke IOMMU support for devices, which fails to probe for
>>> the
>>> first time and use deferred probe approach. When non-NULL dma_ops is
>>> set
>>> in arm_iommu_detach_device(), the given device later ignored by
>>> arch_setup_dma_ops() and stays with non-IOMMU dma_ops.
>>>
>>> Reported-by: Tobias Jakobi <tjakobi@...h.uni-bielefeld.de>
>>> Fixes: 1874619a7df4 "ARM: dma-mapping: Set proper DMA ops in
>>> arm_iommu_detach_device()"
>>> Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
>>> ---
>>> arch/arm/mm/dma-mapping.c | 12 ++++++------
>>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> Can you point out exactly what drivers break because of this change? We
>> need to find a solution that works for everyone. Reverting is only
>> marginally useful because somebody will just end up wanting to revert
>> the revert because a different driver is now broken.
>
> At first glance, it sounds like what we really want is for
> arch_teardown_iommu_ops() to completely clear any ops that
> arch_setup_dma_ops() installed - does the below suffice?
I've initially also thought about similar fix, but then I found the
commit 1874619a7df4b14b23b14877e705ae15325773e3, which was the source of
this problem.
Robin: do you plan to send this fix as a complete patch or do you want
me to resend it with the above commit message and your's suggested-by?
>
> Robin.
>
> ----->8-----
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index f1e2922e447c..1e3e08a1c456 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -2390,4 +2390,6 @@ void arch_teardown_dma_ops(struct device *dev)
> return;
>
> arm_teardown_iommu_dma_ops(dev);
> + /* Let arch_setup_dma_ops() start again from scratch upon
> re-probe */
> + set_dma_ops(dev, NULL);
> }
>
>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Powered by blists - more mailing lists