Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp14211rdd; Wed, 22 Nov 2023 08:13:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHz2MLZEoTaC5uYQUb3FllgYosc/KCxmv1ZJNe57GY6SlxieFJ5vxf/YMM57bseTigb9BHn X-Received: by 2002:a05:6a20:1605:b0:187:60da:4767 with SMTP id l5-20020a056a20160500b0018760da4767mr10705519pzj.25.1700669613368; Wed, 22 Nov 2023 08:13:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700669613; cv=none; d=google.com; s=arc-20160816; b=lSyUrNZ3N5ZE2z2swyFV2Ggzhc5bC5sC8ituoWNhqQ50YIBakVkuhBxpONFJFvaKqA YNQrlKThJ6momDTxgQndzVv+KEZs5sq4bhjCnWLD9P0aABjDrmnHmptbpdUoC/qLb87s dzEZu4k4EieGVMbQXA5K3xjInkdLCWS/yQvVbYtWALuJdyW/raoxM6FGAVhzybfKX/Pw WPzW3ziZjAqnqkgRKvJZZFxlOw/jo8rLwVERRkdJxBBQdTy8Rkg1KYgvWs7Y25LWLl63 Hz7abEuYcBzSQGTBrJlqd9rK+DftcC07j8Dl/oALcim6RvP4N6rgko+x2ZSdEQqqS/tK F/KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IoVmD+VTOG0LFwMmHOyCBmPi9IZVbmlhZU/3heFnccs=; fh=1cutpnXm2G6eeDuheYDL6sa6q6ZhxMbsjiP8Ad91JGM=; b=vUqd/Xh5mcVs25rwf4VzAU/PRpLesJAyLmS6SGo9r+afzChC6kEYXUrkG/XCLurm5D bLx0ZC7cBfWXmuLrPgu+OurHB6HD6ZL3yppGbzX1DEY8B4m7TdJv5TS0T/iUAORpqs1m Hd0VDcigpw1H2/HTDOIvJLvGZuLQRAYVWlXnwotx2weVB2ejvcJi1yGa3cwA4PoALreW 7CEnhTUy7k4vXxM3lnkue18GaybOzNV7bp+ssShQVFeT8BaDxwo9BBX1GQ+9SROMiu9k F18U8LeL+L4/PeQoQIeuHu9Hmxi94mjmyEkPY2gnAeXUnAySzAbwc7oINIvOkTrsOaRs 6Kxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="E3guqg/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id 24-20020a631658000000b005b8f1c4aa49si12837342pgw.895.2023.11.22.08.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 08:13:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="E3guqg/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 9997C8260FB1; Wed, 22 Nov 2023 08:13:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230419AbjKVQNV (ORCPT + 99 others); Wed, 22 Nov 2023 11:13:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbjKVQNU (ORCPT ); Wed, 22 Nov 2023 11:13:20 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12983BC; Wed, 22 Nov 2023 08:13:17 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1ce5e65ba37so7874745ad.1; Wed, 22 Nov 2023 08:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700669596; x=1701274396; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IoVmD+VTOG0LFwMmHOyCBmPi9IZVbmlhZU/3heFnccs=; b=E3guqg/0SKWh/jx/NOQrZgjXrpT+l55oKAy9RXcBhk3bSEmFBkBkyRTqYTsiVwGy7p Vf7KhUfbr+uYCp1Avfx/pUgr4FCh0xkhEg1kx39/tUdCHqnSgJXLxomjyrYHTw4VPFPm mdIQPC2xKUrzzSxThLxTilteiRYY4CendxUjUkqXpG2YvwHZLqNIlh/AOw1U8oNvLNeV PhdadhqDjPQW7OO1Is5KL72RZglKjl3bzxtm/HsYbHdhXgnLvD3qCXtzXD4PX/eCT0Ty tXybwiuD4sqchkJ4TQWQbrAXomZ3z5NZfBaP6/4QnN0pj+VBOikic3lGEpvVR1gme0iV 2iog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700669596; x=1701274396; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IoVmD+VTOG0LFwMmHOyCBmPi9IZVbmlhZU/3heFnccs=; b=gS9yYPpxS4FXnIjnNv0R4k+dtf1IADN/TPUTQs4rN9ongILo2nFfTr7g0ULlLzSrtM LUOuaUcyipNXC2d0410go1dC+iyMpXDW1jtwMTDW+mwnRmVmcKZTPO1D20u31K19hoMv S1U2ADKSsLsT8ptohZIEubXAdwjeIMx/gw8qdMZu00yD9pKd6owRMAccZhPFyDjNZpGg AuX6LtgybFe362j+GFgdGynakntLG77Z6GncmZa479gBzxuziOBYBRmqDJijbFolo49E lWFqOnLFUe+Y72Or4zf8HQ55Gx6tf5BCHVw6WIvFE/CIizuheADtH2TOzwkYjAGyuFZH 9l9w== X-Gm-Message-State: AOJu0YyvTbjHpbF5la4NyYlJNsQEQcV55bgtOL3wEn8mob1vQdu/wNi0 SOqiCFkVOoiImbR9BqAw9IAU1YgWFOmSahv6 X-Received: by 2002:a17:902:c40f:b0:1cf:792d:93d3 with SMTP id k15-20020a170902c40f00b001cf792d93d3mr3120269plk.4.1700669596158; Wed, 22 Nov 2023 08:13:16 -0800 (PST) Received: from localhost.localdomain ([2401:4900:313d:d4a3:2c73:a19b:b896:ebbe]) by smtp.gmail.com with ESMTPSA id jk21-20020a170903331500b001cc311ef152sm9875626plb.286.2023.11.22.08.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 08:13:15 -0800 (PST) From: Ghanshyam Agrawal To: ezequiel@vanguardiasur.com.ar, mchehab@kernel.org Cc: Ghanshyam Agrawal , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, Phillip Potter Subject: [PATCH V2] media: stk1160: Fixed high volume of stk1160_dbg messages Date: Wed, 22 Nov 2023 21:43:04 +0530 Message-Id: <20231122161304.12434-1-ghanshyam1898@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 22 Nov 2023 08:13:30 -0800 (PST) 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. Suggested-by: Phillip Potter Signed-off-by: Ghanshyam Agrawal --- v2: Thanks for your suggestions Phillip. I have updated the TODO comment and used dev_warn_ratelimited for inclusion of kernel warning. drivers/media/usb/stk1160/stk1160-video.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/stk1160/stk1160-video.c b/drivers/media/usb/stk1160/stk1160-video.c index f5b75f380c19..a8e0d352a68c 100644 --- a/drivers/media/usb/stk1160/stk1160-video.c +++ b/drivers/media/usb/stk1160/stk1160-video.c @@ -105,6 +105,16 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) u8 *dst = buf->mem; int remain; + /* + * TODO: These stk1160_dbg are very spammy! + * 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). + * So perhaps, we could add a counter for errors. When the counter + * reaches some value, we simply stop streaming. + */ + len -= 4; src += 4; @@ -140,7 +150,7 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) /* Let the bug hunt begin! sanity checks! */ if (lencopy < 0) { - printk_ratelimited("copy skipped: negative lencopy\n"); + dev_warn_ratelimited(dev, "copy skipped: negative lencopy\n"); return; } -- 2.25.1