summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorRobert Schlabbach <robert_s@gmx.net>2022-01-21 22:18:49 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-11-25 10:59:09 +0100
commite704b44b550fbc9a4af15bc848fdbac5ff2eec47 (patch)
treea60f107adc9ed3c529027fb994beec01501fe9d5 /include/media
parentmedia: dvb: add DVB-C2 and DVB-S2X parameter values (diff)
downloadlinux-e704b44b550fbc9a4af15bc848fdbac5ff2eec47.tar.xz
linux-e704b44b550fbc9a4af15bc848fdbac5ff2eec47.zip
media: dvb-core: Enhance shared multi-frontend support
Drivers for devices with multiple frontends which cannot be used concurrently due to hardware limitations which enforce that restriction by setting the mfe_shared field to 1 exhibit rather unfriendly behavior towards applications: The unavailable frontend devices cannot be opened at all, not even for read-only access to query information. Even worse, any open call is blocked for 5 seconds by default. Allow drivers for such devices to behave like regular busy frontend devices instead, i.e. still allowing concurrent read access to the unavailable frontend and denying concurrent write access with -EBUSY without delay. This patch does not alter the behavior of any existing driver to avoid regressions. Driver developers who wish to take advantage of this must ensure their driver can handle all read-only accesses to the unavailable frontend, and indicate the capability by setting the mfe_shared field to 2 instead of 1. Add a check to dvb-usb-init.c when automatically setting the mfe_shared field that when a driver has already set the field to 2, it is not overwritten. Document the additional capability in the code comment about mfe_shared. Link: https://lore.kernel.org/linux-media/trinity-22c77578-26b0-4867-9ff7-2668e5d22c64-1642799929896@3c-app-gmx-bap04 Signed-off-by: Robert Schlabbach <robert_s@gmx.net> Tested-by: Robert Schlabbach <robert_s@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/dvbdev.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/media/dvbdev.h b/include/media/dvbdev.h
index 2f6b0861322a..6ccff7c6fa6b 100644
--- a/include/media/dvbdev.h
+++ b/include/media/dvbdev.h
@@ -87,7 +87,11 @@ struct dvb_frontend;
* @device: pointer to struct device
* @module: pointer to struct module
* @mfe_shared: indicates mutually exclusive frontends.
- * Use of this flag is currently deprecated.
+ * 1 = legacy exclusion behavior: blocking any open() call
+ * 2 = enhanced exclusion behavior, emulating the standard
+ * behavior of busy frontends: allowing read-only sharing
+ * and otherwise returning immediately with -EBUSY when any
+ * of the frontends is already opened with write access.
* @mfe_dvbdev: Frontend device in use, in the case of MFE
* @mfe_lock: Lock to prevent using the other frontends when MFE is
* used.