Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1728073rdh; Sat, 25 Nov 2023 00:29:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/n8g+rOYrqjqG9zvKOAfO40/piM5Ev2J9PhO++vG7y1XZeHMMoKrExo7wcmulpKcHvozv X-Received: by 2002:a17:902:ee54:b0:1cf:7ce5:e6e8 with SMTP id 20-20020a170902ee5400b001cf7ce5e6e8mr5445876plo.12.1700900941854; Sat, 25 Nov 2023 00:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700900941; cv=none; d=google.com; s=arc-20160816; b=POQaDuGRFnQC+n3lcstATOt8OeYL5aYSvSdW4hkZAEX0wER33FAfFoGg3LWGS5mq09 3P+lAbcwiqofOY1HVbmX8zi5czChKq4JV3skytvyKaCBysuXdP34ziA5aoJZtQETHjPS oSND1ZI43e2ZOg2Ejh0c3ph3peEaDy29gaed9NOsNmzmXk48cY0ofzmtPASH03l8yzxu 7UCNk4FN9X07mhgSr6qnwRiKSUAagOq1liLu0QOqVin+5QLgemkcB/mthKCj4dS5uFsI fAZgDpX5IQGXAhW1h37TMh4mqLC7zQ8wTIZ3EL/WpZDOr2TnXNFN0i523Z3Gm08pMt0b NxwA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SmzWSG8ySSS2jiOb791OXqpLYdbHlOfOEBgHmML1dnY=; fh=calRgFHjO1XaQnbV2oza3BzFw6MwzItAw7iIa+USw3A=; b=yUHULCVludOWncMbP6BD6/ZsKkIO4TJ6qLrmvyMIp53rtOKmZwNcqsSw9G9no++aLz xqkjQuY6cMTlfEVyB8KR08I4WMzypeu9t3g7aG+gE/qUK2rPRNLzNPsx0zzmsHdD9L3d xlwHki067SSwF2QesBgAOYePYvaq3LmU5ufmWB6BuDm7Z2+ut4b/eBQgnQFnovJ2o91s 208CSHpu6s2VlvD9igvFcnmkSvnmw3M4oyki7Oi8RwvWKPhb9y6PkYCUMgu+mal0oBc0 IsH3xGbu1wcYA3vJW8tHvYMWtdUIltGoZKBqPIOg3Gw0V6u+NRaVJ5KdMJq/Z6NGMmmp qfVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0PMKZlnJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z12-20020a170902d54c00b001b3bd85f54bsi5203500plf.35.2023.11.25.00.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 00:29:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0PMKZlnJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 58D318065002; Sat, 25 Nov 2023 00:28:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231833AbjKYI2o (ORCPT + 99 others); Sat, 25 Nov 2023 03:28:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231784AbjKYI2j (ORCPT ); Sat, 25 Nov 2023 03:28:39 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 996E4D41 for ; Sat, 25 Nov 2023 00:28:45 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1AB4C433C8; Sat, 25 Nov 2023 08:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700900925; bh=Ttd2JPImbaXNmJFp7qDlKcqm2O5oVQSU4Y49sjSoDBs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0PMKZlnJ0LjUF/WkotChtMS9ENEkoogCTXi80f3DWkWsXfurS0ZoGk2/laLRrCipP t3lnasxfSuNOifKsLs2pelA7v409D/3AkwvDNz4AyxU3aDKxui11JxIsWElsg5jUKC u2IG4oE3H+GmQwtwMe34Sr5JpgG7Mh/GJiGvFBVY= Date: Sat, 25 Nov 2023 08:28:42 +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: <2023112508-clothing-twirl-fe40@gregkh> References: <20231125073738.649948-1-ghanshyam1898@gmail.com> <2023112554-bagginess-banker-089e@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Sat, 25 Nov 2023 00:28:59 -0800 (PST) On Sat, Nov 25, 2023 at 01:51:35PM +0530, Ghanshyam Agrawal wrote: > On Sat, Nov 25, 2023 at 1:18 PM Greg KH wrote: > > > > 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 > > Hi Greg, > > Thanks for your response. The log level should indeed be DEBUG > as it was earlier. > > I only wanted to add a rate limit there because it was printing too > many log messages as mentioned in the todo. Shall I update the > log level to DEBUG and resend the patch? Thank you very much > again. If it's spamming the logs, why print anything at all as obviously everyone is ignoring it? But I do not really know, the final decision should be up to the developer and maintainer of this subsystem. thanks, greg k-h