From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shuah Khan Subject: Re: [PATCH 15/31] media: dvb-frontend invoke enable/disable_source handlers Date: Thu, 28 Jan 2016 09:59:38 -0700 Message-ID: <56AA48FA.7070203@osg.samsung.com> References: <1591b6cf2025fa95a13e3b7dde52aa0e0bde0bb4.1452105878.git.shuahkh@osg.samsung.com> <20160128135304.3daa79f1@recife.lan> <20160128160711.029f3faf@lxorguk.ukuu.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160128160711.029f3faf-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: One Thousand Gnomes , Mauro Carvalho Chehab Cc: tiwai-IBi9RG/b67k@public.gmane.org, clemens-P6GI/4k7KOmELgA04lAiVw@public.gmane.org, hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org, laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org, sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org, pawel-FA/gS7QP4orQT0dZR+AlfA@public.gmane.org, m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, perex-/Fr2/VpizcU@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, tvboxspy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, crope-X3B1VOXEql0@public.gmane.org, ruchandani.tina-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, corbet-T1hC0tSOHrs@public.gmane.org, chehabrafael-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, stefanr-MtYdepGKPcBMYopoZt5u/LNAH6kLmebB@public.gmane.org, inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, jh1009.sung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, prabhakar.csengg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, labbott-rxtnV0ftBwyoClj4AeEUq9i2O/JbrIOy@public.gmane.org, pierre-louis.bossart-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, ricard.wanderlof-VrBV9hrLPhE@public.gmane.org, julian-SZMMDGyaqes@public.gmane.org, takamichiho-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, dominic.sacre-Mmb7MZpHnFY@public.gmane.org, misterpib-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org, gtmkramer-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org, normalperson-rMlxZR9MS24@public.gmane.org, joe-amhYAVlgbXj10XsdtD+oqA@public.gmane.org, linuxbugs@vittga List-Id: alsa-devel@alsa-project.org On 01/28/2016 09:07 AM, One Thousand Gnomes wrote: > On Thu, 28 Jan 2016 13:53:04 -0200 > Mauro Carvalho Chehab wrote: > >> Em Wed, 6 Jan 2016 13:27:04 -0700 >> Shuah Khan escreveu: >> >>> Checking for tuner availability from frontend thread start >>> disrupts video stream. Change to check for tuner and start >>> pipeline from frontend open instead and stop pipeline from >>> frontend release. >> >> That's wrong, as DVB can be opened on read-only mode, where >> it won't be changing anything. Correct. Please check the code. Tuner availability check is done when the device is opened in Write mode in the following conditional. if ((file->f_flags & O_ACCMODE) != O_RDONLY) { >> >> Also, I don't think POSIX allows to return an error like EBUSY >> on open: >> http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html > > It doesn't document all the errors you may return. Quite a lot of > kernel drivers return EBUSY when they are "single open" things. > > POSIX documents certain cases that *must* error and what the error code > is. It documents certain possible failures and what their error code is. > Beyond that it's up to you. > Returning EBUSY clearly indicates the reason why the device can't be opened in this case. thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org | (970) 217-8978 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from lists.s-osg.org ([54.187.51.154]:58128 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965376AbcA1Q7m (ORCPT ); Thu, 28 Jan 2016 11:59:42 -0500 Subject: Re: [PATCH 15/31] media: dvb-frontend invoke enable/disable_source handlers To: One Thousand Gnomes , Mauro Carvalho Chehab References: <1591b6cf2025fa95a13e3b7dde52aa0e0bde0bb4.1452105878.git.shuahkh@osg.samsung.com> <20160128135304.3daa79f1@recife.lan> <20160128160711.029f3faf@lxorguk.ukuu.org.uk> Cc: tiwai@suse.com, clemens@ladisch.de, hans.verkuil@cisco.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, javier@osg.samsung.com, pawel@osciak.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, perex@perex.cz, arnd@arndb.de, dan.carpenter@oracle.com, tvboxspy@gmail.com, crope@iki.fi, ruchandani.tina@gmail.com, corbet@lwn.net, chehabrafael@gmail.com, k.kozlowski@samsung.com, stefanr@s5r6.in-berlin.de, inki.dae@samsung.com, jh1009.sung@samsung.com, elfring@users.sourceforge.net, prabhakar.csengg@gmail.com, sw0312.kim@samsung.com, p.zabel@pengutronix.de, ricardo.ribalda@gmail.com, labbott@fedoraproject.org, pierre-louis.bossart@linux.intel.com, ricard.wanderlof@axis.com, julian@jusst.de, takamichiho@gmail.com, dominic.sacre@gmx.de, misterpib@gmail.com, daniel@zonque.org, gtmkramer@xs4all.nl, normalperson@yhbt.net, joe@oampo.co.uk, linuxbugs@vittgam.net, johan@oljud.se, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-api@vger.kernel.org, alsa-devel@alsa-project.org, Shuah Khan From: Shuah Khan Message-ID: <56AA48FA.7070203@osg.samsung.com> Date: Thu, 28 Jan 2016 09:59:38 -0700 MIME-Version: 1.0 In-Reply-To: <20160128160711.029f3faf@lxorguk.ukuu.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: On 01/28/2016 09:07 AM, One Thousand Gnomes wrote: > On Thu, 28 Jan 2016 13:53:04 -0200 > Mauro Carvalho Chehab wrote: > >> Em Wed, 6 Jan 2016 13:27:04 -0700 >> Shuah Khan escreveu: >> >>> Checking for tuner availability from frontend thread start >>> disrupts video stream. Change to check for tuner and start >>> pipeline from frontend open instead and stop pipeline from >>> frontend release. >> >> That's wrong, as DVB can be opened on read-only mode, where >> it won't be changing anything. Correct. Please check the code. Tuner availability check is done when the device is opened in Write mode in the following conditional. if ((file->f_flags & O_ACCMODE) != O_RDONLY) { >> >> Also, I don't think POSIX allows to return an error like EBUSY >> on open: >> http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html > > It doesn't document all the errors you may return. Quite a lot of > kernel drivers return EBUSY when they are "single open" things. > > POSIX documents certain cases that *must* error and what the error code > is. It documents certain possible failures and what their error code is. > Beyond that it's up to you. > Returning EBUSY clearly indicates the reason why the device can't be opened in this case. thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shuahkh@osg.samsung.com | (970) 217-8978