Skip to contentSkip to conversation

OMAP: sDMA: Correct the the omap_request_dma_chain() signature

PATCH In review Santosh Shilimkar 3 participants 8 messages Apr 29, 2009 – May 18, 2009 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP: sDMA: Correct the the omap_request_dma_chain() signature

Original OMAP DMA chaining design has chain_id as one of the callback parameters. The below patch broke the desing.
http://git.omapzoom.org/?p=repo/omapkernel.git;a=commitdiff;h=538528de0cb256f65716ab2e9613d9e920f97fe2
Now callback returns logical channel number and not chain_id. Hence the signature of the omap_request_dma_chain() functions needs to be corrected to avoid any confusion.

More details are on this email thread :
http://marc.info/?l=linux-omap&m=122961071931459&w=2

---
 arch/arm/plat-omap/dma.c              |    2 +-
 arch/arm/plat-omap/include/mach/dma.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-omap/dma.c +1 -1
index 6093018..fcc6f69 100644
@@ -1199,7 +1199,7 @@ static void create_dma_lch_chain(int lch_head, int lch_queue)
  * 	     Failure: -EINVAL/-ENOMEM
  */
 int omap_request_dma_chain(int dev_id, const char *dev_name,
-			   void (*callback) (int chain_id, u16 ch_status,
+			   void (*callback) (int lch, u16 ch_status,
 					     void *data),
 			   int *chain_id, int no_of_chans, int chain_mode,
 			   struct omap_dma_channel_params params)
arch/arm/plat-omap/include/mach/dma.h +1 -1
index 224b077..2d5af41 100644
@@ -546,7 +546,7 @@ extern int omap_get_dma_index(int lch, int *ei, int *fi);
 /* Chaining APIs */
 #ifndef CONFIG_ARCH_OMAP1
 extern int omap_request_dma_chain(int dev_id, const char *dev_name,
-				  void (*callback) (int chain_id, u16 ch_status,
+				  void (*callback) (int lch, u16 ch_status,
 						    void *data),
 				  int *chain_id, int no_of_chans,
 				  int chain_mode,
Signature · 1 line
1.5.4.7
#1 lore raw
Quoted 10 lines · On Wed, 29 Apr 2009 17:39:16 +0530 Santosh Shilimkar…

Original OMAP DMA chaining design has chain_id as one of the callback parameters. The below patch broke the desing.
http://git.omapzoom.org/?p=repo/omapkernel.git;a=commitdiff;h=538528de0cb256f65716ab2e9613d9e920f97fe2
Now callback returns logical channel number and not chain_id. Hence the signature of the omap_request_dma_chain() functions needs to be corrected to avoid any confusion.

More details are on this email thread :
http://marc.info/?l=linux-omap&m=122961071931459&w=2

Thanks! And this thread where I promised to send a patch but never done it...

http://marc.info/?l=linux-omap&m=122770291205164&w=2

Two comments:
"Now callback returns logical channel number and not chain_id. " You mean callback gets lch instead of chain_id as an argument?

Change also kernel-doc function comment for omap_request_dma_chain. I.e. those comment lines few lines before the function itself.

Signature · 1 line
Jarkko
#2 lore raw
Quoted 28 lines

-----Original Message-----
From: Jarkko Nikula [mailto:[email protected]]
Sent: Thursday, April 30, 2009 12:38 AM
To: Shilimkar, Santosh
Cc: [email protected]
Subject: Re: [PATCH] OMAP: sDMA: Correct the the
omap_request_dma_chain() signature

Quoted 1 line · On Wed, 29 Apr 2009 17:39:16 +0530 Santosh Shilimkar…

Original OMAP DMA chaining design has chain_id as one of

the callback

Quoted 2 lines

parameters. The below patch broke the desing.

http://git.omapzoom.org/?p=repo/omapkernel.git;a=commitdiff;h=
538528de0cb256f65716ab2e9613d9e920f97fe2

Quoted 7 lines

Now callback returns logical channel number and not chain_id. Hence the signature of the omap_request_dma_chain() functions needs to be corrected to avoid any confusion.

More details are on this email thread :
http://marc.info/?l=linux-omap&m=122961071931459&w=2

Thanks! And this thread where I promised to send a patch but never done
it...

Quoted 5 lines

http://marc.info/?l=linux-omap&m=122770291205164&w=2

Two comments:
"Now callback returns logical channel number and not chain_id. " You mean callback gets lch instead of chain_id as an argument?

Yes.

Quoted 2 lines

Change also kernel-doc function comment for omap_request_dma_chain. I.e. those comment lines few lines before the function itself.

Yes would do that and send the patch.

Regards,
Santosh

#3 lore raw

Regards,
Santosh

Quoted 41 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Shilimkar, Santosh
Sent: Thursday, April 30, 2009 10:02 AM
To: Jarkko Nikula
Cc: [email protected]
Subject: RE: [PATCH] OMAP: sDMA: Correct the the omap_request_dma_chain() signature

Quoted 11 lines

-----Original Message-----
From: Jarkko Nikula [mailto:[email protected]]
Sent: Thursday, April 30, 2009 12:38 AM
To: Shilimkar, Santosh
Cc: [email protected]
Subject: Re: [PATCH] OMAP: sDMA: Correct the the
omap_request_dma_chain() signature

On Wed, 29 Apr 2009 17:39:16 +0530
Santosh Shilimkar <[email protected]> wrote:

Quoted 8 lines
Quoted 1 line

Original OMAP DMA chaining design has chain_id as one of

the callback

Quoted 2 lines

parameters. The below patch broke the desing.

http://git.omapzoom.org/?p=repo/omapkernel.git;a=commitdiff;h=
538528de0cb256f65716ab2e9613d9e920f97fe2

Quoted 2 lines

Now callback returns logical channel number and not chain_id. Hence the signature of the omap_request_dma_chain()

functions needs

Quoted 11 lines
Quoted 5 lines

to be corrected to avoid any confusion.

More details are on this email thread :
http://marc.info/?l=linux-omap&m=122961071931459&w=2

Thanks! And this thread where I promised to send a patch but never done
it...

http://marc.info/?l=linux-omap&m=122770291205164&w=2

Quoted 7 lines
Quoted 3 lines

Two comments:
"Now callback returns logical channel number and not chain_id. " You mean callback gets lch instead of chain_id as an argument?

Yes.

Quoted 2 lines

Change also kernel-doc function comment for omap_request_dma_chain. I.e. those comment lines few lines before the function itself.

Yes would do that and send the patch.

There is no change needed in the documentation part since there is no description about the callback parameters. /**
* @brief omap_request_dma_chain : Request a chain of DMA channels
*
* @param dev_id - Device id using the dma channel
* @param dev_name - Device name
* @param callback - Call back function
* @chain_id -
* @no_of_chans - Number of channels requested
* @chain_mode - Dynamic or static chaining : OMAP_DMA_STATIC_CHAIN
* OMAP_DMA_DYNAMIC_CHAIN
* @params - Channel parameters
*
* @return - Succes : 0
* Failure: -EINVAL/-ENOMEM
*/
int omap_request_dma_chain(int dev_id, const char *dev_name,
void (*callback) (int chain_id, u16 ch_status,
void *data),
int *chain_id, int no_of_chans, int chain_mode,
struct omap_dma_channel_params params)
{

So no need to change the patch.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Yor tow comments....I think I answered both.....Just a correction you comment itself.

Quoted 1 line
Quoted 1 line

You mean callback gets lch instead of chain_id as an argument?

You mean callback **** returns *** lch instead of chain_id as an argument?

> > Two comments:
> > "Now callback returns logical channel number and not chain_id. " > > You mean callback gets lch instead of chain_id as an argument? > Yes.

Comment below.

> > Change also kernel-doc function comment for omap_request_dma_chain. > > I.e. those comment lines few lines before the function itself. > Yes would do that and send the patch.

________________________________
Regards
Santosh

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

________________________________

From: Jarkko Nikula [mailto:[email protected]]
Sent: Thursday, April 30, 2009 3:06 PM
To: Shilimkar, Santosh
Cc: [email protected]
Subject: Re: [PATCH] OMAP: sDMA: Correct the the omap_request_dma_chain() signature

On Thu, Apr 30, 2009 at 12:18 PM, Shilimkar, Santosh <[email protected]> wrote:

Yor tow comments....I think I answered both.....Just a correction you comment itself.

> > You mean callback gets lch instead of chain_id as an argument?

You mean callback **** returns *** lch instead of chain_id as an argument?

I mean argument passed to the callback. Callback is void so not returning anything.

if (likely(dma_chan[ch].callback != NULL))
dma_chan[ch].callback(ch, status, dma_chan[ch].data);

My ***return ** was from the dma user point of view and not the fucntion return :). Anyway the point is callback first argument is dma channel nubmer and not chain_id. So User will get the channel number and not chain_id via callback.

#8 lore raw

Tony,

Can you merge this.

Regards,
Santosh

Quoted 50 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Shilimkar, Santosh
Sent: Thursday, April 30, 2009 3:15 PM
To: Jarkko Nikula
Cc: [email protected]
Subject: RE: [PATCH] OMAP: sDMA: Correct the the omap_request_dma_chain() signature

________________________________

From: Jarkko Nikula [mailto:[email protected]]
Sent: Thursday, April 30, 2009 3:06 PM
To: Shilimkar, Santosh
Cc: [email protected]
Subject: Re: [PATCH] OMAP: sDMA: Correct the the omap_request_dma_chain() signature

	On Thu, Apr 30, 2009 at 12:18 PM, Shilimkar, Santosh 

<[email protected]> wrote:

Yor tow comments....I think I answered
both.....Just a correction you comment itself.

> > You mean callback gets lch instead of
chain_id as an argument?

You mean callback **** returns *** lch instead
of chain_id as an argument?

I mean argument passed to the callback. Callback is
void so not returning anything.

	        if (likely(dma_chan[ch].callback != NULL))
	                dma_chan[ch].callback(ch, status, 

dma_chan[ch].data);

My ***return ** was from the dma user point of view and
not the fucntion return :). Anyway the point is callback first argument is dma channel nubmer and not chain_id. So User will get the channel number and not chain_id via callback.