From patchwork Mon Nov 27 10:07:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1868697 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=MFwzt0xm; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=X+wVEoGG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sf1Wb1J1gz23m6 for ; Mon, 27 Nov 2023 21:08:43 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S6+e0rbkYuw8Oc4jBlvI8JyT0JmejcH00x09gc1mLrk=; b=MFwzt0xmD4N9Ut bQ41fa5xigpZjfh/wHC8ygr5UoU8uCuKGcld99LZ66La2M9U11kNptQz2MJLQrusOwYGopeqerwmO 4aNOjzCgcsGT+EP3bQ8ZkoA7tmrTjXlttHC/U+JlqIvGWqbjpSwn4Wc6Y22Ia2eQEULAVu6DnuVaT N9KksSuwdEGMxI9zxRTcDc0ToMHJrYtcH/pxZ1SqqFRHt/viuSj8EiZHMDHtVa5RCz4oidwWR1mkA o2gta667mXzAuuuOKz3wASxOrFKAcNAI7rnSrZprW06WpV86bCrhHKM8yXRdvOGLc0bR1kNEJttyx eb38ZZz3ZsALuO5S/1nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r7YXF-00228N-2M; Mon, 27 Nov 2023 10:08:13 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r7YXC-002277-3B for linux-mtd@lists.infradead.org; Mon, 27 Nov 2023 10:08:12 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3b837d974ecso2498625b6e.2 for ; Mon, 27 Nov 2023 02:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701079688; x=1701684488; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vAliyeR2O2MXLT9YmjXFeOCnSHaJBvWvut6DOEGh/OU=; b=X+wVEoGGR4S8DN7h05zIrRtvGUqO7o9CoOiTEZvVlzDPafJQb6e8G1NOsGakmQw0wH 7HkzTkRnETPTtv+ogLClB0KL4oOD8Fh4GBXM+dqnxBzbW5ofaHXbNt18Q3myXOcPDFV3 iP4UCfg+aL5MBp6Igse3HRuBpcz5QaEtdVbsh1M3hfiad+qcbpkis1KR4ln4ydQqJXBO uN5lEemMCf3Hk/NW7Mdjxqnv1QzUvY0uTILmsYWmGNXfmhP0DqT4F0aGilr/dcmED01W WhGwnJS8mg4gZ/24u4BiWDZcJB44UR2OLMKPynjW730j+B4nt7G7ztby5q7Uu/kmTyjn 7doA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701079688; x=1701684488; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vAliyeR2O2MXLT9YmjXFeOCnSHaJBvWvut6DOEGh/OU=; b=OTarGDkeVC4JlHaEv7WqnZGXtIb+ht3hbiyCV4aUVZOj4zT344fohn+qAf+94IqmBS TCjMHejPAp3GYt86qgl44xKMakCU4qaUK8cV3zhntG9mN4DZ6LFE7aT8w3PyP6fps1pq YSLT8fjgTAAdsDgGAsm6nkXogxF2bIBR/Y5Eb5yT/9MWQ00/782KBDVger3U7tDigVMd ZiQQFgCqVWI2gYMulkdK3bYMj9o5tt8mehSVM0jNoo7ZAT1hwaif0lagMi607avNY9zb 1jlgrbveDF/H6HwKdzh4AwOoXRYlQCrJYuo70RebnTjKzHDiswtMZGZTFBKhrI4qHkmp C7Ig== X-Gm-Message-State: AOJu0YzsEWHDjjNEUDj6SZ5XZfg/0MckIdL+VKw0fcCAYEkhm1dOGAVk 3V9bWbPzlFsy+imeIJfYQYY= X-Google-Smtp-Source: AGHT+IE7I/mnxAc7ivYFEtgszizN0Tp1cJ75wpwJC1mBCa3aojtGoiwtPbItvDk47K5pY1F8Pvi/Xw== X-Received: by 2002:a05:6870:9e8a:b0:1f9:67db:2d51 with SMTP id pu10-20020a0568709e8a00b001f967db2d51mr15439321oab.31.1701079688461; Mon, 27 Nov 2023 02:08:08 -0800 (PST) Received: from twhmp6px (mxsmtp211.mxic.com.tw. [211.75.127.162]) by smtp.gmail.com with ESMTPSA id a6-20020aa780c6000000b006c5da6411b9sm6851630pfn.101.2023.11.27.02.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 02:08:08 -0800 (PST) Received: from hqs-appsw-appswa2.mp600.macronix.com (linux-patcher [172.17.236.35]) by twhmp6px (Postfix) with ESMTPS id CEC3A80527; Mon, 27 Nov 2023 18:07:50 +0800 (CST) From: Jaime Liao To: linux-mtd@lists.infradead.org, tudor.ambarus@linaro.org, pratyush@kernel.org, michael@walle.cc, miquel.raynal@bootlin.com Cc: leoyu@mxic.com.tw, jaimeliao@mxic.com.tw Subject: [PATCH v1 1/2] mtd: spi-nor:sysfs: hide flash name if it is not set Date: Mon, 27 Nov 2023 18:07:53 +0800 Message-Id: <20231127100756.41605-2-jaimeliao.tw@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231127100756.41605-1-jaimeliao.tw@gmail.com> References: <20231127100756.41605-1-jaimeliao.tw@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231127_020811_040962_27137DFC X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: JaimeLiao The info->name may be optional when flash ID founded in ID table but didn't include flash name. Signed-off-by: JaimeLiao --- Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor | 3 +++ drivers/mtd/spi-nor/sysfs.c | 2 ++ 2 files changed, 5 insertions(+) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:234 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jaimeliao.tw[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: JaimeLiao The info->name may be optional when flash ID founded in ID table but didn't include flash name. Signed-off-by: JaimeLiao --- Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor | 3 +++ drivers/mtd/spi-nor/sysfs.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor b/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor index c800621eff95..6d7be97bf7d1 100644 --- a/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor +++ b/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor @@ -25,6 +25,9 @@ KernelVersion: 5.14 Contact: linux-mtd@lists.infradead.org Description: (RO) Part name of the SPI NOR flash. + The attribute is not present if the jedec_id founded in + ID table but flash name didn't include in it. + What: /sys/bus/spi/devices/.../spi-nor/sfdp Date: April 2021 diff --git a/drivers/mtd/spi-nor/sysfs.c b/drivers/mtd/spi-nor/sysfs.c index 2dfdc555a69f..96064e4babf0 100644 --- a/drivers/mtd/spi-nor/sysfs.c +++ b/drivers/mtd/spi-nor/sysfs.c @@ -78,6 +78,8 @@ static umode_t spi_nor_sysfs_is_visible(struct kobject *kobj, if (attr == &dev_attr_manufacturer.attr && !nor->manufacturer) return 0; + if (attr == &dev_attr_partname.attr && !nor->info->name) + return 0; if (attr == &dev_attr_jedec_id.attr && !nor->info->id && !nor->id) return 0; From patchwork Mon Nov 27 10:07:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1868696 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=oUAItppr; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=IvjxByoV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sf1WZ6j9sz1ySP for ; Mon, 27 Nov 2023 21:08:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0wQN4//lATB+98o/bm6eDD7AIS++Xfg92wqIu8/Xpak=; b=oUAItppr3bExnT NSasmKHHqFWtVr3vNtBzRcQ8iPXa8hfKun5zoXQDNkw2t8i5/Vy5VB1PPVUbf/s9sGMWSTdbJYG2R OdOnz6vIvR66cXyrWIPPiZ4FXm4ePFOUPfW+/vIqtkOi9U5yxPgOYt7+VP1UbH0EHoVmL5yFdxIH/ qz6m65UP1tkzLDE+WY4uj/W7+bCK7rh2umVuNLDChf0QELUW8yK3uIhc2n2MPJsN4Eou0Gb+Bwutr P69MNL8fau8PeKh+8XV5dyHmA5+QNhWpnncxWSFEU4HYIzYXcbOLqDeiSXqkGkfCh1mrOPTdR9CCX VD4UlJxqCT4oRud3EONQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r7YXH-00228X-1K; Mon, 27 Nov 2023 10:08:15 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r7YXD-002278-1A for linux-mtd@lists.infradead.org; Mon, 27 Nov 2023 10:08:13 +0000 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-5bd33a450fdso2864977a12.0 for ; Mon, 27 Nov 2023 02:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701079689; x=1701684489; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MWNFfleF2FQ7tZjJiJmyGEaXMVhNA/SFCvRVCvCjQcg=; b=IvjxByoVrpgUHDFDkjuIkE/d1L7SUkmGjqeGABETAEPIiMUtR6r0IHzIdSAGZPxUcx qffvZ6buop69BXP+6Ew0QsvfQ9xqPTzHp+N0/aEl25dxee3r9SvoONZbs7wTs8Pxm3mU wvqzuUgMWqhUQucR/EMNNc1ucmO8qbNed1kYG8HHB+FtdECq96sjwwsD96aty49eR8Y9 LdlA1g0Uxv5VbkjIweXsWdM7J9iYeVQcdX2a8cM76DBGZLHTMCNFh9y/hI5ryo1TsqQp GDF84l8CbhL5a3xgLKbwI0/x3qzpYU4zMIiBogse7iBQ4UKOxZnw1frvDb3zNFwg7Ehv pypw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701079689; x=1701684489; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MWNFfleF2FQ7tZjJiJmyGEaXMVhNA/SFCvRVCvCjQcg=; b=Vn+i3S0U3TxOPDgtJONE55lPdD89UcvrJ9PQXo5uJcyV4vNkDAsf1R9iGGa2pf0Aiy fMtPl3n/CtHpFPIHgt4/kVijYM9V91ZCQM3zoKvWBQ6TXrpoBsJdAuEXi2abN3JbU3+L PNkaxAV6Y6zpJS8LqKIuV87Zo5xadC3eXKE097u2JEc48H2w9BHUHK+z8Kg/FTbapvpL Rc6mGmPAoAfnhzD+tZeW//rTuEz/XmOnzXrTk7HUPBpRRrwjwsSrhv+BV0tnyQfOWMRa cEV9SVAUMykxiyy1NgkdsfA4bIB7XYmuBQyC84rgkzttBqPIsvN3uWXHDppUcKDda8jz 8f9w== X-Gm-Message-State: AOJu0YzVM/BQB3L+dCDR8KtGP26/TM6QDVMZm1G3cByrQFynROl33AJZ LGqXChBH1YCLW9WSCsKoBtA= X-Google-Smtp-Source: AGHT+IGckNZduWWgdgXTdfPCitRHnaH8emJYsnzmWsCf+BFDQb9D/WkTY47y0FfWtMe9N3INb/VEVA== X-Received: by 2002:a05:6a21:788b:b0:18c:19e2:5735 with SMTP id bf11-20020a056a21788b00b0018c19e25735mr10124551pzc.54.1701079689335; Mon, 27 Nov 2023 02:08:09 -0800 (PST) Received: from twhmp6px (mxsmtp211.mxic.com.tw. [211.75.127.162]) by smtp.gmail.com with ESMTPSA id nl7-20020a17090b384700b00285cc7a867esm1474767pjb.0.2023.11.27.02.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 02:08:08 -0800 (PST) Received: from hqs-appsw-appswa2.mp600.macronix.com (linux-patcher [172.17.236.35]) by twhmp6px (Postfix) with ESMTPS id 72E968056D; Mon, 27 Nov 2023 18:07:51 +0800 (CST) From: Jaime Liao To: linux-mtd@lists.infradead.org, tudor.ambarus@linaro.org, pratyush@kernel.org, michael@walle.cc, miquel.raynal@bootlin.com Cc: leoyu@mxic.com.tw, jaimeliao@mxic.com.tw Subject: [PATCH v1 2/2] mtd: spi-nor: hide flash name when the flash name does not exist Date: Mon, 27 Nov 2023 18:07:54 +0800 Message-Id: <20231127100756.41605-3-jaimeliao.tw@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231127100756.41605-1-jaimeliao.tw@gmail.com> References: <20231127100756.41605-1-jaimeliao.tw@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231127_020811_398780_C05A488F X-CRM114-Status: GOOD ( 11.35 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: JaimeLiao (null) will print when flash ID founded in ID table but the flash name didn't include in it. Make info->name optional in the print for showing flash name and flash size. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jaimeliao.tw[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: JaimeLiao (null) will print when flash ID founded in ID table but the flash name didn't include in it. Make info->name optional in the print for showing flash name and flash size. Signed-off-by: JaimeLiao --- drivers/mtd/spi-nor/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 1c443fe568cf..73405bed2a5a 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3518,7 +3518,7 @@ 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, + dev_info(dev, "%s (%lld Kbytes)\n", info->name ?: "", (long long)mtd->size >> 10); dev_dbg(dev,