[RFC] [PATCH 5/6] media: em28xx-video - implement em28xx_ops: suspend/resume hooks

2014-02-21 Thread Shuah Khan
Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will invoke em28xx_ops: suspend and resume hooks for all its extensions from its suspend() and resume() interfaces. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-video.c | 28

[RFC] [PATCH 1/6] media: em28xx - add suspend/resume to em28xx_ops

2014-02-21 Thread Shuah Khan
-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-core.c | 28 drivers/media/usb/em28xx/em28xx.h | 4 2 files changed, 32 insertions(+) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index

[RFC] [PATCH 0/6] media: em28xx - power management support em28xx

2014-02-21 Thread Shuah Khan
and resume the devices they control. Shuah Khan (6): media: em28xx - add suspend/resume to em28xx_ops media: em28xx-audio - implement em28xx_ops: suspend/resume hooks media: em28xx-dvb - implement em28xx_ops: suspend/resume hooks media: em28xx-input - implement em28xx_ops: suspend/resume hooks

[RFC] [PATCH 2/6] media: em28xx-audio - implement em28xx_ops: suspend/resume hooks

2014-02-21 Thread Shuah Khan
Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will invoke em28xx_ops: suspend and resume hooks for all its extensions from its suspend() and resume() interfaces. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-audio.c | 30

[RFC] [PATCH 3/6] media: em28xx-dvb - implement em28xx_ops: suspend/resume hooks

2014-02-21 Thread Shuah Khan
Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will invoke em28xx_ops: suspend and resume hooks for all its extensions from its suspend() and resume() interfaces. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-dvb.c | 57

[RFC] [PATCH 6/6] media: em28xx - implement em28xx_usb_driver suspend, resume, reset_resume hooks

2014-02-21 Thread Shuah Khan
suspend and resume hooks for all registered extensions. -- change em28xx dvb, audio, input, and video extensions to implement em28xx_ops: suspend and resume hooks. These hooks do what is necessary to suspend and resume the devices they control. Signed-off-by: Shuah Khan shuah...@samsung.com

[RFC] [PATCH 4/6] media: em28xx-input - implement em28xx_ops: suspend/resume hooks

2014-02-21 Thread Shuah Khan
Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will invoke em28xx_ops: suspend and resume hooks for all its extensions from its suspend() and resume() interfaces. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-input.c | 35

[PATCH 0/3] media/drx39xyj: fix DJH_DEBUG path null pointer dereferences, and compile errors.

2014-02-28 Thread Shuah Khan
This patch series fixes null pointer dereference boot failure as well as compile errors. Shuah Khan (3): media/drx39xyj: fix pr_dbg undefined compile errors when DJH_DEBUG is defined media/drx39xyj: remove return that prevents DJH_DEBUG code to run media/drx39xyj: fix boot failure due

[PATCH 3/3] media/drx39xyj: fix boot failure due to null pointer dereference

2014-02-28 Thread Shuah Khan
’ was here struct i2c_msg msg[2]; ^ Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb

[PATCH 2/3] media/drx39xyj: remove return that prevents DJH_DEBUG code to run

2014-02-28 Thread Shuah Khan
drxbsp_i2c_write_read() has return that prevents DJH_DEBUG code to run. Remove it. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb

[PATCH 1/3] media/drx39xyj: fix pr_dbg undefined compile errors when DJH_DEBUG is defined

2014-02-28 Thread Shuah Khan
-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index ed68c52..a78af4e 100644 --- a/drivers/media

Re: [PATCH 0/3] media/drx39xyj: fix DJH_DEBUG path null pointer dereferences, and compile errors.

2014-02-28 Thread Shuah Khan
sane, and I will send a formal Acked-by once I can get in front of a real computer. Devin Thanks for the ack. I will include you on the cc for future patches. I am working in Mauro's experimental git and probably that explains why get_maintainer.pl just showed linux-media and Mauro. -- Shuah

[PATCH] media: lgdt3305 - add lgdt3304_ops: sleep

2014-03-20 Thread Shuah Khan
properly from dvb_frontend_suspend(). Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-frontends/lgdt3305.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/dvb-frontends/lgdt3305.c b/drivers/media/dvb-frontends/lgdt3305.c index 1d2c473..92c891a 100644

[PATCH] media: em28xx-video - change em28xx_scaler_set() to use em28xx_reg_len()

2014-03-21 Thread Shuah Khan
Change em28xx_scaler_set() to use em28xx_reg_len() to get register lengths for EM28XX_R30_HSCALELOW and EM28XX_R32_VSCALELOW registers, instead of hard-coding the length. Moved em28xx_reg_len() definition for it to be visible to em28xx_scaler_set(). Signed-off-by: Shuah Khan shuah...@samsung.com

Re: [PATCH] media: em28xx-video - change em28xx_scaler_set() to use em28xx_reg_len()

2014-03-22 Thread Shuah Khan
On 03/22/2014 06:32 AM, Frank Schäfer wrote: Am 21.03.2014 22:04, schrieb Shuah Khan: Change em28xx_scaler_set() to use em28xx_reg_len() to get register lengths for EM28XX_R30_HSCALELOW and EM28XX_R32_VSCALELOW registers, instead of hard-coding the length. Moved em28xx_reg_len() definition

Re: [PATCH] media: em28xx-video - change em28xx_scaler_set() to use em28xx_reg_len()

2014-03-22 Thread Shuah Khan
with this patch applied and CONFIG_VIDEO_ADV_DEBUG disabled ? ;-) CONFIG_VIDEO_ADV_DEBUG is disabled in my config. -- Shuah -- Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon Valley) shuah...@samsung.com | (970) 672-0658 -- To unsubscribe from

[Proposal] media mini-summit - Linux media power management - problems, challenges and fixes

2014-04-02 Thread Shuah Khan
is being done to address these issues and also present an overview of PM infrastructure being considered for future kernel releases. -- Shuah -- Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon Valley) shuah...@samsung.com | (970) 672-0658

[RFC PATCH 1/2] drivers/base: add new devres_update() interface to devres_*

2014-04-09 Thread Shuah Khan
unlocked is necessary to implement this new managed resource. devres_update() searches for the resource that matches supplied match criteria similar to devres_find(). When a match is found, it calls the update function caller passed in. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/base

[RFC PATCH 2/2] drivers/base: add managed token devres interfaces

2014-04-09 Thread Shuah Khan
: Call devm_token_destroy() to delete the token. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/base/Makefile|2 +- drivers/base/token_devres.c | 204 ++ include/linux/token_devres.h | 19 3 files changed, 224 insertions(+), 1

[RFC PATCH 0/2] managed token devres interfaces

2014-04-09 Thread Shuah Khan
with the format above: usb 8-1: devm_token_create(): created token: tuner:8-1-:00:10.1-0 Shuah Khan (2): drivers/base: add new devres_update() interface to devres_* drivers/base: add managed token devres interfaces drivers/base/Makefile|2 +- drivers/base/devres.c| 36

Re: [RFC PATCH 0/2] managed token devres interfaces

2014-04-09 Thread Shuah Khan
On 04/09/2014 01:17 PM, Greg KH wrote: On Wed, Apr 09, 2014 at 09:21:06AM -0600, Shuah Khan wrote: Test Cases for token devres interfaces: (passed) - Create, lock, unlock, and destroy sequence. - Try lock while it is locked. Returns -EBUSY as expected. - Try lock after destroy. Returns

Re: [RFC PATCH 0/2] managed token devres interfaces

2014-04-10 Thread Shuah Khan
unplug from its em28xx_usb_disconnect() or in generic words, in its uninit. It is a matter of making sure this resource is handled in the uninit for this media device/driver(s) like any other shared resource. Would that cover the hot plugging and re-use of the bus slot scenario? -- Shuah

Re: [RFC PATCH 0/2] managed token devres interfaces

2014-04-11 Thread Shuah Khan
: devm_token_release(): release token [ 1775.052273] usb 8-2: devm_token_create(): created token: tuner:8-2-:00:10.1-0 [ 1775.052276] em2874 #0: devm_token_create() returned 0 [ 1775.052285] usb 8-2: devm_token_create(): created token: video:8-2-:00:10.1 shuah@anduin:~$ dmesg | grep token

Re: [RFC PATCH 0/2] managed token devres interfaces

2014-04-14 Thread Shuah Khan
propose going forward with adding the token devres to solve the issue of sharing functions across drivers that control the functions. -- Shuah -- Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon Valley) shuah...@samsung.com | (970) 672-0658

Re: [RFC PATCH 2/2] drivers/base: add managed token devres interfaces

2014-04-17 Thread Shuah Khan
video to be captured and the media driver digital video function wants to lock a resource that is shared between analog and digital functions. On Wed, Apr 09, 2014 at 09:21:08AM -0600, Shuah Khan wrote: +#define TOKEN_DEVRES_FREE 0 +#define TOKEN_DEVRES_BUSY 1 + +struct token_devres

Re: [RFC PATCH 2/2] drivers/base: add managed token devres interfaces

