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 7D290C27C65 for ; Tue, 11 Jun 2024 22:07:01 +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:In-Reply-To:Content-Type: MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=JS3T0DXloODERqpbCT6vP+SjH4BO3U7pL/aqWk7yM2M=; b=hQdDp/Kqlvyqwh /FcqnvHVchXC73KV3y4ff8e4g9O2Bk74ObHQIcbNJTVkB+iOC22jRtw4kOegRR6MI7PB6VtaUBNtg O9xq9JnnTH0/Xtj4gjJIn6qr6pR7sHV+PVXkRsjR67XDqLD/RnMF6ko8YxhbsrF0kJQjvzDb/MzzT DyGElkLLFVppsz43xBMjpJDmbgs5M13SG/wyQgkZ2PdQyaKGMQ9O8Q1traZMUoJY2KqCEDM7fFdR2 IhTdiVkJg5Ut5jL4IdgLBEphD/xibT3JKZeFVoUGytP1GXLFaNYfEwOWzb9e6ngtKGtIHILNVF6KB lEmAWvpW/yLJPguRkDOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sH9dg-0000000AMhw-43q1; Tue, 11 Jun 2024 22:06:48 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sH9dd-0000000AMhQ-3yFX for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2024 22:06:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id F10EE60E88; Tue, 11 Jun 2024 22:06:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDC81C2BD10; Tue, 11 Jun 2024 22:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718143604; bh=2z2T09bcbzfwexUZ5T7jD1TkbLjspNsoiYHpZ3OkpCI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=a/NzRHHA81Kr/n5nwF8wLMmpSxDwQFBG1tf3wJl/ZX5qrZu3LoF/n38c1RQWAS3to 9PF0iBa1/cYKwSVYTUUEyS/nclJFBX6lIO5eO0x1Az0PTI0ZwlAsdX/khbFtfebn6E YXiFVo4lds+SLiDkmm+nUPE/ZqefCzy2l8jaKYjZeHRpo24owJwxwC2tQwf1lgcI1s jSWMaN02nOnAzTwxwp8JNo1/Rsd/DRVvo/SgDh50CtfMf0VE9bi5/DnHDINTWd02UU HtDL2EuqVAPEfbwNIt35YzWTA4zlII6G6PiSRavH22Rynv/chO+GKlSJqnxKZZ2/Mp +OmyobALds0Jg== Date: Tue, 11 Jun 2024 17:06:40 -0500 From: Bjorn Helgaas To: Manivannan Sadhasivam Cc: Vignesh Raghavendra , Siddharth Vadapalli , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Minghuan Lian , Mingkai Hu , Roy Zang , Jesper Nilsson , Jingoo Han , Srikanth Thokala , Marek Vasut , Yoshihiro Shimoda , Thierry Reding , Jonathan Hunter , Kunihiko Hayashi , Masami Hiramatsu , Kishon Vijay Abraham I , linux-omap@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@axis.com, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org, mhi@lists.linux.dev, Niklas Cassel Subject: Re: [PATCH 2/5] PCI: endpoint: Introduce 'epc_deinit' event and notify the EPF drivers Message-ID: <20240611220640.GA1001976@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240606-pci-deinit-v1-2-4395534520dc@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240611_150646_060510_28CF8161 X-CRM114-Status: GOOD ( 13.60 ) 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 Thu, Jun 06, 2024 at 12:56:35PM +0530, Manivannan Sadhasivam wrote: > As like the 'epc_init' event, that is used to signal the EPF drivers about > the EPC initialization, let's introduce 'epc_deinit' event that is used to > signal EPC deinitialization. > > The EPC deinitialization applies only when any sort of fundamental reset > is supported by the endpoint controller as per the PCIe spec. > > Reference: PCIe Base spec v5.0, sections 4.2.4.9.1 and 6.6.1. PCIe r6.0, sec 4.2.5.9.1 and 6.6.1. (Not 4.2.4.9.1, which no longer exists in r6.x) > Currently, some EPC drivers like pcie-qcom-ep and pcie-tegra194 support > PERST# as the fundamental reset. So the 'deinit' event will be notified to > the EPF drivers when PERST# assert happens in the above mentioned EPC > drivers. > > The EPF drivers, on receiving the event through the epc_deinit() callback > should reset the EPF state machine and also cleanup any configuration that > got affected by the fundamental reset like BAR, DMA etc... > > This change also warrants skipping the cleanups in unbind() if already done > in epc_deinit(). > > Reviewed-by: Niklas Cassel > Signed-off-by: Manivannan Sadhasivam