Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5618523imu; Mon, 26 Nov 2018 03:05:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/XvnduILSEVS5jABYlPoEuYZomuQhZJLCnDjVf8PHRRHQQ+mzIBVr7SQ9WSxUc1s1/SmvJV X-Received: by 2002:a62:1c96:: with SMTP id c144mr22674794pfc.129.1543230315401; Mon, 26 Nov 2018 03:05:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543230315; cv=none; d=google.com; s=arc-20160816; b=lH4df5iV279X2NsbcqLVFad6kz5J8ZqJfkq9UPLUqGLCqDYsY3Stqyjt22ZyAOret6 roPj8a6dGK4mLC2TgKiSR27CyoWjoIzFPUU7BGOnUvwwuW7iX5L0UFTUSnC/JKioU3+n YEpYDxGFsrrq0KHxyPV+qWhfYmab5SKWg5SyjsXER5HvYvL/L1RFaGkN0DQfCMBUgEra BKE25V7YvFhAhccmOjWrO0fs06g4h2aKBlrHrorAaHJDxFUW5BpHNiIup/hAAYseNpKm 5qOEnXtuyjZAvaYkOqiTAjZMvSviLcfeZtvQ6Dy9AKjTzUG2Twl/ztDive8XgVqWGMWt cDxw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=A8UOmKeFFFHwAH0iTYY97KxxCmWKIacXyYF9X7v6VHE=; b=LFwjZHEvDIsGm8dPWNVgH60izm0Rmv5mPDlyDTTLUM15bdRnfKzP/SWDVzuxUIttps JmR9bkPvf5T3F39dr0ZmSNv0abVS+JLWzNL+QcROCaAsEgbJiapEX69nNLuLI+RLs8gq Vtmy/nogSSQTiYLw2PxXHOO2RvQ0+7seGEDrRVgqTQCMc9jPOyjcpY3znmwNTo9gVyvu Mrsari+i9q5vDt1XSGjxs4yEQKpZid+L01+/o1Gq4NdVzBOlIaM/tkuz016J2CTcb4Z5 yQbIRdBmloPGSLcWQfNLLavMAh6QL36wlq0Qn8Qg8bMpkQAUj0ViHYhHWIYcwVrhGhnU wDhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vFCiysMj; 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 k38si32522786pgi.235.2018.11.26.03.05.01; Mon, 26 Nov 2018 03:05:15 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=vFCiysMj; 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 S1730529AbeKZV40 (ORCPT + 99 others); Mon, 26 Nov 2018 16:56:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:39636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729436AbeKZV4Z (ORCPT ); Mon, 26 Nov 2018 16:56:25 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 071422089F; Mon, 26 Nov 2018 11:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543230160; bh=xrgzj9pWgvvuolV+HxMmbnbJZYYNGBxm2NxgEf3mGug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vFCiysMjXKwNQ5xekcGVSPgHPk3mJsRg5jkNX6jAKw8h58wXJgX3s+2aTeJTIfWjG LYwwrg0N5yRLW79epRbnKujGyC2vrBtXrZxKCwF0ASjqMmYFnoMLA3+2KaugLD7NrI QTJBfas1hpGY7GqpvjDNXhT2ro22VKXO8IqnGyKA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phil Edworthy , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 4.19 030/118] clk: renesas: r9a06g032: Fix UART34567 clock rate Date: Mon, 26 Nov 2018 11:50:24 +0100 Message-Id: <20181126105101.032597707@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105059.832485122@linuxfoundation.org> References: <20181126105059.832485122@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ee02950d53eee0d4c7f1c08a35272b77d24b9459 ] The clock for UARTs 0 through 2 is UART012, the clock for UARTs 3 through 7 is UART34567. For UART012, we stop the clock driver from changing the clock rate. This is because the Synopsys UART driver simply sets the reference clock to 16x the baud rate, but doesn't check if the actual rate is within the required tolerance. The RZ/N1 clock divider can't provide this (we have to rely on the UART's internal divider to set the correct clock rate), so you end up with a clock rate that is way off what you wanted. In addition, since the clock is shared between multiple UARTs, you don't want the driver trying to change the clock rate as it may affect the other UARTs (which may not have been configured yet, so you don't know what baud rate they will use). Normally, the clock rate is set early on before Linux to some very high rate that supports all of the clock rates you want. This change stops the UART34567 clock rate from changing for the same reasons. Signed-off-by: Phil Edworthy Fixes: 4c3d88526eba2143 ("clk: renesas: Renesas R9A06G032 clock driver") Signed-off-by: Geert Uytterhoeven Signed-off-by: Sasha Levin --- drivers/clk/renesas/r9a06g032-clocks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c index a0b6ecdc63dd..6d2b56891559 100644 --- a/drivers/clk/renesas/r9a06g032-clocks.c +++ b/drivers/clk/renesas/r9a06g032-clocks.c @@ -539,7 +539,8 @@ r9a06g032_div_round_rate(struct clk_hw *hw, * several uarts attached to this divider, and changing this impacts * everyone. */ - if (clk->index == R9A06G032_DIV_UART) { + if (clk->index == R9A06G032_DIV_UART || + clk->index == R9A06G032_DIV_P2_PG) { pr_devel("%s div uart hack!\n", __func__); return clk_get_rate(hw->clk); } -- 2.17.1