Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp897223rwl; Wed, 29 Mar 2023 09:47:36 -0700 (PDT) X-Google-Smtp-Source: AKy350aCzDL7n4V8u4/O30KuKX3YMIOcOgfph3unsfGsuGYLyHksgfxnkGb5an3f5TBupMubd9do X-Received: by 2002:aa7:8f24:0:b0:626:1b2a:7c0 with SMTP id y4-20020aa78f24000000b006261b2a07c0mr19022955pfr.17.1680108456530; Wed, 29 Mar 2023 09:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680108456; cv=none; d=google.com; s=arc-20160816; b=CsvecUhr84qri5AoYQYgb/FKrceQp2wBdtSG6WB1cc02wYi+Yv+6UC+pTX/2fI8iKw AhzicFfQ1StJ08YoBWU+wGwq5o7I2DTEhi2LRxKSmu5GwOE634o8o0Eob3oPBA4wOdat sBBR5ticlECXJ+5fPwNdGv57bH8lT6qztG3s+vOjcWttbf6UISl6QIjVZ8wFTnB7fCbY 5DcBH5bQ78fnkWDtKRSC4RC39DqqWB+VtEOH0+sDzOnHeUfBadN1VFG7jUZkEGGQ1Ign tfzXvPpK6I18lciSdzTSLHHW09Ni2Um9d7mdbZfldynbzNGgdMQ70JGwRKU78redR739 J0ow== 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=VsYhrL4QtC5ZNA+kq7n/KEZPoa+gL9m0J5D2VbucwVQ=; b=p8Jn6Qmn2Mpd6ny7x+3bpNUPajw3RxVpDCu7+v4FeP5Ayl1jaLedKqQuoTidCVfkEr SGQ6puaOfrwJWxrbqwKOTLW2ZnSLrfATuHOaVG9Sih+OEmGGNUtgM8lQ0vaCGqWG/kbQ f2mKQFzif6qChKj6b4vLVtKi1+cdyWRoCL6RBX5oomHJDmNdFu2lSF64B5bX6g9deMMF TpiL822mprJddz0Ld97oW7w+WucNX4XaNEgRWJyNWD65TAZfYZ1zwkzmmyxZh7xEZ9jf vHGZpajtmwBvPfcd9XqEpwWolcYD3MkwyAzo4SOQvLVBD2UQa/w6MeeqOH9kH1QjBz/V mdJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=yydGJAtS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t19-20020aa79473000000b0062d6f6569e1si8038320pfq.135.2023.03.29.09.47.24; Wed, 29 Mar 2023 09:47:36 -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=yydGJAtS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjC2QjJ (ORCPT + 99 others); Wed, 29 Mar 2023 12:39:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjC2QjI (ORCPT ); Wed, 29 Mar 2023 12:39:08 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF84CF0; Wed, 29 Mar 2023 09:39:07 -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=VsYhrL4QtC5ZNA+kq7n/KEZPoa+gL9m0J5D2VbucwVQ=; b=yydGJAtSK1nqRobhiENbWmwZLY 0rux+2yOz3bBQg9V1LLqsADGFqtceIQXhoXO1XvBzI2IB9eLT7PfoOgCEYLyf7uDUKzOZa8poZDii PIlK0ypB1cnReKyhNoMsdZTnyxxREExfqAuWOPoJmBst0iVZsJwDO9SJJAbTF6jUhGJk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1phYpD-008mdt-D6; Wed, 29 Mar 2023 18:39:03 +0200 Date: Wed, 29 Mar 2023 18:39:03 +0200 From: Andrew Lunn To: Daniel Golle Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel , Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau Subject: Re: [RFC PATCH net-next v3 11/15] net: dsa: mt7530: skip locking if MDIO bus isn't present Message-ID: <022e2a44-31de-4667-9474-6a8518ca030a@lunn.ch> References: <4e6d1cbba2ff16cad5b9ac48ccdf4407f45c7857.1680105013.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4e6d1cbba2ff16cad5b9ac48ccdf4407f45c7857.1680105013.git.daniel@makrotopia.org> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 Wed, Mar 29, 2023 at 04:59:47PM +0100, Daniel Golle wrote: > As MT7530 and MT7531 internally use 32-bit wide registers, each access > to any register of the switch requires several operations on the MDIO > bus. Hence if there is congruent access, e.g. due to PCS or PHY > polling, this can mess up and interfere with another ongoing register > access sequence. > > However, the MDIO bus mutex is only relevant for MDIO-connected > switches. Prepare switches which have there registers directly mapped > into the SoCs register space via MMIO which do not require such > locking. There we can simply use regmap's default locking mechanism. > > Hence guard mutex operations to only be performed in case of MDIO > connected switches. > > Signed-off-by: Daniel Golle Reviewed-by: Andrew Lunn Andrew