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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 47F2EC48BDF for ; Fri, 18 Jun 2021 15:10:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 184B661369 for ; Fri, 18 Jun 2021 15:10:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 184B661369 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TX646XOcJvq5/mFVlFNhXrG9lFLamwYECR1XjCWZ6Ao=; b=2O+nj2LnieY2CDB8wcX3m09u1G LohahOzufqUKmfBBmw7VBfhXWSOyvUDdOyO5D+XFa6QXiBd7YhOi0He4t5agPDc7TV39eN9EkEW1m BCCwepiRuZhXhWMCt6KaIcRj1cEJqJ6DprEvPo3NPIRpCRnbrlHcE7LMMs1EpTDgfCbg8Vy3BEvQK UEr4d6x7RKOnzwWG0vaAgTfa0nQQKkc7b5zF15NKm9DOUo/x41utRuzACyZZURqFGovJcqScNkU96 0l3c8KJSM0O38rXbW+U/GZzVS38QarXdkNrA1fdpexh4lStLC6u983JvR2gMTkJ6KHPlNN4Eq8P0o edtLwCyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luG79-00EczH-5w; Fri, 18 Jun 2021 15:08:59 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luG73-00EcxD-MU for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:08:55 +0000 Received: by mail-wm1-x330.google.com with SMTP id t4-20020a1c77040000b029019d22d84ebdso8922864wmi.3 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=gMDZ+0gzzi7uPF3swqyw0KZ/KPrbjki0uejdoktP4AN42X6GuIyMLz+QZPLmzpmLoN SU70GdelGHzX/3MO9jhHGCUJ7zMCSwa6VKU9HSiC6Pinhg6AJRYXls6QMVYP5GLuJPOO uwTg4DqV0Gq36FZ3TT/QRxMkbF5vKl1N8WUMshJoEa2xSg5S8L7OB8uwOJJXaYc9pxM1 b8NDLVRUM39+8a/eKzCFZazZEliR8Gm7Vn70NtMZf0wDIaPph9U1vJVkYxmaU6Ahglh3 g/PR/PIsVpukvvuPsSBgJcnMbdevYQMnZMmH2yalnB4jEq6h71Lxq7IYe9pWBoLaJeO6 EnJQ== X-Gm-Message-State: AOAM5307PZF+itFyEAG9ppgJ6UEGekcR0ZGao+c2Yqe8HOAQLQFrU6wU 3pht5jVn/iFUFPhYs1Cp9ikyeA== X-Google-Smtp-Source: ABdhPJxDHp+81lE3UaKhD8t72YZzpU4a1NRKPGAQoLZH13xKQADxUrtdW0KvDdrw21Ae2pn6NnLEOA== 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_080853_795553_3ACB5E1D X-CRM114-Status: GOOD ( 22.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel