Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5703437ybp; Tue, 15 Oct 2019 03:52:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2dHmoTAkEuWwGtB+4yvK1TLQI8+suF2NpKIHWtmT5frs4pwFZdj1aR3JRWugGw04FKdhe X-Received: by 2002:aa7:dd18:: with SMTP id i24mr33664872edv.239.1571136764528; Tue, 15 Oct 2019 03:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571136764; cv=none; d=google.com; s=arc-20160816; b=gZLUZcSiciMNka1bplM0M9Q33DWV4XYagDPtnvR/zjL7L+2tNcecjAxn7NbeGk0mbn 2sr3AdNwzvyFuxRSDKwPsfpPdMvrXplk/lHQTuf4utvUcU+jcZR7UdQUtYLMBZHPfNK9 5ujwCfTEVUqLfNuTTvkvNcsWfpZKk5XNpoTgje8s1pgNMDodUdJ5gSaW8g7uBezguWaP xsQu29TXoy3zIrVRksBWSH7h3lXng4Y92aizgAz7hO8Q4FoORisqTs4FmSNgDoqTNGyG vPwQDNTtrCN0Mpq7RzWt7gBUOvaLfyXrIX7XtVAt5Jd6COsnOg5XokI4RwR9vJYi4w05 VfcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=5GW/A/MiFZBz9mcWHkLSCA+IPkvh7T94hD3Sz15vEiw=; b=r7G/ImFszlhIoyMIqnbQ+Wo6Y4+qhaOWzO3M9Ie7GvUlRNKqZ9M00Cxq+g+aDBzaHY 6aOBEWcpX0OKukTrxf0DxTtVOT87J2um8wx/Wv3mMTzrO20lR/2MQRlhfrYdXYTxy9uD NWnoSE5zgoLVftkIzvA3ht0cBWy7vs8hlRe+9/6rDEbIv6MbkvU2313Sjt3x+gwJUgAA ige0VxNelJTbxj2tiXpfhEckSxpo57yb9UqloF8KQMc7gri5urkJ0fRFmZd59CUHCyYu ZvL/6CRvVi4VPn4drl2hJz0qpEQ9UMkOQMmYXfn5uwEW2ypQeI1LcKCwIKqtJFom6gFL uC7w== 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 x17si12800838ejw.375.2019.10.15.03.52.21; Tue, 15 Oct 2019 03:52:44 -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 S1728267AbfJOH4q convert rfc822-to-8bit (ORCPT + 99 others); Tue, 15 Oct 2019 03:56:46 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:41503 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728236AbfJOH4q (ORCPT ); Tue, 15 Oct 2019 03:56:46 -0400 Received: from xps13 (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: miquel.raynal@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 3654324000D; Tue, 15 Oct 2019 07:56:37 +0000 (UTC) Date: Tue, 15 Oct 2019 09:56:37 +0200 From: Miquel Raynal To: masonccyang@mxic.com.tw Cc: "Boris Brezillon" , bbrezillon@kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org, frieder.schrempf@kontron.de, gregkh@linuxfoundation.org, juliensu@mxic.com.tw, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, marcel.ziswiler@toradex.com, marek.vasut@gmail.com, richard@nod.at, tglx@linutronix.de, vigneshr@ti.com Subject: Re: [PATCH RFC 3/3] mtd: rawnand: Add support Macronix power down mode Message-ID: <20191015095637.142e6db7@xps13> In-Reply-To: References: <1568793387-25199-1-git-send-email-masonccyang@mxic.com.tw> <1568793387-25199-3-git-send-email-masonccyang@mxic.com.tw> <20191007104501.1b4ed8ed@xps13> <20191008092832.54492696@dhcp-172-31-174-146.wireless.concordia.ca> Organization: Bootlin X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mason, masonccyang@mxic.com.tw wrote on Tue, 15 Oct 2019 10:33:29 +0800: > Hi Boris, > > > > > > > + nand_select_target(chip, 0); > > > > > > > > On several NAND controllers there is no way to act on the CS line > > > > without actually writing bytes to the NAND chip. So basically this > > > > is very likely to not work. > > > > > > any other way to make it work ? GPIO ? > > > or just have some comments description here. > > > i.e,. > > > > > > /* The NAND chip will exit the deep power down mode with #CS toggling, > > > > * please refer to datasheet for the timing requirement of tCRDP and > tRDP. > > > */ > > > > > > > Good luck with that. As Miquel said, on most NAND controllers > > select_target() is a dummy operation that just assigns nand_chip->target > > to the specified value but doesn't assert the CS line. You could send a > > dummy command here, like a READ_ID, but I guess you need CS to be > > asserted for at least 20ns before asserting any other signals (CLE/ALE) > > which might be an issue. > > okay, got it. > But if possible, I think adding CS line control in nand_select_target() > is a simple and generic way for MTD and all raw NAND controllers. The problem is not that we do not want to; the problem is that controllers are not capable of doing it reliably if no byte is sent over the NAND bus. Thanks, Miquèl