Re: [RFC v3 21/21] omap3isp: Don't rely on devm for memory resource management

2016-12-16 Thread Shuah Khan
On 12/16/2016 06:32 AM, Sakari Ailus wrote: > Hi Laurent, > > On Thu, Dec 15, 2016 at 01:23:50PM +0200, Laurent Pinchart wrote: >>> @@ -1596,7 +1604,6 @@ static void isp_unregister_entities(struct isp_device >>> *isp) omap3isp_stat_unregister_entities(&isp->isp_af); >>> omap3isp_stat_unregiste

Re: Media summit in Feb? - Was: Re: [RFC v3 00/21] Make use of kref in media device, grab references as needed

2016-12-21 Thread Shuah Khan
On Tue, Dec 20, 2016 at 6:31 PM, Mauro Carvalho Chehab wrote: > Em Mon, 19 Dec 2016 07:28:29 -0200 > Mauro Carvalho Chehab escreveu: > >> Em Fri, 16 Dec 2016 15:45:10 +0100 >> Hans Verkuil escreveu: >> >> > We really need a whiteboard for this :-( >> >> Well, we could schedule a media summit tog

Re: [PATCH] [media] exynos-gsc: Avoid spamming the log on VIDIOC_TRY_FMT

2017-02-01 Thread Shuah Khan
On 01/24/2017 02:42 PM, Javier Martinez Canillas wrote: > There isn't an ioctl to enum the supported field orders, so a user-space > application can call VIDIOC_TRY_FMT using different field orders to know > if one is supported. For example, GStreamer does this so during playback > dozens of the fo

[PATCH] media: s5p_mfc - remove unneeded io_modes initialzation in s5p_mfc_open()

2017-02-09 Thread Shuah Khan
Remove unneeded io_modes initialzation in s5p_mfc_open(). It gets done right below in vdev == dev->vfd_dec conditional. Signed-off-by: Shuah Khan --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/driv

[PATCH] media: fix s5p_mfc_set_dec_frame_buffer_v6() to print buf size in hex

2017-02-09 Thread Shuah Khan
Fix s5p_mfc_set_dec_frame_buffer_v6() to print buffer size in hex to be consistent with the rest of the messages in the routine. Signed-off-by: Shuah Khan --- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media

[PATCH v2] media: s5p_mfc print buf pointer in hex constistently

2017-02-10 Thread Shuah Khan
Fix s5p_mfc_set_dec_frame_buffer_v6() to print buffer pointer in hex to be consistent with the rest of the messages in the routine. Signed-off-by: Shuah Khan --- Fixed commit log. No code changes. Thanks for the catch. drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 2 +- 1 file changed, 1

Re: [PATCH v2 03/15] media: s5p-mfc: Replace mem_dev_* entries with an array

2017-02-22 Thread Shuah Khan
On Mon, Feb 20, 2017 at 6:38 AM, Marek Szyprowski wrote: > Internal MFC driver device structure contains two pointers to devices used > for DMA memory allocation: mem_dev_l and mem_dev_r. Replace them with the > mem_dev[] array and use defines for accessing particular banks. This will > help to si

Re: [PATCH v2 08/15] media: s5p-mfc: Move firmware allocation to DMA configure function

2017-02-22 Thread Shuah Khan
On Mon, Feb 20, 2017 at 6:38 AM, Marek Szyprowski wrote: > To complete DMA memory configuration for MFC device, allocation of the > firmware buffer is needed, because some parameters are dependant on its base > address. Till now, this has been handled in the s5p_mfc_alloc_firmware() > function. Th

Re: [PATCH 14/15] media: s5p-mfc: Use preallocated block allocator always for MFC v6+

2017-02-23 Thread Shuah Khan
On Tue, Feb 14, 2017 at 12:52 AM, Marek Szyprowski wrote: > It turned out that all versions of MFC v6+ hardware doesn't have a strict > requirement for ALL buffers to be allocated on higher addresses than the > firmware base like it was documented for MFC v5. This requirement is true > only for th

Re: [PATCH 14/15] media: s5p-mfc: Use preallocated block allocator always for MFC v6+

2017-02-24 Thread Shuah Khan
Hi Marek, On Thu, Feb 23, 2017 at 11:26 PM, Marek Szyprowski wrote: > Hi Shuah > > > > On 2017-02-23 22:43, Shuah Khan wrote: >> >> On Tue, Feb 14, 2017 at 12:52 AM, Marek Szyprowski >> wrote: >>> >>> It turned out that all versions of MFC v6+

Re: [PATCH 14/15] media: s5p-mfc: Use preallocated block allocator always for MFC v6+

2017-02-27 Thread Shuah Khan
On 02/27/2017 05:50 AM, Marek Szyprowski wrote: > Hi Shuah, > > On 2017-02-24 15:23, Shuah Khan wrote: >> On Thu, Feb 23, 2017 at 11:26 PM, Marek Szyprowski >> wrote: >>> On 2017-02-23 22:43, Shuah Khan wrote: >>>> On Tue, Feb 14, 2017 at 12:52 AM, Mar

Re: [RFC v2 03/11] vb2: Move cache synchronisation from buffer done to dqbuf handler

2017-03-27 Thread Shuah Khan
On Thu, Dec 15, 2016 at 6:24 PM, Laurent Pinchart wrote: > From: Sakari Ailus > > The cache synchronisation may be a time consuming operation and thus not > best performed in an interrupt which is a typical context for > vb2_buffer_done() calls. This may consume up to tens of ms on some > machine

Re: [RFC v2 05/11] v4l2-core: Don't sync cache for a buffer if so requested

2017-03-27 Thread Shuah Khan
On Thu, Dec 15, 2016 at 6:24 PM, Laurent Pinchart wrote: > From: Samu Onkalo > > The user may request to the driver (vb2) to skip the cache maintenance > operations in case the buffer does not need cache synchronisation, e.g. in > cases where the buffer is passed between hardware blocks without i

Re: [RFC v2 07/11] vb2: dma-contig: Remove redundant sgt_base field

2017-03-27 Thread Shuah Khan
On Thu, Dec 15, 2016 at 6:24 PM, Laurent Pinchart wrote: > From: Sakari Ailus > > The struct vb2_dc_buf contains two struct sg_table fields: sgt_base and > dma_sgt. The former is used by DMA-BUF buffers whereas the latter is used > by USERPTR. > > Unify the two, leaving dma_sgt. I think this pat

Re: [RFC 00/10] V4L2 explicit synchronization support

2017-04-03 Thread Shuah Khan
Hi Gustavo, On Mon, Apr 3, 2017 at 1:46 PM, Javier Martinez Canillas wrote: > Hello Mauro and Gustavo, > > On 04/03/2017 07:16 AM, Mauro Carvalho Chehab wrote: >> Hi Gustavo, >> >> Em Mon, 13 Mar 2017 16:20:25 -0300 >> Gustavo Padovan escreveu: >> >>> From: Gustavo Padovan >>> >>> Hi, >>> >>> T

[PATCH] arm: dma: fix sharing of coherent DMA memory without struct page

2017-04-05 Thread Shuah Khan
ssink force-modesetting=true I am sending RFC patch to get feedback on the approach and see if I missed anything. Signed-off-by: Shuah Khan --- arch/arm/mm/dma-mapping.c | 34 ++ drivers/base/dma-coherent.c| 25 +++ dr

Re: [PATCH 1/6] media: dvb_frontend: cleanup dvb_frontend_ioctl_properties()

2017-09-20 Thread Shuah Khan
; } > > if (copy_to_user((void __user *)tvps->props, tvp, >tvps->num * sizeof(struct dtv_property))) { > - err = -EFAULT; > - goto out; > + kfree(tvp); > + return -EFAULT; > } Could avoid duplicate code keeping out logic perhaps? Is there a reason for removing this? > - > - } else > - err = -EOPNOTSUPP; > - > -out: > - kfree(tvp); > - return err; > + kfree(tvp); > + break; > + } > + default: > + return -ENOTSUPP; > + } /* switch */ > + return 0; > } > > static int dtv_set_frontend(struct dvb_frontend *fe) > Reviewed-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 2/6] media: dvb_frontend: cleanup ioctl handling logic

2017-09-20 Thread Shuah Khan
that it would hopefully > + * work with a DVBv3 application. > + * It should be noticed that, on multi-frontend devices with > + * different types (terrestrial and cable, for example), > + * a pure DVBv3 application won't be able to use all delivery > + * systems. Yet, changing the DVBv5 cache to the other delivery > + * system should be enough for making it work. > + */ > + switch (dvbv3_type(c->delivery_system)) { > + case DVBV3_QPSK: > + info->type = FE_QPSK; > + break; > + case DVBV3_ATSC: > + info->type = FE_ATSC; > + break; > + case DVBV3_QAM: > + info->type = FE_QAM; > + break; > + case DVBV3_OFDM: > + info->type = FE_OFDM; > + break; > + default: > + dev_err(fe->dvb->device, > + "%s: doesn't know how to handle a DVBv3 > call to delivery system %i\n", > + __func__, c->delivery_system); > + fe->ops.info.type = FE_OFDM; > + } > + dev_dbg(fe->dvb->device, "%s: current delivery system on cache: > %d, V3 type: %d\n", > + __func__, c->delivery_system, > fe->ops.info.type); > + > + /* Set CAN_INVERSION_AUTO bit on in other than oneshot mode */ > + if (!(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) > + info->caps |= FE_CAN_INVERSION_AUTO; > + err = 0; > break; > + } > > case FE_SET_FRONTEND: > err = dvbv3_set_delivery_system(fe); > @@ -2466,11 +2455,10 @@ static int dvb_frontend_ioctl_legacy(struct file > *file, > err = dtv_get_frontend(fe, &getp, parg); > break; > } > - case FE_SET_FRONTEND_TUNE_MODE: > - fepriv->tune_mode_flags = (unsigned long) parg; > - err = 0; > - break; > - } > + > + default: > + return -ENOTSUPP; > + } /* switch */ > > return err; > } > Rest looks okay to me. With c->state issue addressed and/or explained: Reviewed-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 3/6] media: dvb_frontend: get rid of proprierty cache's state

2017-09-20 Thread Shuah Khan
e to indicate when the properties > got flushed. > > So, just get rid of it for good. Okay now PATCH 2/3 makes sense. Looks good to me. Reviewed-by: Shuah Khan > > Signed-off-by: Mauro Carvalho Chehab > --- > drivers/media/dvb-core/dvb_frontend.c | 20 ++-- &g

Re: [PATCH 5/6] media: dvb_frontend: better document the -EPERM condition

2017-09-20 Thread Shuah Khan
IOC_DIR(cmd) != _IOC_READ > + || cmd == FE_GET_EVENT > + || cmd == FE_DISEQC_RECV_SLAVE_REPLY)) { > up(&fepriv->sem); > return -EPERM; > } > Looks good to me Reviewed by: Shuah Khan thanks, -- Shuah

Re: [PATCH 01/25] media: dvb_frontend: better document the -EPERM condition

2017-09-20 Thread Shuah Khan
IR(cmd) != _IOC_READ > + || cmd == FE_GET_EVENT > + || cmd == FE_DISEQC_RECV_SLAVE_REPLY)) { > up(&fepriv->sem); > return -EPERM; > } > Same comment from your previous series. I started looking at the old series and now the latest. Didn't realize the series has been revised. :( Looks good to me Reviewed by: Shuah Khan thanks, -- Shuah

Re: [PATCH 02/25] media: dvb_frontend: fix return values for FE_SET_PROPERTY

2017-09-21 Thread Shuah Khan
t; > While we could fix the above, it could cause regressions. > > So, let's just assume what the code really does, updating > the documentation accordingly and removing the logic that > would update the discarded tvp->result. > > Signed-off-by: Mauro Carvalho Chehab

Re: [PATCH 17/25] media: dvb_frontend: dtv_property_process_set() cleanups

2017-09-21 Thread Shuah Khan
/* ATSC-MH */ > case DTV_ATSCMH_PARADE_ID: > - fe->dtv_property_cache.atscmh_parade_id = tvp->u.data; > + fe->dtv_property_cache.atscmh_parade_id = data; > break; > case DTV_ATSCMH_RS_FRAME_ENSEMBLE: > - fe->dtv_property_cache.atscmh_rs_frame_ensemble = tvp->u.data; > + fe->dtv_property_cache.atscmh_rs_frame_ensemble = data; > break; > > case DTV_LNA: > - c->lna = tvp->u.data; > + c->lna = data; > if (fe->ops.set_lna) > r = fe->ops.set_lna(fe); > if (r < 0) > @@ -2137,7 +2154,9 @@ static int dvb_frontend_handle_ioctl(struct file *file, > return PTR_ERR(tvp); > > for (i = 0; i < tvps->num; i++) { > - err = dtv_property_process_set(fe, tvp + i, file); > + err = dtv_property_process_set(fe, file, > + (tvp + i)->cmd, > + (tvp + i)->u.data); > if (err < 0) { > kfree(tvp); > return err; > The rest looks good. Once the other comments are addressed and/or explained. Reviewed-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 18/25] media: dvb_frontend: get rid of dtv_get_property_dump()

2017-09-21 Thread Shuah Khan
On 09/20/2017 01:11 PM, Mauro Carvalho Chehab wrote: > Simplify the get property handling and move it to the existing > code at dtv_property_process_get() directly. > > Signed-off-by: Mauro Carvalho Chehab > --- > drivers/media/dvb-core/dvb_frontend.c | 43 > ++-

s5p-mfc - WARNING: possible circular locking dependency detected,[ 4.14.0-rc2

2017-09-26 Thread Shuah Khan
rom [] (do_mmap+0x330/0x3a4) [ 2135.422063] [] (do_mmap) from [] (vm_mmap_pgoff+0x90/0xb8) [ 2135.429255] [] (vm_mmap_pgoff) from [] (SyS_mmap_pgoff+0x90/0xc0) [ 2135.437054] [] (SyS_mmap_pgoff) from [] (ret_fast_syscall+0x0/0x28) thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shua...@osg.samsung.com

Re: s5p-mfc - WARNING: possible circular locking dependency detected,[ 4.14.0-rc2

2017-09-26 Thread Shuah Khan
On 09/26/2017 02:10 PM, Shuah Khan wrote: > When running gstreamer pipeline with s5p-mfc → exynos-gsc→ exynos-drm, > I am seeing circular locking dependency detected warning in 4.14-rc2. > This is a regression from 4.13. The pipeline does run to completion > video streaming works. Are

Re: [RFC 5/5] pm: remove kernel thread freezing

2017-10-03 Thread Shuah Khan
On Tue, Oct 3, 2017 at 3:00 PM, Jiri Kosina wrote: > On Tue, 3 Oct 2017, Pavel Machek wrote: > >> > Again, I agree that the (rare) kthreads that are actually "creating" new >> > I/O have to be somehow frozen and require special care. >> >> Agreed. Was any effort made to identify those special kern

Re: [ANN] Call for topics for the media mini-summit on Friday Oct 27 in Prague

2017-10-05 Thread Shuah Khan
Hi Hans/Gustavo. On Wed, Oct 4, 2017 at 1:34 PM, Gustavo Padovan wrote: > Hi Hans, > > > > On Fri, Sep 1, 2017 at 6:46 AM, Hans Verkuil wrote: >> Hi all, >> >> We are organizing a media mini-summit on Friday October 27 in Prague, >> co-located >> with the ELCE conference: >> >> http://events.li

[PATCH 2/2] media: s5p-mfc: fix lock confection - request_firmware() once and keep state

2017-10-06 Thread Shuah Khan
[ 552.446104] lock(&mm->mmap_sem); [ 552.449484]lock(&type->i_mutex_dir_key#2); [ 552.456329]lock(&mm->mmap_sem); [ 552.46] lock(&dev->mfc_mutex); [ 552.465775] *** DE

[PATCH 1/2] media: s5p-mfc: check for firmware allocation before requesting firmware

2017-10-06 Thread Shuah Khan
Check if firmware is allocated before requesting firmware instead of requesting firmware only to release it if firmware is not allocated. Signed-off-by: Shuah Khan --- drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a

[PATCH 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-10-06 Thread Shuah Khan
This patch series fixes inefficiencies and lock contention in the request firmware paths. Shuah Khan (2): media: s5p-mfc: check for firmware allocation before requesting firmware media: s5p-mfc: fix lock confection - request_firmware() once and keep state drivers/media/platform/s5p

Re: [ANN] Call for topics for the media mini-summit on Friday Oct 27 in Prague

2017-10-13 Thread Shuah Khan
Hi Hans, On 10/13/2017 01:36 AM, Hans Verkuil wrote: > Hi Shuah, > > On 10/05/2017 03:53 PM, Shuah Khan wrote: >> Hi Hans/Gustavo. >> >> On Wed, Oct 4, 2017 at 1:34 PM, Gustavo Padovan wrote: >>> Hi Hans, >>> >>> >>> >&

Re: [ANN] Call for topics for the media mini-summit on Friday Oct 27 in Prague

2017-10-13 Thread Shuah Khan
On 10/13/2017 09:05 AM, Hans Verkuil wrote: > On 10/13/17 16:43, Shuah Khan wrote: >> Hi Hans, >> >> On 10/13/2017 01:36 AM, Hans Verkuil wrote: >>> Hi Shuah, >>> >>> On 10/05/2017 03:53 PM, Shuah Khan wrote: >>>> Hi Hans/Gustav

[PATCH 2/2] media: s5p-mfc: fix lockdep warning

2017-10-13 Thread Shuah Khan
ap_region) from [] (do_mmap+0x330/0x3a4) [ 2106.505068] [] (do_mmap) from [] (vm_mmap_pgoff+0x90/0xb8) [ 2106.512260] [] (vm_mmap_pgoff) from [] (SyS_mmap_pgoff+0x90/0xc0) [ 2106.520059] [] (SyS_mmap_pgoff) from [] (ret_fast_syscall+0x0/0x28) Signed-off-by: Shuah Khan Suggested-by: Hans Verkuil

[PATCH 1/2] media: exynos-gsc: fix lockdep warning

2017-10-13 Thread Shuah Khan
from [] (vm_mmap_pgoff+0x90/0xb8) [ 1991.302178] [] (vm_mmap_pgoff) from [] (SyS_mmap_pgoff+0x90/0xc0) [ 1991.309977] [] (SyS_mmap_pgoff) from [] (ret_fast_syscall+0x0/0x28) Signed-off-by: Shuah Khan Suggested-by: Hans Verkuil --- drivers/media/platform/exynos-gsc/gsc-m2m.c | 5 - 1 fi

[PATCH 0/2] fix lockdep warnings in s5p_mfc and exynos-gsc vb2 drivers

2017-10-13 Thread Shuah Khan
Driver mmap functions shouldn't hold lock when calling vb2_mmap(). The vb2_mmap() function has its own lock that it uses to protect the critical section. Reference: commit log for f035eb4e976ef5a059e30bc91cfd310ff030a7d3 Shuah Khan (2): media: exynos-gsc: fix lockdep warning media: s5

Re: [PATCH 0/2] fix lockdep warnings in s5p_mfc and exynos-gsc vb2 drivers

2017-10-16 Thread Shuah Khan
Hi Marek, On 10/16/2017 06:48 AM, Marek Szyprowski wrote: > Hi Shuah, > > On 2017-10-14 01:13, Shuah Khan wrote: >> Driver mmap functions shouldn't hold lock when calling vb2_mmap(). The >> vb2_mmap() function has its own lock that it uses to protect the critical &

Re: Exynos MFC issues on 4.14-rc4

2017-10-16 Thread Shuah Khan
On Mon, Oct 16, 2017 at 7:11 AM, Marek Szyprowski wrote: > Hi Marian, > > On 2017-10-12 02:49, Marian Mihailescu wrote: >> >> I've been testing 4.14-rc4 on Odroid-XU4, and here's a kernel >> complaint when running: >> >> gst-launch-1.0 filesrc location=bunny_trailer_1080p.mov ! parsebin ! >> v4l2v

Re: [PATCH] [media] dvb_frontend: ensure that front end status is initialized

2017-07-20 Thread Shuah Khan
Hi Colin, On 07/20/2017 09:29 AM, Colin King wrote: > From: Colin Ian King > > The fe_status variable s is not initialized meaning it can have any > random garbage status. This could be problematic if fe->ops.tune is > false as s is not updated by the call to fe->ops.tune() and a > subsequent c

Re: [PATCH][V2] dvb_frontend: ensure that inital front end status initialized

2017-07-20 Thread Shuah Khan
> subsequent check on the change status will using a garbage value. > Fix this by adding FE_NONE to the enum fe_status and initializing > s to this. > > Detected by CoverityScan, CID#112887 ("Uninitialized scalar variable") > > Signed-off-by: Colin Ian King Revi

Re: [PATCH] dvb_frontend: initialize variable s with FE_NONE instead of 0

2017-07-21 Thread Shuah Khan
On 07/21/2017 10:01 AM, Colin King wrote: > From: Colin Ian King > > In a previous commit, we added FE_NONE as an unknown fe_status. > Initialize variable s to FE_NONE instead of the more opaque value 0. > > Signed-off-by: Colin Ian King The change looks good to me. Revie

Re: [PATCH] arm: dma: fix sharing of coherent DMA memory without struct page

2017-04-10 Thread Shuah Khan
On 04/05/2017 05:14 PM, Russell King - ARM Linux wrote: > On Wed, Apr 05, 2017 at 10:02:42AM -0600, Shuah Khan wrote: >> When coherent DMA memory without struct page is shared, importer >> fails to find the page and runs into kernel page fault when it >> tries to dmabuf_ops_a

Re: [PATCH] arm: dma: fix sharing of coherent DMA memory without struct page

2017-04-10 Thread Shuah Khan
On 04/06/2017 06:01 AM, Marek Szyprowski wrote: > Hi Shuah, > > On 2017-04-05 18:02, Shuah Khan wrote: >> When coherent DMA memory without struct page is shared, importer >> fails to find the page and runs into kernel page fault when it >> tries to dmabuf_ops_attach/

Re: [PATCH] arm: dma: fix sharing of coherent DMA memory without struct page

2017-04-16 Thread Shuah Khan
On 04/14/2017 03:46 AM, Russell King - ARM Linux wrote: > On Fri, Apr 14, 2017 at 09:56:07AM +0200, Marek Szyprowski wrote: This would be however quite large task, especially taking into account all current users of DMA-buf framework... >>> Yeah it will be a large task. >> >> Maybe once s

Re: [PATCH] arm: dma: fix sharing of coherent DMA memory without struct page

2017-04-19 Thread Shuah Khan
Hi Russell, and Marek, On 04/14/2017 03:46 AM, Russell King - ARM Linux wrote: > On Fri, Apr 14, 2017 at 09:56:07AM +0200, Marek Szyprowski wrote: This would be however quite large task, especially taking into account all current users of DMA-buf framework... >>> Yeah it will be a large

Re: [RFC v3 00/21] Make use of kref in media device, grab references as needed

2017-05-30 Thread Shuah Khan
Hi Sailus/Mauro, On 01/26/2017 02:10 AM, Mauro Carvalho Chehab wrote: > Em Wed, 25 Jan 2017 13:02:31 +0200 > Sakari Ailus escreveu: > >> Hi Mauro, >> >> On Tue, Jan 24, 2017 at 08:49:02AM -0200, Mauro Carvalho Chehab wrote: >>> Hi Sakari, >>> >>> Just returned this week from vacations. I'm readi

Re: [PATCH 5/9] [media] s5p-jpeg: Add IOMMU support

2017-06-02 Thread Shuah Khan
On Fri, Jun 2, 2017 at 10:02 AM, Thierry Escande wrote: > From: Tony K Nadackal > > This patch adds support for IOMMU s5p-jpeg driver if the Exynos IOMMU > and ARM DMA IOMMU configurations are supported. The address space is > created with size limited to 256M and base address set to 0x2000.

Re: [PATCH 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-10-25 Thread Shuah Khan
On 10/06/2017 03:30 PM, Shuah Khan wrote: > This patch series fixes inefficiencies and lock contention in the request > firmware paths. > > Shuah Khan (2): > media: s5p-mfc: check for firmware allocation before requesting > firmware > media: s5p-mfc: fix lock confecti

Re: [PATCH 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-10-25 Thread Shuah Khan
On 10/25/2017 04:28 PM, Marian Mihailescu wrote: > Hi Shuah, > > For MFC patch, you can delete the "dev" variable since it's not being > used anymore and results in a compile warning. > > - struct s5p_mfc_dev *dev = ctx->dev; > > Cheers, > Marian Oops. I thought I handled that. I will fix that

[PATCH v2] media: s5p-mfc: fix lockdep warning

2017-10-30 Thread Shuah Khan
ap_region) from [] (do_mmap+0x330/0x3a4) [ 2106.505068] [] (do_mmap) from [] (vm_mmap_pgoff+0x90/0xb8) [ 2106.512260] [] (vm_mmap_pgoff) from [] (SyS_mmap_pgoff+0x90/0xc0) [ 2106.520059] [] (SyS_mmap_pgoff) from [] (ret_fast_syscall+0x0/0x28) Signed-off-by: Shuah Khan Suggested-by: Hans Verkuil

Re: [PATCH 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-10-30 Thread Shuah Khan
doesn't have the unused warn problem. I fixed the problem in media: s5p-mfc: fix lockdep warning patch that has the warning and sent v2. > On Thu, Oct 26, 2017 at 7:54 AM, Shuah Khan wrote: >> On 10/06/2017 03:30 PM, Shuah Khan wrote: >>> This patch series fixes ineffi

Re: [PATCH 1/2] media: s5p-mfc: check for firmware allocation before requesting firmware

2017-11-02 Thread Shuah Khan
On 11/02/2017 02:12 AM, Andrzej Hajda wrote: > Hi Shuah, > > On 06.10.2017 23:30, Shuah Khan wrote: >> Check if firmware is allocated before requesting firmware instead of >> requesting firmware only to release it if firmware is not allocated. >> >> Signed-off-b

Re: [PATCH 2/2] media: s5p-mfc: fix lock confection - request_firmware() once and keep state

2017-11-02 Thread Shuah Khan
On 11/02/2017 02:31 AM, Andrzej Hajda wrote: > On 06.10.2017 23:30, Shuah Khan wrote: >> Driver calls request_firmware() whenever the device is opened for the >> first time. As the device gets opened and closed, dev->num_inst == 1 >> is true several times. This is not nece

Re: [PATCH 2/2] media: s5p-mfc: fix lock confection - request_firmware() once and keep state

2017-11-03 Thread Shuah Khan
On 11/02/2017 06:43 PM, Marian Mihailescu wrote: > I can confirm, with this patch, there is always error loading MFC in > boot log, since FS is not mounted. > > -Marian > Please refrain from top posting to a kernel email threads. It is very difficult to follow. Bottom post is the norm. thanks,

[PATCH v2 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-11-03 Thread Shuah Khan
case it works. Shuah Khan (2): media: s5p-mfc: remove firmware buf null check in s5p_mfc_load_firmware() media: s5p-mfc: fix lock confection - request_firmware() once and keep state drivers/media/platform/s5p-mfc/s5p_mfc.c| 6 ++ drivers/media/platform/s5p-mfc/s5p_mfc_commo

[PATCH v2 2/2] media: s5p-mfc: fix lock confection - request_firmware() once and keep state

2017-11-03 Thread Shuah Khan
[ 552.446104] lock(&mm->mmap_sem); [ 552.449484]lock(&type->i_mutex_dir_key#2); [ 552.456329]lock(&mm->mmap_sem); [ 552.46] lock(&dev->mfc_mutex); [ 552.465775] *** DEAD

[PATCH v2 1/2] media: s5p-mfc: remove firmware buf null check in s5p_mfc_load_firmware()

2017-11-03 Thread Shuah Khan
s5p_mfc_load_firmware() will not get called if fw_buf.virt allocation fails. The allocation happens very early on in the probe routine and probe fails if allocation fails. There is no need to check if it is null in s5p_mfc_load_firmware(). Remove the check. Signed-off-by: Shuah Khan

Re: [PATCH v2 1/2] media: exynos-gsc: fix lockdep warning

2017-11-07 Thread Shuah Khan
On 10/16/2017 09:18 AM, Hans Verkuil wrote: > On 10/16/2017 05:16 PM, Shuah Khan wrote: >> The driver mmap functions shouldn't take lock when calling vb2_mmap(). >> Fix it to not take the lock. >> >> Reference: commit log for f035eb4e976ef5a

Re: [PATCH v2 1/2] media: exynos-gsc: fix lockdep warning

2017-12-08 Thread Shuah Khan
On 11/07/2017 09:53 AM, Shuah Khan wrote: > On 10/16/2017 09:18 AM, Hans Verkuil wrote: >> On 10/16/2017 05:16 PM, Shuah Khan wrote: >>> The driver mmap functions shouldn't take lock when calling vb2_mmap(). >>> Fix it to not take the lock. &

[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 --- drivers/media/usb/em28xx/em28xx-video.c | 28 1 file

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

2014-02-21 Thread Shuah Khan
: Shuah Khan --- 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 898fb9b..6de41c6

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

2014-02-21 Thread Shuah Khan
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 --- drivers/media/usb/em28xx/em28xx-audio.c | 30 ++ 1 file

[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 --- drivers/media/usb/em28xx/em28xx-dvb.c | 57 +++ 1 file

[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 --- drivers/media/usb

[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 --- drivers/media/usb/em28xx/em28xx-input.c | 35 + 1 file

[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
of ‘msg’ was here struct i2c_msg msg[2]; ^ Signed-off-by: Shuah Khan --- 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/d

[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 --- 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-frontends/drx39xyj

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

2014-02-28 Thread Shuah Khan
^ Signed-off-by: Shuah Khan --- 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/dvb

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

2014-02-28 Thread Shuah Khan
-- Shuah On Feb 28, 2014 4:23 PM, "Shuah Khan" mailto:shuah...@samsung.com>> wrote: 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

Re: [PATCH] media: fix use-after-free in cdev_put() when app exits after driver unbind

2016-05-03 Thread Shuah Khan
On 05/02/2016 04:16 AM, Lars-Peter Clausen wrote: > On 04/30/2016 12:37 AM, Shuah Khan wrote: > [...] >> diff --git a/include/media/media-devnode.h b/include/media/media-devnode.h >> index 5bb3b0e..ce9b051 100644 >> --- a/include/media/media-devnode.h >> +++ b

[PATCH v2] media: fix use-after-free in cdev_put() when app exits after driver unbind

2016-05-03 Thread Shuah Khan
] [] ? exit_to_usermode_loop+0xe7 kernel: [ 193.601368] [] exit_to_usermode_loop+0x120 kernel: [ 193.601376] [] syscall_return_slowpath+0x16a kernel: [ 193.601386] [] entry_SYSCALL_64_fastpath+0xa6 Signed-off-by: Shuah Khan --- Changes since v1: - Addressed review comments from Lars-Peter Clausen

Re: [PATCH v2 4/5] media: Add flags to tell whether to take graph mutex for an IOCTL

2016-05-04 Thread Shuah Khan
On 05/04/2016 05:20 AM, Sakari Ailus wrote: > New IOCTLs (especially for the request API) do not necessarily need the > graph mutex acquired. Leave this up to the drivers. Sakari, Does this mean drivers have to hold the graph mutex as needed? My concern with this is that we will have graph_mutex

[PATCH v3] media: fix use-after-free in cdev_put() when app exits after driver unbind

2016-05-04 Thread Shuah Khan
] [] ? exit_to_usermode_loop+0xe7 kernel: [ 193.601368] [] exit_to_usermode_loop+0x120 kernel: [ 193.601376] [] syscall_return_slowpath+0x16a kernel: [ 193.601386] [] entry_SYSCALL_64_fastpath+0xa6 Signed-off-by: Shuah Khan --- Changes since v2: - Changed pr_info()s to pr_debug()s Changes since v1: - Addressed review

Re: [PATCH 2/2] [media] media-device: dynamically allocate struct media_devnode

2016-05-09 Thread Shuah Khan
On 05/09/2016 09:03 AM, Mauro Carvalho Chehab wrote: > Em Mon, 9 May 2016 14:40:02 +0300 > Laurent Pinchart escreveu: > >> Hi Mauro, >> >> Thank you for the patch. >> >> On Saturday 07 May 2016 12:12:09 Mauro Carvalho Chehab wrote: >>> struct media_devnode is currently embedded at struct media_de

[PATCH 1/3] media: Media Device Allocator API

2016-05-13 Thread Shuah Khan
the references are released. Signed-off-by: Shuah Khan --- drivers/media/Makefile | 3 +- drivers/media/media-dev-allocator.c | 139 include/media/media-dev-allocator.h | 118 ++ 3 files changed, 259 insertions(+), 1

[PATCH 3/3] media: change au0828 to use Media Device Allocator API

2016-05-13 Thread Shuah Khan
Change au0828 to use Media Device Allocator API to allocate media device with the parent usb struct device as the key, so it can be shared with the snd usb audio driver. Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-core.c | 12 drivers/media/usb/au0828/au0828.h

[PATCH 0/3] Media Device Allocator API

2016-05-13 Thread Shuah Khan
the references are released. This patch series has been tested with au0828 and snd-usb-audio drivers. snd-usb-audio patch isn't included in this series. Once this patch series is reviews and gets a stable state, I will send out the snd-usb-audio patch. Shuah Khan (3): media: Media D

[PATCH 2/3] media: add media_device_unregister_put() interface

2016-05-13 Thread Shuah Khan
and freed in the kref put handler. Signed-off-by: Shuah Khan --- drivers/media/media-device.c | 11 +++ include/media/media-device.h | 15 +++ 2 files changed, 26 insertions(+) diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 33a9952..b5c279a

Re: [PATCH 1/3] media: Media Device Allocator API

2016-05-24 Thread Shuah Khan
On 05/23/2016 05:26 AM, Hans Verkuil wrote: > Hi Shuah, > > Some comments below: Thanks for the review. > > On 05/13/2016 07:09 PM, Shuah Khan wrote: >> Media Device Allocator API to allows multiple drivers share a media device. >> Using this API, drivers can alloc

Re: [PATCH 2/3] media: add media_device_unregister_put() interface

2016-05-24 Thread Shuah Khan
On 05/23/2016 05:39 AM, Hans Verkuil wrote: > On 05/13/2016 07:09 PM, Shuah Khan wrote: >> Add media_device_unregister_put() interface to release reference to a media >> device allocated using the Media Device Allocator API. The media device is >> unregistered and freed when

[PATCH v2 1/2] media: Media Device Allocator API

2016-05-24 Thread Shuah Khan
the references are released. Signed-off-by: Shuah Khan --- drivers/media/Makefile | 3 +- drivers/media/media-dev-allocator.c | 120 include/media/media-dev-allocator.h | 85 + 3 files changed, 207 insertions(+), 1

[PATCH v2 0/2] Media Device Allocator API

2016-05-24 Thread Shuah Khan
ia_device_*_allocate(). - Dropped media_device_unregister_put(). au0828 calls media_device_delete() instead. Shuah Khan (2): media: Media Device Allocator API media: change au0828 to use Media Device Allocator API drivers/media/Makefile | 3 +- drivers/media/media-dev-allocator.

[PATCH v2 2/2] media: change au0828 to use Media Device Allocator API

2016-05-24 Thread Shuah Khan
Change au0828 to use Media Device Allocator API to allocate media device with the parent usb struct device as the key, so it can be shared with the snd usb audio driver. Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-core.c | 12 drivers/media/usb/au0828/au0828.h

[PATCH v3] media: Media Device Allocator API

2016-05-27 Thread Shuah Khan
the references are released. Signed-off-by: Shuah Khan --- Changes since v2: -- Addressed Hans's comments on v2 drivers/media/Makefile | 3 +- drivers/media/media-dev-allocator.c | 114 include/media/media-dev-allocator.h

Re: [PATCH v2 1/2] media: Media Device Allocator API

2016-05-27 Thread Shuah Khan
On 05/27/2016 07:26 AM, Hans Verkuil wrote: > On 05/25/2016 01:39 AM, Shuah Khan wrote: >> Media Device Allocator API to allows multiple drivers share a media device. >> Using this API, drivers can allocate a media device with the shared struct >> device as the key. Onc

Re: [PATCH 2/2] [media] media-device: dynamically allocate struct media_devnode

2016-06-06 Thread Shuah Khan
Hi Sakari, On 06/06/2016 02:45 AM, Sakari Ailus wrote: > Hi Mauro, > > On Sat, May 07, 2016 at 12:12:09PM -0300, Mauro Carvalho Chehab wrote: >> struct media_devnode is currently embedded at struct media_device. >> >> While this works fine during normal usage, it leads to a race >> condition duri

Re: [PATCH] media: s5p-mfc: fix error path in driver probe

2016-06-08 Thread Shuah Khan
Hi Marek, On 06/08/2016 08:35 AM, Liviu Dudau wrote: > On Wed, Jun 08, 2016 at 01:33:40PM +0200, Marek Szyprowski wrote: >> This patch fixes the error path in the driver probe, so in case of >> any failure, the resources are not leaked. >> >> Reported-by: Liviu Dudau >> Signed-off-by: Marek Szypr

[PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()

2016-06-08 Thread Shuah Khan
s5p_mfc_remove() fails to release encoder and decoder video devices. Signed-off-by: Shuah Khan --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 274b4f1

[PATCH] media: s5p-mfc fix video device release double release in probe error path

2016-06-08 Thread Shuah Khan
Fix Decoder and encoder video device double release in probe error path. video_device_release(dev->vfd_dec) get called twice if decoder register fails. Also, video_device_release(dev->vfd_enc) get called twice if encoder register fails. Signed-off-by: Shuah Khan --- drivers/media/platfo

[PATCH] media: fix media devnode ioctl/syscall and unregister race

2016-06-10 Thread Shuah Khan
e memory) ... media_devnode_unregister() ... (driver releases the media device memory) Signed-off-by: Shuah Khan Suggested-by: Sakari Ailus Reported-by: Mauro Carvalho Chehab --- Test P

Re: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()

2016-06-13 Thread Shuah Khan
On 06/13/2016 07:42 AM, Javier Martinez Canillas wrote: > Hello Shuah, > > On Wed, Jun 8, 2016 at 9:35 PM, Shuah Khan wrote: >> s5p_mfc_remove() fails to release encoder and decoder video devices. >> >> Signed-off-by: Shuah Khan >> --- >> drivers/media/

[PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()

2016-06-13 Thread Shuah Khan
s5p_mfc_remove() fails to release encoder and decoder video devices. Signed-off-by: Shuah Khan Reviewed-by: Javier Martinez Canillas --- Changes since v1: - Addressed comments from Javier Martinez Canillas and added his reviewed by: drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++ 1 file

Re: [PATCH 3/3] drivers/media/media-device: fix double free bug in _unregister()

2016-06-15 Thread Shuah Khan
On 06/15/2016 02:15 PM, Max Kellermann wrote: > While removing all interfaces in media_device_unregister(), all > media_interface pointers are freed. This is illegal and results in > double kfree() if any media_interface is still linked at this point; > maybe because a userspace process still has

Re: [PATCH 3/3] drivers/media/media-device: fix double free bug in _unregister()

2016-06-15 Thread Shuah Khan
On 06/15/2016 02:37 PM, Max Kellermann wrote: > On 2016/06/15 22:32, Shuah Khan wrote: >> This change introduces memory leaks, since drivers are relying on >> media_device_unregister() to free interfaces. > > This is what I thought, too, until I checked the code paths.

Re: [PATCH 3/3] drivers/media/media-device: fix double free bug in _unregister()

2016-06-16 Thread Shuah Khan
On 06/16/2016 03:29 AM, Max Kellermann wrote: > (Shuah, I did not receive your second reply; I only found it in an > email archive.) > >> Yes media_devnode_create() creates the interfaces links and these >> links are deleted by media_devnode_remove(). >> media_device_unregister() still needs to de

Re: [PATCH 1/3] drivers/media/dvb-core/en50221: use kref to manage struct dvb_ca_private

2016-06-16 Thread Shuah Khan
On 06/15/2016 02:15 PM, Max Kellermann wrote: > Don't free the object until the file handle has been closed. Fixes > use-after-free bug which occurs when I disconnect my DVB-S received > while VDR is running. Which file handle? /dev/dvb--- There seems to be a problem in the driver release routin

Re: [PATCH 2/3] drivers/media/media-entity: clear media_gobj.mdev in _destroy()

2016-06-16 Thread Shuah Khan
On 06/15/2016 02:15 PM, Max Kellermann wrote: > media_gobj_destroy() may be called twice on one instance - once by > media_device_unregister() and again by dvb_media_device_free(). The > function media_remove_intf_links() establishes and documents the > convention that mdev==NULL means that the ob

Re: [PATCH 2/3] drivers/media/media-entity: clear media_gobj.mdev in _destroy()

2016-06-16 Thread Shuah Khan
On 06/16/2016 12:43 PM, Max Kellermann wrote: > On 2016/06/16 18:24, Shuah Khan wrote: >> On 06/15/2016 02:15 PM, Max Kellermann wrote: >>> media_gobj_destroy() may be called twice on one instance - once by >>> media_device_unregister() and again by dvb_media_devic

<    1   2   3   4   5   6   7   >