aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2016-11-16 04:04:51 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-30 06:16:23 -0500
commit0a79ef333dfa7f25abc2eab10f3a11bbdf9a9f17 (patch)
treeb1a224d23c11da2ee96de35a4bbfa440f1c1a556
parent3605163d98dbcd37e5d6f51c4982d7da77bdcba9 (diff)
[media] s5p-mfc: Use printk_ratelimited for reporting ioctl errors
Some applications don't check error codes from QBUF/DQBUF ioctls, so don't spam kernel log with errors if they fall into endless loop trying to queue next buffer after a failure. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_debug.h6
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_dec.c2
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_enc.c2
3 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h b/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h
index 5936923c631c..1936a5b868f5 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h
@@ -39,6 +39,12 @@ extern int mfc_debug_level;
39 __func__, __LINE__, ##args); \ 39 __func__, __LINE__, ##args); \
40 } while (0) 40 } while (0)
41 41
42#define mfc_err_limited(fmt, args...) \
43 do { \
44 printk_ratelimited(KERN_ERR "%s:%d: " fmt, \
45 __func__, __LINE__, ##args); \
46 } while (0)
47
42#define mfc_info(fmt, args...) \ 48#define mfc_info(fmt, args...) \
43 do { \ 49 do { \
44 printk(KERN_INFO "%s:%d: " fmt, \ 50 printk(KERN_INFO "%s:%d: " fmt, \
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index cf787eae11b7..367ef8e8dbf0 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -642,7 +642,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
642 int ret; 642 int ret;
643 643
644 if (ctx->state == MFCINST_ERROR) { 644 if (ctx->state == MFCINST_ERROR) {
645 mfc_err("Call on DQBUF after unrecoverable error\n"); 645 mfc_err_limited("Call on DQBUF after unrecoverable error\n");
646 return -EIO; 646 return -EIO;
647 } 647 }
648 648
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index fcc2e054c61f..e39d9e06e299 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -1268,7 +1268,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
1268 int ret; 1268 int ret;
1269 1269
1270 if (ctx->state == MFCINST_ERROR) { 1270 if (ctx->state == MFCINST_ERROR) {
1271 mfc_err("Call on DQBUF after unrecoverable error\n"); 1271 mfc_err_limited("Call on DQBUF after unrecoverable error\n");
1272 return -EIO; 1272 return -EIO;
1273 } 1273 }
1274 if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { 1274 if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {