Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2625104pxp; Mon, 14 Mar 2022 00:54:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqOi8R/ILanb8op2Corlva4zFqMGyMkKtQi+wB10p7tQt+wVUW7QaQHaXOU0xwCWj9iBVN X-Received: by 2002:a63:1c15:0:b0:372:ffcd:4d21 with SMTP id c21-20020a631c15000000b00372ffcd4d21mr19005273pgc.450.1647244453760; Mon, 14 Mar 2022 00:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647244453; cv=none; d=google.com; s=arc-20160816; b=dXYz1z2i+Avg+JlEGMokOJxm9nwfNHyVEsBXJ8PDl4dsVK3swJJu5mcredayF9/dKl GdOfgUDkHEMqxd4bBoZNyOqMOjQszlezdv5waTWTJQu9DMJZLyWwIgo8lIr6v/0pYyUR uZeZAeFw54A0Ef4wtTpMVgYK7OBE4fLD07wsAtI+fliF41Bx9xkj7TmWD/EA1ji4dsHa edIoaQV7W+HJYEB1qYQ4Eg3DneIX5aU+nq2hqd5eh5MXGYx6KL45/I8l0vh2Xfkl7dEb dAXQeQfRfuHEly/TbCV5lzJ8/gK0tsWESgypNJZI4WkqQQHYfdoH1dYZx5K6hkoPp+fS 9GJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SYLJecFzMoXae9Yd63DSIRQsBWaqYrsKU+5452Z4zcQ=; b=kfR6Zggwaqqrdh+qfatjQTOqSVBkayExklXwxxZMSsJMX7HzmQus4xbPKk8WU7iufj l+PWFT2/t9oAwJXUxJfLxTAQznN7CATijNRVB1BCFa/B+/fWFLHp0I93rkYmukafp7Ny zg/T+NDq9/hru6fRCgYNlZ/WQegbl4dqIOt1zfrqjbyWmsamsWZ/mZEI0+s7AJWUcClH pqhKDa6/8ktLS5/x0U6eoguFL5+GBInY3lWH1DW5HgYUF+etqIFh0mj5Rp8H5vdsC0wL VEhQqC+5or3KCO1ocvzDgSwR11fU9Mr68uLUZWOX39ScKlHC1J2I67l9B8vqunVerHJX Acjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=AECFhEzb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt18-20020a17090af2d200b001bf552c46d4si11451387pjb.173.2022.03.14.00.53.55; Mon, 14 Mar 2022 00:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=AECFhEzb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234687AbiCMOx0 (ORCPT + 99 others); Sun, 13 Mar 2022 10:53:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230290AbiCMOxZ (ORCPT ); Sun, 13 Mar 2022 10:53:25 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3663D8879A; Sun, 13 Mar 2022 07:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=SYLJecFzMoXae9Yd63DSIRQsBWaqYrsKU+5452Z4zcQ=; b=AECFhEzbz4hZ9WbIJVzXpFpbKH kidJPcYSinNrYvzgsSMIytPZjpRanYKa7XnHlYUxM2QtD/A3TK2LpQKi5q7PNg+mlwYh2LfC5Vvqu JX55NxICbc6nzjMLUm/evTnRuIp+a0JiiPdOqBuzUxuwWax+z5zkCZuSpZgo0f2lmsGA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nTPZs-00AdA3-1f; Sun, 13 Mar 2022 15:52:12 +0100 Date: Sun, 13 Mar 2022 15:52:12 +0100 From: Andrew Lunn To: Michael Walle Cc: "David S . Miller" , Jakub Kicinski , Rob Herring , Krzysztof Kozlowski , Heiner Kallweit , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 2/3] net: mdio: mscc-miim: replace magic numbers for the bus reset Message-ID: References: <20220313002153.11280-1-michael@walle.cc> <20220313002153.11280-3-michael@walle.cc> <7cbe529d46c64b01eb99c016d9f16f1a@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7cbe529d46c64b01eb99c016d9f16f1a@walle.cc> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 13, 2022 at 02:17:55AM +0100, Michael Walle wrote: > Am 2022-03-13 01:51, schrieb Andrew Lunn: > > > diff --git a/drivers/net/mdio/mdio-mscc-miim.c > > > b/drivers/net/mdio/mdio-mscc-miim.c > > > index 64fb76c1e395..7773d5019e66 100644 > > > --- a/drivers/net/mdio/mdio-mscc-miim.c > > > +++ b/drivers/net/mdio/mdio-mscc-miim.c > > > @@ -158,18 +158,18 @@ static int mscc_miim_reset(struct mii_bus *bus) > > > { > > > struct mscc_miim_dev *miim = bus->priv; > > > int offset = miim->phy_reset_offset; > > > + int mask = PHY_CFG_PHY_ENA | PHY_CFG_PHY_COMMON_RESET | > > > + PHY_CFG_PHY_RESET; > > > > > - ret = regmap_write(miim->phy_regs, > > > - MSCC_PHY_REG_PHY_CFG + offset, 0x1ff); > > > + ret = regmap_write(miim->phy_regs, offset, mask); > > > > Is mask the correct name? It is not being used in the typical way for > > a mask. > > It is the mask of all the reset bits, see also patch 3/3. Either all > these bits are set or none. Yes, it is you just don't use it in the typical way for a mask foo = bar & mask; The name mask made me look for a read-modify-write or similar. And that then makes me thing of race conditions. > Do you haave any suggestion? value everywhere? Or phy_reset_bits? Andrew