Re: [PATCH v4 2/2] media: video-i2c: add video-i2c driver

2018-03-04 Thread Matt Ranostay
On Wed, Feb 28, 2018 at 8:22 PM, kbuild test robot  wrote:
> Hi Matt,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on linuxtv-media/master]
> [also build test WARNING on v4.16-rc3 next-20180228]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
>
> url:
> https://github.com/0day-ci/linux/commits/Matt-Ranostay/media-video-i2c-add-video-i2c-driver-support/20180301-111038
> base:   git://linuxtv.org/media_tree.git master
> config: ia64-allmodconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 7.2.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
> make.cross ARCH=ia64
>
> All warnings (new ones prefixed by >>):
>
>drivers/media//i2c/video-i2c.c: In function 'video_i2c_probe':
>>> drivers/media//i2c/video-i2c.c:456:13: warning: cast from pointer to 
>>> integer of different size [-Wpointer-to-int-cast]
>   chip_id = (int) of_device_get_match_data(>dev);

Suspect this is some Itanium weirdness nobody cares about.

> ^
>
> vim +456 drivers/media//i2c/video-i2c.c
>
>442
>443  static int video_i2c_probe(struct i2c_client *client,
>444   const struct i2c_device_id *id)
>445  {
>446  struct video_i2c_data *data;
>447  struct v4l2_device *v4l2_dev;
>448  struct vb2_queue *queue;
>449  int chip_id, ret;
>450
>451  data = kzalloc(sizeof(*data), GFP_KERNEL);
>452  if (!data)
>453  return -ENOMEM;
>454
>455  if (client->dev.of_node)
>  > 456  chip_id = (int) 
> of_device_get_match_data(>dev);
>457  else
>458  chip_id = id->driver_data;
>459
>460  data->chip = _i2c_chip[chip_id];
>461  data->client = client;
>462  v4l2_dev = >v4l2_dev;
>463  strlcpy(v4l2_dev->name, VIDEO_I2C_DRIVER, 
> sizeof(v4l2_dev->name));
>464
>465  ret = v4l2_device_register(>dev, v4l2_dev);
>466  if (ret < 0)
>467  goto error_free_device;
>468
>469  mutex_init(>lock);
>470  mutex_init(>queue_lock);
>471
>472  queue = >vb_vidq;
>473  queue->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
>474  queue->io_modes = VB2_DMABUF | VB2_MMAP | VB2_USERPTR | 
> VB2_READ;
>475  queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
>476  queue->drv_priv = data;
>477  queue->buf_struct_size = sizeof(struct video_i2c_buffer);
>478  queue->min_buffers_needed = 1;
>479  queue->ops = _i2c_video_qops;
>480  queue->mem_ops = _vmalloc_memops;
>481
>482  ret = vb2_queue_init(queue);
>483  if (ret < 0)
>484  goto error_unregister_device;
>485
>486  data->vdev.queue = queue;
>487  data->vdev.queue->lock = >queue_lock;
>488
>489  snprintf(data->vdev.name, sizeof(data->vdev.name),
>490   "I2C %d-%d Transport Video",
>491   client->adapter->nr, client->addr);
>492
>493  data->vdev.v4l2_dev = v4l2_dev;
>494  data->vdev.fops = _i2c_fops;
>495  data->vdev.lock = >lock;
>496  data->vdev.ioctl_ops = _i2c_ioctl_ops;
>497  data->vdev.release = video_i2c_release;
>498  data->vdev.device_caps = V4L2_CAP_VIDEO_CAPTURE |
>499   V4L2_CAP_READWRITE | 
> V4L2_CAP_STREAMING;
>500
>501  spin_lock_init(>slock);
>502  INIT_LIST_HEAD(>vid_cap_active);
>503
>504  video_set_drvdata(>vdev, data);
>505  i2c_set_clientdata(client, data);
>506
>507  ret = video_register_device(>vdev, VFL_TYPE_GRABBER, 
> -1);
>508  if (ret < 0)
>509  goto error_unregister_device;
>510
>511  return 0;
>512
>513  error_unregister_device:
>514  v4l2_device_unregister(v4l2_dev);
>515
>516  error_free_device:
>517  kfree(data);
>518
>519  return ret;
>520  }
>521
>
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation


Re: [bug report] media: i2c: Copy tw9910 soc_camera sensor driver

2018-03-04 Thread Dan Carpenter
On Fri, Mar 02, 2018 at 03:20:16PM +0100, jacopo mondi wrote:
> Hi Dan,
> 
> On Thu, Mar 01, 2018 at 12:59:54PM +0300, Dan Carpenter wrote:
> > [ I know you're just copying files, but you might have a fix for these
> >   since you're looking at the code.  - dan ]
> 
> According to the static analyzer I should simply substitute all those
> expressions with 0s.

I really try not to print warnings for stuff which is just white space
complaints like that.  For example, Smatch ignores inconsistent NULL
checking if every caller passes non-NULL parameters or Smatch ignores
comparing unsigned with zero if it's just clamping to between zero and
max.

> I would instead keep them for sake of readability
> and accordance with register description in the video decoder manual.
> 
> Thanks
>j
> 

[ snip ]

> >511  static int tw9910_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
> >512  {
> >513  struct i2c_client *client = v4l2_get_subdevdata(sd);
> >514  struct tw9910_priv *priv = to_tw9910(client);
> >515  const unsigned int hact = 720;
> >516  const unsigned int hdelay = 15;
> >^^^
> >517  unsigned int vact;
> >518  unsigned int vdelay;
> >519  int ret;
> >520
> >521  if (!(norm & (V4L2_STD_NTSC | V4L2_STD_PAL)))
> >522  return -EINVAL;
> >523
> >524  priv->norm = norm;
> >525  if (norm & V4L2_STD_525_60) {
> >526  vact = 240;
> >527  vdelay = 18;
> >528  ret = tw9910_mask_set(client, VVBI, 0x10, 0x10);
> >529  } else {
> >530  vact = 288;
> >531  vdelay = 24;
> >532  ret = tw9910_mask_set(client, VVBI, 0x10, 0x00);
> >533  }
> >534  if (!ret)
> >535  ret = i2c_smbus_write_byte_data(client, CROP_HI,
> >536  ((vdelay >> 2) & 
> > 0xc0) |
> >537  ((vact >> 4) & 0x30) |
> >538  ((hdelay >> 6) & 0x0c) |
> >   ^^^
> > 15 >> 6 is zero.
> >
> >539  ((hact >> 8) & 0x03));

I looked at the spec and it seems to me that we should doing something
like:

(((vdelay >> 8) & 0x3) << 6) |
(((vact >> 8) & 0x3) << 4) |
(((hedelay >> 8) & 0x3) << 2) |
((hact >> 8) & 0x03);


But this is the first time I've looked and it and I can't even be sure
I'm looking in the right place.

regards,
dan carpenter



cron job: media_tree daily build: ERRORS

2018-03-04 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Mon Mar  5 05:00:12 CET 2018
media-tree git hash:e3e389f931a14ddf43089c7db92fc5d74edf93a4
media_build git hash:   c3a4fa1a633e24b4a607a78ad11a61598ee177b6
v4l-utils git hash: 5090c6cb0265c6847ff4b0e89b37c172eb0c1c62
gcc version:i686-linux-gcc (GCC) 7.3.0
sparse version: v0.5.0-3994-g45eb2282
smatch version: v0.5.0-3994-g45eb2282
host hardware:  x86_64
host os:4.14.0-3-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-multi: OK
linux-git-arm-pxa: OK
linux-git-arm-stm32: OK
linux-git-arm64: OK
linux-git-blackfin-bf561: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.36.4-i686: ERRORS
linux-2.6.36.4-x86_64: ERRORS
linux-2.6.37.6-i686: ERRORS
linux-2.6.37.6-x86_64: ERRORS
linux-2.6.38.8-i686: ERRORS
linux-2.6.38.8-x86_64: ERRORS
linux-2.6.39.4-i686: ERRORS
linux-2.6.39.4-x86_64: ERRORS
linux-3.0.60-i686: ERRORS
linux-3.0.60-x86_64: ERRORS
linux-3.1.10-i686: ERRORS
linux-3.1.10-x86_64: ERRORS
linux-3.2.98-i686: ERRORS
linux-3.2.98-x86_64: ERRORS
linux-3.3.8-i686: ERRORS
linux-3.3.8-x86_64: ERRORS
linux-3.4.27-i686: ERRORS
linux-3.4.27-x86_64: ERRORS
linux-3.5.7-i686: ERRORS
linux-3.5.7-x86_64: ERRORS
linux-3.6.11-i686: ERRORS
linux-3.6.11-x86_64: ERRORS
linux-3.7.4-i686: ERRORS
linux-3.7.4-x86_64: ERRORS
linux-3.8-i686: ERRORS
linux-3.8-x86_64: ERRORS
linux-3.9.2-i686: ERRORS
linux-3.9.2-x86_64: ERRORS
linux-3.10.1-i686: ERRORS
linux-3.10.1-x86_64: ERRORS
linux-3.11.1-i686: ERRORS
linux-3.11.1-x86_64: ERRORS
linux-3.12.67-i686: ERRORS
linux-3.12.67-x86_64: ERRORS
linux-3.13.11-i686: ERRORS
linux-3.13.11-x86_64: ERRORS
linux-3.14.9-i686: ERRORS
linux-3.14.9-x86_64: ERRORS
linux-3.15.2-i686: ERRORS
linux-3.15.2-x86_64: ERRORS
linux-3.16.53-i686: ERRORS
linux-3.16.53-x86_64: ERRORS
linux-3.17.8-i686: ERRORS
linux-3.17.8-x86_64: ERRORS
linux-3.18.93-i686: ERRORS
linux-3.18.93-x86_64: ERRORS
linux-3.19-i686: ERRORS
linux-3.19-x86_64: ERRORS
linux-4.0.9-i686: ERRORS
linux-4.0.9-x86_64: ERRORS
linux-4.1.49-i686: ERRORS
linux-4.1.49-x86_64: ERRORS
linux-4.2.8-i686: ERRORS
linux-4.2.8-x86_64: ERRORS
linux-4.3.6-i686: WARNINGS
linux-4.3.6-x86_64: WARNINGS
linux-4.4.115-i686: OK
linux-4.4.115-x86_64: OK
linux-4.5.7-i686: WARNINGS
linux-4.5.7-x86_64: WARNINGS
linux-4.6.7-i686: OK
linux-4.6.7-x86_64: WARNINGS
linux-4.7.5-i686: OK
linux-4.7.5-x86_64: WARNINGS
linux-4.8-i686: OK
linux-4.8-x86_64: WARNINGS
linux-4.9.80-i686: OK
linux-4.9.80-x86_64: OK
linux-4.10.14-i686: OK
linux-4.10.14-x86_64: WARNINGS
linux-4.11-i686: OK
linux-4.11-x86_64: WARNINGS
linux-4.12.1-i686: OK
linux-4.12.1-x86_64: WARNINGS
linux-4.13-i686: OK
linux-4.13-x86_64: OK
linux-4.14.17-i686: OK
linux-4.14.17-x86_64: OK
linux-4.15.2-i686: OK
linux-4.15.2-x86_64: OK
linux-4.16-rc1-i686: OK
linux-4.16-rc1-x86_64: OK
apps: WARNINGS
spec-git: OK
sparse: WARNINGS
smatch: OK

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Monday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Monday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/index.html


Re: Bug: Two device nodes created in /dev for a single UVC webcam

2018-03-04 Thread Alexandre-Xavier Labonté-Lamoureux
Hi Laurent,

I see why. `make install` installed my newly built modules into
`/lib/modules/4.9.0-5-amd64`, but I was running version 4.9.0-6 of the
kernel. Each kernel version has its own folder with its own modules.

I tried to revert the four commits, but they created conflicts. I
wasn't able to resolve them easily and, to be honest, I don't have a
lot of time to spend on this.

Regards,
Alexandre-Xavier

On Sun, Feb 25, 2018 at 6:41 AM, Laurent Pinchart
 wrote:
> Hi Alexandre-Xavier,
>
> On Sunday, 25 February 2018 10:19:51 EET Alexandre-Xavier Labonté-Lamoureux
> wrote:
>> Hi Laurent,
>>
>> Sorry for the late reply.
>>
>> I've been trying to reproduce the issue again. I cloned the entire
>> media repository later during the week and I haven't been able to
>> reproduce the issue after I installed the modules. A metadata node is
>> no longer created for my webcam. The four commits that you've
>> mentioned are still in the commit log, so it seems that they didn't
>> break anything.
>
> Now that's weird. I would expect a metadata video node to be created if the
> patches I mentioned are applied. Are you sure you have loaded the modules
> corresponding to the compiled sources ?
>
>> I'm not sure what could have changed that would have caused it to work
>> fine this time. I believe that I'm in the correct branch.
>>
>> $ git status
>> On branch media_tree/master
>> Your branch is up-to-date with 'r_media_tree/master'.
>>
>> I probably did `./build` instead of `./build --main-git` the first time.
>>
>> On Mon, Feb 19, 2018 at 2:10 PM, Laurent Pinchart wrote:
>> > On Monday, 19 February 2018 19:29:24 EET Alexandre-Xavier
>> > Labonté-Lamoureux wrote:
>> >> Hi Kieran,
>> >>
>> >> This is how I built the drivers:
>> >>
>> >> $ git clone --depth=1 git://linuxtv.org/media_build.git
>> >> $ cd media_build
>> >> $ ./build --main-git
>> >>
>> >> I then installed the newly built kernel modules:
>> >>
>> >> $ sudo make install
>> >>
>> >> Once the modules were updated, I restarted my computer to make sure
>> >> every module got reloaded. I didn't make any changes to the code and I
>> >> found the issues after trying each of those programs individually
>> >> after I restarted my computer.
>> >>
>> >> This was the latest commit when I cloned the repo:
>> >>
>> >> commit d144cfe4b3c37ece55ae27778c99765d4943c4fa
>> >> Author: Jasmin Jessich 
>> >> Date:   Fri Feb 16 22:40:49 2018 +0100
>> >>
>> >> Re-generated v3.12_kfifo_in.patch
>> >>
>> >> My version of VLC is 2.2.6. Here's a copy of the relevant data of
>> >> VLC's log file in case it can help: https://paste.debian.net/1011025/
>> >> In this case, I tried to open /dev/video0 first and /dev/video1 second.
>> >>
>> >> I can also try with ffplay:
>> >> $ ffplay /dev/video0
>> >>
>> >> I get this: [video4linux2,v4l2 @ 0x7f216920]
>> >> ioctl(VIDIOC_STREAMON): Message too long
>> >> /dev/video0: Message too long
>> >>
>> >> A new message appears in dmesg: uvcvideo: Failed to submit URB 0 (-90).
>> >
>> > That's interesting, and possibly unrelated to the patch series that added
>> > metadata capture support. Would you be able to revert that patch series
>> > and see if the problem still occurs ? The four commits to be reverted are
>> >
>> > 088ead25524583e2200aa99111bea2f66a86545a
>> > 3bc85817d7982ed53fbc9b150b0205beff68ca5c
>> > 94c53e26dc74744cc4f9a8ddc593b7aef96ba764
>> > 31a96f4c872e8fb953c853630f69d5de6ec961c9
>> >
>> > And if you could bisect the issue it would be even better :-)
>> >
>> > Could you also send me the output of lsusb -v for your camera (you can
>> > restrict it to the camera with -d VID:PID), running as root if possible ?
>> >
>> >> $ ffplay /dev/video1
>> >>
>> >> I get this:
>> >> [video4linux2,v4l2 @ 0x7f00ec000920] ioctl(VIDIOC_G_INPUT):
>> >> Inappropriate ioctl for device
>> >> /dev/video1: Inappropriate ioctl for device
>> >>
>> >> Like Guennadi said, /dev/video1 is a metadata node, so I don't expect
>> >> it to work. In the case of /dev/video0, I can't tell what could be
>> >> wrong from the error message.
>
> --
> Regards,
>
> Laurent Pinchart
>


Re: [Outreachy kernel] [PATCH 0/3] staging: media: cleanup

2018-03-04 Thread Julia Lawall


On Sun, 4 Mar 2018, Arushi Singhal wrote:

> Spellcheck the comments.
> Remove the repeated, consecutive words with single word.

For the series:
Acked-by: Julia Lawall 

But please look out for things to change in the code, not just in the
comments.

julia


>
> Arushi Singhal (3):
>   staging: media: Replace "be be" with "be"
>   staging: media: Replace "cant" with "can't"
>   staging: media: Replace "dont" with "don't"
>
>  drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h | 2 
> +-
>  drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c| 2 
> +-
>  drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c| 2 
> +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1520178507-25141-1-git-send-email-arushisinghal19971997%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


[PATCH 3/3] staging: media: Replace "dont" with "don't"

2018-03-04 Thread Arushi Singhal
Replace "dont" with "don't".
"Dont" is not same as "Do not" or "Don't".

Signed-off-by: Arushi Singhal 
---
 drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c 
b/drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c
index e36c2a3..f21075c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c
@@ -450,7 +450,7 @@ static void mmu_l1_unmap(struct isp_mmu *mmu, phys_addr_t 
l1_pt,
ptr = end;
}
/*
-* use the same L2 page next time, so we dont
+* use the same L2 page next time, so we don't
 * need to invalidate and free this PT.
 */
/*  atomisp_set_pte(l1_pt, idx, NULL_PTE); */
-- 
2.7.4



[PATCH 1/3] staging: media: Replace "be be" with "be"

2018-03-04 Thread Arushi Singhal
This patch replace "be be" with "be".

Signed-off-by: Arushi Singhal 
---
 drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
index df0aad9..4057a5a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
@@ -402,7 +402,7 @@ ia_css_pipe_set_isp_config(struct ia_css_pipe *pipe,
  exception holds for IA_CSS_EVENT_TYPE_PORT_EOF, for this event an IRQ is 
always
  raised.
  Note that events are still queued and the Host can poll for them. The
- or_mask and and_mask may be be active at the same time\n
+ or_mask and and_mask may be active at the same time\n
  \n
  Default values, for all pipe id's, after ia_css_init:\n
  or_mask = IA_CSS_EVENT_TYPE_ALL\n
-- 
2.7.4



[PATCH 0/3] staging: media: cleanup

2018-03-04 Thread Arushi Singhal
Spellcheck the comments.
Remove the repeated, consecutive words with single word.

Arushi Singhal (3):
  staging: media: Replace "be be" with "be"
  staging: media: Replace "cant" with "can't"
  staging: media: Replace "dont" with "don't"

 drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h | 2 +-
 drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c| 2 +-
 drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.7.4



Hello Beautiful

2018-03-04 Thread jack
Good day dear, i hope this mail meets you well? my name is Jack, from the U.S. 
I know this may seem inappropriate so i ask for your forgiveness but i wish to 
get to know you better, if I may be so bold. I consider myself an easy-going 
man, adventurous, honest and fun loving person but I am currently looking for a 
relationship in which I will feel loved. I promise to answer any question that 
you may want to ask me...all i need is just your attention and the chance to 
know you more.

Please tell me more about yourself, if you do not mind. Hope to hear back from 
you soon.

Jack.


[PATCH v1] libdvbv5: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile)

2018-03-04 Thread Peter Seiderer
Fixes:

  ../../lib/libdvbv5/.libs/libdvbv5.so: undefined reference to 
`TEMP_FAILURE_RETRY'

Signed-off-by: Peter Seiderer 
---
 lib/libdvbv5/dvb-dev-local.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c
index 8bc99d1..7a76d65 100644
--- a/lib/libdvbv5/dvb-dev-local.c
+++ b/lib/libdvbv5/dvb-dev-local.c
@@ -44,6 +44,15 @@
 # define _(string) string
 #endif
 
+/* taken from glibc unistd.h */
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+({ long int __result; \
+   do __result = (long int) (expression); \
+   while (__result == -1L && errno == EINTR); \
+   __result; })
+#endif
+
 struct dvb_dev_local_priv {
dvb_dev_change_t notify_dev_change;
 
-- 
2.16.2