Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11161101ybi; Thu, 25 Jul 2019 11:03:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXV9lhEDS+V9H1dF4uih8iw0sBuT+MRtEYL+JdbAfxC/+vRtWn9OdBmWinur4H9n5dt3tl X-Received: by 2002:a17:902:7d8b:: with SMTP id a11mr38720944plm.306.1564077803157; Thu, 25 Jul 2019 11:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564077803; cv=none; d=google.com; s=arc-20160816; b=oQ2tVX2XQSQsFbAeEka4i77HR1Q7Kj4s+TQQIv8TZTuiVW7grrzzBN9diU1cFMPfij 5X6Y0Mozj5g5pq3kabGJxJXS3fgGg6EnMrn2TMMkVZMQTA+ZR2hlI6qr7DYAC9P3XTlw HfPYe26qOO/zD24VpDSkE3R1lk26jVwO9zEtvIZAKUjk3DkXG3jxm5jwGE82aQoKpkge b0hr1yJfihs0b2NT5gjym5I8qF66bvPjF4jpSzVv5e09ogqxJZWitqXlD4eUA6SvJzWs BZGMkiTaNgC79Z8aCFdnAfWU/dm89gokovfn5QLP3UMCnpG8a60QkVNaB4cxiB3Ugd4m f6ZQ== 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:cc:to:subject :message-id:date:from:reply-to:in-reply-to:references:mime-version :dkim-signature; bh=p9OR61FicIpVENd/71fr74aLBznslcDzFyCpkAgUAXc=; b=KQOgL+2G42YRU2QAj11sznTAuHU4BknRcZipKEaBSpawRdRj7XX36UwNbhlFpxkrWx ULTUREvZHb5VKVM4ZLEgYR8aiPjNuO5sNnJScrrBeBS+nOr4qa0r+Btd0ZHGjKdbq4on Zb/d+xxEFZYMEeqGcMEzFJNSpEhWKzI7psNzhA3e+NOi+mwKfb+l+B8SbQPYS5xi09i5 UKxecbfKZIBAIK17WM3bapoN6cVr701Ea7tiXUl62Am/cX7QaAl7IUG33HGyAFxXdRVO eipXOA70/VcgiK/R2UKqtcuIw00/fk9ypjilew6QkfoK7sBg+DnwSR3wAJ2UJMdkK7QR 9geg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QpF6BdCi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s14si19534169pgj.347.2019.07.25.11.02.52; Thu, 25 Jul 2019 11:03:23 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QpF6BdCi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388884AbfGYPAB (ORCPT + 99 others); Thu, 25 Jul 2019 11:00:01 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38609 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388374AbfGYPAB (ORCPT ); Thu, 25 Jul 2019 11:00:01 -0400 Received: by mail-lj1-f196.google.com with SMTP id r9so48317540ljg.5; Thu, 25 Jul 2019 07:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=p9OR61FicIpVENd/71fr74aLBznslcDzFyCpkAgUAXc=; b=QpF6BdCinO8sSU+WgwVqhTBRehdNQtib+EoE3soWMylfDlEr7ExQR6aPDum3wSyomO YjvZHhKphEW9EvLI+saojKFniOHKA2wjO4m2MIh/dEBr82C/sZIL9KLeDDVlhcJaZjbU 4YMf32NobArfgLnsmOTI4uAUgcPoo9s12i65I023l8RYJ8s18KSHHdOQsaIsBRh3JEiA TwZ55d1Eln05YRaSbpfpRcuQ8uLXh2ZNprhmG8BfsBxq/RjNvFhqBWGgW3vX7DKt3mtc UqzbXF2+OgEuSmOr4S+gW1cA2J707vr1vY0nG1Ph5wxT5BKtVL5GBhYe94vSiSH7AWib jLVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=p9OR61FicIpVENd/71fr74aLBznslcDzFyCpkAgUAXc=; b=EV2nrpFgfwE/A5uNlXmmEfV2W5d+tgps9I3gbSINEzYORttBaLGtSxBlTtqeL2rTwR vYx4qLtUrWBtziST/ZkKCis+zix0lYpkBBCfwz0eROw51mQurC/v4iBOoXynONvl+V4u Mk8ZikzGgooLFHcGC75wg7vxdevfHphZR01effMnClrs8swALoHnCHkeOi+nxJyFh11/ o3TUC7v7Nu4myO4tByom+Lsxy2+4zoqkVaT4VgEXXUVtvCnbmBrZRmCKuDOuqJkuNiwq ZMpEL9jYnLJgubleojn2gE4mD+sFxxJVBb/L9jrFcQlpDCZrKlyD71Q5a+yumylFijM+ XImQ== X-Gm-Message-State: APjAAAXKmjtQN7svYtxPTBZjPt8NPcXg7DbWIm7uRF+Wuu4VOqbYalCb AxVD0UwIRDcIpBcGdV75R37WaG2wd8gIYbsgoSw= X-Received: by 2002:a2e:b0e6:: with SMTP id h6mr44378736ljl.18.1564066797851; Thu, 25 Jul 2019 07:59:57 -0700 (PDT) MIME-Version: 1.0 References: <20190725144300.25014-1-k.konieczny@partner.samsung.com> <20190725144300.25014-2-k.konieczny@partner.samsung.com> In-Reply-To: <20190725144300.25014-2-k.konieczny@partner.samsung.com> Reply-To: cwchoi00@gmail.com From: Chanwoo Choi Date: Thu, 25 Jul 2019 23:59:21 +0900 Message-ID: Subject: Re: [PATCH v4 1/5] devfreq: exynos-bus: correct clock enable sequence To: Kamil Konieczny Cc: Bartlomiej Zolnierkiewicz , Marek Szyprowski , Chanwoo Choi , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Mark Rutland , MyungJoo Ham , Nishanth Menon , Rob Herring , Stephen Boyd , Viresh Kumar , devicetree , linux-arm-kernel , linux-kernel , Linux PM list , linux-samsung-soc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, You are missing my Acked tag. 2019=EB=85=84 7=EC=9B=94 25=EC=9D=BC (=EB=AA=A9) =EC=98=A4=ED=9B=84 11:44, = =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > Regulators should be enabled before clocks to avoid h/w hang. This > require change in exynos_bus_probe() to move exynos_bus_parse_of() > after exynos_bus_parent_parse_of() and change in error handling. > Similar change is needed in exynos_bus_exit() where clock should be > disabled before regulators. > > Signed-off-by: Kamil Konieczny > --- > Changes: > v4: > - move regulator disable after clock disable > - remove unrelated changes > - add disabling regulators in error path in exynos_bus_probe() > > --- > drivers/devfreq/exynos-bus.c | 31 +++++++++++++++++-------------- > 1 file changed, 17 insertions(+), 14 deletions(-) > > diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c > index 486cc5b422f1..f34fa26f00d0 100644 > --- a/drivers/devfreq/exynos-bus.c > +++ b/drivers/devfreq/exynos-bus.c > @@ -194,11 +194,10 @@ static void exynos_bus_exit(struct device *dev) > if (ret < 0) > dev_warn(dev, "failed to disable the devfreq-event device= s\n"); > > - if (bus->regulator) > - regulator_disable(bus->regulator); > - > dev_pm_opp_of_remove_table(dev); > clk_disable_unprepare(bus->clk); > + if (bus->regulator) > + regulator_disable(bus->regulator); > } > > /* > @@ -386,6 +385,7 @@ static int exynos_bus_probe(struct platform_device *p= dev) > struct exynos_bus *bus; > int ret, max_state; > unsigned long min_freq, max_freq; > + bool passive =3D false; > > if (!np) { > dev_err(dev, "failed to find devicetree node\n"); > @@ -399,27 +399,27 @@ static int exynos_bus_probe(struct platform_device = *pdev) > bus->dev =3D &pdev->dev; > platform_set_drvdata(pdev, bus); > > - /* Parse the device-tree to get the resource information */ > - ret =3D exynos_bus_parse_of(np, bus); > - if (ret < 0) > - return ret; > - > profile =3D devm_kzalloc(dev, sizeof(*profile), GFP_KERNEL); > - if (!profile) { > - ret =3D -ENOMEM; > - goto err; > - } > + if (!profile) > + return -ENOMEM; > > node =3D of_parse_phandle(dev->of_node, "devfreq", 0); > if (node) { > of_node_put(node); > - goto passive; > + passive =3D true; > } else { > ret =3D exynos_bus_parent_parse_of(np, bus); > + if (ret < 0) > + return ret; > } > > + /* Parse the device-tree to get the resource information */ > + ret =3D exynos_bus_parse_of(np, bus); > if (ret < 0) > - goto err; > + goto err_reg; > + > + if (passive) > + goto passive; > > /* Initialize the struct profile and governor data for parent dev= ice */ > profile->polling_ms =3D 50; > @@ -510,6 +510,9 @@ static int exynos_bus_probe(struct platform_device *p= dev) > err: > dev_pm_opp_of_remove_table(dev); > clk_disable_unprepare(bus->clk); > +err_reg: > + if (!passive) > + regulator_disable(bus->regulator); > > return ret; > } > -- > 2.22.0 > --=20 Best Regards, Chanwoo Choi