FAILED: patch "[PATCH] media: smipcie: fix interrupt handling and IR timeout" failed to apply to 5.4-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 6532923237b427ed30cc7b4486f6f1ccdee3c647 Mon Sep 17 00:00:00 2001
From: Sean Young <[email protected]>
Date: Fri, 29 Jan 2021 11:54:53 +0100
Subject: [PATCH] media: smipcie: fix interrupt handling and IR timeout
After the first IR message, interrupts are no longer received. In addition, the code generates a timeout IR message of 10ms but sets the timeout value to 100ms, so no timeout was ever generated.
drivers/media/pci/smipcie/smipcie-ir.c +26 -20
@@ -60,38 +60,44 @@ static void smi_ir_decode(struct smi_rc *ir) {struct smi_dev *dev = ir->dev;struct rc_dev *rc_dev = ir->rc_dev; -u32 dwIRControl, dwIRData; -u8 index, ucIRCount, readLoop; +u32 control, data; +u8 index, ir_count, read_loop; - dwIRControl =smi_read (IR_Init_Reg); + control =smi_read (IR_Init_Reg); -if (dwIRControl & rbIRVld) { - ucIRCount = (u8 )smi_read (IR_Data_Cnt); +dev_dbg (&rc_dev->dev,"ircontrol: 0x%08x\n" , control); - readLoop = ucIRCount/4 ; -if (ucIRCount %4 ) - readLoop +=1 ; -for (index =0 ; index < readLoop; index++) { - dwIRData =smi_read (IR_DATA_BUFFER_BASE + (index *4 )); +if (control & rbIRVld) { + ir_count = (u8 )smi_read (IR_Data_Cnt); - ir->irData[index*4 +0 ] = (u8)(dwIRData); - ir->irData[index*4 +1 ] = (u8)(dwIRData >>8 ); - ir->irData[index*4 +2 ] = (u8)(dwIRData >>16 ); - ir->irData[index*4 +3 ] = (u8)(dwIRData >>24 ); +dev_dbg (&rc_dev->dev,"ircount %d\n" , ir_count); + + read_loop = ir_count /4 ; +if (ir_count %4 ) + read_loop +=1 ; +for (index =0 ; index < read_loop; index++) { + data =smi_read (IR_DATA_BUFFER_BASE + (index *4 )); +dev_dbg (&rc_dev->dev,"IRData 0x%08x\n" , data); + + ir->irData[index *4 +0 ] = (u8)(data); + ir->irData[index *4 +1 ] = (u8)(data >>8 ); + ir->irData[index *4 +2 ] = (u8)(data >>16 ); + ir->irData[index *4 +3 ] = (u8)(data >>24 ); } -smi_raw_process (rc_dev, ir->irData, ucIRCount); -smi_set (IR_Init_Reg, rbIRVld); +smi_raw_process (rc_dev, ir->irData, ir_count); } -if (dwIRControl & rbIRhighidle) { +if (control & rbIRhighidle) {struct ir_raw_event rawir = {}; +dev_dbg (&rc_dev->dev,"high idle\n" ); + rawir.pulse =0 ; rawir.duration =SMI_SAMPLE_PERIOD *SMI_SAMPLE_IDLEMIN ;ir_raw_event_store_with_filter (rc_dev, &rawir); -smi_set (IR_Init_Reg, rbIRhighidle); } +smi_set (IR_Init_Reg, rbIRVld);ir_raw_event_handle (rc_dev); }
@@ -150,7 +156,7 @@ int smi_ir_init(struct smi_dev *dev) rc_dev->dev.parent = &dev->pci_dev->dev; rc_dev->map_name = dev->info->rc_map; - rc_dev->timeout =MS_TO_US (100 ); + rc_dev->timeout =SMI_SAMPLE_PERIOD *SMI_SAMPLE_IDLEMIN ; rc_dev->rx_resolution =SMI_SAMPLE_PERIOD ; ir->rc_dev = rc_dev;
@@ -173,7 +179,7 @@ void smi_ir_exit(struct smi_dev *dev)struct smi_rc *ir = &dev->ir;struct rc_dev *rc_dev = ir->rc_dev; -smi_ir_stop (ir);rc_unregister_device (rc_dev); +smi_ir_stop (ir); ir->rc_dev =NULL ; }
Sean Young
Tested-by Laz LevQuoted 6 lines · On Mon, Mar 01, 2021 at 12:18:09PM +0100, [email protected] wrote:
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
commit 6532923237b427ed30cc7b4486f6f1ccdee3c647 backported to 5.4 follows.
Thanks
Sean
---
From a3951322842d0c55f540bfa6e973f8a45185da62 Mon Sep 17 00:00:00 2001
From: Sean Young <[email protected]>
Date: Fri, 29 Jan 2021 11:54:53 +0100
Subject: [PATCH] media: smipcie: fix interrupt handling and IR timeout
After the first IR message, interrupts are no longer received. In addition, the code generates a timeout IR message of 10ms but sets the timeout value to 100ms, so no timeout was ever generated.
--- drivers/media/pci/smipcie/smipcie-ir.c | 46 +++++++++++++++----------- 1 file changed, 26 insertions(+), 20 deletions(-)
drivers/media/pci/smipcie/smipcie-ir.c +26 -20
@@ -60,39 +60,45 @@ static void smi_ir_decode(struct smi_rc *ir) {struct smi_dev *dev = ir->dev;struct rc_dev *rc_dev = ir->rc_dev; -u32 dwIRControl, dwIRData; -u8 index, ucIRCount, readLoop; +u32 control, data; +u8 index, ir_count, read_loop; - dwIRControl =smi_read (IR_Init_Reg); + control =smi_read (IR_Init_Reg); -if (dwIRControl & rbIRVld) { - ucIRCount = (u8 )smi_read (IR_Data_Cnt); +dev_dbg (&rc_dev->dev,"ircontrol: 0x%08x\n" , control); - readLoop = ucIRCount/4 ; -if (ucIRCount %4 ) - readLoop +=1 ; -for (index =0 ; index < readLoop; index++) { - dwIRData =smi_read (IR_DATA_BUFFER_BASE + (index *4 )); +if (control & rbIRVld) { + ir_count = (u8 )smi_read (IR_Data_Cnt); - ir->irData[index*4 +0 ] = (u8)(dwIRData); - ir->irData[index*4 +1 ] = (u8)(dwIRData >>8 ); - ir->irData[index*4 +2 ] = (u8)(dwIRData >>16 ); - ir->irData[index*4 +3 ] = (u8)(dwIRData >>24 ); +dev_dbg (&rc_dev->dev,"ircount %d\n" , ir_count); + + read_loop = ir_count /4 ; +if (ir_count %4 ) + read_loop +=1 ; +for (index =0 ; index < read_loop; index++) { + data =smi_read (IR_DATA_BUFFER_BASE + (index *4 )); +dev_dbg (&rc_dev->dev,"IRData 0x%08x\n" , data); + + ir->irData[index *4 +0 ] = (u8)(data); + ir->irData[index *4 +1 ] = (u8)(data >>8 ); + ir->irData[index *4 +2 ] = (u8)(data >>16 ); + ir->irData[index *4 +3 ] = (u8)(data >>24 ); } -smi_raw_process (rc_dev, ir->irData, ucIRCount); -smi_set (IR_Init_Reg, rbIRVld); +smi_raw_process (rc_dev, ir->irData, ir_count); } -if (dwIRControl & rbIRhighidle) { +if (control & rbIRhighidle) {struct ir_raw_event rawir = {}; +dev_dbg (&rc_dev->dev,"high idle\n" ); + rawir.pulse =0 ; rawir.duration =US_TO_NS (SMI_SAMPLE_PERIOD *SMI_SAMPLE_IDLEMIN );ir_raw_event_store_with_filter (rc_dev, &rawir); -smi_set (IR_Init_Reg, rbIRhighidle); } +smi_set (IR_Init_Reg, rbIRVld);ir_raw_event_handle (rc_dev); }
@@ -151,7 +157,7 @@ int smi_ir_init(struct smi_dev *dev) rc_dev->dev.parent = &dev->pci_dev->dev; rc_dev->map_name = dev->info->rc_map; - rc_dev->timeout =MS_TO_NS (100 ); + rc_dev->timeout =US_TO_NS (SMI_SAMPLE_PERIOD *SMI_SAMPLE_IDLEMIN ); rc_dev->rx_resolution =US_TO_NS (SMI_SAMPLE_PERIOD ); ir->rc_dev = rc_dev;
@@ -174,7 +180,7 @@ void smi_ir_exit(struct smi_dev *dev)struct smi_rc *ir = &dev->ir;struct rc_dev *rc_dev = ir->rc_dev; -smi_ir_stop (ir);rc_unregister_device (rc_dev); +smi_ir_stop (ir); ir->rc_dev =NULL ; }
Signature · 1 line
2.29.2
Greg KH
maintainerQuoted 9 lines · Sean Young
Quoted 6 lines · On Mon, Mar 01, 2021 at 12:18:09PM +0100, [email protected] wrote:
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.commit
6532923237b427ed30cc7b4486f6f1ccdee3c647backported to 5.4 follows.
Now applied, thanks.
greg k-h