Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2879746pxu; Sat, 19 Dec 2020 05:08:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuexOo3LD+eb0iMwCqKhA8yllkf8PoRrOp3z34L2XTiu5gK9X2BFibheyABbexnzKOjFAG X-Received: by 2002:a17:906:2681:: with SMTP id t1mr8355917ejc.29.1608383317346; Sat, 19 Dec 2020 05:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608383317; cv=none; d=google.com; s=arc-20160816; b=pjBNt9ARrmO+Jk6WPnnPOKiPrcaPM+zNInawPCryne6slcNK6nuTsYsE+WqgJ8wkTq GBSGOIlyQrlKgO8L8NniWS0O53200sf7AlY6SxTIhpQwv5iDKsrmSXKOzPz0bf0x4UGl YPz9JOk5qtNqJxvOy9/B5g2GT1OK4oJUGfksyQcCN6WAnrm7xaCVT0UA6dp1miD6Vfs2 UG+SvrNWDP1cme3slcAIvrsf117rEjBV9LrkTfBT8kVSZMkK8U01WWD6FIKZ+MhZZFek lf9lM7MHLn/+QIEavi7X2tCpDF+BFsJTndgzhiwuEMddg+rBqImB03M0s7I2kJVr49cx e4SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=HS+iKiSkbPuOz0Hzvwh5r51qMzTDKjcL+BPnkGxJIsw=; b=yF/N2J27ojbcYlJfcniSWJNSTN/7SScyGieD2pB53g+vlpUZYGdm+HUhRxg9mHp/nj ZSYW+rMciiRF4439AnvVsAtk650M1bn/74MXv5lb4pGmMo+2gI3tkturTi7SkLSK1OMr MHGz4xvswE48kMrc2OHsZuFU1rB1fZMkkHnDNGjdt81eRyCn0AvBVSt7tN7qfvnjhbMe o4AHO066slEBW/LJdA915Xbm78mALJT89ScEpTZWZPooMEnnxS+IAADhGm0rFlC3KLQB G99+FNEcspHoNzKb7YEZzLmdRJUzDVK1LKV1MmU6qd7iQu6mOhdX2KcVEQWYVX61WeTz AuHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si7875504edq.88.2020.12.19.05.08.15; Sat, 19 Dec 2020 05:08:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728156AbgLSNGw (ORCPT + 99 others); Sat, 19 Dec 2020 08:06:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:51314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728328AbgLSNDn (ORCPT ); Sat, 19 Dec 2020 08:03:43 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Blumenstingl , Jerome Brunet , Jakub Kicinski Subject: [PATCH 5.4 17/34] net: stmmac: dwmac-meson8b: fix mask definition of the m250_sel mux Date: Sat, 19 Dec 2020 14:03:14 +0100 Message-Id: <20201219125342.231695087@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125341.384025953@linuxfoundation.org> References: <20201219125341.384025953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Blumenstingl [ Upstream commit 82ca4c922b8992013a238d65cf4e60cc33e12f36 ] The m250_sel mux clock uses bit 4 in the PRG_ETH0 register. Fix this by shifting the PRG_ETH0_CLK_M250_SEL_MASK accordingly as the "mask" in struct clk_mux expects the mask relative to the "shift" field in the same struct. While here, get rid of the PRG_ETH0_CLK_M250_SEL_SHIFT macro and use __ffs() to determine it from the existing PRG_ETH0_CLK_M250_SEL_MASK macro. Fixes: 566e8251625304 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC") Signed-off-by: Martin Blumenstingl Reviewed-by: Jerome Brunet Link: https://lore.kernel.org/r/20201205213207.519341-1-martin.blumenstingl@googlemail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c @@ -29,7 +29,6 @@ #define PRG_ETH0_EXT_RMII_MODE 4 /* mux to choose between fclk_div2 (bit unset) and mpll2 (bit set) */ -#define PRG_ETH0_CLK_M250_SEL_SHIFT 4 #define PRG_ETH0_CLK_M250_SEL_MASK GENMASK(4, 4) #define PRG_ETH0_TXDLY_SHIFT 5 @@ -143,8 +142,9 @@ static int meson8b_init_rgmii_tx_clk(str } clk_configs->m250_mux.reg = dwmac->regs + PRG_ETH0; - clk_configs->m250_mux.shift = PRG_ETH0_CLK_M250_SEL_SHIFT; - clk_configs->m250_mux.mask = PRG_ETH0_CLK_M250_SEL_MASK; + clk_configs->m250_mux.shift = __ffs(PRG_ETH0_CLK_M250_SEL_MASK); + clk_configs->m250_mux.mask = PRG_ETH0_CLK_M250_SEL_MASK >> + clk_configs->m250_mux.shift; clk = meson8b_dwmac_register_clk(dwmac, "m250_sel", mux_parent_names, MUX_CLK_NUM_PARENTS, &clk_mux_ops, &clk_configs->m250_mux.hw);