All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] media: rc: nuvoton: Tweak the interrupt enabling dance
@ 2018-05-21 14:38 Michał Winiarski
  2018-05-21 14:38 ` [PATCH 2/3] media: rc: nuvoton: Keep track of users on CIR enable/disable Michał Winiarski
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Michał Winiarski @ 2018-05-21 14:38 UTC (permalink / raw)
  To: linux-media; +Cc: Michał Winiarski, Jarod Wilson, Sean Young

It appears that we need to enable CIR device before attempting to touch
some of the registers. Previously, this was not a big issue, since we
were rarely seeing nvt_close() getting called.

Unfortunately, since:
cb84343fced1 ("media: lirc: do not call close() or open() on unregistered devices")

The initial open() during probe from rc_setup_rx_device() is no longer
successful, which means that userspace clients will actually end up
calling nvt_open()/nvt_close().
And since nvt_open() is broken, the device doesn't seem to work as
expected.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199597
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: Sean Young <sean@mess.org>
---
 drivers/media/rc/nuvoton-cir.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 5e1d866a61a5..ce8949b6549d 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -922,6 +922,9 @@ static int nvt_open(struct rc_dev *dev)
 	struct nvt_dev *nvt = dev->priv;
 	unsigned long flags;
 
+	/* enable the CIR logical device */
+	nvt_enable_logical_dev(nvt, LOGICAL_DEV_CIR);
+
 	spin_lock_irqsave(&nvt->lock, flags);
 
 	/* set function enable flags */
@@ -937,9 +940,6 @@ static int nvt_open(struct rc_dev *dev)
 
 	spin_unlock_irqrestore(&nvt->lock, flags);
 
-	/* enable the CIR logical device */
-	nvt_enable_logical_dev(nvt, LOGICAL_DEV_CIR);
-
 	return 0;
 }
 
-- 
2.17.0

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

end of thread, other threads:[~2018-05-25 17:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-21 14:38 [PATCH 1/3] media: rc: nuvoton: Tweak the interrupt enabling dance Michał Winiarski
2018-05-21 14:38 ` [PATCH 2/3] media: rc: nuvoton: Keep track of users on CIR enable/disable Michał Winiarski
2018-05-21 14:38 ` [PATCH 3/3] media: rc: nuvoton: Keep device enabled during reg init Michał Winiarski
2018-05-24 11:31   ` Sean Young
2018-05-25 13:35     ` Michał Winiarski
2018-05-25 13:59       ` Sean Young
2018-05-25 14:42         ` Michał Winiarski
2018-05-25 17:51           ` Sean Young
2018-05-25 14:28   ` [PATCH v2 " Michał Winiarski
2018-05-21 15:54 ` [PATCH 1/3] media: rc: nuvoton: Tweak the interrupt enabling dance Sean Young
2018-05-21 16:22   ` Michał Winiarski

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.