Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5702873pxv; Wed, 7 Jul 2021 09:46:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzoygiiQNVUQOZgtEQWHpgTovQkQJsHR6VY5w9sj9vEAl0iBe96Qjh3JOjWbY9yjb7ZHyQ X-Received: by 2002:aa7:cd13:: with SMTP id b19mr31724235edw.45.1625676396144; Wed, 07 Jul 2021 09:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625676396; cv=none; d=google.com; s=arc-20160816; b=tC858k6dgXIb5PJsxnzWnvT5aqDRoYpBCXHE9IdsUpV5/J1qBxa9YrpRIG6jXh8RLD UEUj1rMJ73AwbSRAJucmfpX0ggkSUcEufxvq/CHC7YzmfnVBMnfA+BUd3PHKKHmBRRf2 p5iSuY8rRXck5FzUVxHr69vI6qsUYANV4PkkeQpdXJfRyD81cOoXxpcdcC+aMGXV33L6 ctnR5kaOewZstEzSNGJqot9FciTWAvNWAmDQtAMwm+5M2TD84XtgCsANzg8+uVyUjKAe +xRB80hVHbE4IKuIeSGV3Fu0t/uyvLD8Yn94s3k/+OZAE4FLQVXU6K82d9qTTHPuvRvI mEZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=iGAqdezK2vHGAQ68dZd/ZC/J1Kp8ZpS6hRcaEAVA45M=; b=EN1yqNts7ocajXfoYYkdZjvuMG284CENTSpRWj9BqFaRXMoPSh6jIFuWlYFiwM3jM1 6/EiayaX7qfNB0HBhv6yn1cTOCJgS9IT69N2QwTtid5f/+3x5D5slgjgscyLxiYLUb7p 5lav/5kEtFKplXptsMmZNfEm0mheVuTWkckoxt6J5W8se6YI2HOyQ2RraBH/ofB5x9xc 9LHPARQaeMEARgdcZ6qhS5Mjf/TS+Bm10RpfDuOG0eZo/Td+E8068Rc71t+H7RmJC/5p Tb86GNXa4PDsqelTSmil9AtfeKqm4cBCCKFuVaUTzwp+cq2R2VxP8c5yAK0sMu8ys17S kZ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=gjQPOAOh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca9si17446045edb.172.2021.07.07.09.46.13; Wed, 07 Jul 2021 09:46:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=gjQPOAOh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230302AbhGGQp6 (ORCPT + 99 others); Wed, 7 Jul 2021 12:45:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbhGGQp5 (ORCPT ); Wed, 7 Jul 2021 12:45:57 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB2EAC061760 for ; Wed, 7 Jul 2021 09:43:16 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id l7so2877324wrv.7 for ; Wed, 07 Jul 2021 09:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iGAqdezK2vHGAQ68dZd/ZC/J1Kp8ZpS6hRcaEAVA45M=; b=gjQPOAOhCm7H78f15yDmge4+B3Lml1OZV2BqBTx1bzrBFZarbGDKyvpUXWm00zD6AT yYgcN0AH7xQrg1mg9/hi/JePEd5X6zlrY6gwMai6ZKLZ+AjHENeNSjvm2pdmP2UxYqgz vAJtwTN+F7O5DRvPv/ch+pY6p6yNXtXealbnxpglX/6bfvhzr3GXGZWJPoJ/iQf3SETs 9roTlfqsXpizY9pqnN473fCK+4Yt1oDrM+nvotru/AKUwrvBYUi5NjP4azj+1kwIO/8K bXi1hEKLXLBNcjU2PUD4jqDdqOfg60nJCFS0krIG8/NYO/UNHBwkaSzXLB1y0uyQm1FV mlUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=iGAqdezK2vHGAQ68dZd/ZC/J1Kp8ZpS6hRcaEAVA45M=; b=hHBLyf4LGi+K2sC4AAM7/dxGjvzvEvjaPkbE3qjIzNr840hakRflaSOFyKYF3nnrGr 66Fca5sBjut+D07dXm7lOPZibDke16yhk0+kQcRoF/vEyGEpztBaIxYGXju95xUleO4q bRCdmMNqWIQ/+z42O10npF67m7nIAOZNJpXGdoxCIpj3LuPau8KkHEKdcPtonqJg0iSI TxgU5Hu4PiOo7ohQk7mm1zxxZ08pl+5E5Ils02tt0UGwpMHWDJQqqCTsU0ghMVEVQk5x MlpMwApRSaPbvgUqGzDfvd+eYFCc+oDPbBIK7eqbEw3DVzY++A7NAmK4CvCqKtlLUG2w 8xVg== X-Gm-Message-State: AOAM532Tpt5tuFpz9/6tc9hEaUVcld9v5mfhdB5e1uWzEeyULCC0yBWS pMGy+j3jy6Lwq5AJ4CJ6IcKdxg== X-Received: by 2002:a5d:4f10:: with SMTP id c16mr28985295wru.3.1625676195470; Wed, 07 Jul 2021 09:43:15 -0700 (PDT) Received: from ?IPv6:2001:861:44c0:66c0:59ba:fed7:14a3:f22f? ([2001:861:44c0:66c0:59ba:fed7:14a3:f22f]) by smtp.gmail.com with ESMTPSA id t11sm21281369wrz.7.2021.07.07.09.43.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jul 2021 09:43:14 -0700 (PDT) Subject: Re: [PATCH 0/4] PCI: replace dublicated MRRS limit quirks To: Bjorn Helgaas Cc: Art Nikpal , Huacai Chen , =?UTF-8?B?6ZmI5Y2O5omN?= , Yue Wang , Kevin Hilman , Lorenzo Pieralisi , Rob Herring , Krzysztof Wilczynski , Jerome Brunet , Christian Hewitt , Martin Blumenstingl , PCI , linux-arm-kernel , "open list:ARM/Amlogic Meson..." , LKML , Artem Lapkin , Nick Xie , Gouwa Wang References: <20210707155418.GA897940@bjorn-Precision-5520> From: Neil Armstrong Organization: Baylibre Message-ID: Date: Wed, 7 Jul 2021 18:43:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210707155418.GA897940@bjorn-Precision-5520> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 07/07/2021 17:54, Bjorn Helgaas wrote: > On Tue, Jul 06, 2021 at 11:54:05AM +0200, Neil Armstrong wrote: >> In their Designware PCIe controller driver, amlogic sets the >> Max_Payload_Size & Max_Read_Request_Size to 256: >> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L260 >> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L276 >> in their root port PCIe Express Device Control Register. >> >> Looking at the Synopsys DW-PCIe Databook, Max_Payload_Size & >> Max_Read_Request_Size are used to decompose into AXI burst, but it >> seems the Max_Payload_Size & Max_Read_Request_Size are set by >> default to 512 but the internal Max_Payload_Size_Supported is set to >> 256, thus changing these values to 256 at runtime to match and >> optimize bandwidth. >> >> It's said, "Reducing Outbound Decomposition" : >> - "Ensure that your application master does not generate bursts of >> size greater than or equal to Max_Payload_Size" >> >> - "Program your PCIe system with a larger value of Max_Payload_Size >> without exceeding Max_Payload_Size_Supported" >> >> - "Program your PCIe system with a larger value of Max_Read_Request >> without exceeding Max_Payload_Size_Supported: >> >> So leaving 512 in Max_Payload_Size & Max_Read_Request leads to >> Outbound Decomposition which decreases PCIe link and degrades the >> AXI bus by doubling the bursts, leading to this fix to avoid >> overflowing the AXI bus. >> >> So it seems to be still needed, I assume this *should* be handled in >> the core somehow to propagate these settings to child endpoints to >> match the root port Max_Payload_Size & Max_Read_Request sizes. >> >> Maybe by adding a core function to set these values instead of using >> the dw_pcie_find_capability() & dw_pcie_write/readl_dbi() helpers >> and set a state on the root port to propagate the value ? > > I don't have the Synopsys DW-PCIe Databook, so I'm lacking any > context. The above *seems* to say that MPS/MRRS settings affect AXI > bus usage. It does when the TLPs are directed to the RC. > > The MPS and MRRS registers are defined to affect traffic on *PCIe*. If > a platform uses MPS and MRRS values to optimize transfers on non-PCIe > links, that's a problem because the PCI core code that manages MPS and > MRRS has no knowledge of those non-PCIe parts of the system. Yes and no, it only affects PCIe in P2P, in non-P2P is will certainly affect transfers on the internal SoC/Processor/Chip internal bus/fabric. > You might be able to deal with this in Synopsys-specific code somehow, > but it's going to be a bit of a hassle because I don't want it to make > maintenance of the generic MPS/MRRS code harder. I understand, but this is why these quirks are currently implemented in the controller driver and only applies when the controller has been probed and to each endpoint detected on this particular controller. So we may continue having separate quirks for each controller if the core isn't the right place to handle MPS/MRRS. Neil > Bjorn >