Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43FE9C4332F for ; Wed, 13 Dec 2023 08:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:Cc:To:From :Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QYF0RbBLa58R1Jo7ionUrZTuVowbva58UmE+VVYl7RY=; b=F1XgnU1GrKAIGk2U6GddsczALU Az1NtQ8XO54+sIPzezqTpfrO00S8N5IB6Xu9G7pIKCytFOlOV4lZJgbOyoPdusVCzT/UaRVjAj1qd Qi5O0r4xIgAsZ8Dhd4dqGOATjTAH5GF1A1d7cjvXfRCvtOCMgyg3Wd72KFWo0E84xTkvZtAfgpLfP Qdw96EOvw/9oZWtWmiRjiTeBKTWWRCzTxkDPGTnlzcYSDjZF5Nh1lokHbWrZK3ciJnR1X5Jf5jPYQ Io+GOfH4gjcBBAM9hK71/gVf2z9LYaYJ0B79oclyfgyWWOa8RHPJJrx8oFNRYLrWHrO4TojL4GzD0 ux4t79vA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDKus-00E4yX-0O; Wed, 13 Dec 2023 08:48:30 +0000 Received: from 0001.3ffe.de ([2a01:4f8:c0c:9d57::1] helo=mail.3ffe.de) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rDKup-00E4xS-21 for linux-mtd@lists.infradead.org; Wed, 13 Dec 2023 08:48:29 +0000 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 6EA653B9; Wed, 13 Dec 2023 09:48:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1702457302; 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=800cGXvAiNL2XA7CFvqxlnAOis/gWgEB164ThkoQhhc=; b=RYgQsk1JmeBj7n2vEuZdgfYwz7F+XtlMdVOUvBxyAh3jhhV5O2xpraEGRiLjivi5QEMEEd ddgr8ws00iVWh5WJmbkdG8mYeRvsWc4IyAn0w83um+geQ6Ur2RI+UAp1SOas6fYh76tIJN nKH43TrAMjMBpcw1WPQDucZMNatO2W06JoquYt8N4vpzVj1nS1giHkcKl3KJfStMNKx23P fnsorFybeM7azOjXQWCATLblI8dLFBOZkDQlHTGvGTBgIWlVNWvh8rtw+2e2OB8xkmgL51 JB2WkuZT9Xd91RaHm7kJwP4LazoARRBs6eaGxTltaXp8K8K76asJH/ckzfxX/w== MIME-Version: 1.0 Date: Wed, 13 Dec 2023 09:48:22 +0100 From: Michael Walle To: liao jaime Cc: linux-mtd@lists.infradead.org, tudor.ambarus@linaro.org, pratyush@kernel.org, miquel.raynal@bootlin.com, leoyu@mxic.com.tw, jaimeliao@mxic.com.tw Subject: Re: [PATCH] mtd: spi-nor: core: Introduce spi_nor_abort_octal_dtr() In-Reply-To: References: <20231207075147.21851-1-jaimeliao.tw@gmail.com> Message-ID: X-Sender: michael@walle.cc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231213_004827_827639_716EE02F X-CRM114-Status: GOOD ( 11.62 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org Hi, >> To me it seems, that spi_nor_select_{read,pp,erase}() will select >> the wrong commands/proto. So it should be fixed there. Probably >> shared_mask is wrong. > Features in shared_mask have include 2 parts as below. > 1. Flash support the feature (by parse SFDP or ID table flags) > 2. spi host controller support the feature (In > spi_nor_spimem_adjust_hwcaps) > > But I think Octal DTR is a special case because, in addition to the 2 > points > mentioned above, there are also other conditions that need to be met. Correct. And btw we would have the same problem for quad_enable if we wouldn't have a default. So in spi_nor_default_setup() I'd suggest to add something along if (!nor->quad_enable) shared_mask &= ~SNOR_HWCAPS_4_4_4; /* skip octal command mode if we don't have a .octal_enable callback */ if (!nor->octal_enable) shared_mask &= ~SNOR_HWCAPS_8_8_8; #define SNOR_HWCAPS_4_4_4 (SNOR_HWCAPS_READ_4_4_4 | SNOR_HWCAPS_PP_4_4_4) etc. > My goal is to enable Octal DTR mode for Octal flashes listed in ID > table. > For those not in ID table, choosing spi_nor_generic should allow > selecting > either 1-1-8 protocol or, at the very least, 1-1-1 protocol. That's understood. -michael ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/