From patchwork Tue Jul 23 12:20:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FC3C1399 for ; Tue, 23 Jul 2019 12:21:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FDC1284C5 for ; Tue, 23 Jul 2019 12:21:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43F3B284DC; Tue, 23 Jul 2019 12:21:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB5A3284C5 for ; Tue, 23 Jul 2019 12:21:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730581AbfGWMV0 (ORCPT ); Tue, 23 Jul 2019 08:21:26 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57681 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389690AbfGWMUZ (ORCPT ); Tue, 23 Jul 2019 08:20:25 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122024euoutp0213d1ed42b0047a5ee12238a8d3e1cc6f~0CJkh9kzQ3178431784euoutp02W for ; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190723122024euoutp0213d1ed42b0047a5ee12238a8d3e1cc6f~0CJkh9kzQ3178431784euoutp02W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884424; bh=kmVmqQ7vBBuymdBigbk1kLjY1bQshXiULeywhK0hfzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zi03pn1AzwwhW4BYdzv1xAgCm7paXtAcqjPRH91bX8pd6NnKUEWY3R6t+LR1nEYun TA+wTw+1Zkfpt9J5zF/1vpGRvZQIKdu7IPJfmZSJVBTauH3KGBMEwjRnD/ujDsiHoB 1eUSsld7JdIWkWc/w/YauvfKVROIkYfRBJ+BWAvg= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190723122023eucas1p17500dad051b1f22442f84c7b36ef48a3~0CJjtjSBw0311003110eucas1p1Q; Tue, 23 Jul 2019 12:20:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F4.75.04325.78BF63D5; Tue, 23 Jul 2019 13:20:23 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190723122022eucas1p1266d90873d564894bd852c20140f8474~0CJjCbjWC3150731507eucas1p1p; Tue, 23 Jul 2019 12:20:22 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122022eusmtrp1f00b961ea151a2b89ee920602225ff41~0CJjB1jlQ2487524875eusmtrp1i; Tue, 23 Jul 2019 12:20:22 +0000 (GMT) X-AuditID: cbfec7f5-b75ff700000010e5-9d-5d36fb87d3eb Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 38.D8.04140.68BF63D5; Tue, 23 Jul 2019 13:20:22 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122022eusmtip2474dd9922db572afb0b7c0650f28954d~0CJibJLMJ1668716687eusmtip24; Tue, 23 Jul 2019 12:20:22 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 01/11] devfreq: exynos-bus: Extract exynos_bus_profile_init() Date: Tue, 23 Jul 2019 14:20:06 +0200 Message-Id: <20190723122016.30279-2-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHKsWRmVeSWpSXmKPExsWy7djP87rtv81iDfb+ErA4dGwru8XGGetZ La5/ec5qMf/IOVaLK1/fs1lM37uJzWLS/QksFufPb2C32PT4GqvF5V1z2Cw+9x5htJhxfh+T xdojd9ktbjeuYLOYMfklmwO/x6ZVnWwed67tYfO4332cyWPzknqPg+/2MHn0bVnF6PF5k1wA exSXTUpqTmZZapG+XQJXxsGDi9gKjilUdK/azdzAuFGqi5GTQ0LARGL73eVsXYxcHEICKxgl juy8xgrhfGGU+Nx/kRWkSkjgM6PEnHuSMB3Xl29hgogvZ5S4c1INruHYh51sIAk2AU+Jnok7 wCaJCBxhlJi84D0LiMMssArI+b6NEaRKWCBYYsmx80A2BweLgKrEmV1iIG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1RsOMIPYnAJOEl1H29lAbCGgmm3bXzNC1AtKnJz5 hAVkDLOAusT6eUIgYWag1uats5knMArOQlI1C6FqFpKqBYzMqxhFUkuLc9Nzi430ihNzi0vz 0vWS83M3MQKjdNuxn1t2MHa9Cz7EKMDBqMTDu2GPaawQa2JZcWXuIUYJDmYlEd7ABrNYId6U xMqq1KL8+KLSnNTiQ4ymQJ9NZJYSTc4HJpC8knhDU0NzC0tDc2NzYzMLJXHeDoGDMUIC6Ykl qdmpqQWpRTB9TBycUg2MMz+Xt7Oqlb00ZkyWrZ65dt2ftWKpM5hOfNgdt2nh87xEDuZpbIwh 0tPlglfFLvn9skuyzE+h/dbs2DVSnZ0eVdF8O0ykP4v/YPzXdPevbMkjcaknTGXB+hVCD+o8 FKPunmWwNZ+VVeS45fXRtaFMP7uCvYVZfZyev2fl/zWtW0rvfZu60EQlluKMREMt5qLiRACS 1DSG6AIAAA== X-CMS-MailID: 20190723122022eucas1p1266d90873d564894bd852c20140f8474 X-Msg-Generator: CA X-RootMTR: 20190723122022eucas1p1266d90873d564894bd852c20140f8474 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122022eucas1p1266d90873d564894bd852c20140f8474 References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a new static function, exynos_bus_profile_init(), extracted from exynos_bus_probe(). Signed-off-by: Artur Świgoń --- drivers/devfreq/exynos-bus.c | 106 ++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 46 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index d9f377912c10..d8f1efaf2d49 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -372,12 +372,69 @@ static int exynos_bus_parse_of(struct device_node *np, return ret; } +static int exynos_bus_profile_init(struct exynos_bus *bus, + struct devfreq_dev_profile *profile) +{ + struct device *dev = bus->dev; + struct devfreq_simple_ondemand_data *ondemand_data; + int ret; + + /* Initialize the struct profile and governor data for parent device */ + profile->polling_ms = 50; + profile->target = exynos_bus_target; + profile->get_dev_status = exynos_bus_get_dev_status; + profile->exit = exynos_bus_exit; + + ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL); + if (!ondemand_data) { + ret = -ENOMEM; + goto err; + } + ondemand_data->upthreshold = 40; + ondemand_data->downdifferential = 5; + + /* Add devfreq device to monitor and handle the exynos bus */ + bus->devfreq = devm_devfreq_add_device(dev, profile, + DEVFREQ_GOV_SIMPLE_ONDEMAND, + ondemand_data); + if (IS_ERR(bus->devfreq)) { + dev_err(dev, "failed to add devfreq device\n"); + ret = PTR_ERR(bus->devfreq); + goto err; + } + + /* Register opp_notifier to catch the change of OPP */ + ret = devm_devfreq_register_opp_notifier(dev, bus->devfreq); + if (ret < 0) { + dev_err(dev, "failed to register opp notifier\n"); + goto err; + } + + /* + * Enable devfreq-event to get raw data which is used to determine + * current bus load. + */ + ret = exynos_bus_enable_edev(bus); + if (ret < 0) { + dev_err(dev, "failed to enable devfreq-event devices\n"); + goto err; + } + + ret = exynos_bus_set_event(bus); + if (ret < 0) { + dev_err(dev, "failed to set event to devfreq-event devices\n"); + goto err; + } + +err: + return ret; +} + static int exynos_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node, *node; struct devfreq_dev_profile *profile; - struct devfreq_simple_ondemand_data *ondemand_data; struct devfreq_passive_data *passive_data; struct devfreq *parent_devfreq; struct exynos_bus *bus; @@ -418,52 +475,9 @@ static int exynos_bus_probe(struct platform_device *pdev) if (ret < 0) goto err; - /* Initialize the struct profile and governor data for parent device */ - profile->polling_ms = 50; - profile->target = exynos_bus_target; - profile->get_dev_status = exynos_bus_get_dev_status; - profile->exit = exynos_bus_exit; - - ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL); - if (!ondemand_data) { - ret = -ENOMEM; + ret = exynos_bus_profile_init(bus, profile); + if (ret < 0) goto err; - } - ondemand_data->upthreshold = 40; - ondemand_data->downdifferential = 5; - - /* Add devfreq device to monitor and handle the exynos bus */ - bus->devfreq = devm_devfreq_add_device(dev, profile, - DEVFREQ_GOV_SIMPLE_ONDEMAND, - ondemand_data); - if (IS_ERR(bus->devfreq)) { - dev_err(dev, "failed to add devfreq device\n"); - ret = PTR_ERR(bus->devfreq); - goto err; - } - - /* Register opp_notifier to catch the change of OPP */ - ret = devm_devfreq_register_opp_notifier(dev, bus->devfreq); - if (ret < 0) { - dev_err(dev, "failed to register opp notifier\n"); - goto err; - } - - /* - * Enable devfreq-event to get raw data which is used to determine - * current bus load. - */ - ret = exynos_bus_enable_edev(bus); - if (ret < 0) { - dev_err(dev, "failed to enable devfreq-event devices\n"); - goto err; - } - - ret = exynos_bus_set_event(bus); - if (ret < 0) { - dev_err(dev, "failed to set event to devfreq-event devices\n"); - goto err; - } goto out; passive: From patchwork Tue Jul 23 12:20:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054455 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD1D6186E for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEBC8284A3 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A33D2284DB; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4499E284A3 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389714AbfGWMU1 (ORCPT ); Tue, 23 Jul 2019 08:20:27 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57692 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389373AbfGWMU0 (ORCPT ); Tue, 23 Jul 2019 08:20:26 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122024euoutp022230ff467bff9a02e16adb1de3fa0db6~0CJlEsNdU3178431784euoutp02X for ; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190723122024euoutp022230ff467bff9a02e16adb1de3fa0db6~0CJlEsNdU3178431784euoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884425; bh=ieJ7cuOWHzOtHekeljdAL3BGbRF46aE7ZAyxlKgDJqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V81lm8cVQFRmCMtXVFiAmtQ9y6R9GSnjgBof17Bid0J9Dmv6yf+zP3z8aZyTYeSSv qKaxE4vM+oTD4UCKawAxR4jR3SR9imlM/OfYHcxJ8QAw2ANP781Ls4dm7BWHuZLw7F 8rYQRVX4B7W5HPDKneI4fvTinEcydtArBL/ojUzU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190723122024eucas1p282b69e229491fbeada5acc07ff4068e9~0CJkbaCUk1893418934eucas1p2A; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 26.75.04325.88BF63D5; Tue, 23 Jul 2019 13:20:24 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190723122023eucas1p2ff56c00b60a676ed85d9fe159a1839f2~0CJj2Uwtv2749027490eucas1p2X; Tue, 23 Jul 2019 12:20:23 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122023eusmtrp1a85f16e721c2f79a22b5fda4a3a16896~0CJjrpwnJ2487524875eusmtrp1k; Tue, 23 Jul 2019 12:20:23 +0000 (GMT) X-AuditID: cbfec7f5-b8fff700000010e5-a0-5d36fb887713 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 79.D8.04140.78BF63D5; Tue, 23 Jul 2019 13:20:23 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122022eusmtip29c0f995471815170717c96f9c66fea05~0CJjCobRV1668716687eusmtip25; Tue, 23 Jul 2019 12:20:22 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 02/11] devfreq: exynos-bus: Extract exynos_bus_profile_init_passive() Date: Tue, 23 Jul 2019 14:20:07 +0200 Message-Id: <20190723122016.30279-3-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SfSxVYRz23nPPuYd1dRziRWPdaisrkujdakalTps1/JlZ3XJ85at7ULLW pQ/ckI8aXRVNPrqS6/o2rK4bu4w7ahQZlWb6slxmppLraPnv+T3P73l+v9+7l8ToAdyBjIxN YGWx0mgJYSFs6l4y7M1Y9grZVzeGI213owjVFdXiaGR+GkclugEcvVmYJVBhh4ZA+RO5QmQw qEVI82kYR6/bHhDImK0DqMjQKUA1unERGkutIlBRwQzhs5nRqDIJ5v1wO8FM3O4RMPVPrjEv f7QLmJwGFWCMGqcA0WmLw6FsdGQSK3PzPmsRUZk3Koovsr881bxCyMEHGwUwJyF1AGoHDAIF sCBpqgpAxc1H68U8gHM1S0K+MAKoHyoBCkCuWTpSo3i+EsDWzP4NDvVvkSmXoE7CrLwW3CTY UDoAC0pn16IwSrVaLDatRVlTwVAx42iCQmonLNTTJq+Y8oX3jNlCfj9nWK1+gZmwOXUEKl6l E3yPFdTfn1rrwVZ7rjcWY6Z4SP0UQbVqUcSbj8FyfQXOY2v4padhnd8K+wqy1gdw8HPrBM6b 5QBqKnQYLxyCXT2DuGk5jNoNa9vceNoXDi5OCvmXsIRvv1vxO1jC/KZCjKfFMOMWzUMXWLoc zBshTKseXs9moHLpDpELtik3HKPccIzy/9hSgKmAHZvIxYSznEcse8mVk8ZwibHhrufjYjRg 9Zf1/elZaAGdv85pAUUCySaxut0zhMalSVxyjBZAEpPYiAPlXiG0OFSafIWVxZ2RJUaznBY4 kkKJnTjFbDKYpsKlCewFlo1nZf9UAWnuIAfc1FH2Xc20scQ/zKmx4nGGeeCpGwcDdlx9NpNV +XDZgykLMiseLHf3NcvJKo4IGnL2ueiXGL1gO4L0c8+37AnrvFs2vr2Lvvvxm/dKS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b60a676ed85d9fe159a1839f2 X-Msg-Generator: CA X-RootMTR: 20190723122023eucas1p2ff56c00b60a676ed85d9fe159a1839f2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122023eucas1p2ff56c00b60a676ed85d9fe159a1839f2 References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a new static function, exynos_bus_profile_init_passive(), extracted from exynos_bus_probe(). Signed-off-by: Artur Świgoń --- drivers/devfreq/exynos-bus.c | 70 +++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index d8f1efaf2d49..cf6f6cbd0f55 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -430,13 +430,51 @@ static int exynos_bus_profile_init(struct exynos_bus *bus, return ret; } +static int exynos_bus_profile_init_passive(struct exynos_bus *bus, + struct devfreq_dev_profile *profile) +{ + struct device *dev = bus->dev; + struct devfreq *parent_devfreq; + struct devfreq_passive_data *passive_data; + int ret = 0; + + /* Initialize the struct profile and governor data for passive device */ + profile->target = exynos_bus_passive_target; + profile->exit = exynos_bus_passive_exit; + + /* Get the instance of parent devfreq device */ + parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0); + if (IS_ERR(parent_devfreq)) { + ret = -EPROBE_DEFER; + goto err; + } + + passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL); + if (!passive_data) { + ret = -ENOMEM; + goto err; + } + passive_data->parent = parent_devfreq; + + /* Add devfreq device for exynos bus with passive governor */ + bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, + passive_data); + if (IS_ERR(bus->devfreq)) { + dev_err(dev, + "failed to add devfreq dev with passive governor\n"); + ret = PTR_ERR(bus->devfreq); + goto err; + } + +err: + return ret; +} + static int exynos_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node, *node; struct devfreq_dev_profile *profile; - struct devfreq_passive_data *passive_data; - struct devfreq *parent_devfreq; struct exynos_bus *bus; int ret, max_state; unsigned long min_freq, max_freq; @@ -481,33 +519,9 @@ static int exynos_bus_probe(struct platform_device *pdev) goto out; passive: - /* Initialize the struct profile and governor data for passive device */ - profile->target = exynos_bus_passive_target; - profile->exit = exynos_bus_passive_exit; - - /* Get the instance of parent devfreq device */ - parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0); - if (IS_ERR(parent_devfreq)) { - ret = -EPROBE_DEFER; + ret = exynos_bus_profile_init_passive(bus, profile); + if (ret < 0) goto err; - } - - passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL); - if (!passive_data) { - ret = -ENOMEM; - goto err; - } - passive_data->parent = parent_devfreq; - - /* Add devfreq device for exynos bus with passive governor */ - bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, - passive_data); - if (IS_ERR(bus->devfreq)) { - dev_err(dev, - "failed to add devfreq dev with passive governor\n"); - ret = PTR_ERR(bus->devfreq); - goto err; - } out: max_state = bus->devfreq->profile->max_state; From patchwork Tue Jul 23 12:20:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 732A51399 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63C96284C5 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 587AD284DC; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00B57284C5 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389715AbfGWMU1 (ORCPT ); Tue, 23 Jul 2019 08:20:27 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38688 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389705AbfGWMU1 (ORCPT ); Tue, 23 Jul 2019 08:20:27 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122025euoutp017e41ad89c56bd99a6f4b74c0b5807aa6~0CJl_IykK2865228652euoutp01b for ; Tue, 23 Jul 2019 12:20:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190723122025euoutp017e41ad89c56bd99a6f4b74c0b5807aa6~0CJl_IykK2865228652euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884425; bh=acZs1C2PRXwgbejpkVZ0Vnfcq1LUt8CLhBHrsSuxE7M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bX7wFcfx5NUSBYQhVLs/QbIJFXdyxKVOYVo4VWrMZmJtYiEGHc024I31M0hi56c9b scmOX1QseG5IPTlABKDVvx3WavUfZRYNACLiippBPKXDo/mVnYKCiVqbsMYbfcGCb5 Uu7LCBqDbSj45xVpQ2MS60KmrSXlIvJxA+a6E+b4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190723122024eucas1p26984f8d4bb6c97f37d8fc6535c0a4820~0CJlDQ9ta1104811048eucas1p2X; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 51.5B.04298.88BF63D5; Tue, 23 Jul 2019 13:20:24 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190723122024eucas1p1ff060d072132bfbc8a8a1d10fa1f90f8~0CJkXbnIu0081400814eucas1p1U; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122024eusmtrp18f9c48318e32cff566cc8092b45ff466~0CJkWtNwe2491824918eusmtrp1V; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) X-AuditID: cbfec7f2-f2dff700000010ca-7a-5d36fb888d8f Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 19.41.04146.88BF63D5; Tue, 23 Jul 2019 13:20:24 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122023eusmtip253ad15b0f5b4c58cad1e29511fa48b91~0CJjqaCxF1612616126eusmtip2J; Tue, 23 Jul 2019 12:20:23 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 03/11] devfreq: exynos-bus: Change goto-based logic to if-else logic Date: Tue, 23 Jul 2019 14:20:08 +0200 Message-Id: <20190723122016.30279-4-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRj281x2Zi6P0/LFwmggqOCNTA9lF0Nh0h/7UeRMaulhijptx0tq kGXZNCsvkWY3kVCbeGleUNOotWZhOXRlkqmBhTdMzUuUWG0eLf89z/s8z/e8L3wUJjYSzlSs MplVKeXxEtIGbzH87PFUL/tH+rRNeDI6Q7OAeVxaTzAfFsYI5oG+h2DeLc6QTEmnlmSKRgpw xmhsEDDa0X6CMbXfJZn5a3rElBqfWjO1+iEBM3ihmmRKiyfIg3ZSrSaXlH7q7yClI1e7rKWN D89Ln3/rsJZeb9Ig6bzWJUwgswmMZuNjU1mV9/5TNjF1tWN40tyms+//dGJZqEKYh4QU0H4w XdUgyEM2lJiuRvCmaArxZAHByPIzjCfzCHpKpsj1yOyrFsKCxXQVArXW5V+ic+4RsggkHQr5 ha2ERXCk9QiKy2dwC8FojZn8aFl1OdAyGB6tWsU47QqagaVVLKKDYOh+DeLrdkBNg2UPISWk D0Heyysk77GH17e/4BaMmT3ZzXdWdwV6TgDLw7MYHw4Gg+bX2kMOMNnVJODxduguzsd5zMHX thGCD2ch0Fbq18J74UVXr1mgzA3uUN/uzY+DoK+1DVnGQG+GgWl7fofNUNRSgvFjEahzxDz0 gPLlCD4IcLGmf80hhZu5AQVoZ9mGW8o23FL2v7UcYRrkxKZwCQqW81WyaV6cPIFLUSq8ohIT tMj8zbp/d31vRYt9p3WIppDEVtTQsTtSTMhTufQEHQIKkziKjmT5R4pF0fL0DFaVeF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wHaozmzy7C0bLybzf2Ao+fayZvGGORzamXkT r08K1XsZ93Vmw/vAeCs9rb7sjOvf7kyfJvl6U+Y2g1ua70Uuh76/FaLEUpyRaKjFXFScCACJ jdHh6QIAAA== X-CMS-MailID: 20190723122024eucas1p1ff060d072132bfbc8a8a1d10fa1f90f8 X-Msg-Generator: CA X-RootMTR: 20190723122024eucas1p1ff060d072132bfbc8a8a1d10fa1f90f8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122024eucas1p1ff060d072132bfbc8a8a1d10fa1f90f8 References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch improves code readability by changing the following construct: > if (cond) > goto passive; > foo(); > goto out; >passive: > bar(); >out: into this: > if (cond) > bar(); > else > foo(); Signed-off-by: Artur Świgoń Reviewed-by: Krzysztof Kozlowski --- drivers/devfreq/exynos-bus.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index cf6f6cbd0f55..4bb83b945bf7 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -505,25 +505,19 @@ static int exynos_bus_probe(struct platform_device *pdev) node = of_parse_phandle(dev->of_node, "devfreq", 0); if (node) { of_node_put(node); - goto passive; + ret = exynos_bus_profile_init_passive(bus, profile); + if (ret < 0) + goto err; } else { ret = exynos_bus_parent_parse_of(np, bus); + if (ret < 0) + goto err; + + ret = exynos_bus_profile_init(bus, profile); + if (ret < 0) + goto err; } - if (ret < 0) - goto err; - - ret = exynos_bus_profile_init(bus, profile); - if (ret < 0) - goto err; - - goto out; -passive: - ret = exynos_bus_profile_init_passive(bus, profile); - if (ret < 0) - goto err; - -out: max_state = bus->devfreq->profile->max_state; min_freq = (bus->devfreq->profile->freq_table[0] / 1000); max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000); From patchwork Tue Jul 23 12:20:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC6CA1399 for ; Tue, 23 Jul 2019 12:21:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD350284A3 for ; Tue, 23 Jul 2019 12:21:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0EB4284DB; Tue, 23 Jul 2019 12:21:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AC00284DC for ; Tue, 23 Jul 2019 12:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389722AbfGWMVK (ORCPT ); Tue, 23 Jul 2019 08:21:10 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38680 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389709AbfGWMU1 (ORCPT ); Tue, 23 Jul 2019 08:20:27 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122026euoutp013fee8800f988e12d7cb9f45428847fad~0CJmnz4Qg2863228632euoutp01j for ; Tue, 23 Jul 2019 12:20:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190723122026euoutp013fee8800f988e12d7cb9f45428847fad~0CJmnz4Qg2863228632euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884426; bh=mB6tpYvVSphzP6A9Pn9b/zTWKGneiQ3HT+TMiqcj+Qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zfcl13mcfhl4DkWxNKL9IxrK35MS46FUmKWJFRcKpuyz1v5Z5rqSxnnlwCSE/DCaX lbNe8luIiA6gkWMM57wZVdBuUyrjcvMqTdNSLYzrqMRPlnc2/SykW4P+O/D5BBnrw4 q+wseNgX/G5EU8wQC3xz4U557c+ihT/SUfC3LjnM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190723122025eucas1p1d47c9b6838304eb0f9bbe1d7b4db9a7a~0CJl_YmjL0316803168eucas1p1Y; Tue, 23 Jul 2019 12:20:25 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 69.0C.04377.98BF63D5; Tue, 23 Jul 2019 13:20:25 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190723122024eucas1p25a480ccddaa69ee1d0f1a07960ca3f22~0CJlDr9J02753327533eucas1p2N; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122024eusmtrp18e1c2b5fc07da399501cd94295ab0ccd~0CJk5GeSX2491824918eusmtrp1X; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) X-AuditID: cbfec7f4-113ff70000001119-ab-5d36fb89f5e6 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DA.D8.04140.88BF63D5; Tue, 23 Jul 2019 13:20:24 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122024eusmtip2b8e737d5f88e4f720f9c1534dba52c25~0CJkSC1HV1668716687eusmtip27; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 04/11] devfreq: exynos-bus: Clean up code Date: Tue, 23 Jul 2019 14:20:09 +0200 Message-Id: <20190723122016.30279-5-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrIKsWRmVeSWpSXmKPExsWy7djPc7qdv81iDfpe61gcOraV3WLjjPWs Fte/PGe1mH/kHKvFla/v2Sym793EZjHp/gQWi/PnN7BbbHp8jdXi8q45bBafe48wWsw4v4/J Yu2Ru+wWtxtXsFnMmPySzYHfY9OqTjaPO9f2sHnc7z7O5LF5Sb3HwXd7mDz6tqxi9Pi8SS6A PYrLJiU1J7MstUjfLoErY/qfNqaCJ2oVcz5tYGxg/CjXxcjJISFgInHk/CG2LkYuDiGBFYwS M/7sZIRwvjBK3Gw6zQrhfGaUODh1OxtMy4KWFqiW5YwSHV0tLHAtL+7dZwepYhPwlOiZuAOs XUT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EzcQcrSEJE4BSjxNbl58CqmAU2MUrcPT6RHaRKWMBWYvbZ22A2 i4CqRO/Ux4wgNq+Ao8StD3MYIVbIS6zecABsKqeAk0TX0XY2EFsIqGbb9tdQ9YISJ2c+ATqP A2iBusT6eUIgYWag1uats5knMArOQlI1C6FqFpKqBYzMqxhFUkuLc9Nzi430ihNzi0vz0vWS 83M3MQLjdNuxn1t2MHa9Cz7EKMDBqMTDu2GPaawQa2JZcWXuIUYJDmYlEd7ABrNYId6UxMqq 1KL8+KLSnNTiQ4ymQK9NZJYSTc4HppC8knhDU0NzC0tDc2NzYzMLJXHeDoGDMUIC6Yklqdmp qQWpRTB9TBycUg2Ml9iFergsQ6T35vznkKq8xfk9WfSkSKaM7a+DKzJ/1MTZuunqxhwo1/Cv fpYdKV1YvenZhNM7fsUtKM2KzbrwT5H72wTzYy4P+DRy9W5WyquF221qa3i8U+LK5V8bXoio V3OrHqwt7sj1XKWU55K4+Av/QxY5xvshfVUClcYi/js1+OVzNZVYijMSDbWYi4oTAe17qm/p AgAA X-CMS-MailID: 20190723122024eucas1p25a480ccddaa69ee1d0f1a07960ca3f22 X-Msg-Generator: CA X-RootMTR: 20190723122024eucas1p25a480ccddaa69ee1d0f1a07960ca3f22 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122024eucas1p25a480ccddaa69ee1d0f1a07960ca3f22 References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds minor improvements to the exynos-bus driver. Signed-off-by: Artur Świgoń Reviewed-by: Krzysztof Kozlowski --- drivers/devfreq/exynos-bus.c | 49 ++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 4bb83b945bf7..412511ca7703 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -15,11 +15,10 @@ #include #include #include -#include +#include #include #include #include -#include #define DEFAULT_SATURATION_RATIO 40 #define DEFAULT_VOLTAGE_TOLERANCE 2 @@ -256,7 +255,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np, struct exynos_bus *bus) { struct device *dev = bus->dev; - int i, ret, count, size; + int i, ret, count; /* Get the regulator to provide each bus with the power */ bus->regulator = devm_regulator_get(dev, "vdd"); @@ -283,8 +282,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np, } bus->edev_count = count; - size = sizeof(*bus->edev) * count; - bus->edev = devm_kzalloc(dev, size, GFP_KERNEL); + bus->edev = devm_kcalloc(dev, count, sizeof(*bus->edev), GFP_KERNEL); if (!bus->edev) { ret = -ENOMEM; goto err_regulator; @@ -388,7 +386,7 @@ static int exynos_bus_profile_init(struct exynos_bus *bus, ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL); if (!ondemand_data) { ret = -ENOMEM; - goto err; + goto out; } ondemand_data->upthreshold = 40; ondemand_data->downdifferential = 5; @@ -400,14 +398,14 @@ static int exynos_bus_profile_init(struct exynos_bus *bus, if (IS_ERR(bus->devfreq)) { dev_err(dev, "failed to add devfreq device\n"); ret = PTR_ERR(bus->devfreq); - goto err; + goto out; } /* Register opp_notifier to catch the change of OPP */ ret = devm_devfreq_register_opp_notifier(dev, bus->devfreq); if (ret < 0) { dev_err(dev, "failed to register opp notifier\n"); - goto err; + goto out; } /* @@ -417,16 +415,16 @@ static int exynos_bus_profile_init(struct exynos_bus *bus, ret = exynos_bus_enable_edev(bus); if (ret < 0) { dev_err(dev, "failed to enable devfreq-event devices\n"); - goto err; + goto out; } ret = exynos_bus_set_event(bus); if (ret < 0) { dev_err(dev, "failed to set event to devfreq-event devices\n"); - goto err; + goto out; } -err: +out: return ret; } @@ -446,27 +444,28 @@ static int exynos_bus_profile_init_passive(struct exynos_bus *bus, parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0); if (IS_ERR(parent_devfreq)) { ret = -EPROBE_DEFER; - goto err; + goto out; } passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL); if (!passive_data) { ret = -ENOMEM; - goto err; + goto out; } passive_data->parent = parent_devfreq; /* Add devfreq device for exynos bus with passive governor */ - bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, + bus->devfreq = devm_devfreq_add_device(dev, profile, + DEVFREQ_GOV_PASSIVE, passive_data); if (IS_ERR(bus->devfreq)) { dev_err(dev, "failed to add devfreq dev with passive governor\n"); ret = PTR_ERR(bus->devfreq); - goto err; + goto out; } -err: +out: return ret; } @@ -484,11 +483,11 @@ static int exynos_bus_probe(struct platform_device *pdev) return -EINVAL; } - bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL); + bus = devm_kzalloc(dev, sizeof(*bus), GFP_KERNEL); if (!bus) return -ENOMEM; mutex_init(&bus->lock); - bus->dev = &pdev->dev; + bus->dev = dev; platform_set_drvdata(pdev, bus); /* Parse the device-tree to get the resource information */ @@ -502,7 +501,7 @@ static int exynos_bus_probe(struct platform_device *pdev) goto err; } - node = of_parse_phandle(dev->of_node, "devfreq", 0); + node = of_parse_phandle(np, "devfreq", 0); if (node) { of_node_put(node); ret = exynos_bus_profile_init_passive(bus, profile); @@ -547,12 +546,10 @@ static int exynos_bus_resume(struct device *dev) int ret; ret = exynos_bus_enable_edev(bus); - if (ret < 0) { + if (ret < 0) dev_err(dev, "failed to enable the devfreq-event devices\n"); - return ret; - } - return 0; + return ret; } static int exynos_bus_suspend(struct device *dev) @@ -561,12 +558,10 @@ static int exynos_bus_suspend(struct device *dev) int ret; ret = exynos_bus_disable_edev(bus); - if (ret < 0) { + if (ret < 0) dev_err(dev, "failed to disable the devfreq-event devices\n"); - return ret; - } - return 0; + return ret; } #endif From patchwork Tue Jul 23 12:20:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054445 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89BE5912 for ; Tue, 23 Jul 2019 12:21:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77A9C284A3 for ; Tue, 23 Jul 2019 12:21:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69F99284DB; Tue, 23 Jul 2019 12:21:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02FE0284A3 for ; Tue, 23 Jul 2019 12:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730363AbfGWMVF (ORCPT ); Tue, 23 Jul 2019 08:21:05 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38706 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389716AbfGWMU2 (ORCPT ); Tue, 23 Jul 2019 08:20:28 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122027euoutp019002cec464db09157c4617e413a18796~0CJnREoON2875428754euoutp01V for ; Tue, 23 Jul 2019 12:20:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190723122027euoutp019002cec464db09157c4617e413a18796~0CJnREoON2875428754euoutp01V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884427; bh=69sx8Ho8WYsPHRFweup85Ar55fYbxmZw5YIq9XlVhhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UUMiMS8rcDKWYgE9JDpSXyrW2C/qVYaHwu/wbPvKqmsUEuGa5VRBnPlZromlcP7Mx fbSINPeJEhHU44dcWyOuSwl6rwTYuEFk1Rbpzs3eQtF1vubr0RJILay34ncj+SXh94 0G4Ye/ncfa+oc0XnGp7cTPnUGSHP6E2RPqn6qmhQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190723122026eucas1p1f335ee2bd2411aaba4b3ccdda8ae2cfe~0CJme7mvZ0728407284eucas1p17; Tue, 23 Jul 2019 12:20:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 9A.0C.04377.A8BF63D5; Tue, 23 Jul 2019 13:20:26 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190723122025eucas1p251df372451e0b27ad7f2e3c89df60b64~0CJlrL8tN2751727517eucas1p2d; Tue, 23 Jul 2019 12:20:25 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122025eusmtrp1f6762be756a6f02ff6df821cd5e17030~0CJlgYUKY2491824918eusmtrp1b; Tue, 23 Jul 2019 12:20:25 +0000 (GMT) X-AuditID: cbfec7f4-113ff70000001119-ad-5d36fb8ae00a Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 4A.41.04146.98BF63D5; Tue, 23 Jul 2019 13:20:25 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122024eusmtip27564000c231ee8652f0e0023861fb0d6~0CJk5pYbi1612616126eusmtip2K; Tue, 23 Jul 2019 12:20:24 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 05/11] icc: Export of_icc_get_from_provider() Date: Tue, 23 Jul 2019 14:20:10 +0200 Message-Id: <20190723122016.30279-6-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPKsWRmVeSWpSXmKPExsWy7djP87pdv81iDT7N4bU4dGwru8XGGetZ La5/ec5qMf/IOVaLK1/fs1lM37uJzWLS/QksFufPb2C32PT4GqvF5V1z2Cw+9x5htJhxfh+T xdojd9ktbjeuYLOYMfklmwO/x6ZVnWwed67tYfO4332cyWPzknqPg+/2MHn0bVnF6PF5k1wA exSXTUpqTmZZapG+XQJXxt3jl5kLXvBXPOy8xdjAuIe3i5GDQ0LAROJqs3sXIxeHkMAKRomX n+8xQThfGCV+dX5jgXA+M0pcv3wIKMMJ1rHy0n2oxHJGieZZz1nhWr7OvccKUsUm4CnRM3EH WEJE4AijxOQF78FamAVWATnftzGCbBcWcJTYtbEKpIFFQFXixJYOFhCbFyi8pKGHEWKdvMTq DQeYQWxOASeJrqPtbBA1ghInZz4Bq2cGqmneOpsZZL6EwEd2iV97NkE1u0j8at/HDGELS7w6 voUdwpaROD25hwX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0hqaXFuem6xoV5xYm5xaV66 XnJ+7iZGYJRuO/Zz8w7GSxuDDzEKcDAq8fBu2GMaK8SaWFZcmXuIUYKDWUmEN7DBLFaINyWx siq1KD++qDQntfgQoynQaxOZpUST84EJJK8k3tDU0NzC0tDc2NzYzEJJnLdD4GCMkEB6Yklq dmpqQWoRTB8TB6dUA6N/5Vm3R2LR8xyf9c01epf+1Fbg1qOvLO7TrBvnRlmcOPc4Sr0m70ae cdDW16nb9r6MVLNcJvyKzYzzWfOs8kvyqexCTFem/EtuET7tdE/8aUl15pupj99Nff0ibdbE fS/OnIvOaf/n8lqpbcqvHsN/0+NYbCx3JEz80ma8IcZeZZIW28VC6zglluKMREMt5qLiRABm fgMp6AIAAA== X-CMS-MailID: 20190723122025eucas1p251df372451e0b27ad7f2e3c89df60b64 X-Msg-Generator: CA X-RootMTR: 20190723122025eucas1p251df372451e0b27ad7f2e3c89df60b64 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122025eucas1p251df372451e0b27ad7f2e3c89df60b64 References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch makes the above function public (for use in exynos-bus devfreq driver). Signed-off-by: Artur Świgoń Reviewed-by: Krzysztof Kozlowski --- drivers/interconnect/core.c | 3 ++- include/linux/interconnect-provider.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 871eb4bc4efc..d566ae0b66c0 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -274,7 +274,7 @@ EXPORT_SYMBOL_GPL(of_icc_xlate_onecell); * Returns a valid pointer to struct icc_node on success or ERR_PTR() * on failure. */ -static struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) +struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) { struct icc_node *node = ERR_PTR(-EPROBE_DEFER); struct icc_provider *provider; @@ -293,6 +293,7 @@ static struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) return node; } +EXPORT_SYMBOL_GPL(of_icc_get_from_provider); /** * of_icc_get() - get a path handle from a DT node based on name diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h index 63caccadc2db..9ecfc518b952 100644 --- a/include/linux/interconnect-provider.h +++ b/include/linux/interconnect-provider.h @@ -97,6 +97,7 @@ void icc_node_add(struct icc_node *node, struct icc_provider *provider); void icc_node_del(struct icc_node *node); int icc_provider_add(struct icc_provider *provider); int icc_provider_del(struct icc_provider *provider); +struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec); #else @@ -137,6 +138,11 @@ static inline int icc_provider_del(struct icc_provider *provider) return -ENOTSUPP; } +struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) +{ + return ERR_PTR(-ENOTSUPP); +} + #endif /* CONFIG_INTERCONNECT */ #endif /* __LINUX_INTERCONNECT_PROVIDER_H */ From patchwork Tue Jul 23 12:20:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D310F912 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4503284A3 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8BCC28587; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71B84284F1 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731154AbfGWMVK (ORCPT ); Tue, 23 Jul 2019 08:21:10 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38685 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389722AbfGWMU2 (ORCPT ); Tue, 23 Jul 2019 08:20:28 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122027euoutp01848ba7fdef39e62e69a967db21b7e751~0CJntutkL2875728757euoutp01X for ; Tue, 23 Jul 2019 12:20:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190723122027euoutp01848ba7fdef39e62e69a967db21b7e751~0CJntutkL2875728757euoutp01X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884427; bh=zWW1b2/PIBAroYQDAGRfN0QElK9yhnrQqfnDmdwgYB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lXxrR4HLmaBv3AYFL0vv+6CAQtXmk8MNizb1Gq9Aty/rG26dNINmzIapvbeO0SV6G LMJlHfWrPdAT+Tvxpmyty4aT6dYmUKJde2RYK4VK2HhT7CEbiFHzeGGO5zn8o7ENdA 9G0qQhbroR9Cc5stzHrFeDv9kc326uIs2HuFnXIE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190723122027eucas1p21409f43eaeb7b5a1d63972aca1a6fdd0~0CJnJTm171005510055eucas1p2W; Tue, 23 Jul 2019 12:20:27 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 93.5B.04298.A8BF63D5; Tue, 23 Jul 2019 13:20:26 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190723122026eucas1p2acf705de2a47ba54f383d916f5383144~0CJmfDE3K1104811048eucas1p2Z; Tue, 23 Jul 2019 12:20:26 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122026eusmtrp175c94b91714185ab48d0a353c2736375~0CJmUTcr02491824918eusmtrp1i; Tue, 23 Jul 2019 12:20:26 +0000 (GMT) X-AuditID: cbfec7f2-f13ff700000010ca-82-5d36fb8ab9c8 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FC.D8.04140.A8BF63D5; Tue, 23 Jul 2019 13:20:26 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122025eusmtip2472d7ca264b169f99c872f4d08623443~0CJlnMgmE1852218522eusmtip2B; Tue, 23 Jul 2019 12:20:25 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 06/11] icc: Relax requirement in of_icc_get_from_provider() Date: Tue, 23 Jul 2019 14:20:11 +0200 Message-Id: <20190723122016.30279-7-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Se0hTcRT2t7t7dx3NrtPwpFI5kshSU1IuKJHRH7eIzAr/SESnXlScD3Z9 ZAUtK1MzNRf5yFTCV5v5WCpmFqnLIVbDt1Q+wsSK0kzFypDmrpb/fd855/u+c+CQmNSI25PR cYmsMk6ukBFiYUv3L6Nr1op38AFtiS/d2d0sohsL63F6ZHEGp8v0b3B6cGmOoAue6Qg6fyJP SBuNDSJaNzWM0wNtJQS9cEuP6ELjcwH9SD8mot9dqSHoQvVn4vBWRqfJJJj3w+0EM3HTIGAe V1xmOmbbBUxOkwYxC7odp0TnxL4RrCI6mVW6HwoVR2lLmwUJM8T56tcjuAqN41nIkgTqIAzV laMsJCalVA0C7Z9MnCeLCCaXvhM8WUBQ9ukO2pBMff0p5BvVCDoeNqN/kpLqftHaFEEdg+zb rWYvW0qPQF0+Z5ZglMZEllvMXjZUABQWTJpXEVLO0Fg1j61hCeUHc9PjGJ+3E7QNL8zYkjoC WS9vEPyMNfQUfRSuYcw0c7X5HrYWANS8CH5XakxEZCJH4e76pTbwxdAk4rEj9KqzhTzmYPrJ BM5LVQh0Vfr1XB/oMvSZGqTJfy/Ut7nzZT8w1M2Yy0BZweg3a34DK8hvKcD4sgQy0qU8dIHy lSBeCJCmHV73ZqCsSoXnIafiTacUbzql+H9sOcI0yI5N4mIjWc4jjk1x4+SxXFJcpFt4fKwO md6sd9XwoxUt9Yd1IopEsi2ShnavYCkuT+ZSYzsRkJjMVhKg8g6WSiLkqRdYZXyIMknBcp3I gRTK7CQXLSaDpFSkPJGNYdkEVrnRFZCW9ipk57qU45pWVOn/yic3PGMwxdNv+wcndVfQ8fse 4TIH+4yxWdzzelitv3XpKSbQoSDK+e2efV0KZVNiUVu+yrrjWozAYi5q91TFC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026eucas1p2acf705de2a47ba54f383d916f5383144 X-Msg-Generator: CA X-RootMTR: 20190723122026eucas1p2acf705de2a47ba54f383d916f5383144 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122026eucas1p2acf705de2a47ba54f383d916f5383144 References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch relaxes the condition in of_icc_get_from_provider() so that it is no longer required to set #interconnect-cells = <1> in the DT. In case of the devfreq driver for exynos-bus, #interconnect-cells is always zero. Signed-off-by: Artur Świgoń Acked-by: Krzysztof Kozlowski --- drivers/interconnect/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index d566ae0b66c0..2556fd6d1863 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -279,7 +279,7 @@ struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) struct icc_node *node = ERR_PTR(-EPROBE_DEFER); struct icc_provider *provider; - if (!spec || spec->args_count != 1) + if (!spec) return ERR_PTR(-EINVAL); mutex_lock(&icc_lock); From patchwork Tue Jul 23 12:20:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B5C314F6 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C006284A3 for ; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1004E284DC; Tue, 23 Jul 2019 12:21:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACFF4284A3 for ; Tue, 23 Jul 2019 12:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728707AbfGWMVF (ORCPT ); Tue, 23 Jul 2019 08:21:05 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38680 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389712AbfGWMU3 (ORCPT ); Tue, 23 Jul 2019 08:20:29 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122028euoutp011e65eea93d6f83e999587ea65370a310~0CJoeGSt82863228632euoutp01m for ; Tue, 23 Jul 2019 12:20:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190723122028euoutp011e65eea93d6f83e999587ea65370a310~0CJoeGSt82863228632euoutp01m DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884428; bh=xYHVjPEnK2SWP+r3hWe6spsBX3CeKCFK+Qz1Ihn5wCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UaVI1mOA+sPLf1x+tBVZqOIsO0hdEUIxRoLjdlxJAecyTZrERi9tsQomF32JhLFNu 4l1zkq3ZQVT9sMC222pC2VhV6f47Tnw3pa0n+bdvjqQclo/XKRKy2RgXTbWmE0D65v 2PciSDB308POH+dP6UM+9BY1TSHl/zL8dO40xeLI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190723122028eucas1p13eee0cf56f89df64afa3d2ce3ff472ae~0CJn56LWQ0096400964eucas1p1T; Tue, 23 Jul 2019 12:20:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 58.75.04325.B8BF63D5; Tue, 23 Jul 2019 13:20:27 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190723122027eucas1p124f44370a63b16dcb765585761d661a3~0CJnOVHTg0311803118eucas1p1H; Tue, 23 Jul 2019 12:20:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122027eusmtrp1e5dec855e09799ace7a70bf659773740~0CJnDXiFz2543625436eusmtrp1B; Tue, 23 Jul 2019 12:20:27 +0000 (GMT) X-AuditID: cbfec7f5-b8fff700000010e5-aa-5d36fb8b99fa Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id DD.41.04146.A8BF63D5; Tue, 23 Jul 2019 13:20:26 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122026eusmtip2d645baf0e12dafb33d7dc0bd57036851~0CJmQ0Lac1668716687eusmtip2-; Tue, 23 Jul 2019 12:20:26 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 07/11] icc: Relax condition in apply_constraints() Date: Tue, 23 Jul 2019 14:20:12 +0200 Message-Id: <20190723122016.30279-8-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0hTYRjHe3euWqvjpviUUTQwSPASlh0wIu3C6ZtGQWRSKw9L1Ck7arcP rXt5w7SL6ciBYjYn6przkkqtpZjVikILC60p2WLZmq1CjZxnXb79/s/7/J8bL43JnhHL6HR1 Lq9RKzMVZCBu6f1pjyycjkuN+WGMYa29rRTbUtFEsENTHwi22vaUYF9+myTZ690mki0bKcVZ u72ZYk2OQYJ90akjWU+xDbEV9h4J22h7S7HDp+pJtqL8I7l5CWcyXCK5N4NdJDdS2Cfh7tSe 5O5/7pJwJWYD4jymFUnU3sCNaXxmej6vid50IPBwjX2MyLHSRy3Xxikt8pIFKIAGZh10m92S AhRIy5h6BCVtLkIUUwg83k+UKDwIXG01WAGi5y2tZk6M30LwteUW+dfR7B4ifHVJZgcUXW6f LxXM2BCU6ydxn8AYw5z4bkG+LDmzHWqfOCU+xplw0HcYKR9LmQSoGnZh4oQroaH53jwHMIlQ 8PACKeYEQf+NMdzH2FzOmdYqzNcAGDcFj5ra/Oat8EZr97McnH1mSuTlMFBehIsswHjHCCGa tQhMdTa/IR4e9D0nfEtjzBpo6owWwwnQaHRT4i0WwytXkDjDYiizXPefSAoXz8tEjAD9dIpo BDjdMOivzUGV0YiVolWV/y1T+d8ylf/a6hFmQKF8npCl4oVYNX8kSlBmCXlqVdSh7CwTmvtn A7/6vrWjnpmDVsTQSLFI2ty1PlVGKPOFY1lWBDSmCJYma+NSZdI05bHjvCZ7vyYvkxesKIzG FaHSEwtGU2SMSpnLZ/B8Dq/58yqhA5ZpUdj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4Tv1qkMk2/xvna7V6WeW7f/19S+qUqqx6dRTsHjEFumcrsRRnJBpqMRcVJwIA IsA9K+cCAAA= X-CMS-MailID: 20190723122027eucas1p124f44370a63b16dcb765585761d661a3 X-Msg-Generator: CA X-RootMTR: 20190723122027eucas1p124f44370a63b16dcb765585761d661a3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122027eucas1p124f44370a63b16dcb765585761d661a3 References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The exynos-bus devfreq driver is extended with interconnect functionality by a subsequent patch. This patch removes a check from the interconnect framework that prevents interconnect from working on exynos-bus, in which every bus is a separate interconnect provider. Signed-off-by: Artur Świgoń --- drivers/interconnect/core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 2556fd6d1863..bb55565d190c 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -219,11 +219,8 @@ static int apply_constraints(struct icc_path *path) for (i = 0; i < path->num_nodes; i++) { next = path->reqs[i].node; - /* - * Both endpoints should be valid master-slave pairs of the - * same interconnect provider that will be configured. - */ - if (!prev || next->provider != prev->provider) { + /* both endpoints should be valid master-slave pairs */ + if (!prev) { prev = next; continue; } From patchwork Tue Jul 23 12:20:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A808E912 for ; Tue, 23 Jul 2019 12:20:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9917020121 for ; Tue, 23 Jul 2019 12:20:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CDA222A68; Tue, 23 Jul 2019 12:20:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 285AE20121 for ; Tue, 23 Jul 2019 12:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389719AbfGWMUb (ORCPT ); Tue, 23 Jul 2019 08:20:31 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57745 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389731AbfGWMUa (ORCPT ); Tue, 23 Jul 2019 08:20:30 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122029euoutp02e8a859a215f3a14b42642e99d4d87c60~0CJpMZw1l3179531795euoutp02X for ; Tue, 23 Jul 2019 12:20:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190723122029euoutp02e8a859a215f3a14b42642e99d4d87c60~0CJpMZw1l3179531795euoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884429; bh=R63VpqUTGKXGRrP/Yb1S0i4GgWkwdvgJxrH4IVxwNhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=alUIgy8HfMBCrHlSu1PrgNIlc1vQFZxwBniyeQNWLkTRKeIczRmJVO5EOoZQkUtUc x+dP1KhI3NnT4qY+c9H3Hs1aOtXgb7UyQiYPjjC0YC1Jd6PMOWiftkigb9/J71p38E 6bmUsrZVU+nkHNq75wBo/0h3uMrzT6UzwhXrAQyY= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190723122028eucas1p23bc8d09d1147876131f35f41d4918929~0CJoZ6rhy1082110821eucas1p2a; Tue, 23 Jul 2019 12:20:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id B4.5B.04298.C8BF63D5; Tue, 23 Jul 2019 13:20:28 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190723122027eucas1p24b1d76e3139f7cc52614d7613ff9ba98~0CJns5a7L2096920969eucas1p2A; Tue, 23 Jul 2019 12:20:27 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122027eusmtrp1969382de17b4f9b7cc567e489c022d2b~0CJnh3fqJ2543725437eusmtrp1B; Tue, 23 Jul 2019 12:20:27 +0000 (GMT) X-AuditID: cbfec7f2-f2dff700000010ca-85-5d36fb8cefdb Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BE.D8.04140.B8BF63D5; Tue, 23 Jul 2019 13:20:27 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122026eusmtip2b8aa141a3c4a8a402bed53888c0e08d8~0CJm6ZS3E1733017330eusmtip2j; Tue, 23 Jul 2019 12:20:26 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 08/11] arm: dts: exynos: Add parents and #interconnect-cells to Exynos4412 Date: Tue, 23 Jul 2019 14:20:13 +0200 Message-Id: <20190723122016.30279-9-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SfyyUcRzue++Pe50ur6P5VPp1W7OukFb6bjWlWnv7p/KPtZpy8oZx6F5E al21ECecVqiVP0ztZKcLU5PChVJnUSi1MzFjk/JjrVk/nK/Kf8/zfJ/n+Xw+25ejVHZmORcT nyTq47VxalZB17b8sPsaZwLDNpWP8bippUaOHxRZGNwzNczgOzY7g99Oj7P4xhMri02OfBp3 dFTJsfVzN4O7Ht9i8WSuDeGijgYZrrR9kuO+C/dYXFQ4wu5yE6zmK6zwsbueFRw5rTLhYdl5 ofFLvUy4Wm1GwqR11SH5EcWOSDEuJkXU+weFK6J/DmQyiT1eqbktjTIDsqmykQsH/BZ4NZiH spGCU/H3ENjvG1hCphBcK3MwhEwi+P1yYtbGzUUa7Bqi30XwNLOZ+pcYGs5inL0svx+MBXVz aU/ehqCwdJx2Eoo3z5Lvtcjp8uDDIdvxlXJiml8Hl4xP5nQlHwwVr/NkZMPVUFH1bM7jwu+G 7OeZLPG4w4viQdqJqVnPpZqbFPF/k0NeWxBZdS/UVx0ksgeMtlbLCfaG9kIjTbAEQ4/ImcAb EFjLbfM926G59Q3j7KH49WB57E/kYJhqz6RJ/RLoHXMnGywBU+0NishKyMpQEaiB0pmjJAhw saJ7vluAh0P32Xy0tmTBKSULTin5P7YUUWbkJSZLuihRCogXT/tJW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BsYDj91+HuN46Pxgs+CKCwyvsw/9VV3XVJ2hE8zfynysZvXfkDU3d/fk 70yOEF4jH/94xhnBpAvPP2dyRMjteOPRHHkxhe1DPnfnD63/F+QcHl6Z9mxtyfZvO1k6X8n5 hfNUu6UuYNyjwXznFKupq3fRHb2Ers+df6+etD+V+nfzxjDbui+xUQeVWIozEg21mIuKEwER cQgI6AIAAA== X-CMS-MailID: 20190723122027eucas1p24b1d76e3139f7cc52614d7613ff9ba98 X-Msg-Generator: CA X-RootMTR: 20190723122027eucas1p24b1d76e3139f7cc52614d7613ff9ba98 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122027eucas1p24b1d76e3139f7cc52614d7613ff9ba98 References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds two fields tp the Exynos4412 DTS: - parent: to declare connections between nodes that are not in a parent-child relation in devfreq; - #interconnect-cells: required by the interconnect framework. Please note that #interconnect-cells is always zero and node IDs are not hardcoded anywhere. Signed-off-by: Artur Świgoń --- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 1 + arch/arm/boot/dts/exynos4412.dtsi | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index ea55f377d17c..bdd61ae86103 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi @@ -106,6 +106,7 @@ &bus_leftbus { devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; vdd-supply = <&buck3_reg>; + parent = <&bus_dmc>; status = "okay"; }; diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi index d20db2dfe8e2..a70a671acacd 100644 --- a/arch/arm/boot/dts/exynos4412.dtsi +++ b/arch/arm/boot/dts/exynos4412.dtsi @@ -390,6 +390,7 @@ clocks = <&clock CLK_DIV_DMC>; clock-names = "bus"; operating-points-v2 = <&bus_dmc_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -398,6 +399,7 @@ clocks = <&clock CLK_DIV_ACP>; clock-names = "bus"; operating-points-v2 = <&bus_acp_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -406,6 +408,7 @@ clocks = <&clock CLK_DIV_C2C>; clock-names = "bus"; operating-points-v2 = <&bus_dmc_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -459,6 +462,7 @@ clocks = <&clock CLK_DIV_GDL>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -467,6 +471,7 @@ clocks = <&clock CLK_DIV_GDR>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -475,6 +480,7 @@ clocks = <&clock CLK_ACLK160>; clock-names = "bus"; operating-points-v2 = <&bus_display_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -483,6 +489,7 @@ clocks = <&clock CLK_ACLK133>; clock-names = "bus"; operating-points-v2 = <&bus_fsys_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -491,6 +498,7 @@ clocks = <&clock CLK_ACLK100>; clock-names = "bus"; operating-points-v2 = <&bus_peri_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -499,6 +507,7 @@ clocks = <&clock CLK_SCLK_MFC>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; From patchwork Tue Jul 23 12:20:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7A921399 for ; Tue, 23 Jul 2019 12:20:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6BC220121 for ; Tue, 23 Jul 2019 12:20:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAF9126E3A; Tue, 23 Jul 2019 12:20:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07CF320121 for ; Tue, 23 Jul 2019 12:20:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389731AbfGWMUc (ORCPT ); Tue, 23 Jul 2019 08:20:32 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57756 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389739AbfGWMUb (ORCPT ); Tue, 23 Jul 2019 08:20:31 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122030euoutp0290889fcae82d260bc16dc50d5fbedb24~0CJpzCGHg3163531635euoutp020 for ; Tue, 23 Jul 2019 12:20:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190723122030euoutp0290889fcae82d260bc16dc50d5fbedb24~0CJpzCGHg3163531635euoutp020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884430; bh=EtXo80b/BOT2bVBAt0gRdcaUhCVQMvr2P5JS+yzpsFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r37o2mn0DkTPjwV1X0YN4FWaEExESyZ/rWuSS0vKyKZ2qh1DIG3JVTwfg4ye+5IxV kzPLpQWZqh0cA7fIuVTfZiJBl2EehcBx2YnzFDeO1QdAP8KWeoKDAkpqlG9nYRqPPH PeWaUfSHwt2n++sCe1ocPEM+zFUcfsfqxVPrrOKo= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190723122029eucas1p1d78d048e09d79033ca28037784d3275e~0CJpL8H0n0311003110eucas1p1Z; Tue, 23 Jul 2019 12:20:29 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 96.5B.04298.D8BF63D5; Tue, 23 Jul 2019 13:20:29 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190723122028eucas1p2eb75f35b810e71d6c590370aaff0997b~0CJoWSNdP2751627516eucas1p2d; Tue, 23 Jul 2019 12:20:28 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122028eusmtrp1913f3fc00eda32f785805f9f4a05df09~0CJoLsl3s2543625436eusmtrp1I; Tue, 23 Jul 2019 12:20:28 +0000 (GMT) X-AuditID: cbfec7f2-f2dff700000010ca-89-5d36fb8dd145 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 40.E8.04140.C8BF63D5; Tue, 23 Jul 2019 13:20:28 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122027eusmtip2139fe56f44e2ea08e589506ebef6382c~0CJniKV8X1668716687eusmtip2A; Tue, 23 Jul 2019 12:20:27 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 09/11] devfreq: exynos-bus: Add interconnect functionality to exynos-bus Date: Tue, 23 Jul 2019 14:20:14 +0200 Message-Id: <20190723122016.30279-10-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHKsWRmVeSWpSXmKPExsWy7djPc7q9v81iDdac57I4dGwru8XGGetZ La5/ec5qMf/IOVaLK1/fs1lM37uJzWLS/QksFufPb2C32PT4GqvF5V1z2Cw+9x5htJhxfh+T xdojd9ktbjeuYLOYMfklmwO/x6ZVnWwed67tYfO4332cyWPzknqPg+/2MHn0bVnF6PF5k1wA exSXTUpqTmZZapG+XQJXxutdGgW/zSuW9/1jbGDcr9vFyMkhIWAicbD1BFMXIxeHkMAKRonv e5ZBOV8YJdZ3P2CGcD4zSvy7/4UNpmXLmimsEInljBLdTz+zwrXsfzWLBaSKTcBTomfiDrCE iMARRonJC96zgDjMAquAnO/bGLsYOTiEBeIkOva7gTSwCKhKTLwyjR0kzCvgJHFpijXENnmJ 1RsOMIPYnEDhrqPtYFfwCghKnJz5BGwXM1BN89bZYKdKCHxkl/j16gA7RLOLxKmlV5ghbGGJ V8e3QMVlJE5P7mGBsIslnu68zwrR3MAosWnZEagGa4nDxy+yghzELKApsX6XPk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GMaK8SaWFZcmXuIUYKDWUmEN7DBLFaINyWx siq1KD++qDQntfgQoynQZxOZpUST84HJI68k3tDU0NzC0tDc2NzYzEJJnLdD4GCMkEB6Yklq dmpqQWoRTB8TB6dUA2Nkpd6ah1MSuNqyfVXEZm9w/nftQNPj6TPdy1geXZ99pLliWuU9/v/7 ft5buj4pev0bs2XP1Es8GkqyzavOSC6dy/RrVeUTBRE+108W9g8/f1mfMT3DYEPJ23cKgkur G57t6Wo5X3HjmZV7uIOH3KZNi7Z9PbJfWTZ0R5CNhOlvs9N3579cWrdMiaU4I9FQi7moOBEA hcHFd+YCAAA= X-CMS-MailID: 20190723122028eucas1p2eb75f35b810e71d6c590370aaff0997b X-Msg-Generator: CA X-RootMTR: 20190723122028eucas1p2eb75f35b810e71d6c590370aaff0997b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122028eucas1p2eb75f35b810e71d6c590370aaff0997b References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds interconnect functionality to the exynos-bus devfreq driver. The SoC topology is a graph (or, more specifically, a tree) and most of its edges are taken from the devfreq parent-child hierarchy (cf. Documentation/devicetree/bindings/devfreq/exynos-bus.txt). The previous patch adds missing edges to the DT (under the name 'parent'). Due to unspecified relative probing order, -EPROBE_DEFER may be propagated to guarantee that a child is probed before its parent. Each bus is now an interconnect provider and an interconnect node as well (cf. Documentation/interconnect/interconnect.rst), i.e. every bus registers itself as a node. Node IDs are not hardcoded but rather assigned at runtime, in probing order (subject to the above-mentioned exception regarding relative order). This approach allows for using this driver with various Exynos SoCs. The devfreq target() callback provided by exynos-bus now selects either the frequency calculated by the devfreq governor or the frequency requested via the interconnect API for the given node, whichever is higher. Please note that it is not an error when CONFIG_INTERCONNECT is 'n', in which case all interconnect API functions are no-op. Signed-off-by: Artur Świgoń --- drivers/devfreq/exynos-bus.c | 145 +++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 412511ca7703..12fb7c84ae50 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -23,6 +24,8 @@ #define DEFAULT_SATURATION_RATIO 40 #define DEFAULT_VOLTAGE_TOLERANCE 2 +#define icc_units_to_hz(x) ((x) * 1000UL / 8) + struct exynos_bus { struct device *dev; @@ -31,12 +34,17 @@ struct exynos_bus { unsigned int edev_count; struct mutex lock; + unsigned long min_freq; unsigned long curr_freq; struct regulator *regulator; struct clk *clk; unsigned int voltage_tolerance; unsigned int ratio; + + /* One provider per bus, one node per provider */ + struct icc_provider provider; + struct icc_node *node; }; /* @@ -61,6 +69,13 @@ exynos_bus_ops_edev(enable_edev); exynos_bus_ops_edev(disable_edev); exynos_bus_ops_edev(set_event); +static int exynos_bus_next_id(void) +{ + static int exynos_bus_node_id; + + return exynos_bus_node_id++; +} + static int exynos_bus_get_event(struct exynos_bus *bus, struct devfreq_event_data *edata) { @@ -98,6 +113,8 @@ static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 flags) unsigned long old_freq, new_freq, new_volt, tol; int ret = 0; + *freq = max(*freq, bus->min_freq); + /* Get new opp-bus instance according to new bus clock */ new_opp = devfreq_recommended_opp(dev, freq, flags); if (IS_ERR(new_opp)) { @@ -208,6 +225,8 @@ static int exynos_bus_passive_target(struct device *dev, unsigned long *freq, unsigned long old_freq, new_freq; int ret = 0; + *freq = max(*freq, bus->min_freq); + /* Get new opp-bus instance according to new bus clock */ new_opp = devfreq_recommended_opp(dev, freq, flags); if (IS_ERR(new_opp)) { @@ -251,6 +270,35 @@ static void exynos_bus_passive_exit(struct device *dev) clk_disable_unprepare(bus->clk); } +static int exynos_bus_icc_set(struct icc_node *src, struct icc_node *dst) +{ + struct exynos_bus *src_bus = src->data, *dst_bus = dst->data; + + src_bus->min_freq = icc_units_to_hz(src->peak_bw); + dst_bus->min_freq = icc_units_to_hz(dst->peak_bw); + + return 0; +} + +static int exynos_bus_icc_aggregate(struct icc_node *node, u32 avg_bw, + u32 peak_bw, u32 *agg_avg, u32 *agg_peak) +{ + *agg_peak = *agg_avg = peak_bw; + + return 0; +} + +static struct icc_node *exynos_bus_icc_xlate(struct of_phandle_args *spec, + void *data) +{ + struct exynos_bus *bus = data; + + if (spec->np != bus->dev->of_node) + return ERR_PTR(-EINVAL); + + return bus->node; +} + static int exynos_bus_parent_parse_of(struct device_node *np, struct exynos_bus *bus) { @@ -469,6 +517,95 @@ static int exynos_bus_profile_init_passive(struct exynos_bus *bus, return ret; } +static int exynos_bus_icc_connect(struct exynos_bus *bus) +{ + struct device_node *np = bus->dev->of_node; + struct devfreq *parent_devfreq; + struct icc_node *parent_node = NULL; + struct of_phandle_args args; + int ret = 0; + + parent_devfreq = devfreq_get_devfreq_by_phandle(bus->dev, 0); + if (!IS_ERR(parent_devfreq)) { + struct exynos_bus *parent_bus; + + parent_bus = dev_get_drvdata(parent_devfreq->dev.parent); + parent_node = parent_bus->node; + } else { + /* Look for parent in DT */ + int num = of_count_phandle_with_args(np, "parent", + "#interconnect-cells"); + if (num != 1) + goto out; + + ret = of_parse_phandle_with_args(np, "parent", + "#interconnect-cells", + 0, &args); + if (ret < 0) + goto out; + + of_node_put(args.np); + + parent_node = of_icc_get_from_provider(&args); + if (IS_ERR(parent_node)) { + /* May be -EPROBE_DEFER */ + ret = PTR_ERR(parent_node); + goto out; + } + } + + ret = icc_link_create(bus->node, parent_node->id); + +out: + return ret; +} + +static int exynos_bus_icc_init(struct exynos_bus *bus) +{ + struct device *dev = bus->dev; + struct icc_provider *provider = &bus->provider; + struct icc_node *node; + int id, ret; + + /* Initialize the interconnect provider */ + provider->set = exynos_bus_icc_set; + provider->aggregate = exynos_bus_icc_aggregate; + provider->xlate = exynos_bus_icc_xlate; + provider->dev = dev; + provider->data = bus; + + ret = icc_provider_add(provider); + if (ret < 0) + goto out; + + id = exynos_bus_next_id(); + node = icc_node_create(id); + if (IS_ERR(node)) { + ret = PTR_ERR(node); + goto err_node; + } + + bus->node = node; + node->name = dev->of_node->name; + node->data = bus; + icc_node_add(node, provider); + + ret = exynos_bus_icc_connect(bus); + if (ret < 0) + goto err_connect; + +out: + return ret; + +err_connect: + icc_node_del(node); + icc_node_destroy(id); +err_node: + icc_provider_del(provider); + + return ret; +} + static int exynos_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -517,6 +654,14 @@ static int exynos_bus_probe(struct platform_device *pdev) goto err; } + /* + * Initialize interconnect provider. A return value of -ENOTSUPP means + * that CONFIG_INTERCONNECT is disabled. + */ + ret = exynos_bus_icc_init(bus); + if (ret < 0 && ret != -ENOTSUPP) + goto err; + max_state = bus->devfreq->profile->max_state; min_freq = (bus->devfreq->profile->freq_table[0] / 1000); max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000); From patchwork Tue Jul 23 12:20:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 214C61399 for ; Tue, 23 Jul 2019 12:20:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11D7320121 for ; Tue, 23 Jul 2019 12:20:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05A0022A68; Tue, 23 Jul 2019 12:20:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB76420121 for ; Tue, 23 Jul 2019 12:20:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389746AbfGWMUw (ORCPT ); Tue, 23 Jul 2019 08:20:52 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57719 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389740AbfGWMUb (ORCPT ); Tue, 23 Jul 2019 08:20:31 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122030euoutp028166e3aa9dcbf1dcd68480ada8a6e97b~0CJqJ1vhZ3178431784euoutp02e for ; Tue, 23 Jul 2019 12:20:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190723122030euoutp028166e3aa9dcbf1dcd68480ada8a6e97b~0CJqJ1vhZ3178431784euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884430; bh=RUl5wJeFoskqQ1lDVm8gqntXrYOyS23MWPseu8SSF2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e6HlEwEvhOIZ0/qXBkr91CsMlxwf3AeC/VOQUCSsII6gY76QG6xzJvxXolgeArVKU n3YnaDSCxKMTih1A9WIgAwBBMmM/33DuIvKtbA/bI1S4oDTWT7dgfkO1VypMkd4p8T p/Cy+CIF5KF06Iyvlg5PGJKgZTe7Hz+3aYuLh9a4= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190723122029eucas1p229ebf0e7f961ec1ea52fdd2e8068089a~0CJpnFwhH2751627516eucas1p2g; Tue, 23 Jul 2019 12:20:29 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id DF.0C.04377.D8BF63D5; Tue, 23 Jul 2019 13:20:29 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190723122029eucas1p21e1a51e759f9b605d2c89daf659af7bb~0CJo-Ssns1893418934eucas1p2G; Tue, 23 Jul 2019 12:20:29 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122029eusmtrp1014a6d434e4a0d7a52cc6c3dda4f522e~0CJo0lgUD2543625436eusmtrp1K; Tue, 23 Jul 2019 12:20:29 +0000 (GMT) X-AuditID: cbfec7f4-12dff70000001119-bb-5d36fb8dd1e6 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 11.51.04146.C8BF63D5; Tue, 23 Jul 2019 13:20:28 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122028eusmtip2f4761e8c1aeee8935e1e6249aa5034b5~0CJoJwBlI1731117311eusmtip2r; Tue, 23 Jul 2019 12:20:28 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 10/11] arm: dts: exynos: Add interconnects to Exynos4412 mixer Date: Tue, 23 Jul 2019 14:20:15 +0200 Message-Id: <20190723122016.30279-11-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAKsWRmVeSWpSXmKPExsWy7djP87q9v81iDZqXalgcOraV3WLjjPWs Fte/PGe1mH/kHKvFla/v2Sym793EZjHp/gQWi/PnN7BbbHp8jdXi8q45bBafe48wWsw4v4/J Yu2Ru+wWtxtXsFnMmPySzYHfY9OqTjaPO9f2sHnc7z7O5LF5Sb3HwXd7mDz6tqxi9Pi8SS6A PYrLJiU1J7MstUjfLoErY+emF6wFc9gr3re/YmtgbGPrYuTkkBAwkWhfeoOli5GLQ0hgBaPE xMNbmCGcL4wSe27dYYVwPjNKbLq9gQmm5cKVc1AtyxklnjW+YYVr+Xq9H6yKTcBTomfiDrCE iMARRonJC96DtTALrAJyvm9jBKkSFgiROHngFFgHi4CqxM5p18FsXgEniU//TrNC7JOXWL3h ADOIzQkU7zrazgZRIyhxcuYTFhCbGaimeetsZoj6j+wSbx4mQdguEn+X9kPFhSVeHd/CDmHL SJye3MMCYRdLPN15H+xSCYEGoEeXHYFqsJY4fPwiUIIDaIGmxPpd+hBhR4lfv48yg4QlBPgk brwVhDiBT2LStulQYV6JjjYhCFNLYsHvaIhGCYmm1degZntIfOlpYpzAqDgLyS+zkPwyC2Ht AkbmVYziqaXFuempxUZ5qeV6xYm5xaV56XrJ+bmbGIHp7PS/4192MO76k3SIUYCDUYmHd8Me 01gh1sSy4srcQ4wSHMxKIryBDWaxQrwpiZVVqUX58UWlOanFhxilOViUxHmrGR5ECwmkJ5ak ZqemFqQWwWSZODilGhi314rrNjZciumd8+pMTlPTz5hX7R6h5xd7fLYtX9qU7nUz0Oscz+Ln RrkW25ofc+VfDDU5u/NysNDFOgbBm2YTN9xQfp7U0CY8kUPD2LaX/0yD8FnV0NPNKc31V6Jf p626y9t2YnXtRq4wLo719jfuH36TcXWtX4VbZtXdeClzmU9bJRVnpyixFGckGmoxFxUnAgC6 lrohYwMAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGIsWRmVeSWpSXmKPExsVy+t/xe7o9v81iDb5ssbI4dGwru8XGGetZ La5/ec5qMf/IOVaLK1/fs1lM37uJzWLS/QksFufPb2C32PT4GqvF5V1z2Cw+9x5htJhxfh+T xdojd9ktbjeuYLOYMfklmwO/x6ZVnWwed67tYfO4332cyWPzknqPg+/2MHn0bVnF6PF5k1wA e5SeTVF+aUmqQkZ+cYmtUrShhZGeoaWFnpGJpZ6hsXmslZGpkr6dTUpqTmZZapG+XYJexs5N L1gL5rBXvG9/xdbA2MbWxcjJISFgInHhyjmWLkYuDiGBpYwSG963MUEkJCQ+rr/BCmELS/y5 1sUGUfSJUeLGsmOMIAk2AU+Jnok7WEESIgKnGCW2Lj8HVsUssIlR4u7xiewgVcICQRJvLzeA 7WMRUJXYOe062ApeASeJT/9OQ62Ql1i94QAziM0JFO862g5WLyTgKLFt+2tGiHpBiZMznwDd ygG0QF1i/TwhkDAzUGvz1tnMExgFZyGpmoVQNQtJ1QJG5lWMIqmlxbnpucWGesWJucWleel6 yfm5mxiBcbrt2M/NOxgvbQw+xCjAwajEw7thj2msEGtiWXFl7iFGCQ5mJRHewAazWCHelMTK qtSi/Pii0pzU4kOMpkCvTWSWEk3OB6aQvJJ4Q1NDcwtLQ3Njc2MzCyVx3g6BgzFCAumJJanZ qakFqUUwfUwcnFINjLNtxYRMHlvM03jBNnXutikdJkw/+c8lr3j+9Esma/yi5WnS70Rezjr9 QDh1c2fJuy3mtd7VJ3g9pdzN11y+XW1w5EPFjpu/mpdvecX1tlup6YO3++afuTv/crjXXJQp mXXNtk1EgWPp6j8lEnnuG862yysJNE7cIKT+5/zDn4LJvTFcG1t+uyixFGckGmoxFxUnAgDh 0cb16QIAAA== X-CMS-MailID: 20190723122029eucas1p21e1a51e759f9b605d2c89daf659af7bb X-Msg-Generator: CA X-RootMTR: 20190723122029eucas1p21e1a51e759f9b605d2c89daf659af7bb X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122029eucas1p21e1a51e759f9b605d2c89daf659af7bb References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds an 'interconnects' property to Exynos4412 DTS in order to declare the interconnect path used by the mixer. Please note that the 'interconnect-names' property is not needed when there is only one path in 'interconnects', in which case calling of_icc_get() with a NULL name simply returns the right path. Signed-off-by: Artur Świgoń --- arch/arm/boot/dts/exynos4412.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi index a70a671acacd..faaec6c40412 100644 --- a/arch/arm/boot/dts/exynos4412.dtsi +++ b/arch/arm/boot/dts/exynos4412.dtsi @@ -789,6 +789,7 @@ clock-names = "mixer", "hdmi", "sclk_hdmi", "vp"; clocks = <&clock CLK_MIXER>, <&clock CLK_HDMI>, <&clock CLK_SCLK_HDMI>, <&clock CLK_VP>; + interconnects = <&bus_display &bus_dmc>; }; &pmu { From patchwork Tue Jul 23 12:20:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11054427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB1B71399 for ; Tue, 23 Jul 2019 12:20:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C523320174 for ; Tue, 23 Jul 2019 12:20:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7E6D22A68; Tue, 23 Jul 2019 12:20:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FC9420174 for ; Tue, 23 Jul 2019 12:20:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389754AbfGWMUe (ORCPT ); Tue, 23 Jul 2019 08:20:34 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38689 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389745AbfGWMUd (ORCPT ); Tue, 23 Jul 2019 08:20:33 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190723122031euoutp012c3b1f1f94ff74e276a9ce574cad9b3e~0CJq2kriK2865228652euoutp01i for ; Tue, 23 Jul 2019 12:20:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190723122031euoutp012c3b1f1f94ff74e276a9ce574cad9b3e~0CJq2kriK2865228652euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563884431; bh=chTAxkeOxeztbYhH5EwlVhyZmCCDjcZAKWEH2LV9Maw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SDJFh76Xs3O0baQ+0RL20r3do0CbUInP1yE9C2qSPh+QqXtvkarNdywgj+G3b0r3D 0jeLwfdDPZG3zUdPGvCwdRqcp4vqm2TInMmeG0b/1ACgCa19DCiMWld5J2YqvPVfoa A5cReIjq+1g2716hhh2jP0mYM5cENknB6YwwvNqo= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190723122030eucas1p1526085231fac50d83e0c3f4e901d27ac~0CJqHQ6G11172511725eucas1p1s; Tue, 23 Jul 2019 12:20:30 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id BA.75.04325.E8BF63D5; Tue, 23 Jul 2019 13:20:30 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190723122029eucas1p2915f536d9ef43a7bd043a878a553439f~0CJpcU7GT2749027490eucas1p2e; Tue, 23 Jul 2019 12:20:29 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190723122029eusmtrp1a31f44e38dd0815908164fafed0ac103~0CJpbZEWS2543625436eusmtrp1M; Tue, 23 Jul 2019 12:20:29 +0000 (GMT) X-AuditID: cbfec7f5-b75ff700000010e5-b1-5d36fb8eb2a1 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 44.51.04146.D8BF63D5; Tue, 23 Jul 2019 13:20:29 +0100 (BST) Received: from AMDC3555.DIGITAL.local (unknown [106.120.51.67]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190723122028eusmtip253d509d660fc46b60b3b91f389d18d83~0CJozTE0j1733017330eusmtip2k; Tue, 23 Jul 2019 12:20:28 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: krzk@kernel.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, m.szyprowski@samsung.com Subject: [RFC PATCH 11/11] drm: exynos: mixer: Add interconnect support Date: Tue, 23 Jul 2019 14:20:16 +0200 Message-Id: <20190723122016.30279-12-a.swigon@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723122016.30279-1-a.swigon@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SfSyUcRzvd8/LPY7jccR3va5b14tNekG/lVrJ1rX+kH8z6YknWlx2D0r9 EbmQMLkaIaxaOBMOV3lbXYdarVtLspWpYdFW8hojdeeh/Pf5fl5+n+93+zGEwkqtYs5o4nmt hotR0jLS1DHzxjtn1j9su6FEhs0djVJcV1BD4Q8TXylcanlD4a7JERrntxppnNeXS2KrtVaK jf3dFH7XVEzj8WwLwgXWNgmutvRK8ceUChoX6IfpAy5qo+Earf7U3UKr+653StT19y+rn/1o kahzGgxIPW5cd0x6XBYQycecSeS1PvtPyqINbbVUnG7jhbSB92Qysq7NRA4MsL4wr5uSZiIZ o2ArEKS2TknsgoKdQFBQuVIUxhG8uJpKLyXufX+6mChHMDCcjv4lUpqd7Jhmj0DWjceU3eTO WhDoy0ZI+0CwBtvwy7SQcGMPw5e8koU+klXBwHQdZcdyNhD+lBeTYt16qKp9Stixg43PbE+n RY8rvLw9sOAhbJ7UxiLCXgDsqBTu/PotEcNBUN6vQyJ2g2+dDVIRr4FX+qzFAgEGn/RRYjgZ gfGBhRCFvfC8861NYGwNW6GmyUekD0KlTi+108A6Q893V3EHZ8gz5RMiLYeMNIUIvaBsNlQM Alyp6l58Ww0/sk1ELtpQuOyYwmXHFP6vLUOEAXnyCUJsFC/s0vDntwlcrJCgidoWcS7WiGzf 7NV85+Rj1DZ3yoxYBimd5LUtfmEKiksUkmLNCBhC6S4PSfYPU8gjuaSLvPZcuDYhhhfMaDVD Kj3ll1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ad313b4VLz5eLjlhGmzwOTR9fubniX2BX9Vn 3NvV32UgEXz0t+rc0tRPzov3xgXtfzsloFRVcT/PxBD3iNfftr+d4OuvxFKckWioxVxUnAgA zexhSukCAAA= X-CMS-MailID: 20190723122029eucas1p2915f536d9ef43a7bd043a878a553439f X-Msg-Generator: CA X-RootMTR: 20190723122029eucas1p2915f536d9ef43a7bd043a878a553439f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190723122029eucas1p2915f536d9ef43a7bd043a878a553439f References: <20190723122016.30279-1-a.swigon@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marek Szyprowski This patch adds interconnect support to exynos-mixer. Please note that the mixer works the same as before when CONFIG_INTERCONNECT is 'n'. Co-developed-by: Artur Świgoń Signed-off-by: Artur Świgoń Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_mixer.c | 68 +++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 7b24338fad3c..fb763854b300 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -97,6 +98,7 @@ struct mixer_context { struct exynos_drm_crtc *crtc; struct exynos_drm_plane planes[MIXER_WIN_NR]; unsigned long flags; + struct icc_path *soc_path; int irq; void __iomem *mixer_regs; @@ -931,6 +933,37 @@ static void mixer_disable_vblank(struct exynos_drm_crtc *crtc) mixer_reg_writemask(mixer_ctx, MXR_INT_EN, 0, MXR_INT_EN_VSYNC); } +static void mixer_set_memory_bandwidth(struct exynos_drm_crtc *crtc) +{ + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; + struct mixer_context *ctx = crtc->ctx; + unsigned long bw, bandwidth = 0; + int i, j, sub; + + for (i = 0; i < MIXER_WIN_NR; i++) { + struct drm_plane *plane = &ctx->planes[i].base; + const struct drm_format_info *format; + + if (plane->state && plane->state->crtc && plane->state->fb) { + format = plane->state->fb->format; + bw = mode->hdisplay * mode->vdisplay * + drm_mode_vrefresh(mode); + if (mode->flags & DRM_MODE_FLAG_INTERLACE) + bw /= 2; + for (j = 0; j < format->num_planes; j++) { + sub = j ? (format->vsub * format->hsub) : 1; + bandwidth += format->cpp[j] * bw / sub; + } + } + } + + /* add 20% safety margin */ + bandwidth = 5UL * bandwidth / 4; + + pr_info("exynos-mixer: safe bandwidth %ld Bps\n", bandwidth); + icc_set_bw(ctx->soc_path, 0, Bps_to_icc(bandwidth)); +} + static void mixer_atomic_begin(struct exynos_drm_crtc *crtc) { struct mixer_context *ctx = crtc->ctx; @@ -982,6 +1015,7 @@ static void mixer_atomic_flush(struct exynos_drm_crtc *crtc) if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) return; + mixer_set_memory_bandwidth(crtc); mixer_enable_sync(mixer_ctx); exynos_crtc_handle_event(crtc); } @@ -1029,6 +1063,7 @@ static void mixer_disable(struct exynos_drm_crtc *crtc) for (i = 0; i < MIXER_WIN_NR; i++) mixer_disable_plane(crtc, &ctx->planes[i]); + mixer_set_memory_bandwidth(crtc); exynos_drm_pipe_clk_enable(crtc, false); pm_runtime_put(ctx->dev); @@ -1220,12 +1255,22 @@ static int mixer_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; const struct mixer_drv_data *drv; struct mixer_context *ctx; + struct icc_path *path; int ret; + /* + * Returns NULL if CONFIG_INTERCONNECT is disabled. + * May return ERR_PTR(-EPROBE_DEFER). + */ + path = of_icc_get(dev, NULL); + if (IS_ERR(path)) + return PTR_ERR(path); + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) { DRM_DEV_ERROR(dev, "failed to alloc mixer context.\n"); - return -ENOMEM; + ret = -ENOMEM; + goto err; } drv = of_device_get_match_data(dev); @@ -1233,6 +1278,7 @@ static int mixer_probe(struct platform_device *pdev) ctx->pdev = pdev; ctx->dev = dev; ctx->mxr_ver = drv->version; + ctx->soc_path = path; if (drv->is_vp_enabled) __set_bit(MXR_BIT_VP_ENABLED, &ctx->flags); @@ -1242,17 +1288,29 @@ static int mixer_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ctx); ret = component_add(&pdev->dev, &mixer_component_ops); - if (!ret) - pm_runtime_enable(dev); + if (ret < 0) + goto err; + + pm_runtime_enable(dev); + + return 0; + +err: + icc_put(path); return ret; } static int mixer_remove(struct platform_device *pdev) { - pm_runtime_disable(&pdev->dev); + struct device *dev = &pdev->dev; + struct mixer_context *ctx = dev_get_drvdata(dev); - component_del(&pdev->dev, &mixer_component_ops); + pm_runtime_disable(dev); + + component_del(dev, &mixer_component_ops); + + icc_put(ctx->soc_path); return 0; }