Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4604756rdb; Tue, 12 Dec 2023 04:35:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5PtOGOlasXyFGSbbgLgivsHyJZdpTZ5zm3D1sIL4AvER8qkEfSFQt/FetzLzGrYeIXek8 X-Received: by 2002:a05:6a00:3090:b0:6ce:f632:3ca4 with SMTP id bh16-20020a056a00309000b006cef6323ca4mr2255784pfb.23.1702384518299; Tue, 12 Dec 2023 04:35:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702384518; cv=none; d=google.com; s=arc-20160816; b=ZUUqeM2HW/16mBkR3ePbGJjPIbbe0QSn674RAsBfvzZAivktoGDgVDxi2Ig3e/EVT5 x8LLvXSckfB8z19cH14MiGRxJtD0rBXMUqYC1uuP44dyR+KP9FCNRLNjJsJz/wEypgaW D0jnsUk7YlAUjfo5MSJwn+QH5dFtSz7DRUftTaJAsPiTZJye7v3B1ZZTawBpk3tpJ1Cu RxPPAZXB3XrRT3Y+TdtFy8e/fkKm1IxSI2D7CwgmwqcYZAhABAexgw7CafM6i5R42tsJ i1TrouwhBpbcdEGR7j8QOQPf+6mZrYgER0x0FO5Nks8ILSLLLMd/JGT0y6C1izoYgVGr 06Iw== 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=cVsH9JrMU+kTllg4YnT8PH24+guNEqb5IZwuUj2+thc=; fh=UfKF2ji1v6vZlgxjrRzCn58oPjoq0XZAYW6OaYM5Zy4=; b=fXbFn2ZcNZePdUlaeAUrmR3q2SJiwvJuSOXZasXLaA56l2qHIEzhRrnD3vog3oo23n 1rJ1JfJ8AEFtQ4UIVP7+nzg9OW6dafkNVUdkt4wR3DHoBj04Bu5lxQ9Ppoj5ft6ozEtE 4unGsXqdcReTlFAqlOmZDwnw8FnA8Fc7daay4A/we+ug/hOcaquzoWntIEsZq9VT6JYe 86xTFlWmnogXLT6Jyjjon9Y4vAHDuo5JGFecxGmHCoO8HWffg72MQu7WPSmnExWHfHrt nATzR47LNaD4z7olRneAa7YPj3Dk9kH8Wt5C6D1fRcGRUdvFv3251c/7ObtgkTwzCj/e IHKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=asEntrfs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id f14-20020a63100e000000b005c660a37af2si7929342pgl.255.2023.12.12.04.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 04:35:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=asEntrfs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 6E99F807E400; Tue, 12 Dec 2023 04:35:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346535AbjLLMeu (ORCPT + 99 others); Tue, 12 Dec 2023 07:34:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232539AbjLLMet (ORCPT ); Tue, 12 Dec 2023 07:34:49 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5100EB7; Tue, 12 Dec 2023 04:34:54 -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 BC3E071; Tue, 12 Dec 2023 13:34:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1702384491; 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=cVsH9JrMU+kTllg4YnT8PH24+guNEqb5IZwuUj2+thc=; b=asEntrfsJUlVGUOuVaMNcSEyWMez6f94TkJxrdnYBhrPGNP6VFg/a3sxhqR0hd1IkQZIWX EqnahLwu8JFqlCzFkksUj3ny6AojzvDwmyknQs29Xh7cB7yHi+iJ89NEu1LhvV8Llb1+zd wSkrrDAcq6FjbYIDRFEwzQOgl5BHZOONLlYylIO0zjx2ZQP9D+c5+gKcVTG3kvhZpLXqNY mKCdx5SMagAm+jyjxpETjDt5y/h48F5k1qY6TYvDLz163Po8UJjJYyzZiLbu8MikXffurA 7uVidvriQgkThLix3x5o1jZgUWuOoCZEU7OqZpUBVmiPBx3sNZmbF6Bg9ag2TA== MIME-Version: 1.0 Date: Tue, 12 Dec 2023 13:34:51 +0100 From: Michael Walle To: Amit Kumar Mahapatra Cc: broonie@kernel.org, tudor.ambarus@linaro.org, pratyush@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, sbinding@opensource.cirrus.com, lee@kernel.org, james.schulman@cirrus.com, david.rhodes@cirrus.com, rf@opensource.cirrus.com, perex@perex.cz, tiwai@suse.com, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev, michal.simek@amd.com, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-sound@vger.kernel.org, git@amd.com, amitrkcian2002@gmail.com Subject: Re: [PATCH v11 00/10] spi: Add support for stacked/parallel memories In-Reply-To: <20231125092137.2948-1-amit.kumar-mahapatra@amd.com> References: <20231125092137.2948-1-amit.kumar-mahapatra@amd.com> Message-ID: <30ffd8378d3ef1c4fa6dfe4324b18345@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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 12 Dec 2023 04:35:05 -0800 (PST) > This patch series updated the spi-nor, spi core and the AMD-Xilinx > GQSPI > driver to add stacked and parallel memories support. Honestly, I'm not thrilled about how this is implemented in the core and what the restrictions are. First, the pattern "if (n==1) then { old behavior } else { copy old code modify for n==2 }" is hard to maintain. There should be no copy and the old code shall be adapted to work for both n=1 and n>1. But I agree with Tudor, some kind of abstraction (layer) would be nice. Also, you hardcode n=2 everywhere. Please generalize that one. Are you aware of any other controller supporting such a feature? I've seen you also need to modify the spi controller and intercept some commands. Can everything be moved there? I'm not sure we are implementing controller specific things in the core. Hard to judge without seeing other controllers doing a similar thing. I'd like to avoid that. If we had some kind of abstraction here, that might be easier to adapt in the future, but just putting everything into the core will make it really hard to maintain. So if everything related to stacked and parallel memory would be in drivers/mtd/spi-nor/stacked.c, we'd have at least everything in one place with a proper interface between that and the core. -michael