Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2770876imj; Mon, 11 Feb 2019 08:12:58 -0800 (PST) X-Google-Smtp-Source: AHgI3IbYpC28PWamgVvVXBG5PUjOeFJFaUZL/jSvH4kea8PkUDESLWERmKwOXRjuiCNhdxX0NExo X-Received: by 2002:aa7:8542:: with SMTP id y2mr37807342pfn.83.1549901578771; Mon, 11 Feb 2019 08:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901578; cv=none; d=google.com; s=arc-20160816; b=Nv0N/aUwMwx+uwqdOXpv0c41KmWdUvrcaBz4gbHNC6uzKfDRgWOQIlcoLp95dcx9R+ 6m9LszLoorC3TVW2r1MxsNAJo5FYJ5lHSXrdpjR+u/6tj14ZEpg9ZbAgBWlSyFduSZ/m eLg/+VLpHyiAuFFnznhAuwOLoQwLCsHewIOcdCeHcncLnT+xSGefTC0MUBXT2tzBTBkX zHTkKmAl6GK9ugWra6aQoI6jhDjKfQrAoAH70oikykdUDXx7eFnFcWswrZd+OBvGaPMC X5sJw9EmayxB2v0aK1QyV5XauqSbzUQ1SHE31DED4650auw66bgOmRIFDlLr7ZLWZiA/ Q96Q== 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=qXSBwKQZqFJTCJE4QTJuUReAGz2ECXFO3sBJSuLvEww=; b=e4DUvzSVR0irmwNuBsP/6G1Rla3zlPxmTF2U4WiGq2DOJo9GlmdahERgq2HcXUcdIM usgLDCUPgtsXkNR67EUcQGI1PDFyIkm/NJxGfUcK+PSroh2irAL7lj5Mj1b8jEH7+xpj ydYvqXudO+Aa3T4MrPFpkK9c9S/etbKsa6Ni++s/UMBxPiHsSWeQPgmilOVWYExtXy0y Dbbn46u7Fu40bX2fle5xn79FVNpe2CphWABpekYF83tzJO1PALPNoIvTDe35/8xKQI3b KzxYGdNtHz3Nl6N+gBtSwmDUuxfaVF9Pcl2e6FSdmVMjyJDm4YGkcQvFQQZD/hPmslb8 HlKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TjJCsoBb; 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 a20si775082pgk.581.2019.02.11.08.12.36; Mon, 11 Feb 2019 08:12:58 -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=TjJCsoBb; 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 S1729584AbfBKQLo (ORCPT + 99 others); Mon, 11 Feb 2019 11:11:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:56898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729082AbfBKOXu (ORCPT ); Mon, 11 Feb 2019 09:23:50 -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 18183222A1; Mon, 11 Feb 2019 14:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895029; bh=OkE/gxmnnjMpfLPHAwquAZmEpqjZzVHf/CGkR6L76WY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TjJCsoBboIbKpaQVT03oYJjhJpHNurKwvt66hG/lkHsk2d1+T1sqyX3jNbCVcAajm sueJ+lnlYpRKSjIwkXoH2B2drpE9WNNurRUORe6xocYgE65ppPTICBabEuAjRLBZpL /fm77Pq9cTqfCvpuMAQq4SujXPNEW9e/GpiZ5BeM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Blumenstingl , Jerome Brunet , Neil Armstrong , Sasha Levin Subject: [PATCH 4.20 067/352] clk: meson: meson8b: do not use cpu_div3 for cpu_scale_out_sel Date: Mon, 11 Feb 2019 15:14:54 +0100 Message-Id: <20190211141850.381750045@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a5ac1ead32c9aac285f6436e09b4f6111996e9b8 ] The cpu_div3 clock (cpu_in divided by 3) generates a signal with a duty cycle of 33%. The CPU clock however requires a clock signal with a duty cycle of 50% to run stable. cpu_div3 was observed to be problematic when cycling through all available CPU frequencies (with additional patches on top of this one) while running "stress --cpu 4" in the background. This caused sporadic hangs where the whole system would fully lock up. Amlogic's 3.10 kernel code also does not use the cpu_div3 clock either when changing the CPU clock. Signed-off-by: Martin Blumenstingl Reviewed-by: Jerome Brunet Signed-off-by: Neil Armstrong Link: https://lkml.kernel.org/r/20181115224048.13511-3-martin.blumenstingl@googlemail.com Signed-off-by: Sasha Levin --- drivers/clk/meson/meson8b.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index 1d39273d7a04..328fcf50d9e8 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -612,20 +612,27 @@ static struct clk_regmap meson8b_cpu_scale_div = { }, }; +static u32 mux_table_cpu_scale_out_sel[] = { 0, 1, 3 }; static struct clk_regmap meson8b_cpu_scale_out_sel = { .data = &(struct clk_regmap_mux_data){ .offset = HHI_SYS_CPU_CLK_CNTL0, .mask = 0x3, .shift = 2, + .table = mux_table_cpu_scale_out_sel, }, .hw.init = &(struct clk_init_data){ .name = "cpu_scale_out_sel", .ops = &clk_regmap_mux_ro_ops, + /* + * NOTE: We are skipping the parent with value 0x2 (which is + * "cpu_div3") because it results in a duty cycle of 33% which + * makes the system unstable and can result in a lockup of the + * whole system. + */ .parent_names = (const char *[]) { "cpu_in_sel", "cpu_div2", - "cpu_div3", "cpu_scale_div" }, - .num_parents = 4, + .num_parents = 3, .flags = CLK_SET_RATE_PARENT, }, }; -- 2.19.1