diff mbox

OMAP: sDMA: Correct the the omap_request_dma_chain() signature

Message ID 1241006956-29268-1-git-send-email-santosh.shilimkar@ti.com (mailing list archive)
State Accepted
Commit 0b2ce840c9fb58cf489bfdfc2d77f99a09a5dca3
Headers show

Commit Message

Santosh Shilimkar April 29, 2009, 12:09 p.m. UTC
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

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/plat-omap/dma.c              |    2 +-
 arch/arm/plat-omap/include/mach/dma.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Jarkko Nikula April 29, 2009, 7:08 p.m. UTC | #1
On Wed, 29 Apr 2009 17:39:16 +0530
Santosh Shilimkar <santosh.shilimkar@ti.com> wrote:

> 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.
Santosh Shilimkar April 30, 2009, 4:32 a.m. UTC | #2
> -----Original Message-----
> From: Jarkko Nikula [mailto:jhnikula@gmail.com] 
> Sent: Thursday, April 30, 2009 12:38 AM
> To: Shilimkar, Santosh
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH] OMAP: sDMA: Correct the the 
> omap_request_dma_chain() signature
> 
> On Wed, 29 Apr 2009 17:39:16 +0530
> Santosh Shilimkar <santosh.shilimkar@ti.com> wrote:
> 
> > 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?
Yes.
> 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--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Santosh Shilimkar April 30, 2009, 4:48 a.m. UTC | #3
Regards,
Santosh
 

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org 
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of 
> Shilimkar, Santosh
> Sent: Thursday, April 30, 2009 10:02 AM
> To: Jarkko Nikula
> Cc: linux-omap@vger.kernel.org
> Subject: RE: [PATCH] OMAP: sDMA: Correct the the 
> omap_request_dma_chain() signature
> 
> > -----Original Message-----
> > From: Jarkko Nikula [mailto:jhnikula@gmail.com] 
> > Sent: Thursday, April 30, 2009 12:38 AM
> > To: Shilimkar, Santosh
> > Cc: linux-omap@vger.kernel.org
> > Subject: Re: [PATCH] OMAP: sDMA: Correct the the 
> > omap_request_dma_chain() signature
> > 
> > On Wed, 29 Apr 2009 17:39:16 +0530
> > Santosh Shilimkar <santosh.shilimkar@ti.com> wrote:
> > 
> > > 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?
> Yes.
> > 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Santosh Shilimkar April 30, 2009, 9:18 a.m. UTC | #4
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?



		> > 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.
Santosh Shilimkar April 30, 2009, 9:44 a.m. UTC | #5

Santosh Shilimkar May 13, 2009, 10:12 a.m. UTC | #6
Tony,

Can you merge this.

Regards,
Santosh
 

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org 
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of 
> Shilimkar, Santosh
> Sent: Thursday, April 30, 2009 3:15 PM
> To: Jarkko Nikula
> Cc: linux-omap@vger.kernel.org
> Subject: RE: [PATCH] OMAP: sDMA: Correct the the 
> omap_request_dma_chain() signature
> 
> ________________________________
> 
> From: Jarkko Nikula [mailto:jhnikula@gmail.com] 
> Sent: Thursday, April 30, 2009 3:06 PM
> To: Shilimkar, Santosh
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH] OMAP: sDMA: Correct the the 
> omap_request_dma_chain() signature
> 
> 
> 
> 	On Thu, Apr 30, 2009 at 12:18 PM, Shilimkar, Santosh 
> <santosh.shilimkar@ti.com> 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.
> 	
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren May 18, 2009, 9:26 p.m. UTC | #7
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Initial commit ID (Likely to change): 0b2ce840c9fb58cf489bfdfc2d77f99a09a5dca3

PatchWorks
http://patchwork.kernel.org/patch/20665/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=0b2ce840c9fb58cf489bfdfc2d77f99a09a5dca3


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 6093018..fcc6f69 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -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)
diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/mach/dma.h
index 224b077..2d5af41 100644
--- a/arch/arm/plat-omap/include/mach/dma.h
+++ b/arch/arm/plat-omap/include/mach/dma.h
@@ -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,