From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A2DDC7EE2E for ; Mon, 12 Jun 2023 19:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233493AbjFLTTP (ORCPT ); Mon, 12 Jun 2023 15:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230335AbjFLTTE (ORCPT ); Mon, 12 Jun 2023 15:19:04 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B423B0 for ; Mon, 12 Jun 2023 12:19:03 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-75d54faa03eso22223685a.1 for ; Mon, 12 Jun 2023 12:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686597542; x=1689189542; h=in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:from:to:cc:subject:date:message-id:reply-to; bh=bLK0Z6wcJdLdrE5mWg9KDy8duuwhqNJ88PLjSIZy0cw=; b=fuf8xROhKLN7FYzZj78C4/RgS4buo/xAVv44FGPnE+f/ZkGgbEh3fBVDpMiEOP3cam gW7NBjJaI+hTcJO/6IIBRNeK2fdRpq9wOac1RPKC4xTa2/yy008hZBQyqri4ujv4jGK2 k7rrBdPSLbfibaIGtvJpN0vGaRKO0H3Cbsw5c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686597542; x=1689189542; h=in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bLK0Z6wcJdLdrE5mWg9KDy8duuwhqNJ88PLjSIZy0cw=; b=M6s+gVXPODYi4E/+r5iNkPP1MRnKsPFbNZpv+n5z9TBXGvXy4kAIIGG/k62BSoS4Zo 5K95elxQjrycj+MhcHvfiSl9xdXIL8MT57hPqMkAwwNDXu4MBNPEwkZukKVxzGkyzpO9 68Qk0JgYxzdqlzp8JL+bGb2HI21jElXYp0oOZID9Kk+PxrE/VgS9EG6R9Jwp284f2dT2 q+erfoWAb/kN3m+QDyeq+JHvorvPBQbTRo3L1fHQi6YKD05RxKZovcOzlsIMp+TdCX0e QyJeJ2oYoUwjwt0iYFF3DAPGkHY7N9DGLq260v1Qg5V6bwS9doOhX0avUqMNuy23H6E0 SLtA== X-Gm-Message-State: AC+VfDy1erLcVacYXBYmEmp5Em3EtbQ9xuSYFRRdtfWXYqsbzeotx/Ew 37JuA9YcBOFXRX5oAMCka37z6w== X-Google-Smtp-Source: ACHHUZ7wHVg85VB5aDCqc6FINLuHDpJBbpgJe577f3y5yDgx1BV7L1KCQVR2S8bzyZyT0sPjX6o+7g== X-Received: by 2002:a05:620a:28c4:b0:760:97ef:cf5b with SMTP id l4-20020a05620a28c400b0076097efcf5bmr2523039qkp.49.1686597542116; Mon, 12 Jun 2023 12:19:02 -0700 (PDT) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id g10-20020a05620a13ca00b007606a26988dsm1435515qkl.73.2023.06.12.12.18.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2023 12:19:00 -0700 (PDT) Subject: Re: [PATCH 10/12] mtd: rawnand: brcmnand: Add BCMBCA read data bus interface To: Miquel Raynal Cc: Broadcom Kernel List , Linux MTD List , f.fainelli@gmail.com, rafal@milecki.pl, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, computersforpeace@gmail.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, linux-kernel@vger.kernel.org, Vignesh Raghavendra , Richard Weinberger , Kamal Dasu , linux-arm-kernel@lists.infradead.org References: <20230606231252.94838-1-william.zhang@broadcom.com> <20230606231252.94838-11-william.zhang@broadcom.com> <20230607102232.17c4a27b@xps-13> <7b393f47-4053-a8c7-f32e-3881d8130d80@broadcom.com> <20230608081821.1de5a50b@xps-13> <4ab08e3e-3be4-8b8b-6eb8-03a62337f46f@broadcom.com> <20230609103544.0f00f799@xps-13> <3d3b471b-c555-ee1c-96d6-c04d76979e76@broadcom.com> <20230612194908.5465bc56@xps-13> <20230612195305.4b097c46@xps-13> From: William Zhang Message-ID: Date: Mon, 12 Jun 2023 12:18:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20230612195305.4b097c46@xps-13> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000065831905fdf39765" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000065831905fdf39765 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit On 06/12/2023 10:53 AM, Miquel Raynal wrote: > Hello again, > >>>>>>>> Perhaps we could have a single function that is statically assigned at >>>>>>>> probe time instead of a first helper with two conditions which calls in >>>>>>>> one case another hook... This can be simplified I guess. >>>>>>>> >> Well this will need to be done at the SoC specific implementation level (bcm_nand.c) and each SoC will need to have either general data bus read func with is_param option or data_bus_read_page, data_bus_read_param. >>>>>> >>>>>> You told me in case we would use exec_op we could avoid the param >>>>>> cache. If that's true then the whole support can be simplified. >>>>>> >> Correct we may possibly unified the parameter data read but exec_op is long shot and we are not fully ready for that yet. It also depends on if the low level data register has endianess difference for the parameter data between difference SoCs. >>>>> >>>>> So I would like to push the current implementation and we can explore the exec_op option late which will be a much big and complete different implementation. >>>> >>>> I am sorry but this series is totally backwards, you're trying to guess >>>> what comes next with the 'is_param' thing, it's exactly what we are >>>> fighting against since 2017. There are plenty of ->exec_op() >>>> conversions out there, I don't believe this one will be harder. You >>>> need to convert the driver to this new API and get rid of this whole >>>> endianness non-sense to simplify a lot the driver. >>>> >>> I am not guessing anything but just factor out the existing common nand cache read logic into the single default function(or one for page read and another for parameter read as I mentioned in another thread) and allow SoC to overrides the implementation when needed. >> >> No, you are trying to guess what type of read the core is performing, >> either a regular data page read or a parameter page read. >> >>> I agree ->exec_op can possibly get rid of the parameter page read function and is the way to go. But it won't help on the page read for endianess. >> >> You told me there is no endianess issue with the data pages, so why it >> won't help on the page read? >> >>> It's not that I am against exec_op but I want to take one step a time >>> and I'd like to get these fixes >> >> I don't see any fix here? Let me know if I am missing something but >> right now I see a new version of the controller being supported with >> its own constraints. If you are fixing existing code for already >> supported platform, then make it clear and we can discuss this. But if >> you just want to support the bcmbca flavor, then there is no risk >> mitigation involved here, and a conversion is the right step :) >> > > I forgot to mention: the exec_op conversion is almost ready, Boris > worked on it but he lacked the hardware so maybe you'll just need to > revive the few patches which target your platform and do a little bit of > debugging? > > https://github.com/bbrezillon/linux/commits/nand/exec-op-conversion?after=8a3cf6fd25d5e15c6667f9e95c1fc86e4cb735e6+34&branch=nand%2Fexec-op-conversion&qualified_name=refs%2Fheads%2Fnand%2Fexec-op-conversion > Yes this is the patch what our exec_op work is based on. Thanks Boris! The issue with patch is that performance is very slow for anything that rely on nand_read_page_op as the patch implementing it using the low level cmd and data register to transfer the data byte by byte. I actually sent out email regarding this to Boris and he cc'ed you in sept last year. We have to use the nand parser to match the page read from exec_op so we can actually match and use the brcmnand_page_read fast path. But there are many situations that we need to match so the project to migrate exce_op are still work in progress just on our bcmbca chip as of now. Just forward that email again to you and I appreciate it if you have any inputs there. So IMHO it is just too risky and too big of scope to have the exec_op added to this patch series and definitively better to do it afterwards with a dedicated patch. > Cheers, > Miquèl > --00000000000065831905fdf39765 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQcAYJKoZIhvcNAQcCoIIQYTCCEF0CAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3HMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMDBaMFsxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTEwLwYDVQQDEyhHbG9iYWxTaWduIEdDQyBS MyBQZXJzb25hbFNpZ24gMiBDQSAyMDIwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA vbCmXCcsbZ/a0fRIQMBxp4gJnnyeneFYpEtNydrZZ+GeKSMdHiDgXD1UnRSIudKo+moQ6YlCOu4t rVWO/EiXfYnK7zeop26ry1RpKtogB7/O115zultAz64ydQYLe+a1e/czkALg3sgTcOOcFZTXk38e aqsXsipoX1vsNurqPtnC27TWsA7pk4uKXscFjkeUE8JZu9BDKaswZygxBOPBQBwrA5+20Wxlk6k1 e6EKaaNaNZUy30q3ArEf30ZDpXyfCtiXnupjSK8WU2cK4qsEtj09JS4+mhi0CTCrCnXAzum3tgcH cHRg0prcSzzEUDQWoFxyuqwiwhHu3sPQNmFOMwIDAQABo4IB2jCCAdYwDgYDVR0PAQH/BAQDAgGG MGAGA1UdJQRZMFcGCCsGAQUFBwMCBggrBgEFBQcDBAYKKwYBBAGCNxQCAgYKKwYBBAGCNwoDBAYJ KwYBBAGCNxUGBgorBgEEAYI3CgMMBggrBgEFBQcDBwYIKwYBBQUH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