Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5918597rwd; Mon, 5 Jun 2023 10:13:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5P+RvHJvWL+7aaHUJ7gu0AGED8czZyP3YzIZX53TqNwl25pWw7jasgjX5/479WWtUCANBP X-Received: by 2002:a05:6a20:430d:b0:110:6146:1056 with SMTP id h13-20020a056a20430d00b0011061461056mr9397418pzk.2.1685985190516; Mon, 05 Jun 2023 10:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685985190; cv=none; d=google.com; s=arc-20160816; b=ubOOKrcM/jBaoVbZm35cYIycAsI4PBJ2lHodJ4SsCjJuYU2r/NQu0ZG1ZMEZfYKQOc u/mYkR/bG0tNnwe/2nlt1f3uMGfzOKy/MTlpmxZqsn7AnzJ20InVtnuG96lBAOgqlxCI 5FDQ1Yfuaevnfwdrcx+Amx2gIVGamr3o4v5+JUEOZvhNRkUSg+K2ryLX+rtGFdGtv5Lx 9TDVmzL479fFIQEeKNKTTsMzW1rmFMRCkLyUvNvW52/mYShXFJ1xcv3PBioWbwnYVHB6 PT3zXp3D4/547J6fSpneMmYaHyauK8Ks9qFT3xnlD2Rg6Hgdb4EXsyFWEY2srd5gWrXV w+Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=x+1qHC0v4b7AQgdBgAH1V4V1aQW5KU1oALYhRBo8Ldg=; b=anz5VVvj0982j3r9zYArgCE0BAej7oIQI17HTGNm6aWlSp8M5ScPTfGR0W6Zjo/Kns Q686qYESml7UAgIZnUvsSCbZzkr63YivGCIZ6B1Uk/JEuAQaV+OYhUzn5rWr7lrqISce AdabUTjB6GWWEdQGVvZdKIIVwV/1Szr2oqQ3NOiKv2VV0kcu6pG8Yxs/xOFPtTTzkG7P LjOUa2IwFC1+aumVpKF2XZu8kItuHSqbuv3O3dqW2yAMzY1c+BeH5CzlAVSjcriQX2J+ 1yxfQ8ioG5t32zA0gf2Vb/PydksaMZGTulURn2vWmX3uY3wJTwh7amcxJSvM3dji+0s1 cuXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b="szx0Wa+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q78-20020a632a51000000b0053ff4eea2fdsi5568282pgq.352.2023.06.05.10.12.54; Mon, 05 Jun 2023 10:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b="szx0Wa+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235084AbjFERDW (ORCPT + 99 others); Mon, 5 Jun 2023 13:03:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235109AbjFERDU (ORCPT ); Mon, 5 Jun 2023 13:03:20 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 284BAF4 for ; Mon, 5 Jun 2023 10:02:57 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id E17AB5FD20; Mon, 5 Jun 2023 20:02:55 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1685984575; bh=x+1qHC0v4b7AQgdBgAH1V4V1aQW5KU1oALYhRBo8Ldg=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; b=szx0Wa+/T+P+pgW/v719qCHdQla1J6fdYiEPy8CnaFRJBfN6Y3fKTQGrfNeK9Emut T0pIsV1dVy+ClkyXlrgP6FJseHwWB79w1jjkhF2UB2iLT6UecHcbcA8t7Y9AfGHUsR 71DM4KKQyUuJiVfsrnfJE4v9zL4yBcQGpRvw+VnZhLWYBX0tpKF71GzEY5jkZyTBtd NXD/KNzwGWLCbGCePdgs54gNzIwb63POmEJNqQeEnEuLjBsg75cDNwmeUqG2auBPJ5 r+aqeq7WRtoAgU5Niyor+JjNCtHLx6Q511S70muXH/36ZhogpNNNoEFEKEfRfz3K5n YQz/d5LnMK37A== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 5 Jun 2023 20:02:53 +0300 (MSK) Message-ID: Date: Mon, 5 Jun 2023 19:58:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [RFC PATCH v5 2/6] mtd: rawnand: meson: wait for command in polling mode Content-Language: en-US To: Liang Yang , Miquel Raynal CC: Richard Weinberger , Vignesh Raghavendra , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , , , , , , References: <20230601061850.3907800-1-AVKrasnov@sberdevices.ru> <20230601061850.3907800-3-AVKrasnov@sberdevices.ru> <20230601100751.41c3ff0b@xps-13> <9e106d50-2524-c999-48b1-a20760238aaf@sberdevices.ru> <20230605110546.6cb00a8d@xps-13> <2a755783-1d56-9842-2eee-b5ab41152c81@amlogic.com> <163e0684-caff-77d0-1eaf-9a58290c200d@amlogic.com> From: Arseniy Krasnov In-Reply-To: <163e0684-caff-77d0-1eaf-9a58290c200d@amlogic.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/06/05 13:50:00 #21435193 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.06.2023 16:30, Liang Yang wrote: > > > On 2023/6/5 21:19, Liang Yang wrote: >> Hi Miquel and Arseniy, >> >> >> On 2023/6/5 17:05, Miquel Raynal wrote: >>> [ EXTERNAL EMAIL ] >>> >>> Hi Arseniy, >>> >>>>>> @@ -1412,6 +1419,8 @@ static int meson_nfc_probe(struct platform_device *pdev) >>>>>>             return ret; >>>>>>     } >>>>>> >>>>>> +  nfc->use_polling = of_property_read_bool(dev->of_node, "polling"); >>>>> >>>>> This is a problem. You cannot add a polling property like that. >>>>> >>>>> There is already a nand-rb property which is supposed to carry how are >>>>> wired the RB lines. I don't see any in-tree users of the compatibles, I >>>>> don't know how acceptable it is to consider using soft fallback when >>>>> this property is missing, otherwise take the values of the rb lines >>>>> provided in the DT and user hardware control, but I would definitely >>>>> prefer that. >>>> >>>> I see. So i need to implement processing of this property here? And if it >>>> is missed -> use software waiting. I think interesting thing will be that: >>>> >>>> 1) Even with support of this property here, I really don't know how to pass >>>>     RB values to this controller - I just have define for RB command and that's >>>>     it. I found that this property is an array of u32 - IIUC each element is >>>>     RB pin per chip. May be i need to dive into the old vendor's driver to find >>>>     how to use RB values (although this driver uses software waiting so I'm not >>>>     sure that I'll find something in it). >>> >>> Liang, can you please give use the relevant information here? How do we >>> target RB0 and RB1? It seems like you use the CS as only information >>> like if the RB lines where hardwired internally to a CS. Can we invert >>> the lines with a specific configuration? >> >> Controllor has only one external RB pinmux (NAND_RB0). all the RB pins >> of different CEs need to be bound into one wire and connect with >> NAND_RB0 if want to use controller polling rb. the current operating >> CE of NAND is decided to "chip_select", of course controller internally has different nfc commands to regconize which Ce's RB signal is polling. >> >> <&nand_pins> in dts/yaml should include the NAND_RB0 if hardware connects, or use software polling here. >> >> @Arseniy, sorry, i don't travel all the informations yet. but why don't you use the new RB_INT command with irq that i provided in another thread. the new RB_INT command doesn't depend on the physical RB wires, it also send the READ status command(0x70) and wait for the irq wake up completion. Technically no problem! I can use new RB_INT instead of 'nand_soft_waitrdy()' as software fallback, and currently implemented RB_INT as interrupt driven way. What do You think Miquel ? > > Use "nand-rb" in dts to decide old RB_INT(physical RB wires is needed) or new RB_INT(no physical RB wires). the new RB_INT command decides the RB0 or RB1 by the previous command with ce args. > So I can implement "nand-rb" in dts as boolean value - "false" or missing means use "no physical RB wires", "true" - means use "physical RB wires" ? Thanks, Arseniy >> >>> Arseniy, if the answer to my above question is no, then you should >>> expect the nand-rb and reg arrays to be identical. If they are not, >>> then you can return -EINVAL. >>> >>> If the nand-rb property is missing, then fallback to software wait. >>> >>>> 2) I can't test RB mode - I don't have such device :( >>>> >>>> Also for example in arasan-nand-controller.c parsed 'nand-rb' values are used >>>> in controller specific register for waiting (I guess Meson controller has something >>>> like that, but I don't have doc). While in marvell_nand.c it looks like that they parse >>>> 'nand-rb' property, but never use it. >>> >>> Yes, the logic around the second RB line (taking care of CS1/CS3) is >>> slightly broken or at least badly documented, and thus should not be >>> used. >>> >>>>> In any case you'll need a dt-binding update which must be acked by >>>>> dt-binding maintainers. >>>> >>>> You mean to add this property desc to Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml ? >>> >>> Yes. In a dedicated patch. Something along the lines: >>> >>>          nand-rb: true >>> >>> inside the nand chip object should be fine. And flag the change as a >>> fix because we should have used and parsed this property since the >>> beginning. >>> >>> Thanks, >>> Miquèl