Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp272506pxx; Thu, 29 Oct 2020 02:09:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfa8GzJJyhgPkFzCoNuxBYs10dV8hrknDgKGhqv4ocrZhXmxaowg0oP7dyog7rkv0XpUva X-Received: by 2002:a17:907:435b:: with SMTP id oc19mr2946807ejb.311.1603962571495; Thu, 29 Oct 2020 02:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603962571; cv=none; d=google.com; s=arc-20160816; b=BpMWoAHewwTVO7+4lWFB+lcoo4ywxdxRxsNLMx7rfxlHL+YEUHVo1qe2N3IQMTGvrL DvE3TWucwBM97INwl96EqeYGePJK9pH5iMczhdQeyei8TcZfVi4uYHnEzS0ApNBfQiOA /BaJMXe1QK1kvEyKZlmeANdlcjf+1/UJ3bgbDOIP1/q6Puu3/NLp97voxYK0NtvCzELx 2iJ2H7xJ07j4xWytLZ3xX6jZOcJ1m5qRmHi2lVVjqDZ8xHokwita8j2Ku6W4kW6Tn/0R CiQRM1IsxErqvf3POzqrApTxA4A9iHiFUGXJ3kdkWOnUKVRe3IWYU8nVPc1er/M6waXA NhGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Otp61Qk4Ee3C+hPtckLhrjEHG5NzEtpbac7nrqOdf4I=; b=dc1hVH4lwu5h4LQ3g3ywZDMQx/udosDjqZElbw2UOJRrBmIHsnRBxvglmWiWvA8W3x TjBzIdMBDwPkgve1UrlPenDZVx45CaaHUYCa1pdw7lw91bWZZKWEkPkbU6rRj2EdU0G1 Z/Q+DLSV1se8sJ1xK9BIcUWW+k+yF/2k/aDjh/3aowFgPTdcZSVtCihQ0t9V+u3PHgfv kStSKSkvHIYa36XLH96E0+ZCdLfUl0lhOZIO4ZdJ7Daimc0TG/hWZZBaVgm+D7Ay5jOE dynM6sxg1NHi7rNXqq8Sb2SrdobL+ZsORWVvRinzDk0oJnrPN+RzwT8J0hh5alvjVD4z gUjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si554030edy.510.2020.10.29.02.09.09; Thu, 29 Oct 2020 02:09:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725980AbgJ2JH5 (ORCPT + 99 others); Thu, 29 Oct 2020 05:07:57 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:43464 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbgJ2JH4 (ORCPT ); Thu, 29 Oct 2020 05:07:56 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 35D211F458B8; Thu, 29 Oct 2020 09:07:54 +0000 (GMT) Date: Thu, 29 Oct 2020 10:07:51 +0100 From: Boris Brezillon To: Md Sadre Alam Cc: agross@kernel.org, bjorn.andersson@linaro.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, linux-arm-msm@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, sricharan@codeaurora.org Subject: Re: [PATCH 2/5] mtd: rawnand: qcom: Add initial support for qspi nand Message-ID: <20201029100751.713e27df@collabora.com> In-Reply-To: <1602307902-16761-3-git-send-email-mdalam@codeaurora.org> References: <1602307902-16761-1-git-send-email-mdalam@codeaurora.org> <1602307902-16761-3-git-send-email-mdalam@codeaurora.org> Organization: Collabora X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Sat, 10 Oct 2020 11:01:39 +0530 Md Sadre Alam wrote: > This change will add initial support for qspi (serial nand). > > QPIC Version v.2.0 onwards supports serial nand as well so this > change will initialize all required register to enable qspi (serial > nand). > > This change is supporting very basic functionality of qspi nand flash. > > 1. Reset device (Reset QSPI NAND device). > > 2. Device detection (Read id QSPI NAND device). Unfortunately, that's not going to work in the long term. You're basically hacking the raw NAND framework to make SPI NANDs fit. I do understand the rationale behind this decision (re-using the code for ECC and probably other things), but that's not going to work. So I'd recommend doing the following instead: 1/ implement a SPI-mem controller driver 2/ implement an ECC engine driver so the ECC logic can be shared between the SPI controller and raw NAND controller drivers 3/ convert the raw NAND driver to the exec_op() interface (none of this hack would have been possible if the driver was using the new API) Regards, Boris