Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1174103
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Benoit Parrot <bparrot@ti.com> |
| Newsgroups | linux.kernel |
| Subject | [Patch v2 1/1] media: am437x-vpfe: Fix a race condition during release |
| Date | Mon, 29 Jun 2015 23:00:02 +0200 |
| Message-ID | <pGOjM-5WS-9@gated-at.bofh.it> (permalink) |
| X-Original-To | Hans Verkuil <hverkuil@xs4all.nl> |
| X-Mailer | git-send-email 1.8.5.1 |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 50 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Prabhakar Lad <prabhakar.csengg@gmail.com>, <linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Benoit Parrot <bparrot@ti.com>, <stable@vger.kernel.org> |
| X-Original-Date | Mon, 29 Jun 2015 15:51:10 -0500 |
| X-Original-Message-ID | <1435611070-3239-1-git-send-email-bparrot@ti.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | aioe.org linux.kernel:1174103 |
Show key headers only | View raw
There was a race condition where during cleanup/release operation
on-going streaming would cause a kernel panic because the hardware
module was disabled prematurely with IRQ still pending.
Fixes: 417d2e507ed [media] media: platform: add VPFE capture driver support for AM437X
Cc: <stable@vger.kernel.org> # v4.0+
Signed-off-by: Benoit Parrot <bparrot@ti.com>
---
Changes from v1:
- Added stable reference
drivers/media/platform/am437x/am437x-vpfe.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c
index a30cc2f..eb25c43 100644
--- a/drivers/media/platform/am437x/am437x-vpfe.c
+++ b/drivers/media/platform/am437x/am437x-vpfe.c
@@ -1185,14 +1185,21 @@ static int vpfe_initialize_device(struct vpfe_device *vpfe)
static int vpfe_release(struct file *file)
{
struct vpfe_device *vpfe = video_drvdata(file);
+ bool fh_singular = v4l2_fh_is_singular_file(file);
int ret;
mutex_lock(&vpfe->lock);
- if (v4l2_fh_is_singular_file(file))
- vpfe_ccdc_close(&vpfe->ccdc, vpfe->pdev);
+ /* the release helper will cleanup any on-going streaming */
ret = _vb2_fop_release(file, NULL);
+ /*
+ * If this was the last open file.
+ * Then de-initialize hw module.
+ */
+ if (fh_singular)
+ vpfe_ccdc_close(&vpfe->ccdc, vpfe->pdev);
+
mutex_unlock(&vpfe->lock);
return ret;
--
1.8.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[Patch v2 1/1] media: am437x-vpfe: Fix a race condition during release Benoit Parrot <bparrot@ti.com> - 2015-06-29 23:00 +0200
csiph-web