Re: [PATCH/RFC v3 5/5] media: Add registration helpers for V4L2 flash sub-devices

2014-04-28 Thread Jacek Anaszewski

Hi Sakari,

On 04/23/2014 05:24 PM, Sakari Ailus wrote:

Hi Jacek,

On Thu, Apr 17, 2014 at 10:26:44AM +0200, Jacek Anaszewski wrote:

Hi Sakari,

Thanks for the review.

On 04/16/2014 08:21 PM, Sakari Ailus wrote:

Hi Jacek,

Thanks for the update!


[...]

+static inline enum led_brightness v4l2_flash_intensity_to_led_brightness(
+   struct led_ctrl *config,
+   u32 intensity)


Fits on a single line.


+{
+   return intensity / config-step;


Shouldn't you first decrement the minimum before the division?


Brightness level 0 means that led is off. Let's consider following case:

intensity - 15625
config-step - 15625
intensity / config-step = 1 (the lowest possible current level)


In V4L2 controls the minimum is not off, and zero might not be a possible
value since minimum isn't divisible by step.

I wonder how to best take that into account.


I've assumed that in MODE_TORCH a led is always on. Switching
the mode to MODE_FLASH or MODE_OFF turns the led off.
This way we avoid the problem with converting 0 uA value to
led_brightness, as available torch brightness levels start from
the minimum current level value and turning the led off is
accomplished on transition to MODE_OFF or MODE_FLASH, by
calling brightness_set op with led_brightness = 0.

[...]


+/*
+ * V4L2 subdev internal operations
+ */
+
+static int v4l2_flash_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
+{
+   struct v4l2_flash *v4l2_flash = v4l2_subdev_to_v4l2_flash(sd);
+   struct led_classdev *led_cdev = v4l2_flash-led_cdev;
+
+   mutex_lock(led_cdev-led_lock);
+   v4l2_call_flash_op(sysfs_lock, led_cdev);


Have you thought about device power management yet?


Having in mind that the V4L2 Flash sub-device is only a wrapper
for LED driver, shouldn't power management be left to the
drivers?


How does the LED controller driver know it needs to power the device up in
that case?

I think an s_power() op which uses PM runtime to set the power state until
V4L2 sub-device switches to it should be enough. But I'm fine leaving it out
from this patchset.



This solution looks reasonable.

Regards,
Jacek Anaszewski


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC v3 3/5] leds: Add support for max77693 mfd flash cell

2014-04-28 Thread Jacek Anaszewski

Hi Sakari,

On 04/23/2014 05:52 PM, Sakari Ailus wrote:

Hi Jacek,

Thanks for the answers to my comments! :-)

On Thu, Apr 17, 2014 at 11:23:06AM +0200, Jacek Anaszewski wrote:

On 04/16/2014 07:26 PM, Sakari Ailus wrote:

Hi Jacek,

Thanks for the patch! Comments below.

On Fri, Apr 11, 2014 at 04:56:54PM +0200, Jacek Anaszewski wrote:

This patch adds led-flash support to Maxim max77693 chipset.
A device can be exposed to user space through LED subsystem
sysfs interface or through V4L2 subdevice when the support
for V4L2 Flash sub-devices is enabled. Device supports up to
two leds which can work in flash and torch mode. Leds can
be triggered externally or by software.

Signed-off-by: Andrzej Hajda a.ha...@samsung.com
Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
Acked-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Bryan Wu coolo...@gmail.com
Cc: Richard Purdie rpur...@rpsys.net
Cc: SangYoung Son hello@smasung.com
Cc: Samuel Ortiz sa...@linux.intel.com
Cc: Lee Jones lee.jo...@linaro.org
---
  drivers/leds/Kconfig |   10 +
  drivers/leds/Makefile|1 +
  drivers/leds/leds-max77693.c |  794 ++
  drivers/mfd/max77693.c   |2 +-
  include/linux/mfd/max77693.h |   38 ++
  5 files changed, 844 insertions(+), 1 deletion(-)
  create mode 100644 drivers/leds/leds-max77693.c

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 1e1c81f..b2152a6 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -462,6 +462,16 @@ config LEDS_TCA6507
  LED driver chips accessed via the I2C bus.
  Driver support brightness control and hardware-assisted blinking.

+config LEDS_MAX77693
+   tristate LED support for MAX77693 Flash
+   depends on LEDS_CLASS_FLASH
+   depends on MFD_MAX77693
+   depends on OF
+   help
+ This option enables support for the flash part of the MAX77693
+ multifunction device. It has build in control for two leds in flash
+ and torch mode.
+
  config LEDS_MAX8997
tristate LED support for MAX8997 PMIC
depends on LEDS_CLASS  MFD_MAX8997
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 8861b86..64f6234 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -52,6 +52,7 @@ obj-$(CONFIG_LEDS_MC13783)+= leds-mc13783.o
  obj-$(CONFIG_LEDS_NS2)+= leds-ns2.o
  obj-$(CONFIG_LEDS_NETXBIG)+= leds-netxbig.o
  obj-$(CONFIG_LEDS_ASIC3)  += leds-asic3.o
+obj-$(CONFIG_LEDS_MAX77693)+= leds-max77693.o
  obj-$(CONFIG_LEDS_MAX8997)+= leds-max8997.o
  obj-$(CONFIG_LEDS_LM355x) += leds-lm355x.o
  obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o
diff --git a/drivers/leds/leds-max77693.c b/drivers/leds/leds-max77693.c
new file mode 100644
index 000..979736c
--- /dev/null
+++ b/drivers/leds/leds-max77693.c
@@ -0,0 +1,794 @@
+/*
+ * Copyright (C) 2014, Samsung Electronics Co., Ltd.
+ *
+ * Authors: Andrzej Hajda a.ha...@samsung.com
+ *  Jacek Anaszewski j.anaszew...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ */
+
+#include asm/div64.h
+#include linux/leds_flash.h
+#include linux/module.h
+#include linux/mutex.h
+#include linux/platform_device.h
+#include linux/slab.h
+#include media/v4l2-flash.h


I guess this should be last in the list.


+#include linux/workqueue.h
+#include linux/mfd/max77693.h
+#include linux/mfd/max77693-private.h
+
+#define MAX77693_LED_NAME  max77693-flash
+
+#define MAX77693_TORCH_IOUT_BITS   4
+
+#define MAX77693_TORCH_NO_TIMER0x40
+#define MAX77693_FLASH_TIMER_LEVEL 0x80
+
+#define MAX77693_FLASH_EN_OFF  0
+#define MAX77693_FLASH_EN_FLASH1
+#define MAX77693_FLASH_EN_TORCH2
+#define MAX77693_FLASH_EN_ON   3
+
+#define MAX77693_FLASH_EN1_SHIFT   6
+#define MAX77693_FLASH_EN2_SHIFT   4
+#define MAX77693_TORCH_EN1_SHIFT   2
+#define MAX77693_TORCH_EN2_SHIFT   0
+
+#define MAX77693_FLASH_LOW_BATTERY_EN  0x80
+
+#define MAX77693_FLASH_BOOST_FIXED 0x04
+#define MAX77693_FLASH_BOOST_LEDNUM_2  0x80
+
+#define MAX77693_FLASH_TIMEOUT_MIN 62500
+#define MAX77693_FLASH_TIMEOUT_MAX 100
+#define MAX77693_FLASH_TIMEOUT_STEP62500
+
+#define MAX77693_TORCH_TIMEOUT_MIN 262000
+#define MAX77693_TORCH_TIMEOUT_MAX 15728000
+
+#define MAX77693_FLASH_IOUT_MIN15625
+#define MAX77693_FLASH_IOUT_MAX_1LED   100
+#define MAX77693_FLASH_IOUT_MAX_2LEDS  625000
+#define MAX77693_FLASH_IOUT_STEP   15625
+
+#define MAX77693_TORCH_IOUT_MIN15625
+#define MAX77693_TORCH_IOUT_MAX25
+#define MAX77693_TORCH_IOUT_STEP   15625
+
+#define MAX77693_FLASH_VSYS_MIN 

Re: [PATCH/RFC v3 1/5] leds: Add sysfs and kernel internal API for flash LEDs

2014-04-28 Thread Jacek Anaszewski

Hi Bryan,

Thanks for the review.

On 04/26/2014 01:17 AM, Bryan Wu wrote:

On Fri, Apr 11, 2014 at 7:56 AM, Jacek Anaszewski
j.anaszew...@samsung.com wrote:

Some LED devices support two operation modes - torch and
flash.


Do we have a method to look up the capabilities from LED devices driver?
For example, the LED device supports Torch/Flash then LED device
driver should set a flag like LED_DEV_CAP_TORCH or LED_DEV_CAP_FLASH.
If it doesn't support those functions, it won't set those flags.


It is assumed that torch led is always available. For declaring
the existence of the flash led there is 'has_flash_led' flag in the
struct led_flash.


LED Flash class core can check those flags for further usage.


This patch provides support for flash LED devices
in the LED subsystem by introducing new sysfs attributes
and kernel internal interface. The attributes being
introduced are: flash_brightness, flash_strobe, flash_timeout,
max_flash_timeout, max_flash_brightness, flash_fault and
optional external_strobe, indicator_brightness and
max_indicator_btightness. All the flash related features


typo here, it should max_indicator_btightness - max_indicator_brightness


are placed in a separate module.


Please add one empty line here.


The modifications aim to be compatible with V4L2 framework
requirements related to the flash devices management. The
design assumes that V4L2 sub-device can take of the LED class
device control and communicate with it through the kernel
internal interface. When V4L2 Flash sub-device file is
opened, the LED class device sysfs interface is made
unavailable.



I don't quite understand the last sentence here. Looks like the LED
flash class interface binds to V4L2 Flash sub-device, then why we need
to export sysfs for user space if the only user is V4L2 which can talk
through kernel internal API here.


It has been agreed that the two types of interfaces should be available
for the users for operating on LED flash devices. Currently on open
the V4L2 flash sub-device sets the lock flag to disable LED sysfs
interface which was exported when the LED device was created.
Do you suggest that attributes should be removed each time V4L2
takes control of the LED flash device and re-created after
the device is released?


Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
Acked-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Bryan Wu coolo...@gmail.com
Cc: Richard Purdie rpur...@rpsys.net
---
  drivers/leds/Kconfig|8 +
  drivers/leds/Makefile   |1 +
  drivers/leds/led-class.c|   36 ++-
  drivers/leds/led-flash.c|  627

+++

If we go for the LED Flash class, I prefer to use led-class-flash.c
rather than led-flash.c


OK.


  drivers/leds/led-triggers.c |   16 +-
  drivers/leds/leds.h |6 +
  include/linux/leds.h|   50 +++-
  include/linux/leds_flash.h  |  252 +


leds_flash.h - led-class-flash.h


  8 files changed, 982 insertions(+), 14 deletions(-)
  create mode 100644 drivers/leds/led-flash.c
  create mode 100644 include/linux/leds_flash.h

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 2062682..1e1c81f 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -19,6 +19,14 @@ config LEDS_CLASS
   This option enables the led sysfs class in /sys/class/leds.  You'll
   need this to do anything useful with LEDs.  If unsure, say N.

+config LEDS_CLASS_FLASH
+   tristate Flash LEDs Support

LED Flash Class Support


+   depends on LEDS_CLASS
+   help
+ This option enables support for flash LED devices. Say Y if you
+ want to use flash specific features of a LED device, if they
+ are supported.
+


This help message is not very accurate, please take a look at
LEDS_CLASS. And I prefer this driver can be a module, so it should be
mentioned here.


Doesn't 'tristate' property suffice for indicating that the driver
can be a module?


  comment LED drivers

  config LEDS_88PM860X
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 3cd76db..8861b86 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -2,6 +2,7 @@
  # LED Core
  obj-$(CONFIG_NEW_LEDS) += led-core.o
  obj-$(CONFIG_LEDS_CLASS)   += led-class.o
+obj-$(CONFIG_LEDS_CLASS_FLASH) += led-flash.o
  obj-$(CONFIG_LEDS_TRIGGERS)+= led-triggers.o

  # LED Platform Drivers
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index f37d63c..58f16c3 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -9,15 +9,16 @@
   * published by the Free Software Foundation.
   */

-#include linux/module.h
-#include linux/kernel.h
+#include linux/ctype.h
+#include linux/device.h
+#include linux/err.h
  #include linux/init.h
+#include linux/kernel.h
  #include linux/list.h
+#include linux/module.h
+#include linux/slab.h
  #include linux/spinlock.h
-#include linux/device.h
  #include 

Re: dvbv5-scan errors trying to search channels

2014-04-28 Thread Mauro Carvalho Chehab
Em Sun, 27 Apr 2014 20:43:52 -0300
Roberto Alcantara robe...@eletronica.org escreveu:

 Scan problem (not all) solved.
 
 Just to update thread, my backport driver was using 
 MSG_SMS_GET_STATISTICS_REQ but firmware version for my isdb-t device do not 
 respond. I need to use MSG_SMS_GET_STATISTICS_EX_REQ  and handle 
 MSG_SMS_GET_STATISTICS_EX_RES to get answer.

Ah. Yeah, depending on the firmware, only one of those options is available.

