[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <23ed7ff8-c1d7-a069-3058-3944c7586116@gmail.com>
Date: Sat, 12 May 2018 10:02:03 +1200
From: Michael Schmitz <schmitzmic@...il.com>
To: Finn Thain <fthain@...egraphics.com.au>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
"David S. Miller" <davem@...emloft.net>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
netdev <netdev@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@....de>
Subject: Re: [PATCH net] macmace: Set platform device coherent_dma_mask
Hi Finn,
Am 11.05.2018 um 22:06 schrieb Finn Thain:
>> You would have to be careful not to overwrite a pdev->dev.dma_mask and
>> pdev->dev.dma_coherent_mask that might have been set in a platform
>> device passed via platform_device_register here. Coldfire is the only
>> m68k platform currently using that, but there might be others in future.
>>
>
> That Coldfire patch could be reverted if this is a better solution.
True, but there might be other uses for deviating from a platform
default (I'm thinking of Atari SCSI and floppy drivers here). But we
could chose the correct mask to set in arch_setup_pdev_archdata()
instead, as it's a platform property not a driver property in that case.
>> ... But I don't think there are smaller DMA masks used by m68k drivers
>> that use the platform device mechanism at present. I've only looked at
>> arch/m68k though.
>
> So we're back at the same problem that Geert's suggestion also raised: how
> to identify potentially affected platform devices and drivers?
>
> Maybe we can take a leaf out of Christoph's book, and leave a noisy
> WARNING splat in the log.
>
> void arch_setup_pdev_archdata(struct platform_device *pdev)
> {
> WARN_ON_ONCE(pdev->dev.coherent_dma_mask != DMA_MASK_NONE ||
> pdev->dev.dma_mask != NULL);
I'd suggest using WARN_ON() so we catch all uses on a particular platform.
I initially thought it necessary to warn on unset mask here, but I see
that would throw up a lot of redundant false positives.
Cheers,
Michael
Powered by blists - more mailing lists