Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1731801rdh; Sat, 25 Nov 2023 00:39:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbdpSzL8kmQC1ind5dkLskeJIsr+7Z6g47qV5VB+YeKzWm9W57qAt6Xr+DhJyXlpDtCVOR X-Received: by 2002:a17:90b:4f4a:b0:285:a163:c24c with SMTP id pj10-20020a17090b4f4a00b00285a163c24cmr1894783pjb.36.1700901563414; Sat, 25 Nov 2023 00:39:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700901563; cv=none; d=google.com; s=arc-20160816; b=EDKYZBThY3pGvvD0ueK2l5Xd5qdLCObz1BkqKj/Uo4kGuPD7vuQEbpAzxwjYgzIYNq iJ8Q8p2J7yQsjpRhPQ0gPldOUxq+HbA06tLfRePPdHZ80RCVFBFgEyXEFN6/WEHLjvJ/ Z0+Ml2b3KDja773HvlY+D5GCzsGMyXoPZDHlMkHpH+HSWYYLn8kusOvYzqxmn9d/AIqQ nWd3kCQFSgAVFoJtuY5v001Os1gNWnkAsNegDVwvVXkMEJnTaEuSgnE9WmccTZOVpmOx c7J+2NeiYksX9FDiC3Lf1LaRHckGWi3ejSMv+IY6UBGv+5zNoSWj654cbADrbtqMH+nu 7/Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=m3Bf/Yl9mKrvt0khOxHwark3QzJ6UQysXXp2xzavtBk=; fh=fgF9zOmwp95gSowcq+JgXs69+tJfESOcGf2ZNGcqZGE=; b=TSm9TuV4v1JIlU0qOOQX5wQFcpGw2eQzxthKIIfl0i3OtCy6JnsATbA9cYr1MZBqIV 6A5KqdADhwOkMfv+WzB1LIe/X5Cn7NvULbplKkdFgAJU5gY7dUHDJ2XLDZCvBVOLf9WY sXiY7OenZJpoJpPvdEWNfrwHZQE/70wilj58CnRi1913SV6OAIiNEaxttXaq1i6L9xCS 5GSnISCp3RVTYFQJ0SPdTINgBxQytn0g5lpYTHppbtsZHf+B4uwEj8s4If6BqgDnkMae UaUldBS3idn1BbF0hJ/Ci+9WdIaetzdT8zHoFhNUfaOO6kybKAHRfrUcYP5pr0buoZLF GuPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cXVzSidy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id pl14-20020a17090b268e00b0028515d4c7f9si5729767pjb.45.2023.11.25.00.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 00:39:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cXVzSidy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 54BA2809FC88; Sat, 25 Nov 2023 00:39:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbjKYIjM (ORCPT + 99 others); Sat, 25 Nov 2023 03:39:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjKYIjJ (ORCPT ); Sat, 25 Nov 2023 03:39:09 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 682E5E6; Sat, 25 Nov 2023 00:39:01 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-285196556fcso2032064a91.0; Sat, 25 Nov 2023 00:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700901541; x=1701506341; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=m3Bf/Yl9mKrvt0khOxHwark3QzJ6UQysXXp2xzavtBk=; b=cXVzSidyjDMYLiOlOoz9imjAm5p7wOEwJD2obsPwwOTeozfENBZAtw3LAcuOhox6Na wnpGNeZyfwKs61+4ZVuIkkBWDd1Bodw1v8NbKjwfOZc8oTYpzSAfWoSJpU2MSs+fOJv4 Ebwx0keJivCl0qFZDkpqrB36mc2A1rfuq+AMXGIQAijv3WTqqh2jbbcdQvUniemDsHgb HgWwkY8jlvIqqRkk4BmvVSTLu9snmC/k7Uv10oFCUbEiCNyiz0S2zykLhlW5KToe6lW/ fwf4HIOr+X/RDovMcTIFdbM2D+jNH6TgOwqv5wjO0WjHGgeZB4ILksDpQkSe2Puhh9tf faZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700901541; x=1701506341; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m3Bf/Yl9mKrvt0khOxHwark3QzJ6UQysXXp2xzavtBk=; b=ZPOGzM3YLAcfSySQ3K6JgVMf6cGXfmYiaTJHVOdpPcfwAAYJNKHit8X4sxY9wk0OG3 E9MG+MOoMdUhdzBx/7M79bsiL4BEhGoQqy0wYLY2RTgRfv2vpt5Jn6hTZS8fw928QKgb l9mvTj7PUfYibFDxLJAjxLrHbzvLGFpQrFjcL7BQALVempy2TUYGsCD5GwrtXs5oKu+Y /mS2tmGzlDmUwa5fg5sfuawcy3X7MSD0XAcdwvT0R/x/l51Ko87h57juQsGPMNszgV1/ /c5uBmZlemFUyzEMCkGZbjpAc6VAZ8/C3wZdy5Den3iRuXwhh9BPV3uvlR1A5k+cRxDl ML5Q== X-Gm-Message-State: AOJu0YzHetsQYWWSInPLNxN54Tl+g7/sJsdNQFX1mgQOgPeavILszJZ9 Lgevynumo3FRftaHDO8CBOQFB9XhSPs8QV5BHXE= X-Received: by 2002:a17:90b:224b:b0:27d:880d:8645 with SMTP id hk11-20020a17090b224b00b0027d880d8645mr5626111pjb.49.1700901540728; Sat, 25 Nov 2023 00:39:00 -0800 (PST) MIME-Version: 1.0 References: <20231125073738.649948-1-ghanshyam1898@gmail.com> <2023112554-bagginess-banker-089e@gregkh> <2023112508-clothing-twirl-fe40@gregkh> In-Reply-To: <2023112508-clothing-twirl-fe40@gregkh> From: Ghanshyam Agrawal Date: Sat, 25 Nov 2023 14:08:24 +0530 Message-ID: Subject: Re: [PATCH V3] media: stk1160: Fixed high volume of stk1160_dbg messages To: Greg KH 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Sat, 25 Nov 2023 00:39:22 -0800 (PST) On Sat, Nov 25, 2023 at 1:58=E2=80=AFPM Greg KH wrote: > > On Sat, Nov 25, 2023 at 01:51:35PM +0530, Ghanshyam Agrawal wrote: > > On Sat, Nov 25, 2023 at 1:18=E2=80=AFPM 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 appli= ed > > > > 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/me= dia/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 the= se > > > > * is incorrect standard (mismatch between expected and confi= gured). > > > > @@ -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: negati= ve lencopy\n"); > > > > > > You changed a debug message level to a KERN_WARNING level? That feel= s > > > 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 Hi Greg, Noted with thanks. Let me update the patch. Regards, Ghanshyam Agrawal