There is a code at the Siano driver that tries to detect it, but it seems that
the logic there is not 100% (well, it works with the devices I have, but I
don't have much Siano samples).

Maybe we could add a different strategy:
- test first if MSG_SMS_GET_STATISTICS_EX_RES work. If it doesn't, fall
  back to MSG_SMS_GET_STATISTICS_REQ.

That is likely better than the current logic, that tries to guess what's
available based on a firmware version.

I'm out this week for a meeting in San Jose. Could you please try to write
such patch and submit to the ML? I'll test it after returning back to Brazil.

 I still with problems on scan but as i’m without antenna, tomorrow I will try 
 again.

Well, you generally need an external antenna to get ISDB-T broadcast signals
on most places, and a good RC6 cabling with low noise TAPs, if you're
using a common building antenna. 

A very high gain internal antenna, placed at the window sometimes work.

Regards,
Mauro
 
 Thank you for help!
 
 Cheers,
  - Roberto
 
 root@awsom:~# dvbv5-scan freq.conf 
 INFO Scanning frequency #1 473142857
 Lock   (0x1f) Signal= 0.06% C/N= 0.00% UCB= 0 postBER= 8
 error while waiting for PAT table
 INFO Scanning frequency #2 479142857
 Lock   (0x1f) Signal= 0.06% C/N= 0.00% UCB= 0 postBER= 8
 error while waiting for PAT table
 INFO Scanning frequency #3 485142857
 Lock   (0x1f) Signal= 0.06% C/N= 0.00% UCB= 0 postBER= 8
 error while waiting for PAT table
 INFO Scanning frequency #4 491142857
 Lock   (0x1f) Signal= 0.07% C/N= 0.00% UCB= 0 postBER= 8
 error while waiting for PAT table
 
 
 
 Em 27/04/2014, à(s) 10:00, Mauro Carvalho Chehab m.che...@samsung.com 
 escreveu:
 
  Em Sun, 27 Apr 2014 09:31:17 -0300
  Roberto Alcantara robe...@eletronica.org escreveu:
  
  Hello,
  
  After a lot of tries with a few commits I obtained an version from siano 
  drivers that loads fine in my 3.4.75.sun7i kernel @A20 device.
  
  This message looks weird:
  [ 1267.803903] data rate 0 bytes/secs
  
  
  I’m using checkout from 2a7643159d commit.
  
  Firmware is loading without any issue reported. But when I try to scan 
  with dvbv5-scan I see:
  
  root@awsom:~# dvbv5-scan freq.conf 
  INFO Scanning frequency #1 473142857
  ERRORFE_READ_STATUS: Timer expired
  ERROR: dvb_fe_get_stats failed (Timer expired)
  ERRORError: no adapter status
  ERRORFE_READ_STATUS: Timer expired
  ERROR: dvb_fe_get_stats failed (Timer expired)
  ERRORError: no adapter status
  ERRORFE_READ_STATUS: Timer expired
  ERROR: dvb_fe_get_stats failed (Timer expired)
  ERRORError: no adapter status
  
  In my desktop using same firmware I can scan without this errors.  I tried 
  with device directly connected and via usb powered hub with same results.
  
  You should search for ETIME at the Siano driver. There are lots of
  cases where this is returned at:
  drivers/media/common/siano/smscoreapi.c
  
  Probably, it is due to those:
  [ 1050.516057] smsusb_sendrequest: sending MSG_SMS_GET_STATISTICS_REQ(615) 
  size: 8
  [ 1052.516059] smsusb_sendrequest: sending MSG_SMS_GET_STATISTICS_REQ(615) 
  size: 8
  [ 1054.516049] smsusb_sendrequest: sending MSG_SMS_GET_STATISTICS_REQ(615) 
  size: 8
  [ 1056.516057] smsusb_sendrequest: sending MSG_SMS_GET_STATISTICS_REQ(615) 
  size: 8
  [ 1058.516047] smsusb_sendrequest: sending MSG_SMS_GET_STATISTICS_REQ(615) 
  size: 8
  
  I'm not seeing any receive packet from those requested stats.
  
  
  Did you have any tips for debug this error? Any ideas will be appreciated 
  :-)
  
  I suspect that this is due to driver's bad backport to Kernel 3.4.
  
  Another possibility would be some troubles with URB settings or with the USB
  driver.
  
  Regards,
  Mauro
  
  Thank you very much!
  
  - Roberto
  
  
  dmesg:
  
  [6.012466] init: plymouth-splash main process (271) terminated with 
  status 2
  [6.301960] init: bluetooth main process (231) terminated with status 1
  [6.359855] init: bluetooth main process ended, respawning
  [6.706961] smsusb_probe: interface number 0
  [6.709849] smsusb_probe: smsusb_probe 0
  [6.764522] smsusb_probe: endpoint 0 81 02 512
  [6.825161] smsusb_probe: endpoint 1 02 02 512
  [6.863769] smsusb_init_device: in_ep = 81, out_ep = 02
  [6.927804] smscore_register_device: allocated 50 buffers
  [6.932445] smscore_register_device: device ee6a7c00 created
  [7.040405] smsusb_init_device: smsusb_start_streaming(...).
  [7.158579] smscore_set_device_mode: set device mode to 6
  [  

Re: [RFC 0/2] [media] si4713 DT binding

2014-04-28 Thread Sebastian Reichel
On Sun, Apr 06, 2014 at 01:52:03PM +0200, Sebastian Reichel wrote:
 This is an RFC patch adding DT support to the si4713 radio
 transmitter i2c driver.

ping?

-- Sebastian


signature.asc
Description: Digital signature


Re: [PATCH v2] media: stk1160: Avoid stack-allocated buffer for control URBs

2014-04-28 Thread Sander Eikelenboom

Friday, April 25, 2014, 11:51:53 PM, you wrote:

 On Apr 17, Ezequiel Garcia wrote:
 Currently stk1160_read_reg() uses a stack-allocated char to get the
 read control value. This is wrong because usb_control_msg() requires
 a kmalloc-ed buffer.
 
 This commit fixes such issue by kmalloc'ating a 1-byte buffer to receive
 the read value.
 
 While here, let's remove the urb_buf array which was meant for a similar
 purpose, but never really used.
 
 Cc: Alan Stern st...@rowland.harvard.edu
 Reported-by: Sander Eikelenboom li...@eikelenboom.it

 Ouch, I forgot to Cc Sander!

 Sander, Here's the patch:

 https://patchwork.linuxtv.org/patch/23660/

 Maybe you can give it a ride and confirm it fixes the warning over there?

 Also, have you observed any serious issues caused by this or just the
 DMA API debug warning?

Hi Ezequiel,

Just tested  with your v2 patch for a while and haven't seen the warning again 
:-)

I don't remember for certain if it gave any serious issues .. since i have been 
running with you v1 patch now for a while and it's on a test machine i use 
infrequently.

--
Sander

 Signed-off-by: Ezequiel Garcia ezequiel.gar...@free-electrons.com
 ---
  drivers/media/usb/stk1160/stk1160-core.c | 10 +-
  drivers/media/usb/stk1160/stk1160.h  |  1 -
  2 files changed, 9 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/media/usb/stk1160/stk1160-core.c 
 b/drivers/media/usb/stk1160/stk1160-core.c
 index 34a26e0..03504dc 100644
 --- a/drivers/media/usb/stk1160/stk1160-core.c
 +++ b/drivers/media/usb/stk1160/stk1160-core.c
 @@ -67,17 +67,25 @@ int stk1160_read_reg(struct stk1160 *dev, u16 reg, u8 
 *value)
  {
   int ret;
   int pipe = usb_rcvctrlpipe(dev-udev, 0);
 + u8 *buf;
  
   *value = 0;
 +
 + buf = kmalloc(sizeof(u8), GFP_KERNEL);
 + if (!buf)
 + return -ENOMEM;
   ret = usb_control_msg(dev-udev, pipe, 0x00,
   USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 - 0x00, reg, value, sizeof(u8), HZ);
 + 0x00, reg, buf, sizeof(u8), HZ);
   if (ret  0) {
   stk1160_err(read failed on reg 0x%x (%d)\n,
   reg, ret);
 + kfree(buf);
   return ret;
   }
  
 + *value = *buf;
 + kfree(buf);
   return 0;
  }
  
 diff --git a/drivers/media/usb/stk1160/stk1160.h 
 b/drivers/media/usb/stk1160/stk1160.h
 index 05b05b1..abdea48 100644
 --- a/drivers/media/usb/stk1160/stk1160.h
 +++ b/drivers/media/usb/stk1160/stk1160.h
 @@ -143,7 +143,6 @@ struct stk1160 {
   int num_alt;
  
   struct stk1160_isoc_ctl isoc_ctl;
 - char urb_buf[255];   /* urb control msg buffer */
  
   /* frame properties */
   int width;/* current frame width */
 -- 
 1.9.1
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


WARNING: CPU: 0 PID: 3918 at drivers/media/v4l2-core/videobuf2-core.c:2094 __vb2_queue_cancel+0x11d/0x180()

2014-04-28 Thread Sander Eikelenboom
Hi,

With a 3.15-rc3 kernel i seem to reliably trigger these warnings (which don't 
trigger on 3.14.2) when stopping a video stream. They don't seem to cause to 
much havoc because the devices are still usable after this.

It seems to happen with both this syntek device as with em28xx devices.

--
Sander

[  264.705467] stk1160: queue_setup: buffer count 8, each 691200 bytes
[  264.728032] stk1160: queue_setup: buffer count 8, each 691200 bytes
[  264.736159] stk1160: queue_setup: buffer count 8, each 691200 bytes
[  264.744373] stk1160: setting alternate 5
[  264.748274] stk1160: minimum isoc packet size: 3072 (alt=5)
[  264.753377] stk1160: setting alt 5 with wMaxPacketSize=3072
[  264.758958] stk1160: allocating urbs...
[  264.765254] stk1160: 16 urbs allocated
[  264.772243] stk1160: streaming started
[  270.523114] stk1160: killing 16 urbs...
[  270.656992] stk1160: all urbs killed
[  270.660639] stk1160: freeing 16 urb buffers...
[  270.664925] stk1160: all urb buffers freed
[  270.668891] stk1160: setting alternate 0
[  270.675200] stk1160: buffer [88003b865000/7] aborted
[  270.678496] stk1160: buffer [88003b866400/0] aborted
[  270.678496] stk1160: buffer [88003b864400/1] aborted
[  270.678496] stk1160: buffer [88003b861000/2] aborted
[  270.678496] stk1160: buffer [88003b863800/3] aborted
[  270.678496] stk1160: buffer [88003b861c00/4] aborted
[  270.700760] stk1160: streaming stopped
[  270.703414] [ cut here ]
[  270.706603] WARNING: CPU: 0 PID: 3918 at 
drivers/media/v4l2-core/videobuf2-core.c:2094 __vb2_queue_cancel+0x11d/0x180()
[  270.713272] Modules linked in:
[  270.715907] CPU: 0 PID: 3918 Comm: videograbber.py Not tainted 
3.15.0-rc3-security-20140428-v4lall-stkpatch+ #1
[  270.721578] Hardware name: Xen HVM domU, BIOS 4.5-unstable 04/21/2014
[  270.725238]  0009 88003d589c48 81c5277e 

[  270.731505]  88003d589c80 810e4aa3  
0001
[  270.737774]   88003c3b13e0  
88003d589c90
[  270.744021] Call Trace:
[  270.746022]  [81c5277e] dump_stack+0x45/0x56
[  270.749420]  [810e4aa3] warn_slowpath_common+0x73/0x90
[  270.753934]  [810e4b75] warn_slowpath_null+0x15/0x20
[  270.758987]  [8185067d] __vb2_queue_cancel+0x11d/0x180
[  270.764168]  [81850766] vb2_ioctl_streamoff+0x56/0x60
[  270.769276]  [81838785] v4l_streamoff+0x15/0x20
[  270.774037]  [8183c2c4] __video_do_ioctl+0x294/0x310
[  270.779124]  [81bdd2f6] ? unix_stream_sendmsg+0x3a6/0x3e0
[  270.784460]  [8183bd50] video_usercopy+0x1f0/0x4b0
[  270.789411]  [8183c030] ? video_ioctl2+0x20/0x20
[  270.794193]  [81ae0e1f] ? sock_aio_write+0xcf/0xe0
[  270.799136]  [811771eb] ? free_pages.part.69+0x3b/0x40
[  270.804299]  [8118fe6d] ? tlb_finish_mmu+0x2d/0x40
[  270.809194]  [8183c020] video_ioctl2+0x10/0x20
[  270.813879]  [818375ff] v4l2_ioctl+0x10f/0x150
[  270.818407]  [811d62e0] do_vfs_ioctl+0x2e0/0x4c0
[  270.822878]  [811c4b1c] ? vfs_write+0x17c/0x1e0
[  270.827387]  [811d64fc] SyS_ioctl+0x3c/0x80
[  270.831927]  [81c687b9] system_call_fastpath+0x16/0x1b
[  270.837545] ---[ end trace 8d6b91c80125b9e2 ]---
[  270.842103] [ cut here ]
[  270.846562] WARNING: CPU: 0 PID: 3918 at 
drivers/media/v4l2-core/videobuf2-core.c:1165 vb2_buffer_done+0x163/0x170()
[  270.856204] Modules linked in:
[  270.859787] CPU: 0 PID: 3918 Comm: videograbber.py Tainted: GW 
3.15.0-rc3-security-20140428-v4lall-stkpatch+ #1
[  270.868591] Hardware name: Xen HVM domU, BIOS 4.5-unstable 04/21/2014
[  270.873886]  0009 88003d589c10 81c5277e 

[  270.882386]  88003d589c48 810e4aa3 88003b863000 
88003c3b1460
[  270.890943]   88003c3b13e0 0003 
88003d589c58
[  270.899446] Call Trace:
[  270.902102]  [81c5277e] dump_stack+0x45/0x56
[  270.906634]  [810e4aa3] warn_slowpath_common+0x73/0x90
[  270.911926]  [810e4b75] warn_slowpath_null+0x15/0x20
[  270.916783]  [8184f493] vb2_buffer_done+0x163/0x170
[  270.921378]  [818506b7] __vb2_queue_cancel+0x157/0x180
[  270.926030]  [81850766] vb2_ioctl_streamoff+0x56/0x60
[  270.931019]  [81838785] v4l_streamoff+0x15/0x20
[  270.935648]  [8183c2c4] __video_do_ioctl+0x294/0x310
[  270.940571]  [81bdd2f6] ? unix_stream_sendmsg+0x3a6/0x3e0
[  270.945806]  [8183bd50] video_usercopy+0x1f0/0x4b0
[  270.950581]  [8183c030] ? video_ioctl2+0x20/0x20
[  270.955479]  [81ae0e1f] ? sock_aio_write+0xcf/0xe0
[  270.960517]  [811771eb] ? free_pages.part.69+0x3b/0x40
[  270.965703]  [8118fe6d] ? tlb_finish_mmu+0x2d/0x40
[  270.970702]  [8183c020] video_ioctl2+0x10/0x20
[  270.975462

LOAN

2014-04-28 Thread Bakker, K.
Dear valued customer,

Do you need an urgent loan to pay of your bills, invest more on your business, 
if yes PREMIUM CAPITAL LOAN offer loan at 3% interest rate. We are fast and 
reliable when it comes to loan lending contact email: 
premiumcapitall...@hotmail.co.uk for more information.

Contact email: premiumcapitall...@hotmail.co.uk

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] s5p-mfc: Add IOMMU support

2014-04-28 Thread Laurent Pinchart
Hi Arun,

On Tuesday 22 April 2014 17:52:08 Arun Kumar K wrote:
 On Tue, Apr 22, 2014 at 5:23 PM, Laurent Pinchart wrote:
  On Tuesday 22 April 2014 16:32:48 Arun Kumar K wrote:
  The patch adds IOMMU support for MFC driver.
  
  I've been working on an IOMMU driver lately, which led me to think about
  how drivers should be interfaced with IOMMUs. Runtime IOMMU handling is
  performed by the DMA mapping API, but in many cases (including Exynos
  platforms) the arm_iommu_create_mapping() and arm_iommu_attach_device()
  functions still need to be called explicitly by drivers, which doesn't
  seem a very good idea to me. Ideally IOMMU usage should be completely
  transparent for bus master drivers, without requiring any driver
  modification to use the IOMMU.
  
  What would you think about improving the Exynos IOMMU driver to create the
  mapping and attach the device instead of having to modify all bus master
  drivers ? See the ipmmu_add_device() function in
  http://www.spinics.net/lists/linux-sh/msg30488.html for a possible
  implementation.
 
 Yes that would be a better solution. But as far as I know, exynos platforms
 has few more complications where multiple IOMMUs are present for single IP.
 The exynos iommu work is still under progress and KyonHo Cho will have some
 inputs / comments on this. This seems to me a valid usecase which can be
 considered for exynos iommu also.

Thank you. Just to be clear, I don't see a reason to delay this patch until 
the Exynos IOMMU driver gets support for creating mappings and attaching 
devices, but it would be nice to see that happen as a cleanup in the not too 
distant future.

  Signed-off-by: Arun Kumar K arun...@samsung.com
  ---
  This patch is tested on IOMMU support series [1] posted
  by KyonHo Cho.
  [1] https://lkml.org/lkml/2014/3/14/9
  ---
  
   drivers/media/platform/s5p-mfc/s5p_mfc.c |   33
   +++
   1 file changed, 33 insertions(+)
  
  diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c
  b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 89356ae..1f248ba 100644
  --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
  +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
  @@ -32,11 +32,18 @@
  
   #include s5p_mfc_opr.h
   #include s5p_mfc_cmd.h
   #include s5p_mfc_pm.h
  
  +#ifdef CONFIG_EXYNOS_IOMMU
  +#include asm/dma-iommu.h
  +#endif
  
   #define S5P_MFC_NAME s5p-mfc
   #define S5P_MFC_DEC_NAME s5p-mfc-dec
   #define S5P_MFC_ENC_NAME s5p-mfc-enc
  
  +#ifdef CONFIG_EXYNOS_IOMMU
  +static struct dma_iommu_mapping *mapping;
  +#endif
  +
  
   int debug;
   module_param(debug, int, S_IRUGO | S_IWUSR);
   MODULE_PARM_DESC(debug, Debug level - higher value produces more
   verbose
  
  messages); @@ -1013,6 +1020,23 @@ static void *mfc_get_drv_data(struct
  platform_device *pdev);
  
   static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev)
   {
  
  +#ifdef CONFIG_EXYNOS_IOMMU
  + struct device *mdev = dev-plat_dev-dev;
  +
  + mapping = arm_iommu_create_mapping(platform_bus_type, 0x2000,
  + SZ_256M);
  + if (mapping == NULL) {
  + mfc_err(IOMMU mapping failed\n);
  + return -EFAULT;
  + }
  + mdev-dma_parms = devm_kzalloc(dev-plat_dev-dev,
  + sizeof(*mdev-dma_parms), GFP_KERNEL);
  + dma_set_max_seg_size(mdev, 0xu);
  + arm_iommu_attach_device(mdev, mapping);
  +
  + dev-mem_dev_l = dev-mem_dev_r = mdev;
  + return 0;
  +#else
  
unsigned int mem_info[2] = { };

dev-mem_dev_l = devm_kzalloc(dev-plat_dev-dev,
  
  @@ -1049,6 +1073,7 @@ static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev
  *dev) return -ENOMEM;
  
}
return 0;
  
  +#endif
  
   }
   
   /* MFC probe function */
  
  @@ -1228,6 +1253,10 @@ err_mem_init_ctx_1:
vb2_dma_contig_cleanup_ctx(dev-alloc_ctx[0]);
   
   err_res:
s5p_mfc_final_pm(dev);
  
  +#ifdef CONFIG_EXYNOS_IOMMU
  + if (mapping)
  + arm_iommu_release_mapping(mapping);
  +#endif
  
pr_debug(%s-- with error\n, __func__);
return ret;
  
  @@ -1256,6 +1285,10 @@ static int s5p_mfc_remove(struct platform_device
  *pdev) put_device(dev-mem_dev_r);
  
}
  
  +#ifdef CONFIG_EXYNOS_IOMMU
  + if (mapping)
  + arm_iommu_release_mapping(mapping);
  +#endif
  
s5p_mfc_final_pm(dev);
return 0;
   
   }

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] v4l: subdev: Move [gs]_std operation to video ops

2014-04-28 Thread Laurent Pinchart
The g_std and s_std operations are video-related, move them to the video
ops where they belong.

Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
Acked-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/i2c/adv7180.c |  2 +-
 drivers/media/i2c/adv7183.c |  4 ++--
 drivers/media/i2c/adv7842.c |  4 ++--
 drivers/media/i2c/bt819.c   |  2 +-
 drivers/media/i2c/cx25840/cx25840-core.c|  4 ++--
 drivers/media/i2c/ks0127.c  |  6 +-
 drivers/media/i2c/ml86v7667.c   |  2 +-
 drivers/media/i2c/msp3400-driver.c  |  2 +-
 drivers/media/i2c/saa6752hs.c   |  2 +-
 drivers/media/i2c/saa7110.c |  2 +-
 drivers/media/i2c/saa7115.c |  2 +-
 drivers/media/i2c/saa717x.c |  2 +-
 drivers/media/i2c/saa7191.c |  2 +-
 drivers/media/i2c/soc_camera/tw9910.c   |  4 ++--
 drivers/media/i2c/sony-btf-mpx.c| 10 +-
 drivers/media/i2c/tvaudio.c |  6 +-
 drivers/media/i2c/tvp514x.c |  2 +-
 drivers/media/i2c/tvp5150.c |  2 +-
 drivers/media/i2c/tw2804.c  |  2 +-
 drivers/media/i2c/tw9903.c  |  2 +-
 drivers/media/i2c/tw9906.c  |  2 +-
 drivers/media/i2c/vp27smpx.c|  6 +-
 drivers/media/i2c/vpx3220.c |  2 +-
 drivers/media/pci/bt8xx/bttv-driver.c   |  2 +-
 drivers/media/pci/cx18/cx18-av-core.c   |  2 +-
 drivers/media/pci/cx18/cx18-fileops.c   |  2 +-
 drivers/media/pci/cx18/cx18-gpio.c  |  6 +-
 drivers/media/pci/cx18/cx18-ioctl.c |  2 +-
 drivers/media/pci/cx23885/cx23885-video.c   |  4 ++--
 drivers/media/pci/cx88/cx88-core.c  |  2 +-
 drivers/media/pci/ivtv/ivtv-fileops.c   |  2 +-
 drivers/media/pci/ivtv/ivtv-ioctl.c |  2 +-
 drivers/media/pci/saa7134/saa7134-video.c   |  4 ++--
 drivers/media/pci/saa7146/mxb.c | 14 +++---
 drivers/media/pci/sta2x11/sta2x11_vip.c |  4 ++--
 drivers/media/pci/zoran/zoran_device.c  |  2 +-
 drivers/media/pci/zoran/zoran_driver.c  |  2 +-
 drivers/media/platform/blackfin/bfin_capture.c  |  4 ++--
 drivers/media/platform/davinci/vpfe_capture.c   |  2 +-
 drivers/media/platform/davinci/vpif_capture.c   |  2 +-
 drivers/media/platform/davinci/vpif_display.c   |  2 +-
 drivers/media/platform/fsl-viu.c|  2 +-
 drivers/media/platform/soc_camera/soc_camera.c  |  4 ++--
 drivers/media/platform/timblogiw.c  |  2 +-
 drivers/media/platform/vino.c   |  6 +++---
 drivers/media/usb/au0828/au0828-video.c |  4 ++--
 drivers/media/usb/cx231xx/cx231xx-417.c |  2 +-
 drivers/media/usb/cx231xx/cx231xx-video.c   |  6 +++---
 drivers/media/usb/em28xx/em28xx-video.c |  4 ++--
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c |  2 +-
 drivers/media/usb/stk1160/stk1160-v4l.c |  4 ++--
 drivers/media/usb/tm6000/tm6000-cards.c |  2 +-
 drivers/media/usb/tm6000/tm6000-video.c |  2 +-
 drivers/media/usb/usbvision/usbvision-video.c   |  2 +-
 drivers/media/v4l2-core/tuner-core.c|  6 +-
 drivers/staging/media/davinci_vpfe/vpfe_video.c |  2 +-
 drivers/staging/media/go7007/go7007-v4l2.c  |  2 +-
 drivers/staging/media/go7007/s2250-board.c  |  2 +-
 drivers/staging/media/go7007/saa7134-go7007.c   |  4 
 include/media/v4l2-subdev.h |  6 +++---
 60 files changed, 107 insertions(+), 91 deletions(-)

Changes compared to v1:

- Rebase on top of the latest media tree master branch

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 5e638b1..ac1cdbe 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -461,6 +461,7 @@ static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
 }
 
 static const struct v4l2_subdev_video_ops adv7180_video_ops = {
+   .s_std = adv7180_s_std,
.querystd = adv7180_querystd,
.g_input_status = adv7180_g_input_status,
.s_routing = adv7180_s_routing,
@@ -472,7 +473,6 @@ static const struct v4l2_subdev_video_ops adv7180_video_ops 
= {
 };
 
 static const struct v4l2_subdev_core_ops adv7180_core_ops = {
-   .s_std = adv7180_s_std,
.s_power = adv7180_s_power,
 };
 
diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c
index d45e0e3..df461b0 100644
--- a/drivers/media/i2c/adv7183.c
+++ b/drivers/media/i2c/adv7183.c
@@ -501,8 +501,6 @@ static const struct v4l2_ctrl_ops adv7183_ctrl_ops = {
 
 static const struct v4l2_subdev_core_ops adv7183_core_ops = {
.log_status = adv7183_log_status,
-   .g_std = adv7183_g_std,
-   .s_std = adv7183_s_std,
.reset = adv7183_reset,
 

[PATCH 7/6] media: videobuf2-dma-sg: call find_vma with the mmap_sem held

2014-04-28 Thread Davidlohr Bueso
Performing vma lookups without taking the mm-mmap_sem is asking
for trouble. While doing the search, the vma in question can
be modified or even removed before returning to the caller.
Take the lock in order to avoid races while iterating through
the vmacache and/or rbtree.

Also do some very minor cleanup changes.

This patch is only compile tested.

Signed-off-by: Davidlohr Bueso davidl...@hp.com
Cc: Pawel Osciak pa...@osciak.com
Cc: Marek Szyprowski m.szyprow...@samsung.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Mauro Carvalho Chehab m.che...@samsung.com
Cc: linux-media@vger.kernel.org
---
It would seem this is the last offending user. 
v4l2 is a maze but I believe that this is needed as I don't
see the mmap_sem being taken by any callers of vb2_dma_sg_get_userptr().

 drivers/media/v4l2-core/videobuf2-dma-sg.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c 
b/drivers/media/v4l2-core/videobuf2-dma-sg.c
index c779f21..2a21100 100644
--- a/drivers/media/v4l2-core/videobuf2-dma-sg.c
+++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c
@@ -168,8 +168,9 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, 
unsigned long vaddr,
unsigned long first, last;
int num_pages_from_user;
struct vm_area_struct *vma;
+   struct mm_struct *mm = current-mm;
 
-   buf = kzalloc(sizeof *buf, GFP_KERNEL);
+   buf = kzalloc(sizeof(*buf), GFP_KERNEL);
if (!buf)
return NULL;
 
@@ -178,7 +179,7 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, 
unsigned long vaddr,
buf-offset = vaddr  ~PAGE_MASK;
buf-size = size;
 
-   first = (vaddrPAGE_MASK)  PAGE_SHIFT;
+   first = (vaddr  PAGE_MASK)  PAGE_SHIFT;
last  = ((vaddr + size - 1)  PAGE_MASK)  PAGE_SHIFT;
buf-num_pages = last - first + 1;
 
@@ -187,7 +188,8 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, 
unsigned long vaddr,
if (!buf-pages)
goto userptr_fail_alloc_pages;
 
-   vma = find_vma(current-mm, vaddr);
+   down_write(mm-mmap_sem);
+   vma = find_vma(mm, vaddr);
if (!vma) {
dprintk(1, no vma for address %lu\n, vaddr);
goto userptr_fail_find_vma;
@@ -218,7 +220,7 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, 
unsigned long vaddr,
buf-pages[num_pages_from_user] = pfn_to_page(pfn);
}
} else
-   num_pages_from_user = get_user_pages(current, current-mm,
+   num_pages_from_user = get_user_pages(current, mm,
 vaddr  PAGE_MASK,
 buf-num_pages,
 write,
@@ -233,6 +235,7 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, 
unsigned long vaddr,
buf-num_pages, buf-offset, size, 0))
goto userptr_fail_alloc_table_from_pages;
 
+   up_write(mm-mmap_sem);
return buf;
 
 userptr_fail_alloc_table_from_pages:
@@ -244,6 +247,7 @@ userptr_fail_get_user_pages:
put_page(buf-pages[num_pages_from_user]);
vb2_put_vma(buf-vma);
 userptr_fail_find_vma:
+   up_write(mm-mmap_sem);
kfree(buf-pages);
 userptr_fail_alloc_pages:
kfree(buf);
-- 
1.8.1.4



--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL v2 FOR v3.16] adv7604: ADV7611 and DT support

2014-04-28 Thread Laurent Pinchart
Hi Mauro,

The following changes since commit 393cbd8dc532c1ebed60719da8d379f50d445f28:

  [media] smiapp: Use %u for printing u32 value (2014-04-23 16:05:06 -0300)

are available in the git repository at:

  git://linuxtv.org/pinchartl/media.git linuxtv/adv7611

for you to fetch changes up to 89d3226804151fb97049ecc2170ea46aaa6f7f60:

  adv7604: Set HPD GPIO direction to output (2014-04-28 21:03:58 +0200)


Lars-Peter Clausen (4):
  adv7604: Add missing include to linux/types.h
  adv7604: Add support for asynchronous probing
  adv7604: Don't put info string arrays on the stack
  adv7604: Add adv7611 support

Laurent Pinchart (44):
  v4l: Add UYVY10_2X10 and VYUY10_2X10 media bus pixel codes
  v4l: Add UYVY10_1X20 and VYUY10_1X20 media bus pixel codes
  v4l: Add 12-bit YUV 4:2:0 media bus pixel codes
  v4l: Add 12-bit YUV 4:2:2 media bus pixel codes
  v4l: Add pad-level DV timings subdev operations
  ad9389b: Add pad-level DV timings operations
  adv7511: Add pad-level DV timings operations
  adv7842: Add pad-level DV timings operations
  s5p-tv: hdmi: Add pad-level DV timings operations
  s5p-tv: hdmiphy: Add pad-level DV timings operations
  ths8200: Add pad-level DV timings operations
  tvp7002: Add pad-level DV timings operations
  media: bfin_capture: Switch to pad-level DV operations
  media: davinci: vpif: Switch to pad-level DV operations
  media: staging: davinci: vpfe: Switch to pad-level DV operations
  s5p-tv: mixer: Switch to pad-level DV operations
  ad9389b: Remove deprecated video-level DV timings operations
  adv7511: Remove deprecated video-level DV timings operations
  adv7842: Remove deprecated video-level DV timings operations
  s5p-tv: hdmi: Remove deprecated video-level DV timings operations
  s5p-tv: hdmiphy: Remove deprecated video-level DV timings operation
  ths8200: Remove deprecated video-level DV timings operations
  tvp7002: Remove deprecated video-level DV timings operations
  v4l: Improve readability by not wrapping ioctl number #define's
  v4l: Add support for DV timings ioctls on subdev nodes
  v4l: Validate fields in the core code for subdev EDID ioctls
  adv7604: Add 16-bit read functions for CP and HDMI
  adv7604: Cache register contents when reading multiple bits
  adv7604: Remove subdev control handlers
  adv7604: Add sink pads
  adv7604: Make output format configurable through pad format operations
  adv7604: Add pad-level DV timings support
  adv7604: Remove deprecated video-level DV timings operations
  v4l: subdev: Remove deprecated video-level DV timings operations
  adv7604: Inline the to_sd function
  adv7604: Store I2C addresses and clients in arrays
  adv7604: Replace *_and_or() functions with *_clr_set()
  adv7604: Sort headers alphabetically
  adv7604: Support hot-plug detect control through a GPIO
  adv7604: Specify the default input through platform data
  adv7604: Add DT support
  adv7604: Add LLC polarity configuration
  adv7604: Add endpoint properties to DT bindings
  adv7604: Set HPD GPIO direction to output

 Documentation/DocBook/media/v4l/subdev-formats.xml  |  760 
 .../DocBook/media/v4l/vidioc-dv-timings-cap.xml |   27 +-
 .../DocBook/media/v4l/vidioc-enum-dv-timings.xml|   30 +-
 Documentation/devicetree/bindings/media/i2c/adv7604.txt |   70 ++
 drivers/media/i2c/ad9389b.c |   64 +-
 drivers/media/i2c/adv7511.c |   66 +-
 drivers/media/i2c/adv7604.c | 1468 ++
 drivers/media/i2c/adv7842.c |   14 +-
 drivers/media/i2c/ths8200.c |   10 +
 drivers/media/i2c/tvp7002.c |5 +-
 drivers/media/platform/blackfin/bfin_capture.c  |4 +-
 drivers/media/platform/davinci/vpif_capture.c   |4 +-
 drivers/media/platform/davinci/vpif_display.c   |4 +-
 drivers/media/platform/s5p-tv/hdmi_drv.c|   14 +-
 drivers/media/platform/s5p-tv/hdmiphy_drv.c |9 +-
 drivers/media/platform/s5p-tv/mixer_video.c |8 +-
 drivers/media/v4l2-core/v4l2-subdev.c   |   51 +-
 drivers/staging/media/davinci_vpfe/vpfe_video.c |4 +-
 include/media/adv7604.h |  124 +-
 include/media/v4l2-subdev.h |8 +-
 include/uapi/linux/v4l2-mediabus.h  |   14 +-
 include/uapi/linux/v4l2-subdev.h|   40 +-
 include/uapi/linux/videodev2.h  |   10 +-
 23 files changed, 2188 insertions(+), 620 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/adv7604.txt

-- 
Regards,

Laurent 

[PATCH v3] v4l: subdev: Move [gs]_std operation to video ops

2014-04-28 Thread Laurent Pinchart
The g_std and s_std operations are video-related, move them to the video
ops where they belong.

Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
Acked-by: Hans Verkuil hans.verk...@cisco.com
Acked-by: Lad, Prabhakar prabhakar.cse...@gmail.com
---
 drivers/media/i2c/adv7180.c |  2 +-
 drivers/media/i2c/adv7183.c |  4 ++--
 drivers/media/i2c/adv7842.c |  4 ++--
 drivers/media/i2c/bt819.c   |  2 +-
 drivers/media/i2c/cx25840/cx25840-core.c|  4 ++--
 drivers/media/i2c/ks0127.c  |  6 +-
 drivers/media/i2c/ml86v7667.c   |  2 +-
 drivers/media/i2c/msp3400-driver.c  |  2 +-
 drivers/media/i2c/saa6752hs.c   |  2 +-
 drivers/media/i2c/saa7110.c |  2 +-
 drivers/media/i2c/saa7115.c |  2 +-
 drivers/media/i2c/saa717x.c |  2 +-
 drivers/media/i2c/saa7191.c |  2 +-
 drivers/media/i2c/soc_camera/tw9910.c   |  4 ++--
 drivers/media/i2c/sony-btf-mpx.c| 10 +-
 drivers/media/i2c/tvaudio.c |  6 +-
 drivers/media/i2c/tvp514x.c |  2 +-
 drivers/media/i2c/tvp5150.c |  2 +-
 drivers/media/i2c/tw2804.c  |  2 +-
 drivers/media/i2c/tw9903.c  |  2 +-
 drivers/media/i2c/tw9906.c  |  2 +-
 drivers/media/i2c/vp27smpx.c|  6 +-
 drivers/media/i2c/vpx3220.c |  2 +-
 drivers/media/pci/bt8xx/bttv-driver.c   |  2 +-
 drivers/media/pci/cx18/cx18-av-core.c   |  2 +-
 drivers/media/pci/cx18/cx18-fileops.c   |  2 +-
 drivers/media/pci/cx18/cx18-gpio.c  |  6 +-
 drivers/media/pci/cx18/cx18-ioctl.c |  2 +-
 drivers/media/pci/cx23885/cx23885-video.c   |  4 ++--
 drivers/media/pci/cx88/cx88-core.c  |  2 +-
 drivers/media/pci/ivtv/ivtv-fileops.c   |  2 +-
 drivers/media/pci/ivtv/ivtv-ioctl.c |  2 +-
 drivers/media/pci/saa7134/saa7134-video.c   |  4 ++--
 drivers/media/pci/saa7146/mxb.c | 14 +++---
 drivers/media/pci/sta2x11/sta2x11_vip.c |  4 ++--
 drivers/media/pci/zoran/zoran_device.c  |  2 +-
 drivers/media/pci/zoran/zoran_driver.c  |  2 +-
 drivers/media/platform/blackfin/bfin_capture.c  |  4 ++--
 drivers/media/platform/davinci/vpfe_capture.c   |  2 +-
 drivers/media/platform/davinci/vpif_capture.c   |  2 +-
 drivers/media/platform/davinci/vpif_display.c   |  2 +-
 drivers/media/platform/fsl-viu.c|  2 +-
 drivers/media/platform/soc_camera/soc_camera.c  |  4 ++--
 drivers/media/platform/timblogiw.c  |  2 +-
 drivers/media/platform/vino.c   |  6 +++---
 drivers/media/usb/au0828/au0828-video.c |  4 ++--
 drivers/media/usb/cx231xx/cx231xx-417.c |  2 +-
 drivers/media/usb/cx231xx/cx231xx-video.c   |  6 +++---
 drivers/media/usb/em28xx/em28xx-video.c |  4 ++--
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c |  2 +-
 drivers/media/usb/stk1160/stk1160-v4l.c |  4 ++--
 drivers/media/usb/tm6000/tm6000-cards.c |  2 +-
 drivers/media/usb/tm6000/tm6000-video.c |  2 +-
 drivers/media/usb/usbvision/usbvision-video.c   |  2 +-
 drivers/media/v4l2-core/tuner-core.c|  6 +-
 drivers/staging/media/davinci_vpfe/vpfe_video.c |  2 +-
 drivers/staging/media/go7007/go7007-v4l2.c  |  2 +-
 drivers/staging/media/go7007/s2250-board.c  |  2 +-
 drivers/staging/media/go7007/saa7134-go7007.c   |  4 
 include/media/v4l2-subdev.h |  6 +++---
 60 files changed, 107 insertions(+), 91 deletions(-)

Changes compared to v2:

- Picked Prabhakar's Acked-by tag

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 5e638b1..ac1cdbe 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -461,6 +461,7 @@ static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
 }
 
 static const struct v4l2_subdev_video_ops adv7180_video_ops = {
+   .s_std = adv7180_s_std,
.querystd = adv7180_querystd,
.g_input_status = adv7180_g_input_status,
.s_routing = adv7180_s_routing,
@@ -472,7 +473,6 @@ static const struct v4l2_subdev_video_ops adv7180_video_ops 
= {
 };
 
 static const struct v4l2_subdev_core_ops adv7180_core_ops = {
-   .s_std = adv7180_s_std,
.s_power = adv7180_s_power,
 };
 
diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c
index d45e0e3..df461b0 100644
--- a/drivers/media/i2c/adv7183.c
+++ b/drivers/media/i2c/adv7183.c
@@ -501,8 +501,6 @@ static const struct v4l2_ctrl_ops adv7183_ctrl_ops = {
 
 static const struct v4l2_subdev_core_ops adv7183_core_ops = {
.log_status = adv7183_log_status,
-   .g_std = adv7183_g_std,
-   .s_std = adv7183_s_std,
  

Re: [PATCH] Kernel 3.15-rc2 : Peak DVB-T USB tuner device ids for rtl28xxu driver

2014-04-28 Thread Brian Healy
On Sun, Apr 27, 2014 at 03:19:12PM -0700, Linus Torvalds wrote:

Hi Linus,

apologies, i've changed email clients in order to preserve the
formatting this time around. The patch is now included inline as an
attachment. I ran the script but noticed you've already cc'd the
appropriate people. 

Brian.


Resubmitting modified patch. It's purpose is to add the appropriate
device/usb ids for the Peak DVT-B usb dongle to the rtl28xxu.c driver.

Signed-off-by: Brian Healy healybrian at gmail.com


 Brian, please use
 
  ./scripts/get_maintainer -f drivers/media/usb/dvb-usb-v2/rtl28xxu.c
 
 to get the proper people to send this to, so that it doesn't get lost
 in the flood in lkml.
 
 The indentation of that new entry also seems to be suspect, in that it
 doesn't match the ones around it.
 
 Quoting full email for context for people added.
 
  Linus
 
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index 61d196e..b6e20cc 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -1499,6 +1499,8 @@ static const struct usb_device_id rtl28xxu_id_table[] = {
 		rtl2832u_props, Crypto ReDi PC 50 A, NULL) },
 	{ DVB_USB_DEVICE(USB_VID_KYE, 0x707f,
 		rtl2832u_props, Genius TVGo DVB-T03, NULL) },
+{ DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd395,
+rtl2832u_props, Peak DVB-T USB, NULL) },
 
 	/* RTL2832P devices: */
 	{ DVB_USB_DEVICE(USB_VID_HANFTEK, 0x0131,


Fw: + media-videobuf2-dma-sg-call-find_vma-with-the-mmap_sem-held.patch added to -mm tree

2014-04-28 Thread Mauro Carvalho Chehab
Hi Hans,

Could you please take a look at this patch? I remember you had to revert a
VB2 patch from Al Viro, as it caused some regressions. Not sure if this one
is similar to the one that was reverted.

Thanks,
Mauro

Forwarded message:

Date: Mon, 28 Apr 2014 15:04:06 -0700
From: a...@linux-foundation.org
To: mm-comm...@vger.kernel.org, pa...@osciak.com, m.szyprow...@samsung.com, 
m.che...@samsung.com, kyungmin.p...@samsung.com, davidl...@hp.com
Subject: + media-videobuf2-dma-sg-call-find_vma-with-the-mmap_sem-held.patch 
added to -mm tree


Subject: + media-videobuf2-dma-sg-call-find_vma-with-the-mmap_sem-held.patch 
added to -mm tree
To: 
davidl...@hp.com,kyungmin.p...@samsung.com,m.che...@samsung.com,m.szyprow...@samsung.com,pa...@osciak.com
From: a...@linux-foundation.org
Date: Mon, 28 Apr 2014 15:04:06 -0700


The patch titled
 Subject: drivers/media/v4l2-core/videobuf2-dma-sg.c: call find_vma with 
the mmap_sem held
has been added to the -mm tree.  Its filename is
 media-videobuf2-dma-sg-call-find_vma-with-the-mmap_sem-held.patch

This patch should soon appear at

http://ozlabs.org/~akpm/mmots/broken-out/media-videobuf2-dma-sg-call-find_vma-with-the-mmap_sem-held.patch
and later at

http://ozlabs.org/~akpm/mmotm/broken-out/media-videobuf2-dma-sg-call-find_vma-with-the-mmap_sem-held.patch

Before you just go and hit reply, please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

--
From: Davidlohr Bueso davidl...@hp.com
Subject: drivers/media/v4l2-core/videobuf2-dma-sg.c: call find_vma with the 
mmap_sem held

Performing vma lookups without taking the mm-mmap_sem is asking for
trouble.  While doing the search, the vma in question can be modified or
even removed before returning to the caller.  Take the lock in order to
avoid races while iterating through the vmacache and/or rbtree.

Also do some very minor cleanup changes.

Signed-off-by: Davidlohr Bueso davidl...@hp.com
Cc: Pawel Osciak pa...@osciak.com
Cc: Marek Szyprowski m.szyprow...@samsung.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Mauro Carvalho Chehab m.che...@samsung.com
Signed-off-by: Andrew Morton a...@linux-foundation.org
---

 drivers/media/v4l2-core/videobuf2-dma-sg.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff -puN 
drivers/media/v4l2-core/videobuf2-dma-sg.c~media-videobuf2-dma-sg-call-find_vma-with-the-mmap_sem-held
 drivers/media/v4l2-core/videobuf2-dma-sg.c
--- 
a/drivers/media/v4l2-core/videobuf2-dma-sg.c~media-videobuf2-dma-sg-call-find_vma-with-the-mmap_sem-held
+++ a/drivers/media/v4l2-core/videobuf2-dma-sg.c
@@ -168,8 +168,9 @@ static void *vb2_dma_sg_get_userptr(void
unsigned long first, last;
int num_pages_from_user;
struct vm_area_struct *vma;
+   struct mm_struct *mm = current-mm;
 
-   buf = kzalloc(sizeof *buf, GFP_KERNEL);
+   buf = kzalloc(sizeof(*buf), GFP_KERNEL);
if (!buf)
return NULL;
 
@@ -178,7 +179,7 @@ static void *vb2_dma_sg_get_userptr(void
buf-offset = vaddr  ~PAGE_MASK;
buf-size = size;
 
-   first = (vaddrPAGE_MASK)  PAGE_SHIFT;
+   first = (vaddr  PAGE_MASK)  PAGE_SHIFT;
last  = ((vaddr + size - 1)  PAGE_MASK)  PAGE_SHIFT;
buf-num_pages = last - first + 1;
 
@@ -187,7 +188,8 @@ static void *vb2_dma_sg_get_userptr(void
if (!buf-pages)
goto userptr_fail_alloc_pages;
 
-   vma = find_vma(current-mm, vaddr);
+   down_write(mm-mmap_sem);
+   vma = find_vma(mm, vaddr);
if (!vma) {
dprintk(1, no vma for address %lu\n, vaddr);
goto userptr_fail_find_vma;
@@ -218,7 +220,7 @@ static void *vb2_dma_sg_get_userptr(void
buf-pages[num_pages_from_user] = pfn_to_page(pfn);
}
} else
-   num_pages_from_user = get_user_pages(current, current-mm,
+   num_pages_from_user = get_user_pages(current, mm,
 vaddr  PAGE_MASK,
 buf-num_pages,
 write,
@@ -233,6 +235,7 @@ static void *vb2_dma_sg_get_userptr(void
buf-num_pages, buf-offset, size, 0))
goto userptr_fail_alloc_table_from_pages;
 
+   up_write(mm-mmap_sem);
return buf;
 
 userptr_fail_alloc_table_from_pages:
@@ -244,6 +247,7 @@ userptr_fail_get_user_pages:
put_page(buf-pages[num_pages_from_user]);
vb2_put_vma(buf-vma);
 userptr_fail_find_vma:
+   up_write(mm-mmap_sem);