Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2178022ybd; Mon, 24 Jun 2019 02:03:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmW0LJjIBx06yYebf+1T7DUSgaoigJ1dYOSgNJkCRoLZjYKdtOhcKTLb67sM808pXk/DPa X-Received: by 2002:a17:902:a411:: with SMTP id p17mr22765779plq.104.1561366981147; Mon, 24 Jun 2019 02:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561366981; cv=none; d=google.com; s=arc-20160816; b=EQlr65kXD/H48z/BbphzStB3/p2OxEFS8qjh9N6MDjI1xq05qzovNDHBrta7vXjLEH 2HnBMpKywU81oPIuVVCttSyBCAAYva3Uz1btIl7oIxBFKiI3SUgeQc/TX8qtGYaRIi3I GZA1VuFyGleTLXgq6+Lyl3Q8U1/buS0FocF8LU8fvPafuZPqcIAmXSoicqgFCASNBoHy Lx7JWXNXXq56j4Sq6kqewdzjMXShPARwWNEfbxr8R2fbpxA0hwr0Xgpk1NjUrcpEiqAQ 8+bss2Y9W8x2jfgGhrQkPek+Q91y+uGMDk36p1gvMWsER70ZopCf3FE8y00/O481RyEG MZig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:from:message-id:mime-version:subject :cc:to:references:in-reply-to; bh=/lpqBbv60ilaM3IUts+L43m9OUcFnsAVPVTLOo9gP2Q=; b=OhDog5CajhQFJCGt3B0MBNWpsVbiREqKLpPQ1pVt9QjcxJPXKSZojWgMPyGhHqI+FW v6EW5K0PeehEQ0hd8EAd/M1A8UrYaASSroc4aqmycRErPoFWRWai5AsqnbMWHwf3BRf2 TzWeEBn3V3iBv4KVfFTt9u1e5ld6fEpTjwov5m93RhYSebamwMnSfqdbsVSM76QMfkNg EgxXgEjJT+KH+y1/3RFurkpC4JbtIZx1zX9MFXb4TW9DX/5dxc1Go3g49YUY1gWFza1C +1Wzf3Yl5SOX+SU5/iOh0cltQ37LsbglTrskp8Kgl0/+p4HiIlND+PnsEnN8Q7d7HIYc VWjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8si9379245plr.291.2019.06.24.02.02.44; Mon, 24 Jun 2019 02:03:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727270AbfFXIzv (ORCPT + 99 others); Mon, 24 Jun 2019 04:55:51 -0400 Received: from twhmllg4.macronix.com ([122.147.135.202]:39564 "EHLO TWHMLLG4.macronix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725916AbfFXIzv (ORCPT ); Mon, 24 Jun 2019 04:55:51 -0400 Received: from twhfmnt1.mxic.com.tw (twhfm1p2.macronix.com [172.17.20.92]) by TWHMLLG4.macronix.com with ESMTP id x5O8te4j092345; Mon, 24 Jun 2019 16:55:40 +0800 (GMT-8) (envelope-from masonccyang@mxic.com.tw) Received: from MXML06C.mxic.com.tw (mxml06c.mxic.com.tw [172.17.14.55]) by Forcepoint Email with ESMTP id 61692E8312812FC0B8BA; Mon, 24 Jun 2019 16:55:41 +0800 (CST) In-Reply-To: <20190619110643.523c1f56@collabora.com> References: <1555320234-15802-1-git-send-email-masonccyang@mxic.com.tw> <20190512151820.4f2dd9da@xps13> <20190520142333.390091d5@xps13> <20190527144250.71908bd9@xps13> <20190617143510.4ded5728@xps13> <20190618081436.5d488320@collabora.com> <20190618092901.3bdd9f61@collabora.com> <20190619101519.391919ec@collabora.com> To: "Boris Brezillon" Cc: bbrezillon@kernel.org, broonie@kernel.org, christophe.kerello@st.com, computersforpeace@gmail.com, devicetree@vger.kernel.org, dwmw2@infradead.org, geert@linux-m68k.org, juliensu@mxic.com.tw, lee.jones@linaro.org, liang.yang@amlogic.com, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, marcel.ziswiler@toradex.com, marek.vasut@gmail.com, mark.rutland@arm.com, "Miquel Raynal" , paul.burton@mips.com, richard@nod.at, robh+dt@kernel.org, stefan@agner.ch, zhengxunli@mxic.com.tw Subject: Re: [PATCH v3 2/4] mtd: rawnand: Add Macronix MX25F0A NAND controller MIME-Version: 1.0 X-KeepSent: C97D5691:B26644D3-48258423:002F8D47; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3FP4 SHF90 June 10, 2013 Message-ID: From: masonccyang@mxic.com.tw Date: Mon, 24 Jun 2019 16:55:41 +0800 X-MIMETrack: Serialize by Router on MXML06C/TAIWAN/MXIC(Release 9.0.1FP10 HF265|July 25, 2018) at 2019/06/24 PM 04:55:41, Serialize complete at 2019/06/24 PM 04:55:41 Content-Type: text/plain; charset="US-ASCII" X-MAIL: TWHMLLG4.macronix.com x5O8te4j092345 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, > > > > > Re: [PATCH v3 2/4] mtd: rawnand: Add Macronix MX25F0A NAND > > controller > > > > > > > > > > On Tue, 18 Jun 2019 08:14:36 +0200 > > > > > Boris Brezillon wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > How to make all #CS keep high for NAND to enter > > > > > > > > > > > low-power standby mode if driver don't use > > > > "legacy.select_chip()" > > > > > > > ? > > > > > > > > > > > > > > > > > > > > See commit 02b4a52604a4 ("mtd: rawnand: Make > > ->select_chip() > > > > > > > optional > > > > > > > > > > when ->exec_op() is implemented") which states: > > > > > > > > > > > > > > > > > > > > "When [->select_chip() is] not implemented, the > > core > > > > is > > > > > > > assuming > > > > > > > > > > the CS line is automatically asserted/deasserted by the > > > > > > driver > > > > > > > > > > ->exec_op() implementation." > > > > > > > > > > > > > > > > > > > > Of course, the above is right only when the controller > > driver > > > > > > > > > > > supports > > > > > > > > > > the ->exec_op() interface. > > > > > > > > > > > > > > > > > > Currently, it seems that we will get the incorrect data and > > > > > > error > > > > > > > > > operation due to CS in error toggling if CS line is > > controlled > > > > in > > > > > > > > > ->exec_op(). > > > > > > > > > > Oh, and please provide the modifications you added on top of this > > patch. > > > > > Right now we're speculating on what you've done which is definitely > > not > > > > > an efficient way to debug this sort of issues. > > > > > > > > The patch is to add in beginning of ->exec_op() to control CS# low and > > > > > > before return from ->exec_op() to control CS# High. > > > > i.e,. > > > > static in mxic_nand_exec_op( ) > > > > { > > > > cs_to_low(); > > > > > > > > > > > > > > > > cs_to_high(); > > > > return; > > > > } > > > > > > > > But for nand_onfi_detect(), > > > > it calls nand_read_param_page_op() and then nand_read_data_op(). > > > > mxic_nand_exec_op() be called twice for nand_onfi_detect() and > > > > driver will get incorrect ONFI parameter table data from > > > > nand_read_data_op(). > > > > > > And I think it's valid to release the CE pin between > > > read_param_page_op() (CMD(0xEC)+ADDR(0x0)) and read_data_op() (data > > > cycles) if your chip is CE-dont-care compliant. So, either you have a > > > problem with your controller driver (CS-related timings are incorrect) > > > or your chip is not CE-dont-care compliant. > > > > Understood, I will try to fix it on my NFC driver. > > Before you do that, can you please try to understand where the problem > comes from and explain it to us? Hacking the NFC driver is only > meaningful if the problem is on the NFC side. If your NAND chip does > not support when the CS pin goes high between read_param_page_op() and > read_data_op() the problem should be fixed in the core. I think I have fixed the problem and the root cause is the our NFC's TX FIFO counter do a unnecessary reset in CS control function. Our NFC implement read-write buffer transfer to send command, address and data. A unnecessary reset to TX FIFO will send a command byte out first and this extra command will make something wrong to next operation. For now, doing CS# control in ->exec_op() is OK to me. thanks & best regards, Mason CONFIDENTIALITY NOTE: This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation. Macronix International Co., Ltd. ===================================================================== ============================================================================ CONFIDENTIALITY NOTE: This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation. Macronix International Co., Ltd. =====================================================================