Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1532588ybl; Tue, 3 Dec 2019 08:35:10 -0800 (PST) X-Google-Smtp-Source: APXvYqybSMeFnJwTR+8Zws1842Y3dbVl5EqAAtAzbCSLhKBvii5ZmXsZmTbYK7gP8KQag6C6tuF7 X-Received: by 2002:a54:4482:: with SMTP id v2mr4110169oiv.0.1575390910230; Tue, 03 Dec 2019 08:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575390910; cv=none; d=google.com; s=arc-20160816; b=RQ9AOe1ExXrC+zjjmgz8/GTlU1jmw9pCohy5u/v0qC5GtYgW3LrR1427SlFO7Qt2Mp AmXV6Mnpie52C2bBmuruFF+VFgEALRhnwU75MvZbm/x5LxLzDY53260RuZWBGTwzXaFD PTAlCDsvX8ObZEm1IEqAP6BLuRBQmq+FD2xHRDJFBdxGqAqzwp8HQvoZNhyzNnbOspBU iv3MnpHaoXqd7aMSYhGuCutmF9dwo2bnwNBhZR1IIRD4QfZNpWDSGJ2robuIBQ/ERRwb aFWx4nMGRllujtA3EX3RMD+rBwzw1HWSUL7Dwkfv/n1oHBSPAqnP+v1KEhzZAQDr0M1T hWhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=593tFEEedWDfHN/GaC6ep3nZeASQFunemSMCyJkM4RM=; b=gJuMzCs5WcVI1bY7AcZM/vkKOuw5UfQ3raYZt6e6RQmr3sKdR7BzTcTxwoZQj4WGUF uzBY0zdsbxmkhcOk4vZIyIy7UCGVSSmBOj8Z5y88cT2I1YPJJKNlgvamUYnRaI6+dC9D bHzdJLGIc2OeJtTUx1tfroUqJSd/ntfcsRpXubapiMVN+ggnpWQtldlZIEmwwMD4x/6Q h3Slh1Hl0+x7f8+jGL34wFpOXPXCBAY4ynKY34MWeGe93V4CCUqE3rEDfss+9S2Dt+kQ qWnixap7vxgCrK3SqwfZZKaapfB/2daxAtOR9e+i+qHwPnIQo8uFuQTaiTXFWhf2ncb7 Fgyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x126si1570391oix.53.2019.12.03.08.34.57; Tue, 03 Dec 2019 08:35:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726550AbfLCQbr (ORCPT + 99 others); Tue, 3 Dec 2019 11:31:47 -0500 Received: from foss.arm.com ([217.140.110.172]:45222 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfLCQbr (ORCPT ); Tue, 3 Dec 2019 11:31:47 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 081E231B; Tue, 3 Dec 2019 08:31:46 -0800 (PST) Received: from [192.168.122.164] (U201426.austin.arm.com [10.118.28.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C7F7A3F52E; Tue, 3 Dec 2019 08:31:45 -0800 (PST) Subject: Re: [PATCH v3 4/7] PCI: brcmstb: add Broadcom STB PCIe host controller driver To: Nicolas Saenz Julienne , andrew.murray@arm.com, maz@kernel.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Eric Anholt , Stefan Wahren , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com Cc: james.quinlan@broadcom.com, mbrugger@suse.com, phil@raspberrypi.org, linux-pci@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Bjorn Helgaas , linux-arm-kernel@lists.infradead.org References: <20191126091946.7970-1-nsaenzjulienne@suse.de> <20191126091946.7970-5-nsaenzjulienne@suse.de> From: Jeremy Linton Message-ID: Date: Tue, 3 Dec 2019 10:31:45 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191126091946.7970-5-nsaenzjulienne@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 11/26/19 3:19 AM, Nicolas Saenz Julienne wrote: > From: Jim Quinlan > > This adds a basic driver for Broadcom's STB PCIe controller, for now > aimed at Raspberry Pi 4's SoC, bcm2711. > > Signed-off-by: Jim Quinlan > Co-developed-by: Nicolas Saenz Julienne > Signed-off-by: Nicolas Saenz Julienne > > --- > > Changes since v2: > - Correct rc_bar2_offset sign > - Invert IRQ clear and masking in setup code > - Use bitfield.h, redo all register ops while keeping the register > names intact > - Remove all SHIFT register definitions > - Get rid of all _RB writes > - Get rid of of_data > - Don't iterate over inexisting dma-ranges > - Add comment regarding dma-ranges validation > - Small cosmetic cleanups > - Fix license mismatch > - Set driver Kconfig tristate > - Didn't add any comment about the controller not being I/O coherent > for now as I wait for Jeremy's reply I guess its fine.. In answer to the original query. It seems that this PCIe bridge requires explicit cache operations for DMA from PCIe endpoints. This wasn't obvious to me at first reading because I was assuming the custom DMA ops were strictly to deal with the stated DMA limits. So if you end up respinning, it still might be worthy mentioning somewhere that this is a non-coherent PCIe implementation. I still hold much of my original reservations about pieces of this driver. Particularly, how it might look if someone wanted to boot the RPi using ACPI on linux. But, I was shown a clever bit of AML recently, which solves those problems for the RPi and the attached XHCI. So, given how much time I've looked at the root port configuration/etc sections of this driver and I've not found a serious bug: Reviewed-by: Jeremy Linton > > Changes since v1: > - Fix Kconfig > - Remove pci domain check > - Remove all MSI related code > - Remove supend/resume code > - Simplify link state wait routine > - Prefix all functions > - Use of_device_get_match_data() > - Use devm_clk_get_optional() > - Get rid of irq variable > - Use STB all over the driver > - Simplify map_bus() function > - Fix license mismatch > - Remove unused register definitions > - Small cleanups, spell errors > > This is based on Jim's original submission[1] but adapted and tailored > specifically to bcm2711's needs (that's the Raspberry Pi 4). Support for > the rest of the brcmstb family will soon follow once we get support for > multiple dma-ranges in dma/direct. > > [1] https://patchwork.kernel.org/patch/10605959/ > > drivers/pci/controller/Kconfig | 8 + > drivers/pci/controller/Makefile | 1 + > drivers/pci/controller/pcie-brcmstb.c | 753 ++++++++++++++++++++++++++ > 3 files changed, 762 insertions(+) > create mode 100644 drivers/pci/controller/pcie-brcmstb.c > Thanks,