Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5161025pxb; Mon, 28 Mar 2022 08:47:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxScj4uWwwk1ldUXQnPzBqNB8Z8zhZ0SSx/tNxum+2dGrxKj0UzQ3M7qZprQIdE6flU4lKS X-Received: by 2002:a17:906:4fcb:b0:6e0:55b7:179 with SMTP id i11-20020a1709064fcb00b006e055b70179mr29375804ejw.159.1648482436810; Mon, 28 Mar 2022 08:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648482436; cv=none; d=google.com; s=arc-20160816; b=RL3c2jKxgonzoS5tG4ugyqmIQ+IdSCDqspUZ0jU0bgMoYhV+HBCcT+Uu1rQtC5PhXg e9K1v+rPDNNC26Vb5BVkJ0b80LNqj2dOl25nDt1g8pUCzRV8dkqfZq/OFYEhLi5g4ag6 KSibiAlJeXW7AoyjZBWnIMScJrh56/OyK9Zvcyhna04neEISuBBk0dj0F2qI0zpqel2j atcQpOgNGzu7G9qpzFju/RGqdCLyIg4sB6x06mfi+Zg79iqFu6NQOWPTUQa6gkV1YesE SrG85SVxkirHFWv84az9qRmqP7bu+Lx4MnUvQJZM+NzP8EbDrHQKApRtsNdtoqkmbpTV YqcQ== 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=emVq8fUjWce333B85VW9zsY10Mr1PEvsIJ2jYK1KaaQ=; b=Mlm1JxXulgpjLvf5HbfMAAOzKrwwOO+IpKYh+A0dPw3Ds9/4J42XIyUcm9TxvwGJcB cX3ZpMProeawsuECb9jI9PK6Pky+S8nY1tFiE3hiKHlC3eXRYacwsOOhSccQU5RY2Rue E8aSvva8tx06BjD18JceFyyNfvb9e4WpHdZjNN7YdqmaH0eBzFM2JToYIvynP06QH011 7cIm6vkpRjFacnp5qKgWybZsHXw2uA2FLAck3ELdQVIL29cJji06yXWvPqwz0W61D30C ehdF0r4VaUHZqzehgg5RhioYN7NVuxWONXJzyHMaNC4O1VmJo93IF7VZYPVNEFuy6xw9 Gjsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SHrYdVNS; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h22-20020a170906719600b006df76385d7asi12766538ejk.538.2022.03.28.08.46.49; Mon, 28 Mar 2022 08:47:16 -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=@ti.com header.s=ti-com-17Q1 header.b=SHrYdVNS; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239192AbiC1IQF (ORCPT + 99 others); Mon, 28 Mar 2022 04:16:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239182AbiC1IQE (ORCPT ); Mon, 28 Mar 2022 04:16:04 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF1412776; Mon, 28 Mar 2022 01:14:23 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 22S8Dv3o014064; Mon, 28 Mar 2022 03:13:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1648455237; bh=emVq8fUjWce333B85VW9zsY10Mr1PEvsIJ2jYK1KaaQ=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=SHrYdVNSZ0zUykJdOs5qHsLqJAeZenV8dc/Ow28XkeO/xM1+2VF3q+iOZ858xLk/O 1G5onBYI4tu3ZyaNs80sTkvmuHr5TN23g+733CnKKDLdbqPhNqJOXfSvpeCUwkUR3z 14l2RzMJael1WkhATupz+CI+2FJyTrSb4IxUPNkg= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 22S8Dv3M106347 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Mar 2022 03:13:57 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 28 Mar 2022 03:13:57 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE101.ent.ti.com (10.64.6.22) 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; Mon, 28 Mar 2022 03:13:57 -0500 Received: from [10.250.232.209] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 22S8Dr0C018651; Mon, 28 Mar 2022 03:13:53 -0500 Message-ID: <300da7e6-a72f-e7a1-f430-e1e26752594f@ti.com> Date: Mon, 28 Mar 2022 13:43:51 +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> <846b6171-2acd-1e03-8cd8-827bf5437636@ti.com> <20220327083012.GA3254@localhost> From: Siddharth Vadapalli In-Reply-To: <20220327083012.GA3254@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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,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 Hi Raag, On 27/03/22 14:00, Raag Jadav wrote: > On Thu, Mar 24, 2022 at 03:36:02PM +0530, Siddharth Vadapalli wrote: >> 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. >> > > Maybe this is what you're looking for. > https://www.spinics.net/lists/netdev/msg768517.html Thank you for pointing me to the thread. I will follow up regarding the progress of the autonegotiation feature on that thread. Regards, Siddharth