IPU6 fixes following multi-stream support
Subsystems (2)
Sakari Ailus
maintainercover IPU6 fixes following multi-stream support
Hi all,
There's a small but important fix for the ipu6 driver's ipu7 support -- on ipu7 streaming works only once, and apparently this is because the ISYS needs a power reset between streaming instances. The patch addresses detecting this, which got broken in the multi-stream support set.
The second patch adds a warning on needing a reset.
Addressing why the reset is needed is out of scope of this set.
Sakari Ailus (2):
media: ipu6: Reset need_reset in ISYS suspend
media: ipu6: Warn if the active list isn't empty when returning
buffers
drivers/media/pci/intel/ipu6/ipu6-isys-queue.c | 7 +++++++ drivers/media/pci/intel/ipu6/ipu6-isys.c | 4 ++++ 2 files changed, 11 insertions(+)
base-commit: 58348f64125e9a3e44d3abb275ca7f4e6c9641e5
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH 1/2 media: ipu6: Reset need_reset in ISYS suspend
The need_reset field in struct ipu6_isys tells whether the device needs a power-on reset. Resetting the field was removed unintentionally in commit 70e3fac3ec78 ("media: ipu6: Move firmware init/cleanup to RPM callbacks").
Add it back.
--- drivers/media/pci/intel/ipu6/ipu6-isys.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/media/pci/intel/ipu6/ipu6-isys.c +4 -0
@@ -826,6 +826,10 @@ static int isys_runtime_pm_suspend(struct device *dev) ret = -EIO ; } +mutex_lock (&isys->mutex); + isys->need_reset = false; +mutex_unlock (&isys->mutex); + isys->phy_termcal_val =0 ;cpu_latency_qos_update_request (&isys->pm_qos,PM_QOS_DEFAULT_VALUE );
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH 2/2 media: ipu6: Warn if the active list isn't empty when returning buffers
In reply to Sakari AilusThe ISYS needs a reset when the active buffer list isn't empty. Warn about this.
--- drivers/media/pci/intel/ipu6/ipu6-isys-queue.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/media/pci/intel/ipu6/ipu6-isys-queue.c +7 -0
@@ -423,6 +423,7 @@ static void return_buffers(struct ipu6_isys_queue *aq,struct ipu6_isys_video *av =ipu6_isys_queue_to_video (aq);struct ipu6_isys_buffer *ib;bool need_reset = false; +bool first_buf = true;unsigned long flags;spin_lock_irqsave (&aq->lock, flags);
@@ -448,6 +449,12 @@ static void return_buffers(struct ipu6_isys_queue *aq,while (!list_empty (&aq->active)) {struct vb2_buffer *vb; +if (first_buf) { +dev_warn (&av->isys->adev->auxdev.dev, +"buffer list not empty, needs isys reset\n" ); + first_buf = false; + } + ib = list_first_entry(&aq->active, struct ipu6_isys_buffer, head); vb =ipu6_isys_buffer_to_vb2_buffer (ib);
Signature · 1 line
2.47.3
Re: [PATCH 2/2] media: ipu6: Warn if the active list isn't empty when returning buffers
Quoted 21 lines · Sakari Ailus
The ISYS needs a reset when the active buffer list isn't empty. Warn about this.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/pci/intel/ipu6/ipu6-isys-queue.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/media/pci/intel/ipu6/ipu6-isys-queue.c +1
-0@@ -423,6 +423,7 @@ static void return_buffers(struct ipu6_isys_queue *aq,struct ipu6_isys_video *av =ipu6_isys_queue_to_video (aq);struct ipu6_isys_buffer *ib;bool need_reset = false; +bool first_buf = true;unsigned long flags;spin_lock_irqsave (&aq->lock, flags);
drivers/media/pci/intel/ipu6/ipu6-isys-queue.c static void return_buffers(struct ipu6_isys_queue *aq, · line 456
Quoted 8 lines
drivers/media/pci/intel/ipu6/ipu6-isys-queue.c +5
-0@@ -448,6 +449,12 @@ static void return_buffers(struct ipu6_isys_queue *aq,while (!list_empty (&aq->active)) {struct vb2_buffer *vb; +if (first_buf) { +dev_warn (&av->isys->adev->auxdev.dev, +"buffer list not empty, needs isys reset\n" ); + first_buf = false; + }
Could the warning be in the end of the function, in need_reset block. We could save one local variable too.
Quoted 7 lines
drivers/media/pci/intel/ipu6/ipu6-isys-queue.c +1
-0+ ib = list_first_entry(&aq->active, struct ipu6_isys_buffer, head); vb =ipu6_isys_buffer_to_vb2_buffer (ib);Signature · 1 line
2.47.3
Sakari Ailus
maintainerRe: [PATCH 2/2] media: ipu6: Warn if the active list isn't empty when returning buffers
Hei Antti,
Thanks for the review.
Quoted 25 lines · Antti Laakso
Quoted 24 lines · Sakari Ailus
The ISYS needs a reset when the active buffer list isn't empty. Warn about this.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/pci/intel/ipu6/ipu6-isys-queue.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/media/pci/intel/ipu6/ipu6-isys-queue.c +1
-0@@ -423,6 +423,7 @@ static void return_buffers(struct ipu6_isys_queue *aq,struct ipu6_isys_video *av =ipu6_isys_queue_to_video (aq);struct ipu6_isys_buffer *ib;bool need_reset = false; +bool first_buf = true;unsigned long flags;spin_lock_irqsave (&aq->lock, flags);@@ -448,6 +449,12 @@ static void return_buffers(struct ipu6_isys_queue *aq,while (!list_empty (&aq->active)) {struct vb2_buffer *vb;
Quoted 8 lines
drivers/media/pci/intel/ipu6/ipu6-isys-queue.c static void return_buffers(struct ipu6_isys_queue *aq, · line 456
Quoted 5 lines
drivers/media/pci/intel/ipu6/ipu6-isys-queue.c +5
-0+if (first_buf) { +dev_warn (&av->isys->adev->auxdev.dev, +"buffer list not empty, needs isys reset\n" ); + first_buf = false; + }Could the warning be in the end of the function, in
need_resetblock. We could save one local variable too.
Makes sense; I'll do that for v2.
Signature · 3 lines
Terveisin, Sakari Ailus