All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Stigge <stigge@antcom.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	arm@kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kevin.wells@nxp.com,
	srinivas.bakki@nxp.com, aletes.xgr@gmail.com
Subject: Re: [PATCH v2 04/23] ARM: LPC32xx: Add DMA configuration to platform data
Date: Wed, 11 Jul 2012 10:28:47 +0200	[thread overview]
Message-ID: <4FFD393F.1070104@antcom.de> (raw)
In-Reply-To: <201207102136.35944.arnd@arndb.de>

On 07/10/2012 11:36 PM, Arnd Bergmann wrote:
>> +/* NOTE: These will change, according to RMK */
>> +static int pl08x_get_signal(struct pl08x_dma_chan *ch)
>> +{
>> +	return ch->cd->min_signal;
>> +}
>> +
> 
> This has changed now, rendering linux-next broken for lpc32xx_defconfig:
> 
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:190:36: warning: 'struct pl08x_dma_chan' declared inside parameter list [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:190:36: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c: In function 'pl08x_get_signal':
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:192:11: error: dereferencing pointer to incomplete type
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c: At top level:
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:195:37: warning: 'struct pl08x_dma_chan' declared inside parameter list [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:202:2: warning: initialization from incompatible pointer type [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:202:2: warning: (near initialization for 'pl08x_pd.get_signal') [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:203:2: warning: initialization from incompatible pointer type [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:203:2: warning: (near initialization for 'pl08x_pd.put_signal') [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c: In function 'pl08x_get_signal':
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:193:1: warning: control reaches end of non-void function [-Wreturn-type]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c: In function 'lpc32xx_dma_filter':
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:720:48: error: dereferencing pointer to incomplete type
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:720:67: warning: initialization from incompatible pointer type [enabled by default]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:720:67: warning: (near initialization for 'ch') [enabled by default]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:720:145: error: invalid use of undefined type 'struct pl08x_dma_chan'
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:723:8: error: dereferencing pointer to incomplete type
> make[4]: *** [drivers/mtd/nand/lpc32xx_slc.o] Error 1
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c: In function 'lpc32xx_dma_filter':
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:582:48: error: dereferencing pointer to incomplete type
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:582:67: warning: initialization from incompatible pointer type [enabled by default]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:582:67: warning: (near initialization for 'ch') [enabled by default]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:582:145: error: invalid use of undefined type 'struct pl08x_dma_chan'
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:585:8: error: dereferencing pointer to incomplete type
> make[4]: *** [drivers/mtd/nand/lpc32xx_mlc.o] Error 1
> 
> As far as I can tell, each branch touching these files is ok individually,
> but they don't go together.
> 
> There is also this bit of suspicious code in lpc32xx_slc:
> 
> static bool lpc32xx_dma_filter(struct dma_chan *chan, void *param)
> {
>         struct pl08x_dma_chan *ch =
>                 container_of(chan, struct pl08x_dma_chan, chan);
> 
>         /* In LPC32xx's PL080 DMA wiring, the SLC NAND DMA signal is #1 */
>         if (ch->cd->min_signal == 1)
>                 return true;
>         return false;
> }
> 
> I dont't think that actually valid -- you cannot make any assumption about
> the structure outside of dma_chan here, only about the parameter you pass
> in.

Thanks for the note! Looks like the interface consolidated to replace
ch->cd->min_signal with sth. like cd->min_signal directly.

Accessing the signal id/number is/was quite convenient because as you
can see in the 3 above cases that now get compile errors with the pl08x
changes, the LPC32xx chip hard-wires those numbers, and the respective
code is LPC32xx specific anyway.

So can we make an exception here to compare static dma channel numbers?
Or is there any other interface to access the static dma channel numbers
that I'm currently not aware of?

Depending on what we agree upon, I can then provide fixes to the
lpc32xx-next branch.

Thanks in advance,

Roland

WARNING: multiple messages have this Message-ID (diff)
From: stigge@antcom.de (Roland Stigge)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 04/23] ARM: LPC32xx: Add DMA configuration to platform data
Date: Wed, 11 Jul 2012 10:28:47 +0200	[thread overview]
Message-ID: <4FFD393F.1070104@antcom.de> (raw)
In-Reply-To: <201207102136.35944.arnd@arndb.de>

On 07/10/2012 11:36 PM, Arnd Bergmann wrote:
>> +/* NOTE: These will change, according to RMK */
>> +static int pl08x_get_signal(struct pl08x_dma_chan *ch)
>> +{
>> +	return ch->cd->min_signal;
>> +}
>> +
> 
> This has changed now, rendering linux-next broken for lpc32xx_defconfig:
> 
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:190:36: warning: 'struct pl08x_dma_chan' declared inside parameter list [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:190:36: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c: In function 'pl08x_get_signal':
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:192:11: error: dereferencing pointer to incomplete type
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c: At top level:
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:195:37: warning: 'struct pl08x_dma_chan' declared inside parameter list [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:202:2: warning: initialization from incompatible pointer type [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:202:2: warning: (near initialization for 'pl08x_pd.get_signal') [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:203:2: warning: initialization from incompatible pointer type [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:203:2: warning: (near initialization for 'pl08x_pd.put_signal') [enabled by default]
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c: In function 'pl08x_get_signal':
> /home/arnd/linux-arm/arch/arm/mach-lpc32xx/phy3250.c:193:1: warning: control reaches end of non-void function [-Wreturn-type]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c: In function 'lpc32xx_dma_filter':
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:720:48: error: dereferencing pointer to incomplete type
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:720:67: warning: initialization from incompatible pointer type [enabled by default]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:720:67: warning: (near initialization for 'ch') [enabled by default]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:720:145: error: invalid use of undefined type 'struct pl08x_dma_chan'
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_slc.c:723:8: error: dereferencing pointer to incomplete type
> make[4]: *** [drivers/mtd/nand/lpc32xx_slc.o] Error 1
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c: In function 'lpc32xx_dma_filter':
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:582:48: error: dereferencing pointer to incomplete type
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:582:67: warning: initialization from incompatible pointer type [enabled by default]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:582:67: warning: (near initialization for 'ch') [enabled by default]
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:582:145: error: invalid use of undefined type 'struct pl08x_dma_chan'
> /home/arnd/linux-arm/drivers/mtd/nand/lpc32xx_mlc.c:585:8: error: dereferencing pointer to incomplete type
> make[4]: *** [drivers/mtd/nand/lpc32xx_mlc.o] Error 1
> 
> As far as I can tell, each branch touching these files is ok individually,
> but they don't go together.
> 
> There is also this bit of suspicious code in lpc32xx_slc:
> 
> static bool lpc32xx_dma_filter(struct dma_chan *chan, void *param)
> {
>         struct pl08x_dma_chan *ch =
>                 container_of(chan, struct pl08x_dma_chan, chan);
> 
>         /* In LPC32xx's PL080 DMA wiring, the SLC NAND DMA signal is #1 */
>         if (ch->cd->min_signal == 1)
>                 return true;
>         return false;
> }
> 
> I dont't think that actually valid -- you cannot make any assumption about
> the structure outside of dma_chan here, only about the parameter you pass
> in.

Thanks for the note! Looks like the interface consolidated to replace
ch->cd->min_signal with sth. like cd->min_signal directly.

Accessing the signal id/number is/was quite convenient because as you
can see in the 3 above cases that now get compile errors with the pl08x
changes, the LPC32xx chip hard-wires those numbers, and the respective
code is LPC32xx specific anyway.

So can we make an exception here to compare static dma channel numbers?
Or is there any other interface to access the static dma channel numbers
that I'm currently not aware of?

Depending on what we agree upon, I can then provide fixes to the
lpc32xx-next branch.

Thanks in advance,

Roland

  reply	other threads:[~2012-07-11  8:28 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 16:50 [PATCH v2 00/23] ARM: LPC32xx specific updates for next Roland Stigge
2012-06-14 16:50 ` Roland Stigge
2012-06-14 16:50 ` [PATCH v2 01/23] ARM: LPC32xx: Add NAND flash timing to PHY3250 board dts Roland Stigge
2012-06-14 16:50   ` Roland Stigge
2012-06-14 16:50 ` [PATCH v2 02/23] ARM: LPC32xx: Clock initialization for NAND controllers Roland Stigge
2012-06-14 16:50   ` Roland Stigge
2012-06-14 16:50 ` [PATCH v2 03/23] ARM: LPC32xx: Remove SLC controller initialization from platform init Roland Stigge
2012-06-14 16:50   ` Roland Stigge
2012-06-14 16:50 ` [PATCH v2 04/23] ARM: LPC32xx: Add DMA configuration to platform data Roland Stigge
2012-06-14 16:50   ` Roland Stigge
2012-07-10 21:36   ` Arnd Bergmann
2012-07-10 21:36     ` Arnd Bergmann
2012-07-11  8:28     ` Roland Stigge [this message]
2012-07-11  8:28       ` Roland Stigge
2012-07-11 12:33       ` Arnd Bergmann
2012-07-11 12:33         ` Arnd Bergmann
2012-07-11 12:40         ` Roland Stigge
2012-07-11 12:40           ` Roland Stigge
2012-07-11 13:25           ` Arnd Bergmann
2012-07-11 13:25             ` Arnd Bergmann
2012-07-11 13:39             ` Roland Stigge
2012-07-11 13:39               ` Roland Stigge
2012-06-14 16:50 ` [PATCH v2 05/23] ARM: LPC32xx: Adjust dtsi file for MLC controller configuration Roland Stigge
2012-06-14 16:50   ` Roland Stigge
2012-06-14 16:50 ` [PATCH v2 06/23] ARM: LPC32xx: Add dts for EA3250 reference board Roland Stigge
2012-06-14 16:50   ` Roland Stigge
2012-06-14 16:50 ` [PATCH v2 07/23] ARM: LPC32xx: DTS adjustment for key matrix controller Roland Stigge
2012-06-14 16:50   ` Roland Stigge
2012-06-14 16:50 ` [PATCH v2 08/23] ARM: LPC32xx: Clock " Roland Stigge
2012-06-14 16:50   ` Roland Stigge
2012-06-14 16:50 ` [PATCH v2 09/23] ARM: LPC32xx: Defconfig update Roland Stigge
2012-06-14 16:50   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 10/23] ARM: LPC32xx: Add MMC controller support Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 11/23] ARM: LPC32xx: DTS adjustment for using pl18x primecell Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 12/23] ARM: LPC32xx: DT conversion of Standard UARTs Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 13/23] ARM: LPC32xx: High Speed UART configuration via DT Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 14/23] ARM: LPC32xx: Remove mach specific ARCH_NR_GPIOS, use default Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 15/23] ARM: LPC32xx: Fix lpc32xx.dtsi status property: "disable" -> "disabled" Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 16/23] ARM: LPC32xx: Build arch dtbs Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 17/23] ARM: LPC32xx: Add dt settings to the at25 node Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 18/23] ARM: LPC32xx: Remove spi chipselect request from board init Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 19/23] ARM: LPC32xx: Remove spi chip definitions Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 20/23] ARM: LPC32xx: Cleanup board init, remove duplicate clock init Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 21/23] ARM: LPC32xx: Move uart6 irda disable to serial.c Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 22/23] ARM: LPC32xx: Move i2s1 dma enabling to clock.c Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-14 16:51 ` [PATCH v2 23/23] ARM: LPC32xx: Remove duplicate usb host clock init Roland Stigge
2012-06-14 16:51   ` Roland Stigge
2012-06-15 12:07 ` [PATCH v2 00/23] ARM: LPC32xx specific updates for next Arnd Bergmann
2012-06-15 12:07   ` Arnd Bergmann
2012-06-15 12:12   ` Alexandre Pereira da Silva
2012-06-15 12:12     ` Alexandre Pereira da Silva
2012-06-15 12:37     ` Roland Stigge
2012-06-15 12:37       ` Roland Stigge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FFD393F.1070104@antcom.de \
    --to=stigge@antcom.de \
    --cc=aletes.xgr@gmail.com \
    --cc=arm@kernel.org \
    --cc=arnd@arndb.de \
    --cc=kevin.wells@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=srinivas.bakki@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.