From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57EC7C678D4 for ; Fri, 3 Mar 2023 06:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:MIME-Version:Message-ID:Date :Subject:In-Reply-To:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VsTmwpkQ8aEtIgRYTxXA0pd0+urgxGgcQCGU3lM+l8o=; b=gqVwB96hIh1UJu BUbJEMDHUXd20q08l1Ur7XMuRx/0j96erpYOK6vFMLN2nRNlcRT3MkXHP5Q0gF+rkbsW6DHSpDFAg oggNeJVOK5CoBBNa6pM/hDfLvNGk86sfZw6BsayYAzO8MoFK0d/A0u4Mc4Sui9abwnmav+CoC1JWH tSa4wP/mkmCoGKtEZZYhNezKNSlJLtl/NsKbyu4FXpcH2HtNnp9b61GMWMyPIyHIzQoQBoEjVv+3L sr1Dt8Q1V0UW2J+W47Az7A4m3TSUwnVFP9t3kxBUaX5EEKkVPPP3x54d+msFzRwVfU4ZWwK2AnAkY DEHhiGQVPkoq/GclUElw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pXys2-00532h-4y; Fri, 03 Mar 2023 06:26:22 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pXyqj-0052Ss-Ia for linux-arm-kernel@lists.infradead.org; Fri, 03 Mar 2023 06:25:04 +0000 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20230303062459epoutp04e82aee2393b13719461f085377698548~I1KzLMCty2519625196epoutp04X for ; Fri, 3 Mar 2023 06:24:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20230303062459epoutp04e82aee2393b13719461f085377698548~I1KzLMCty2519625196epoutp04X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1677824699; bh=sv2hnfV+RZAA1n52R0aeU8NHCNtbzK89lktgJrilOZc=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=BzFyFbiwX01CjwL/2H7ZuK9vLk+lQX21u6bR1qYyNkL+a2u8VfsVB6kYdbthjBkze w2TPFz50V9213DDCHY/4VmthTzx+RcrSbDyOviPFGxOY6+rKsVYDCLJrd6qMGUwR8t 0Z+WpKZCIRP+uZKMuiQWixtnzFmIO728RkqDgA2M= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20230303062459epcas5p3ea6871064e48c6efd24ff13ca3bc0dcf~I1Kypaotc0229702297epcas5p3B; Fri, 3 Mar 2023 06:24:59 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.181]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4PSdHY23n6z4x9QF; Fri, 3 Mar 2023 06:24:57 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id B4.86.06765.9B291046; Fri, 3 Mar 2023 15:24:57 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20230302131016epcas5p3084bc8d556da7316c3ca50cba044a836~InDXxiSmB1466014660epcas5p3R; Thu, 2 Mar 2023 13:10:16 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230302131016epsmtrp19162c5513b2eff120490acdd5e7d7d3b~InDXwiMBR0832508325epsmtrp1P; Thu, 2 Mar 2023 13:10:16 +0000 (GMT) X-AuditID: b6c32a4b-46dfa70000011a6d-3d-640192b92341 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 05.84.18071.830A0046; Thu, 2 Mar 2023 22:10:16 +0900 (KST) Received: from FDSFTE462 (unknown [107.122.81.248]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230302131013epsmtip20cb8ea82f30448f73cc63032ab2e84dd~InDVC3y-i2302723027epsmtip2r; Thu, 2 Mar 2023 13:10:13 +0000 (GMT) From: "Shradha Todi" To: "'Krzysztof Kozlowski'" , , , , , , , , , , , , , , Cc: , , , , In-Reply-To: Subject: RE: [PATCH 15/16] PCI: samsung: Add structure to hold resource operations Date: Thu, 2 Mar 2023 18:40:12 +0530 Message-ID: <139901d94d08$54fb9030$fef2b090$@samsung.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHB3D0FgV9/Br8Y35oSVRdB1anKHwH9qfdGAn+u9fwBvPnmbq7khR1w Content-Language: en-in X-Brightmail-Tracker: H4sIAAAAAAAAA02TfUxTZxTGfXtve1sEdwU2XzGy7sq2gOOjUroXQ90yK7tTl5FowmKY0NAb ipS26W0FxxLLAsII4HeAWr4RRjdQi2DLx6YF5tgmc4PJxjBTVzOciMIaNkPdRrl147/nnPye POe8b44QC/YKwoTZWiNj0Co1lCAA7xmMjIp2ngCquJP2QHSrrkeAWj5Uo/qhUT6y9NQCNLc4 iqOPPTUEqpy+jaGB+90EMpcv8pH91xt8NNZrFaBrdVcFqPrbz3ioyFuEo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lK5PCVr+8 Uba8/3yxQP2UkwTUC9p1bzr6vhi1iflry99eszbZZ+k23pHOTs2f3vn5g+Oc85Nq67rd3qWF z/x7EpdFZf24uWHe/RwJoVTIpNE4p5T9BTLGqm11AwAA X-CMS-MailID: 20230302131016epcas5p3084bc8d556da7316c3ca50cba044a836 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230214121503epcas5p291dce2b37ec4cdabcfecbf8fbdfcca51 References: <20230214121333.1837-1-shradha.t@samsung.com> <20230214121333.1837-16-shradha.t@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230302_222502_043374_FCB70575 X-CRM114-Status: GOOD ( 28.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > -----Original Message----- > From: Krzysztof Kozlowski [mailto:krzysztof.kozlowski@linaro.org] > Sent: 16 February 2023 16:42 > To: Shradha Todi ; lpieralisi@kernel.org; > kw@linux.com; robh@kernel.org; bhelgaas@google.com; > krzysztof.kozlowski+dt@linaro.org; alim.akhtar@samsung.com; > jingoohan1@gmail.com; Sergey.Semin@baikalelectronics.ru; > lukas.bulwahn@gmail.com; hongxing.zhu@nxp.com; tglx@linutronix.de; > m.szyprowski@samsung.com; jh80.chung@samsung.co; > pankaj.dubey@samsung.com > Cc: linux-pci@vger.kernel.org; devicetree@vger.kernel.org; linux-arm- > kernel@lists.infradead.org; linux-samsung-soc@vger.kernel.org; linux- > kernel@vger.kernel.org > Subject: Re: [PATCH 15/16] PCI: samsung: Add structure to hold resource > operations > > On 14/02/2023 13:13, Shradha Todi wrote: > > Some resources might differ based on platforms and we > > Please wrap commit message according to Linux coding style / submission > process (neither too early nor over the limit): > https://protect2.fireeye.com/v1/url?k=66656d8a-07ee78a5-6664e6c5- > 74fe485cbfe7-a61191c61bcf38f7&q=1&e=80994c2d-d0ca-4b83-a7ca- > 5242c4bb701f&u=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Fv5.18- > rc4%2Fsource%2FDocumentation%2Fprocess%2Fsubmitting- > patches.rst%23L586 > > Wrapping looks a bit short... Ack > > > need platform specific functions to initialize or alter them. For > > better code reusibility, making a separate > > typo, I think it is: re-usability Ack > > > res_ops which will hold all such function pointers or other resource > > specific data. > > Are you saying that interrupts differ in different devices? > Yes, the interrupts are routed and integrated differently for the different platforms > > > > This patch includes adding function pointer for IRQ > > Do not use "This commit/patch". > https://protect2.fireeye.com/v1/url?k=ffdc2502-9e57302d-ffddae4d- > 74fe485cbfe7-49aeaacd1141660f&q=1&e=80994c2d-d0ca-4b83-a7ca- > 5242c4bb701f&u=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Fv5.17.1%2 > Fsource%2FDocumentation%2Fprocess%2Fsubmitting-patches.rst%23L95 > Ack > > initialization which will help to move common operations for host init > > into the probe sequence. > > > > Suggested-by: Pankaj Dubey > > Signed-off-by: Shradha Todi > > --- > > drivers/pci/controller/dwc/pci-samsung.c | 26 > > ++++++++++++++++-------- > > 1 file changed, 17 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pci-samsung.c > > b/drivers/pci/controller/dwc/pci-samsung.c > > index 47ca2a6a545d..01882f2d06c7 100644 > > --- a/drivers/pci/controller/dwc/pci-samsung.c > > +++ b/drivers/pci/controller/dwc/pci-samsung.c > > @@ -55,6 +55,7 @@ struct samsung_pcie_pdata { > > struct pci_ops *pci_ops; > > const struct dw_pcie_ops *dwc_ops; > > const struct dw_pcie_host_ops *host_ops; > > + const struct samsung_res_ops *res_ops; > > }; > > > > /* > > @@ -77,6 +78,10 @@ struct samsung_pcie { > > struct regulator_bulk_data supplies[2]; > > }; > > > > +struct samsung_res_ops { > > + int (*irq_init)(struct samsung_pcie *sp, struct platform_device > > +*pdev); }; > > + > > static int samsung_pcie_init_clk_resources(struct samsung_pcie *sp) > > { > > struct device *dev = sp->pci.dev; > > @@ -276,7 +281,7 @@ static const struct dw_pcie_host_ops > exynos_pcie_host_ops = { > > .host_init = exynos_pcie_host_init, > > }; > > > > -static int exynos_add_pcie_port(struct samsung_pcie *sp, > > +static int exynos_irq_init(struct samsung_pcie *sp, > > struct platform_device *pdev) { > > struct dw_pcie *pci = &sp->pci; > > @@ -295,15 +300,8 @@ static int exynos_add_pcie_port(struct > samsung_pcie *sp, > > return ret; > > } > > > > - pp->ops = &exynos_pcie_host_ops; > > pp->msi_irq[0] = -ENODEV; > > > > - ret = dw_pcie_host_init(pp); > > - if (ret) { > > - dev_err(dev, "failed to initialize host\n"); > > - return ret; > > - } > > - > > return 0; > > } > > > > @@ -314,6 +312,10 @@ static const struct dw_pcie_ops > exynos_dw_pcie_ops = { > > .start_link = exynos_pcie_start_link, }; > > > > +static const struct samsung_res_ops exynos_res_ops_data = { > > + .irq_init = exynos_irq_init, > > +}; > > + > > static int samsung_pcie_probe(struct platform_device *pdev) { > > struct device *dev = &pdev->dev; > > @@ -357,7 +359,12 @@ static int samsung_pcie_probe(struct > > platform_device *pdev) > > > > platform_set_drvdata(pdev, sp); > > > > - ret = exynos_add_pcie_port(sp, pdev); > > + if (pdata->res_ops->irq_init) > > + pdata->res_ops->irq_init(sp, pdev); > > Check return value and handle errors. > Ack > > + > > + sp->pci.pp.ops = pdata->host_ops; > > + > > + ret = dw_pcie_host_init(&sp->pci.pp); > > if (ret < 0) > > goto fail_probe; > > > > @@ -428,6 +435,7 @@ static const struct samsung_pcie_pdata > exynos_5433_pcie_rc_pdata = { > > .dwc_ops = &exynos_dw_pcie_ops, > > .pci_ops = &exynos_pci_ops, > > .host_ops = &exynos_pcie_host_ops, > > + .res_ops = &exynos_res_ops_data, > > }; > > > > static const struct of_device_id samsung_pcie_of_match[] = { > > Best regards, > Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel