Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3704566rdh; Tue, 28 Nov 2023 01:13:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7wLOUTuQjJGzYmlmJ8mhmFBBXJfzhZbkbq+nnSuwiQqaz8vwnBEH4oH4T6HCRB207WhtB X-Received: by 2002:a05:6a00:808b:b0:6c3:4bf2:7486 with SMTP id eh11-20020a056a00808b00b006c34bf27486mr19641649pfb.7.1701162809934; Tue, 28 Nov 2023 01:13:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701162809; cv=none; d=google.com; s=arc-20160816; b=HqUHchOvQu5MWdCtzSZzPpdsPD8xLfOMJMFbNyrSXk43tPR9sf02VJiwxloh6rxNw1 ZxqlITPame1TwfqwFmwqMg8yBvBc0OrJPIv/UCPcnEFacdOnMWSLJJwCHNmx/qvlzAl7 LmDz5DGRlqyVBDt45SdbPWQHAe8rZbsvo3Ui7DjyL/h1w1j2m97W1KmMwo0N428ibTHW kKkDtxOjYUuOS/BYfcBOD6N5OVE+qbDskdtOAf2qfnbII9K0hlHK7gdesaZbcX+2MmNE 6e98aJzKxWneNeHBPf4Fl6T59QEiKcZ4FiuMiVzYNcBzKR4CJ5lPRD/IThmQesjrbpLT 7PXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:references :in-reply-to:subject:cc:to:from:date:mime-version:dkim-signature; bh=Ntqosi7UP2Do89QUaBtdH8dZHNZj7id7/4zX8GPlxF8=; fh=LlCjufC2rYYoweXx8l2TrbRg8uQEIGBUOUXB3pc4y00=; b=AHQz34V85zXVqdgfxM49X2lBPA+YT0XIHKg93AaSbHFcv/JFvG6rJyKMXonbnvjJGa JBUDf1t4249b7SzSiW0IhSmip2rEkMgx3lhchD/32Lv4QVxXc62FAtR+qPeCay50jPvd Iv9AdSqkJmIvq324eSp5dUL4axjyPaysQnG+BlY1IWY8yEcSICfJuT4p9FmonXn6lGE7 N/G0X994LtDkM+nfzuOax7+DbC8AJAJ/xg0bRUkujc66OCaOLK14E70jrp6VG8oJLQM6 NKDj84548mSXYeIxuZIdMfb8wfVa4v9e4KqQSdjh4HNMeO4L/qAGo3K1qLuoKH+Ove4P 3q5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=zOcQi7qN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id z9-20020a056a001d8900b006cbf67abff9si9723920pfw.269.2023.11.28.01.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 01:13:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=zOcQi7qN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 35772807E454; Tue, 28 Nov 2023 01:11:19 -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 S231179AbjK1JKz (ORCPT + 99 others); Tue, 28 Nov 2023 04:10:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234788AbjK1JKw (ORCPT ); Tue, 28 Nov 2023 04:10:52 -0500 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2445A1B6 for ; Tue, 28 Nov 2023 01:10:56 -0800 (PST) Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id AD0F96E; Tue, 28 Nov 2023 10:10:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1701162654; 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=Ntqosi7UP2Do89QUaBtdH8dZHNZj7id7/4zX8GPlxF8=; b=zOcQi7qNp1g5i9Qydg1AuVFUJop7+nVIWhEfUCPeV3UeX/eYsQnjWILQVfO4bixDYqSwlt QEW4MONYK0AidoQy/cgHai6l5xrd1J8Ah8lcoEE+a2/tg7kVT0NGsOBzTfg8J/pfyTVTlD 7jUKDNKRvTtk2IhRIkrhHLnm4kWaYnDfYckvr6gitOyHkasvUGL+mXi1A/EEQRfmzeVMcq 8M0SNXQren7mQrlWTafTUJBQuds7vxfXVDSfGCL17e+lCFSZisusSWz0Lh9qnGt2qeBnay FBHA2zgvDxUROf/Y61tV8CXKhkv47bcNPELJ1icUXlmpRgWbHltFYq2n82qXkA== MIME-Version: 1.0 Date: Tue, 28 Nov 2023 10:10:54 +0100 From: Michael Walle To: Miquel Raynal 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 In-Reply-To: <20231128100313.3c990f69@xps-13> References: <20231127165908.1734951-1-tudor.ambarus@linaro.org> <42c96d63d1ea4f7e8f16a3c8eb0a4cf1@walle.cc> <20231128100313.3c990f69@xps-13> Message-ID: <18ba4126dbd9e49846344b517ad2fbdd@walle.cc> X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit 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:11:19 -0800 (PST) Hi, >> > 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. >> > >> > Signed-off-by: Tudor Ambarus >> > >> > --- >> > drivers/mtd/spi-nor/core.c | 19 ------------------- >> > 1 file changed, 19 deletions(-) >> > >> > 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); >> > >> > - dev_info(dev, "%s (%lld Kbytes)\n", info->name, >> > - (long long)mtd->size >> 10); >> >> 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. Also with recent (or planned, dunno the current state) printk won't wait anymore for the slowest console. I really don't have a strong opinion, either dev_info(jedec_id) or dev_dbg(jedec_id). Whatever Tudor prefers. >> > - dev_dbg(dev, >> > - "mtd .name = %s, .size = 0x%llx (%lldMiB), " >> > - ".erasesize = 0x%.8x (%uKiB) .numeraseregions = %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 = 0; i < mtd->numeraseregions; i++) >> > - dev_dbg(dev, >> > - "mtd.eraseregions[%d] = { .offset = 0x%llx, " >> > - ".erasesize = 0x%.8x (%uKiB), " >> > - ".numblocks = %d }\n", >> > - i, (long long)mtd->eraseregions[i].offset, >> > - mtd->eraseregions[i].erasesize, >> > - mtd->eraseregions[i].erasesize / 1024, >> > - mtd->eraseregions[i].numblocks); >> > return 0; >> >> Part of this is already available through the spi-nor debugfs, >> although not >> 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. Good point. Just curious, do you know any boards which has the rootfs writable on the spi-nor flash? -michael