From: Sean Young Date: Tue, 14 Sep 2021 14:57:46 +0000 (+0200) Subject: media: ir_toy: prevent device from hanging during transmit X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a4ac45aff8d38c64104aec21c6529747d94ae75a;p=linux.git media: ir_toy: prevent device from hanging during transmit [ Upstream commit 4114978dcd24e72415276bba60ff4ff355970bbc ] If the IR Toy is receiving IR while a transmit is done, it may end up hanging. We can prevent this from happening by re-entering sample mode just before issuing the transmit command. Link: https://github.com/bengtmartensson/HarcHardware/discussions/25 Cc: stable@vger.kernel.org [mchehab: renamed: s/STATE_RESET/STATE_COMMAND_NO_RESP/ ] Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- diff --git a/drivers/media/rc/ir_toy.c b/drivers/media/rc/ir_toy.c index 7f394277478b3..53ae19fa103ab 100644 --- a/drivers/media/rc/ir_toy.c +++ b/drivers/media/rc/ir_toy.c @@ -310,7 +310,7 @@ static int irtoy_tx(struct rc_dev *rc, uint *txbuf, uint count) buf[i] = cpu_to_be16(v); } - buf[count] = cpu_to_be16(0xffff); + buf[count] = 0xffff; irtoy->tx_buf = buf; irtoy->tx_len = size;