All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] media: dvb-core: Enhance shared multi-frontend support
@ 2022-01-21 21:17 Robert Schlabbach
  0 siblings, 0 replies; only message in thread
From: Robert Schlabbach @ 2022-01-21 21:17 UTC (permalink / raw)
  To: linux-media

I'm currently developing a driver for a receiver with multiple frontends which
cannot be used simultaneously, and found that employing the mfe_shared field to
exhibit that restriction leads to terrible behavior towards applications:

- the unavailable frontend device cannot be opened at all, not even in read-
  only mode to just query information about the frontend
- and really terrible: the open() call is blocked for a whopping 5 seconds!

The user experience ended up being this (/dev/dvb/adapter0/frontend0 was
already in use):

$ robscan
[5 seconds delay]
Could not open /dev/dvb/adapter0/frontend1, device is busy
Available Frontends and Supported Delivery Systems:
1: /dev/dvb/adapter0/frontend0: Silicon Labs Si2183 (DVB-T/T2)
2: /dev/dvb/adapter0/frontend0: Silicon Labs Si2183 (DVB-C)
[shared frontend is missing]
Select Frontend: 1
ERROR: Could not select frontend Silicon Labs Si2183: Device or resource busy

The actually busy frontend /dev/dvb/adapter0/frontend0 could be queried
for its name and supported delivery systems and the error when trying to
use it came back immediately, so I thought I want the shared frontend to
exhibit the same behavior, i.e. allow it being queried for its name and
supported delivery systems, and reject write access with -EBUSY without
delay.

So I developed the attached patch for dvb_core.c which allows setting the
mfe_shared field to 2 to achieve this behavior. Using this setting in my
driver yielded the desired result:

$ robscan
Available Frontends and Supported Delivery Systems:
1: /dev/dvb/adapter0/frontend0: Silicon Labs Si2183 (DVB-T/T2)
2: /dev/dvb/adapter0/frontend0: Silicon Labs Si2183 (DVB-C)
3: /dev/dvb/adapter0/frontend1: Silicon Labs Si2183 (DVB-S/S2)
Select Frontend: 3
ERROR: Could not select frontend Silicon Labs Si2183: Device or resource busy

No delays, the unavailable frontend can be shown with name and supported
delivery systems, and trying to use it gives the same result as for the
frontend device currently in use.

I left the existing uses of the mfe_shared field untouched so that existing
drivers continue to function as before. Maybe some would already work by just
setting the field to 2, but I did not take the time to thoroughly review their
code, nor do I have those devices available to do regression testing with.

So for now, only my driver would take advantage of this. I intend to submit
my device driver once it is finished.

Signed-off-by: Robert Schlabbach <robert_s@gmx.net>
Tested-by: Robert Schlabbach <robert_s@gmx.net>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-21 21:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21 21:17 [PATCH 0/1] media: dvb-core: Enhance shared multi-frontend support Robert Schlabbach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.