Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp68023lqp; Tue, 11 Jun 2024 15:06:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUup1RpZB9wxzAJLZk2oD8BycSamL9KBsEY964Jx3/znVef4ub7QU++BstXmYJ06VCWZ4Ub/z3NxQFkkU149dhajeBeiFNoCAgpOmpRBA== X-Google-Smtp-Source: AGHT+IEnbDelljX+kUVvQFz1qqxQP4RTJjgE5RUR7Wbmn2BUKPa50FubReEwGvBrs8WKVfXUykm7 X-Received: by 2002:ac8:570b:0:b0:441:1354:6426 with SMTP id d75a77b69052e-44113546695mr64649851cf.47.1718143616829; Tue, 11 Jun 2024 15:06:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718143616; cv=pass; d=google.com; s=arc-20160816; b=zbMygVHmY96Gu99qhs3vU4VWs7Bqec7qO0KGRkPe8HNZn5XAX4cpKKODQFbmH5d+nx LcAFCwQ1nh5IHZ1sUlSUx/BGEtTbFNv1YicIdC8vrcrfsAkoMXLTBPS+72l2kUIlwkWM kx+YSrTtTBUnDOhUU6W1HXtYeNcc34ZDiFDuzfgAH3dnRW42ZuaBojD8hNlpcjtClTcS iONdt+HQCPfi7C5EUZ1LCFRB/SmIdPgFCPbmOS4GtSZxFTvs1Eoxm4sszA/dgcCSvd3m f6wVdIsPnuCxlEoqLQuzaO0F91un0NwyUNhOoFpnYC7A3oehH6m+lRl2qA27g80u2h2s SnvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=JS3T0DXloODERqpbCT6vP+SjH4BO3U7pL/aqWk7yM2M=; fh=3t8hA6cznvDqQe+n8CZRPia1QhQ6dJA7jX9awcpmRV8=; b=RWMfQXX25LrXLnPZq32BYN+eXos8prZeieO5T7DaE8rSkILm2SA2FiIp3xRZHOeKFB PQCSWaAoiG/t5HpH2zrqsXXAIilKJPsiwnWqk7u2L6SxMcy0FSe7hiqMbjBh9bt9zTlJ DKUylJp2O6sDEw2tFmijDJW+AnahVEJSjw1bzWj7TNbmrDDH+oNlVrHGvi4vV1ItRvI1 EBHK2dH5dn0FbaDPE5uw8Ii+9aveejp9mOm6UmRa9AVAawWO/kkluKzB6dvPU1Jz/L98 S+qcyt+L62aUxkGf8dr7/PTYUyK0Nyld27COOphYz8wqKSdsXg7oCFa01exWf0th1MWd RVcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="a/NzRHHA"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-44063b1a5dcsi78100101cf.562.2024.06.11.15.06.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 15:06:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="a/NzRHHA"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8A3641C234BB for ; Tue, 11 Jun 2024 22:06:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 320AF155313; Tue, 11 Jun 2024 22:06:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="a/NzRHHA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34A4E3A8E4; Tue, 11 Jun 2024 22:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718143605; cv=none; b=dZ2H7wVx+7FMTggyFkL9Zpj4tWo2gy1Njvxi2Bwa4F77MjWCOVjNqtpGgT4PFhEff+7QzO0gemdqk7zKuH+4ObT+p+XWFiZjz7Lqx8yZNFzZZCRYByHN2hN0tOljyBGyM3nXe8W2QmLY3P0wxkZdopXisLZWBnbGqSQy21xBUtk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718143605; c=relaxed/simple; bh=2z2T09bcbzfwexUZ5T7jD1TkbLjspNsoiYHpZ3OkpCI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=S3oQDUOGk9ZUWoUr6usYvNZjGQtGPO6sNTAj+Xg+jFLvMuzH6aXbihOC4v6Y+usGqpSbnLhYQv6s666tSpPXHa2dRrL6crJOu4M0CFgHbcOyKFnsh2KJj1URau+wzmv5Zweg4XoBnug4aF5r96qXPetcw4egG77mjcBDX7TPRpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a/NzRHHA; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> 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