2014-04-17 Thread Shuah Khan
On 04/17/2014 02:10 PM, Tejun Heo wrote: On Thu, Apr 17, 2014 at 02:01:32PM -0600, Shuah Khan wrote: Operating on the lock should be atomic, which is what devres_update() is doing. It can be simplified as follows by holding devres_lock in devm_token_lock(). spin_lock_irqsave(dev-devres_lock

Re: [RFC PATCH 2/2] drivers/base: add managed token devres interfaces

2014-04-17 Thread Shuah Khan
it directly, at least add lockdep annotations. Thanks. This is helpful. Yes it does simplify the code with mutex embedded in the devres data area. I am working on a v2 patch with that change. -- Shuah -- Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon

[PATCH 2/4] media: dvb-fe changes to use tuner token

2014-04-29 Thread Shuah Khan
is held in use as long as the kdvb adapter fe kthread is running. Tuner token is unlocked in dvb_frontend_thread() when kdvb adapter fe thread exits. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-core/dvb_frontend.c | 15 +++ drivers/media/dvb-core

[PATCH 4/4] media: em28xx dvb changes to initialze tuner token

2014-04-29 Thread Shuah Khan
Changes to em28xx-dvb to initialze dvb fe tuner token when dvb fe is registered. This will provide dvb fe the em28xx tuner token devres for sharing tuner across analog and digital functions. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-dvb.c |4 1

[PATCH 3/4] media/em28xx: changes to create token for tuner access

2014-04-29 Thread Shuah Khan
Changes add a new tuner_tkn field to struct em28xx and create a token devres to allow sharing tuner function across analog and digital functions. Tuner token is created during probe in em28xx_usb_probe() and destroyed during disconnect in em28xx_release_resources(). Signed-off-by: Shuah Khan

[PATCH 0/4] Add managed token devres interfaces and change media drivers to use it

2014-04-29 Thread Shuah Khan
and digital functions. em28xx and dvb-core make use of this new tuner token to control tuner access. Analog changes will be added in a subsequent patch series. Patch series is tested with Kworld UB435-Q V3 USB TV stick and Kaffeine media player. Shuah Khan (4): drivers/base: add managed token devres

[PATCH 1/4] drivers/base: add managed token devres interfaces

2014-04-29 Thread Shuah Khan
() devm_token_unlock() Usage: Create token: Call devm_token_create() with a token id string. Lock token: Call devm_token_lock() to lock or try lock a token. Unlock token: Call devm_token_unlock(). Destroy token: Call devm_token_destroy() to delete the token. Signed-off-by: Shuah Khan shuah

Re: [PATCH 1/4] drivers/base: add managed token devres interfaces

2014-05-05 Thread Shuah Khan
the one I am proposing. This new device I am testing with now presents all the use-cases that need addressing. So I am hoping to refine the approach and make course corrections as needed with this device. -- Shuah -- Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research

Re: [PATCH 1/4] drivers/base: add managed token devres interfaces

2014-05-05 Thread Shuah Khan
here? We actually discussed this proposal at length at the media summit last week. The patches are being pulled pending further internal review being pulled into a tree or being pulled for more work? and after Shuah has exercised some other use cases. As I said in my response: This new

[PATCH 0/4] media: tuner large grain locking

2014-06-24 Thread Shuah Khan
digital app. - digital tv app detects tuner is busy without disrupting the active digital app. Requesting feedback on any use-cases I missed and overall approach to solving the contention between media functions. Shuah Khan (4): drivers/base: add managed token dev resource media: dvb-fe changes

[PATCH 1/4] drivers/base: add managed token dev resource

2014-06-24 Thread Shuah Khan
token: Call devm_token_create() with a token id string. Lock token: Call devm_token_lock() to lock or try lock a token. Unlock token: Call devm_token_unlock(). Destroy token: Call devm_token_destroy() to delete the token. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/base

[PATCH 2/4] media: dvb-fe changes to use tuner token

2014-06-24 Thread Shuah Khan
is held in use as long as the kdvb adapter fe kthread is running. Tuner token is unlocked in dvb_frontend_thread() when kdvb adapter fe thread exits. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-core/dvb_frontend.c | 21 + drivers/media/dvb-core

[PATCH 3/4] media: v4l2-core changes to use tuner token

2014-06-24 Thread Shuah Khan
as the v4l2 device is open and unlocked from v4l2_release(). Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/v4l2-core/v4l2-dev.c | 23 ++- include/media/v4l2-dev.h |1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2

[PATCH 4/4] media: au0828 changes to use token devres for tuner access

2014-06-24 Thread Shuah Khan
detects tuner is busy without disrupting the active digital app. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/au0828/au0828-core.c | 42 +++ drivers/media/usb/au0828/au0828-dvb.c |1 + drivers/media/usb/au0828/au0828-video.c |4

fix PCTV 461e tuner I2C binding

2014-07-07 Thread Shuah Khan
); + i2c_unregister_device(client); + } + + em28xx_unregister_dvb(dvb); + kfree(dvb); + dev-dvb = NULL; } Why are we unregistering i2c devices and dvb in this resume path? Looks incorrect to me. -- Shuah -- Shuah Khan Senior Linux

Re: fix PCTV 461e tuner I2C binding

2014-07-08 Thread Shuah Khan
Moikka Antti, On 07/07/2014 09:45 PM, Antti Palosaari wrote: Moikka Shuah Why are we unregistering i2c devices and dvb in this resume path? Looks incorrect to me. I don't know. Original patch I send was a bit different and tuner was removed only during em28xx_dvb_fini() https

Re: fix PCTV 461e tuner I2C binding

2014-07-08 Thread Shuah Khan
On 07/08/2014 12:51 PM, Antti Palosaari wrote: On 07/08/2014 04:55 PM, Shuah Khan wrote: Moikka Antti, On 07/07/2014 09:45 PM, Antti Palosaari wrote: Moikka Shuah Why are we unregistering i2c devices and dvb in this resume path? Looks incorrect to me. I don't know. Original patch I send

[PATCH] media: em28xx-dvb - fix em28xx_dvb_resume() to not unregister i2c and dvb

2014-07-09 Thread Shuah Khan
em28xx_dvb_resume() unregisters i2c tuner, i2c demod, and dvb. This erroneous cleanup results in i2c tuner, i2c demod, and dvb devices unregistered and removed during resume. This error is a result of merge conflict between two patches that went into 3.15. Signed-off-by: Shuah Khan shuah

[PATCH] media: em28xx - add error handling for KWORLD dvb_attach failures

2014-07-09 Thread Shuah Khan
Add error hanlding when EM2870_BOARD_KWORLD_A340 dvb_attach() for fe and tuner fail in em28xx_dvb_init(). Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-dvb.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/media

[PATCH] media: em28xx - remove reset_resume interface

2014-07-09 Thread Shuah Khan
reset_resume to allow disconnect to be called followed by device restore sequence. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-cards.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx

[PATCH] media: em28xx-dvb unregister i2c tuner and demod after fe detach

2014-07-11 Thread Shuah Khan
i2c tuner and demod are unregisetred in .fini before fe detach. dvb_unregister_frontend() and dvb_frontend_detach() invoke tuner sleep() and release() interfaces. Change to unregister i2c tuner and demod from em28xx_unregister_dvb() after unregistering dvb and detaching fe. Signed-off-by: Shuah

[PATCH] media: em28xx - fix i2c_xfer to return -ENODEV when dev is removed

2014-07-11 Thread Shuah Khan
In em28xx usb disconnect code path, some dvb fe and tuner drivers attempt i2c transfers from their release interfaces. When device is removed, return -ENODEV instead of attempting to transfer data over i2c. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-i2c.c

[PATCH 0/3] media: prevent driver device access in disconnect path

2014-07-12 Thread Shuah Khan
in its release interface. Shuah Khan (3): media: dvb-core move fe exit flag from fepriv to fe for driver access media: em28xx-dvb update fe exit flag to indicate device disconnect media: drx39xyj driver change to check fe exit flag from release drivers/media/dvb-core/dvb_frontend.c

[PATCH 1/3] media: dvb-core move fe exit flag from fepriv to fe for driver access

2014-07-12 Thread Shuah Khan
maintains exit flag to keep track when fe device is disconnected in its private data structures. Export the flag in fe to enable drivers to check the device status from their release interfaces. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-core/dvb_frontend.c | 26

[PATCH 3/3] media: drx39xyj driver change to check fe exit flag from release

2014-07-12 Thread Shuah Khan
Change drx39xyj_release() to check fe exit flag to detect the device disconnect state and avoid accessing the device after it has been removed. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-frontends/drx39xyj/drxj.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH 2/3] media: em28xx-dvb update fe exit flag to indicate device disconnect

2014-07-12 Thread Shuah Khan
disconnect path. This change depends on dvb-core change that exports fe exit flag by moving it from fepriv to fe. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/em28xx/em28xx-dvb.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb

Re: [PATCH] media: em28xx-dvb unregister i2c tuner and demod after fe detach

2014-07-15 Thread Shuah Khan
On 07/12/2014 02:14 PM, Antti Palosaari wrote: Moikka Shuah! I suspect that patch makes no sense. On DVB there is runtime PM controlled by DVB frontend. It wakes up all FE sub-devices when frontend device is opened and sleeps when closed. FE release() is not relevant at all for those sub

[PATCH] media: drx39xyj - fix to return actual error codes instead of -EIO

2014-07-23 Thread Shuah Khan
Several functions ignore the return values in error legs and always return -EIO. This makes it hard to debug and take proper action in calling routines. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 112 +-- 1 file

[PATCH 1/2] media: dvb-core add new flag exit flag value for resume

2014-07-24 Thread Shuah Khan
define and changes dvb_frontend_resume() to set it prior to calling fe init and tuner init calls and resets it back to DVB_FE_NO_EXIT once fe and tuner init is done. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-core/dvb_frontend.c |2 ++ drivers/media/dvb-core

[PATCH 0/2] dvb-core and drx39xyj - add resume support

2014-07-24 Thread Shuah Khan
://lkml.org/lkml/2014/7/12/115 Shuah Khan (2): media: dvb-core add new flag exit flag value for resume media: drx39xyj - add resume support drivers/media/dvb-core/dvb_frontend.c |2 + drivers/media/dvb-core/dvb_frontend.h |1 + drivers/media/dvb-frontends/drx39xyj/drxj.c | 65

[PATCH 2/2] media: drx39xyj - add resume support

2014-07-24 Thread Shuah Khan
-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 65 +-- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index c3931cc

[PATCH] media: drx39xyj - use drxj_set_lna_state() and remove duplicate LNA code

2014-07-24 Thread Shuah Khan
drx39xxj_set_lna() and drx39xxj_set_frontend() set LNA. Instead of duplicating LNA configure code, change to use drxj_set_lna_state() which sets LNA to the caller requested state (on or off). Signed-off-by: Shuah Khan shuah...@samsung.com --- This patch depends on previous patch that added

Re: [PATCH] em28xx: fix compiler warnings

2014-08-05 Thread Shuah Khan
to the structure? It is always assigned whenever it is used in this patch. It might make sense to make it local variable. Somehow seeing a tmp field in the structure doesn't sound right and also since it maintains state being in the structure, it could be used with incorrect data. -- Shuah -- To unsubscribe from

Re: [PATCH] em28xx: fix compiler warnings

2014-08-05 Thread Shuah Khan
On Tue, Aug 5, 2014 at 8:18 AM, Hans Verkuil hverk...@xs4all.nl wrote: On 08/05/2014 03:57 PM, Shuah Khan wrote: I'm not sure what you mean. It *was* a local variable, that was the problem. There are two option: one is to add it to the main struct, then other is to allocate and free it inside

Re: [PATCH 3/3] au0828: don't let the IR polling thread to run at suspend

2014-08-08 Thread Shuah Khan
: Add suspend and resume functions */ + .suspend= au0828_suspend, + .resume = au0828_resume, }; all the extensions will need suspend/resume hooks similar to em28xx would like me to take a look at that?? -- Shuah -- To unsubscribe from this list: send the line

[PATCH 2/2] au0828: remove CONFIG_VIDEO_AU0828_RC scope around au0828_rc_*()

2014-08-08 Thread Shuah Khan
Remove CONFIG_VIDEO_AU0828_RC scope around au0828_rc_register() and au0828_rc_unregister() calls in au0828-core Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/au0828/au0828-core.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/media/usb/au0828/au0828

[PATCH 1/2] au0828: add au0828_rc_*() stubs for VIDEO_AU0828_RC disabled case

2014-08-08 Thread Shuah Khan
Define au0828_rc_*() stubs to avoid compile errors when VIDEO_AU0828_RC is disabled and avoid the need to enclose au0828_rc_*() in ifdef CONFIG_VIDEO_AU0828_RC in .c files. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/au0828/au0828.h | 15 +++ 1 file changed

[PATCH 0/2] au0828: au0828_rc_*() defines cleanup

2014-08-08 Thread Shuah Khan
Define au0828_rc_*() stubs to avoid compile errors when VIDEO_AU0828_RC is disabled and avoid the need to enclose au0828_rc_*() in ifdef CONFIG_VIDEO_AU0828_RC in .c files. This patch series adds stubs and fixes places where ifdef is used. Shuah Khan (2): au0828: add au0828_rc_*() stubs

[PATCH] media: fix au0828 dvb suspend/resume to call dvb_frontend_suspend/resume

2014-08-11 Thread Shuah Khan
and with active TV stream, and after resume it went right back to active TV stream. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/au0828/au0828-dvb.c | 37 ++--- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/drivers/media/usb/au0828/au0828

[PATCH v2] media: fix au0828 dvb suspend/resume to call dvb_frontend_suspend/resume

2014-08-13 Thread Shuah Khan
-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/usb/au0828/au0828-dvb.c | 47 ++--- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-dvb.c b/drivers/media/usb/au0828/au0828-dvb.c index 821f86e..4bd9d68 100644

[PATCH 1/2] media: tuner xc5000 - release firmwware from xc5000_release()

2014-08-13 Thread Shuah Khan
-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/tuners/xc5000.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c index 512fe50..31b1dec 100644 --- a/drivers/media

[PATCH 0/2] media: tuner xc5000 firmware load fixes and improvements

2014-08-13 Thread Shuah Khan
is done before firmware is loaded. Shuah Khan (2): media: tuner xc5000 - release firmwware from xc5000_release() media: tuner xc5000 - try to avoid firmware load in resume path drivers/media/tuners/xc5000.c | 50 - 1 file changed, 35 insertions

[PATCH 2/2] media: tuner xc5000 - try to avoid firmware load in resume path

2014-08-13 Thread Shuah Khan
formware in this scenario results in slowpath warnings during resume as it won't be in the suspend firmware cache. Signed-off-by: Shuah Khan shuah...@samsung.com --- drivers/media/tuners/xc5000.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/media/tuners

v4l2 ioctls

2014-09-11 Thread Shuah Khan
at the moment. dvb is in good shape. -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) shua...@osg.samsung.com | (970) 217-8978 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More

v4l2_fops - poll and open

2014-09-12 Thread Shuah Khan
Mauro/Hans, It turns out au0828 driver does init tuner from its v4l2_fops read and poll. If an analog app comes in and does a read or poll, digital could get disrupted. Do you recommend adding token access to these?? -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Samsung Research America

Re: v4l2 ioctls

2014-09-12 Thread Shuah Khan
working through issues related to unbalanced nature of tuner holds in analog mode. -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) shua...@osg.samsung.com | (970) 217-8978 -- To unsubscribe from this list: send the line unsubscribe linux-media

Re: v4l2_fops - poll and open

2014-09-15 Thread Shuah Khan
On 09/13/2014 02:36 AM, Hans Verkuil wrote: On 09/13/2014 02:34 AM, Shuah Khan wrote: Mauro/Hans, It turns out au0828 driver does init tuner from its v4l2_fops read and poll. If an analog app comes in and does a read or poll, digital could get disrupted. Do you recommend adding token access

Re: v4l2 ioctls

2014-09-15 Thread Shuah Khan
On 09/15/2014 05:54 AM, Mauro Carvalho Chehab wrote: Hi Shuah, Em Fri, 12 Sep 2014 18:37:13 -0600 Shuah Khan shua...@osg.samsung.com escreveu: Mauro/Hans, Thanks for both for your replies. I finally have it working with the following: One additional info: While in DVB mode, opening

Re: v4l2 ioctls

2014-09-15 Thread Shuah Khan
On 09/15/2014 05:53 PM, Mauro Carvalho Chehab wrote: Em Mon, 15 Sep 2014 17:15:52 -0600 Shuah Khan shua...@osg.samsung.com escreveu: On 09/15/2014 05:54 AM, Mauro Carvalho Chehab wrote: Hi Shuah, Em Fri, 12 Sep 2014 18:37:13 -0600 Shuah Khan shua...@osg.samsung.com escreveu: Mauro/Hans

[PATCH 3/5] media: au0828-video changes to use media tuner token api

2014-09-22 Thread Shuah Khan
mode release v4l2_file_operations: - hold tuner in exclusive analog mode to power down. Don't call s_power when tuner is busy. Initialize dev_parent field struct video_device to enable media tuner token lookup from v4l2-core. Signed-off-by: Shuah Khan shua...@osg.samsung.com --- drivers/media

[PATCH 4/5] media: dvb-core changes to use media tuner token api

2014-09-22 Thread Shuah Khan
Change to hold media tuner token exclusive mode in dvb_frontend_start() before starting the dvb thread and release from dvb_frontend_thread() when thread exits. dvb frontend thread is started only when the dvb device is opened in Read/Write mode. Signed-off-by: Shuah Khan shua...@osg.samsung.com

[PATCH 2/5] media: v4l2-core changes to use media tuner token api

2014-09-22 Thread Shuah Khan
a reset to clear it. Signed-off-by: Shuah Khan shua...@osg.samsung.com --- drivers/media/v4l2-core/v4l2-fh.c| 16 ++ drivers/media/v4l2-core/v4l2-ioctl.c | 96 +- 2 files changed, 110 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core

[PATCH 5/5] media: au0828-core changes to create and destroy media token res

2014-09-22 Thread Shuah Khan
that control the media device, including the non-media sound drivers. Signed-off-by: Shuah Khan shua...@osg.samsung.com --- drivers/media/usb/au0828/au0828-core.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb

[PATCH 1/5] media: add media token device resource framework

2014-09-22 Thread Shuah Khan
. As an example, when tuner token is held digital and exclusive mode, no other requests are granted. On the other hand, when the tuner token is held in shared analog mode, other requests for shared analog access are granted. Signed-off-by: Shuah Khan shua...@osg.samsung.com --- MAINTAINERS

[PATCH 0/5] media token resource framework

2014-09-22 Thread Shuah Khan
with changes in the core. Shuah Khan (5): media: add media token device resource framework media: v4l2-core changes to use media tuner token api media: au0828-video changes to use media tuner token api media: dvb-core changes to use media tuner token api media: au0828-core changes to create

au0828_init_tuner() called without dev lock held

2014-09-22 Thread Shuah Khan
au0828_init_tuner() invokes s_std. All of these changes including the au0828_init_tuner() itself were added in ea86968fb91471493ccac7d8f2a65bc65db6803b au0828_v4l2_resume() also does this and this one for sure needs fixing very likely. I am not sure about the others. Thoughts?? -- Shuah -- Shuah Khan

Re: au0828_init_tuner() called without dev lock held

2014-09-22 Thread Shuah Khan
On 09/22/2014 10:37 AM, Hans Verkuil wrote: On 09/22/2014 06:31 PM, Shuah Khan wrote: Hi Hans and Mauro, While I was making changes for media token work, I noticed there are several places au0828_init_tuner() gets called without holding dev lock. au0828 sets the lock pointer in struct

Re: [PATCH 2/5] media: v4l2-core changes to use media tuner token api

2014-09-22 Thread Shuah Khan
Hi Devin, On 09/22/2014 01:21 PM, Devin Heitmueller wrote: Hi Shuah, What about G_INPUT and G_TUNER? Consider the following use case, which is entirely legal in the V4L2 API: Did you mean G_INPUT and G_STD here? I didn't see G_TUNER mentioned below in the use-case. I didn't know this use

Re: [PATCH 1/2] media: tuner xc5000 - release firmwware from xc5000_release()

2014-09-22 Thread Shuah Khan
On 09/22/2014 02:18 PM, Mauro Carvalho Chehab wrote: Em Wed, 13 Aug 2014 19:09:23 -0600 Shuah Khan shuah...@samsung.com escreveu: xc5000 releases firmware right after loading it. Change it to save the firmware and release it from xc5000_release(). This helps avoid fecthing firmware when

[PATCH v2] media: tuner xc5000 - release firmwware from xc5000_release()

2014-09-22 Thread Shuah Khan
-off-by: Shuah Khan shua...@osg.samsung.com --- patch v2: fixes issues found in patch v1 review drivers/media/tuners/xc5000.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c

Re: [PATCH 2/5] media: v4l2-core changes to use media tuner token api

2014-09-23 Thread Shuah Khan
and see where it takes us. I have to change the v4l2 and driver v4l2 patches. dvb and the rest can stay the same. thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) shua...@osg.samsung.com | (970) 217-8978 -- To unsubscribe from this list: send

Re: [PATCH 1/5] media: add media token device resource framework

2014-09-24 Thread Shuah Khan
On 09/24/2014 05:26 AM, Hans Verkuil wrote: Hi Shuah, Here is my review... On 09/22/2014 05:00 PM, Shuah Khan wrote: Add media token device resource framework to allow sharing resources such as tuner, dma, audio etc. across media drivers and non-media sound drivers that control media

Re: [PATCH 2/5] media: v4l2-core changes to use media tuner token api

2014-09-24 Thread Shuah Khan
On 09/24/2014 05:57 AM, Hans Verkuil wrote: Hi Shuah, Here is my review... On 09/22/2014 05:00 PM, Shuah Khan wrote: Changes to v4l2-core to hold tuner token in v4l2 ioctl that change the tuner modes, and reset the token from fh exit. The changes are limited to vb2 calls that disrupt

