From patchwork Thu Jun 8 16:30:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 105075 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp433285vqr; Thu, 8 Jun 2023 10:27:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6FWs1BuiZFWOHC8JfBB1rSGqno3suxigzNZ7WJcwnBhhgRfCPLpwIVwQ36kBndA79Bt0xq X-Received: by 2002:a17:902:6945:b0:1b3:696f:b7e with SMTP id k5-20020a170902694500b001b3696f0b7emr1451398plt.46.1686245228393; Thu, 08 Jun 2023 10:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686245228; cv=none; d=google.com; s=arc-20160816; b=qbP/9oxvTQ+NoIZlLx7HYX/e9bA9UQvC7s7QFKVHE0Lkhhn2pvi0q0Spf6d0ebzh0E seCMk2aQYHC3gDSYaHxCDZsXx1HQ5Yaq0fRcCvytYn1I/xU/6+VAIpg3w1tfguBGb1H9 b8ge/vXTIW8ne0LvV9cNS70+3w7LP2rPPkkPFgYCvlOc825LuN5LNer19P7mfYJfxJIS 29+TR+0+FXaGNM/CeH24/Tvhv2CpsL00+Fl8Luj+gk4BY+lY8+dGawGRIOpCL/Pegqn2 FRpodU7s8mwhLqN79v0Z5pIrGkmxj/mx4wIhUmW0NHd4s0Ap6nF2tcTKmm8zul4W0tmI 55DQ== 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 :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature; bh=8JK6nUED3jU/yRq5Kxia5FQ+fi4P7t0pEwpfr3iX2Go=; b=LC73U37pM85zw2Fv9o7H940EL8TyJ4xrYd1Z4G/INM2YIPL9SlKj8VQwBnKpkczbHa Kr04Wi3bflABSXnMr/VNa1H2kFo8W4G6J+2cwH7CuddwGgISW3I0C1G5O9yB01/cfT+1 wQO7O+ggV0jA/ZPuJ49BTK+a/JJpNuWxb1/aQCatlo6PdimnoNKD8sNO2ED82EoxP0fv qjjh3CZuvwtKTnvA/A3gsG9cQ50JiX+rp0Sq8s6owAmskIOXIiRqLF++/zAH+gwPxrRA cozL9FNerMC/NiwSl/yMSt4drQdjuEDzJz98LGDpGxSkG9KsKMsUdzUEwzxUTXVtRkE1 JDpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=SSUKz1jK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a170902e5c600b001ac7ea55768si1350712plf.499.2023.06.08.10.26.55; Thu, 08 Jun 2023 10:27:08 -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=@gmail.com header.s=20221208 header.b=SSUKz1jK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235285AbjFHQaw (ORCPT + 99 others); Thu, 8 Jun 2023 12:30:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235520AbjFHQao (ORCPT ); Thu, 8 Jun 2023 12:30:44 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87EAC1FDC for ; Thu, 8 Jun 2023 09:30:43 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-51493ec65d8so1445987a12.2 for ; Thu, 08 Jun 2023 09:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686241842; x=1688833842; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=8JK6nUED3jU/yRq5Kxia5FQ+fi4P7t0pEwpfr3iX2Go=; b=SSUKz1jK9Qed9t+uRHaFgw0LA0tr/oknZHzTeub9Vqzp/NzBqntpHfr6v3zXDpEKi1 LPJMzzZxsfB/77Xdxp4oUWCRR7sl7ibeHk2L+VJ6IB+SMfmIGOtaJRulnEL64DPClwzz ekLt0OMAizMxolBclwsuX5Tqz+1rs6ADmZaYo9fl0j+kWDuZV18toFs7/39EiAQg1GTl qK1ffa4v+rmFOKWgCqYMv4ML3vb4sFmzq+g29+/0HX6q+sJv5pCqnBb1fVqvl6AlpQKD N5Kd9sksfVKH1soJJ3x3Sc5n9RGrTH4vNhUlut8W3+rt9aFPrT4PBvKtP2ImF6/CpikE +HxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686241842; x=1688833842; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8JK6nUED3jU/yRq5Kxia5FQ+fi4P7t0pEwpfr3iX2Go=; b=JNZmPdZrb4FgaYKSmJBMtqOd+SMb1G0zmFJjoTM3wBb1zMhlYXFi/Tankn8xrW1RHB Z8qI8YQh5ZoH9CQDKwInzQKvppvmRqPeZh0uIqFwhQzIpvwqNW99yRwX1LB7gxr1ibfF kzedOUuWURP/On0YJ+M+vk8IW0Z9aUCrPOjcAy9xuCDQmfgX0WnVQOQfDVqHsfpIziKz FuwqNq2xwf84ek9DtpMbmP6XQk+DTcSW2MTRiwP6HDRAfg/G8S4/Q863+zhvIZcd0lrO SI7tTT4XNaUvkdyi1TogKS2yCL0KjcqPjGx5pF6E1WH84iCVfXypGC6+d0qztHGIp37j lbIw== X-Gm-Message-State: AC+VfDzYaYlg/ZUQNRyvokf808yBiPYVm4wmKINRDLazpybRc3gvfI+J 671raOjSp61QYwu1gGf4EKo= X-Received: by 2002:a17:907:da1:b0:958:cc8:bd55 with SMTP id go33-20020a1709070da100b009580cc8bd55mr345832ejc.0.1686241841862; Thu, 08 Jun 2023 09:30:41 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id o10-20020a1709061d4a00b0096a742beb68sm24919ejh.201.2023.06.08.09.30.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jun 2023 09:30:41 -0700 (PDT) Message-ID: Date: Thu, 8 Jun 2023 18:30:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Johan Jonker Subject: [PATCH v1 3/5] mtd: nand: raw: rockchip-nand-controller: fix nand timing default To: miquel.raynal@bootlin.com Cc: richard@nod.at, vigneshr@ti.com, heiko@sntech.de, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, yifeng.zhao@rock-chips.com References: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> Content-Language: en-US In-Reply-To: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768156276615617043?= X-GMAIL-MSGID: =?utf-8?q?1768156276615617043?= Somehow not all NAND chips give a valid timing setting with the nand_get_sdr_timings() function. Don't consider it as an error, but fall back to the default value in order to continue to use the driver. Signed-off-by: Johan Jonker --- drivers/mtd/nand/raw/rockchip-nand-controller.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/drivers/mtd/nand/raw/rockchip-nand-controller.c b/drivers/mtd/nand/raw/rockchip-nand-controller.c index f56430f6c..e39431cfa 100644 --- a/drivers/mtd/nand/raw/rockchip-nand-controller.c +++ b/drivers/mtd/nand/raw/rockchip-nand-controller.c @@ -429,8 +429,10 @@ static int rk_nfc_setup_interface(struct nand_chip *chip, int target, return 0; timings = nand_get_sdr_timings(conf); - if (IS_ERR(timings)) - return -EOPNOTSUPP; + if (IS_ERR(timings)) { + rknand->timing = 0x1081; + return 0; + } if (IS_ERR(nfc->nfc_clk)) rate = clk_get_rate(nfc->ahb_clk);