Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1526693lqz; Mon, 1 Apr 2024 08:51:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXttjo4N1rDlsBFqaFYXD2UFgGBWG6W6aNgN938mAO+tFwA360iiaI9l9cyRkQjNG13VRbb/74YTrHgXpW7KJvkaBfnlNc4sL95obOZCg== X-Google-Smtp-Source: AGHT+IELPIEkX9pItM58njNLWkLbN4muj5up1LGkqJuh/OfBrIdQPknkH2gb2Zwu+GLNnn2GBD8X X-Received: by 2002:ac2:51a5:0:b0:515:c615:ce23 with SMTP id f5-20020ac251a5000000b00515c615ce23mr7369902lfk.22.1711986673249; Mon, 01 Apr 2024 08:51:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711986673; cv=pass; d=google.com; s=arc-20160816; b=pmMVpKJCg1POx6fHThGsYbesirBOAmPc4vHMVF3y2jFJzc6kBs2G8JqTutfIU6cdhe VqCS/RUyEIA68CdC6dc+vqZUgOh1x7OoCf7Vk+58oGuAkaRzGrR1swHPcesDCilYyqSI ZlOtfhajtIifvPgH/pUFZiXSlrrApRBwHM9f071d9L2K2dG4GrWCx2iorf3bhgh0leWy 1bqNkn1nFUHyw6KFihB9T8xVZ62ip7FxugHGzfwFZhZUOvdDmYLxk+tDVCwHY1FA1rEH /+qKZTn2j5lL9Qrw9qLj56Y8si5FVsa+DmD3y7MzHUyeEuQ0svcmh3h19SNKarsUiteW 12qA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=rKFY3ONj6P8dLgleToMrlio096mf81VdCaDAeiGZl+g=; fh=WCuI0+w39ydZ7Wz+VVTBSIIKNLUBgTEElTEyrTjRwAE=; b=T0vqBn/B6ZJN6C2MUa0zbGRwFhW/0vpnPrt98KKYOTdv0Irhp8RAjH22FBw6MVuQ2u GV1s/bA/Kl1YnDoLNMg65znWvtPkmKBbHFKtcjhlFeO+HNRClc7DDi6VO7ebP10rbJ+w uomVOfnUaBM7T9U0qzZu2TigutXF6dto+kZhYHtH5FKMnKKfPR1RauRkOZiFoJOjCQ01 UfTKZvrYYbw8FoiQZaDCA/dkmksbXC33AaJ2J4jYlAuqkev22XVArHThIQUaoSUvzjcF v3tQ3zKMoDKuHazG9+j23S3HlnjkLlaMsDMwguJ3nrbBpibIQEO77n2tRDIyWgNnlSSQ hhaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p8easuU4; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-126824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u17-20020a50a411000000b0056bf6434ed3si4616765edb.526.2024.04.01.08.51.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 08:51:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-126824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p8easuU4; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-126824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8EC2C1F22E41 for ; Mon, 1 Apr 2024 15:51:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5EE1D46551; Mon, 1 Apr 2024 15:50:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="p8easuU4" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE28047F64 for ; Mon, 1 Apr 2024 15:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711986653; cv=none; b=UfCUVCqlo704SDrkxO7GnwEQzYICE4Aw73O5t6Lw7JKwofoMkUR/kEn1B68zQRcjDUQ9wYGFvfKVUw7ZPWY9fAMLF8T3XpBl5RS5GXin5p5ncj5HA2BbPu+jpVcRoBsf/1MHFIv2c7hk9IeaK9ZR9UHhRZgnkA/4kau9faLsl/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711986653; c=relaxed/simple; bh=hRAyyHM9jBq8z5BMXGzXE9hXwapt0pAaABlLaIcw+Rc=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=sqR7KwmnlhzyfkM0k6TqMgY46zcjHPiacNVG1Lp7pd6L0ZqqMOs6cCou1bd+glae8+NV24uPJzdVQVCAMQ5j+MowjmqyW5kbrDzUa1hzsMESA/+umqgN3cjlA6W5vefNCohl4U6c3f1eRpLegAIOspo6ZS2Bi1VJgsHJ2aVyKeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=p8easuU4; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1e00d1e13a2so26914455ad.0 for ; Mon, 01 Apr 2024 08:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711986651; x=1712591451; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=rKFY3ONj6P8dLgleToMrlio096mf81VdCaDAeiGZl+g=; b=p8easuU4hh7CnuhZBT0gfYkYLFyWLfaMlA1xG5KBM9xxEICVOYcDSHpFgXXtyS7q8b x+sU8nZWMAvnE4Qt52juwPCO4x1HyCnjmnNFM/Qb2kxbWKrkIUQMXWVR2L0OLO+or5t8 zTXgveEbQYdG6/msTrxKqhBGOYucsAlipIAQ7kWGY7gfyMVPNnrbQ943ytjlL9QuPq8v 2McH0dAfcJ2lLSarGbQpxtrFdOQqAaejm0sbbHf00izfsq/K7yL8K/06JVmcF09aFCbN KFoA8TA7Aqy866I9Qo69S5ydkWyyi/c8+tUQTlkGcILmrVkp7KlsyCBWZfI5GSbK9Fhu FfDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711986651; x=1712591451; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rKFY3ONj6P8dLgleToMrlio096mf81VdCaDAeiGZl+g=; b=uwO+hdcanYHtiN6F82OSWDq0l982mtfOeiUc7D8YC3PJhUEuHsk5+7zurXUaGvXSAt pRFtTpb04yiGftGbqwQeAlC+WJ1eGK9bbhCNDTCtx4nYdmWoUgreBeMvTSg9NxpgiCYJ 5xkXLLTVQik2juKb3ZqpZ1gAgBjl3Gg8br30fbxQ0klsrwtdz5KsBUKzhMTO60t5ssAc aiLjqk9vPTXmZwVtCTKmd5OO8mN7BDNF0rlhjemO2Jo4MHhEtaXpsX4s5fFxHYhEuli7 ye8A65Z/ZwZKUHI52sYTvNic4bxGrnSRL/nvVy9wVFy0b5C1H+GOY93i+gdmKuC41Ykw VLAA== X-Forwarded-Encrypted: i=1; AJvYcCXT+gddBUO2s7jmaagBRdOkWLDe8PiKUWt8QcEMMrL7kEB//qCkIhrrbM/QAHqsktYtn6nMRmvT/xO43gIEEbygqnhifqlLrvHYYzb/ X-Gm-Message-State: AOJu0YzKZ8IskUkrF9uXJ9M+5y0R2xht2Q6/Zdgm2suQ+6U70xIWHhGi LIMQFQcT4o5GH59VCPx1vem2KCbacI2ANA1yR7dv46u/VwcvTGe+NTvSzE9bUA== X-Received: by 2002:a17:902:7847:b0:1e0:e650:5bd with SMTP id e7-20020a170902784700b001e0e65005bdmr8261630pln.45.1711986650660; Mon, 01 Apr 2024 08:50:50 -0700 (PDT) Received: from [127.0.1.1] ([103.28.246.102]) by smtp.gmail.com with ESMTPSA id kh6-20020a170903064600b001e21957fecdsm8949076plb.246.2024.04.01.08.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 08:50:50 -0700 (PDT) From: Manivannan Sadhasivam Subject: [PATCH v2 00/10] PCI: endpoint: Make host reboot handling more robust Date: Mon, 01 Apr 2024 21:20:26 +0530 Message-Id: <20240401-pci-epf-rework-v2-0-970dbe90b99d@linaro.org> 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="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAMLXCmYC/3XMQQ6CMBCF4auQWTumA7UGV9zDsKgwwERDm6lBD eHuVvYu/5e8b4XEKpzgUqygvEiSMOcoDwV0k59HRulzQ2lKayqyGDtBjgMqv4Le0Tt2pxuZyp9 ryKeoPMh7B69t7knSM+hn9xf6rX+phdCgo8qy66i3NTUPmb2GY9AR2m3bvrkeMDWtAAAA To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Kishon Vijay Abraham I , Thierry Reding , Jonathan Hunter , Jingoo Han Cc: linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, mhi@lists.linux.dev, linux-tegra@vger.kernel.org, Niklas Cassel , Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2712; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=hRAyyHM9jBq8z5BMXGzXE9hXwapt0pAaABlLaIcw+Rc=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBmCtfTf7aNZNHSAcCrTEEK8X7g1dcGqfxMorvtY CkRgMCnuOiJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZgrX0wAKCRBVnxHm/pHO 9TbyB/4sZtMS4Y03NcUAGDf0XzMHg3hBKVNV3iuprXrozKDhO2hHn2E062aAslNK9JnpNRwscjf qnkGAt8bvR+f5dGh4F68jvBss3gYG/3IeDqzv/uqJGruc3MznxErSQHjYrKGlfpN/d4iijGITZ8 S7cBkXp2IlzF3MBZQQ/BwgasmNSdJx2naEOFydF6kz28QJJpADObCIL6bK7fvv/wXsWZqmS3Rs0 BstYijy0Q64WSSC7WGSD472hBbZCNK6A0iSvKMpYwFIlEoPTv4I6eott7cVLq9g+biR2r+VWv5o T4UKMmAWoY9e4VZgw3zf87CqqfYf2tW98xv1LTeqaZM/Zfn6 X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 Hello, This is the follow up series of [1], to improve the handling of host reboot in the endpoint subsystem. This involves refining the PERST# and Link Down event handling in both the controller and function drivers. Testing ======= This series is tested on Qcom SM8450 based development board with both MHI_EPF and EPF_TEST function drivers. Dependency ========== This series depends on [1] and [2]. - Mani [1] https://lore.kernel.org/linux-pci/20240314-pci-dbi-rework-v10-0-14a45c5a938e@linaro.org/ [2] https://lore.kernel.org/linux-pci/20240320113157.322695-1-cassel@kernel.org/ Signed-off-by: Manivannan Sadhasivam --- Changes in v2: - Dropped the {start/stop}_link rework patches - Incorporated comments from Niklas - Collected review tags - Rebased on top of v6.9-rc1 and https://lore.kernel.org/linux-pci/20240320113157.322695-1-cassel@kernel.org/ - Link to v1: https://lore.kernel.org/r/20240314-pci-epf-rework-v1-0-6134e6c1d491@linaro.org --- Manivannan Sadhasivam (10): PCI: qcom-ep: Disable resources unconditionally during PERST# assert PCI: endpoint: Decouple EPC and PCIe bus specific events PCI: endpoint: Rename core_init() callback in 'struct pci_epc_event_ops' to init() PCI: epf-test: Refactor pci_epf_test_unbind() function PCI: epf-{mhi/test}: Move DMA initialization to EPC init callback PCI: endpoint: Introduce EPC 'deinit' event and notify the EPF drivers PCI: dwc: ep: Add a generic dw_pcie_ep_linkdown() API to handle Link Down event PCI: qcom-ep: Use the generic dw_pcie_ep_linkdown() API to handle Link Down event PCI: epf-test: Handle Link Down event PCI: qcom: Implement shutdown() callback to properly reset the endpoint devices drivers/pci/controller/dwc/pcie-designware-ep.c | 99 ++++++++++++++--------- drivers/pci/controller/dwc/pcie-designware.h | 5 ++ drivers/pci/controller/dwc/pcie-qcom-ep.c | 9 +-- drivers/pci/controller/dwc/pcie-qcom.c | 8 ++ drivers/pci/controller/dwc/pcie-tegra194.c | 1 + drivers/pci/endpoint/functions/pci-epf-mhi.c | 47 ++++++++--- drivers/pci/endpoint/functions/pci-epf-test.c | 103 +++++++++++++++++------- drivers/pci/endpoint/pci-epc-core.c | 53 ++++++++---- include/linux/pci-epc.h | 1 + include/linux/pci-epf.h | 27 +++++-- 10 files changed, 248 insertions(+), 105 deletions(-) --- base-commit: e6377605ca734126533a0f8e4de2b4bac881f076 change-id: 20240314-pci-epf-rework-a6e65b103a79 Best regards, -- Manivannan Sadhasivam