Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2155069pxb; Fri, 25 Mar 2022 12:04:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9yiA1226y+DQ4zk8LCeeU7ySQIRaT3pJNU9/AzLNzWWi6Xkf+T8s+t3pK+8JyvGYAlMvH X-Received: by 2002:a17:90a:9106:b0:1b9:115a:a2c1 with SMTP id k6-20020a17090a910600b001b9115aa2c1mr26566415pjo.80.1648235071951; Fri, 25 Mar 2022 12:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648235071; cv=none; d=google.com; s=arc-20160816; b=VyJvcvqlprM9WmmbVFKOt82QH04gU6q6zd7iGbBL6hXPM6AXU5BiedP0/VTB9aYR2t H5L5lF7/5NnuZhjzFRcGnUsSbNWghWDtlHyVMnWQi3vsmMaZwQx0nfRgMgVD5X5OMmvS Gb7d9mE3BzMhclN6gkaeNLUYdUaS7CR3phjoeTC8JTcjB8d5nfXavzbLcjz1kPO+m0iZ u09O0Htfw/LeJjHyjGwjjBs0qmwMMLekKqIE5S8rKbmmsf0dCBbKWhPap6UVmFcdBEv1 aNXcnH1IKHaUttauRsQbUyxbZ2+nN4fmhl6sQVbcvLl2/ytBLhS4TCDGTyRvKhvuNACU jtpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=XuSM+SWpQxW85C7aLKWpG8Av4KyR7imSTqKnTSbtJEA=; b=NtFRmi1innEv4bZIohR8L7fgk/1OOnlkjYTxbLS0PuNikhcR7+Uip3FV/o57QhjhDp LShQVJSrGL/+z462scOE7opLeKULcFDGXmZ9TvOj8KFcDtYyQJxIW8x7wGzki8iMhDnE o/z1z680ILY9yz8/rBFO1yDI4DyNLDWV7yWwpEn3ktuw6X2C7rTuitrPHiHitTRjmayS 3Aj86nYSSLz9FayzL9OcIvUzBKnCdCvjux1LJOmKYQZvBii+lCBvVv8lDqH6QuhNIu54 mK5YktKxO79wmkMD+qfkfPk/keI9QtcEydIPweA4J/ATlCbUbgss6sQY+6jxX7p7cNam nAJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gKUBRbj8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c17-20020a170902f31100b00153b2d165d9si2703519ple.481.2022.03.25.12.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:04:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gKUBRbj8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00B3F34646; Fri, 25 Mar 2022 11:13:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349395AbiCXKIE (ORCPT + 99 others); Thu, 24 Mar 2022 06:08:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349401AbiCXKH5 (ORCPT ); Thu, 24 Mar 2022 06:07:57 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14F889F6D7; Thu, 24 Mar 2022 03:06:24 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 22OA68Lc102802; Thu, 24 Mar 2022 05:06:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1648116368; bh=XuSM+SWpQxW85C7aLKWpG8Av4KyR7imSTqKnTSbtJEA=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=gKUBRbj8jYzcJDrf0q9Eo2WJTYr7WLGs4JLwD0SiUEnwk4XupZ7W/LdpSDsoQzYx8 cJcvkBmo/PF7BvMwvOnK1nmA9Px5ZYhc+79LBq/sXxZ8CDItPNVx2vpJGgsYtmkMOM e+rAhK+HMIWSLk0c8Fvftu8pVfe9X/SPef+bqjVE= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 22OA68kV024494 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 Mar 2022 05:06:08 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 24 Mar 2022 05:06:07 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Thu, 24 Mar 2022 05:06:07 -0500 Received: from [10.250.232.209] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 22OA63jT075746; Thu, 24 Mar 2022 05:06:04 -0500 Message-ID: <846b6171-2acd-1e03-8cd8-827bf5437636@ti.com> Date: Thu, 24 Mar 2022 15:36:02 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] net: phy: mscc: enable MAC SerDes autonegotiation Content-Language: en-US To: Raag Jadav CC: "Russell King (Oracle)" , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Steen Hegelund , Bjarni Jonasson , , References: <1644043492-31307-1-git-send-email-raagjadav@gmail.com> <20220226072327.GA6830@localhost> From: Siddharth Vadapalli In-Reply-To: <20220226072327.GA6830@localhost> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE 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 Hi Raag, On 26/02/22 12:53, Raag Jadav wrote: > On Thu, Feb 24, 2022 at 10:48:57AM +0000, Russell King (Oracle) wrote: >> Sorry for the late comment on this patch. >> >> On Sat, Feb 05, 2022 at 12:14:52PM +0530, Raag Jadav wrote: >>> +static int vsc85xx_config_inband_aneg(struct phy_device *phydev, bool enabled) >>> +{ >>> + int rc; >>> + u16 reg_val = 0; >>> + >>> + if (enabled) >>> + reg_val = MSCC_PHY_SERDES_ANEG; >>> + >>> + mutex_lock(&phydev->lock); >>> + >>> + rc = phy_modify_paged(phydev, MSCC_PHY_PAGE_EXTENDED_3, >>> + MSCC_PHY_SERDES_PCS_CTRL, MSCC_PHY_SERDES_ANEG, >>> + reg_val); >>> + >>> + mutex_unlock(&phydev->lock); >> >> What is the reason for the locking here? >> >> phy_modify_paged() itself is safe due to the MDIO bus lock, so you >> shouldn't need locking around it. >> > > True. > > My initial thought was to have serialized access at PHY level, > as we have multiple ports to work with. > But I guess MDIO bus lock could do the job as well. > > Will fix it in v2 if required. Could you please let me know if you plan to post the v2 patch? The autonegotiation feature is also required for VSC8514, and has to be invoked in vsc8514_config_init(). Let me know if you need my help for this. Regards, Siddharth