Received: by 10.213.65.68 with SMTP id h4csp2157112imn; Sun, 8 Apr 2018 21:11:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx49vhBx7Qt9iUG7w6MPs7X/lDm2D06dxyHcgEQh0EkdVTHRtj/PqwohkV3haDG5RxJBt0NV8 X-Received: by 10.99.43.80 with SMTP id r77mr23819174pgr.193.1523247071330; Sun, 08 Apr 2018 21:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523247071; cv=none; d=google.com; s=arc-20160816; b=g0iIEZZccaMRVEQGvfGFCvKCrjvcz72wNsyma8nASvwiRa5QtoMzviNYk0AJphFusX Bt2jq4Gv6C77TeBE6+suU67VwfZfKGEwGJebS5pIVYiHh20Hz4lt/r/25n9d7YYs/XYg XrDtmeePcuLfQ2RqdEWwsRH1yXRiDEra465pQEoaRvAk7CJ7xOZQgteM+E4e+XByV8gO 8iW2Fejyx4EFC9wypwmu+tqcZXcyOQDOXXyY7ifXqtu/Msp2TcPhR4XwTH3Jd7vkBq2U cN+Xn40NrByOMkah4huwOKnycc4TQUGyk/zO+69dxKdciM+3C376EDpRQmU4AEmzeFUq paeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=+jxJy+qrhWyLJPmZwjAYqgVQBtT43mLyGJA+EaoIRYc=; b=Fd/OQvURGzICz846J0h4bMFA3vMiZ+ZXd+hkNWr3xAbgQlwpoQb13oA2pRW/fvV98s DurqfgxmsP1BekA8B8RZWNWXl7fyjjb1Ej5L3rQl4K8fXSXXC3h3fu+HzuZRh4jtsFGh fuacUa4oDHPLVTL+GdY2e8SiyvmsY5dgUl/MzfQsLsuqijmhDIOJIIchkudyDD6l7Ytq dLOusXlDWpQGmQlRA7HzojATBcXoctQyU6tzi1N60QafMUB5POKq8Pt8gVPdrZ1J7szH p4XOcqlagDdZ0Uv+J5lLWPzyxFg7QeFZ+X5hm2x7XTp7nN74Gsg0Zd1eS359f4+U6hhQ jwPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=JSzWZsq4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si10326610pgq.83.2018.04.08.21.10.33; Sun, 08 Apr 2018 21:11:11 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=JSzWZsq4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754271AbeDIEFc (ORCPT + 99 others); Mon, 9 Apr 2018 00:05:32 -0400 Received: from mail-bl2nam02on0136.outbound.protection.outlook.com ([104.47.38.136]:51875 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753181AbeDIARx (ORCPT ); Sun, 8 Apr 2018 20:17:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+jxJy+qrhWyLJPmZwjAYqgVQBtT43mLyGJA+EaoIRYc=; b=JSzWZsq4PPua1BipCj1gKL1GG5bQNJhD3hlCZJSbEX6riBubtIjB89P/dnUBI5P0PlhDi7OVXAZegJUdeiAmQItXpMquFwMWfY1DluGVXfT2ehRz9N21YaFRGjyAGPRrVRi6QB4ZvWD2GtAEYupOipQgU3oD74rj7wv9CAFaNRk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1048.namprd21.prod.outlook.com (52.132.128.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:17:46 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:17:46 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Martin Blumenstingl , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 042/189] net: stmmac: dwmac-meson8b: propagate rate changes to the parent clock Thread-Topic: [PATCH AUTOSEL for 4.15 042/189] net: stmmac: dwmac-meson8b: propagate rate changes to the parent clock Thread-Index: AQHTz5gf54fZTJy6J02HPB5zSKPGAQ== Date: Mon, 9 Apr 2018 00:17:19 +0000 Message-ID: <20180409001637.162453-42-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1048;7:lGZtlzBFyMVneTtTIWaB0wKGQyvFOZHuhQzYS/ipY8efUATxSDU+ZhMFW5IbHORkFb+d5ZbACpKyaaqbPVGX4PJ40JBDILQ/g92vBEn6TXoh8a5Evm6fgjUw7ky8BTvDHwo/EzIqacLMBXvtBvh/0q8QWRahJ8+LKl0YV/cRpRQcdikr6sy378lWFTdV4CNKf8jVcKVF7k3chtT4f7QFUPVuSQJ22M4bxvhZl4hQ3ZWCnTcB3JUX/SybfbFFdCv3;20:JOWQ5ul6absvuIzUgxWqgAZc19GYbD7ZnLbOlsWWAOvwi8U8XWU7aQ2L/EZ8xCYszIHSBw/bmp5do3wRN/4pcyS8+aITuX/nMoOOxqAZbuTwwKlCkurtJOJt7lzwTSmNXfoOYkCa7USu+ivykvvG+6E7WoR+VAMhVUQzYU09joA= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: b0c4b2e8-f68d-4ad5-6d47-08d59daf5253 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1048; x-ms-traffictypediagnostic: DM5PR2101MB1048: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(8415204561270); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1048;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1048; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39380400002)(376002)(39860400002)(346002)(396003)(189003)(199004)(86362001)(1076002)(99286004)(6116002)(110136005)(3846002)(54906003)(22452003)(3280700002)(105586002)(2906002)(76176011)(4326008)(6512007)(6436002)(6486002)(3660700001)(6666003)(7736002)(59450400001)(86612001)(25786009)(2900100001)(14454004)(97736004)(53936002)(107886003)(68736007)(102836004)(36756003)(6506007)(26005)(186003)(106356001)(305945005)(5250100002)(72206003)(478600001)(2501003)(10290500003)(81166006)(5660300001)(8676002)(66066001)(316002)(81156014)(2616005)(10090500001)(11346002)(446003)(476003)(8936002)(486006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1048;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Zn12XBfBJLc63fIsc5eSHszv0m4gPBH7r56IrNpowVynjM8WwpjEyg3a9IBYbNLReRuubEIPHAYD1WupOyeav9eLrTrR7+p6jKK6YtGX3ebWtkMTwPsLS0H9Ct+WCt4ZAg3Ohtlh+xUoOlj0qV/tv1Yia10RO4v51MMCaGSop8wipp6a+bkmWk0e40AKjFmuondV0/3MvB1GxCit2wK6J82wpxY5lwnEHvvqD95FOj8vyMUyi7RTZYkUCY+N6rgo8eWwemGxqcLWf7lq9hUWfrAKGo+LbAvOXE5j9gsyxRkD98j1mH22iu5L4yOUhB4uuEjG4i5zfHd6UHF8BefuOJ7vF+I7DjYBnwDTKT/bGDXhW9Wc35+e5mXwNwvB+O6MhLTYTjaI6YPRn9F+HPidwWpSLlkC1L8DHmXWwE29cbk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0c4b2e8-f68d-4ad5-6d47-08d59daf5253 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:19.2762 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Blumenstingl [ Upstream commit fb7d38a70e1d8ffd54f7a7464dcc4889d7e490ad ] On Meson8b the only valid input clock is MPLL2. The bootloader configures that to run at 500002394Hz which cannot be divided evenly down to 125MHz using the m250_div clock. Currently the common clock framework chooses a m250_div of 2 - with the internal fixed "divide by 10" this results in a RGMII TX clock of 125001197Hz (120Hz above the requested 125MHz). Letting the common clock framework propagate the rate changes up to the parent of m250_mux allows us to get the best possible clock rate. With this patch the common clock framework calculates a rate of very-close-to-250MHz (249999701Hz to be exact) for the MPLL2 clock (which is the mux input). Dividing that by 2 (which is an internal, fixed divider for the RGMII TX clock) gives us an RGMII TX clock of 124999850Hz (which is only 150Hz off the requested 125MHz, compared to 1197Hz based on the MPLL2 rate set by u-boot and the Amlogic GPL kernel sources). SoCs from the Meson GX series are not affected by this change because the input clock is FCLK_DIV2 whose rate cannot be changed (which is fine since it's running at 1GHz, so it's already a multiple of 250MHz and 125MHz). Fixes: 566e8251625304 ("net: stmmac: add a glue driver for the Amlogic Meso= n 8b / GXBB DWMAC") Suggested-by: Jerome Brunet Signed-off-by: Martin Blumenstingl Reviewed-by: Jerome Brunet Tested-by: Jerome Brunet Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/= net/ethernet/stmicro/stmmac/dwmac-meson8b.c index 157e12e15f28..8be4b32544ef 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c @@ -116,7 +116,7 @@ static int meson8b_init_clk(struct meson8b_dwmac *dwmac= ) snprintf(clk_name, sizeof(clk_name), "%s#m250_sel", dev_name(dev)); init.name =3D clk_name; init.ops =3D &clk_mux_ops; - init.flags =3D 0; + init.flags =3D CLK_SET_RATE_PARENT; init.parent_names =3D mux_parent_names; init.num_parents =3D MUX_CLK_NUM_PARENTS; =20 --=20 2.15.1