Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6361484rwb; Wed, 18 Jan 2023 04:20:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXsKnXVck5vp7qe+ZJlVc5YvE6kzISFEtE2N1tgixL+Xje1KC2Sk4UNCMcbL9A3j8WigVQZa X-Received: by 2002:a17:906:eb06:b0:871:8a18:d0a7 with SMTP id mb6-20020a170906eb0600b008718a18d0a7mr6489912ejb.68.1674044440014; Wed, 18 Jan 2023 04:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674044439; cv=none; d=google.com; s=arc-20160816; b=LG73uVKCct6YNcjXFYGyGZmcX+0TidReF2QXnNqTNwVdo1M2qbDTN1Nf1trBWRjp/L aTLlGtyct3mmn/D7M1pU/YU1aIW3NgUS6wl/Fum8M3BCLEY20Rcb+nyu0AChgHPRADHW XwUaEO34fuVUjiHBCScF0umssq6myx2X28XHj/sNAmuJaYHrLHESqZPt2GTwubF41ZT6 lflSwFDSpsEbDsCPw7D5xcMFEJrL+J/eOEx68wuS52vgPwh4PYv4hrGKtgL4MRHseY4+ A6ntc8HOcSs1frTNnXoO2Rc1T+YrRD6htPPohqsDABXYYyqLDUxsrChkEdFAVUMXD0uY pvfw== 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=A3CMEGjNC4kTbgjbRO+64OkdzqoJFohtC5/wg3RnfnM=; b=vPuqafSqDwngQkOIip0KKoaJYLJmWX/A6aTvCcHm7f30UXsdkR55CpODZHXipYO7vD wAJasVaYWeGG3Jqotvm5qhRGGXuuCA6zI7SdQwmfrBRkvLoq26Bx1QnRmjlvGafgX3c/ l0L0dNfm+kD8+GS+1aHHILnze89IcWVMORH/ScLIfdU/DcAZCkqOWMXf2Md3fBZ4VNcU yjp86PsRbVTvNLw4MKsJjiyUumrkAOiMn17ARAAa2EV7gDdvBnYtZBTNtpAijamJHibN AItXenMrILDaUpMiPZgM6roGqdf2ly3jI1lYSZ6KytEh45TXTOTcqRVgDhrqCwZbTF46 FsQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y49XCDlG; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd38-20020a1709076e2600b008725a1034d3si6533436ejc.85.2023.01.18.04.20.29; Wed, 18 Jan 2023 04:20:39 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=Y49XCDlG; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230390AbjARMLe (ORCPT + 45 others); Wed, 18 Jan 2023 07:11:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230395AbjARMKB (ORCPT ); Wed, 18 Jan 2023 07:10:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61D7E4391E; Wed, 18 Jan 2023 03:30:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1B429B81C38; Wed, 18 Jan 2023 11:30:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3B4EC433F1; Wed, 18 Jan 2023 11:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674041403; bh=AHP0LcYttnqUZ4+wG/53i7rfpAMEuP+Lz9vHvX11KZ8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y49XCDlG2rX3zfzVwQuJaNH+ERr6vrX9uln5ggGfcFklApsCqIfvJ2supnp5M7PgK A90P2AyUGb2eEaFQWgfxvcE/ioa8pPWCCaqvxB1iWfiM3jn5XX2o7cB7WLIhReJVpQ 8m0Ry/xMnW+iUkiytRh300QFwYO0N1wtrx827D1QNnrxijBgKSZw/3m1zP8gkWBKkl yLsgaR4mZsu8mUYuYlI+dqQEChc8vy93/Z5SwXXdOb7TUkOx/t8d1hBuMqVkYjCpGr ofwkTCG+DMIheoBmTw9gQgNl7JRhSZGw/0oZM/95xBNwQpxlpf9LIKtYQOhqaA+DzQ 6uVNmlHX1YdJA== Date: Wed, 18 Jan 2023 13:29:57 +0200 From: Leon Romanovsky To: Siddharth Vadapalli Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, linux@armlinux.org.uk, pabeni@redhat.com, rogerq@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, vigneshr@ti.com, srk@ti.com Subject: Re: [PATCH net-next v3 2/2] net: ethernet: ti: am65-cpsw/cpts: Fix CPTS release action Message-ID: References: <20230118095439.114222-1-s-vadapalli@ti.com> <20230118095439.114222-3-s-vadapalli@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230118095439.114222-3-s-vadapalli@ti.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Wed, Jan 18, 2023 at 03:24:39PM +0530, Siddharth Vadapalli wrote: > The am65_cpts_release() function is registered as a devm_action in the > am65_cpts_create() function in am65-cpts driver. When the am65-cpsw driver > invokes am65_cpts_create(), am65_cpts_release() is added in the set of devm > actions associated with the am65-cpsw driver's device. > > In the event of probe failure or probe deferral, the platform_drv_probe() > function invokes dev_pm_domain_detach() which powers off the CPSW and the > CPSW's CPTS hardware, both of which share the same power domain. Since the > am65_cpts_disable() function invoked by the am65_cpts_release() function > attempts to reset the CPTS hardware by writing to its registers, the CPTS > hardware is assumed to be powered on at this point. However, the hardware > is powered off before the devm actions are executed. > > Fix this by getting rid of the devm action for am65_cpts_release() and > invoking it directly on the cleanup and exit paths. > > Fixes: f6bd59526ca5 ("net: ethernet: ti: introduce am654 common platform time sync driver") > Signed-off-by: Siddharth Vadapalli > --- > drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 ++ > drivers/net/ethernet/ti/am65-cpts.c | 15 +++++---------- > drivers/net/ethernet/ti/am65-cpts.h | 5 +++++ > 3 files changed, 12 insertions(+), 10 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky