Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp967235rdh; Fri, 27 Oct 2023 00:12:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQ1QK6FswgvcCOUtG6B556ansytNxZgnFVL37Ancgo3Awn4p0IWlbUPvj4XyAbEL27hhBs X-Received: by 2002:a25:b120:0:b0:d91:fdb:afd4 with SMTP id g32-20020a25b120000000b00d910fdbafd4mr1647248ybj.16.1698390777452; Fri, 27 Oct 2023 00:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698390777; cv=none; d=google.com; s=arc-20160816; b=rWc1X4bwlQNx12ggLrsHyrQg2C8+J/yRcgLKIGHnd2Fz15N5jPXOxyPalX6uKTy7b/ 3JabswJifsYNPtTr3fYE5DEwaQtJrQ5CbmHU/hJ51y5bqxro5ylqkZpEB8APPo05p/7d 0cT3yKGTVZNBqbCico4b7P8pak1SAaEu5MJUpTKqFzG7MhMLivmDz4DjDNR766Wr8w7J cgN+nO+y4b8ZZmRkrTY+65nAhaxkEjjYeFj01C3xjcPNbdKAKpG+4fR7bV4rgjOeu2YQ E8h+Kl3XPeUwjVtuvE406AZTE/jBfdKzpDB0ntjOc8VB9od4RLR6e/xxBeq1FmLBiEeN yKGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:content-language :thread-index:content-transfer-encoding:mime-version:message-id:date :subject:in-reply-to:cc:to:from:dkim-signature:dkim-filter; bh=XinEXqbMGYYXEdTEUQ6Gxi75JRlQ0apA3Uu3KoNEONQ=; fh=NDQ0yF0IX9mS7kTNd6/atRciNXz6GiOF85GnFjPccvM=; b=yjSDk1Csuwf0B3OzxUD8lzLkLLkXBK1WwwXdHSeXvxJOERPxadz2cgfKcpd97Qn+dO olV1gEKO1sTUNzFK3BuAxrC82li6UOfk+oxKzIn11/iA4mP9KvE5c5VH3QXTGK9o+RAa AJouWidjcKMeJX8t4QqhACAbrmL/pU2+n7BOCtN9QR+7Yt99iv2Y//8dDX+KPMDAWskA DeowzgoKILLFj9Ta/zl6PxUJ7HwObZbGDcKKyBVooXFu1PDoQVEjH7Xd+9rAeIxXR03v bfnPcoP9xzakqAChmnlwpyK1gIfvNfjeKvcph1Jmyji+/C+srpW/z+xe3w3f9PejYkpA DaJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Fixw7w7j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id m125-20020a252683000000b00d9c7e958ce4si1802674ybm.488.2023.10.27.00.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 00:12:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Fixw7w7j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8630981C0C82; Fri, 27 Oct 2023 00:12:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234957AbjJ0HMH (ORCPT + 99 others); Fri, 27 Oct 2023 03:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234981AbjJ0HMF (ORCPT ); Fri, 27 Oct 2023 03:12:05 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 373631BD for ; Fri, 27 Oct 2023 00:12:00 -0700 (PDT) Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231027071158epoutp048087ce4c5b67c6cd13950ac0d44528d0~R5VwSV6sE2313123131epoutp04h for ; Fri, 27 Oct 2023 07:11:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231027071158epoutp048087ce4c5b67c6cd13950ac0d44528d0~R5VwSV6sE2313123131epoutp04h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1698390718; bh=XinEXqbMGYYXEdTEUQ6Gxi75JRlQ0apA3Uu3KoNEONQ=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=Fixw7w7j0kbV7fHtj+7nAyHSot2zlj5lrO/Y8BNgyixVlJz6WUlp9PutDY57NRtM5 9Kuw6NUzgJjBgwyWSoVAdQIA2EQ63TbOSRVWm/DcUZ+RBeGZ/Gqwh44p/GBBnwVz3u 9vCtoM/CLkL+lY9XOta1/BEhFaAg+we7ycSgtDes= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20231027071157epcas5p412d8c4007d98798f39809bc775f623b0~R5Vvwtdsi2566125661epcas5p4d; Fri, 27 Oct 2023 07:11:57 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.176]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4SGv3v5rlSz4x9QB; Fri, 27 Oct 2023 07:11:55 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 7D.6A.09672.8B26B356; Fri, 27 Oct 2023 16:11:52 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20231027063746epcas5p1256399d02b1255f65b6e766a13da92cd~R435iH_-D2895828958epcas5p1P; Fri, 27 Oct 2023 06:37:46 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231027063746epsmtrp1a947182f52274b9b4fdafaf6d4cb332d~R435hXZ_40137601376epsmtrp1n; Fri, 27 Oct 2023 06:37:46 +0000 (GMT) X-AuditID: b6c32a4b-39fff700000025c8-2c-653b62b8ecfd Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 46.52.08755.ABA5B356; Fri, 27 Oct 2023 15:37:46 +0900 (KST) Received: from FDSFTE462 (unknown [107.122.81.248]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20231027063744epsmtip1ad1884e37ef89dbc96485af6ccb07398~R433nhDDm2102021020epsmtip1R; Fri, 27 Oct 2023 06:37:44 +0000 (GMT) From: "Shradha Todi" To: , , , , , , Cc: , , , , In-Reply-To: <20231009062216.6729-1-shradha.t@samsung.com> Subject: RE: [PATCH] PCI: exynos: Adapt to clk_bulk_* APIs Date: Fri, 27 Oct 2023 12:07:43 +0530 Message-ID: <0b4801da08a0$18877110$49965330$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQFlrvPEaqAl+ZjspMpXVx4MiN0lSgK7wbyrsTAEGMA= Content-Language: en-in X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIJsWRmVeSWpSXmKPExsWy7bCmpu6OJOtUg/PzDC0ezNvGZrGkKcNi xZeZ7BZ7X29lt2jo+c1qsenxNVaLy7vmsFmcnXeczWLG+X1MFi1/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q31qcHbK/7Mz5dQyq7z4IThS27fpZJ58p8NaF4f+CHS4xhh/ON6i7/PO+86hRW4ml OCPRUIu5qDgRAIDWXTo8AwAA X-CMS-MailID: 20231027063746epcas5p1256399d02b1255f65b6e766a13da92cd X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231009062222epcas5p36768b75c13c7c79965b5863521361a64 References: <20231009062216.6729-1-shradha.t@samsung.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 27 Oct 2023 00:12:37 -0700 (PDT) Gentle reminder to review this patch. Thanks in advance=21 > -----Original Message----- > From: Shradha Todi =5Bmailto:shradha.t=40samsung.com=5D > Sent: 09 October 2023 11:52 > To: jingoohan1=40gmail.com; lpieralisi=40kernel.org; kw=40linux.com; > robh=40kernel.org; bhelgaas=40google.com; krzysztof.kozlowski=40linaro.or= g; > alim.akhtar=40samsung.com > Cc: linux-pci=40vger.kernel.org; linux-arm-kernel=40lists.infradead.org; = linux- > samsung-soc=40vger.kernel.org; linux-kernel=40vger.kernel.org; > pankaj.dubey=40samsung.com; Shradha Todi > Subject: =5BPATCH=5D PCI: exynos: Adapt to clk_bulk_* APIs >=20 > There is no need to hardcode the clock info in the driver as driver can r= ely on > the devicetree to supply the clocks required for the functioning of the > peripheral. Get rid of the static clock info and obtain the platform supp= lied > clocks. The total number of clocks supplied is obtained using the > devm_clk_bulk_get_all() API and used for the rest of the clk_bulk_* APIs. >=20 > Signed-off-by: Shradha Todi > --- > drivers/pci/controller/dwc/pci-exynos.c =7C 46 ++++++------------------- > 1 file changed, 11 insertions(+), 35 deletions(-) >=20 > diff --git a/drivers/pci/controller/dwc/pci-exynos.c > b/drivers/pci/controller/dwc/pci-exynos.c > index 9e42cfcd99cc..023cf41fccd7 100644 > --- a/drivers/pci/controller/dwc/pci-exynos.c > +++ b/drivers/pci/controller/dwc/pci-exynos.c > =40=40 -54,8 +54,8 =40=40 > struct exynos_pcie =7B > struct dw_pcie pci; > void __iomem *elbi_base; > - struct clk *clk; > - struct clk *bus_clk; > + struct clk_bulk_data *clks; > + int clk_cnt; > struct phy *phy; > struct regulator_bulk_data supplies=5B2=5D; > =7D; > =40=40 -65,30 +65,18 =40=40 static int exynos_pcie_init_clk_resources(str= uct > exynos_pcie *ep) > struct device *dev =3D ep->pci.dev; > int ret; >=20 > - ret =3D clk_prepare_enable(ep->clk); > - if (ret) =7B > - dev_err(dev, =22cannot enable pcie rc clock=22); > + ret =3D devm_clk_bulk_get_all(dev, &ep->clks); > + if (ret < 0) > return ret; > - =7D >=20 > - ret =3D clk_prepare_enable(ep->bus_clk); > - if (ret) =7B > - dev_err(dev, =22cannot enable pcie bus clock=22); > - goto err_bus_clk; > - =7D > + ep->clk_cnt =3D ret; >=20 > - return 0; > - > -err_bus_clk: > - clk_disable_unprepare(ep->clk); > - > - return ret; > + return clk_bulk_prepare_enable(ep->clk_cnt, ep->clks); > =7D >=20 > static void exynos_pcie_deinit_clk_resources(struct exynos_pcie *ep) = =7B > - clk_disable_unprepare(ep->bus_clk); > - clk_disable_unprepare(ep->clk); > + clk_bulk_disable_unprepare(ep->clk_cnt, ep->clks); > =7D >=20 > static void exynos_pcie_writel(void __iomem *base, u32 val, u32 reg) =40= =40 - > 332,17 +320,9 =40=40 static int exynos_pcie_probe(struct platform_device > *pdev) > if (IS_ERR(ep->elbi_base)) > return PTR_ERR(ep->elbi_base); >=20 > - ep->clk =3D devm_clk_get(dev, =22pcie=22); > - if (IS_ERR(ep->clk)) =7B > - dev_err(dev, =22Failed to get pcie rc clock=5Cn=22); > - return PTR_ERR(ep->clk); > - =7D > - > - ep->bus_clk =3D devm_clk_get(dev, =22pcie_bus=22); > - if (IS_ERR(ep->bus_clk)) =7B > - dev_err(dev, =22Failed to get pcie bus clock=5Cn=22); > - return PTR_ERR(ep->bus_clk); > - =7D > + ret =3D exynos_pcie_init_clk_resources(ep); > + if (ret < 0) > + return ret; >=20 > ep->supplies=5B0=5D.supply =3D =22vdd18=22; > ep->supplies=5B1=5D.supply =3D =22vdd10=22; > =40=40 -351,10 +331,6 =40=40 static int exynos_pcie_probe(struct platform= _device > *pdev) > if (ret) > return ret; >=20 > - ret =3D exynos_pcie_init_clk_resources(ep); > - if (ret) > - return ret; > - > ret =3D regulator_bulk_enable(ARRAY_SIZE(ep->supplies), ep- > >supplies); > if (ret) > return ret; > =40=40 -369,8 +345,8 =40=40 static int exynos_pcie_probe(struct platform_= device > *pdev) >=20 > fail_probe: > phy_exit(ep->phy); > - exynos_pcie_deinit_clk_resources(ep); > regulator_bulk_disable(ARRAY_SIZE(ep->supplies), ep->supplies); > + exynos_pcie_deinit_clk_resources(ep); >=20 > return ret; > =7D > -- > 2.17.1