Re: [PATCH 1/3] ata: sata_dwc_460ex: use "dmas" DT property to find dma channel

From: Måns Rullgård
Date: Fri Dec 18 2015 - 06:24:48 EST


Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> writes:

> On Thu, 2015-12-17 at 17:41 -0400, Julian Margetson wrote:
>> On 12/17/2015 3:53 PM, MÃns RullgÃrd wrote:
>> > Julian Margetson <runaway@xxxxxxxx> writes:
>> >
>> > > On 12/17/2015 2:51 PM, MÃns RullgÃrd wrote:
>> > > > Julian Margetson <runaway@xxxxxxxx> writes:
>> > > >
>> > > > > On 12/17/2015 1:59 PM, MÃns RullgÃrd wrote:
>> > > > > > Julian Margetson <runaway@xxxxxxxx> writes:
>> > > > > >
>> > > > > > > I have been running my machine mostly configured for
>> > > > > > > pciex1ÂÂthus with
>> > > > > > > the sata_dwc disabled.
>> > > > > > > The changes to sata_dwc-460ex do cause an oops.
>> > > > > > > I will try to give more detailed info over this weekend .
>> > > > > > The driver as is upstream would do that since it
>> > > > > > unconditionally
>> > > > > > dereferences a null pointer in the probe function.ÂÂMy
>> > > > > > patch fixes that
>> > > > > > as a side-effect.
>> > > > > >
>> > > > > patching file drivers/ata/Kconfig
>> > > > >
>> > > > > Hunk #1 FAILED at 296.
>> > > > [...]
>> > > >
>> > > > > root@julian-VirtualBox:/usr/src/linux-3.18.25#
>> > > > The patch is against 4.4-rc5.
>> > > >
>> > > ÂCCÂÂÂÂÂÂdrivers/ata/sata_dwc_460ex.o
>> > >
>> > > drivers/ata/sata_dwc_460ex.c:198:15: error: variable
>> > > ÃâËsata_dwc_dma_dwsÃââ has initializer but incomplete type
>> > >
>> > > Âstatic struct dw_dma_slave sata_dwc_dma_dws = {
>> > > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ^
>> > It builds, albeit with an unrelated warning, using the attached
>> > config.
>> > Maybe there's a missing config dependency somewhere.
>> >
>> I am attempting to cross compile under Ubuntu 14.04 X86 in Virtualbox
>> with your .config.
>> 4.4.0-rc5 builds ok with no patches applied .
>> Once your patch is applied it fails to build .
>> CCÂÂÂÂÂÂdrivers/ata/sata_dwc_460ex.o
>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable
>> âsata_dwc_dma_dwsâ has initializer but incomplete type
>> Âstatic struct dw_dma_slave sata_dwc_dma_dws = {
>> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ^
>> drivers/ata/sata_dwc_460ex.c:199:2: error: unknown field âsrc_idâ
>> specified in initializer
>> Â .src_id = 0,
>
> This clearly means that header file that defines the struct
> dw_dma_slave is not included.

And yet two lines above there's this:

#include <linux/platform_data/dma-dw.h>

This unconditionally defines struct dw_dma_slave.

Moreover, the line number in the error message above does not match any
version of the file with my patches applied. I suspect something went
wrong when Julian patched his tree.

> After the patch it seems you have to explicitly enable DW_DMAC, so,
> either via make nconfig, or by adding
> CONFIG_DW_DMAC=y

The option for enabling the compatibility code selects DW_DMAC. There
is a missing select DMA_ENGINE, but that won't make any difference here,
and my .config has it enabled anyhow.

--
MÃns RullgÃrd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/