From: Smitha T Murthy <smitha.t@samsung.com>
To: linux-arm-kernel@lists.infradead.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: m.szyprowski@samsung.com, andrzej.hajda@intel.com,
mchehab@kernel.org, alim.akhtar@samsung.com,
aswani.reddy@samsung.com, pankaj.dubey@samsung.com,
linux-fsd@tesla.com, aakarsh.jain@samsung.com,
Smitha T Murthy <smitha.t@samsung.com>,
stable@vger.kernel.org
Subject: [PATCH 2/3] media: s5p-mfc: Clear workbit to handle error condition
Date: Wed, 7 Sep 2022 16:02:26 +0530 [thread overview]
Message-ID: <20220907103227.61088-2-smitha.t@samsung.com> (raw)
In-Reply-To: <20220907103227.61088-1-smitha.t@samsung.com>
During error on CLOSE_INSTANCE command, ctx_work_bits was not getting cleared.
During consequent mfc execution NULL pointer dereferencing of this context led
to kernel panic. This patch fixes this issue by making sure to clear
ctx_work_bits always.
Fixes: 818cd91ab8c6e ("[media] s5p-mfc: Extract open/close MFC instance commands)
Cc: stable@vger.kernel.org
Cc: linux-fsd@tesla.com
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
---
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c
index 72d70984e99a..6d3c92045c05 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c
@@ -468,8 +468,10 @@ void s5p_mfc_close_mfc_inst(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx)
s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
/* Wait until instance is returned or timeout occurred */
if (s5p_mfc_wait_for_done_ctx(ctx,
- S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET, 0))
+ S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET, 0)){
+ clear_work_bit_irqsave(ctx);
mfc_err("Err returning instance\n");
+ }
/* Free resources */
s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers, ctx);
--
2.17.1
next prev parent reply other threads:[~2022-09-07 13:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220907101823epcas5p22148836690ecf1d8e0e7ab81fd9aee28@epcas5p2.samsung.com>
2022-09-07 10:32 ` [PATCH 1/3] media: s5p-mfc: Fix in register read and write for H264 Smitha T Murthy
[not found] ` <CGME20220907101825epcas5p321eaebfafa5f69a9695d4b12532eccfd@epcas5p3.samsung.com>
2022-09-07 10:32 ` Smitha T Murthy [this message]
[not found] ` <CGME20220907101827epcas5p2afa088ce5a591040094d2b49b928f3c2@epcas5p2.samsung.com>
2022-09-07 10:32 ` [PATCH 3/3] media: s5p-mfc: Fix to handle reference queue during finishing Smitha T Murthy
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=20220907103227.61088-2-smitha.t@samsung.com \
--to=smitha.t@samsung.com \
--cc=aakarsh.jain@samsung.com \
--cc=alim.akhtar@samsung.com \
--cc=andrzej.hajda@intel.com \
--cc=aswani.reddy@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fsd@tesla.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@kernel.org \
--cc=pankaj.dubey@samsung.com \
--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
all inboxes | Powered by JetHome®