Commit graph

546487 commits

Author SHA1 Message Date
Hans Verkuil
031d229772 [media] saa7164: fix format ioctls
Fix various v4l2-compliance issues in the formatting ioctls:

- the vbi device implemented video format ioctls which make no senses
  for a vbi device, remove them.
- remove the unused ts_packet_size and ts_packet_count fields.
- fill in colorspace and field.
- fill in sizeimage with a default value.
- for the video node the get, set and try format functions all do the
  same thing, so combine into a single function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:24:40 -03:00
Hans Verkuil
245b5ae95f [media] saa7164: add support for control events
Now that saa7164 uses v4l2_fh and that poll() has been fixed, it is
trivial to add support for control events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:23:29 -03:00
Hans Verkuil
45053edc05 [media] saa7164: fix poll bugs
- poll doesn't return negative values, so you can't return -EINVAL.
  Instead return POLLERR.
- poll can't be called if !video_is_registered(), so this test can
  be dropped.
- poll can never do a blocking wait, so remove that check.
- poll shouldn't attempt to start streaming if the caller isn't interested
  in read events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:22:41 -03:00
Hans Verkuil
d6d3fe2fe1 [media] saa7164: add v4l2_fh support
Control events require the use of struct v4l2_fh. Add this to saa7164.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:13:58 -03:00
Hans Verkuil
1a708ea013 [media] saa7164: convert to the control framework
Convert this driver to the control framework. Note that the VBI device
nodes have no controls as there is nothing to control.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:13:26 -03:00
Ricardo Ribalda
28c5029275 [media] media/v4l2-compat-ioctl32: Simple stylechecks
The next patches on the series need this modifications to pass clean
checkpath.pl.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:51:43 -03:00
Ricardo Ribalda
d9e7d2285a [media] videodev2.h: Fix typo in comment
Referenced file has moved

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:50:37 -03:00
Hans Verkuil
b96c544f44 [media] vivid: add 10 and 12 bit Bayer formats
Add support for 10 and 12 bit Bayer formats to the test pattern generator
and the vivid driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:49:45 -03:00
Hans Verkuil
d5beb67bc7 [media] v4l2-compat-ioctl32: add missing SDR support
Add the missing support for v4l2_sdr_format (V4L2_BUF_TYPE_SDR_CAPTURE).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:48:35 -03:00
Geliang Tang
fd4b0d7518 [media] media: fix kernel-doc warnings in v4l2-dv-timings.h
Fix the following 'make htmldocs' warnings:

  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'frame_height'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'hfreq'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'vsync'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'active_width'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'polarities'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'interlaced'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'fmt'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'frame_height'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'hfreq'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'vsync'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'polarities'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'interlaced'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'aspect'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'fmt'
  .//include/media/v4l2-dv-timings.h:184: warning: No description found for parameter 'hor_landscape'
  .//include/media/v4l2-dv-timings.h:184: warning: No description found for parameter 'vert_portrait'

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:47:57 -03:00
Hans Verkuil
d006a9791d [media] vim2m: small cleanup: use assignment instead of memcpy
Use a type-safe assignment instead of memcpy. And it is easier to read as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:47:33 -03:00
Hans Verkuil
00507a8d6a [media] DocBook media: Document the SMPTE 2084 transfer function
Document this new transfer function used by High Dynamic Range content.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:46:55 -03:00
Hans Verkuil
c732e647ba [media] vivid: add support for SMPTE 2084 transfer function
Support the new SMPTE 2084 transfer function in the vivid test driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:49:41 -03:00
Hans Verkuil
b258480aa7 [media] vivid-tpg: add support for SMPTE 2084 transfer function
Support the new SMPTE 2084 transfer function in the test pattern generator.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:49:16 -03:00
Hans Verkuil
2bdd28017e [media] videodev2.h: add SMPTE 2084 transfer function define
CEA-861.3 adds support for the SMPTE 2084 Electro-Optical Transfer Function
as can be used in HDR displays. Add a define for this in videodev2.h.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:48:27 -03:00
Hans Verkuil
1d78053549 [media] vivid: add support for the DCI-P3 colorspace
Support this new colorspace in vivid.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:47:17 -03:00
Hans Verkuil
b592b52e2b [media] vivid-tpg: support the DCI-P3 colorspace
Add support to the test pattern generator for the DCI-P3 colorspace.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:46:39 -03:00
Hans Verkuil
7146a9cfa4 [media] DocBook media: document the new DCI-P3 colorspace
Document this colorspace.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:43:35 -03:00
Hans Verkuil
529a796030 [media] videodev2.h: add support for the DCI-P3 colorspace
This colorspace is used for cinema projectors and is supported by
the DisplayPort standard.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:42:18 -03:00
Hans Verkuil
2e94c19c07 [media] vivid: use Bradford method when converting Rec. 709 to NTSC 1953
The V4L2_COLORSPACE_470_SYSTEM_M (aka NTSC 1953) colorspace has a different
whitepoint (C) compared to Rec. 709 (D65). The Bradford method is the
recommended method to compensate for that when converting a Rec. 709 color
to an NTSC 1953 color.

See http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html for more
details on the Bradford method.

This patch updates the Rec. 709 to NTSC 1953 matrix so that it includes the
chromatic adaptation as calculated by the Bradford method, and it recalculates
the tpg_csc_colors table accordingly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:41:06 -03:00
Hans Verkuil
ff1447267b [media] vivid: use ARRAY_SIZE to calculate max control value
The max value of various menu controls is hardcoded, and it is easy to forget
to update it after adding a new menu item.

So use ARRAY_SIZE instead to calculate this value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:39:04 -03:00
Hans Verkuil
9ec32cc703 [media] v4l2-compat-ioctl32: replace pr_warn by pr_debug
Every time compat32 encounters an unknown ioctl it will call pr_warn.
However, that's very irritating since it is perfectly normal that this
happens. For example, applications often try to call an ioctl to see if
it exists, and if that's used with an older kernel where compat32 doesn't
support that ioctl yet, then it starts spamming the kernel log.

So replace pr_warn by pr_debug.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:44:14 -03:00
Josh Wu
ac4033e02a [media] atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity
This patch will get the DT parameters of vsync/hsync/pixclock polarity, and
pass to driver.

Also add a debug information for test purpose.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:42:12 -03:00
Laurent Pinchart
d32dd315ff [media] v4l: atmel-isi: Remove unused platform data fields
The emb_crc_sync, mck_hz, asd and asd_sizes platform data fields are
unused, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:41:23 -03:00
Laurent Pinchart
40a78f36fc [media] v4l: atmel-isi: Remove support for platform data
All in-tree users have migrated to DT, remove support for platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[josh.wu@atmel.com: squash the commit to remove the unused variable: dev]
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:37:07 -03:00
Laurent Pinchart
375123976f [media] v4l: atmel-isi: Simplify error handling during DT parsing
Put the endpoint DT node earlier to avoid the need for goto statements
to a cleanup code block in case of errors.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:36:32 -03:00
Josh Wu
9626d03e8d [media] atmel-isi: add sanity check for supported formats in try/set_fmt()
After adding the format check in try_fmt()/set_fmt(), we don't need any
format check in configure_geometry(). So make configure_geometry() as
void type.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:36:09 -03:00
Josh Wu
f653da3457 [media] atmel-isi: move configure_geometry() to start_streaming()
As in set_fmt() function we only need to know which format is been set,
we don't need to access the ISI hardware in this moment.

So move the configure_geometry(), which access the ISI hardware, to
start_streaming() will make code more consistent and simpler.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:35:47 -03:00
Josh Wu
ad5f9d1968 [media] atmel-isi: setup the ISI_CFG2 register directly
In the function configure_geometry(), we will setup the ISI CFG2
according to the sensor output format.

It make no sense to just read back the CFG2 register and just set part
of it.

