Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp607194imm; Fri, 14 Sep 2018 03:39:08 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb9Ky4NU6gOfduwGCZBm2Md2sjCg/fI9mPTJFqFwKl7hf0bbLf29u//SjnAvivDlf/Uc2Lw X-Received: by 2002:a63:6ce:: with SMTP id 197-v6mr10994603pgg.338.1536921548317; Fri, 14 Sep 2018 03:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536921548; cv=none; d=google.com; s=arc-20160816; b=eXsMNH4JyngSOaskkx2+qWQUSE4x+l4drD+8as8xOp3SP2JtPQiw+fljlT0tISE7BE 2qkv3pzgnxY0Sjlt8KKmBmcYildpOC0qOPYPz1F7M1bbm5J8UDygmmhC/vcv8o/vCpX/ dNIikA6yPuqPqLETHXr3WHepb79IFxVfMkmYvErB9NQEv/b+6Oq5Ln4uFrmAL2pp+wrp MFMYoZNtVtXdlFCu7BCLKp3Tbys8RPHbym8IeeBKmD0YD6rbW60KZIN48Apk0R8165yQ f7FvgRuEvYHRHh0McsbdPzCSVTIyNdxqfZVceeBgvePw4BtV//8yIh0kvdOQ5DTB8rMl uXOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=5U6OV2nGkD3upLu1SglBeH5ERccWvoufs1IZ82SHwGI=; b=0PvfsHFbO9URK8EhQW0zEj5yWKiFznHGUsHrniGIBYeo4/+qzFzAVw7H24Uy1+03wK PI0w/R7wUT2e6AzJu+KFKCCF/0IiK73JhWdgvkBuPngXEl7srAYQWRgLBUA1198JPyn+ ruTm4dvW9BsaS1oGhFx0nAhkuHJvwjSXRsr50zquxjB0jnjSfcN1PC8GPak08MEYyrOq JdWAYL4qMD0qNoLSDI12/SVOFKZ1iVfso/tpmfMUU9W2F58Km18LG6Hlxk/cKswChG60 iMBB8X2xIn05UU8XOBEm1x+xKxpKWp42HSGliP2jr7/H/lQ2C4TB0tIHx0k3caKTf+Fs gcyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18-v6si7009113pfk.78.2018.09.14.03.38.52; Fri, 14 Sep 2018 03:39:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728241AbeINPwR (ORCPT + 99 others); Fri, 14 Sep 2018 11:52:17 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:49221 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbeINPwR (ORCPT ); Fri, 14 Sep 2018 11:52:17 -0400 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1g0lUN-0004Cd-E5; Fri, 14 Sep 2018 12:38:15 +0200 Message-ID: <1536921493.4112.6.camel@pengutronix.de> Subject: Re: [PATCH] ARC: HSDK: improve reset driver From: Philipp Zabel To: Eugeniy Paltsev Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Alexey Brodkin Date: Fri, 14 Sep 2018 12:38:13 +0200 In-Reply-To: <20180827143803.28178-1-Eugeniy.Paltsev@synopsys.com> References: <20180827143803.28178-1-Eugeniy.Paltsev@synopsys.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eugeniy, On Mon, 2018-08-27 at 17:38 +0300, Eugeniy Paltsev wrote: > As for today HSDK reset driver implements only > .reset() callback. > > In case of driver which implements one of standard > reset controller usage pattern > (call *_deassert() in probe(), call *_assert() in remove()) > that leads to inoperability of this reset driver. > > Improve HSDK reset driver by calling .reset() callback inside of > .assert()/.deassert() callbacks to avoid each reset controller > user adaptation for work with both reset methods > (reset() and .assert()/.deassert() pair) > > Signed-off-by: Eugeniy Paltsev > --- > drivers/reset/reset-hsdk.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/reset/reset-hsdk.c b/drivers/reset/reset-hsdk.c > index 8bce391c6943..1fd91df91343 100644 > --- a/drivers/reset/reset-hsdk.c > +++ b/drivers/reset/reset-hsdk.c > @@ -86,6 +86,8 @@ static int hsdk_reset_reset(struct reset_controller_dev *rcdev, > > static const struct reset_control_ops hsdk_reset_ops = { > .reset = hsdk_reset_reset, > + .assert = hsdk_reset_reset, This is incorrect for exclusive reset controls. It will cause reset_control_assert() to return success for exclusive reset controls, even though the .assert op failed to leave the reset line asserted after the function returns. While calling hsdk_reset_reset from .assert for shared reset controls would be fine, I don't see how this is necessary of useful. If a consumer driver requires the reset to be asserted upon remove(), it must not request a shared reset control anyway, because with shared reset controls other drivers may keep the reset line deasserted indefinitely. > + .deassert = hsdk_reset_reset, This should be fine. I wonder from time to time whether this should be implemented in the core, in reset_control_deassert(). regards Philipp