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=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 BFD25C433E0 for ; Fri, 26 Mar 2021 13:41:30 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 69A3461A18 for ; Fri, 26 Mar 2021 13:41:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69A3461A18 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0aXNm9VTlW+Zx90HY03ojiTaJZIxjoi16B5ADT7sMGY=; b=akFkBvnQu/Mlp2IYmP63lhWsy Hykk0IUvY6KgQUsvwBs0eC95uo9VXw1sYLQRHhp0dpuurMNKvcNaD2IZ/l3wST02ovwCSn+EpIsAp eOdkNtkJekcCvrGlJaIVRoOqFbHUde9pP+0l4tiXB7uXobt/HR3uAWqWFq1Z4WWq0z2bSni3WShoQ iCT881JFFV4e+S3b2PrjobpAksPG92lNrF4ITkyUrahZRko6LiJxvLr3i2iTUIxx1G6u9IQs1vTzw RPc19YaFilEx1PFcWGubNc5mPNV3sfXEEa42EKJfHwrQLSDxW7+06twZky38lr8K/cFNvpmuScVen er0GCQsIg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPmgs-003cD6-83; Fri, 26 Mar 2021 13:39:54 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPmgo-003cCb-6f for linux-arm-kernel@lists.infradead.org; Fri, 26 Mar 2021 13:39:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=K+OXuZx0DvROyzdDSVKuWVEPaeWjmlruLI43qXxtc0U=; b=in4/0zoOq/Ev4XI66PJJ489Km Aug6bnhEVs1ccu60zavKwMDJMdsjFkHci4WPWJDAr2DUEUOdErm4WyyKny7TBlg3bkybfeKsBaU0u g12gAsOeGw9T5wBvp2sBx3qQPWQrhV79x9SSVmd+VaVngSGMm1EkF0FhtM1hpLf4jp62ydpH3192n 9gg7/nV/k1Ks8DXhhgWOmoNuUfpkQDqf2YwmLVZpv0IaUhqMoe9+o7IGemZKmDij8iIGTCcIcP715 qTSvQ/MOj2SmMACA+7MXXdL9tjxk24btLABaeLbA9j6ScXB52cGIxxfIbscQvKzkvU94shGV8CSwg HmrIrfE+w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51800) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPmgm-0005jF-J4; Fri, 26 Mar 2021 13:39:48 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lPmgm-0007AN-9Z; Fri, 26 Mar 2021 13:39:48 +0000 Date: Fri, 26 Mar 2021 13:39:48 +0000 From: Russell King - ARM Linux admin To: Arnd Bergmann Cc: Linux ARM , Rob Herring Subject: Re: [PATCH 1/3] ARM: pci: make bus I/O resources optional Message-ID: <20210326133948.GR1463@shell.armlinux.org.uk> References: <20210326121735.GQ1463@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210326_133950_528182_DCFFA1FF X-CRM114-Status: GOOD ( 23.23 ) 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 Fri, Mar 26, 2021 at 02:33:15PM +0100, Arnd Bergmann wrote: > Leaving out the lower 0x1000 port numbers in turn is required so > legacy ISA drivers acquire the ports with request_region(). The reason > it broke on your machine was apparently that pci_claim_resource() > failed to assign the low port numbers to the PCI bus after that has > explicitly set the minimum. No, this is totally broken thinking. The 0x1000 offset is *purely* a PCI resource *allocation* issue, nothing more nothing less. To argue otherwise just shows a lack of understanding of what is going on here. _All_ resources from IO port 0 to 0xffff are on the PCI bus in this case. It makes no sense to create a PCI bus resource for 0x1000-0xffff. That is entirely illogical and ficticious. > Using ioport_resource as the PCI host bridge resource as you do > is the easiest way to make it work for both ISA drivers and PCI drivers > using low I/O ports. The fact is, in these machines, the ISA bus is _behind_ the PCI bus, just like it is on x86 PCs and Alpha. There's no difference here. > > @@ -434,19 +435,25 @@ static int pcibios_init_resource(int busnr, struct pci_sys_data *sys, > > if (resource_type(window->res) == IORESOURCE_IO) > > return 0; > > > > - sys->io_res.start = (busnr * SZ_64K) ? : pcibios_min_io; > > - sys->io_res.end = (busnr + 1) * SZ_64K - 1; > > - sys->io_res.flags = IORESOURCE_IO; > > - sys->io_res.name = sys->io_res_name; > > - sprintf(sys->io_res_name, "PCI%d I/O", busnr); > > + if (bus_ioport_resource) { > > + sys->io_res.start = (busnr * SZ_64K) ? : pcibios_min_io; > > + sys->io_res.end = (busnr + 1) * SZ_64K - 1; > > + sys->io_res.flags = IORESOURCE_IO; > > > After rereading this function, I see that the function already provides > a way to do what you want here: If the hw->setup() function inserts > ioport_resource into sys->resources along with the memory > resources, it will skip the extra one, and you get the same effect. True, but I suspect the start of the IO resource above is wrong in any case - as I say, this is based on a misunderstanding of what pcibios_min_io is. It is the start of the region of to be used for resource allocation on the bus, which can be different from the range of addresses present on the bus. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel