Re: [PATCH 5/5] media: staging: rkisp1: replace workqueue with threaded irq for reading statistics registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dafna,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.7-rc5 next-20200512]
[cannot apply to staging/staging-testing]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dafna-Hirschfeld/media-staging-rkisp1-change-workqueue-to-threaded-irq-in-stats/20200512-200942
base:   git://linuxtv.org/media_tree.git master
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=nios2 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

In file included from drivers/staging/media/rkisp1/rkisp1-stats.c:14:
drivers/staging/media/rkisp1/rkisp1-common.h:309:1: error: unknown type name 'irqreturn_t'
309 | irqreturn_t rkisp1_read_stats_threaded_irq(int irq, void *ctx);
| ^~~~~~~~~~~
drivers/staging/media/rkisp1/rkisp1-common.h:310:1: error: unknown type name 'irqreturn_t'
310 | irqreturn_t rkisp1_isp_isr(struct rkisp1_device *rkisp1);
| ^~~~~~~~~~~
drivers/staging/media/rkisp1/rkisp1-common.h:311:1: error: unknown type name 'irqreturn_t'
311 | irqreturn_t rkisp1_mipi_isr(struct rkisp1_device *rkisp1);
| ^~~~~~~~~~~
drivers/staging/media/rkisp1/rkisp1-common.h:312:1: error: unknown type name 'irqreturn_t'
312 | irqreturn_t rkisp1_capture_isr(struct rkisp1_device *rkisp1);
| ^~~~~~~~~~~
drivers/staging/media/rkisp1/rkisp1-common.h:313:1: error: unknown type name 'irqreturn_t'
313 | irqreturn_t rkisp1_stats_isr(struct rkisp1_stats *stats, u32 isp_ris);
| ^~~~~~~~~~~
>> drivers/staging/media/rkisp1/rkisp1-stats.c:313:1: error: unknown type name 'irqreturn_t'
313 | irqreturn_t rkisp1_read_stats_threaded_irq(int irq, void *ctx)
| ^~~~~~~~~~~
drivers/staging/media/rkisp1/rkisp1-stats.c: In function 'rkisp1_read_stats_threaded_irq':
>> drivers/staging/media/rkisp1/rkisp1-stats.c:326:10: error: 'IRQ_HANDLED' undeclared (first use in this function)
326 |   return IRQ_HANDLED;
|          ^~~~~~~~~~~
drivers/staging/media/rkisp1/rkisp1-stats.c:326:10: note: each undeclared identifier is reported only once for each function it appears in
drivers/staging/media/rkisp1/rkisp1-stats.c: At top level:
drivers/staging/media/rkisp1/rkisp1-stats.c:382:1: error: unknown type name 'irqreturn_t'
382 | irqreturn_t rkisp1_stats_isr(struct rkisp1_stats *stats, u32 isp_ris)
| ^~~~~~~~~~~
drivers/staging/media/rkisp1/rkisp1-stats.c: In function 'rkisp1_stats_isr':
drivers/staging/media/rkisp1/rkisp1-stats.c:387:2: error: unknown type name 'irqreturn_t'
387 |  irqreturn_t ret = IRQ_HANDLED;
|  ^~~~~~~~~~~
drivers/staging/media/rkisp1/rkisp1-stats.c:387:20: error: 'IRQ_HANDLED' undeclared (first use in this function)
387 |  irqreturn_t ret = IRQ_HANDLED;
|                    ^~~~~~~~~~~
>> drivers/staging/media/rkisp1/rkisp1-stats.c:409:10: error: 'IRQ_WAKE_THREAD' undeclared (first use in this function); did you mean 'RUSAGE_THREAD'?
409 |    ret = IRQ_WAKE_THREAD;
|          ^~~~~~~~~~~~~~~
|          RUSAGE_THREAD
drivers/staging/media/rkisp1/rkisp1-stats.c: In function 'rkisp1_read_stats_threaded_irq':
>> drivers/staging/media/rkisp1/rkisp1-stats.c:379:1: warning: control reaches end of non-void function [-Wreturn-type]
379 | }
| ^

