Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3088837pxb; Mon, 9 Nov 2020 02:07:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxzqbSLHhVDcMqHl45V4zkptsX1hwRgXR7Ullqq58sooR7fLr6G7kHWJaoF3SLdrQrdnAF X-Received: by 2002:aa7:df81:: with SMTP id b1mr14192207edy.365.1604916479306; Mon, 09 Nov 2020 02:07:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604916479; cv=none; d=google.com; s=arc-20160816; b=RzlkjcxliIqf+VxGOzx6G4fzyfpbtVBhG3hxdBGmnwSwrj5ZIVuo1CFoodXkeQxxrW NNyyE9xjZuO209NU8sf2dCUuY/B1ULpfJsjXsVlYVVCxebW6upPwI1AB7sVhRrgCh7KN h7V/hlxWpOFTSQA+n1UEaUXqY8SZUU3SDe8kOnmlKAKbpj/1Icuv2ZH3XxCnuXdMGn2F nZGQHXeZfB1Raon5uTjN1fSRXIwnArJC/YyW9D9uRyLiMQTqHw9GdrZ/51fdfinLmOE3 z1SSKn1LjQcCi/si7qo1HAtzkgpERxXTaLtUID32gTlalgXrKmb+xx1hZN/JZoC6UCRQ SZ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=h4mSWUU9ovjWdm7rX96K2XxWC+6XG2XmsjG34xkYeVU=; b=CKR3jEsBbgUBWwKFaekCz5hzQTMbSu27uyy3V3XCXdr0F0FM8WK1FWpa15c6hlVx4s kyRIbRxTcJL1cM82KuVs1A+reKn6EZnVIrHOqqS1YjOuGx+MmZ/Ze1tK7/XFAC2j0Csh YOtc4ADd+MwUAiQvOQP4tg/u+s3pl+v9QZRDlo8G0Z565G66tp9WMdL/9PrzdgErVI5o JiTgKLcH/6ffX+UmFmtVIDZIxKDbWjcR+GLG6Sd/z/TvoofQU2jI8ypbwAVPvGgIrBJ8 3RJfJIx8KuPxtvPXVKD+S+GIdSCHAecP/FLNiUQ4ltFbACxaAntpW8GZmwf8gr3u8Ee8 ZYJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e8si2972337ejd.368.2020.11.09.02.07.36; Mon, 09 Nov 2020 02:07:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729208AbgKIKFp convert rfc822-to-8bit (ORCPT + 99 others); Mon, 9 Nov 2020 05:05:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729146AbgKIKFp (ORCPT ); Mon, 9 Nov 2020 05:05:45 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52BCEC0613CF for ; Mon, 9 Nov 2020 02:05:45 -0800 (PST) Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kc43P-0003ON-5h; Mon, 09 Nov 2020 11:05:39 +0100 Received: from pza by lupine with local (Exim 4.92) (envelope-from ) id 1kc43N-0008T4-Py; Mon, 09 Nov 2020 11:05:37 +0100 Message-ID: <64aa1f860bf60ddac7a2015c87896c8a7b13b161.camel@pengutronix.de> Subject: Re: [PATCH v2 1/2] reset: brcmstb rescal: implement {de}assert() instead of reset() From: Philipp Zabel To: Jim Quinlan , Hans de Goede , Jens Axboe , bcm-kernel-feedback-list@broadcom.com Cc: Florian Fainelli , "moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE" , open list , Amjad Ouled-Ameur Date: Mon, 09 Nov 2020 11:05:37 +0100 In-Reply-To: <20201106191743.40457-2-james.quinlan@broadcom.com> References: <20201106191743.40457-1-james.quinlan@broadcom.com> <20201106191743.40457-2-james.quinlan@broadcom.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jim, On Fri, 2020-11-06 at 14:17 -0500, Jim Quinlan wrote: > Before, only control_reset() was implemented. However, the reset core only > invokes control_reset() once in its lifetime. Because we need it to invoke > control_reset() again after resume out of S2 or S3, we have switched to > putting the reset functionality into the control_deassert() method and > having an empty control_assert() method. > > Signed-off-by: Jim Quinlan You are switching to the wrong abstraction to work around a deficiency of the reset controller framework. Instead, it would be better to allow to "reactivate" shared pulsed resets so they can be triggered again. Could you please have a look at [1], which tries to implement this with a new API call, and check if this can fix your problem? If so, it would be great if you could coordinate with Amjad to see this fixed in the core. [1] https://lore.kernel.org/lkml/20201001132758.12280-1-aouledameur@baylibre.com/ regards Philipp > --- > drivers/reset/reset-brcmstb-rescal.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/reset/reset-brcmstb-rescal.c b/drivers/reset/reset-brcmstb-rescal.c > index b6f074d6a65f..1f54ae4f91fe 100644 > --- a/drivers/reset/reset-brcmstb-rescal.c > +++ b/drivers/reset/reset-brcmstb-rescal.c > @@ -20,8 +20,8 @@ struct brcm_rescal_reset { > struct reset_controller_dev rcdev; > }; > > -static int brcm_rescal_reset_set(struct reset_controller_dev *rcdev, > - unsigned long id) > +static int brcm_rescal_reset_deassert(struct reset_controller_dev *rcdev, > + unsigned long id) > { > struct brcm_rescal_reset *data = > container_of(rcdev, struct brcm_rescal_reset, rcdev); > @@ -52,6 +52,12 @@ static int brcm_rescal_reset_set(struct reset_controller_dev *rcdev, > return 0; > } > > +static int brcm_rescal_reset_assert(struct reset_controller_dev *rcdev, > + unsigned long id) > +{ > + return 0; > +} > + > static int brcm_rescal_reset_xlate(struct reset_controller_dev *rcdev, > const struct of_phandle_args *reset_spec) > { > @@ -60,7 +66,8 @@ static int brcm_rescal_reset_xlate(struct reset_controller_dev *rcdev, > } > > static const struct reset_control_ops brcm_rescal_reset_ops = { > - .reset = brcm_rescal_reset_set, > + .deassert = brcm_rescal_reset_deassert, > + .assert = brcm_rescal_reset_assert, > }; > > static int brcm_rescal_reset_probe(struct platform_device *pdev)