From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 542A01119A; Sat, 3 Feb 2024 04:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706933852; cv=none; b=Z87BDnlckptIeJ7uHLWT08BkNdfl/CIefb8FASiDoR/v8MJNW7p4RavOCoRJ2jV6b4Zwe/BEU1WaY1Vdz2uG6XcHyl4lyPp6CUNm5EW1JrwJ5CF5oP+n1XYmdPqK1ZPXE1UxDUPk7l1msJV5VTfS5Pa2s13Vcl0DsiLI8yPMJ74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706933852; c=relaxed/simple; bh=v8Y0GxRQbW8qSlSksn+XTRyhj5QQeLOQiPzR9GV0eGQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sHGPYUuDjG6KyHF2GXc19S5WJ7SsIkaP8hozin+mAf7uUcYufJTpbi4qwqtOIDf4VseEmZIIH8RdXfr4Qpg6nHcyQm+KgNY7trKaBcBnqFcEOYUtoIWFZIhAsXepEY5eMEmQ15idcMH/MHcpyJoY4y1qf9SF+Le+Z7xhvgFN+aI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1Fs4ZHkd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1Fs4ZHkd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C04FAC433C7; Sat, 3 Feb 2024 04:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706933851; bh=v8Y0GxRQbW8qSlSksn+XTRyhj5QQeLOQiPzR9GV0eGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Fs4ZHkdeZSFKbkxYcRFYEUra15nSbu5JMZ3n/YOLCbow5bQrmBYpzSh2UfWDWvhu 3sv/Vs9+uC2JaoLIoUEP8axsSCeMR9kbZMUlWgne3a0JWs+/2prkx25WnEjyAz4/1k qYAbd3Lt0wOtRfqPn7igiHYuDGDRxANGClayjt3U= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Phillip Potter , Ghanshyam Agrawal , Hans Verkuil , Sasha Levin Subject: [PATCH 6.7 182/353] media: stk1160: Fixed high volume of stk1160_dbg messages Date: Fri, 2 Feb 2024 20:05:00 -0800 Message-ID: <20240203035409.402623478@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240203035403.657508530@linuxfoundation.org> References: <20240203035403.657508530@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ghanshyam Agrawal [ Upstream commit b3695e86d25aafbe175dd51f6aaf6f68d341d590 ] 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. Suggested-by: Phillip Potter Signed-off-by: Ghanshyam Agrawal Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- 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..366f0e4a5dc0 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_DEBUG "copy skipped: negative lencopy\n"); return; } -- 2.43.0