So just set up this register directly makes things simpler.
Currently only support YUV format from camera sensor.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:35:15 -03:00
Josh Wu
d67b48824f [media] atmel-isi: increase timeout to disable/enable isi
If ISI is working on a 1024x768 or higher resolution, it needs longer
time to disable ISI. So this patch will increase timeout to 500ms.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:34:03 -03:00
Geert Uytterhoeven
18baba6458 [media] atmel-isi: Protect PM-only functions to kill warning
If CONFIG_PM=n:

    drivers/media/platform/soc_camera/atmel-isi.c:1044: warning: 'atmel_isi_runtime_suspend' defined but not used
    drivers/media/platform/soc_camera/atmel-isi.c:1054: warning: 'atmel_isi_runtime_resume' defined but not used

Protect the unused functions by #ifdef CONFIG_PM to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:33:21 -03:00
Sergei Shtylyov
f00ae754c5 [media] rcar_vin: call g_std() instead of querystd()
Hans Verkuil says: "The only place querystd can be called  is in the QUERYSTD
ioctl, all other ioctls should use the last set standard." So call the g_std()
subdevice method instead of querystd() in the driver's set_fmt() method.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:32:42 -03:00
Sergei Shtylyov
936ad8900c [media] rcar_vin: propagate querystd() error upstream
rcar_vin_set_fmt() defaults to  PAL when the subdevice's querystd() method call
fails (e.g. due to I2C error).  This doesn't work very well when a camera being
used  outputs NTSC which has different order of fields and resolution.  Let  us
stop  pretending and return the actual error except  when the querystd() method
is not implemented,  in which case  we'll have  to set the 'field' variable  to
V4L2_FIELD_NONE.

Note that doing this would prevent video capture on at least Renesas Henninger/
Porter boards where I2C seems particularly buggy.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:29:24 -03:00
Geert Uytterhoeven
db33386ae3 [media] rcar_vin: Remove obsolete r8a779x-vin platform_device_id entries
Since commit a483dcbfa2 ("ARM: shmobile: lager: Remove legacy
board support"), R-Car Gen2 SoCs are only supported in generic DT-only
ARM multi-platform builds.  The driver doesn't need to match platform
devices by name anymore, hence remove the corresponding
platform_device_id entry.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:26:57 -03:00
Josh Wu
3dcb8043fb [media] soc-camera: increase the length of clk_name on soc_of_bind()
Since in soc_of_bind() it may use the of node's full name as the clk_name,
and this full name may be longer than 32 characters, take at91 i2c sensor
as an example, length is 34 bytes:
   /ahb/apb/i2c@f8028000/camera@0x30

So this patch increase the clk_name[] array size to 64. It seems big
enough so far.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:26:27 -03:00
Laurent Pinchart
5d0fd3c806 [media] uvcvideo: Disable hardware timestamps by default
The hardware timestamping implementation has been reported as not
working correctly on at least the Logitech C920. Until this can be
fixed, disable it by default.

Reported-by: Peter Rabbitson <rabbit@rabbit.us>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:23:26 -03:00
Antti Palosaari
60f6873544 [media] vivid: sdr cap: few enhancements
* Constify struct

* Fix comments

* Fix alignment

* Use modulus to transfer phase angles

* Correct float [-1.0, +1.0] to s8 [-128, 127] conversion

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:22:00 -03:00
Antti Palosaari
f335c3f229 [media] vivid: SDR cap: add control for FM deviation
Add user control to adjust generated FM deviation.
Default it to 75kHz like public FM radio broadcast.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:21:13 -03:00
Andrzej Hajda
655e9780ab [media] v4l2-compat-ioctl32: fix alignment for ARM64
Alignment/padding rules on AMD64 and ARM64 differs. To allow properly match
compatible ioctls on ARM64 kernels without breaking AMD64 some fields
should be aligned using compat_s64 type and in one case struct should be
unpacked.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Cc: <stable@vger.kernel.org>      # for v3.10 and up
[hans.verkuil@cisco.com: use compat_u64 instead of compat_s64 in v4l2_input32]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:20:25 -03:00
Darek Zielski
63ab664ceb [media] saa7134: add Leadtek Winfast TV2100 FM card support
Add Leadtek Winfast TV2100 FM card to saa7134 driver. It is a card bearing
SAA7130HL chip.

Signed-off-by: Darek Zielski <dz1125tor@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:19:17 -03:00
Alexander Kuleshov
67dcfebdf9 [media] media/pci/cobalt: Use %*ph to print small buffers
printk() supports %*ph format specifier for printing a small buffers,
let's use it intead of %02x %02x...

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:18:47 -03:00
Zahari Doychev
f1a81afc98 [media] m2m: fix bad unlock balance
This patch removes unnecessary mutex queue unlock/lock sequence causing bad
unlock balance in v4l2_m2m_poll when the last buffer on the destination
queue has been dequeued and adds spin lock protection for the done list
list_empty calls.

[  144.990873] =====================================
[  144.995584] [ BUG: bad unlock balance detected! ]
[  145.000301] 4.1.0-00137-ga105070 #98 Tainted: G        W
[  145.006140] -------------------------------------
[  145.010851] demux:sink/487 is trying to release lock (&dev->dev_mutex) at:
[  145.017785] [<808cc578>] mutex_unlock+0x18/0x1c
[  145.022322] but there are no more locks to release!
[  145.027205]
[  145.027205] other info that might help us debug this:
[  145.033741] no locks held by demux:sink/487.
[  145.038015]
[  145.038015] stack backtrace:
[  145.042385] CPU: 2 PID: 487 Comm: demux:sink Tainted: G        W       4.1.0-00137-ga105070 #98
[  145.051089] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[  145.057622] Backtrace:
[  145.060102] [<80014a4c>] (dump_backtrace) from [<80014cc4>] (show_stack+0x20/0x24)
[  145.067679]  r6:80cedf78 r5:00000000 r4:00000000 r3:00000000
[  145.073421] [<80014ca4>] (show_stack) from [<808c61e0>] (dump_stack+0x8c/0xa4)
[  145.080661] [<808c6154>] (dump_stack) from [<80072b64>] (print_unlock_imbalance_bug+0xb8/0xe8)
[  145.089277]  r6:808cc578 r5:ac6cd050 r4:ac38e400 r3:00000001
[  145.095020] [<80072aac>] (print_unlock_imbalance_bug) from [<80077db4>] (lock_release+0x1a4/0x250)
[  145.103983]  r6:808cc578 r5:ac6cd050 r4:ac38e400 r3:00000000
[  145.109728] [<80077c10>] (lock_release) from [<808cc470>] (__mutex_unlock_slowpath+0xc4/0x1b4)
[  145.118344]  r9:acb27a41 r8:00000000 r7:81553814 r6:808cc578 r5:60030013 r4:ac6cd01c
[  145.126190] [<808cc3ac>] (__mutex_unlock_slowpath) from [<808cc578>] (mutex_unlock+0x18/0x1c)
[  145.134720]  r7:00000000 r6:aced7cd4 r5:00000041 r4:acb87800
[  145.140468] [<808cc560>] (mutex_unlock) from [<805a98b8>] (v4l2_m2m_fop_poll+0x5c/0x64)
[  145.148494] [<805a985c>] (v4l2_m2m_fop_poll) from [<805955a0>] (v4l2_poll+0x6c/0xa0)
[  145.156243]  r6:aced7bec r5:00000000 r4:ac6cc380 r3:805a985c
[  145.161991] [<80595534>] (v4l2_poll) from [<80156edc>] (do_sys_poll+0x230/0x4c0)
[  145.169391]  r5:00000000 r4:aced7be4
[  145.173013] [<80156cac>] (do_sys_poll) from [<801574a8>] (SyS_ppoll+0x1d4/0x1fc)
[  145.180414]  r10:00000000 r9:aced6000 r8:00000000 r7:00000000 r6:75c04538 r5:00000002
[  145.188338]  r4:00000000
[  145.190906] [<801572d4>] (SyS_ppoll) from [<800108c0>] (ret_fast_syscall+0x0/0x54)
[  145.198481]  r8:80010aa4 r7:00000150 r6:75c04538 r5:00000002 r4:00000008

Signed-off-by: Zahari Doychev <zahari.doychev@linux.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:18:27 -03:00
Nicolas Sugino
27315059e2 [media] ivtv-alsa: Add index to specify device number
When using multiple capture cards, it might be necessary to identify a
specific device with an ALSA one. If not, the order of the ALSA devices
might have no relation to the id of the radio or video device.

Signed-off-by: Nicolas Sugino <nsugino@3way.com.ar>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:17:08 -03:00
Andrew Milkovich
a1f8c0cff0 [media] Staging: media: bcm2048: warnings for uninitialized variables fixed
This patch fixes the following sparse warnings:
warning: ... may be used uninitialized in this function
Some function variables have been initialized to 0.

Signed-off-by: Andrew Milkovich <amilkovich@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:16:28 -03:00
Mauro Carvalho Chehab
9ddf9071ea Linux 4.3-rc1
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJV9LbmAAoJEHm+PkMAQRiGb40IAJWcETZb6hoCUIrGZX+4Znqy
 UXYY9BwybF+3yPsTKWRUWQGifNhUiW7ejNgMO3QYG+E1RgJ6uj8Mym9I11+x3a9D
 beIem8Ftf1Zwt71zg6DpUCNhlRIfa3TTnbQMIYmoIihVwYWVve1/rMPD5kgafF6P
 Xnp7QSUh7uCK/G06sksK9aB2GkRgvoMKfAgTHmj094f24udl87NyUo8O8mP5QWX2
 b0S5ZwlDRL64sio59QyxZK87f0TGnquDBLe6Gcl3wJQx/g3RzRpSxEkumylwx+S4
 u9xeHlorOkg8a+k62TgbC6GP0Y6Ptk+yMF6UFCPsifwQTRvJubrA2ofdfPuggCk=
 =aqcb
 -----END PGP SIGNATURE-----

Merge tag 'v4.3-rc1' into patchwork

Linux 4.3-rc1

* tag 'v4.3-rc1': (11838 commits)
  Linux 4.3-rc1
  blk: rq_data_dir() should not return a boolean
  writeback: plug writeback in wb_writeback() and writeback_inodes_wb()
  thermal: fix intel PCH thermal driver mismerge
  ARCv2: [axs103_smp] Reduce clk for SMP FPGA configs
  revert "ocfs2/dlm: use list_for_each_entry instead of list_for_each"
  mm/early_ioremap: add explicit #include of asm/early_ioremap.h
  fs/seq_file: convert int seq_vprint/seq_printf/etc... returns to void
  selftests: enhance membarrier syscall test
  selftests: add membarrier syscall test
  sys_membarrier(): system-wide memory barrier (generic, x86)
  MODSIGN: fix a compilation warning in extract-cert
  Revert "writeback: plug writeback at a high level"
  scsi_dh: fix randconfig build error
  target: use stringify.h instead of own definition
  target/user: Fix UFLAG_UNKNOWN_OP handling
  target: Remove no-op conditional
  target/user: Remove unused variable
  target: Fix max_cmd_sn increment w/o cmdsn mutex regressions
  target: Attach EXTENDED_COPY local I/O descriptors to xcopy_pt_sess
  ...
2015-09-13 11:10:12 -03:00
Linus Torvalds
6ff33f3902 Linux 4.3-rc1 2015-09-12 16:35:56 -07:00
Linus Torvalds
6917b51dee CRIS changes for 4.3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iEYEABECAAYFAlXqI2YACgkQ31LbvUHyf1eV9QCdH1QQrv3ze1j+5ut3hVGQFC7F
 s0oAnRWfi65O5J6Ns4gEGfbjSXvF2aNf
 =5RcU
 -----END PGP SIGNATURE-----

Merge tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris

Pull CRIS updates from Jesper Nilsson:
 "Mostly removal of old cruft of which we can use a generic version, or
  fixes for code not commonly run in the cris port, but also additions
  to enable some good debug"

* tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris: (25 commits)
  CRISv10: delete unused lib/dmacopy.c
  CRISv10: delete unused lib/old_checksum.c
  CRIS: fix switch_mm() lockdep splat
  CRISv32: enable LOCKDEP_SUPPORT
  CRIS: add STACKTRACE_SUPPORT
  CRISv32: annotate irq enable in idle loop
  CRISv32: add support for irqflags tracing
  CRIS: UAPI: use generic types.h
  CRIS: UAPI: use generic shmbuf.h
  CRIS: UAPI: use generic msgbuf.h
  CRIS: UAPI: use generic socket.h
  CRIS: UAPI: use generic sembuf.h
  CRIS: UAPI: use generic sockios.h
  CRIS: UAPI: use generic auxvec.h
  CRIS: UAPI: use generic headers via Kbuild
  CRIS: UAPI: fix elf.h export
  CRIS: don't make asm/elf.h depend on asm/user.h
  CRIS: UAPI: fix ptrace.h
  CRISv32: Squash compile warnings for axisflashmap
  CRISv32: Add GPIO driver to the default configs
  ...
2015-09-12 12:24:29 -07:00
Linus Torvalds
10fbd36e36 blk: rq_data_dir() should not return a boolean
rq_data_dir() returns either READ or WRITE (0 == READ, 1 == WRITE), not
a boolean value.

Now, admittedly the "!= 0" doesn't really change the value (0 stays as
zero, 1 stays as one), but it's not only redundant, it confuses gcc, and
causes gcc to warn about the construct

    switch (rq_data_dir(req)) {
        case READ:
            ...
        case WRITE:
            ...

that we have in a few drivers.

Now, the gcc warning is silly and stupid (it seems to warn not about the
switch value having a different type from the case statements, but about
_any_ boolean switch value), but in this case the code itself is silly
and stupid too, so let's just change it, and get rid of warnings like
this:

  drivers/block/hd.c: In function ‘hd_request’:
  drivers/block/hd.c:630:11: warning: switch condition has boolean value [-Wswitch-bool]
     switch (rq_data_dir(req)) {

The odd '!= 0' came in when "cmd_flags" got turned into a "u64" in
commit 5953316dbf ("block: make rq->cmd_flags be 64-bit") and is
presumably because the old code (that just did a logical 'and' with 1)
would then end up making the type of rq_data_dir() be u64 too.

But if we want to retain the old regular integer type, let's just cast
the result to 'int' rather than use that rather odd '!= 0'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-12 12:03:30 -07:00
Linus Torvalds
e1df8b0a1b Merge branch 'writeback-plugging'
Fix up the writeback plugging introduced in commit d353d7587d
("writeback: plug writeback at a high level") that then caused problems
due to the unplug happening with a spinlock held.

* writeback-plugging:
  writeback: plug writeback in wb_writeback() and writeback_inodes_wb()
  Revert "writeback: plug writeback at a high level"
2015-09-12 11:19:01 -07:00
Linus Torvalds
505a666ee3 writeback: plug writeback in wb_writeback() and writeback_inodes_wb()
We had to revert the pluggin in writeback_sb_inodes() because the
wb->list_lock is held, but we could easily plug at a higher level before
taking that lock, and unplug after releasing it.  This does that.

Chris will run performance numbers, just to verify that this approach is
comparable to the alternative (we could just drop and re-take the lock
around the blk_finish_plug() rather than these two commits.

I'd have preferred waiting for actual performance numbers before picking
one approach over the other, but I don't want to release rc1 with the
known "sleeping function called from invalid context" issue, so I'll
pick this cleanup version for now.  But if the numbers show that we
really want to plug just at the writeback_sb_inodes() level, and we
should just play ugly games with the spinlock, we'll switch to that.

Cc: Chris Mason <clm@fb.com>
Cc: Josef Bacik <jbacik@fb.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-12 11:13:07 -07:00