Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1619040pxj; Fri, 18 Jun 2021 10:56:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXGgGJxXH65CiPk2VTB8d6PmB4P5S0nWDY55Rb3KteXYNqrIVyTulnh1kBBWcxr+GBA1o1 X-Received: by 2002:a05:6638:24d0:: with SMTP id y16mr4366147jat.41.1624039016396; Fri, 18 Jun 2021 10:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624039016; cv=none; d=google.com; s=arc-20160816; b=S5Ffj4C6I+UFe9q+gmlUKKqEJHR/Vj+xUnAbcY5C4vSZuWavYg1HfC4aEXTsk40XIE 9myubsaiXBy6yDoj5um/wRl5vO/eIV+o8MrrdmXsH+Tvh61fE0h8n0wjztRexxlZRFc2 U7AIggGZ0suN0b441niATNYkH5fXHS6NdDmn+aEichi+VbcgYmz4euIlOmT+HG7ubnYa /ey4RE9tvMU7zPW/YE+a2SNh+droqKgvs9YFyXSuabyz1Nh+jUdbrDmbboQgFi6HJjzZ lK3tBsvIoDLHpisrpy9oVizi8Iz81r+zuEwKteYL51STx1Pn5C4QLam2p8gFl9u12rnX lr0A== 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=BB8SswcEaNjvxfv5/SYWvaIhulUyrjsY7Tim+J287Po=; b=YC6e3FEHG9lsgtTDtDNSiQnKqRh3Fwvp9msjprZXmQC5MIpeAr/lW8SFcYImJc6vo/ FCJOtprXV2QmEmvv5VWFYRkdQspAKI1oKCd8loocxW/cJbyxFxDJSXYlrAn2u0rggVs3 6gCs84ALkRnBDkVecT3xktfLytz9A1JJZio49g88z1LJ7nZkyWdfzWeJrRn65MBzzWpB So4H4rNoGYFQQShCl5T1Ao3bBUo5bSEvNBCaCspxrZB+oKAhvp93cd4I2tDPBsn73TTM ZdVQflBlTtP+8Sci2bqS75NTRC4JsSrDr0m6J1i0rilpdt7OTMXG1xRf9t1nQdAAJ/vr Zb5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=yZmbw54f; 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 l12si2964436ils.9.2021.06.18.10.56.43; Fri, 18 Jun 2021 10:56:56 -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=yZmbw54f; 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 S229550AbhFRPLD (ORCPT + 99 others); Fri, 18 Jun 2021 11:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbhFRPLC (ORCPT ); Fri, 18 Jun 2021 11:11:02 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B0F4C061574 for ; Fri, 18 Jun 2021 08:08:52 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id n35-20020a05600c3ba3b02901cdecb6bda8so8904422wms.5 for ; Fri, 18 Jun 2021 08:08:52 -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=BB8SswcEaNjvxfv5/SYWvaIhulUyrjsY7Tim+J287Po=; b=yZmbw54fJezM3UObaPBhSLvrX2gSA9+LSWtH2qYk8jxMojG6lI4YXcKvqvsvQQTWIE lKA9iT6D1d2pROZ95mRBVhxjLinX2g0RwgNXx44mtfn7OyIZ+Tr3yT4TzvkeeNuMehuE q+74TUg2i0XDPXq1zmBmBmtPyIHQnYUJxckq3BZpSYji7LI0HpPGRGG5GfW3cMZP3FAT pSnY2lWSuurXxwZ2+2fuKJEZkaIHtSKYQaCG+GP4MMvstlaqbVqmTSvo9SFUYGVZPjaN mr9bjoIs4vlySv5nbPD0ujzQtferv/pkjS1KsqRY1eNHlYcmhfiTDdUPOu7R5J4tkiqm 1D6g== 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=BB8SswcEaNjvxfv5/SYWvaIhulUyrjsY7Tim+J287Po=; b=gID13sW0sYh4XHW3AIrqa7RM8vFbwuZfjs0Ny4mLsnDBncf5oV2EJT3bT5rqxvfIiP Qi/EoT5qEGATvzP/9O4Q0YaMrl04JpEFpaCUDYVOJCkdGVray1ew4oeglsBTCvoU5Ckv sEWKmVGahuv9UNi36g2ih0j6d4NwSZ4zISoHmuciF9Un4BUd5Rn7v5nwKhKlJLDkaKCI twOjPqSeS2yalG4QERzVHFHKzeLY5tdnQHZvZXfpuaPeabl5Teg6zOeqQN7LU+hHNNY8 tc/q+RSz04cpRVtf9oRhQe6ZM37ktZwRQOUTwGEqqhFWhdd+lTgPBjpGVOpmPFfU/ETg /NTQ== X-Gm-Message-State: AOAM5329km/5Q01Nn6nGvHHzeli4TIi6aoo7Wna+3WHv7/0Fj4ZLG0U8 +bhlpS9D7FjThxhK7sJzhvHKOQ== X-Received: by 2002:a1c:7314:: with SMTP id d20mr10760262wmb.167.1624028931071; Fri, 18 Jun 2021 08:08:51 -0700 (PDT) Received: from [10.1.3.24] (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id u12sm9276925wrr.40.2021.06.18.08.08.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Jun 2021 08:08:50 -0700 (PDT) Subject: Re: [PATCH] PCI: dwc: meson add quirk To: Rob Herring , Martin Blumenstingl Cc: Artem Lapkin , Yue Wang , Kevin Hilman , Lorenzo Pieralisi , Krzysztof Wilczynski , Jerome Brunet , Christian Hewitt , PCI , linux-arm-kernel , "open list:ARM/Amlogic Meson..." , "linux-kernel@vger.kernel.org" , art@khadas.com, Nick Xie , gouwa@khadas.com References: <20210618063821.1383357-1-art@khadas.com> From: Neil Armstrong Organization: Baylibre Message-ID: <9b27444c-ea13-0dd2-a671-cef27e03b35c@baylibre.com> Date: Fri, 18 Jun 2021 17:08:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: 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 On 18/06/2021 16:30, Rob Herring wrote: > On Fri, Jun 18, 2021 at 6:12 AM Martin Blumenstingl > wrote: >> >> Hi Artem, >> >> On Fri, Jun 18, 2021 at 8:38 AM Artem Lapkin wrote: >>> >>> Device set same 256 bytes maximum read request size equal MAX_READ_REQ_SIZE >>> was find some issue with HDMI scrambled picture and nvme devices >>> at intensive writing... >>> >>> [ 4.798971] nvme 0000:01:00.0: fix MRRS from 512 to 256 >>> >>> This quirk setup same MRRS if we try solve this problem with >>> pci=pcie_bus_perf kernel command line param >> thank you for investigating this issue and for providing a fix! >> >> [...] >>> +static void meson_pcie_quirk(struct pci_dev *dev) >>> +{ >>> + int mrrs; >>> + >>> + /* no need quirk */ >>> + if (pcie_bus_config != PCIE_BUS_DEFAULT) >>> + return; >>> + >>> + /* no need for root bus */ >>> + if (pci_is_root_bus(dev->bus)) >>> + return; >>> + >>> + mrrs = pcie_get_readrq(dev); >>> + >>> + /* >>> + * set same 256 bytes maximum read request size equal MAX_READ_REQ_SIZE >>> + * was find some issue with HDMI scrambled picture and nvme devices >>> + * at intensive writing... >>> + */ >>> + >>> + if (mrrs != MAX_READ_REQ_SIZE) { >>> + dev_info(&dev->dev, "fix MRRS from %d to %d\n", mrrs, MAX_READ_REQ_SIZE); >>> + pcie_set_readrq(dev, MAX_READ_REQ_SIZE); >>> + } >>> +} >>> +DECLARE_PCI_FIXUP_ENABLE(PCI_ANY_ID, PCI_ANY_ID, meson_pcie_quirk); > > Isn't this going to run for everyone if meson driver happens to be enabled? It should be enabled only when the Amlogic bridge is present, thus similar filtering as keystone & loongon is needed, but with such filtering we could reuse ks_pcie_quirk() and loongson_mrrs_quirk() as is. > >> it seems that other PCIe controllers need something similar. in >> particular I found pci-keystone [0] and pci-loongson [1] >> while comparing your code with the two existing implementations two >> things came to my mind: >> 1. your implementation slightly differs from the two existing ones as >> it's not walking through the parent PCI busses (I think this would be >> relevant if there's another bridge between the host bridge and the >> actual device) >> 2. (this is a question towards the PCI maintainers) does it make sense >> to have this MRRS quirk re-usable somewhere? > > Yes. Ideally, the max size could just be data in the bus or bridge > struct and perhaps some flags too, then the core can handle > everything. AFAIL Simply moving ks_pcie_quirk() and loongson_mrrs_quirk() to core with the amlogic pci IDS added would be sufficient here. Neil > > Rob >