From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3B22606A332 for ; Sat, 7 Nov 2026 16:50:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=z/n29h2H DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:References:In-Reply-To: Cc:To:From:Subject:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=RA4zkysn4VSBQIv98er1ip5TUxruKgiYBt6ft8NyquY=; b=z/n29h2HRLCOYZX/d9NF52uOj6 ObR7S+ZKFBmMES1ZFi4AuNkXe7UTqlfA55nQKJx8MzHfpRVFWsJa28gM1VHZpFBUVwFvLjy+z8DN/ PZfszuT8wWrkMamRuumXqIfbGn+zOtFcppT0scWHV+pS7jSaiL6eVi2SbCXtb+PHIN4yl2hxSNnLd 1KzavcmfNEawUOBvWPFdXGEg5/wO/jtUDzyzk5XLLFidd0+Xe11YNu3rE7Kth4OQliWzSwrWKeXj6 HyylICZh2wZGvK45sslUwiqw90WFLJggjBhib8YzyasrIuMcx9s7J41Zhb1AT8ScBB7tcgOObZIj+ CuCzcirw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xPjcq-0000000F2eA-2zUm; Sat, 07 Nov 2026 16:50:44 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xPjco-0000000F2dn-3dDi; Sat, 07 Nov 2026 16:50:43 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 8FB396138A; Sat, 7 Nov 2026 16:50:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CEE31F008A1; Sat, 7 Nov 2026 16:50:39 +0000 (UTC) X-Archived-By: MIME-Version: 1.0 Subject: Re: [PATCH v2 2/3] PCI: Configure Root Port MPS after scanning its hierarchy From: Manivannan Sadhasivam To: Niklas Cassel Cc: Bjorn Helgaas , Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Heiko Stuebner , Yue Wang , Hans Zhang <18255117159@163.com>, Keith Busch , mx2pg@pm.me, Lukas Wunner , Frank Li , Mahesh Vaidya , Ricardo Pardini , Shawn Lin , =?utf-8?q?Pali_Roh=C3=A1r?= , Neil Armstrong , Rob Herring , Jingoo Han , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Myron Stowe , Jon Mason , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-rockchip@lists.infradead.org In-Reply-To: <20261020122854.1500883-7-cassel@kernel.org> References: <20261020122854.1500883-5-cassel@kernel.org> <20261020122854.1500883-7-cassel@kernel.org> Date: Sat, 07 Nov 2026 22:20:38 +0530 Message-Id: <179407023831.65886.4898449607413795226.b4-reply@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2497; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=5LFctG0eiAz5gLJy+LkdgxdcQaH2WjiLxcMmdDJcNCo=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBq71bfk94n2KqPyxyjK3MxV0IdJr8qZsarNEVt8 IzRU0v0pV+JATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCau9W3wAKCRBVnxHm/pHO 9c8aCAChrzgEZVOZTm7ZdM+eYCmMceH2bCAIyzgIESMvYJdeHG2yqrmibfQqM5ZbaaRMGszjOXt +tCbtQLST72VVN5Brm7tfnMtAb7S0fws+9Xmf/72hBxC+uWQpIppyoA/sut+c++FRGvDltZkn/i zxHU2JzUikv8laW9muroU/YbV1xMWfkPiRbnNXMOD/mikdu4ttQw19CjNO/FNN4lR5U6hoRVAbc jf5yDayX+6FJ0RdKE0vofG+Th0UzqLOMI3lYHfvwGM9U1D+x8Lt1tFXppPrB+ArVxzs1iOLZwj9 twETqh7xYX1ZJuNxMr7RWBKCAsIo8Pc7VpFuwfjWNZd0fdZX X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" X-Spam-Status: No, score=-11.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 2026-10-20 14:28 +0200, Niklas Cassel wrote: > With the default MPS strategy (PCIE_BUS_DEFAULT), pci_configure_mps() > only matches each device's Maximum Payload Size (MPS) to its upstream > bridge. Root Ports have no upstream bridge, so their MPS stays at > whatever firmware or the hardware default (128 bytes) left there, and the > hierarchy below them inherits that value even if the Root Port and all > devices below it support more. > > Once the hierarchy below a Root Port has been scanned, and before drivers > are bound, set the Root Port and every device below it to the largest MPS > they all support, even if that is more than firmware programmed. Do this > from pcie_bus_configure_settings(), which the host bridge, ACPI and > hotplug paths call after scanning, and from pci_rescan_bus() and > pci_rescan_bus_bridge_resize(), which don't. > > If the hierarchy contains a hotplug bridge other than the Root Port, > typically a Switch Downstream Port, limit it to 128 bytes instead, like > pcie_find_smpss() does for PCIE_BUS_SAFE: a device hot-added below such a > port later can't lower the MPS of a hierarchy in use, but every device > supports 128 bytes. This costs throughput where firmware programmed a > larger MPS for such a hierarchy, in exchange for hot-added devices always > working. > > An empty slot directly below a Root Port is left alone; it is evaluated > when a device is hot-added or rescanned there, which also allows raising > the Root Port again after a device that supported less has been replaced. > Hierarchies in which a device other than a Switch port may already have > a driver bound are never changed. If the MPS of a device can't be set, > restore the previous MPS of the whole hierarchy rather than leaving it > with mismatched settings. > > Since PCIE_BUS_DEFAULT can now raise MPS above what firmware programmed, > apply the Intel 5000/5100 read completion coalescing quirk to it as well. > > The other strategies are unchanged: PCIE_BUS_TUNE_OFF doesn't touch MPS, > and PCIE_BUS_SAFE, PCIE_BUS_PERFORMANCE and PCIE_BUS_PEER2PEER already > configure the hierarchy in pcie_bus_configure_settings(). > > Suggested-by: Manivannan Sadhasivam > Co-developed-by: Hans Zhang <18255117159@163.com> > Signed-off-by: Hans Zhang <18255117159@163.com> > Signed-off-by: Niklas Cassel Acked-by: Manivannan Sadhasivam - Mani _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic