From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1EC0C19F2D for ; Fri, 12 Aug 2022 04:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236923AbiHLEge (ORCPT ); Fri, 12 Aug 2022 00:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236269AbiHLEgc (ORCPT ); Fri, 12 Aug 2022 00:36:32 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EA7D90812; Thu, 11 Aug 2022 21:36:29 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 27C4a93T002653; Thu, 11 Aug 2022 23:36:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1660278969; bh=rxFKTwMGkyTFRaVUJXNHx4g7Bh4686ASvFuE6UEmTcY=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=TvwUIMpdzKDHFRiVmpGW8fcgGULYcyRpuzfucv1Jw46NXZigCWdcyissD4AbF7b8F G0QlJK8z6sQvymG322ggJvlqmGTycbAZSGMaf2ed1YTm5g4GYUx5IQ0ymI2CxQ/DXR 3UK/5Xfn8lI7ATuyveDhUcjOMISvUTkoRgcTK8uk= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 27C4a9dh023830 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Aug 2022 23:36:09 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Thu, 11 Aug 2022 23:36:09 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) 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.2507.6 via Frontend Transport; Thu, 11 Aug 2022 23:36:09 -0500 Received: from [10.24.69.79] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 27C4a5R0003462; Thu, 11 Aug 2022 23:36:06 -0500 Message-ID: Date: Fri, 12 Aug 2022 10:06:05 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 net-next] net: ethernet: ti: davinci_mdio: Add workaround for errata i2329 Content-Language: en-US To: Andrew Lunn CC: , , , , , , , , , References: <20220810111345.31200-1-r-gunasekaran@ti.com> <9d17ab9f-1679-4af1-f85c-a538cb330d7b@ti.com> From: Ravi Gunasekaran In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> There is atleast one device sh_eth, which is not configured for autosuspend >> but uses the bit bang core in sh_mdiobb_read() and invokes regular runtime >> PM functions. > > And that is the point of moving it into the core. It would of just > worked for you. > > If you don't feel comfortable with making this unconditional, please > put runtime pm enabled version of mdiobb_read/mdiobb_write() in the > core and swap sh_eth and any other drivers to using them. > sh_eth is not configured for autosuspend and uses only pm_runtime_put(). davinci_mdio is configured for autosuspend and it must invoke pm_runtime_mark_last_busy() before calling pm_runtime_put_autosuspend(). So it looks like, there needs to be a runtime PM version of mdiobb_read/mdiobb_write() for each pm_runtime_put_*(). As of now, it's only sh_eth which is currently using runtime PM and davinci_mdio would be the next one. So at least in this case, two variants of mdiobb_read/mdiobb_write() could be added at the moment. By checking against the dev->power.use_autosuspend flag, it is possible to support both via a single version. That being said, I'm quite inclined towards the existing implementation, where drivers can have wrappers written around mdiobb_read/mdiobb_write(). But I might be failing to see the broader picture. If having multiple runtime PM versions of mdiobb_read/mdiobb_write() benefits many other future drivers, then I will go ahead and add the variant(s) in the bitbang core. Please provide your views on this. Your inputs on the next course of action would be helpful. -- Regards, Ravi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFB10C00140 for ; Fri, 12 Aug 2022 04:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1SnZncFssHzMtOho0RwAMqTCeK4R9cjZt+TcGD4kNCY=; b=VAC/JoevSdlPRN hqp3Bu15SUQ8KADiKbrBOasmgGZ5/l2Aq645crI8jzqq1s/RZrkBannICMliCt+lPBDCQV212VGR8 7xlSjh+OvQylEewwKKZEmzGrPnJ85kx3yo26Sb7/7IuBPTuXJ5LB86awMgN0Fc+t62ZVFZwtALb+X uklj+0t6359g0tb43n2Rp1pcdgKYgystVs0V4rS22JDOm3L28jDQ0YWu+qKDAS1exvoYAHvKPV8Fz tdqBEPfSS/Oz8e1Asyiba9y2ynwYNyYN5CUNewafH5UsqXijNC5eK58/dbMQveYkZ5QRMHK7t8qIP q+1SzMiVxUSPG8RjFnnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMMPK-00F61j-0q; Fri, 12 Aug 2022 04:36:26 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMMPD-00F5xd-VP for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2022 04:36:21 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 27C4a93T002653; Thu, 11 Aug 2022 23:36:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1660278969; bh=rxFKTwMGkyTFRaVUJXNHx4g7Bh4686ASvFuE6UEmTcY=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=TvwUIMpdzKDHFRiVmpGW8fcgGULYcyRpuzfucv1Jw46NXZigCWdcyissD4AbF7b8F G0QlJK8z6sQvymG322ggJvlqmGTycbAZSGMaf2ed1YTm5g4GYUx5IQ0ymI2CxQ/DXR 3UK/5Xfn8lI7ATuyveDhUcjOMISvUTkoRgcTK8uk= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 27C4a9dh023830 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Aug 2022 23:36:09 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Thu, 11 Aug 2022 23:36:09 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) 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.2507.6 via Frontend Transport; Thu, 11 Aug 2022 23:36:09 -0500 Received: from [10.24.69.79] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 27C4a5R0003462; Thu, 11 Aug 2022 23:36:06 -0500 Message-ID: Date: Fri, 12 Aug 2022 10:06:05 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 net-next] net: ethernet: ti: davinci_mdio: Add workaround for errata i2329 Content-Language: en-US To: Andrew Lunn CC: , , , , , , , , , References: <20220810111345.31200-1-r-gunasekaran@ti.com> <9d17ab9f-1679-4af1-f85c-a538cb330d7b@ti.com> From: Ravi Gunasekaran In-Reply-To: X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220811_213620_209103_0D3A927E X-CRM114-Status: GOOD ( 18.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org >> There is atleast one device sh_eth, which is not configured for autosuspend >> but uses the bit bang core in sh_mdiobb_read() and invokes regular runtime >> PM functions. > > And that is the point of moving it into the core. It would of just > worked for you. > > If you don't feel comfortable with making this unconditional, please > put runtime pm enabled version of mdiobb_read/mdiobb_write() in the > core and swap sh_eth and any other drivers to using them. > sh_eth is not configured for autosuspend and uses only pm_runtime_put(). davinci_mdio is configured for autosuspend and it must invoke pm_runtime_mark_last_busy() before calling pm_runtime_put_autosuspend(). So it looks like, there needs to be a runtime PM version of mdiobb_read/mdiobb_write() for each pm_runtime_put_*(). As of now, it's only sh_eth which is currently using runtime PM and davinci_mdio would be the next one. So at least in this case, two variants of mdiobb_read/mdiobb_write() could be added at the moment. By checking against the dev->power.use_autosuspend flag, it is possible to support both via a single version. That being said, I'm quite inclined towards the existing implementation, where drivers can have wrappers written around mdiobb_read/mdiobb_write(). But I might be failing to see the broader picture. If having multiple runtime PM versions of mdiobb_read/mdiobb_write() benefits many other future drivers, then I will go ahead and add the variant(s) in the bitbang core. Please provide your views on this. Your inputs on the next course of action would be helpful. -- Regards, Ravi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel