Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9456222pxu; Mon, 28 Dec 2020 17:12:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJweSsIaRwScIF/1MjKtZNHVHhn4V2eh+Jyg4f3RsvDaMFSMzHLCd/8sI8Lw5Y1knUt14lvQ X-Received: by 2002:a50:84a9:: with SMTP id 38mr43619163edq.378.1609204376351; Mon, 28 Dec 2020 17:12:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609204376; cv=none; d=google.com; s=arc-20160816; b=qItslURMC/jjzFX9dijPsoru6KrCSoKPYczz4JuuC6chB5icEqJW2nKdLYcmmGkQWj xAriDVjF1SluBc/BgWBGxjyqPmCWUT0Iww3sPqAKGSIlSIG2koNqUkGOp9myIvN/60NX IZptDtKZDS1kyoaZQMMszqkwLEHkxkbUnG2b2h/5/eJmLWVSpac9pyRvbY/CtQ/TI0M6 huvuEW/BDaVRu0ZhhdKxcKzPCJJ74ju85iiGC9IZn9iCPSoKbkIVe0FwTPQLAXzHtFE5 VUE4pSdBmmvCT6pa9t9wX0jcbqe30DmCtwl+enL98OVwdii0ik5jDgK5f6MI4x8Z1eO4 oPWg== 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:dkim-signature; bh=Oy+7Q+inWwEHqJ0I1k19dFN81Mga98qarPEZz/lLzaQ=; b=f/YEp2K/jDe0xXPnVBIPQEO1IUIFbwa3ZJ+z2y9WfXfc2zUo7WieH1c1aQYn6aqhHX l5r3Q4MMYJP2xxwVVeMIvx/iFCv52uOCZq9z5mB2CiiY0zpV+QxGhiBTq2m3KZjQLjrl FNpg4abRDzFYalDXeNIElJlH2opb65f0FvQUHvgb6ZmCciH0pa5Yfn8dRjaHDhMHazxO X/RxdvAvd+bzsGhvFYm3JglJpTGt+qMQmW22kH+7uCC+CHKN9ndzdrmDfVxH1pxKEHCf 7jY5Mlx5MnmQ8tqlh80U/g9Ma+cYcbIkWMjrwJ/iPNf2LCsGuSZYeUkcSUqVii20/HxM +CYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dx1gK22/"; 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=pass (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 gn22si18520542ejc.749.2020.12.28.17.12.34; Mon, 28 Dec 2020 17:12:56 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dx1gK22/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503596AbgL1Qkk (ORCPT + 99 others); Mon, 28 Dec 2020 11:40:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:55708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728515AbgL1M7b (ORCPT ); Mon, 28 Dec 2020 07:59:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CA6EB22AAD; Mon, 28 Dec 2020 12:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160330; bh=mCKcn42ai5yLIkB4E8U89XJ4qeRFev5q3sycr5NWsGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dx1gK22/VaFjxCcC5D4TK3WVT3yCNbyMrhKRtc778DstpiVKrwxG68ryKAPDQVQgN m/T+v0Rh1oFWEewXHNBZfjbL9VACp1LXMrXvZbStxO7Pve7PwKeKaSweX1NH1q5Ide lHJN5abHCeWo4eySIvT9Ojzzdlz2p0qXEQJiFQUE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Blumenstingl , Jerome Brunet , Jakub Kicinski Subject: [PATCH 4.9 015/175] net: stmmac: dwmac-meson8b: fix mask definition of the m250_sel mux Date: Mon, 28 Dec 2020 13:47:48 +0100 Message-Id: <20201228124853.997472795@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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_RGMII_MODE BIT(0) /* 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 @@ -123,8 +122,9 @@ static int meson8b_init_clk(struct meson init.num_parents = MUX_CLK_NUM_PARENTS; dwmac->m250_mux.reg = dwmac->regs + PRG_ETH0; - dwmac->m250_mux.shift = PRG_ETH0_CLK_M250_SEL_SHIFT; - dwmac->m250_mux.mask = PRG_ETH0_CLK_M250_SEL_MASK; + dwmac->m250_mux.shift = __ffs(PRG_ETH0_CLK_M250_SEL_MASK); + dwmac->m250_mux.mask = PRG_ETH0_CLK_M250_SEL_MASK >> + dwmac->m250_mux.shift; dwmac->m250_mux.flags = 0; dwmac->m250_mux.table = NULL; dwmac->m250_mux.hw.init = &init;