From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) (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 A7B077E for ; Thu, 14 Jul 2022 21:52:02 +0000 (UTC) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id EEABB22238; Thu, 14 Jul 2022 23:51:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1657835518; 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=eUOOklFf429NJHGjFaL0HxFv89LnFvPtMIbNqZTM4d0=; b=HSkIfATqx+Z/1khW1hK+6puc0ECVGu02CCNcVyvWwwxFtkmNvepbMsWDMYOqDCJN9552/Q jpV5u9uj2zXqR6KVmUiRi6qnHalq2wx1hvKHbXfAZ7L5VYX18olHGeTivSo0mSj4iuktL4 opgvlduW4U0xYcytb9s/OnvmWHuLf7o= Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 14 Jul 2022 23:51:56 +0200 From: Michael Walle To: =?UTF-8?Q?Michal_Such=C3=A1nek?= Cc: linux-sunxi@lists.linux.dev, Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: Re: [PATCH 1/2] mtd: spi-nor: When a flash memory is missing do not report an error In-Reply-To: <20220714205529.GE17705@kitsune.suse.cz> References: <701967b0c418db333c66b48d225df60aa9d03ead.1657826188.git.msuchanek@suse.de> <20220714205529.GE17705@kitsune.suse.cz> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <33abf7b84860049c4a22605578303ff2@walle.cc> X-Sender: michael@walle.cc Am 2022-07-14 22:55, schrieb Michal Suchánek: > On Thu, Jul 14, 2022 at 09:41:48PM +0200, Michael Walle wrote: >> Hi, >> >> Am 2022-07-14 21:19, schrieb Michal Suchanek: >> > It is normal that devices are designed with multiple types of storage, >> > and only some types of storage are present. >> > >> > The kernel can handle this situation gracefully for many types of >> > storage devices such as mmc or ata but it reports and error when spi >> > flash is not present. >> > >> > Only print a notice that the storage device is missing when no response >> > to the identify command is received. >> > >> > Consider reply buffers with all bits set to the same value no response. >> >> I'm not sure you can compare SPI with ATA and MMC. I'm just speaking >> of >> DT now, but there, for ATA and MMC you just describe the controller >> and >> it will auto-detect the connected storage. Whereas with SPI you >> describe > > Why does mmc assume storage and SDIO must be descibed? Why the special > casing? I can't follow you here. My SDIO wireless card just works in an SD slot and doesn't have to be described. >> both the controller and the flash. So I'd argue that your hardware >> description is wrong if it describes a flash which is not present. > > At any rate the situation is the same - the storage may be present > sometimes. I don't think assuming some kind of device by defualt is a > sound practice. Where is the assumption when the DT tells you there is a flash on a specific chip select but actually there it isn't. Shouldn't the DT then be fixed? Maybe I don't understand your problem. What are you trying to solve? I mean this just demotes an error to an info message. > However, when the board is designed for a specific kind of device which > is not always present, and the kernel can detect the device, it is > perfectly fine to describe it. > > The alternative is to not use the device at all, even when present, > which is kind of useless. Or let the bootloader update your device tree and disable the device if it's not there? Or load an overlay if it is there? -michael