mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 12:14:01 +08:00
[media] exynos-gsc: send valid m2m ctx to gsc_m2m_job_finish
gsc_m2m_job_finish() has to be called with the m2m context for the necessary cleanup while resume. But currently gsc_m2m_job_finish() always passes m2m context as NULL. This patch preserves the context before making it null, for necessary cleanup. Use gsc_m2m_opened() instead gsc_m2m_active() in gsc_resume(). Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
6a5360966a
commit
5d83790be7
@ -1054,16 +1054,18 @@ static int gsc_m2m_suspend(struct gsc_dev *gsc)
|
|||||||
|
|
||||||
static int gsc_m2m_resume(struct gsc_dev *gsc)
|
static int gsc_m2m_resume(struct gsc_dev *gsc)
|
||||||
{
|
{
|
||||||
|
struct gsc_ctx *ctx;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&gsc->slock, flags);
|
spin_lock_irqsave(&gsc->slock, flags);
|
||||||
/* Clear for full H/W setup in first run after resume */
|
/* Clear for full H/W setup in first run after resume */
|
||||||
|
ctx = gsc->m2m.ctx;
|
||||||
gsc->m2m.ctx = NULL;
|
gsc->m2m.ctx = NULL;
|
||||||
spin_unlock_irqrestore(&gsc->slock, flags);
|
spin_unlock_irqrestore(&gsc->slock, flags);
|
||||||
|
|
||||||
if (test_and_clear_bit(ST_M2M_SUSPENDED, &gsc->state))
|
if (test_and_clear_bit(ST_M2M_SUSPENDED, &gsc->state))
|
||||||
gsc_m2m_job_finish(gsc->m2m.ctx,
|
gsc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
|
||||||
VB2_BUF_STATE_ERROR);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1204,7 +1206,7 @@ static int gsc_resume(struct device *dev)
|
|||||||
/* Do not resume if the device was idle before system suspend */
|
/* Do not resume if the device was idle before system suspend */
|
||||||
spin_lock_irqsave(&gsc->slock, flags);
|
spin_lock_irqsave(&gsc->slock, flags);
|
||||||
if (!test_and_clear_bit(ST_SUSPEND, &gsc->state) ||
|
if (!test_and_clear_bit(ST_SUSPEND, &gsc->state) ||
|
||||||
!gsc_m2m_active(gsc)) {
|
!gsc_m2m_opened(gsc)) {
|
||||||
spin_unlock_irqrestore(&gsc->slock, flags);
|
spin_unlock_irqrestore(&gsc->slock, flags);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user