Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1713014rdh; Fri, 24 Nov 2023 23:49:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHswEsXjATdkVZMbxPI5mG0lyaN8YQIRLwX4VnpCphUHj8E46jSY0Ape2HC5jDNNjS6uBe0 X-Received: by 2002:a9d:7382:0:b0:6d7:f8c7:1a73 with SMTP id j2-20020a9d7382000000b006d7f8c71a73mr6151748otk.24.1700898542445; Fri, 24 Nov 2023 23:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700898542; cv=none; d=google.com; s=arc-20160816; b=F78GNUVEeLPOYelDFxekDe5g/p+HwVayjUj0CSo4mhqFwBvQNUEvuVF1mf5P4/IEPp WUJCF9SjS4mRrvLqkPCGMxkyxSg8kCoz/asqoLWivpXi04vAqGnEOe0GGItXudBKBPKO waLsQo99A+CF/uVcbxPG9wy1OijiBeDvzmzmqiBLNQkUqb6gzBKG7VCCbjo6TcDFihQk HS0n6yCI3CqWnMJkLZrJh7CHRTWNfh6Oj3JyA2PLiSn73TCtKgjd91oMaP1AIu3KW7F0 2LpkPXtCXPyc2/xCFnaPGMAbFBqGuc4qiJG86juoAtMYIDW1WMhb8CFk+as9U032qml+ Fnjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cJe58+yV5tMu3Le3QRPrVUK5z9SUUH4xryW1m7lOXv4=; fh=calRgFHjO1XaQnbV2oza3BzFw6MwzItAw7iIa+USw3A=; b=SC7aKkTyEDLB7+Ym7ZmNmPz1Uyu18WFcZg21lyapfBTJcBtzNTTpjeaUnNH9epN89X /XxcItn1i5SMfTrGR3RsjsGAVehXX7KELRNIvJD7g6dEUfQDXyojn/+wBctfyP2hhAyZ 0rhliehNe4EMVdaYg99X1xUrUyMKNnzAOsIFW7eseo11TwAH8tTZORvcKzLRmaBP3ORV eb6Zy8Jxxs2g7xym8VyVBDguwX3B1zM6R8mrtABfD7EvC0y9V2dmNKBXuTyXpLrElu0s v6Pbb0v0Qusb2R4zAn4ZFS6S4q8s1J33R3FwURpKnXsaaFFC8gjitjKQU0lAjdlLdIhv XVaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="T6eKkn/L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h33-20020a632121000000b005c1b58a321asi5478746pgh.411.2023.11.24.23.49.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 23:49:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="T6eKkn/L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 02A6A8063D46; Fri, 24 Nov 2023 23:49:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231714AbjKYHsk (ORCPT + 99 others); Sat, 25 Nov 2023 02:48:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjKYHsi (ORCPT ); Sat, 25 Nov 2023 02:48:38 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E507610F6 for ; Fri, 24 Nov 2023 23:48:44 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3AEEC433C8; Sat, 25 Nov 2023 07:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700898524; bh=2Jqvgdk2LpiV1WxebiiaBPjnXuNkuIUOCoXEMB6dMgk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T6eKkn/Lpf0Na1PwR3q0Nc9EpletVID6t2uGQTizJ0bBHU8T5dmAJrHfyIfZ609+Y Yc0nv8ke+kSp+LuCytllFm86LqbCcVQrmMX6lZd8ixrC5x/EF+wewWwSVCD5vSh6+q wP5N6pCisVTRJTMOHjY2hdSpIeMRN7PglaDSYyts= Date: Sat, 25 Nov 2023 07:48:41 +0000 From: Greg KH To: Ghanshyam Agrawal Cc: ezequiel@vanguardiasur.com.ar, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Phillip Potter Subject: Re: [PATCH V3] media: stk1160: Fixed high volume of stk1160_dbg messages Message-ID: <2023112554-bagginess-banker-089e@gregkh> References: <20231125073738.649948-1-ghanshyam1898@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231125073738.649948-1-ghanshyam1898@gmail.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 24 Nov 2023 23:49:00 -0800 (PST) On Sat, Nov 25, 2023 at 01:07:38PM +0530, Ghanshyam Agrawal wrote: > The function stk1160_dbg gets called too many times, which causes > the output to get flooded with messages. Since stk1160_dbg uses > printk, it is now replaced with printk_ratelimited directly. > > Suggested-by: Phillip Potter > Signed-off-by: Ghanshyam Agrawal > --- > V3: > Fixed the issue with my patch needing previous versions being applied > first. > > Used printk_ratelimited instead of dev_warn_ratelimited because > of compiler error "incompatible pointer type". > > V2: > To add KERN_WARNING in printk_ratelimited, and later as per warning by > the checkpatch script, replaced printk_ratelimited with > dev_warn_ratelimited. > > V1: > The function stk1160_dbg gets called too many times, which causes > the output to get flooded with messages. Since stk1160_dbg uses > printk, it is now replaced with dev_warn_ratelimited. > > drivers/media/usb/stk1160/stk1160-video.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/usb/stk1160/stk1160-video.c b/drivers/media/usb/stk1160/stk1160-video.c > index 4e966f6bf608..98417fa31d70 100644 > --- a/drivers/media/usb/stk1160/stk1160-video.c > +++ b/drivers/media/usb/stk1160/stk1160-video.c > @@ -107,8 +107,7 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) > > /* > * TODO: These stk1160_dbg are very spammy! > - * We should 1) check why we are getting them > - * and 2) add ratelimit. > + * We should check why we are getting them. > * > * UPDATE: One of the reasons (the only one?) for getting these > * is incorrect standard (mismatch between expected and configured). > @@ -151,7 +150,7 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) > > /* Let the bug hunt begin! sanity checks! */ > if (lencopy < 0) { > - stk1160_dbg("copy skipped: negative lencopy\n"); > + printk_ratelimited(KERN_WARNING "copy skipped: negative lencopy\n"); You changed a debug message level to a KERN_WARNING level? That feels like a step backwards. thanks, greg k-h