Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp858432pxa; Thu, 27 Aug 2020 18:36:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSuorVWKfWJb6OHsqKtwp0465B7D/6d7CSvCX8GEklb/4GSO2ZDzcEM4CfLMfTI7xZwb6a X-Received: by 2002:a17:906:c001:: with SMTP id e1mr24893103ejz.390.1598578597792; Thu, 27 Aug 2020 18:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598578597; cv=none; d=google.com; s=arc-20160816; b=KZ4+LK4fyBMLKjikkoz1Jp4sNcVr2GSmZyeL3QNGQbOYMaETBy0bOR1DYX+L0CQbHJ mmOOBYIPKIsreoWpJlJKwVR8SMF6Qdh4qa1G8Lq/lWnDGUawfSFft0wf/eKKWEPiEL8t o0+cyjN+Jm7JD7z7j9RfpAcn+vg4Y0QcnuB4Yq33wyCb1mrI/927rWg+lfwLj18HwzYd HcbfRgazDY/w3TsOgMmOqSh4KoDYMADDTOA92KnRsUeWGlBXC0Jwde4oUtNJ23CCWfLg XkcY7rn+FvguVXX34ZLhRgZ1JkkFHrpmXOS3/5OAOn91p0c5CI0JierdhwlEv5uNskii 3qaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:cc:to:subject :dkim-signature:dkim-filter; bh=mfZS9t3mm4EcSIakzUimqKpFxitij5KZmxwTrUCgxhc=; b=TEgirN+UGg0sWSy75K1ktfe78LFGUbo0Ai8jq/kj7AyKIWJ4BoN12oV2XVn7GafZ7p AVnRiNeljMSSLwyx79GYOS8HsufgNu9wZlelVpkhnUuOKfdhG3QLVFlmeNYll2oEiVbX QLJDXzywV9GIXbhQ8s74eqhFUim6AlvFJHKjxycXcGh9UITzxdEbYY/e9M9/njtMknqm rHNPNjjTuwJYx8qz/kdG7bYDcy+p2MP1RfiKIdP7E9FxrcFTvvLX2f7w8zZuEmkd3XHy rTpDMDeROCcDyb82/V6CHAmPZWsHkNy3bbnPZcjd3ycEd2kEmTdKDAL5hveOLEkQzUH4 L2NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=u7auesJf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qp26si2575134ejb.118.2020.08.27.18.36.15; Thu, 27 Aug 2020 18:36:37 -0700 (PDT) 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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=u7auesJf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728267AbgH1Bfe (ORCPT + 99 others); Thu, 27 Aug 2020 21:35:34 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:22216 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbgH1Bfd (ORCPT ); Thu, 27 Aug 2020 21:35:33 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200828013529epoutp01d572058771f7b59a435818e16dc9f4a6~vSrQN6WUC0864808648epoutp01a for ; Fri, 28 Aug 2020 01:35:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200828013529epoutp01d572058771f7b59a435818e16dc9f4a6~vSrQN6WUC0864808648epoutp01a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598578529; bh=mfZS9t3mm4EcSIakzUimqKpFxitij5KZmxwTrUCgxhc=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=u7auesJfbgAw2m+bpWAjU7aJ0vNeEXVLoQODJgIbfdZYitK/9443Vm9mvSgHDpS60 Tp0jhxn1pZayhKfqPXBXIP8hDz91LZkusCei/90IVBw4CidlBjnRTLtQISPwTWuh49 6TkIQDX/4v6le91qnI3r+yrFn5VOXyrpuQc3us5g= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20200828013529epcas1p47231fba0fb8e3486082f079f17624411~vSrPXxycJ3008030080epcas1p4J; Fri, 28 Aug 2020 01:35:29 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.40.153]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Bd2Gh6nN0zMqYmD; Fri, 28 Aug 2020 01:35:24 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 4C.BE.29173.85F584F5; Fri, 28 Aug 2020 10:35:20 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200828013520epcas1p2bc32bd495a6427a36bc7e016dea98e27~vSrHIUnUo0309303093epcas1p2z; Fri, 28 Aug 2020 01:35:20 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200828013520epsmtrp1aae0b48885e40c8b76c3a48da1087bfe~vSrHHRFUJ0208202082epsmtrp1S; Fri, 28 Aug 2020 01:35:20 +0000 (GMT) X-AuditID: b6c32a37-9b7ff700000071f5-02-5f485f584a00 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id EE.F2.08382.75F584F5; Fri, 28 Aug 2020 10:35:20 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200828013519epsmtip2cb4c7fb54f955a09e82cac16c65c1415~vSrG0NQaN0625906259epsmtip2I; Fri, 28 Aug 2020 01:35:19 +0000 (GMT) Subject: Re: [PATCH v5 13/36] PM / devfreq: tegra30: Use MC timings for building OPP table To: Dmitry Osipenko , Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Mikko Perttunen Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org From: Chanwoo Choi Organization: Samsung Electronics Message-ID: <2a255211-5426-d78f-d266-cdb958f4c658@samsung.com> Date: Fri, 28 Aug 2020 10:47:46 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: <1de8aa41-8001-cf46-026c-b00f8df0b9a3@gmail.com> Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBJsWRmVeSWpSXmKPExsWy7bCmnm5EvEe8QdsSI4t3n56yWsw/co7V YvXHx4wWV76+Z7OYvncTm0XLrEUsFmeb3rBbXN41h83ic+8RRovOL7PYLC6ecrW43biCzWLS 2qmMFq17j7Bb/Lu2kcXi5655LA4CHu9vtLJ77Jx1l93j0rk/zB6bVnWyedy5tofN4373cSaP 3uZ3bB59W1YxenzeJBfAGZVtk5GamJJapJCal5yfkpmXbqvkHRzvHG9qZmCoa2hpYa6kkJeY m2qr5OIToOuWmQP0hpJCWWJOKVAoILG4WEnfzqYov7QkVSEjv7jEVim1ICWnwLJArz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a36bc7e016dea98e27 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200814000944epcas1p3dfd0104c5fa640695dfcd4949f6b1818 References: <20200814000621.8415-1-digetx@gmail.com> <20200814000621.8415-14-digetx@gmail.com> <1b0d75fe-79af-70eb-8450-999a3bc72bac@samsung.com> <1de8aa41-8001-cf46-026c-b00f8df0b9a3@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 8/15/20 1:47 AM, Dmitry Osipenko wrote: > 14.08.2020 05:02, Chanwoo Choi пишет: >> Hi Dmitry, >> >> I add the minor comment. Except of some comments, it looks good to me. > > Hello, Chanwoo! Thank you for the review! > > ... >>> +struct tegra_devfreq_soc_data { >>> + const char *mc_compatible; >>> +}; >>> + >>> +static const struct tegra_devfreq_soc_data tegra30_soc = { >>> + .mc_compatible = "nvidia,tegra30-mc", >>> +}; >>> + >>> +static const struct tegra_devfreq_soc_data tegra124_soc = { >>> + .mc_compatible = "nvidia,tegra124-mc", >>> +}; > . >>> + soc_data = of_device_get_match_data(&pdev->dev); >> >> I think that better to check whether 'soc_data' is not NULL. > > It's a quite common misconception among kernel developers that > of_device_get_match_data() may "accidentally" return NULL, but it > couldn't if every driver's of_match[] entry has a non-NULL .data field > and because the OF-matching already happened at the driver's probe-time > [1], which is the case of this driver. > > [1] https://elixir.bootlin.com/linux/v5.8/source/drivers/of/device.c#L189 > > Hence the NULL-checking is unnecessary. > > When I first encountered the of_device_get_match_data(), I was also > thinking that adding the NULL-checks is a good idea, but later on > somebody pointed out to me (maybe Thierry) that it's unnecessary to do. OK. Thanks. > >>> + >>> + mc = tegra_get_memory_controller(soc_data->mc_compatible); >>> + if (IS_ERR(mc)) >>> + return PTR_ERR(mc); >> >> You better to add error log. > > In practice we should get only -EPROBE_DEFER here ever. I'll consider > adding the message in the next revision, at least just for consistency. In order to handle -EPROBE_DEFER, recommend the using of dev_err_probe(). (snip) -- Best Regards, Chanwoo Choi Samsung Electronics