Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3938268ybg; Mon, 21 Oct 2019 00:55:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9DjewLPPLSUgo95mKHK8EpflfpQQyIbgAI7D/NKa18FkxBUMGE90kXsLAuYtmtx4kt9c0 X-Received: by 2002:a50:a227:: with SMTP id 36mr11484281edl.262.1571644503475; Mon, 21 Oct 2019 00:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571644503; cv=none; d=google.com; s=arc-20160816; b=EL4WpSKRLeyRKDU0OFR7TujD4PfrJhz/NKnyqvFXf3vmjK6TTiw575Uxo+2l3JlEm8 5NcxYdnqQNjBELy1RxAQwtYTEX4KTv5dy4AsvXFHNWPcbAYm2mldprdTKzA2JQU+Ydxq Mu4ozvSA/A+k6Ks6PD5kwgYKwowGl161BZlTbuj6l+JGB1/3iu+8oj7vFGljcNfEEPJW ywxnyQYdtLR6JDeTGspjuRwNR0/sN//qDxd8c9MO5al68hfilXRxBU7XC40xjZ8UOu82 K/9FasJ/9l01d5QUgXwwN114T6U94oDtPbMUd9GVNxZ2PdWLQqSL8+/Ud5TVW+FCnkwK z/+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lshseq5695iLMWS2/yTnU4q4phMFdnGbVyLcqMyDgNw=; b=wb0KX/H+U9FgWScf4YVWCAFoCGA2wkKkMiHmA+AWvYSrRfleGy3z97Tvc3IyhPSC/v /q+HAShzJDpPsEghwE+vrVXCjCXoRWcoNBqn3wMmltotEbSvmh2DsdxxeuPfjqIjc2hG mRj/UjGoG2aShWvFJ0UUIWxgAADnRkQy4E5pQ5lwnbBXIQebokXpCRK7VL4jIyu604pf 7eKGME8MeLJpQuFiFp7cwENmiLSohxo4lrh4BNAbQ8SL8zm0UEqmwyUbT94JsjQFw2Bg SWx/0ii4aJzt0JsAJ5tCSNoAG2+HivcZpWvbKnMp+azvAWZoeilO/mOMluRBtO06oD+R yNTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f4plsD5O; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si7870083ejr.417.2019.10.21.00.54.40; Mon, 21 Oct 2019 00:55:03 -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=@chromium.org header.s=google header.b=f4plsD5O; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727503AbfJUHw0 (ORCPT + 99 others); Mon, 21 Oct 2019 03:52:26 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:44851 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbfJUHw0 (ORCPT ); Mon, 21 Oct 2019 03:52:26 -0400 Received: by mail-ed1-f68.google.com with SMTP id r16so9242594edq.11 for ; Mon, 21 Oct 2019 00:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lshseq5695iLMWS2/yTnU4q4phMFdnGbVyLcqMyDgNw=; b=f4plsD5OF7QI01+J/daaDJeoz3LkteQ6BQB7+jftsCG7vHACEuYAS0/ifg1VOZ+2bv DVnIY34EwF6RV/LyAIkxxcICf5gDAB5lJnzvHZwPiIbqUNd0/Lda6KhsIL7Vv666qS53 0dm2LtJmUWVBz3Z6INSe5m7WXyh7OwRPV6IN4= 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:from:date :message-id:subject:to:cc; bh=lshseq5695iLMWS2/yTnU4q4phMFdnGbVyLcqMyDgNw=; b=jyw1eSXtFu2tz96a7M3b4FjOaM5yXCofKnAGHkVhObX7uXspzWgallI8eT1T82zlwZ rBbsI2DDAzhntkkNSlSKmlbiAjCei6aVlJdCElvZG9RleYQVRBLmuDNON9p5xKlgfs6E HoVq3W5ipsyNdjKb+ZwVyKVvs17GmTi/pvcms24isLQD6XifPFBshQhTBiULbRAmZ5Av yIUDD1nP+f1qrqHlEoU0nQdWTqFA9DdnW5u+a6Xh9yvZQ3+1T19YD1WIXJMl7NCvVFg4 A3i65+rR+MRxVjVXLeTFhk7fFl/2kUqJNCPdy9gYUZDms7iTJVir+dHagwfjzWoJWbWC I6SQ== X-Gm-Message-State: APjAAAVNQ2NJ4RdV4C5fOagBZL0kzrZZVMxGbpuRueTI3Uwh38/ei31u oNRPiNZzGTXQB5WefB1XAx3tahg8Y3pnMGe2nl9eMQ== X-Received: by 2002:aa7:d8c6:: with SMTP id k6mr23548337eds.87.1571644344157; Mon, 21 Oct 2019 00:52:24 -0700 (PDT) MIME-Version: 1.0 References: <20190906100514.30803-1-roger.lu@mediatek.com> <20190906100514.30803-4-roger.lu@mediatek.com> In-Reply-To: <20190906100514.30803-4-roger.lu@mediatek.com> From: Pi-Hsun Shih Date: Mon, 21 Oct 2019 15:51:48 +0800 Message-ID: Subject: Re: [PATCH v5 3/3] PM / AVS: SVS: Introduce SVS engine To: Roger Lu Cc: Kevin Hilman , Rob Herring , Nicolas Boichat , Stephen Boyd , Fan Chen , HenryC Chen , yt.lee@mediatek.com, Angus Lin , Mark Rutland , Matthias Brugger , Nishanth Menon , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , open list , "open list:THERMAL" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Roger, On Fri, Sep 6, 2019 at 6:06 PM Roger Lu wrote: > ... > +static int svs_resource_setup(struct mtk_svs *svs) > ... > + for (i = 0, freq = (u32)-1; i < svsb->opp_count; i++, freq--) { > + opp = dev_pm_opp_find_freq_floor(svsb->dev, &freq); > + if (IS_ERR(opp)) { > + pr_err("%s: error opp entry!!, err = %ld\n", > + svsb->name, PTR_ERR(opp)); > + return PTR_ERR(opp); > + } > + > + svsb->opp_freqs[i] = freq; > + svsb->opp_volts[i] = dev_pm_opp_get_voltage(opp); > + svsb->freqs_pct[i] = percent(svsb->opp_freqs[i], > + svsb->freq_base) & 0xff; Should have dev_pm_opp_put(opp); here. > + } > + } > + > + return 0; > +} > ... > +static int svs_status_proc_show(struct seq_file *m, void *v) > ... > + for (i = 0, freq = (u32)-1; i < svsb->opp_count; i++, freq--) { > + opp = dev_pm_opp_find_freq_floor(svsb->dev, &freq); > + if (IS_ERR(opp)) { > + seq_printf(m, "%s: error opp entry!!, err = %ld\n", > + svsb->name, PTR_ERR(opp)); > + return PTR_ERR(opp); > + } > + > + seq_printf(m, "opp_freqs[%02u]: %lu, volts[%02u]: %lu, ", > + i, freq, i, dev_pm_opp_get_voltage(opp)); > + seq_printf(m, "svsb_volts[%02u]: 0x%x, freqs_pct[%02u]: %u\n", > + i, svsb->volts[i], i, svsb->freqs_pct[i]); Same here. > + } > + > + return 0; > +} > ...