diff mbox

[1/3] omap-dma: Allow compile-testing omap1_camera driver

Message ID 6cbd00c5f2d342b573aaf9c0e533778374dd2e1e.1410273306.git.m.chehab@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab Sept. 9, 2014, 2:38 p.m. UTC
We want to be able to COMPILE_TEST the omap1_camera driver.
It compiles fine, but it fails linkediting:

ERROR: "omap_stop_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
ERROR: "omap_start_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
ERROR: "omap_dma_link_lch" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
ERROR: "omap_set_dma_dest_burst_mode" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
ERROR: "omap_set_dma_src_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
ERROR: "omap_request_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
ERROR: "omap_set_dma_transfer_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
ERROR: "omap_set_dma_dest_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
ERROR: "omap_free_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!

So, add some stub functions to avoid it.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

Comments

Nishanth Menon Sept. 9, 2014, 2:40 p.m. UTC | #1
+linux-omap, tony
-Balaji

On 09/09/2014 09:38 AM, Mauro Carvalho Chehab wrote:
> We want to be able to COMPILE_TEST the omap1_camera driver.
> It compiles fine, but it fails linkediting:
> 
> ERROR: "omap_stop_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_start_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_dma_link_lch" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_set_dma_dest_burst_mode" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_set_dma_src_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_request_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_set_dma_transfer_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_set_dma_dest_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_free_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> 
> So, add some stub functions to avoid it.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> 
> diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
> index 6f06f8bc612c..7c8bfdd90a33 100644
> --- a/include/linux/omap-dma.h
> +++ b/include/linux/omap-dma.h
> @@ -294,43 +294,24 @@ struct omap_system_dma_plat_info {
>  extern struct omap_system_dma_plat_info *omap_get_plat_info(void);
>  
>  extern void omap_set_dma_priority(int lch, int dst_port, int priority);
> -extern int omap_request_dma(int dev_id, const char *dev_name,
> -			void (*callback)(int lch, u16 ch_status, void *data),
> -			void *data, int *dma_ch);
>  extern void omap_enable_dma_irq(int ch, u16 irq_bits);
>  extern void omap_disable_dma_irq(int ch, u16 irq_bits);
> -extern void omap_free_dma(int ch);
> -extern void omap_start_dma(int lch);
> -extern void omap_stop_dma(int lch);
> -extern void omap_set_dma_transfer_params(int lch, int data_type,
> -					 int elem_count, int frame_count,
> -					 int sync_mode,
> -					 int dma_trigger, int src_or_dst_synch);
>  extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
>  				    u32 color);
>  extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
>  extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
>  
> -extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
> -				    unsigned long src_start,
> -				    int src_ei, int src_fi);
>  extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
>  extern void omap_set_dma_src_data_pack(int lch, int enable);
>  extern void omap_set_dma_src_burst_mode(int lch,
>  					enum omap_dma_burst_mode burst_mode);
>  
> -extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
> -				     unsigned long dest_start,
> -				     int dst_ei, int dst_fi);
>  extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
>  extern void omap_set_dma_dest_data_pack(int lch, int enable);
> -extern void omap_set_dma_dest_burst_mode(int lch,
> -					 enum omap_dma_burst_mode burst_mode);
>  
>  extern void omap_set_dma_params(int lch,
>  				struct omap_dma_channel_params *params);
>  
> -extern void omap_dma_link_lch(int lch_head, int lch_queue);
>  extern void omap_dma_unlink_lch(int lch_head, int lch_queue);
>  
>  extern int omap_set_dma_callback(int lch,
> @@ -356,18 +337,9 @@ extern void omap_dma_disable_irq(int lch);
>  
>  /* Chaining APIs */
>  #ifndef CONFIG_ARCH_OMAP1
> -extern int omap_request_dma_chain(int dev_id, const char *dev_name,
> -				  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);
> -extern int omap_free_dma_chain(int chain_id);
>  extern int omap_dma_chain_a_transfer(int chain_id, int src_start,
>  				     int dest_start, int elem_count,
>  				     int frame_count, void *callbk_data);
> -extern int omap_start_dma_chain_transfers(int chain_id);
> -extern int omap_stop_dma_chain_transfers(int chain_id);
>  extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
>  extern int omap_get_dma_chain_dst_pos(int chain_id);
>  extern int omap_get_dma_chain_src_pos(int chain_id);
> @@ -377,6 +349,87 @@ extern int omap_modify_dma_chain_params(int chain_id,
>  extern int omap_dma_chain_status(int chain_id);
>  #endif
>  
> +#ifndef CONFIG_COMPILE_TEST
> +extern int omap_request_dma(int dev_id, const char *dev_name,
> +			void (*callback)(int lch, u16 ch_status, void *data),
> +			void *data, int *dma_ch);
> +extern void omap_free_dma(int ch);
> +extern void omap_start_dma(int lch);
> +extern void omap_stop_dma(int lch);
> +extern void omap_set_dma_transfer_params(int lch, int data_type,
> +					 int elem_count, int frame_count,
> +					 int sync_mode,
> +					 int dma_trigger, int src_or_dst_synch);
> +extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
> +				    unsigned long src_start,
> +				    int src_ei, int src_fi);
> +extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
> +				     unsigned long dest_start,
> +				     int dst_ei, int dst_fi);
> +extern void omap_set_dma_dest_burst_mode(int lch,
> +					 enum omap_dma_burst_mode burst_mode);
> +extern void omap_dma_link_lch(int lch_head, int lch_queue);
> +
> +#ifndef CONFIG_ARCH_OMAP1
> +extern int omap_request_dma_chain(int dev_id, const char *dev_name,
> +				  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);
> +extern int omap_free_dma_chain(int chain_id);
> +extern int omap_start_dma_chain_transfers(int chain_id);
> +extern int omap_stop_dma_chain_transfers(int chain_id);
> +#endif /* CONFIG_ARCH_OMAP1 */
> +#else
> +	/* Stubs for compile testing some drivers on other archs */
> +
> +static inline
> +int omap_request_dma(int dev_id, const char *dev_name,
> +		     void (*callback)(int lch, u16 ch_status, void *data),
> +		     void *data, int *dma_ch) { return 0; }
> +
> +static inline void omap_free_dma(int ch) {}
> +static inline void omap_start_dma(int lch) {}
> +static inline void omap_stop_dma(int lch) {}
> +
> +static inline
> +void omap_set_dma_transfer_params(int lch, int data_type,
> +				  int elem_count, int frame_count,
> +				  int sync_mode,
> +				  int dma_trigger, int src_or_dst_synch) {}
> +
> +static inline
> +void omap_set_dma_src_params(int lch, int src_port, int src_amode,
> +			     unsigned long src_start,
> +			     int src_ei, int src_fi) {}
> +
> +static inline
> +void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
> +			      unsigned long dest_start,
> +			      int dst_ei, int dst_fi) {}
> +
> +static inline
> +void omap_set_dma_dest_burst_mode(int lch,
> +				  enum omap_dma_burst_mode burst_mode) {}
> +
> +static inline
> +void omap_dma_link_lch(int lch_head, int lch_queue) {}
> +
> +static inline
> +int omap_request_dma_chain(int dev_id, const char *dev_name,
> +			   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) { return 0; }
> +
> +static inline int omap_free_dma_chain(int chain_id) { return 0; }
> +static inline int omap_start_dma_chain_transfers(int chain_id) { return 0; }
> +static inline int omap_stop_dma_chain_transfers(int chain_id) { return 0; }
> +
> +#endif /* CONFIG_COMPILE_TEST */
> +
>  #if defined(CONFIG_ARCH_OMAP1) && IS_ENABLED(CONFIG_FB_OMAP)
>  #include <mach/lcd_dma.h>
>  #else
>
Russell King - ARM Linux Sept. 9, 2014, 2:41 p.m. UTC | #2
On Tue, Sep 09, 2014 at 11:38:17AM -0300, Mauro Carvalho Chehab wrote:
> We want to be able to COMPILE_TEST the omap1_camera driver.
> It compiles fine, but it fails linkediting:
> 
> ERROR: "omap_stop_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_start_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_dma_link_lch" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_set_dma_dest_burst_mode" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_set_dma_src_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_request_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_set_dma_transfer_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_set_dma_dest_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> ERROR: "omap_free_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> 
> So, add some stub functions to avoid it.

The real answer to this is to find someone who still uses it, and convert
it to the DMA engine API.  If there's no users, the driver might as well
be killed off.
Tony Lindgren Sept. 9, 2014, 2:58 p.m. UTC | #3
* Nishanth Menon <nm@ti.com> [140909 07:40]:
> +linux-omap, tony
> -Balaji
> 
> On 09/09/2014 09:38 AM, Mauro Carvalho Chehab wrote:
> > We want to be able to COMPILE_TEST the omap1_camera driver.
> > It compiles fine, but it fails linkediting:
> > 
> > ERROR: "omap_stop_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_start_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_dma_link_lch" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_set_dma_dest_burst_mode" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_set_dma_src_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_request_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_set_dma_transfer_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_set_dma_dest_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_free_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > 
> > So, add some stub functions to avoid it.

How about just remove that old driver? I doubt it works, and I'm
almost certain nobody has actually tried to use it for many
years. At least I'm not aware of any hardware supported in the
mainline kernel with it. And we're moving things to dma engine
API anyways.

Regards,

Tony


> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> > 
> > diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
> > index 6f06f8bc612c..7c8bfdd90a33 100644
> > --- a/include/linux/omap-dma.h
> > +++ b/include/linux/omap-dma.h
> > @@ -294,43 +294,24 @@ struct omap_system_dma_plat_info {
> >  extern struct omap_system_dma_plat_info *omap_get_plat_info(void);
> >  
> >  extern void omap_set_dma_priority(int lch, int dst_port, int priority);
> > -extern int omap_request_dma(int dev_id, const char *dev_name,
> > -			void (*callback)(int lch, u16 ch_status, void *data),
> > -			void *data, int *dma_ch);
> >  extern void omap_enable_dma_irq(int ch, u16 irq_bits);
> >  extern void omap_disable_dma_irq(int ch, u16 irq_bits);
> > -extern void omap_free_dma(int ch);
> > -extern void omap_start_dma(int lch);
> > -extern void omap_stop_dma(int lch);
> > -extern void omap_set_dma_transfer_params(int lch, int data_type,
> > -					 int elem_count, int frame_count,
> > -					 int sync_mode,
> > -					 int dma_trigger, int src_or_dst_synch);
> >  extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
> >  				    u32 color);
> >  extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
> >  extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
> >  
> > -extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
> > -				    unsigned long src_start,
> > -				    int src_ei, int src_fi);
> >  extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
> >  extern void omap_set_dma_src_data_pack(int lch, int enable);
> >  extern void omap_set_dma_src_burst_mode(int lch,
> >  					enum omap_dma_burst_mode burst_mode);
> >  
> > -extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
> > -				     unsigned long dest_start,
> > -				     int dst_ei, int dst_fi);
> >  extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
> >  extern void omap_set_dma_dest_data_pack(int lch, int enable);
> > -extern void omap_set_dma_dest_burst_mode(int lch,
> > -					 enum omap_dma_burst_mode burst_mode);
> >  
> >  extern void omap_set_dma_params(int lch,
> >  				struct omap_dma_channel_params *params);
> >  
> > -extern void omap_dma_link_lch(int lch_head, int lch_queue);
> >  extern void omap_dma_unlink_lch(int lch_head, int lch_queue);
> >  
> >  extern int omap_set_dma_callback(int lch,
> > @@ -356,18 +337,9 @@ extern void omap_dma_disable_irq(int lch);
> >  
> >  /* Chaining APIs */
> >  #ifndef CONFIG_ARCH_OMAP1
> > -extern int omap_request_dma_chain(int dev_id, const char *dev_name,
> > -				  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);
> > -extern int omap_free_dma_chain(int chain_id);
> >  extern int omap_dma_chain_a_transfer(int chain_id, int src_start,
> >  				     int dest_start, int elem_count,
> >  				     int frame_count, void *callbk_data);
> > -extern int omap_start_dma_chain_transfers(int chain_id);
> > -extern int omap_stop_dma_chain_transfers(int chain_id);
> >  extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
> >  extern int omap_get_dma_chain_dst_pos(int chain_id);
> >  extern int omap_get_dma_chain_src_pos(int chain_id);
> > @@ -377,6 +349,87 @@ extern int omap_modify_dma_chain_params(int chain_id,
> >  extern int omap_dma_chain_status(int chain_id);
> >  #endif
> >  
> > +#ifndef CONFIG_COMPILE_TEST
> > +extern int omap_request_dma(int dev_id, const char *dev_name,
> > +			void (*callback)(int lch, u16 ch_status, void *data),
> > +			void *data, int *dma_ch);
> > +extern void omap_free_dma(int ch);
> > +extern void omap_start_dma(int lch);
> > +extern void omap_stop_dma(int lch);
> > +extern void omap_set_dma_transfer_params(int lch, int data_type,
> > +					 int elem_count, int frame_count,
> > +					 int sync_mode,
> > +					 int dma_trigger, int src_or_dst_synch);
> > +extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
> > +				    unsigned long src_start,
> > +				    int src_ei, int src_fi);
> > +extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
> > +				     unsigned long dest_start,
> > +				     int dst_ei, int dst_fi);
> > +extern void omap_set_dma_dest_burst_mode(int lch,
> > +					 enum omap_dma_burst_mode burst_mode);
> > +extern void omap_dma_link_lch(int lch_head, int lch_queue);
> > +
> > +#ifndef CONFIG_ARCH_OMAP1
> > +extern int omap_request_dma_chain(int dev_id, const char *dev_name,
> > +				  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);
> > +extern int omap_free_dma_chain(int chain_id);
> > +extern int omap_start_dma_chain_transfers(int chain_id);
> > +extern int omap_stop_dma_chain_transfers(int chain_id);
> > +#endif /* CONFIG_ARCH_OMAP1 */
> > +#else
> > +	/* Stubs for compile testing some drivers on other archs */
> > +
> > +static inline
> > +int omap_request_dma(int dev_id, const char *dev_name,
> > +		     void (*callback)(int lch, u16 ch_status, void *data),
> > +		     void *data, int *dma_ch) { return 0; }
> > +
> > +static inline void omap_free_dma(int ch) {}
> > +static inline void omap_start_dma(int lch) {}
> > +static inline void omap_stop_dma(int lch) {}
> > +
> > +static inline
> > +void omap_set_dma_transfer_params(int lch, int data_type,
> > +				  int elem_count, int frame_count,
> > +				  int sync_mode,
> > +				  int dma_trigger, int src_or_dst_synch) {}
> > +
> > +static inline
> > +void omap_set_dma_src_params(int lch, int src_port, int src_amode,
> > +			     unsigned long src_start,
> > +			     int src_ei, int src_fi) {}
> > +
> > +static inline
> > +void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
> > +			      unsigned long dest_start,
> > +			      int dst_ei, int dst_fi) {}
> > +
> > +static inline
> > +void omap_set_dma_dest_burst_mode(int lch,
> > +				  enum omap_dma_burst_mode burst_mode) {}
> > +
> > +static inline
> > +void omap_dma_link_lch(int lch_head, int lch_queue) {}
> > +
> > +static inline
> > +int omap_request_dma_chain(int dev_id, const char *dev_name,
> > +			   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) { return 0; }
> > +
> > +static inline int omap_free_dma_chain(int chain_id) { return 0; }
> > +static inline int omap_start_dma_chain_transfers(int chain_id) { return 0; }
> > +static inline int omap_stop_dma_chain_transfers(int chain_id) { return 0; }
> > +
> > +#endif /* CONFIG_COMPILE_TEST */
> > +
> >  #if defined(CONFIG_ARCH_OMAP1) && IS_ENABLED(CONFIG_FB_OMAP)
> >  #include <mach/lcd_dma.h>
> >  #else
> > 
> 
> 
> -- 
> Regards,
> Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mauro Carvalho Chehab Sept. 9, 2014, 3:36 p.m. UTC | #4
Em Tue, 9 Sep 2014 15:41:58 +0100
Russell King - ARM Linux <linux@arm.linux.org.uk> escreveu:

> On Tue, Sep 09, 2014 at 11:38:17AM -0300, Mauro Carvalho Chehab wrote:
> > We want to be able to COMPILE_TEST the omap1_camera driver.
> > It compiles fine, but it fails linkediting:
> > 
> > ERROR: "omap_stop_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_start_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_dma_link_lch" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_set_dma_dest_burst_mode" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_set_dma_src_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_request_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_set_dma_transfer_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_set_dma_dest_params" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > ERROR: "omap_free_dma" [drivers/media/platform/soc_camera/omap1_camera.ko] undefined!
> > 
> > So, add some stub functions to avoid it.
> 
> The real answer to this is to find someone who still uses it, and convert
> it to the DMA engine API.  If there's no users, the driver might as well
> be killed off.

Hmm... it seems that there are still several drivers still relying on
the functions declared at: omap-dma.h:

$ grep extern include/linux/omap-dma.h |perl -ne 'print "$1\n" if (m/extern\s\S+\s(.*)\(/)' >funcs && git grep -f funcs -l
arch/arm/mach-omap1/pm.c
arch/arm/mach-omap2/pm24xx.c
arch/arm/plat-omap/dma.c
drivers/dma/omap-dma.c
drivers/media/platform/omap/omap_vout_vrfb.c
drivers/media/platform/omap3isp/isphist.c
drivers/media/platform/soc_camera/omap1_camera.c
drivers/mtd/onenand/omap2.c
drivers/usb/gadget/udc/omap_udc.c
drivers/usb/musb/tusb6010_omap.c
drivers/video/fbdev/omap/omapfb_main.c
include/linux/omap-dma.h

