From: Andy Walls Subject: Re: [PATCH] drm/edid: Don't repeatedly log hex dumps of bad EDIDs by default Date: Sun, 19 Sep 2010 15:18:19 -0400 Message-ID: <1284923899.2079.95.camel@morgan.silverblock.net> References: <1284764006.13604.21.camel@morgan.silverblock.net> <20100918115043.GB2953@joi.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= Cc: Marcin Slusarz , Dave Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Sun, 2010-09-19 at 20:39 +0200, Rafa=C5=82 Mi=C5=82ecki wrote: > 2010/9/18 Marcin Slusarz : > > On Fri, Sep 17, 2010 at 06:53:26PM -0400, Andy Walls wrote: > >> On my system, every 10 seconds drm_edid_block_valid() gets called = 4 > >> times by radeon_dvi_detect(). This results in 4 instances of a > >> multi-line hex dump of the same EDID (non-)data being logged every= 10 > >> seconds. > >> > >> Silence the hex dump from drm_edid_block_valid() unless a drm_debu= g > >> module parameter flag is set. > >> > >> Signed-of-by: Andy Walls > >> > >> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid= =2Ec > >> index dce5c4a..33a748c 100644 > >> --- a/drivers/gpu/drm/drm_edid.c > >> +++ b/drivers/gpu/drm/drm_edid.c > >> @@ -173,9 +173,12 @@ drm_edid_block_valid(u8 *raw_edid) > >> > >> bad: > >> if (raw_edid) { > >> - DRM_ERROR("Raw EDID:\n"); > >> - print_hex_dump_bytes(KERN_ERR, DUMP_PREFIX_NONE, r= aw_edid, EDID_LENGTH); > >> - printk("\n"); > >> + DRM_DEBUG("Raw EDID:\n"); > >> + if (drm_debug & DRM_UT_CORE) { > >> + print_hex_dump_bytes(KERN_ERR, DUMP_PREFIX= _NONE, > >> + raw_edid, EDID_LENGTH= ); > >> + printk("\n"); > >> + } > >> } > >> return 0; > >> } > >> > > > > Why not print it only once on original error level? > > Something like: > > static bool printed =3D false; > > if (!printed) { > > ... > > printed =3D true; > > } > > > > It has the same effect for you (no spamming by default) and it's st= ill provide some information. >=20 > Should be per-monitor or per-output I think. Yes, something like that. I thought about that after my reply. My perpetual log spam is related to my DVI-D-1 "connector" for my radeo= n graphics chip. So per connector, per graphics chip. With the patch as provided, the hex dump messages can be turned on and off using something like: echo 1 > /sys/module/drm/parameters/debug echo 0 > /sys/module/drm/parameters/debug once the user has a shell prompt. Regards, Andy