Skip to contentSkip to conversation

linux-next: build failure after merge of the v4l-dvb tree

PATCH In review Stephen Rothwell 13 participants 28 messages Sep 9, 2014 – Sep 17, 2014

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

Hi Mauro,

After merging the v4l-dvb tree, today's linux-next build (x86_64 allmodconfig) failed like this:

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!
ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!
ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_display.ko] undefined!
ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_capture.ko] undefined!

I have used the v4l-dvb tree from next-20140908 for today.

There were also lots of new warnings like:

drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function 's5p_mfc_get_crop_info_h_v6':
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:2039:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(unsigned int) ctx->dev->mfc_regs->d_display_crop_info1);
^

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#1 lore raw

Hi Stephen,

Em Tue, 9 Sep 2014 12:43:06 +1000
Stephen Rothwell <[email protected]> escreveu:

Quoted 5 lines

Hi Mauro,

After merging the v4l-dvb tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Quoted 13 lines

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!
ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!
ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_display.ko] undefined!
ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_capture.ko] undefined!

Yeah, there are several drivers that are now enabled with COMPILE_TEST.

Not sure what's the best thing to do with those errors. Perhaps I should add some stub functions for those drivers to not complain about linking issues if COMPILE_TEST.

Quoted 10 lines

I have used the v4l-dvb tree from next-20140908 for today.

There were also lots of new warnings like:

drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function 's5p_mfc_get_crop_info_h_v6':
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:2039:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

   (unsigned int) ctx->dev->mfc_regs->d_display_crop_info1);
   ^

Those warnings are harmless in practice, but they should be fixed.

I'll be handling them before the next merge window.

Regards,
Mauro

#2 lore raw

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

In reply to Stephen Rothwell

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.

include/linux/omap-dma.h +81 -28
index 6f06f8bc612c..7c8bfdd90a33 100644
@@ -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
Signature · 1 line
1.9.3
#3 lore raw

PATCH 2/3 s5p-jpeg: Fix compilation with COMPILE_TEST

ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!

Yet, it sounds a bad idea to use ndelay to wait for 100 us for the device to reset.

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +2 -0
index e51c078360f5..01eeacf28843 100644
@@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base)
 	reg = readl(base + EXYNOS4_JPEG_CNTL_REG);
 	writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 
+#ifndef CONFIG_COMPILE_TEST
 	ndelay(100000);
+#endif
 
 	writel(reg | EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 }
Signature · 1 line
1.9.3
#4 lore raw

Re: [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST

Quoted 13 lines · Mauro Carvalho Chehab

ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!

Yet, it sounds a bad idea to use ndelay to wait for 100 us for the device to reset.

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +0 -0
index e51c078360f5..01eeacf28843 100644

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c void exynos4_jpeg_sw_reset(void __iomem *base) · line 28

Quoted 6 lines
drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +2 -0
@@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base)
 	reg = readl(base + EXYNOS4_JPEG_CNTL_REG);
 	writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 
+#ifndef CONFIG_COMPILE_TEST
 	ndelay(100000);
+#endif

Wouldn't be a better fix to replace ndelay(100000); with udelay(100), rather than sticking in a not so pretty #ifndef ?

I guess usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held.

--
Regards,
Sylwester

#5 lore raw

Re: [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST

Em Tue, 09 Sep 2014 16:58:58 +0200
Sylwester Nawrocki <[email protected]> escreveu:

Quoted 17 lines · Mauro Carvalho Chehab
Quoted 16 lines

ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!

Yet, it sounds a bad idea to use ndelay to wait for 100 us for the device to reset.

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +0 -0
index e51c078360f5..01eeacf28843 100644
@@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base)
 	reg = readl(base + EXYNOS4_JPEG_CNTL_REG);
 	writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 
Quoted 6 lines

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c void exynos4_jpeg_sw_reset(void __iomem *base) · line 28

Quoted 3 lines
drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +2 -0
+#ifndef CONFIG_COMPILE_TEST
 	ndelay(100000);
+#endif

Wouldn't be a better fix to replace ndelay(100000); with udelay(100), rather than sticking in a not so pretty #ifndef ?

Works for me. I'll submit a new version.

Quoted 2 lines

I guess usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held.

Ok.

Regards,
Mauro

#6 lore raw

Re: [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST

Hi Mauro, Sylwester,

Quoted 27 lines · Mauro Carvalho Chehab

Em Tue, 09 Sep 2014 16:58:58 +0200
Sylwester Nawrocki <[email protected]> escreveu:

Quoted 17 lines · Mauro Carvalho Chehab
Quoted 16 lines

ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!

Yet, it sounds a bad idea to use ndelay to wait for 100 us for the device to reset.

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +0 -0
index e51c078360f5..01eeacf28843 100644
@@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base)
  	reg = readl(base + EXYNOS4_JPEG_CNTL_REG);
  	writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 
Quoted 6 lines

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c void exynos4_jpeg_sw_reset(void __iomem *base) · line 28

Quoted 3 lines
drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +2 -0
+#ifndef CONFIG_COMPILE_TEST
  	ndelay(100000);
+#endif

Wouldn't be a better fix to replace ndelay(100000); with udelay(100), rather than sticking in a not so pretty #ifndef ?

Quoted 6 lines

Works for me. I'll submit a new version.

Quoted 2 lines

I guess usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held.

Ok.

Within few days I will perform some hardware tests, to verify if there is more room for improvement here.

Best Regards,
Jacek Anaszewski

#7 lore raw

PATCH v2 2/3 s5p-jpeg: Fix compilation with COMPILE_TEST

ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!

That happens because asm-generic doesn't like any ndelay time bigger than 20us.

Currently, usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held.

So, let's use ndelay() instead.

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +1 -1
index e51c078360f5..ab6d6f43c96f 100644
@@ -23,7 +23,7 @@ void exynos4_jpeg_sw_reset(void __iomem *base)
 	reg = readl(base + EXYNOS4_JPEG_CNTL_REG);
 	writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 
-	ndelay(100000);
+	udelay(100);
 
 	writel(reg | EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 }
Acked-by on v2 2/3
#8 lore raw

Re: [PATCHv2 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST

Quoted 5 lines · Mauro Carvalho Chehab

ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!

That happens because asm-generic doesn't like any ndelay time bigger than 20us.

Quoted 7 lines

Currently, usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held.

So, let's use ndelay() instead.

--
Thanks,
Sylwester

#9 lore raw

Re: [PATCHv2 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST

In reply to Mauro Carvalho Chehab
Quoted 9 lines · Mauro Carvalho Chehab

ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!

That happens because asm-generic doesn't like any ndelay time bigger than 20us.

Currently, usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held.

So, let's use ndelay() instead.

You meant 'udelay() instead'.

#10 lore raw

Re: [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST

In reply to Mauro Carvalho Chehab
Quoted 8 lines · On Tuesday 09 September 2014 12:09:36 Mauro Carvalho Chehab wrote:

-exynos4.c

Quoted 7 lines
Quoted 7 lines

index e51c078360f5..01eeacf28843 100644

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +0 -0
@@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base)
    reg = readl(base + EXYNOS4_JPEG_CNTL_REG);
    writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 
Quoted 8 lines
Quoted 6 lines

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c void exynos4_jpeg_sw_reset(void __iomem *base) · line 28

Quoted 3 lines
drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +2 -0
+#ifndef CONFIG_COMPILE_TEST
    ndelay(100000);
+#endif

Wouldn't be a better fix to replace ndelay(100000); with udelay(100), rather than sticking in a not so pretty #ifndef ?

Works for me. I'll submit a new version.

New version looks good to me. On a more general level, I would argue that we should not disable code based on COMPILE_TEST. The typical use of this symbol is to make it possible to compile more code, not to change the behavior of code on machines that were able to build it already.

Arnd

#11 lore raw

Re: [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST

Em Tue, 09 Sep 2014 19:54:19 +0200
Arnd Bergmann <[email protected]> escreveu:

Quoted 16 lines · On Tuesday 09 September 2014 12:09:36 Mauro Carvalho Chehab wrote:
Quoted 15 lines

-exynos4.c

Quoted 13 lines

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c void exynos4_jpeg_sw_reset(void __iomem *base) · line 28

Quoted 10 lines

index e51c078360f5..01eeacf28843 100644

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +2 -0
@@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base)
    reg = readl(base + EXYNOS4_JPEG_CNTL_REG);
    writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 
+#ifndef CONFIG_COMPILE_TEST
    ndelay(100000);
+#endif

Wouldn't be a better fix to replace ndelay(100000); with udelay(100), rather than sticking in a not so pretty #ifndef ?

Quoted 7 lines
Quoted 1 line

Works for me. I'll submit a new version.

New version looks good to me. On a more general level, I would argue that we should not disable code based on COMPILE_TEST. The typical use of this symbol is to make it possible to compile more code, not to change the behavior of code on machines that were able to build it already.

Yeah, agreed as a general concept. In this case, however, it were causing a compilation breakage on X86 (as it generates a non-existing _bad_ndelay() symbol, if the time is bigger than 20000). See include/asm-generic/delay.h.

Btw, I suspect that the only reason why ndelay(100000) causes a compilation breakage is to avoid a big number, as the maximum limit check ndelay() code (20000) at asm-generic is identical to the one for udelay(). So, for ndelay, it means 20us, while, for udelay, it means 20ms. Even so, both calls the very same implementation code.

Perhaps we should fix it, for both to accept a maximum time of 20ms.

Regards,
Mauro

#12 lore raw

PATCH 3/3 vpif: Fix compilation with allmodconfig

In reply to Mauro Carvalho Chehab

When vpif is compiled as module, those errors happen:

ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_display.ko] undefined!
ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_capture.ko] undefined!

That's because vpif_lock symbol is not exported.

drivers/media/platform/davinci/vpif.c +1 -0
index cd08e5248387..3dad5bd7fe0a 100644
@@ -38,6 +38,7 @@ MODULE_LICENSE("GPL");
 #define VPIF_CH3_MAX_MODES	2
 
 spinlock_t vpif_lock;
+EXPORT_SYMBOL_GPL(vpif_lock);
 
 void __iomem *vpif_base;
 EXPORT_SYMBOL_GPL(vpif_base);
Signature · 1 line
1.9.3
Acked-by on v1 3/3
#13 lore raw

Re: [PATCH 3/3] [media] vpif: Fix compilation with allmodconfig

Quoted 7 lines · Mauro Carvalho Chehab

When vpif is compiled as module, those errors happen:

ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_display.ko] undefined!
ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_capture.ko] undefined!

That's because vpif_lock symbol is not exported.

Regards,
--Prabhakar Lad

Quoted 18 lines
drivers/media/platform/davinci/vpif.c +1 -1
index cd08e5248387..3dad5bd7fe0a 100644
@@ -38,6 +38,7 @@ MODULE_LICENSE("GPL");
 #define VPIF_CH3_MAX_MODES     2
 
 spinlock_t vpif_lock;
+EXPORT_SYMBOL_GPL(vpif_lock);
 
 void __iomem *vpif_base;
 EXPORT_SYMBOL_GPL(vpif_base);
--

1.9.3

#14 lore raw

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

In reply to Mauro Carvalho Chehab

+linux-omap, tony
-Balaji

Quoted 174 lines · Mauro Carvalho Chehab

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.

include/linux/omap-dma.h +81 -28
index 6f06f8bc612c..7c8bfdd90a33 100644
@@ -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
Signature · 2 lines
Regards,
Nishanth Menon
maintainer
#15 lore raw

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

Quoted 17 lines · Nishanth Menon
(quoted diff) +1 -1
+linux-omap, tony
-Balaji
Quoted 13 lines · Mauro Carvalho Chehab

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!

Quoted 1 line
Quoted 1 line

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

Quoted 164 lines
Quoted 159 lines
include/linux/omap-dma.h +81 -28
index 6f06f8bc612c..7c8bfdd90a33 100644
@@ -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
Signature · 2 lines
Regards,
Nishanth Menon
#16 lore raw

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

In reply to Mauro Carvalho Chehab
Quoted 13 lines · Mauro Carvalho Chehab

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!

Quoted 1 line

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.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
#17 lore raw

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

Em Tue, 9 Sep 2014 15:41:58 +0100
Russell King - ARM Linux <[email protected]> escreveu:

Quoted 14 lines · Mauro Carvalho Chehab
Quoted 13 lines

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!

Quoted 5 lines
Quoted 1 line

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

#18 lore raw

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

Em Tue, 09 Sep 2014 12:36:54 -0300
Mauro Carvalho Chehab <[email protected]> escreveu:

Quoted 40 lines

Em Tue, 9 Sep 2014 15:41:58 +0100
Russell King - ARM Linux <[email protected]> escreveu:

Quoted 14 lines · Mauro Carvalho Chehab
Quoted 13 lines

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!

Quoted 5 lines
Quoted 1 line

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
Quoted 3 lines

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.

Are all the functions declared at omap-dma.h part of the old DMA API that should be deprecated?

If so, it seems that the OMAP2 and OMAP3 also depends on this thing, as all the PM code for OMAP depends on the functions declared inside omap-dma.h, and marking them as BROKEN causes compilation to failure:

arch/arm/mach-omap2/built-in.o: In function `omap3_save_scratchpad_contents':
:(.text+0x798): undefined reference to `omap3_restore_3630'
:(.text+0x7a8): undefined reference to `omap3_restore'
:(.text+0x7ac): undefined reference to omap3_restore_es3' arch/arm/mach-omap2/built-in.o: In function omap3_sram_restore_context':
:(.text+0x925c): undefined reference to omap_push_sram_idle' arch/arm/mach-omap2/built-in.o: In function option_set':
:(.text+0xc15c): undefined reference to omap3_pm_off_mode_enable' arch/arm/mach-omap2/built-in.o: In function pwrdm_suspend_set':
:(.text+0xc1a0): undefined reference to omap3_pm_set_suspend_state' arch/arm/mach-omap2/built-in.o: In function pwrdm_suspend_get':
:(.text+0xc1e4): undefined reference to omap3_pm_get_suspend_state' arch/arm/mach-omap2/built-in.o: In function omap3_enter_idle_bm':
:(.text+0xc7ec): undefined reference to `omap_sram_idle'
:(.text+0xc848): undefined reference to `pm34xx_errata'
arch/arm/mach-omap2/built-in.o: In function `omap2420_init_late':
:(.init.text+0xf64): undefined reference to omap2_pm_init' arch/arm/mach-omap2/built-in.o: In function omap2430_init_late':
:(.init.text+0x1024): undefined reference to omap2_pm_init' arch/arm/mach-omap2/built-in.o: In function omap3_init_late':
:(.init.text+0x1248): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o: In function omap3430_init_late':
:(.init.text+0x1264): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o: In function omap35xx_init_late':
:(.init.text+0x1280): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o: In function omap3630_init_late':
:(.init.text+0x129c): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o: In function am35xx_init_late':
:(.init.text+0x12b8): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o::(.init.text+0x12d4): more undefined references to omap3_pm_init' follow

This was compiled with allmodconfig on arm, with COMPILE_TEST disabled (a few sub-archs disabled too), to avoid spurious unrelated compilation issues).

Am I missing something?

BTW, CONFIG_PM is auto-selected by ARCH_OMAP3.

And those are the functions that the OMAP3 code uses from omap-dma.h:

arch/arm/mach-omap2/pm34xx.c:92:2: error: implicit declaration of function ‘omap_dma_global_context_save’ [-Werror=implicit-function-declaration] arch/arm/mach-omap2/pm34xx.c:103:2: error: implicit declaration of function ‘omap_dma_global_context_restore’ [-Werror=implicit-function-declaration] arch/arm/mach-omap2/pm24xx.c:170:2: error: implicit declaration of function ‘omap_dma_running’ [-Werror=implicit-function-declaration]

Just enabling this won't work, as the code at arch/arm/plat-omap/dma.c depends on several other functions inside omap-dma.h.

Regards,
Mauro

-

From: Mauro Carvalho Chehab <[email protected]>
Subject: [PATCH] omap-dma: remove deprecated omap-dma.h API

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!

That's because OMAP1 is using a legacy deprecated API. Instead of fixing it, the right thing to do is to convert the remaining OMAP drivers that use the legacy API to the standard DMA API.

While this doesn't happen, let's mark the broken stuff with BROKEN.

include/linux/omap-dma.h +8 -0
index 6f06f8bc612c..2f19292d1e78 100644
@@ -291,6 +291,12 @@ struct omap_system_dma_plat_info {
 #define dma_omap15xx()	__dma_omap15xx(d)
 #define dma_omap16xx()	__dma_omap16xx(d)
 
+#ifdef CONFIG_BROKEN
+
+/*
+ * Deprecated non-standard DMA API.
+ */
+
 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);
@@ -377,6 +383,8 @@ extern int omap_modify_dma_chain_params(int chain_id,
 extern int omap_dma_chain_status(int chain_id);
 #endif
 
+#endif /* CONFIG_BROKEN */
+
 #if defined(CONFIG_ARCH_OMAP1) && IS_ENABLED(CONFIG_FB_OMAP)
 #include <mach/lcd_dma.h>
 #else
arch/arm/mach-omap1/Kconfig +5 -0
index cdd05f2e67ee..c5dbcebd8fdc 100644
@@ -34,6 +34,11 @@ config ARCH_OMAP16XX
 comment "OMAP Board Type"
 	depends on ARCH_OMAP1
 
+config OMAP1_PM
+	tristate
+	depends on PM
+	depends on BROKEN
+
 config MACH_OMAP_INNOVATOR
 	bool "TI Innovator"
 	depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX)
arch/arm/mach-omap1/Makefile +1 -1
index 3889b6cd211e..4a80fcd9528e 100644
@@ -17,7 +17,7 @@ obj-$(CONFIG_OMAP_32K_TIMER)	+= timer32k.o
 obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
 
 # Power Management
-obj-$(CONFIG_PM) += pm.o sleep.o
+obj-$(CONFIG_OMAP1_PM) += pm.o sleep.o
 
 i2c-omap-$(CONFIG_I2C_OMAP)		:= i2c.o
 obj-y					+= $(i2c-omap-m) $(i2c-omap-y)
arch/arm/mach-omap2/Kconfig +10 -0
index e7189dcc9309..8a670f374638 100644
@@ -11,6 +11,16 @@ config ARCH_OMAP2
 	select CPU_V6
 	select SOC_HAS_OMAP2_SDRC
 
+config OMAP2_PM24XX
+	bool
+	depends on ARCH_OMAP2
+	depends on BROKEN
+
+config OMAP2_PM34XX
+	bool
+	depends on ARCH_OMAP3
+	depends on BROKEN
+
 config ARCH_OMAP3
 	bool "TI OMAP3"
 	depends on ARCH_MULTI_V7
arch/arm/mach-omap2/Makefile +3 -3
index 69bbcba8842f..9b88e8083b22 100644
@@ -84,9 +84,9 @@ endif
 obj-$(CONFIG_OMAP_PM_NOOP)		+= omap-pm-noop.o
 
 ifeq ($(CONFIG_PM),y)
-obj-$(CONFIG_ARCH_OMAP2)		+= pm24xx.o
-obj-$(CONFIG_ARCH_OMAP2)		+= sleep24xx.o
-obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o
+obj-$(CONFIG_OMAP2_PM24XX)		+= pm24xx.o
+obj-$(CONFIG_OMAP2_PM24XX)		+= sleep24xx.o
+obj-$(CONFIG_OMAP3_PM34XX)		+= pm34xx.o sleep34xx.o
 obj-$(CONFIG_ARCH_OMAP4)		+= pm44xx.o omap-mpuss-lowpower.o
 obj-$(CONFIG_SOC_OMAP5)			+= omap-mpuss-lowpower.o
 obj-$(CONFIG_SOC_DRA7XX)		+= omap-mpuss-lowpower.o
arch/arm/plat-omap/Makefile +2 -1
index 0b01b68fd033..07c45d60a026 100644
@@ -5,7 +5,8 @@
 ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include
 
 # Common support
-obj-y := sram.o dma.o counter_32k.o
+obj-y := sram.o counter_32k.o
+obj-$(CONFIG_BROKEN) := dma.o
 obj-m :=
 obj-n :=
 obj-  :=
drivers/dma/Kconfig +1 -0
index 9b1ea0ef59af..8f297523ba0f 100644
@@ -321,6 +321,7 @@ config MMP_TDMA
 config DMA_OMAP
 	tristate "OMAP DMA support"
 	depends on ARCH_OMAP
+	depends on BROKEN
 	select DMA_ENGINE
 	select DMA_VIRTUAL_CHANNELS
 
drivers/media/platform/Kconfig +1 -0
index bee9074ebc13..63a87448ac83 100644
@@ -97,6 +97,7 @@ config VIDEO_OMAP3
 	tristate "OMAP 3 Camera support"
 	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && ARCH_OMAP3
 	depends on HAS_DMA
+	depends on BROKEN
 	select ARM_DMA_USE_IOMMU
 	select OMAP_IOMMU
 	select VIDEOBUF2_DMA_CONTIG
drivers/media/platform/omap/Kconfig +1 -0
index 05de442d24e4..d4a3c6170907 100644
@@ -4,6 +4,7 @@ config VIDEO_OMAP2_VOUT_VRFB
 config VIDEO_OMAP2_VOUT
 	tristate "OMAP2/OMAP3 V4L2-Display driver"
 	depends on ARCH_OMAP2 || ARCH_OMAP3 || (COMPILE_TEST && HAS_MMU)
+	depends on BROKEN
 	select VIDEOBUF_GEN
 	select VIDEOBUF_DMA_CONTIG
 	select OMAP2_DSS if HAS_IOMEM && ARCH_OMAP2PLUS
drivers/media/platform/soc_camera/Kconfig +1 -0
index 6af6c6dccda8..52afbdd2b915 100644
@@ -65,6 +65,7 @@ config VIDEO_OMAP1
 	depends on VIDEO_DEV && SOC_CAMERA
 	depends on ARCH_OMAP1 || COMPILE_TEST
 	depends on HAS_DMA
+	depends on BROKEN
 	select VIDEOBUF_DMA_CONTIG
 	select VIDEOBUF_DMA_SG
 	---help---
drivers/mtd/onenand/Kconfig +1 -0
index dcae2f6a2b11..2155c081e7ea 100644
@@ -26,6 +26,7 @@ config MTD_ONENAND_GENERIC
 config MTD_ONENAND_OMAP2
 	tristate "OneNAND on OMAP2/OMAP3 support"
 	depends on ARCH_OMAP2 || ARCH_OMAP3
+	depends on BROKEN
 	help
 	  Support for a OneNAND flash device connected to an OMAP2/OMAP3 CPU
 	  via the GPMC memory controller.
drivers/usb/gadget/udc/Kconfig +5 -0
index 5151f947a4f5..66216d1e3c22 100644
@@ -29,6 +29,11 @@ menu "USB Peripheral Controller"
 # Integrated controllers
 #
 
+config UDC_OMAP
+	tristate
+	depends on USB_OMAP
+	depends on BROKEN
+
 config USB_AT91
 	tristate "Atmel AT91 USB Device Port"
 	depends on ARCH_AT91
drivers/usb/gadget/udc/Makefile +1 -1
index 4096122bb283..9b14964adccd 100644
@@ -9,7 +9,7 @@ obj-$(CONFIG_USB_AMD5536UDC)	+= amd5536udc.o
 obj-$(CONFIG_USB_PXA25X)	+= pxa25x_udc.o
 obj-$(CONFIG_USB_PXA27X)	+= pxa27x_udc.o
 obj-$(CONFIG_USB_GOKU)		+= goku_udc.o
-obj-$(CONFIG_USB_OMAP)		+= omap_udc.o
+obj-$(CONFIG_UDC_OMAP)		+= omap_udc.o
 obj-$(CONFIG_USB_S3C2410)	+= s3c2410_udc.o
 obj-$(CONFIG_USB_AT91)		+= at91_udc.o
 obj-$(CONFIG_USB_ATMEL_USBA)	+= atmel_usba_udc.o
drivers/usb/musb/Kconfig +1 -0
index 06cc5d6ea681..13c3e3767938 100644
@@ -147,6 +147,7 @@ config USB_TUSB_OMAP_DMA
 	bool 'TUSB 6010'
 	depends on USB_MUSB_TUSB6010 = USB_MUSB_HDRC # both built-in or both modules
 	depends on ARCH_OMAP
+	depends on BROKEN
 	help
 	  Enable DMA transfers on TUSB 6010 when OMAP DMA is available.
 
drivers/video/fbdev/omap/Kconfig +1 -0
index 18c4cb0d5690..c0a6d208c6e3 100644
@@ -2,6 +2,7 @@ config FB_OMAP
 	tristate "OMAP frame buffer support"
 	depends on FB
 	depends on ARCH_OMAP1
+	depends on BROKEN
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
maintainer
#19 lore raw

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

Quoted 44 lines · Mauro Carvalho Chehab

Em Tue, 09 Sep 2014 12:36:54 -0300
Mauro Carvalho Chehab <[email protected]> escreveu:

Quoted 41 lines

Em Tue, 9 Sep 2014 15:41:58 +0100
Russell King - ARM Linux <[email protected]> escreveu:

Quoted 14 lines · Mauro Carvalho Chehab
Quoted 13 lines

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!

Quoted 5 lines
Quoted 1 line

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.

No, not quite yet. That would currently cause major issues for omap2 and omap3.

Quoted 4 lines
Quoted 1 line

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

Are all the functions declared at omap-dma.h part of the old DMA API that should be deprecated?

For the drivers yes. For the platform code, there are few functions needed, that's at least omap_dma_global_context_save() and omap_dma_global_context_restore(). But those can be in a local header file in arch/arm/plat-omap/include/plat.

Quoted 36 lines

If so, it seems that the OMAP2 and OMAP3 also depends on this thing, as all the PM code for OMAP depends on the functions declared inside omap-dma.h, and marking them as BROKEN causes compilation to failure:

arch/arm/mach-omap2/built-in.o: In function `omap3_save_scratchpad_contents':
:(.text+0x798): undefined reference to `omap3_restore_3630'
:(.text+0x7a8): undefined reference to `omap3_restore'
:(.text+0x7ac): undefined reference to omap3_restore_es3' arch/arm/mach-omap2/built-in.o: In function omap3_sram_restore_context':
:(.text+0x925c): undefined reference to omap_push_sram_idle' arch/arm/mach-omap2/built-in.o: In function option_set':
:(.text+0xc15c): undefined reference to omap3_pm_off_mode_enable' arch/arm/mach-omap2/built-in.o: In function pwrdm_suspend_set':
:(.text+0xc1a0): undefined reference to omap3_pm_set_suspend_state' arch/arm/mach-omap2/built-in.o: In function pwrdm_suspend_get':
:(.text+0xc1e4): undefined reference to omap3_pm_get_suspend_state' arch/arm/mach-omap2/built-in.o: In function omap3_enter_idle_bm':
:(.text+0xc7ec): undefined reference to `omap_sram_idle'
:(.text+0xc848): undefined reference to `pm34xx_errata'
arch/arm/mach-omap2/built-in.o: In function `omap2420_init_late':
:(.init.text+0xf64): undefined reference to omap2_pm_init' arch/arm/mach-omap2/built-in.o: In function omap2430_init_late':
:(.init.text+0x1024): undefined reference to omap2_pm_init' arch/arm/mach-omap2/built-in.o: In function omap3_init_late':
:(.init.text+0x1248): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o: In function omap3430_init_late':
:(.init.text+0x1264): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o: In function omap35xx_init_late':
:(.init.text+0x1280): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o: In function omap3630_init_late':
:(.init.text+0x129c): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o: In function am35xx_init_late':
:(.init.text+0x12b8): undefined reference to omap3_pm_init' arch/arm/mach-omap2/built-in.o::(.init.text+0x12d4): more undefined references to omap3_pm_init' follow

Quoted 3 lines

This was compiled with allmodconfig on arm, with COMPILE_TEST disabled (a few sub-archs disabled too), to avoid spurious unrelated compilation issues).

OK thanks for pointing that out. I'll take a look at dealing with the with omap_dma_global_context_save() and omap_dma_global_context_restore() to fix the above.

Quoted 4 lines

Am I missing something?

BTW, CONFIG_PM is auto-selected by ARCH_OMAP3.

Quoted 8 lines

And those are the functions that the OMAP3 code uses from omap-dma.h:

arch/arm/mach-omap2/pm34xx.c:92:2: error: implicit declaration of function ‘omap_dma_global_context_save’ [-Werror=implicit-function-declaration] arch/arm/mach-omap2/pm34xx.c:103:2: error: implicit declaration of function ‘omap_dma_global_context_restore’ [-Werror=implicit-function-declaration] arch/arm/mach-omap2/pm24xx.c:170:2: error: implicit declaration of function ‘omap_dma_running’ [-Werror=implicit-function-declaration]

Just enabling this won't work, as the code at arch/arm/plat-omap/dma.c depends on several other functions inside omap-dma.h.

OK so looks like omap_dma_running() is needed by the platform code too, it's the same story.

Quoted 16 lines

From: Mauro Carvalho Chehab <[email protected]>
Subject: [PATCH] omap-dma: remove deprecated omap-dma.h API

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!

Quoted 7 lines

That's because OMAP1 is using a legacy deprecated API. Instead of fixing it, the right thing to do is to convert the remaining OMAP drivers that use the legacy API to the standard DMA API.

While this doesn't happen, let's mark the broken stuff with BROKEN.

As pointed out, the proper fix for the above is to remove the broken driver that nobody is using. Or update it to use dmaengine API if somebody is still using it.

Quoted 5 lines

+++ b/arch/arm/mach-omap2/Kconfig

arch/arm/mach-omap2/Kconfig +0 -0
@@ -11,6 +11,16 @@ config ARCH_OMAP2
 	select CPU_V6
 	select SOC_HAS_OMAP2_SDRC
 

arch/arm/mach-omap2/Kconfig config ARCH_OMAP2 · line 23

Quoted 10 lines
arch/arm/mach-omap2/Kconfig +10 -0
+config OMAP2_PM24XX
+	bool
+	depends on ARCH_OMAP2
+	depends on BROKEN
+
+config OMAP2_PM34XX
+	bool
+	depends on ARCH_OMAP3
+	depends on BROKEN
+

And all this should not be needed, I'll move those to a local platform specific header file.

Regards,

Tony

#20 lore raw

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

In reply to Mauro Carvalho Chehab
Quoted 17 lines · Mauro Carvalho Chehab

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
Quoted 1 line

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.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
#21 lore raw

PATCH v3 1/3 disable OMAP1 COMPILE_TEST

In reply to Mauro Carvalho Chehab

This driver depends on a legacy OMAP DMA API. So, it won't compile-test on other archs.

While we might add stubs to the functions, this is not a good idea, as the hole API should be replaced.

So, for now, let's just remove COMPILE_TEST and wait for some time for people to fix. If not fixed, then we'll end by removing this driver as a hole.

drivers/media/platform/soc_camera/Kconfig +1 -1
index 6af6c6dccda8..f2776cd415ca 100644
@@ -63,7 +63,7 @@ config VIDEO_SH_MOBILE_CEU
 config VIDEO_OMAP1
 	tristate "OMAP1 Camera Interface driver"
 	depends on VIDEO_DEV && SOC_CAMERA
-	depends on ARCH_OMAP1 || COMPILE_TEST
+	depends on ARCH_OMAP1
 	depends on HAS_DMA
 	select VIDEOBUF_DMA_CONTIG
 	select VIDEOBUF_DMA_SG
Signature · 1 line
1.9.3
#22 lore raw

PATCH v3 2/3 s5p-jpeg: Fix compilation with COMPILE_TEST

ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!

That happens because asm-generic doesn't like any ndelay time bigger than 20us.

Currently, usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held.

So, let's use udelay() instead.

drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +1 -1
index e51c078360f5..ab6d6f43c96f 100644
@@ -23,7 +23,7 @@ void exynos4_jpeg_sw_reset(void __iomem *base)
 	reg = readl(base + EXYNOS4_JPEG_CNTL_REG);
 	writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 
-	ndelay(100000);
+	udelay(100);
 
 	writel(reg | EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG);
 }
Signature · 1 line
1.9.3
#23 lore raw

PATCH v3 3/3 vpif: Fix compilation with allmodconfig

In reply to Mauro Carvalho Chehab

When vpif is compiled as module, those errors happen:

ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_display.ko] undefined!
ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_capture.ko] undefined!

That's because vpif_lock symbol is not exported.

drivers/media/platform/davinci/vpif.c +1 -0
index cd08e5248387..3dad5bd7fe0a 100644
@@ -38,6 +38,7 @@ MODULE_LICENSE("GPL");
 #define VPIF_CH3_MAX_MODES	2
 
 spinlock_t vpif_lock;
+EXPORT_SYMBOL_GPL(vpif_lock);
 
 void __iomem *vpif_base;
 EXPORT_SYMBOL_GPL(vpif_base);
Signature · 1 line
1.9.3
Acked-by on v3 1/3
#24 lore raw

Re: [PATCHv3 1/3] [media] disable OMAP1 COMPILE_TEST

In reply to Mauro Carvalho Chehab

Thanks, Mauro,

Quoted 11 lines · Mauro Carvalho Chehab

This driver depends on a legacy OMAP DMA API. So, it won't compile-test on other archs.

While we might add stubs to the functions, this is not a good idea, as the hole API should be replaced.

So, for now, let's just remove COMPILE_TEST and wait for some time for people to fix. If not fixed, then we'll end by removing this driver as a hole.

Regards
Guennadi

Quoted 17 lines
drivers/media/platform/soc_camera/Kconfig +1 -1
index 6af6c6dccda8..f2776cd415ca 100644
@@ -63,7 +63,7 @@ config VIDEO_SH_MOBILE_CEU
 config VIDEO_OMAP1
 	tristate "OMAP1 Camera Interface driver"
 	depends on VIDEO_DEV && SOC_CAMERA
-	depends on ARCH_OMAP1 || COMPILE_TEST
+	depends on ARCH_OMAP1
 	depends on HAS_DMA
 	select VIDEOBUF_DMA_CONTIG
 	select VIDEOBUF_DMA_SG
Signature · 1 line
1.9.3
#25 lore raw

Re: [PATCHv3 1/3] [media] disable OMAP1 COMPILE_TEST

In reply to Mauro Carvalho Chehab

Hi,

Quoted 5 lines · Mauro Carvalho Chehab

This driver depends on a legacy OMAP DMA API. So, it won't compile-test on other archs.

While we might add stubs to the functions, this is not a good idea, as the hole API should be replaced.

This is also not a good idea becaouse it would break the driver for OMAP1 once somebody enables COMPILE_TEST option while also having ARCH_OMAP1 enabled (which is perfectly fine and shouldn't cause the driver breakage). In general COMPILE_TEST option is completely independent from the arch specific ones and it should not change behaviour of the existing code.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 19 lines

So, for now, let's just remove COMPILE_TEST and wait for some time for people to fix. If not fixed, then we'll end by removing this driver as a hole.

drivers/media/platform/soc_camera/Kconfig +1 -1
index 6af6c6dccda8..f2776cd415ca 100644
@@ -63,7 +63,7 @@ config VIDEO_SH_MOBILE_CEU
 config VIDEO_OMAP1
 	tristate "OMAP1 Camera Interface driver"
 	depends on VIDEO_DEV && SOC_CAMERA
-	depends on ARCH_OMAP1 || COMPILE_TEST
+	depends on ARCH_OMAP1
 	depends on HAS_DMA
 	select VIDEOBUF_DMA_CONTIG
 	select VIDEOBUF_DMA_SG
#26 lore raw

Re: [PATCHv3 1/3] [media] disable OMAP1 COMPILE_TEST

Quoted 10 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 5 lines · Mauro Carvalho Chehab

This driver depends on a legacy OMAP DMA API. So, it won't compile-test on other archs.

While we might add stubs to the functions, this is not a good idea, as the hole API should be replaced.

Quoted 6 lines

This is also not a good idea becaouse it would break the driver for OMAP1 once somebody enables COMPILE_TEST option while also having ARCH_OMAP1 enabled (which is perfectly fine and shouldn't cause the driver breakage). In general COMPILE_TEST option is completely independent from the arch specific ones and it should not change behaviour of the existing code.

Small clarification:

I was of course referring to the original patch for the issue:

https://lkml.org/lkml/2014/9/9/498

stubs can be added properly with using

  #if defined(CONFIG_COMPILE_TEST) && !defined(CONFIG_ARCH_OMAP1)

similarly like it is handled for ARCH_QCOM in

drivers/gpu/drm/msm/msm_drv.h

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

#27 lore raw
In reply to Stephen Rothwell

Hi all,

Quoted 4 lines · On Tue, 9 Sep 2014 12:43:06 +1000 Stephen Rothwell <[email protected]> wrote:

After merging the v4l-dvb tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Quoted 12 lines

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!
ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined!
ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_display.ko] undefined!
ERROR: "vpif_lock" [drivers/media/platform/davinci/vpif_capture.ko] undefined!

Still getting these ...

Quoted 1 line

I have used the v4l-dvb tree from next-20140908 for today.

So this still applies.

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]