vim +/irqreturn_t +313 drivers/staging/media/rkisp1/rkisp1-stats.c

   312	
 > 313	irqreturn_t rkisp1_read_stats_threaded_irq(int irq, void *ctx)
   314	{
   315		struct device *dev = ctx;
   316		struct rkisp1_device *rkisp1 = dev_get_drvdata(dev);
   317		struct rkisp1_stats *stats = &rkisp1->stats;
   318		struct rkisp1_kstats_buffer *kstats_buf = NULL;
   319		struct rkisp1_stat_buffer *cur_stat_buf;
   320		unsigned long flags;
   321		u64 timestamp = ktime_get_ns();
   322	
   323		spin_lock_irqsave(&stats->stats_lock, flags);
   324		if (!stats->is_streaming) {
   325			spin_unlock_irqrestore(&stats->stats_lock, flags);
 > 326			return IRQ_HANDLED;
   327		}
   328		if (list_empty(&stats->stat)) {
   329			spin_unlock_irqrestore(&stats->stats_lock, flags);
   330			WARN("%s: threaded irq waked but there are no buffers",
   331			     __func__);
   332			return IRQ_HANDLED;
   333		}
   334		kstats_buf = list_first_entry(&stats->stat,
   335					      struct rkisp1_kstats_buffer, buff.queue);
   336	
   337		/*
   338		 * each waked irq thread reads exactly one ready statistics
   339		 * so it is a bug  if no statistics are ready
   340		 */
   341		if (!kstats_buf->ris) {
   342			spin_unlock_irqrestore(&stats->stats_lock, flags);
   343			WARN("%s: threaded irq waked but buffer holds no measures",
   344			     __func__);
   345			return IRQ_HANDLED;
   346		}
   347		list_del(&kstats_buf->buff.queue);
   348		spin_unlock_irqrestore(&stats->stats_lock, flags);
   349	
   350		cur_stat_buf =
   351			(struct rkisp1_stat_buffer *)(kstats_buf->buff.vaddr[0]);
   352	
   353		if (kstats_buf->ris & RKISP1_CIF_ISP_AWB_DONE) {
   354			rkisp1_stats_get_awb_meas(stats, cur_stat_buf);
   355			cur_stat_buf->meas_type |= RKISP1_CIF_ISP_STAT_AWB;
   356		}
   357	
   358		if (kstats_buf->ris & RKISP1_CIF_ISP_AFM_FIN) {
   359			rkisp1_stats_get_afc_meas(stats, cur_stat_buf);
   360			cur_stat_buf->meas_type |= RKISP1_CIF_ISP_STAT_AFM_FIN;
   361		}
   362	
   363		if (kstats_buf->ris & RKISP1_CIF_ISP_EXP_END) {
   364			rkisp1_stats_get_aec_meas(stats, cur_stat_buf);
   365			rkisp1_stats_get_bls_meas(stats, cur_stat_buf);
   366			cur_stat_buf->meas_type |= RKISP1_CIF_ISP_STAT_AUTOEXP;
   367		}
   368	
   369		if (kstats_buf->ris & RKISP1_CIF_ISP_HIST_MEASURE_RDY) {
   370			rkisp1_stats_get_hst_meas(stats, cur_stat_buf);
   371			cur_stat_buf->meas_type |= RKISP1_CIF_ISP_STAT_HIST;
   372		}
   373	
   374		vb2_set_plane_payload(&kstats_buf->buff.vb.vb2_buf, 0,
   375				      sizeof(struct rkisp1_stat_buffer));
   376		kstats_buf->buff.vb.vb2_buf.timestamp = timestamp;
   377		vb2_buffer_done(&kstats_buf->buff.vb.vb2_buf, VB2_BUF_STATE_DONE);
   378		return IRQ_HANDLED;
 > 379	}
   380	
   381	
   382	irqreturn_t rkisp1_stats_isr(struct rkisp1_stats *stats, u32 isp_ris)
   383	{
   384		struct rkisp1_device *rkisp1 = stats->rkisp1;
   385		struct rkisp1_isp *isp = &rkisp1->isp;
   386		struct rkisp1_kstats_buffer *buf = NULL;
 > 387		irqreturn_t ret = IRQ_HANDLED;
   388		unsigned int isp_mis_tmp = 0;
   389		unsigned long flags;
   390		u32 val;
   391	
   392		spin_lock_irqsave(&stats->stats_lock, flags);
   393	
   394		val = RKISP1_STATS_MEAS_MASK;
   395		rkisp1_write(rkisp1, val, RKISP1_CIF_ISP_ICR);
   396	
   397		isp_mis_tmp = rkisp1_read(rkisp1, RKISP1_CIF_ISP_MIS);
   398		if (isp_mis_tmp & RKISP1_STATS_MEAS_MASK)
   399			rkisp1->debug.stats_error++;
   400	
   401		if (!stats->is_streaming || !(isp_ris & RKISP1_STATS_MEAS_MASK))
   402			goto unlock;
   403	
   404		list_for_each_entry(buf, &stats->stat, buff.queue) {
   405			if (!buf->ris) {
   406				buf->buff.vb.sequence =
   407					atomic_read(&isp->frame_sequence);
   408				buf->ris = isp_ris;
 > 409				ret = IRQ_WAKE_THREAD;
   410				break;
   411			}
   412		}
   413	
   414	unlock:
   415		spin_unlock_irqrestore(&stats->stats_lock, flags);
   416		return ret;
   417	}
   418	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux