From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796550049; b=OQAwWFmAH/JkQCSp3rGkU2qUXg7psrKmwDC/Exn2lk/QmNgX2lAvlMQ/kORYxZSCOMk5 92ee1vHCT4CzSAaCHSTj62ct11adryiDlvyvygxYvIdDw+w69Vv2sGsqsNzCzKEDjiNgW 5Ma5qXe8/Qpcj7BdQCRrj2vCsPSR2PxYu5B4NPhOlmJo6anS3O5VmQUJZCEsGwV3bPPn2 cZ241Vo8BCW59YPN9kdwWm9Z9VnjxlnD/hfGql/NLEmyFzuZeAQX9eoxY/oTU3vMADAb4 GRhoG8jhCjMjJ3CDpsNot91cD3a5FXtfrTBjeTa4SEI4KwRv8IedpjcBmwgJ9AuU8PA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796550049; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=/f7vSdwpAY3Dc7BQvvBAiy920CJk9OUgcisOcx1fb5c=; b=ob9SULVydF3m8M/yRcl0AE30tAxguWrd7ksV8zYNY5u//DTHRhCvOiYQpXAOaF9eA4ET yjtgH9uH6j3p4gARvzsNjVDD6dr5FjCzUzVrrbuh8G6HviuBxEIr0ZZdPJMSlBWQCcyTF XlkQgPwfP7HQSNlevbCG4xqHDlm0G2IUQr3diG/ikoCU7TiCKMpmvIpUph5o0JAORcdpv wZNiFjDvnApKOmIuW3BO7MHB/x6sl9vRTxnfJ+jfaApMdev9tyHiOiYCNHywLMpEsfPAN 2c2KmGKxugZKC/tBKVjEeIx4r/WlLlRtjtiR7qRWUMnL8UqJ4hwgYP5VfuiELqRcFRQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ZzHEInnr; arc=none smtp.remote-ip=209.85.216.49 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D05E2606A330 for ; Sun, 6 Dec 2026 09:40:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D05E2606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ZzHEInnr Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-3b405d8f1cfso1285527a91.3 for ; Sun, 06 Dec 2026 01:40:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796550048; x=1797154848; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=/f7vSdwpAY3Dc7BQvvBAiy920CJk9OUgcisOcx1fb5c=; b=ZzHEInnrFbMoNb4xstlKWmABML6pIXbPZLpk1xrV5BJE3V5fBY14tI25XiD+Y6WzjW gL3P0N8G7BwBUH8/66GOcuZ9SH/5UXme67pUvn6I98fHCRJsHwGawpQnqHPDSlWS/2H3 2TmpJiSte6NqeglfhkWJose5Xr3qSRsRcGt7WK3gjjwGdeR36Zqp0EEMSWrYK2F3e8RS l4MQCimcuWs580rSsRUPVvojGUJnN4hReG6P5td8m3f3xgK7S5O6vpAHkcc0I4yS9Dxk TLw4e4x0Kegt1879EHJnMAu3dU2bkbBLWECuA6rdaEfjkHjZUm77kfbMmQL5xelPTtXi OaDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796550048; x=1797154848; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/f7vSdwpAY3Dc7BQvvBAiy920CJk9OUgcisOcx1fb5c=; b=yhO2afc7qT8prH7eim6dmt6DDC7+Oyt+q8+Q+7uWgfKV8079H+moRbqfZpSDBWPurF 305fUz6uMcspAbYV3yXMf2SRxwbq7c9aKaTEsP93sWu/jLumLDKcCBmK1lnlQy+eUpZa BrXijduskyfgJOTo0vjPmpLCav7/CgdRIStixE5JlXS0kBcYxExHWe50ZPkikPHJFpt/ ONYwopo3QvrYqvE5xTx9Wi71DMPinDtnZEkAVxyw1GvgLqbEjkEgtyFHknKCMC2cdejj K6bfqsfYoRnX5dVCWkpws+r6aeYDDXNLLl4dvCq0oy0olsU5XrIJWz3rAXN+EAo1bzZl +BVg== X-Forwarded-Encrypted: i=1; AL+hErGV1oTnSp/shTwfmPUaf8gaYCbP+2xl1TCWxc37nHOlzbD0IIYgR4EYdJdbLPs/4k6B/wbcrKOGP3E=@vger.kernel.org X-Gm-Message-State: AB4q+uHSwCV19uC53y7G2E8TD+mhHk6EActiXnoYIilj0Qx+T6Z2Gmur meInX5ZoFfqbQXWpdNTTz1IGVsGH2vHSh48JdyaEjHPoSlTAUqNlE0Zh X-Gm-Gg: AZFdTZdcnItDNu3TF6X77QyX22DFvgYD9hGFdwt6VE91ltz3en4vJwr0Fc4zvHGJKhE v9x2LQz9pmti4vyTCZY29WmKL94M50v4UfK2gWVl+2y3C226erpxOpCL3vxIqe1c3pgIFggJga3 m+SnffCd14HHx/RSZBmtUuTckOpaPPDVOhNaj9eVUdJVsDFYM4aBM4L0DwqhdvO0l9XZOryhMvt gg3Q3fgUxrpM/E0ML3YCB/FR82l+4p9eD4lT4YndQvxJ3f/pqG5ayMWPu2MoPrje+Sm8TzZxjgU CbzqoIIbpDClPBwEKKc6HBYsZxofmkY4FKE3BmXeJecw9x/4jwb2nbFWL5Js1mMZlsP+wgp5sxM PnErCRU6G3e8r3s8AG66FuCRhS9kjgyCwxkKsuwaDF3UIIapGncRO56alECqlmRfLOTmFFWAEju di3Ph67NHqLWNcGsfwDvnCdSjvtAHjfDWlFreqgFcB9OslGX0lnF1vpAKlgCM61g8ceR0P1ZP6e fnUQsOJ6p1KngPidi8gtAPGeCTLcz8q6QdfTaIWMoTm8AobzsE7I8PeJR9uBMwrQ19ATRuZT6v+ z5ImDlYfCwHZ6YfZS1bzvbNolbDZT8gRJtjUJOy+rKSov6+uQELv8WxeUsDKITzszIrM25Xhwzq pLCOU7cuKU65jx8w8EwWjK3k5DuKAHYWm/t4I9MFCE49oader7L/uosk3n1DDHNFPRZPhIF7zKI 2wTw== X-Received: by 2002:a17:90b:1c12:b0:3b5:b11d:c9fe with SMTP id 98e67ed59e1d1-3b5e06f9b01mr6850920a91.65.1796550048016; Sun, 06 Dec 2026 01:40:48 -0800 (PST) Received: from ryzen.lan ([2601:644:8000:37f::e34]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d10d06sm18102513a91.3.2026.12.06.01.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2026 01:40:46 -0800 (PST) From: Rosen Penev To: Thomas Petazzoni , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Frank Li Cc: Rob Herring , Manivannan Sadhasivam , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 0/3] PCI: mvebu: Reset Root Ports with PERST# Date: Sun, 6 Dec 2026 01:40:30 -0800 Message-ID: <20261206094043.971494-1-rosenp@gmail.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Some devices don't reset fully on the in-band hot reset that a bus reset of a Root Port triggers: the Marvell 88W8864 and 88W8964 Wi-Fi chips only return to their boot ROM on PERST# or power-on, so once their firmware has run the driver can't be bound to them again until the board is rebooted. Patch 3 implements reset_root_port() in pci-mvebu to pulse PERST# on ports that have a reset GPIO, and keeps the hot reset on the others. Patch 1 fixes the core side: pcibios_reset_secondary_bus() restores the Root Port's config space after reset_root_port() without saving it first, so it restores the state saved at enumeration, with memory decoding and bus mastering off. Patch 2 exports pci_reset_secondary_bus() for pci-mvebu's fallback, as the driver can be a module. Patches 1 and 3 were sent separately as v1. They are a series now because patch 3 depends on patch 1. Tested on a Linksys WRT3200ACM (two 88W8964 radios): unbinding and binding mwlwifi again reloads the firmware of either radio. That test was on v1; the changes since are compile-tested only (arm, mvebu_v7_defconfig with PCI_MVEBU=m, W=1). Changes in v2: - Patch 1: don't save the Root Port's state again after a failed reset_root_port(), so a retry restores the state from before the failure instead of reset defaults, and doesn't read the config space of a controller left with its clocks off (review). - New patch 2: export pci_reset_secondary_bus(), which pci-mvebu calls and which broke the PCI_MVEBU=m build (review). - Patch 3: explain the state save/restore in the commit message. - v1 of patch 1: https://lore.kernel.org/linux-pci/20261204060150.1239223-1-rosenp@gmail.com/ - v1 of patch 3: https://lore.kernel.org/linux-pci/20261204060752.1243189-1-rosenp@gmail.com/ Rosen Penev (3): PCI: Save Root Port state before resetting it with reset_root_port() PCI: Export pci_reset_secondary_bus() PCI: mvebu: Reset Root Ports with PERST# drivers/pci/controller/pci-mvebu.c | 56 ++++++++++++++++++++++++++---- drivers/pci/pci.c | 17 +++++++-- drivers/pci/pci.h | 1 + 3 files changed, 66 insertions(+), 8 deletions(-) base-commit: 29beb21c21ada7207692b2d69fc58dcd15dab6e9 -- 2.56.1