From: kernel test robot <lkp@intel.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [hverkuil-media-tree:vivid-kthread 36/37] drivers/media/test-drivers/vivid/vivid-kthread-cap.c:773:undefined reference to `__udivdi3'
Date: Sun, 28 Apr 2024 10:38:38 +0800 [thread overview]
Message-ID: <202404281015.gPENjPYW-lkp@intel.com> (raw)
tree: git://linuxtv.org/hverkuil/media_tree.git vivid-kthread
head: 110b5a0121cf99f034671c91eed3674a652b0e6f
commit: 61319ac7d6157a0f4d6f782749b820988e22fdf2 [36/37] media: vivid: make the timestamps/seq numbers reliable
config: i386-randconfig-141-20240428 (https://download.01.org/0day-ci/archive/20240428/202404281015.gPENjPYW-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240428/202404281015.gPENjPYW-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404281015.gPENjPYW-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: drivers/media/test-drivers/vivid/vivid-kthread-cap.o: in function `vivid_thread_vid_cap':
>> drivers/media/test-drivers/vivid/vivid-kthread-cap.c:773:(.text+0x2d9f): undefined reference to `__udivdi3'
ld: drivers/media/test-drivers/vivid/vivid-kthread-out.o: in function `vivid_thread_vid_out':
>> drivers/media/test-drivers/vivid/vivid-kthread-out.c:242:(.text+0x76f): undefined reference to `__udivdi3'
ld: drivers/media/test-drivers/vivid/vivid-sdr-cap.o: in function `vivid_thread_sdr_cap':
drivers/media/test-drivers/vivid/vivid-sdr-cap.c:225:(.text+0x1515): undefined reference to `__udivdi3'
ld: drivers/media/test-drivers/vivid/vivid-kthread-touch.o: in function `vivid_thread_touch_cap':
>> drivers/media/test-drivers/vivid/vivid-kthread-touch.c:146:(.text+0x381): undefined reference to `__udivdi3'
vim +773 drivers/media/test-drivers/vivid/vivid-kthread-cap.c
660
661 static int vivid_thread_vid_cap(void *data)
662 {
663 struct vivid_dev *dev = data;
664 u64 start_time;
665 u64 numerators_since_start;
666 u64 buffers_since_start;
667 u64 f_time;
668 u32 seq_offset = 0;
669 unsigned long next_jiffies;
670 unsigned long jiffies_since_start;
671 unsigned long cur_jiffies;
672 unsigned numerator;
673 unsigned denominator;
674 int dropped_bufs;
675
676 dprintk(dev, 1, "Video Capture Thread Start\n");
677
678 set_freezable();
679
680 /*
681 * Wait for first buffer to arrive. Without this you can end up with
682 * a first buffer that has a sequence counter > 0.
683 *
684 * Since this driver is also used for regression testing the behavior
685 * should be predictable, and so the first buffer definitely should
686 * start with sequence == 0.
687 */
688 while (!kthread_should_stop()) {
689 bool has_buffer;
690
691 spin_lock(&dev->slock);
692 has_buffer = !list_empty(&dev->vid_cap_active) ||
693 !list_empty(&dev->vbi_cap_active) ||
694 !list_empty(&dev->meta_cap_active);
695 spin_unlock(&dev->slock);
696 if (has_buffer)
697 break;
698 try_to_freeze();
699 schedule();
700 }
701
702 /* Resets frame counters */
703 dev->cap_seq_count = 0;
704 dev->cap_seq_resync = false;
705 dev->jiffies_vid_cap = jiffies;
706 start_time = ktime_get_ns();
707 if (dev->time_wrap)
708 dev->time_wrap_offset = dev->time_wrap - start_time;
709 else
710 dev->time_wrap_offset = 0;
711 vivid_cap_update_frame_period(dev);
712
713 for (;;) {
714 try_to_freeze();
715 if (kthread_should_stop())
716 break;
717
718 if (!mutex_trylock(&dev->mutex)) {
719 schedule();
720 continue;
721 }
722
723 cur_jiffies = jiffies;
724 if (dev->cap_seq_resync) {
725 dev->jiffies_vid_cap = cur_jiffies;
726 seq_offset = dev->cap_seq_count + 1;
727 dev->cap_seq_count = 0;
728 start_time += dev->cap_frame_period * seq_offset;
729 vivid_cap_update_frame_period(dev);
730 dev->cap_seq_resync = false;
731 }
732 numerator = dev->timeperframe_vid_cap.numerator;
733 denominator = dev->timeperframe_vid_cap.denominator;
734
735 if (dev->field_cap == V4L2_FIELD_ALTERNATE)
736 denominator *= 2;
737
738 /* Calculate the number of jiffies since we started streaming */
739 jiffies_since_start = cur_jiffies - dev->jiffies_vid_cap;
740 /* Get the number of buffers streamed since the start */
741 buffers_since_start = (u64)jiffies_since_start * denominator;
742 buffers_since_start = div_u64(buffers_since_start, HZ * numerator);
743 f_time = start_time + dev->time_wrap_offset +
744 buffers_since_start * dev->cap_frame_period;
745
746 /*
747 * After more than 0xf0000000 (rounded down to a multiple of
748 * 'jiffies-per-day' to ease jiffies_to_msecs calculation)
749 * jiffies have passed since we started streaming reset the
750 * counters and keep track of the sequence offset.
751 */
752 if (jiffies_since_start > JIFFIES_RESYNC) {
753 dev->jiffies_vid_cap = cur_jiffies;
754 seq_offset = buffers_since_start;
755 buffers_since_start = 0;
756 }
757 dropped_bufs = buffers_since_start + seq_offset - dev->cap_seq_count;
758 dev->cap_seq_count = buffers_since_start + seq_offset;
759
760 vivid_thread_vid_cap_tick(dev, dropped_bufs, f_time);
761 mutex_unlock(&dev->mutex);
762
763 /*
764 * Calculate the number of 'numerators' streamed since we started,
765 * including the current buffer.
766 */
767 numerators_since_start = ++buffers_since_start * numerator;
768
769 /*
770 * Calculate when that next buffer is supposed to start
771 * in jiffies since we started streaming.
772 */
> 773 next_jiffies = (numerators_since_start * HZ + denominator - 1) /
774 denominator + dev->jiffies_vid_cap;
775
776 while (time_is_after_jiffies(next_jiffies) &&
777 !kthread_should_stop())
778 schedule();
779 }
780 dprintk(dev, 1, "Video Capture Thread End\n");
781 return 0;
782 }
783
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-04-28 2:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202404281015.gPENjPYW-lkp@intel.com \
--to=lkp@intel.com \
--cc=hverkuil@xs4all.nl \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.