Perhaps we can remove the header and mark all the above as BROKEN.

If nobody fixes, we can strip all of them from the Kernel.

Regards,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Russell King - ARM Linux Sept. 11, 2014, 10:45 a.m. UTC | #5
On Tue, Sep 09, 2014 at 12:36:54PM -0300, Mauro Carvalho Chehab wrote:
> Hmm... it seems that there are still several drivers still relying on
> the functions declared at: omap-dma.h:
> 
> $ grep extern include/linux/omap-dma.h |perl -ne 'print "$1\n" if (m/extern\s\S+\s(.*)\(/)' >funcs && git grep -f funcs -l
> arch/arm/mach-omap1/pm.c
> arch/arm/mach-omap2/pm24xx.c
> arch/arm/plat-omap/dma.c
> drivers/dma/omap-dma.c
> drivers/media/platform/omap/omap_vout_vrfb.c
> drivers/media/platform/omap3isp/isphist.c
> drivers/media/platform/soc_camera/omap1_camera.c
> drivers/mtd/onenand/omap2.c
> drivers/usb/gadget/udc/omap_udc.c
> drivers/usb/musb/tusb6010_omap.c
> drivers/video/fbdev/omap/omapfb_main.c
> include/linux/omap-dma.h
> 
> Perhaps we can remove the header and mark all the above as BROKEN.

Not quite.  You'll notice that drivers/dma/omap-dma.c appears in that
list.  That is because right now, the new code has to co-operate with
the old legacy code to ensure that both do not try and operate on the
same hardware channel simultaneously.

Right now, when anyone tries to use any of the drivers using the legacy
APIs, they will get a warning printed in their kernel message log.  This
is part of my attempt to try and find out:

(a) whether anyone is using these drivers
(b) whether we can delete these drivers

That warning has not been in the kernel long enough to be certain of
anything - it was merged during the last merge window (despite me
having it ready to go since the previous merge window, it would not
have been correct to introduce a new warning during the -rc period.)

What I recommend is that you just don't mark the OMAP drivers for
compile testing right now, especially as their future is rather
uncertain.
diff mbox

Patch

diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
index 6f06f8bc612c..7c8bfdd90a33 100644
--- a/include/linux/omap-dma.h
+++ b/include/linux/omap-dma.h
@@ -294,43 +294,24 @@  struct omap_system_dma_plat_info {
 extern struct omap_system_dma_plat_info *omap_get_plat_info(void);
 
 extern void omap_set_dma_priority(int lch, int dst_port, int priority);
-extern int omap_request_dma(int dev_id, const char *dev_name,
-			void (*callback)(int lch, u16 ch_status, void *data),
-			void *data, int *dma_ch);
 extern void omap_enable_dma_irq(int ch, u16 irq_bits);
 extern void omap_disable_dma_irq(int ch, u16 irq_bits);
-extern void omap_free_dma(int ch);
-extern void omap_start_dma(int lch);
-extern void omap_stop_dma(int lch);
-extern void omap_set_dma_transfer_params(int lch, int data_type,
-					 int elem_count, int frame_count,
-					 int sync_mode,
-					 int dma_trigger, int src_or_dst_synch);
 extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
 				    u32 color);
 extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
 extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
 
-extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
-				    unsigned long src_start,
-				    int src_ei, int src_fi);
 extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
 extern void omap_set_dma_src_data_pack(int lch, int enable);
 extern void omap_set_dma_src_burst_mode(int lch,
 					enum omap_dma_burst_mode burst_mode);
 
-extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
-				     unsigned long dest_start,
-				     int dst_ei, int dst_fi);
 extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
 extern void omap_set_dma_dest_data_pack(int lch, int enable);
-extern void omap_set_dma_dest_burst_mode(int lch,
-					 enum omap_dma_burst_mode burst_mode);
 
 extern void omap_set_dma_params(int lch,
 				struct omap_dma_channel_params *params);
 
-extern void omap_dma_link_lch(int lch_head, int lch_queue);
 extern void omap_dma_unlink_lch(int lch_head, int lch_queue);
 
 extern int omap_set_dma_callback(int lch,
@@ -356,18 +337,9 @@  extern void omap_dma_disable_irq(int lch);
 
 /* Chaining APIs */
 #ifndef CONFIG_ARCH_OMAP1
-extern int omap_request_dma_chain(int dev_id, const char *dev_name,
-				  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);
-extern int omap_free_dma_chain(int chain_id);
 extern int omap_dma_chain_a_transfer(int chain_id, int src_start,
 				     int dest_start, int elem_count,
 				     int frame_count, void *callbk_data);
-extern int omap_start_dma_chain_transfers(int chain_id);
-extern int omap_stop_dma_chain_transfers(int chain_id);
 extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
 extern int omap_get_dma_chain_dst_pos(int chain_id);
 extern int omap_get_dma_chain_src_pos(int chain_id);
@@ -377,6 +349,87 @@  extern int omap_modify_dma_chain_params(int chain_id,
 extern int omap_dma_chain_status(int chain_id);
 #endif
 
+#ifndef CONFIG_COMPILE_TEST
+extern int omap_request_dma(int dev_id, const char *dev_name,
+			void (*callback)(int lch, u16 ch_status, void *data),
+			void *data, int *dma_ch);
+extern void omap_free_dma(int ch);
+extern void omap_start_dma(int lch);
+extern void omap_stop_dma(int lch);
+extern void omap_set_dma_transfer_params(int lch, int data_type,
+					 int elem_count, int frame_count,
+					 int sync_mode,
+					 int dma_trigger, int src_or_dst_synch);
+extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
+				    unsigned long src_start,
+				    int src_ei, int src_fi);
+extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
+				     unsigned long dest_start,
+				     int dst_ei, int dst_fi);
+extern void omap_set_dma_dest_burst_mode(int lch,
+					 enum omap_dma_burst_mode burst_mode);
+extern void omap_dma_link_lch(int lch_head, int lch_queue);
+
+#ifndef CONFIG_ARCH_OMAP1
+extern int omap_request_dma_chain(int dev_id, const char *dev_name,
+				  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);
+extern int omap_free_dma_chain(int chain_id);
+extern int omap_start_dma_chain_transfers(int chain_id);
+extern int omap_stop_dma_chain_transfers(int chain_id);
+#endif /* CONFIG_ARCH_OMAP1 */
+#else
+	/* Stubs for compile testing some drivers on other archs */
+
+static inline
+int omap_request_dma(int dev_id, const char *dev_name,
+		     void (*callback)(int lch, u16 ch_status, void *data),
+		     void *data, int *dma_ch) { return 0; }
+
+static inline void omap_free_dma(int ch) {}
+static inline void omap_start_dma(int lch) {}
+static inline void omap_stop_dma(int lch) {}
+
+static inline
+void omap_set_dma_transfer_params(int lch, int data_type,
+				  int elem_count, int frame_count,
+				  int sync_mode,
+				  int dma_trigger, int src_or_dst_synch) {}
+
+static inline
+void omap_set_dma_src_params(int lch, int src_port, int src_amode,
+			     unsigned long src_start,
+			     int src_ei, int src_fi) {}
+
+static inline
+void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
+			      unsigned long dest_start,
+			      int dst_ei, int dst_fi) {}
+
+static inline
+void omap_set_dma_dest_burst_mode(int lch,
+				  enum omap_dma_burst_mode burst_mode) {}
+
+static inline
+void omap_dma_link_lch(int lch_head, int lch_queue) {}
+
+static inline
+int omap_request_dma_chain(int dev_id, const char *dev_name,
+			   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) { return 0; }
+
+static inline int omap_free_dma_chain(int chain_id) { return 0; }
+static inline int omap_start_dma_chain_transfers(int chain_id) { return 0; }
+static inline int omap_stop_dma_chain_transfers(int chain_id) { return 0; }
+
+#endif /* CONFIG_COMPILE_TEST */
+
 #if defined(CONFIG_ARCH_OMAP1) && IS_ENABLED(CONFIG_FB_OMAP)
 #include <mach/lcd_dma.h>
 #else