Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3699735rdh; Tue, 28 Nov 2023 01:03:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeH1Ii9zh1ZE/YakU2Ch8CFhoap6z8FAy60rq7vf+qEf99LfbKdAz+JCO2GAmLKCAC9hkE X-Received: by 2002:a17:903:228a:b0:1cf:b146:8101 with SMTP id b10-20020a170903228a00b001cfb1468101mr12948890plh.16.1701162223708; Tue, 28 Nov 2023 01:03:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701162223; cv=none; d=google.com; s=arc-20160816; b=C9tPkF6es/gyURU89LT72VJKvwBBpcT+xS5RLYo4ODwzZhBAe0YJ1+cFH11kGr7mo+ zpKCLrQxbbWwRYSuwIwunhFH76pAXEKRlGmdg+IpAt+pmwxiDYvrs9QMEWBfT6RArg4Y q4V3+T8L1h8Lc1bgGAvGTr0IKyIdBQ1G8jih0C4W/a6QtF6+oHtIgEpEioFsE9Iz5g67 MRJM4DziN9nGBAwD//Ka/oLrSEmQ4Zkolyw9UZLynoLQQplFKbEbEajqM1WAHp7exztk e80/7pWT4STfY8ICsaYIWKfFga5aImBrJ7xphZJ3SitXcbOnyDErqF2AzW6ppr3dpLcN 3d8g== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=WD8wV/VANG0qms5+pgg5WkXkGCgPD0uOURm4uNYIcnk=; fh=4o74u8t3tZl+gOqTeO36TacdC/0fcbXxPBxG7u0NAWQ=; b=UhKp6rai8TVb6eKSM0R/dzrO7OhpmCRw4dSWhaWZFG55AYUQbowFFEFfl65lX8ivuP o+DJvQWgE1rEs6X+EyWTbco6GCQ2N3MKOp/2lJfS1UP8HpnYUJej1FuJ1OCB9XvvKG3h ut6d20EIE+q7OP2BQwVaYRqwgcFhbojUjQtiEbKxPrvRFDc/IcOMmdca9KBy+k2xKUkE NvdUCnrgFVHjBfPAvwd0I+AcqcB/0HHJG5Tpk6qz4RtP/o7XHzCiJ4iMuojOwiBS0vpF oxSO+9y9RdWk2rr4dljaLCgCCzJQdATx4XEFATVvkQ29C9fBGkVI5cC/IPHNWFEEUHOq VJqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=G0Ldjj+U; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i6-20020a17090332c600b001cffe392e7dsi629759plr.329.2023.11.28.01.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 01:03:43 -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=@bootlin.com header.s=gm1 header.b=G0Ldjj+U; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 18FF58069914; Tue, 28 Nov 2023 01:03:41 -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 S230506AbjK1JDO (ORCPT + 99 others); Tue, 28 Nov 2023 04:03:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbjK1JDM (ORCPT ); Tue, 28 Nov 2023 04:03:12 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C57C81B5 for ; Tue, 28 Nov 2023 01:03:17 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id F3278FF81E; Tue, 28 Nov 2023 09:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701162196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WD8wV/VANG0qms5+pgg5WkXkGCgPD0uOURm4uNYIcnk=; b=G0Ldjj+UYdmXqluksI3HIMDa7/JFXW5tsMHkFdZwUvvmwMR4bGZzbO/AyN/6Ee45f8dXAW prN9ilgyPrL0jo860pD/sNUENUaV6uf1tpoX+r50wA4LYx5GlvygxG6DtFhEvxqLRkjZN2 XWZcqOqo/qwJSa+PSvWnPu4aXEaMcbaY+9rTXEXjJ5kaXSZH7BhPYEWULg3KknGYKl047U Bv5gcURtFFW8n+waV7V6wh/GWUcPmjdfYzJ8KfA9h0n2DO3whU5hFabN0UNYFFTITGmTzz TVtQDcmWv25BGEYN1Ibf7xFRP+tfyRuk76vteWsg6aWWZGj75ZKaixodJweRzA== Date: Tue, 28 Nov 2023 10:03:13 +0100 From: Miquel Raynal To: Michael Walle Cc: Tudor Ambarus , jaimeliao.tw@gmail.com, jaimeliao@mxic.com.tw, pratyush@kernel.org, richard@nod.at, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: spi-nor: stop printing superfluous debug info Message-ID: <20231128100313.3c990f69@xps-13> In-Reply-To: <42c96d63d1ea4f7e8f16a3c8eb0a4cf1@walle.cc> References: <20231127165908.1734951-1-tudor.ambarus@linaro.org> <42c96d63d1ea4f7e8f16a3c8eb0a4cf1@walle.cc> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=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 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]); Tue, 28 Nov 2023 01:03:41 -0800 (PST) Hello, michael@walle.cc wrote on Tue, 28 Nov 2023 09:47:28 +0100: > Hi, >=20 > > The mtd data can be obtain with the mtd ioctls and the SPI NOR > > flash name can be determined interrogating the sysfs entries. > > Stop polluting the kernel log. > >=20 > > Signed-off-by: Tudor Ambarus > >=20 > > --- > > drivers/mtd/spi-nor/core.c | 19 ------------------- > > 1 file changed, 19 deletions(-) > >=20 > > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c > > index 25a64c65717d..6de76fd009d1 100644 > > --- a/drivers/mtd/spi-nor/core.c > > +++ b/drivers/mtd/spi-nor/core.c > > @@ -3517,25 +3517,6 @@ int spi_nor_scan(struct spi_nor *nor, const char= > *name, > > /* No mtd_info fields should be used up to this point. */ > > spi_nor_set_mtd_info(nor); > >=20 > > - dev_info(dev, "%s (%lld Kbytes)\n", info->name, > > - (long long)mtd->size >> 10); =20 >=20 > I'd lower this to dev_dbg() and print the jedec id. It might come in > handy for a quick glance during bootup if debug is enabled. Ack. Although, your boot time will almost be unaffected if you don't print the info messages to the console. What takes the most time is not writing to the kernel buffer, it's to display the lines on a serial console, and dev_info() are by default discarded, you need to select a lower log level manually, and if you do that it means you're not looking for quick boot times but rather more for additional information. > > - dev_dbg(dev, > > - "mtd .name =3D %s, .size =3D 0x%llx (%lldMiB), " > > - ".erasesize =3D 0x%.8x (%uKiB) .numeraseregions =3D %d\n", > > - mtd->name, (long long)mtd->size, (long long)(mtd->size >> 20), > > - mtd->erasesize, mtd->erasesize / 1024, mtd->numeraseregions); > > - > > - if (mtd->numeraseregions) > > - for (i =3D 0; i < mtd->numeraseregions; i++) > > - dev_dbg(dev, > > - "mtd.eraseregions[%d] =3D { .offset =3D 0x%llx, " > > - ".erasesize =3D 0x%.8x (%uKiB), " > > - ".numblocks =3D %d }\n", > > - i, (long long)mtd->eraseregions[i].offset, > > - mtd->eraseregions[i].erasesize, > > - mtd->eraseregions[i].erasesize / 1024, > > - mtd->eraseregions[i].numblocks); > > return 0; =20 >=20 > Part of this is already available through the spi-nor debugfs, although n= ot > the actual mtd properties. These I think, should go into the mtdcore > itself if really needed. Either through dev_dbg() or debugfs. Maybe we don't need this at all, as long as one message remains about the JEDEC ID, but keep in mind that spi-nors are commonly storing the rootfs and if your spi-nor does not boot you don't have a userspace yet and all the debugfs entries are purely useless. Thanks, Miqu=C3=A8l