Re: [PATCH 2/5] media: v4l2-core changes to use media tuner token api

2014-09-24 Thread Shuah Khan
On 09/24/2014 05:57 AM, Hans Verkuil wrote: Hi Shuah, Here is my review... On 09/22/2014 05:00 PM, Shuah Khan wrote: Changes to v4l2-core to hold tuner token in v4l2 ioctl that change the tuner modes, and reset the token from fh exit. The changes are limited to vb2 calls that disrupt

Re: [PATCH 2/5] media: v4l2-core changes to use media tuner token api

2014-09-24 Thread Shuah Khan
On 09/24/2014 06:25 AM, Hans Verkuil wrote: Hi Shuah, Let's be realistic: if an application doesn't test for error codes, then that's the problem of the application. Also, EBUSY will only be returned if someone else is holding the tuner in a different mode. And that didn't work anyway

Re: em28xx breaks after hibernate

2014-09-25 Thread Shuah Khan
Hi Johannes, On 09/25/2014 06:53 AM, Johannes Stezenbach wrote: Hi Shuah, ever since your patchset which implements suspend/resume for em28xx, hibernating the system breaks the Hauppauge WinTV HVR 930C driver. In v3.15.y and v3.16.y it throws a request_firmware warning during hibernate

Re: [patch] [media] xc5000: use after free in release()

2014-09-25 Thread Shuah Khan
-by: Shuah Khan shua...@osg.samsung.com -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) shua...@osg.samsung.com | (970) 217-8978 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org

Re: em28xx breaks after hibernate

2014-09-25 Thread Shuah Khan
On 09/25/2014 08:10 AM, Mauro Carvalho Chehab wrote: Hi Johannes and Shuah, Em Thu, 25 Sep 2014 07:45:37 -0600 Shuah Khan shua...@osg.samsung.com escreveu: Hi Johannes, On 09/25/2014 06:53 AM, Johannes Stezenbach wrote: Hi Shuah, ever since your patchset which implements suspend

Re: em28xx breaks after hibernate

2014-09-25 Thread Shuah Khan
On 09/25/2014 10:01 AM, Johannes Stezenbach wrote: Hi Shuah, On Thu, Sep 25, 2014 at 07:45:37AM -0600, Shuah Khan wrote: On 09/25/2014 06:53 AM, Johannes Stezenbach wrote: ever since your patchset which implements suspend/resume for em28xx, hibernating the system breaks the Hauppauge WinTV

Re: em28xx breaks after hibernate

2014-09-25 Thread Shuah Khan
it is okay to take you up un your offer to test. thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) shua...@osg.samsung.com | (970) 217-8978 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord

Re: em28xx breaks after hibernate

2014-09-25 Thread Shuah Khan
On 09/25/2014 12:17 PM, Johannes Stezenbach wrote: On Thu, Sep 25, 2014 at 11:40:45AM -0600, Shuah Khan wrote: Right. I introduced DVB_FE_DEVICE_RESUME code to resume problems in drx39xxj driver. Because I had to make it not toggle power on the fe for resume. In other words

Re: em28xx breaks after hibernate

2014-09-25 Thread Shuah Khan
Hi Johannes and Mauro, On 09/25/2014 12:45 PM, Shuah Khan wrote: Revert is good. Just checked 3.16 and we are good on that. It needs to be reverted from 3.17 for sure. Mauro! Do you need anything from me for this revert? Please let me know. Gotta be done soon I am guessing with us so close

Re: em28xx breaks after hibernate

2014-09-26 Thread Shuah Khan
. Also I dumped em28xx eprom to see if looks ok during these tests. thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) shua...@osg.samsung.com | (970) 217-8978 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body

Re: em28xx breaks after hibernate

2014-09-26 Thread Shuah Khan
in the initramfs for testing simplicity? Right. We have an issue when media drivers are compiled static (non-modular). I have been debugging that problem for a while. We have to separate the two cases - if you are compiling em28xx as static then you will run into the issue. thanks, -- Shuah

Re: em28xx breaks after hibernate

2014-09-26 Thread Shuah Khan
On 09/26/2014 09:06 AM, Johannes Stezenbach wrote: On Fri, Sep 26, 2014 at 08:30:32AM -0600, Shuah Khan wrote: On 09/26/2014 08:25 AM, Johannes Stezenbach wrote: So, what is happening is that the em28xx driver still async initializes while the initramfs already has started resume. Thus

  1   2   3   4   5   6   7   >