From patchwork Thu Jun 24 17:14:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 467409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF687C49EA5 for ; Thu, 24 Jun 2021 17:14:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B52C261057 for ; Thu, 24 Jun 2021 17:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232186AbhFXRQn (ORCPT ); Thu, 24 Jun 2021 13:16:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:37290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbhFXRQn (ORCPT ); Thu, 24 Jun 2021 13:16:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 01497613DC; Thu, 24 Jun 2021 17:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624554863; bh=zVx5VItzPLj7HM2YlVcVsl4Odcp6W+sfx757TCcPVvo=; h=From:To:Cc:Subject:Date:From; b=lLVOyh83aDlfzLS35Lp6FTJ9GjwU890OLYt3ugyyuhqJKZOXsZ31j6RbKA/3YzPPZ otQb+zN1LEBQXnNX4zfKiMWvQIYNHSA2KOZsJ3c3cwEZ0tl50Won0eWl/BSJO2xga3 rocixqHPfQU43C/00V3ia+q+lMXNUaqCR3eCvufViJFSJPSzPDlS5BUZNPBopBIODw G9M9o1hS26H5cHfgUbj5mTLGcqGDNa0VFGzLcDWqNd2hiBhqM1eUECmdB+Lh7vcvjF Nv5C/espaC6lGRAb/591DtiFwdoZhs9bKx7k12IcPayOrebldsQbdva8rtmawEEAw9 2eLXEa6BHYQRg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: =?utf-8?q?Pali_Roh=C3=A1r?= , =?utf-8?b?UsO2dHRp?= , Zachary Zhang , =?utf-8?q?Marek_Beh=C3=BAn?= , stable@vger.kernel.org Subject: [PATCH 1/2] PCI: Call MPS fixup quirks early Date: Thu, 24 Jun 2021 19:14:17 +0200 Message-Id: <20210624171418.27194-1-kabel@kernel.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The pci_device_add() function calls header fixups only after pci_configure_device(), which configures MPS. So in order to have MPS fixups working, they need to be called early. Signed-off-by: Marek Behún Fixes: 27d868b5e6cfa ("PCI: Set MPS to match upstream bridge") Cc: stable@vger.kernel.org --- drivers/pci/quirks.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 22b2bb1109c9..4d9b9d8fbc43 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3233,12 +3233,12 @@ static void fixup_mpss_256(struct pci_dev *dev) { dev->pcie_mpss = 1; /* 256 bytes */ } -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE, - PCI_DEVICE_ID_SOLARFLARE_SFC4000A_0, fixup_mpss_256); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE, - PCI_DEVICE_ID_SOLARFLARE_SFC4000A_1, fixup_mpss_256); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE, - PCI_DEVICE_ID_SOLARFLARE_SFC4000B, fixup_mpss_256); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLARFLARE, + PCI_DEVICE_ID_SOLARFLARE_SFC4000A_0, fixup_mpss_256); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLARFLARE, + PCI_DEVICE_ID_SOLARFLARE_SFC4000A_1, fixup_mpss_256); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLARFLARE, + PCI_DEVICE_ID_SOLARFLARE_SFC4000B, fixup_mpss_256); /* * Intel 5000 and 5100 Memory controllers have an erratum with read completion From patchwork Thu Jun 24 17:14:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 466802 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A9F7C49EAB for ; Thu, 24 Jun 2021 17:14:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70409613DC for ; Thu, 24 Jun 2021 17:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232085AbhFXRQo (ORCPT ); Thu, 24 Jun 2021 13:16:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:37338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbhFXRQo (ORCPT ); Thu, 24 Jun 2021 13:16:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB74C61166; Thu, 24 Jun 2021 17:14:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624554865; bh=B6qNqvi41h4uc4w9dvtFFFJy8jV4qKdG7ikgRpKBPIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OLkdGSyvR8TOsESZ0YrcnHynVuuwEONYjnbM5UhqLq2YRvz3bRLZTAMjelPrgW6PM GukC+uMimKNabq/hulkcOnHoT5W/zz4DMkBQJEviy3+OdHjgATKXMiSOOmaBxU6tq+ NM1rWGstcThPk0+OsfU0kvtpsW86vYt69FvtYSmvd49GbEJ1I4r0BlA17b/6lgZ99G eN7xsGW4lFk7D05RZ0n8F3X3Y5txbKWYqpV062nRZBTdIv89wa4zuV1+6Dvj51XXQD ZYS/cI+LGMFz9PDVAAVq6KJGO7dAAmDxllAY7JueMhJgYNa5x19orXOZlguBmcJyaO 4OEJN46rLvw3Q== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: =?utf-8?q?Pali_Roh=C3=A1r?= , =?utf-8?b?UsO2dHRp?= , Zachary Zhang , =?utf-8?q?Marek_Beh=C3=BAn?= , stable@vger.kernel.org Subject: [PATCH 2/2] PCI: Add Max Payload Size quirk for ASMedia ASM1062 SATA controller Date: Thu, 24 Jun 2021 19:14:18 +0200 Message-Id: <20210624171418.27194-2-kabel@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210624171418.27194-1-kabel@kernel.org> References: <20210624171418.27194-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The ASMedia ASM1062 SATA controller advertises Max_Payload_Size_Supported of 512, but in fact it cannot handle TLPs with payload size of 512. We discovered this issue on PCIe controllers capable of MPS = 512 (Aardvark and DesignWare), where the issue presents itself as an External Abort. Bjorn Helgaas says: Probably ASM1062 reports a Malformed TLP error when it receives a data payload of 512 bytes, and Aardvark, DesignWare, etc convert this to an arm64 External Abort. Limiting Max Payload Size to 256 bytes solves this problem. Signed-off-by: Marek Behún BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212695 Reported-by: Rötti Cc: Pali Rohár Cc: stable@vger.kernel.org --- drivers/pci/quirks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 4d9b9d8fbc43..a4ba3e3b3c5e 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3239,6 +3239,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLARFLARE, PCI_DEVICE_ID_SOLARFLARE_SFC4000A_1, fixup_mpss_256); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLARFLARE, PCI_DEVICE_ID_SOLARFLARE_SFC4000B, fixup_mpss_256); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ASMEDIA, 0x0612, fixup_mpss_256); /* * Intel 5000 and 5100 Memory controllers have an erratum with read completion