summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [media] omap3isp: create links after all subdevs have been boundJavier Martinez Canillas2016-01-111-8/+15
| | | | | | | | | | | | | | | | | | The omap3isp driver parses the graph endpoints to know how many subdevices needs to be registered async and register notifiers callbacks for to know when these are bound and when the async registrations are completed. Currently the entities pad are linked with the correct ISP input interface when the subdevs are bound but it happens before entitities are registered with the media device so that won't work now that the entity links list is initialized on device registration. So instead creating the pad links when the subdevice is bound, create them on the complete callback once all the subdevices have been bound but only try to create for the ones that have a bus configuration set during bound. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] omap3isp: separate links creation from entities initJavier Martinez Canillas2016-01-1111-104/+185
| | | | | | | | | | | | | | The omap3isp driver initializes the entities and creates the pads links before the entities are registered with the media device. This does not work now that object IDs are used to create links so the media_device has to be set. Split out the pads links creation from the entity initialization so the links are created after the entities have been registered with the media device. Suggested-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: add functions to allow creating interfacesMauro Carvalho Chehab2016-01-113-0/+133
| | | | | | | | | | | | | | | | | Interfaces are different than entities: they represent a Kernel<->userspace interaction, while entities represent a piece of hardware/firmware/software that executes a function. Let's distinguish them by creating a separate structure to store the interfaces. Later patches should change the existing drivers and logic to split the current interface embedded inside the entity structure (device nodes) into a separate object of the graph. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] uapi/media.h: Declare interface types for V4L2 and DVBMauro Carvalho Chehab2016-01-111-0/+21
| | | | | | | | | | | | | Declare the interface types that will be used by the new G_TOPOLOGY ioctl that will be defined later on. For now, we need those types, as they'll be used on the internal structs associated with the new media_interface graph object defined on the next patch. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: remove media entity .parent fieldJavier Martinez Canillas2016-01-111-1/+0Star
| | | | | | | | | | Now that the struct media_entity .parent field is unused, it can be safely removed. Since all the previous users were converted to use the .mdev field from the embedded struct media_gobj instead. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: use entity.graph_obj.mdev instead of .parentJavier Martinez Canillas2016-01-1113-43/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The struct media_entity has a .parent field that stores a pointer to the parent struct media_device. But recently a media_gobj was embedded into the entities and since struct media_gojb already has a pointer to a struct media_device in the .mdev field, the .parent field becomes redundant and can be removed. This patch replaces all the usage of .parent by .graph_obj.mdev so that field will become unused and can be removed on a later patch. No functional changes. The transformation was made using the following coccinelle spatch: @@ struct media_entity *me; @@ - me->parent + me->graph_obj.mdev @@ struct media_entity *link; @@ - link->source->entity->parent + link->source->entity->graph_obj.mdev @@ struct exynos_video_entity *ve; @@ - ve->vdev.entity.parent + ve->vdev.entity.graph_obj.mdev Suggested-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rename the function that create pad linksMauro Carvalho Chehab2016-01-1130-72/+72
| | | | | | | | | | | | | | | | | With the new API, a link can be either between two PADs or between an interface and an entity. So, we need to use a better name for the function that create links between two pads. So, rename the such function to media_create_pad_link(). No functional changes. This patch was created via this shell script: for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' -type f) ; do sed s,media_entity_create_link,media_create_pad_link,g <$i >a && mv a $i; done Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: add a debug message to warn about gobj creation/removalMauro Carvalho Chehab2016-01-112-1/+74
| | | | | | | | | | | | It helps to check if the media controller is doing the right thing with the object creation and removal. No extra code/data will be produced if DEBUG or CONFIG_DYNAMIC_DEBUG is not enabled. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: add messages when media device gets (un)registeredMauro Carvalho Chehab2016-01-111-0/+5
| | | | | | | | | | | | | We can only free the media device after being sure that no graph object is used. In order to help tracking it, let's add debug messages that will print when the media controller gets registered or unregistered. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: use media_gobj inside linksMauro Carvalho Chehab2016-01-114-0/+23
| | | | | | | | | | | | Just like entities and pads, links also need to have unique Object IDs along a given media controller. So, let's add a media_gobj inside it and initialize the object then a new link is created. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: use media_gobj inside padsMauro Carvalho Chehab2016-01-114-0/+19
| | | | | | | | | | | | | | | | | PADs also need unique object IDs that won't conflict with the entity object IDs. The pad objects are currently created via media_entity_init() and, once created, never change. While this will likely change in the future in order to support dynamic changes, for now we'll keep PADs as arrays and initialize the media_gobj embedded structs when registering the entity. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: use media_gobj inside entitiesMauro Carvalho Chehab2016-01-114-12/+15
| | | | | | | | | | | | | | | As entities are graph objects, let's embed media_gobj on it. That ensures an unique ID for entities that can be global along the entire media controller. For now, we'll keep the already existing entity ID. Such field need to be dropped at some point, but for now, let's not do this, to avoid needing to review all drivers and the userspace apps. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: add a common struct to be embed on media graph objectsMauro Carvalho Chehab2016-01-112-0/+93
| | | | | | | | | | | | | Due to the MC API proposed changes, we'll need to have an unique object ID for all graph objects, and have some shared fields that will be common on all media graph objects. Right now, the only common object is the object ID, but other fields will be added later on. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] omap3isp: get entity ID using media_entity_id()Javier Martinez Canillas2016-01-113-6/+11
| | | | | | | | | | | | | Accessing media_entity ID should now use media_entity_id() macro to obtain the entity ID, as a next patch will remove the .id field from struct media_entity . So, get rid of it, otherwise the omap3isp driver will fail to build. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] staging: omap4iss: get entity ID using media_entity_id()Javier Martinez Canillas2016-01-112-2/+2
| | | | | | | | | | | | | Accessing media_entity ID should now use media_entity_id() macro to obtain the entity ID, as a next patch will remove the .id field from struct media_entity . So, get rid of it, otherwise the omap4iss driver will fail to build. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: create a macro to get entity IDMauro Carvalho Chehab2016-01-114-10/+15
| | | | | | | | | | Instead of accessing directly entity.id, let's create a macro, as this field will be moved into a common struct later on. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] au0828: Fix the logic that enables the analog demoder linkMauro Carvalho Chehab2016-01-111-2/+2
| | | | | | | | | This logic was broken on the original patch, likely due to a cut-and-paste mistake. Fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] Kconfig: Re-enable Media controller support for DVBMauro Carvalho Chehab2016-01-111-1/+0Star
| | | | | | | | | This was depending on broken because we're working at the Media Controller API, with has... issues. As this got fixed, we can re-enable it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: get rid of unused "extra_links" param on media_entity_init()Mauro Carvalho Chehab2016-01-1167-92/+89Star
| | | | | | | | | | | | | | | | | | Currently, media_entity_init() creates an array with the links, allocated at init time. It provides a parameter (extra_links) that would allocate more links than the current needs, but this is not used by any driver. As we want to be able to do dynamic link allocation/removal, we'll need to change the implementation of the links. So, before doing that, let's first remove that extra unused parameter, in order to cleanup the interface first. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] au0828: Cache the decoder info at au0828 dev structureMauro Carvalho Chehab2016-01-113-14/+10Star
| | | | | | | | | Instead of seeking for the decoder every time analog stream is started, cache it. This simplifies the code a little bit. Requested-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] au0828: Add support for media controllerRafael Lourenço de Lima Chehab2016-01-116-0/+226
| | | | | | | Add support for analog and dvb tv using media controller. Signed-off-by: Rafael Lourenço de Lima Chehab <chehabrafael@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: define Media Controller API when CONFIG_MEDIA_CONTROLLER enabledShuah Khan2016-01-112-0/+31
| | | | | | | | | | Change to define Media Controller API when CONFIG_MEDIA_CONTROLLER is enabled. Define stubs for CONFIG_MEDIA_CONTROLLER disabled case. This will help avoid drivers needing to enclose Media Controller code within ifdef CONFIG_MEDIA_CONTROLLER block. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: new media controller API for device resource supportShuah Khan2016-01-112-0/+35
| | | | | | | | | | | | | | | | | | | Add new media controller API to allocate media device as a device resource. When a media device is created on the main struct device which is the parent device for the interface device, it will be available to all drivers associated with that interface. For example, if a usb media device driver creates the media device on the main struct device which is common for all the drivers that control the media device, including the non-media ALSA driver, media controller API can be used to share access to the resources on the media device. This new interface provides the above described feature. A second interface that finds and returns the media device is added to allow drivers to find the media device created by any of the drivers associated with the device. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rc: sunxi-cir: Initialize the spinlock properlyChen-Yu Tsai2015-12-231-0/+2
| | | | | | | | | | | | | | | The driver allocates the spinlock but fails to initialize it correctly. The kernel reports a BUG indicating bad spinlock magic when spinlock debugging is enabled. Call spin_lock_init() on it to initialize it correctly. Fixes: b4e3e59fb59c ("[media] rc: add sunxi-ir driver") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rtl2832: do not filter out slave TS null packetsAntti Palosaari2015-12-231-12/+0Star
| | | | | | | | | Do not remove slave TS NULL padding PID (0x1fff) by default as there is no real need. After that whole TS is passed to kernel sw PID filter. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rtl2832: print reg number on error caseAntti Palosaari2015-12-231-3/+6
| | | | | | | | It is hard to debug possible I2C failures without knowing the possible register itself. Add register number to error printing. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rtl28xxu: return demod reg page from driver cacheAntti Palosaari2015-12-231-5/+11
| | | | | | | | | Return current active rtl2830/rtl2832 register page from the driver cache in order to reduce I2C I/O. Register page is already cached due to I2C write needs. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: enable MPEG-2 ES decodingPhilipp Zabel2015-12-231-0/+4
| | | | | | | | Hook up the MPEG-2 ES decoder. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: don't start streaming without queued buffersPhilipp Zabel2015-12-231-10/+3Star
| | | | | | | | | | | We could support start streaming with an empty output queue for the BIT decoders due to the bitstream buffer which could still contain data at this point, but there is really no reason for userspace to expect this to work. Simplify the code by disallowing it. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: hook up vidioc_prepare_bufPhilipp Zabel2015-12-231-0/+1
| | | | | | Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: relax coda_jpeg_check_buffer for trailing bytesPhilipp Zabel2015-12-233-8/+22
| | | | | | | | | | | | | | coda_jpeg_check_buffer only cares about the buffer length and contents, so change the parameter type back from v4l2_vb2_buffer to just the vb2_buffer. Instead of just checking the first and last bytes for the SOI and EOI markers, relax the EOI marker check a bit and allow up to 32 trailing bytes after the EOI marker as hardware generated JPEGs sometimes contain some alignment overhead. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] coda: make to_coda_video_device staticPhilipp Zabel2015-12-231-1/+2
| | | | | | | | This function is not used outside coda-common.c. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: remove volatile attribute from MFC register addressesAndrzej Hajda2015-12-231-244/+244
| | | | | | | | | MFC register addresses are used only by writel/readl macros which already takes care of proper register accessing. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: merge together s5p_mfc_hw_call and s5p_mfc_hw_call_voidAndrzej Hajda2015-12-236-58/+52Star
| | | | | | | | Both macros can be merged into one. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: use spinlock to protect MFC contextAndrzej Hajda2015-12-236-70/+11Star
| | | | | | | | | | | MFC driver uses dev->irqlock spinlock to protect queues only, but many context fields require protection also - they can be accessed concurrently from IOCTLs and IRQ handler. The patch increases protection range of irqlock to those fields also. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: remove unnecessary callbacksAndrzej Hajda2015-12-233-102/+0Star
| | | | | | | | | | Many version specific functions are not called by common code, so there is no need to use callbacks. Additionally some of them are not used at all, so they can be safely removed. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: make queue cleanup code commonAndrzej Hajda2015-12-237-50/+23Star
| | | | | | | | Code for queue cleanup has nothing specific to hardware version. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: use one implementation of s5p_mfc_get_new_ctxAndrzej Hajda2015-12-234-45/+21Star
| | | | | | | | | Both version of MFC driver use functions with the same body and name. The patch moves them to common location. It also simplifies it. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: constify s5p_mfc_codec_ops structuresJulia Lawall2015-12-235-7/+7
| | | | | | | | | | | The s5p_mfc_codec_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] au8522: Avoid memory leak for device config dataMauro Carvalho Chehab2015-12-214-26/+16Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported by kmemleak: unreferenced object 0xffff880321e1da40 (size 32): comm "modprobe", pid 3309, jiffies 4295019569 (age 2359.636s) hex dump (first 32 bytes): 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 G............... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<ffffffff82278c8e>] kmemleak_alloc+0x4e/0xb0 [<ffffffff8153c08c>] kmem_cache_alloc_trace+0x1ec/0x280 [<ffffffffa13a896a>] au8522_probe+0x19a/0xa30 [au8522_decoder] [<ffffffff81de0032>] i2c_device_probe+0x2b2/0x490 [<ffffffff81ca7004>] driver_probe_device+0x454/0xd90 [<ffffffff81ca7c1b>] __device_attach_driver+0x17b/0x230 [<ffffffff81ca15da>] bus_for_each_drv+0x11a/0x1b0 [<ffffffff81ca6a4d>] __device_attach+0x1cd/0x2c0 [<ffffffff81ca7d43>] device_initial_probe+0x13/0x20 [<ffffffff81ca451f>] bus_probe_device+0x1af/0x250 [<ffffffff81c9e0f3>] device_add+0x943/0x13b0 [<ffffffff81c9eb7a>] device_register+0x1a/0x20 [<ffffffff81de8626>] i2c_new_device+0x5d6/0x8f0 [<ffffffffa0d88ea4>] v4l2_i2c_new_subdev_board+0x1e4/0x250 [v4l2_common] [<ffffffffa0d88fe7>] v4l2_i2c_new_subdev+0xd7/0x110 [v4l2_common] [<ffffffffa13b2f76>] au0828_card_analog_fe_setup+0x2e6/0x3f0 [au0828] Checking where the error happens: (gdb) list *au8522_probe+0x19a 0x99a is in au8522_probe (drivers/media/dvb-frontends/au8522_decoder.c:761). 756 printk(KERN_INFO "au8522_decoder attach existing instance.\n"); 757 break; 758 } 759 760 demod_config = kzalloc(sizeof(struct au8522_config), GFP_KERNEL); 761 if (demod_config == NULL) { 762 if (instance == 1) 763 kfree(state); 764 return -ENOMEM; 765 } Shows that the error path is not being handled properly. The are actually several issues here: 1) config free should have been calling hybrid_tuner_release_state() function, by calling au8522_release_state(); 2) config is only allocated at the digital part. On the analog one, it is received from the caller. A complex logic could be added to address it, however, it is simpler to just embeed config inside the state. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] ir-lirc-codec.c: don't leak lirc->drv-rbufMauro Carvalho Chehab2015-12-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported by kmemleak: unreferenced object 0xffff8802adae0ba0 (size 192): comm "modprobe", pid 3024, jiffies 4296503588 (age 324.368s) hex dump (first 32 bytes): 00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N.......... ff ff ff ff ff ff ff ff c0 48 25 a0 ff ff ff ff .........H%..... backtrace: [<ffffffff82278c8e>] kmemleak_alloc+0x4e/0xb0 [<ffffffff8153c08c>] kmem_cache_alloc_trace+0x1ec/0x280 [<ffffffffa0250f0d>] ir_lirc_register+0x8d/0x7a0 [ir_lirc_codec] [<ffffffffa07372b8>] ir_raw_event_register+0x318/0x4b0 [rc_core] [<ffffffffa07351ed>] rc_register_device+0xf2d/0x1450 [rc_core] [<ffffffffa13c5451>] au0828_rc_register+0x7d1/0xa10 [au0828] [<ffffffffa13b0dc2>] au0828_usb_probe+0x6c2/0xcf0 [au0828] [<ffffffff81d7619d>] usb_probe_interface+0x45d/0x940 [<ffffffff81ca7004>] driver_probe_device+0x454/0xd90 [<ffffffff81ca7a61>] __driver_attach+0x121/0x160 [<ffffffff81ca141f>] bus_for_each_dev+0x11f/0x1a0 [<ffffffff81ca5d4d>] driver_attach+0x3d/0x50 [<ffffffff81ca5039>] bus_add_driver+0x4c9/0x770 [<ffffffff81ca944c>] driver_register+0x18c/0x3b0 [<ffffffff81d71e58>] usb_register_driver+0x1f8/0x440 [<ffffffffa13680b7>] 0xffffffffa13680b7 0xf3d is in ir_lirc_register (drivers/media/rc/ir-lirc-codec.c:348). 343 drv = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL); 344 if (!drv) 345 return rc; 346 347 rbuf = kzalloc(sizeof(struct lirc_buffer), GFP_KERNEL); 348 if (!rbuf) 349 goto rbuf_alloc_failed; 350 351 rc = lirc_buffer_init(rbuf, sizeof(int), LIRCBUF_SIZE); 352 if (rc) Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] uvcvideo: small cleanup in uvc_video_clock_update()Dan Carpenter2015-12-181-1/+1
| | | | | | | | | | Smatch is not smart enough to see that "&stream->clock.lock" and "&clock->lock" are the same thing so it complains about the locking here. Let's make it more consistent. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] uvcvideo: Fix reading the current exposure value of UVCAnton V. Shokurov2015-12-181-1/+2
| | | | | | | | | | | | V4L2_CID_EXPOSURE_ABSOLUTE property does not return an updated value when autoexposure (V4L2_CID_EXPOSURE_AUTO) is turned on. This patch fixes this issue by adding the UVC_CTRL_FLAG_AUTO_UPDATE flag. Tested on a C920 camera. Signed-off-by: Anton V. Shokurov <shokurov.anton.v@yandex.ru> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cx23885-dvb: move initialization of a8293_pdataMauro Carvalho Chehab2015-12-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Smatch complains about where the au8293_data is placed: drivers/media/pci/cx23885/cx23885-dvb.c:2174 dvb_register() info: 'a8293_pdata' is not actually initialized (unreached code). It is not actually expected to have such initialization at switch { foo = bar; case: ... } Not really sure how gcc does that, but this is something that I would expect that different compilers would do different things. David Howells checked with the compiler people: it's not really expected to initialise as expected. So, move the initialization outside the switch(), making smatch to shut up one warning. Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cx23885-dvb: initialize a8293_pdataMauro Carvalho Chehab2015-12-181-1/+1
| | | | | | | As reported by smatch: drivers/media/pci/cx23885/cx23885-dvb.c:2174 dvb_register() info: 'a8293_pdata' is not actually initialized (unreached code). Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] videobuf2: avoid memory leak on errorsMauro Carvalho Chehab2015-12-181-2/+4
| | | | | | | | | As reported by smatch: drivers/media/v4l2-core/videobuf2-core.c:2415 __vb2_init_fileio() warn: possible memory leak of 'fileio' While here, avoid the usage of sizeof(struct foo_struct). Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] videobuf2-core: fix plane_sizes handling in VIDIOC_CREATE_BUFSHans Verkuil2015-12-182-19/+24
| | | | | | | | | | | | | | | | | | | | The handling of q->plane_sizes was wrong in vb2_core_create_bufs(). The q->plane_sizes array was global and it was overwritten by create_bufs. So if reqbufs was called with e.g. size 100000 then q->plane_sizes[0] would be set to 100000. If create_bufs was called afterwards with size 200000, then q->plane_sizes[0] would be overwritten with the new value. Calling create_bufs again for size 100000 would cause an error since 100000 is now less than q->plane_sizes[0]. This patch fixes this problem by 1) removing q->plane_sizes and using the vb->planes[].length field instead, and 2) by introducing a min_length field in struct vb2_plane. This field is set to the plane size as returned by the queue_setup op and is the minimum required plane size. So user pointers or dmabufs should all be at least this size. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] videobuf2-core: call __setup_offsets before buf_init()Hans Verkuil2015-12-181-26/+16Star
| | | | | | | | | Ensure that the offsets are correct before buf_init() is called. As a consequence the __setup_offsets() function now sets up the offsets for the given buffer instead of for all new buffers. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] videobuf2-core: fill in q->bufs[vb->index] before buf_init()Hans Verkuil2015-12-181-2/+3
| | | | | | | | Fill in q->bufs[vb->index] before the call to buf_init: it makes sense that this is initialized correctly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] videobuf2-core: move __setup_lengths into __vb2_queue_alloc()Hans Verkuil2015-12-181-21/+3Star
| | | | | | | | | Rather than setting up the lengths at the end, set them up when the vb2_buffer is allocated. This also ensures that buf_init() sees the right length values. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>