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 5A6F9C3DA70 for ; Tue, 30 Jul 2024 16:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QtyNm11XvCD8/W1yH2YGAcKFdYxc9/J+Z+0y6mVs8ow=; b=oqIaBwujDRGEi0yz+WJ4htDK9r iBR9P5XanM9hOn1TeRJuej6tag43msxncHKvQYJUT9viCclFQB34NDKlBLdNc2yXSFJKuZ4lHnzXf d98MMNQ/mY3mRusMl7XNqEk9VnROMMSmCUfvcgOh0zFT7Jav2Rpdacf/DEzCDFGv3sGw9kdpUmnkM aNvGmtEMf0UPtQFgc2Br31Hf0S+iFHE5bS+2jznJwIDSXGujXf9bDIVQJBUMtLAWsdwbA/uN+Spof ku5GfWYN7TQv6i78+Q3CmF9PghKWgLBF2YIduKTGHUh1KqVIpEdcDE3rfMhlmOguzgxY2DKI+TPek kvS67Nlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYpX8-0000000ForU-3cPA; Tue, 30 Jul 2024 16:17:06 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYpWc-0000000Fogh-2qAX for linux-arm-kernel@lists.infradead.org; Tue, 30 Jul 2024 16:16:36 +0000 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46UFpu4P031714; Tue, 30 Jul 2024 16:16:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= QtyNm11XvCD8/W1yH2YGAcKFdYxc9/J+Z+0y6mVs8ow=; b=k5xYUVSMZ7DuCB8q DhzGz5jPFXf3E6U9/OpKwxFa58VvQ/q5tcXZAK8HIbD1lmgitNF6SWEaGxpiBnw9 F9S3NzSpr6dfqN88gVJ73Tb/xAr5flep7wEvDY7T/HIaZoQwWU1CgnHy6jePoc/E wurTY8p6nYO8Gt9tzARYeXec7OVIL6FTabNZCWe4pL7pYKMEeVSoa3dsT/LJVp/1 x1hIvlA+lNuwFELxhI69+jOYn4iw08KUIPYr1crGfR7afyvRrnbTfifxrArsD1pO iuur7bmasXRVjZ1br1+ySq8JsrBNjnug7aGslmMYIGlO8LeqFJh+0zshwAEXl9Bd 7efgEw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40pw441dut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jul 2024 16:16:07 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46UGG6fm019079 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jul 2024 16:16:06 GMT Received: from [10.110.56.150] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 30 Jul 2024 09:16:05 -0700 Message-ID: <22f4ecb4-f955-4401-befc-cb27b4fa4c59@quicinc.com> Date: Tue, 30 Jul 2024 09:16:05 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2 0/7] Add power domain and MSI functionality with PCIe host generic ECAM driver To: Manivannan Sadhasivam CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <1721067215-5832-1-git-send-email-quic_mrana@quicinc.com> <925d1eca-975f-4eec-bdf8-ca07a892361a@quicinc.com> <20240730053425.GB3122@thinkpad> Content-Language: en-US From: Mayank Rana In-Reply-To: <20240730053425.GB3122@thinkpad> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: I3RupqWLXtt-eDIMMr8AGmx975EvbPE_ X-Proofpoint-ORIG-GUID: I3RupqWLXtt-eDIMMr8AGmx975EvbPE_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-30_13,2024-07-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 priorityscore=1501 adultscore=0 mlxlogscore=962 clxscore=1015 impostorscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2407300111 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_091634_896813_DB02E581 X-CRM114-Status: GOOD ( 17.66 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/29/2024 10:34 PM, Manivannan Sadhasivam wrote: > On Mon, Jul 29, 2024 at 10:19:45AM -0700, Mayank Rana wrote: >> Hi Bjorn / Mani >> >> Gentle ping for your review/feedback on this series. >> Thank you. >> > > I was waiting for your reply for my comment [1]. Because that will have > influence on this series. > > - Mani > > [1] https://lore.kernel.org/linux-pci/20240724095407.GA2347@thinkpad/ ok. Thanks for above response, and suggesting that you are ok with either new ECAM driver or updating PCIE qcom driver with ECAM mode as well utilizing DWC specific functionality. I still believe having separate PCIe QCOM ecam driver would be more useful and allow decoupling dwc host specific code base. I am requesting above if you can review current MSI split functionality, and provide feedback on that. Regards, Mayank > >> Regards, >> Mayank >> >> On 7/15/2024 11:13 AM, Mayank Rana wrote: >>> Based on previously received feedback, this patch series adds functionalities >>> with existing PCIe host generic ECAM driver (pci-host-generic.c) to get PCIe >>> host root complex functionality on Qualcomm SA8775P auto platform. >>> >>> Previously sent RFC patchset to have separate Qualcomm PCIe ECAM platform driver: >>> https://lore.kernel.org/all/d10199df-5fb3-407b-b404-a0a4d067341f@quicinc.com/T/ >>> >>> 1. Interface to allow requesting firmware to manage system resources and performing >>> PCIe Link up (devicetree binding in terms of power domain and runtime PM APIs is used in driver) >>> 2. Performing D3 cold with system suspend and D0 with system resume (usage of GenPD >>> framework based power domain controls these operations) >>> 3. SA8775P is using Synopsys Designware PCIe controller which supports MSI controller. >>> This MSI functionality is used with PCIe host generic driver after splitting existing MSI >>> functionality from pcie-designware-host.c file into pcie-designware-msi.c file. >>> >>> Below architecture is used on Qualcomm SA8775P auto platform to get ECAM compliant PCIe >>> controller based functionality. Here firmware VM based PCIe driver takes care of resource >>> management and performing PCIe link related handling (D0 and D3cold). Linux VM based PCIe >>> host generic driver uses power domain to request firmware VM to perform these operations >>> using SCMI interface. >>> ---------------- >>> >>> >>> ┌────────────────────────┐ >>> │ │ >>> ┌──────────────────────┐ │ SHARED MEMORY │ ┌──────────────────────────┐ >>> │ Firmware VM │ │ │ │ Linux VM │ >>> │ ┌─────────┐ │ │ │ │ ┌────────────────┐ │ >>> │ │ Drivers │ ┌──────┐ │ │ │ │ │ PCIE host │ │ >>> │ │ PCIE PHY◄─┤ │ │ │ ┌────────────────┐ │ │ │ generic driver│ │ >>> │ │ │ │ SCMI │ │ │ │ │ │ │ │ │ │ >>> │ │PCIE CTL │ │ │ ├─────────┼───► PCIE ◄───┼─────┐ │ └──┬──────────▲──┘ │ >>> │ │ ├─►Server│ │ │ │ SHMEM │ │ │ │ │ │ │ >>> │ │Clk, Vreg│ │ │ │ │ │ │ │ │ │ ┌──▼──────────┴──┐ │ >>> │ │GPIO,GDSC│ └─▲──┬─┘ │ │ └────────────────┘ │ └──────┼────┤PCIE SCMI Inst │ │ >>> │ └─────────┘ │ │ │ │ │ │ └──▲──────────┬──┘ │ >>> │ │ │ │ │ │ │ │ │ │ >>> └───────────────┼──┼───┘ │ │ └───────┼──────────┼───────┘ >>> │ │ │ │ │ │ >>> │ │ └────────────────────────┘ │ │ >>> │ │ │ │ >>> │ │ │ │ >>> │ │ │ │ >>> │ │ │IRQ │HVC >>> IRQ │ │HVC │ │ >>> │ │ │ │ >>> │ │ │ │ >>> │ │ │ │ >>> ┌─────────────────┴──▼───────────────────────────────────────────────────────────┴──────────▼──────────────┐ >>> │ │ >>> │ │ >>> │ HYPERVISOR │ >>> │ │ >>> │ │ >>> │ │ >>> └──────────────────────────────────────────────────────────────────────────────────────────────────────────┘ >>> ┌─────────────┐ ┌─────────────┐ ┌──────────┐ ┌───────────┐ ┌─────────────┐ ┌────────────┐ >>> │ │ │ │ │ │ │ │ │ PCIE │ │ PCIE │ >>> │ CLOCK │ │ REGULATOR │ │ GPIO │ │ GDSC │ │ PHY │ │ controller │ >>> └─────────────┘ └─────────────┘ └──────────┘ └───────────┘ └─────────────┘ └────────────┘ >>> ---------- >>> Changes in V2: >>> - Drop new PCIe Qcom ECAM driver, and use existing PCIe designware based MSI functionality >>> - Add power domain based functionality within existing ECAM driver >>> >>> Tested: >>> - Validated NVME functionality with PCIe0 and PCIe1 on SA8775P-RIDE platform >>> >>> Mayank Rana (7): >>> PCI: dwc: Move MSI related code to separate file >>> PCI: dwc: Add msi_ops to allow DBI based MSI register access >>> PCI: dwc: Add pcie-designware-msi driver kconfig option >>> dt-bindings: PCI: host-generic-pci: Add power-domains binding >>> PCI: host-generic: Add power domain based handling for PCIe controller >>> dt-bindings: PCI: host-generic-pci: Add snps,dw-pcie-ecam-msi binding >>> PCI: host-generic: Add dwc MSI based MSI functionality >>> >>> .../devicetree/bindings/pci/host-generic-pci.yaml | 64 +++ >>> drivers/pci/controller/dwc/Kconfig | 8 + >>> drivers/pci/controller/dwc/Makefile | 1 + >>> drivers/pci/controller/dwc/pci-keystone.c | 12 +- >>> drivers/pci/controller/dwc/pcie-designware-host.c | 438 ++------------------- >>> drivers/pci/controller/dwc/pcie-designware-msi.c | 413 +++++++++++++++++++ >>> drivers/pci/controller/dwc/pcie-designware-msi.h | 63 +++ >>> drivers/pci/controller/dwc/pcie-designware.c | 1 + >>> drivers/pci/controller/dwc/pcie-designware.h | 26 +- >>> drivers/pci/controller/dwc/pcie-rcar-gen4.c | 1 + >>> drivers/pci/controller/dwc/pcie-tegra194.c | 5 +- >>> drivers/pci/controller/pci-host-generic.c | 127 +++++- >>> 12 files changed, 723 insertions(+), 436 deletions(-) >>> create mode 100644 drivers/pci/controller/dwc/pcie-designware-msi.c >>> create mode 100644 drivers/pci/controller/dwc/pcie-designware-msi.h >>> >