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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D54DEE14D7 for ; Thu, 7 Sep 2023 03:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237270AbjIGDNQ (ORCPT ); Wed, 6 Sep 2023 23:13:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231859AbjIGDNN (ORCPT ); Wed, 6 Sep 2023 23:13:13 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFAE3133; Wed, 6 Sep 2023 20:13:08 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 120CE3200945; Wed, 6 Sep 2023 23:13:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 06 Sep 2023 23:13:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1694056384; x=1694142784; bh=OXTmpIBOV1UxZ2xEwVd1/NfVXC6bFY0UiDJ AKT3kajw=; b=OVaTFjB+tJuF36xZSClXZas6bTYFmPOna6qLbLDFZhgSatZrtnn 4gwbd9eHcFxub5sNNfvCMVkTtnimU1fwez+9V7e0zTaW/X/C2fZ7gxKOk+qYOFLY cklVFF3/25+2RJgahWL+o99rbtAsi1F5SBZF+vMgljIHFHmmH6KBh7ce97sG4rLn A/ZZef/pctp+jl59atieAklcNx7KuuxMKvbDMIXKjX9zJsmaLzSnolf28VzKG6rn nahZt+Ilho7A485CAtM8EyrzTsN60v7fiB5aFn+vnbBYqZxOElXheNzQaQ3ivFaO WvmuRkMHm57zE7ygqq1lHVZ4+aOzPk8U4IA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694056384; x=1694142784; bh=OXTmpIBOV1UxZ2xEwVd1/NfVXC6bFY0UiDJ AKT3kajw=; b=dcvtZApRAQ25C9kUF/inYTfY+NZ59bEC5fBt0T+fDcowjKXOp6G 3Xw7319JGehT03+VzQKfLTYdXixXa+NVKtPP3d/fIusvNhIeB92RSozSsJMD3DhS 1GsJfFsJ3I5v61jz61Xftirt2wmY6de3ILDhZkFzBTKCPcePJnfn//XOk1KD1uEK KMZ3UZM6C893FXLYsGuQPFMSe1U6USSegGqn/ciciIUo3h1u2iObsk5mvmBGtsR6 Kq/LNsN5AWudHQ2jBjOnzl0BNVo8k4pTvXEqbxIlkxWLI/s4ydJIUgZtq6rP+gU2 ZuXb0VaGknVvX8fFdxeCElbj7E2TCWqQfQg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehgedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfvfevfhfhufgjtgfgsehtkeertddtfeejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhephfehveeggeevieehgfdtveeigffgteehieehffetleetffeh hfeuteffudehfeffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Sep 2023 23:13:02 -0400 (EDT) Message-ID: <6e1bdebf-f335-23a5-c79f-d603c5d0150c@flygoat.com> Date: Thu, 7 Sep 2023 11:13:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 To: Manivannan Sadhasivam Cc: Huacai Chen , linux-pci@vger.kernel.org, bhelgaas@google.com, linux-kernel@vger.kernel.org, kw@linux.com, lpieralisi@kernel.org, stable@vger.kernel.org References: <20230725061008.1504292-1-jiaxun.yang@flygoat.com> <861a809d-3df1-327e-e033-87506f6d89e5@flygoat.com> <20230907011828.GA2865@thinkpad> Content-Language: en-GB From: Jiaxun Yang Subject: Re: [PATCH v2] pci: loongson: Workaround MIPS firmware MRRS settings In-Reply-To: <20230907011828.GA2865@thinkpad> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2023/9/7 9:18, Manivannan Sadhasivam 写道: [...] > Why do you need to walk through every single device instead of just bridges? > I'm not the maintainer, but my suggestion is to go for Huacai Chen's solution. Hi Mani, Thanks for your reply, unfortunately Huacai's solution is impractical in this case. The problem we have, is firmware (or BIOS) setting improper MRRS for devices attached under those bridges. So we have to fix up MRRS for every single device. We can't iterate child device in bridge quirk because there is no guarantee that bridge will be probed before  it's child device, partly due to hotplug. This quirk has been in tree for a while, until Huacai refactored it and broke some systems in 8b3517f88ff2 ("PCI: loongson: Prevent LS7A MRRS increases"). Also to note that ks_pcie_quirk in drivers/pci/controller/dwc/pci-keystone.c uses similar approach. > This avoids iterating over bridges/devices two times. > > Also, please rename firmware to BIOS, as firmware commonly represents the > software running on PCIe endpoint devices. Ack, will fix in next reversion. Thanks - Jiaxun > > - Mani [...]