stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Subject: [PATCH 4.19 048/115] media: pulse8-cec: fix lost cec_transmit_attempt_done() call
Date: Tue,  7 Jan 2020 21:54:18 +0100	[thread overview]
Message-ID: <20200107205302.324393223@linuxfoundation.org> (raw)
In-Reply-To: <20200107205240.283674026@linuxfoundation.org>

From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

commit e5a52a1d15c79bb48a430fb263852263ec1d3f11 upstream.

The periodic PING command could interfere with the result of
a CEC transmit, causing a lost cec_transmit_attempt_done()
call.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: <stable@vger.kernel.org>      # for v4.10 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/usb/pulse8-cec/pulse8-cec.c |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

--- a/drivers/media/usb/pulse8-cec/pulse8-cec.c
+++ b/drivers/media/usb/pulse8-cec/pulse8-cec.c
@@ -121,6 +121,7 @@ struct pulse8 {
 	unsigned int vers;
 	struct completion cmd_done;
 	struct work_struct work;
+	u8 work_result;
 	struct delayed_work ping_eeprom_work;
 	struct cec_msg rx_msg;
 	u8 data[DATA_SIZE];
@@ -142,8 +143,10 @@ static void pulse8_irq_work_handler(stru
 {
 	struct pulse8 *pulse8 =
 		container_of(work, struct pulse8, work);
+	u8 result = pulse8->work_result;
 
-	switch (pulse8->data[0] & 0x3f) {
+	pulse8->work_result = 0;
+	switch (result & 0x3f) {
 	case MSGCODE_FRAME_DATA:
 		cec_received_msg(pulse8->adap, &pulse8->rx_msg);
 		break;
@@ -177,12 +180,12 @@ static irqreturn_t pulse8_interrupt(stru
 		pulse8->escape = false;
 	} else if (data == MSGEND) {
 		struct cec_msg *msg = &pulse8->rx_msg;
+		u8 msgcode = pulse8->buf[0];
 
 		if (debug)
 			dev_info(pulse8->dev, "received: %*ph\n",
 				 pulse8->idx, pulse8->buf);
-		pulse8->data[0] = pulse8->buf[0];
-		switch (pulse8->buf[0] & 0x3f) {
+		switch (msgcode & 0x3f) {
 		case MSGCODE_FRAME_START:
 			msg->len = 1;
 			msg->msg[0] = pulse8->buf[1];
@@ -191,14 +194,20 @@ static irqreturn_t pulse8_interrupt(stru
 			if (msg->len == CEC_MAX_MSG_SIZE)
 				break;
 			msg->msg[msg->len++] = pulse8->buf[1];
-			if (pulse8->buf[0] & MSGCODE_FRAME_EOM)
+			if (msgcode & MSGCODE_FRAME_EOM) {
+				WARN_ON(pulse8->work_result);
+				pulse8->work_result = msgcode;
 				schedule_work(&pulse8->work);
+				break;
+			}
 			break;
 		case MSGCODE_TRANSMIT_SUCCEEDED:
 		case MSGCODE_TRANSMIT_FAILED_LINE:
 		case MSGCODE_TRANSMIT_FAILED_ACK:
 		case MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA:
 		case MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE:
+			WARN_ON(pulse8->work_result);
+			pulse8->work_result = msgcode;
 			schedule_work(&pulse8->work);
 			break;
 		case MSGCODE_HIGH_ERROR:



  parent reply	other threads:[~2020-01-07 21:16 UTC|newest]

Thread overview: 127+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07 20:53 [PATCH 4.19 000/115] 4.19.94-stable review Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 001/115] nvme_fc: add module to ops template to allow module references Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 002/115] nvme-fc: fix double-free scenarios on hw queues Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 003/115] drm/amdgpu: add check before enabling/disabling broadcast mode Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 004/115] drm/amdgpu: add cache flush workaround to gfx8 emit_fence Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 005/115] drm/amd/display: Fixed kernel panic when booting with DP-to-HDMI dongle Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 006/115] iio: adc: max9611: Fix too short conversion time delay Greg Kroah-Hartman
2020-01-07 22:02   ` Pavel Machek
2020-01-07 20:53 ` [PATCH 4.19 007/115] PM / devfreq: Fix devfreq_notifier_call returning errno Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 008/115] PM / devfreq: Set scaling_max_freq to max on OPP notifier error Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 009/115] PM / devfreq: Dont fail devfreq_dev_release if not in list Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 010/115] afs: Fix afs_find_server lookups for ipv4 peers Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 011/115] afs: Fix SELinux setting security label on /afs Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 012/115] RDMA/cma: add missed unregister_pernet_subsys in init failure Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 013/115] rxe: correctly calculate iCRC for unaligned payloads Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 014/115] scsi: lpfc: Fix memory leak on lpfc_bsg_write_ebuf_set func Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 015/115] scsi: qla2xxx: Drop superfluous INIT_WORK of del_work Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 016/115] scsi: qla2xxx: Dont call qlt_async_event twice Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 017/115] scsi: qla2xxx: Fix PLOGI payload and ELS IOCB dump length Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 018/115] scsi: qla2xxx: Configure local loop for N2N target Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 019/115] scsi: qla2xxx: Send Notify ACK after N2N PLOGI Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 020/115] scsi: qla2xxx: Ignore PORT UPDATE " Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 021/115] scsi: iscsi: qla4xxx: fix double free in probe Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 022/115] scsi: libsas: stop discovering if oob mode is disconnected Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 023/115] drm/nouveau: Move the declaration of struct nouveau_conn_atom up a bit Greg Kroah-Hartman
2020-01-08  7:48   ` Pavel Machek
2020-01-07 20:53 ` [PATCH 4.19 024/115] usb: gadget: fix wrong endpoint desc Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 025/115] net: make socket read/write_iter() honor IOCB_NOWAIT Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 026/115] afs: Fix creation calls in the dynamic root to fail with EOPNOTSUPP Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 027/115] md: raid1: check rdev before reference in raid1_sync_request func Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 028/115] s390/cpum_sf: Adjust sampling interval to avoid hitting sample limits Greg Kroah-Hartman
2020-01-07 20:53 ` [PATCH 4.19 029/115] s390/cpum_sf: Avoid SBD overflow condition in irq handler Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 030/115] IB/mlx4: Follow mirror sequence of device add during device removal Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 031/115] IB/mlx5: Fix steering rule of drop and count Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 032/115] xen-blkback: prevent premature module unload Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 033/115] xen/balloon: fix ballooned page accounting without hotplug enabled Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 034/115] PM / hibernate: memory_bm_find_bit(): Tighten node optimisation Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 035/115] ALSA: hda/realtek - Add Bass Speaker and fixed dac for bass speaker Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 036/115] ALSA: hda/realtek - Enable the bass speaker of ASUS UX431FLC Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 037/115] ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 038/115] xfs: fix mount failure crash on invalid iclog memory access Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 039/115] taskstats: fix data-race Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 040/115] drm: limit to INT_MAX in create_blob ioctl Greg Kroah-Hartman
2020-01-08  8:11   ` Pavel Machek
2020-01-08 10:47     ` Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 041/115] netfilter: nft_tproxy: Fix port selector on Big Endian Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 042/115] ALSA: ice1724: Fix sleep-in-atomic in Infrasonic Quartet support code Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 043/115] ALSA: usb-audio: fix set_format altsetting sanity check Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 044/115] ALSA: usb-audio: set the interface format after resume on Dell WD19 Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 045/115] ALSA: hda/realtek - Add headset Mic no shutup for ALC283 Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 046/115] drm/sun4i: hdmi: Remove duplicate cleanup calls Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 047/115] MIPS: Avoid VDSO ABI breakage due to global register variable Greg Kroah-Hartman
2020-01-07 20:54 ` Greg Kroah-Hartman [this message]
2020-01-07 20:54 ` [PATCH 4.19 049/115] media: cec: CEC 2.0-only bcast messages were ignored Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 050/115] media: cec: avoid decrementing transmit_queue_sz if it is 0 Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 051/115] media: cec: check transmit_in_progress, not transmitting Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 052/115] mm/zsmalloc.c: fix the migrated zspage statistics Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 053/115] memcg: account security cred as well to kmemcg Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 054/115] mm: move_pages: return valid node id in status if the page is already on the target node Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 055/115] pstore/ram: Write new dumps to start of recycled zones Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 056/115] locks: print unsigned ino in /proc/locks Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 057/115] dmaengine: Fix access to uninitialized dma_slave_caps Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 058/115] compat_ioctl: block: handle Persistent Reservations Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 059/115] compat_ioctl: block: handle BLKREPORTZONE/BLKRESETZONE Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 060/115] ata: libahci_platform: Export again ahci_platform_<en/dis>able_phys() Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 061/115] ata: ahci_brcm: Fix AHCI resources management Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 062/115] ata: ahci_brcm: Allow optional reset controller to be used Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 063/115] ata: ahci_brcm: Add missing clock management during recovery Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 064/115] ata: ahci_brcm: BCM7425 AHCI requires AHCI_HFLAG_DELAY_ENGINE Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 065/115] libata: Fix retrieving of active qcs Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 066/115] gpiolib: fix up emulated open drain outputs Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 067/115] riscv: ftrace: correct the condition logic in function graph tracer Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 068/115] rseq/selftests: Fix: Namespace gettid() for compatibility with glibc 2.30 Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 069/115] tracing: Fix lock inversion in trace_event_enable_tgid_record() Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 070/115] tracing: Avoid memory leak in process_system_preds() Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 071/115] tracing: Have the histogram compare functions convert to u64 first Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 072/115] tracing: Fix endianness bug in histogram trigger Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 073/115] apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 074/115] ALSA: cs4236: fix error return comparison of an unsigned integer Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 075/115] ALSA: firewire-motu: Correct a typo in the clock proc string Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 076/115] exit: panic before exit_mm() on global init exit Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 077/115] arm64: Revert support for execute-only user mappings Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 078/115] ftrace: Avoid potential division by zero in function profiler Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 079/115] drm/msm: include linux/sched/task.h Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 080/115] PM / devfreq: Check NULL governor in available_governors_show Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 081/115] nfsd4: fix up replay_matches_cache() Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 082/115] HID: i2c-hid: Reset ALPS touchpads on resume Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 083/115] ACPI: sysfs: Change ACPI_MASKABLE_GPE_MAX to 0x100 Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 084/115] xfs: dont check for AG deadlock for realtime files in bunmapi Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 085/115] platform/x86: pmc_atom: Add Siemens CONNECT X300 to critclk_systems DMI table Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 086/115] Bluetooth: btusb: fix PM leak in error case of setup Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 087/115] Bluetooth: delete a stray unlock Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 088/115] Bluetooth: Fix memory leak in hci_connect_le_scan Greg Kroah-Hartman
2020-01-07 20:54 ` [PATCH 4.19 089/115] media: flexcop-usb: ensure -EIO is returned on error condition Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 090/115] regulator: ab8500: Remove AB8505 USB regulator Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 091/115] media: usb: fix memory leak in af9005_identify_state Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 092/115] dt-bindings: clock: renesas: rcar-usb2-clock-sel: Fix typo in example Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 093/115] arm64: dts: meson: odroid-c2: Disable usb_otg bus to avoid power failed warning Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 094/115] tty: serial: msm_serial: Fix lockup for sysrq and oops Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 095/115] fix compat handling of FICLONERANGE, FIDEDUPERANGE and FS_IOC_FIEMAP Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 096/115] bdev: Factor out bdev revalidation into a common helper Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 097/115] bdev: Refresh bdev size for disks without partitioning Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 098/115] scsi: qedf: Do not retry ELS request if qedf_alloc_cmd fails Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 099/115] drm/mst: Fix MST sideband up-reply failure handling Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 100/115] powerpc/pseries/hvconsole: Fix stack overread via udbg Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 101/115] selftests: rtnetlink: add addresses with fixed life time Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 102/115] coresight: tmc-etf: Do not call smp_processor_id from preemptible Greg Kroah-Hartman
2020-01-08 11:00   ` Suzuki Kuruppassery Poulose
2020-01-07 20:55 ` [PATCH 4.19 103/115] coresight: etb10: " Greg Kroah-Hartman
2020-01-08 11:01   ` Suzuki Kuruppassery Poulose
2020-01-08 11:17     ` Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 104/115] KVM: PPC: Book3S HV: use smp_mb() when setting/clearing host_ipi flag Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 105/115] rxrpc: Fix possible NULL pointer access in ICMP handling Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 106/115] tcp: annotate tp->rcv_nxt lockless reads Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 107/115] net: core: limit nested device depth Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 108/115] ath9k_htc: Modify byte order for an error message Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 109/115] ath9k_htc: Discard undersized packets Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 110/115] xfs: periodically yield scrub threads to the scheduler Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 111/115] net: add annotations on hh->hh_len lockless accesses Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 112/115] ubifs: ubifs_tnc_start_commit: Fix OOB in layout_in_gaps Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 113/115] s390/smp: fix physical to logical CPU map for SMT Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 114/115] xen/blkback: Avoid unmapping unmapped grant pages Greg Kroah-Hartman
2020-01-07 20:55 ` [PATCH 4.19 115/115] perf/x86/intel/bts: Fix the use of page_private() Greg Kroah-Hartman
2020-01-08  2:41 ` [PATCH 4.19 000/115] 4.19.94-stable review shuah
2020-01-08 15:43 ` Guenter Roeck
2020-01-08 16:23 ` Jon Hunter
2020-01-08 16:49 ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200107205302.324393223@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).