From patchwork Wed Nov 16 09:04:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9431125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 853296021C for ; Wed, 16 Nov 2016 09:05:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7483628682 for ; Wed, 16 Nov 2016 09:05:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6908C28EB1; Wed, 16 Nov 2016 09:05:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A68228682 for ; Wed, 16 Nov 2016 09:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933750AbcKPJFg (ORCPT ); Wed, 16 Nov 2016 04:05:36 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57066 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934094AbcKPJFY (ORCPT ); Wed, 16 Nov 2016 04:05:24 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGQ00EI198VFR80@mailout1.w1.samsung.com>; Wed, 16 Nov 2016 09:05:19 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20161116090519eucas1p2ebe899121e359bc2802d24a12994b9fe~He8wrcz910951009510eucas1p2r; Wed, 16 Nov 2016 09:05:19 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 35.8B.19540.F412C285; Wed, 16 Nov 2016 09:05:19 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20161116090518eucas1p17c506d8c8282f852cb3f4f10c5f82fa0~He8v6JYAa2251122511eucas1p1i; Wed, 16 Nov 2016 09:05:18 +0000 (GMT) X-AuditID: cbfec7f5-f79ce6d000004c54-84-582c214ff655 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 5A.4A.07726.4512C285; Wed, 16 Nov 2016 09:05:24 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OGQ00GDL98JU960@eusync2.samsung.com>; Wed, 16 Nov 2016 09:05:18 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Javier Martinez Canillas , Andrzej Hajda , Inki Dae Subject: [PATCH 2/9] s5p-mfc: Use printk_ratelimited for reporting ioctl errors Date: Wed, 16 Nov 2016 10:04:51 +0100 Message-id: <1479287098-30493-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1479287098-30493-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCIsWRmVeSWpSXmKPExsWy7djP87r+ijoRBmuPc1vcWneO1WLjjPWs FpPuT2CxePN2DZPF+fMb2C16Nmxlt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mQvOClas3nCcuYHxCV8XIyeHhICJxOpDj9khbDGJC/fW s3UxcnEICSxhlLi4t40Vwmliklg9pZ0FpIpNwFCi620XG4gtIuAksXDWX3aQImaBJ0wSZ97t ZwJJCAv4S3yfNgesgUVAVeLp5ztgDbwCHhK33z5lg1gnJ3Hy2GRWEJtTwFPiycxXQPUcQNs8 JJYfNZ3AyLuAkWEVo0hqaXFuem6xoV5xYm5xaV66XnJ+7iZGYIBvO/Zz8w7GSxuDDzEKcDAq 8fAuUNeOEGJNLCuuzD3EKMHBrCTCe11QJ0KINyWxsiq1KD++qDQntfgQoynQTROZpUST84HR l1cSb2hiaG5paGRsYWFuZKQkzlvy4Uq4kEB6YklqdmpqQWoRTB8TB6dUA6OjMsPHnWkdB4K+ XnLffSnhofHUSv7NTybvMW+Yy6omOM/z7DmVaU+/frQpEAhMMWmv4DOzytzZN6mo6CtnLeMM 31PH+X+KMN6fFf1Hq+i6rUW3ZWhh8pbfLCURt99U9D9h+fN7//ykjXMv6upcjiiV3ixz75oS W6iY5slda2tTBC8cj18VfFuJpTgj0VCLuag4EQB5kU7FhgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161116090518eucas1p17c506d8c8282f852cb3f4f10c5f82fa0 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161116090518eucas1p17c506d8c8282f852cb3f4f10c5f82fa0 X-RootMTR: 20161116090518eucas1p17c506d8c8282f852cb3f4f10c5f82fa0 References: <1479287098-30493-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some applications doesn'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 --- drivers/media/platform/s5p-mfc/s5p_mfc_debug.h | 6 ++++++ drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 2 +- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 2 +- 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 @@ __func__, __LINE__, ##args); \ } while (0) +#define mfc_err_limited(fmt, args...) \ + do { \ + printk_ratelimited(KERN_ERR "%s:%d: " fmt, \ + __func__, __LINE__, ##args); \ + } while (0) + #define mfc_info(fmt, args...) \ do { \ 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 52081ddc9bf2..47aceacee169 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) int ret; if (ctx->state == MFCINST_ERROR) { - mfc_err("Call on DQBUF after unrecoverable error\n"); + mfc_err_limited("Call on DQBUF after unrecoverable error\n"); return -EIO; } 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) int ret; if (ctx->state == MFCINST_ERROR) { - mfc_err("Call on DQBUF after unrecoverable error\n"); + mfc_err_limited("Call on DQBUF after unrecoverable error\n"); return -EIO; } if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {