public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] ddbridge improvements and cleanups
@ 2017-12-17 15:40 Daniel Scheller
  2017-12-17 15:40 ` [PATCH 1/8] [media] ddbridge: unregister I2C tuner client before detaching fe's Daniel Scheller
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Daniel Scheller @ 2017-12-17 15:40 UTC (permalink / raw)
  To: linux-media, mchehab, mchehab

From: Daniel Scheller <d.scheller@gmx.net>

This series improves on a few things in ddbridge:

* Fix up a KASAN report which pops up with all TDA18212-equipped hardware
  by changing the order of all frontend driver teardown. This was
  originally thought to be a problem of the tda18212 driver, see
  https://patchwork.linuxtv.org/patch/45992/ (though other drivers with
  that problem may remain).
* Fix up CI resources cleanup handling, and further cosmetics and code
  move, all CI related
* Frontend cleanup improvements when handling errors (ie. when on one
  port the device initialisation fails). Whenever a tuner module fails
  now, everything should be cleaned up properly (and early) now, while
  all other (working) tuners are being usable. Proper errors are printed
  to the kernel log about this.

Mauro, I'm pretty sure you like this overall approach better, compared
to https://patchwork.linuxtv.org/patch/45810/ :-) In fact, I picked up
your idea of counting ports and act accordingly. Partial hardware setup
now starts up all working parts properly, while releasing resources
early when the nonworking parts are handled. If no ports could be started
at all, the driver instance will fail gracefully and report this to
upper layers.

I verified this by simply removing tda18212.ko with this DD setup:

* CineCTv6 bridge card (stv0367+tda18212 soldered on it, handled as
  port 0), one DuoFlex C2T2 connected to port 1 (cxd2841er+tda18212)
* Octopus CI Duo, one DuoFlex C2T2I (cxd2841er+tda18212) connected to
  port 1, one SingleCI module (cxd2099) connected to port 2

Upon modprobe ddbridge, the CTv6 will completely fail due to the tuner
driver not initialising (it's not there, actually). The OctoCIDUO
will fail on the C2T2I Flex, but starts up the CI hardware, registers
it's en50221 device nodes and things work fine with it. Unload cleans
up everything, no leaked usecounts, no KASAN complaints. Putting back
tda18212.ko, modprobe ddbridge - registers everything. Unload cleans
up everything properly aswell.

Not entirely sure, but patch 1 might be something for stable (ie. 4.14).

Daniel Scheller (8):
  [media] ddbridge: unregister I2C tuner client before detaching fe's
  [media] ddbridge: fix resources cleanup for CI hardware
  [media] ddbridge: deduplicate calls to dvb_ca_en50221_init()
  [media] ddbridge: move CI detach code to ddbridge-ci.c
  [media] ddbridge: completely tear down input resources on failure
  [media] ddbridge: fix deinit order in case of failure in ddb_init()
  [media] ddbridge: detach first input if the second one failed to init
  [media] ddbridge: improve ddb_ports_attach() failure handling

 drivers/media/pci/ddbridge/ddbridge-ci.c   |  17 +++--
 drivers/media/pci/ddbridge/ddbridge-ci.h   |   1 +
 drivers/media/pci/ddbridge/ddbridge-core.c | 108 ++++++++++++++++++-----------
 3 files changed, 81 insertions(+), 45 deletions(-)

-- 
2.13.6

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-12-17 16:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-17 15:40 [PATCH 0/8] ddbridge improvements and cleanups Daniel Scheller
2017-12-17 15:40 ` [PATCH 1/8] [media] ddbridge: unregister I2C tuner client before detaching fe's Daniel Scheller
2017-12-17 15:40 ` [PATCH 2/8] [media] ddbridge: fix resources cleanup for CI hardware Daniel Scheller
2017-12-17 15:40 ` [PATCH 3/8] [media] ddbridge: deduplicate calls to dvb_ca_en50221_init() Daniel Scheller
2017-12-17 15:40 ` [PATCH 4/8] [media] ddbridge: move CI detach code to ddbridge-ci.c Daniel Scheller
2017-12-17 15:40 ` [PATCH 5/8] [media] ddbridge: completely tear down input resources on failure Daniel Scheller
2017-12-17 15:40 ` [PATCH 6/8] [media] ddbridge: fix deinit order in case of failure in ddb_init() Daniel Scheller
2017-12-17 15:40 ` [PATCH 7/8] [media] ddbridge: detach first input if the second one failed to init Daniel Scheller
2017-12-17 15:40 ` [PATCH 8/8] [media] ddbridge: improve ddb_ports_attach() failure handling Daniel Scheller
2017-12-17 16:00 ` [PATCH 0/8] ddbridge improvements and cleanups Daniel Scheller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox