From patchwork Sun Mar 21 16:25:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 406033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51BAFC433E1 for ; Sun, 21 Mar 2021 16:25:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 250ED61937 for ; Sun, 21 Mar 2021 16:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230125AbhCUQZH (ORCPT ); Sun, 21 Mar 2021 12:25:07 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:33102 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbhCUQZE (ORCPT ); Sun, 21 Mar 2021 12:25:04 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 4FC301C0B78; Sun, 21 Mar 2021 17:25:01 +0100 (CET) Date: Sun, 21 Mar 2021 17:25:00 +0100 From: Pavel Machek To: kernel list , Claudiu Manoil , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: enetc: fix bitfields, we are clearing wrong bits Message-ID: <20210321162500.GA26497@amd> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Bitfield manipulation in enetc_mac_config() looks wrong. Fix it. Untested. Signed-off-by: Pavel Machek (CIP) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index 224fc37a6757..b85079493933 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -505,7 +505,7 @@ static void enetc_mac_config(struct enetc_hw *hw, phy_interface_t phy_mode) if (phy_interface_mode_is_rgmii(phy_mode)) { val = enetc_port_rd(hw, ENETC_PM0_IF_MODE); val &= ~ENETC_PM0_IFM_EN_AUTO; - val &= ENETC_PM0_IFM_IFMODE_MASK; + val &= ~ENETC_PM0_IFM_IFMODE_MASK; val |= ENETC_PM0_IFM_IFMODE_GMII | ENETC_PM0_IFM_RG; enetc_port_wr(hw, ENETC_PM0_IF_MODE, val); }