Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2984977imm; Sun, 1 Jul 2018 09:42:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLsw8AdGbB4t899ttzH9BZeIzKHNCF2sfvmEpWY2msYe9XXaPzm/4dU5PofRIHqmQ4DFpW+ X-Received: by 2002:a17:902:123:: with SMTP id 32-v6mr22221988plb.181.1530463376439; Sun, 01 Jul 2018 09:42:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530463376; cv=none; d=google.com; s=arc-20160816; b=k2nuCjDNYKbZSOW/vc7PJa5hFelSWuPWFLl9PDEBTB8qMlexYKxVEh/fwWwuraVtO8 7HBlVW5GXoXr4K6ujxUCYqubZSffIRtbtCqa2JfLaXmbQ9wZ8ECxygiOvBxopqJfwOIg tnJkYocZ+7k270MM6T8L4Gg2XqEJkQRBCfs37vLEOUEhOGj4xhEW6eRArESU4ZoNholJ Fx2pPt6RH5LdfYETMzzc8A8sMIpnHM5hiFF1JjXVk/zFy/iIoowjYgvDkuogN/xkbjwz omWG7JAQTAvIjL3zoiublG37l//FcZIKHb0uqDS39siy6JOlt+OpOZXWoFfbE80J7wCe nfKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=s+uEH7F6iyobLTkgLFTqavcFmZ49yN5YB7UKgS3Ug4E=; b=xJgxgcvIWeNuMOkC9rRmmWk0gDM2aJ24/+WzjdkhWWLz7/DQIyEWOTWQN71xK+xkvN jfVyz+chxue2irGmh1fKYtzBlr9YGHVq7oUlRFXriUiyztdVapHz6JDWIvsJ/9vngRs+ dUwf67JXar6hLqrwKk+kyT0bSYvCoEZZPzA/ct/D9rpHAdclTr0lYARZvrAI7We/3DLk cBR+Tgumtdgc9HXm2CtCS1MSJ0OQvmVlVAmq0l3INqddJrPelfyYS3noRm1q16iwl5Er PAwyYxDd/CHRxNrt2eTgD2j746JgZcQvik5PVcD9Lee7iL+/xEd1FTpd65xwzq7SB0eq fLJA== 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 a20-v6si250038pgb.600.2018.07.01.09.42.41; Sun, 01 Jul 2018 09:42:56 -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 S1032043AbeGAQlV (ORCPT + 99 others); Sun, 1 Jul 2018 12:41:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37344 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031508AbeGAQlP (ORCPT ); Sun, 1 Jul 2018 12:41:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A3B32ACC; Sun, 1 Jul 2018 16:41:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Philipp Rosenberger , Boris Brezillon , Masahiro Yamada , Richard Weinberger Subject: [PATCH 4.17 101/220] mtd: rawnand: denali_dt: set clk_x_rate to 200 MHz unconditionally Date: Sun, 1 Jul 2018 18:22:05 +0200 Message-Id: <20180701160912.623088990@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masahiro Yamada commit 3f6e6986045d47f87bd982910821b7ab9758487e upstream. Since commit 1bb88666775e ("mtd: nand: denali: handle timing parameters by setup_data_interface()"), denali_dt.c gets the clock rate from the clock driver. The driver expects the frequency of the bus interface clock, whereas the clock driver of SOCFPGA provides the core clock. Thus, the setup_data_interface() hook calculates timing parameters based on a wrong frequency. To make it work without relying on the clock driver, hard-code the clock frequency, 200MHz. This is fine for existing DT of UniPhier, and also fixes the issue of SOCFPGA because both platforms use 200 MHz for the bus interface clock. Fixes: 1bb88666775e ("mtd: nand: denali: handle timing parameters by setup_data_interface()") Cc: linux-stable #4.14+ Reported-by: Philipp Rosenberger Suggested-by: Boris Brezillon Signed-off-by: Masahiro Yamada Tested-by: Richard Weinberger Signed-off-by: Boris Brezillon Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/denali_dt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/denali_dt.c +++ b/drivers/mtd/nand/raw/denali_dt.c @@ -123,7 +123,11 @@ static int denali_dt_probe(struct platfo if (ret) return ret; - denali->clk_x_rate = clk_get_rate(dt->clk); + /* + * Hardcode the clock rate for the backward compatibility. + * This works for both SOCFPGA and UniPhier. + */ + denali->clk_x_rate = 200000000; ret = denali_init(denali); if (ret)