Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2873335pxu; Sat, 19 Dec 2020 04:59:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOrGXYjfXvICUBe0bbVFAGAsfS2H7m/m46Hn/O1oEcXI1h2kW4U6/98BnfDF2C+owiXvcD X-Received: by 2002:a17:906:8617:: with SMTP id o23mr8317197ejx.274.1608382773605; Sat, 19 Dec 2020 04:59:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608382773; cv=none; d=google.com; s=arc-20160816; b=fyDMfRxGrmBUqD1P/Un5Gmm4oSLk23xChoMZzjGyZMvzi3mvuQz87I29TlfrE6Ce0O GBYDKDeE+S52Em9ZxIjLjvzNR8K8IJhmFj4K2V0zhTZQ5WnfwiLbz9txT19SQNu2NMqD 7QEt+QJCHrzkfqUQpqLz0T8EU/NqIrgFVMPj+Ar9aKy0TbojNK1Vg6mu82XvgFwkznxf oyiR/brub9T+ZJDkyvzGEHxoCeVQe/esJ+dNqDAdVzhm5dtmmn7rsiSx/GFl1YFhA+oH ZId0IT+jF+R/sy8X6LcxfpNW5HshL0IJGD2bd2lsDA4q5A3U7Jx88Cs4kom5h+g1osgC EE9g== 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=gG99cjl804EckJaA1RCapNU7F86Vyw3IirEAsfdUfIE=; b=ixyNNYxjvrk/jAtqjjRskQTOOcM8ubazCJ+LbPZ0pLUvGtXs36TQEqBQ3jotAfAV9i sr3yDiGqNVTMoks2aEPP5KieMg+OwWhZpdCVwK/K1gFTa5qZVXtROpLLQ4ALr05EA9U6 hvAG6KBZT1VwejQU3iPTOfPM5Rt8vZEozCmj09UQMV9Ff1d7aFgaLfmCV+dYtYsc9/K0 dPkNWKmMbb/iTUghEr/cC1Aj61DB7YLI5/fFnzCAaiCiFqFC2iZ8hSQQVObyg6JXHn/C kUxBBR5AMlzT693d/rzL9G4WGQHFg8VZompxG7TRQVdRBdnX3kRtQ+yF+hFm4nPcm7ZB +0Hg== 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 l28si7494694edj.68.2020.12.19.04.59.11; Sat, 19 Dec 2020 04:59:33 -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 S1727432AbgLSM6G (ORCPT + 99 others); Sat, 19 Dec 2020 07:58:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:44158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727428AbgLSM6F (ORCPT ); Sat, 19 Dec 2020 07:58:05 -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.9 14/49] net: stmmac: dwmac-meson8b: fix mask definition of the m250_sel mux Date: Sat, 19 Dec 2020 13:58:18 +0100 Message-Id: <20201219125345.376925474@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125344.671832095@linuxfoundation.org> References: <20201219125344.671832095@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 @@ -30,7 +30,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) /* TX clock delay in ns = "8ns / 4 * tx_dly_val" (where 8ns are exactly one @@ -155,8 +154,9 @@ static int meson8b_init_rgmii_tx_clk(str return -ENOMEM; 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_parents, ARRAY_SIZE(mux_parents), &clk_mux_ops, &clk_configs->m250_mux.hw);