From patchwork Sun Aug 22 16:10:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12451583 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 85AA2C432BE for ; Sun, 22 Aug 2021 16:10:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F3E961267 for ; Sun, 22 Aug 2021 16:10:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234377AbhHVQKv (ORCPT ); Sun, 22 Aug 2021 12:10:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234312AbhHVQKu (ORCPT ); Sun, 22 Aug 2021 12:10:50 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F252C061575; Sun, 22 Aug 2021 09:10:09 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id l7-20020a1c2507000000b002e6be5d86b3so9130191wml.3; Sun, 22 Aug 2021 09:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9iPYiB9P0MXl5MIldnO2JAw/ZmMfLkJnaCtEYcgC+G0=; b=Nx/X6Mtx1X8yXKSqH60hv5xFiHTRjFdulRlVSrvCQnAzAfROfv1zaadiIT5IBZNM2q ZNzsgywSmdLY0LI+ld2dOM2IEjh7qG+jyrnW6IZC3ZoO1M6f0apZGYZpx2IErAkGawnR WGPKqdEGUp1Ai70OWTl4hDA04cfZLFtgcz7Szwq2fE6X8hhzGNJPbrS9H04FUuv+m2B6 Oy2TnAsRm2WZrfNI17Xzc139Xdz1sIuZWGPepDlj25hVSTyOJHQgi1ZxtTiQpS3C3EP7 89cCEqlky+/cNJaAUGaVSzLkc+Cspsp/SE0lEVWfwh2aA1gd1VWWgLAfebvDF6/B0FHl WH6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9iPYiB9P0MXl5MIldnO2JAw/ZmMfLkJnaCtEYcgC+G0=; b=K3Ovuysgb1iNwQuyVsZukXslUNrwTbF8y8ncKJrdgNi+yXm0uhuIOBVxhLv192lUSi DQdzJJI/ObovPOIutqbRMe8VEY2KTRlKzwEruyP99VKx/OGf8OyJsfofIsdYLObmi5qA 0yCQt6vb91mWIyJtUSsoJFLIGSqlxYax6vXw8qqgGwPYtxW8CAfh3yb0COoOOhpZWAUi ECVVrQN0M273rjx8B+5iIzqz4SUVjjcuaNXEbRXD8Ko9PWf42s8Nh2IfmwnODic9w55C WsOjclIhYTfPZmEzWJhWkG+narsnPdv0z0Y3W1O1J7yTKx4xmmjbIWyV0FQ+RWT6p2b/ MWdw== X-Gm-Message-State: AOAM530T5bMfqQ0VvQSc7ayNbSc+m6SM14E5VlVrN6tWVSSiO3CZmdvP wEAFO9DJBFANXMkq1Eln+Jw= X-Google-Smtp-Source: ABdhPJyCY7IpuQyVLQmn1AHmTtihcWx5mRPyQ1CyFjU5AjrMeT2dn9KoGviyYoZvE7mx6Qam31mQ+g== X-Received: by 2002:a1c:7714:: with SMTP id t20mr12544059wmi.175.1629648608189; Sun, 22 Aug 2021 09:10:08 -0700 (PDT) Received: from localhost.localdomain (10.red-83-57-27.dynamicip.rima-tde.net. [83.57.27.10]) by smtp.gmail.com with ESMTPSA id y11sm14861976wru.0.2021.08.22.09.10.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Aug 2021 09:10:07 -0700 (PDT) From: Sergio Paracuellos To: tsbogend@alpha.franken.de Cc: bhelgaas@google.com, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] MIPS: ralink: don't define PC_IOBASE but increase IO_SPACE_LIMIT Date: Sun, 22 Aug 2021 18:10:03 +0200 Message-Id: <20210822161005.22467-2-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210822161005.22467-1-sergio.paracuellos@gmail.com> References: <20210822161005.22467-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Defining PCI_IOBASE results in pci resource handling working but the addresses generated for IO accesses are wrong since the ioremap in the pci core function 'pci_parse_request_of_pci_ranges' tries to remap to a fixed virtual address (PC_IOBASE) which can't work for KSEG1 addresses. To get it working this way, we would need to put PCI_IOBASE somewhere into KSEG2 which will result in creating TLB entries for IO addresses, which most of the time isn't needed on MIPS because of access via KSEG1. So avoid to define PCI_IOBASE and increase IO_SPACE_LIMIT resource for ralink MIPS platform instead, to get valid IO addresses for resources from pci core 'pci_address_to_pio' function. Fixes: 222b27713d7f ("MIPS: ralink: Define PCI_IOBASE) Signed-off-by: Sergio Paracuellos Acked-by: Thomas Bogendoerfer --- arch/mips/include/asm/mach-ralink/spaces.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/mips/include/asm/mach-ralink/spaces.h b/arch/mips/include/asm/mach-ralink/spaces.h index 87d085c9ad61..31a3525213cf 100644 --- a/arch/mips/include/asm/mach-ralink/spaces.h +++ b/arch/mips/include/asm/mach-ralink/spaces.h @@ -2,9 +2,7 @@ #ifndef __ASM_MACH_RALINK_SPACES_H_ #define __ASM_MACH_RALINK_SPACES_H_ -#define PCI_IOBASE _AC(0xa0000000, UL) -#define PCI_IOSIZE SZ_16M -#define IO_SPACE_LIMIT (PCI_IOSIZE - 1) +#define IO_SPACE_LIMIT 0x1fffffff #include #endif From patchwork Sun Aug 22 16:10:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12451585 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 3339CC4320A for ; Sun, 22 Aug 2021 16:10:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16C7161266 for ; Sun, 22 Aug 2021 16:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234407AbhHVQKw (ORCPT ); Sun, 22 Aug 2021 12:10:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234405AbhHVQKw (ORCPT ); Sun, 22 Aug 2021 12:10:52 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACE75C061575; Sun, 22 Aug 2021 09:10:10 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id q11-20020a7bce8b0000b02902e6880d0accso12375664wmj.0; Sun, 22 Aug 2021 09:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gSXX1JoXvG5K5PKjisS9BImgtclzTYpjATWwr5Azs4A=; b=tBVxcCppV4Y8b4NgNXNDPE1zoyOm6rxGJ684C2aVzwtdKlI06iAPPBQUAM1uBS3Wfn 1EigME8VWB6cBIRyRuXLZqfWC5gs1cKFwDmxJ0ApoKpnlN+HV+Vs9kBcS5GbJJmjuWRb TJPQHB7LwRNtAe6zBGWKvkhsIy6nx0YIMgHZRlf7NLkGVON1+IZDyZN6TI7jFZE2VMZ7 kFzjjn44Jfi7PW8m2dpZwQPXhjPdB3Gb41D32jGBCty+VjzW7lhhbfSqd+obR8QRY2ZZ s+8aq//VGUAawSTxuEVnB/etEsN/ln+CfzxFld6U03zv258ON8OZ2eRuVCjOVPZ559w8 NcSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gSXX1JoXvG5K5PKjisS9BImgtclzTYpjATWwr5Azs4A=; b=FTCEUmKjXSISo5UxA7C5cYGhPZoJEsLqdK+lWCz5/Segcc5NlntpsKWvqmtAjuSO50 uM22dpgtdHa7Amu+Ijn8k6jO6nRp3mbs13oL/hvym7ZC1EsDsvdJWMaquhdkdwhDtJFJ FOwurBpUhdUkFgLopXuASNB7mMP/LAwB08ruvdSjQhR9CZsa5narzzbRe6IYMk6eBcyl uVpknAHFXWkQNP/DsLTkZW7JKBfTqZ0myWLVtQXJWkSgGlzuVwGq4y4PPuNyNrLLa2Xv NvDEImrP9eHhb6R6lXtzihJemlgDpJLcyjG8tI1z2di/FhfX/93KFJ6O4BRJryz3pT2A cKFw== X-Gm-Message-State: AOAM533hJJoShQsgQqDaIlj/LBAX0QDAm/fC68CDkML1grWZ/CZ8gZ4M 4esH+oWgBnscafc9fVAMIug= X-Google-Smtp-Source: ABdhPJzZzMwsRzU3TZVMg+llESmr69DSI8bn8ril64uySNWUeJ6OF0UGJwCC8UkXnjIEVlc0TPmlkg== X-Received: by 2002:a1c:2042:: with SMTP id g63mr12548033wmg.27.1629648609190; Sun, 22 Aug 2021 09:10:09 -0700 (PDT) Received: from localhost.localdomain (10.red-83-57-27.dynamicip.rima-tde.net. [83.57.27.10]) by smtp.gmail.com with ESMTPSA id y11sm14861976wru.0.2021.08.22.09.10.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Aug 2021 09:10:08 -0700 (PDT) From: Sergio Paracuellos To: tsbogend@alpha.franken.de Cc: bhelgaas@google.com, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] PCI: fix 'pci_remap_iospace' for architectures with PCI_IOBASE not defined Date: Sun, 22 Aug 2021 18:10:04 +0200 Message-Id: <20210822161005.22467-3-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210822161005.22467-1-sergio.paracuellos@gmail.com> References: <20210822161005.22467-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Request for I/O resources from device tree call 'pci_remap_iospace' from 'devm_pci_remap_iospace' which is also called from device tree function 'pci_parse_request_of_pci_ranges'. if PCI_IOBASE is not defined and I/O resources are requested the following warning appears: ------------[ cut here ]------------ WARNING: CPU: 2 PID: 1 at ../drivers/pci/pci.c:4066 pci_remap_iospace+0x3c/0x54 This architecture does not support memory mapped I/O Modules linked in: CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.10.1+ #1228 Stack : 00000000 00000000 807fa974 00000000 827ffa80 80066b48 80710000 0000000b 00000000 00000000 81c59aac 7d06ddec 80850000 00000001 81c59a40 7d06ddec 00000000 00000000 807c909c 81c598f0 00000001 81c59904 00000000 0000000a 203a6d6d 80708880 0000000f 70617773 80850000 00000000 00000000 807d0000 807ffecc 1e160000 00000001 00000200 00000000 8054e920 00000008 815e0008 ... Call Trace: [<80008efc>] show_stack+0x8c/0x130 [<806e1674>] dump_stack+0x9c/0xc8 [<80024a3c>] __warn+0xc0/0xe8 [<80024ad0>] warn_slowpath_fmt+0x6c/0xbc [<80410ca8>] pci_remap_iospace+0x3c/0x54 [<80410d20>] devm_pci_remap_iospace+0x58/0xa4 [<8042019c>] devm_of_pci_bridge_init+0x4dc/0x55c [<80408de8>] devm_pci_alloc_host_bridge+0x78/0x88 [<80424e44>] mt7621_pci_probe+0x68/0x9a4 [<80464804>] platform_drv_probe+0x40/0x7c [<804628bc>] really_probe+0x2fc/0x4e4 [<80463214>] device_driver_attach+0x4c/0x74 [<80463384>] __driver_attach+0x148/0x150 [<8046047c>] bus_for_each_dev+0x6c/0xb0 [<804614dc>] bus_add_driver+0x1b4/0x1fc [<80463aa0>] driver_register+0xd0/0x110 [<80001714>] do_one_initcall+0x84/0x1c0 [<808e7fd0>] kernel_init_freeable+0x214/0x24c [<806e4164>] kernel_init+0x14/0x118 [<80003358>] ret_from_kernel_thread+0x14/0x1c ---[ end trace 1c9d4412bd51b53c ]--- mt7621-pci 1e140000.pcie: error -19: failed to map resource [io 0x1e160000-0x1e16ffff] Since there are architectures (like MIPS ralink) that can request I/O resources from device tree but have not mapeable I/O space and also PCI_IOBASE not defined, avoid this warning and just return zero to make the I/O ranges assignment work. Signed-off-by: Sergio Paracuellos --- drivers/pci/pci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index aacf575c15cf..10bb2191f376 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4102,9 +4102,9 @@ unsigned long __weak pci_address_to_pio(phys_addr_t address) * @phys_addr: physical address of range to be mapped * * Remap the memory mapped I/O space described by the @res and the CPU - * physical address @phys_addr into virtual address space. Only - * architectures that have memory mapped IO functions defined (and the - * PCI_IOBASE value defined) should call this function. + * physical address @phys_addr into virtual address space. There + * are architectures that don't define PCI_IOBASE but can have not + * mapeable IO space. Return zero for those cases. */ int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) { @@ -4122,10 +4122,10 @@ int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) #else /* * This architecture does not have memory mapped I/O space, - * so this function should never be called + * but can have not mapeable I/O space, so just return ok + * here. */ - WARN_ONCE(1, "This architecture does not support memory mapped I/O\n"); - return -ENODEV; + return 0; #endif } EXPORT_SYMBOL(pci_remap_iospace); From patchwork Sun Aug 22 16:10:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12451587 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 A443AC4338F for ; Sun, 22 Aug 2021 16:10:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D47A61040 for ; Sun, 22 Aug 2021 16:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234312AbhHVQKy (ORCPT ); Sun, 22 Aug 2021 12:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234427AbhHVQKx (ORCPT ); Sun, 22 Aug 2021 12:10:53 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6DAEC061575; Sun, 22 Aug 2021 09:10:11 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id w21-20020a7bc1150000b02902e69ba66ce6so9130889wmi.1; Sun, 22 Aug 2021 09:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R7ftxM96YAq/VWL5+bWMfsnR3bh1EBHc546zzPpFbiU=; b=LGP4ALA/JTlwPIgsdrrLU6uI7R7+r40480lxGGI68rxhMYGHzVLJcOkmkb8m9SDvDh PtJbcdWv3EQappKQ8ntAoV1csSxQAQY7zkpz/afZeuAl6PI1kNVQd04tAevto7uBrxXR UYCtQoo2GHWPN/mol+ljL8DTJ+aurnCiGtw98z8idB1aCbCIOuQHmcUd5Hr+6s2Hg/HS xdJzH6fmpqau0aUmU/PbfnPZtiVtuz4nyXk1Esxy2sFMoVioqPf0Nb0bvvrQas+xwSKk k9+qOFpKXa/Nx2RU9qX7CWpTocoNvIddeSpv42UW6gU3C1rZa7XS+b7AEtq8ZjH6p9iJ zUfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R7ftxM96YAq/VWL5+bWMfsnR3bh1EBHc546zzPpFbiU=; b=hnhj1vnZyZ9/qbdNoCLXb+/4UIHSYdAfbM6KmLHbLzoKNX2DCtcyY/jiSfyhc5F6w5 ZjqYUi9hBERmjvwZFdj+lURcLyASqFbhDIyblXRPi+OL0LKUn+4AJzA2uBqfMUSJAAYm Clx8+gnPHs4XcP4AfPpD81jysrfhUEMeiCM/98fGrnrB2vT5NRB7kZhO1nBIQzkHN1o9 sYmwi5qR6gcfnaMt7Bj6AeIzZ2FC7iIBl5vouchvwhTpbvXZeLJxYjFMWCTtjNTqYxqF Q+7s9/JOtXvazKH/18LkgydtEYcqYnFK96RxQQVSTBi06Ug+c3by3JVpfn3q4OZzdVj0 Pfpw== X-Gm-Message-State: AOAM530myPyr9WLJzewx+rN3BrEGUxTTDpfqZt1FnsVWVormFhCj3E1H /NvaMj6W1/5DU0mHKlZSC/U= X-Google-Smtp-Source: ABdhPJz0Ifgs694Lr7lE65X7ZFHXH3p5AcKAwElxNzWF/0oSucA9XkoQjob8X7gM/LL5A3TtuEDUxA== X-Received: by 2002:a1c:27c5:: with SMTP id n188mr12575469wmn.126.1629648610344; Sun, 22 Aug 2021 09:10:10 -0700 (PDT) Received: from localhost.localdomain (10.red-83-57-27.dynamicip.rima-tde.net. [83.57.27.10]) by smtp.gmail.com with ESMTPSA id y11sm14861976wru.0.2021.08.22.09.10.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Aug 2021 09:10:09 -0700 (PDT) From: Sergio Paracuellos To: tsbogend@alpha.franken.de Cc: bhelgaas@google.com, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] staging: mt7621-pci: set end limit for 'ioport_resource' Date: Sun, 22 Aug 2021 18:10:05 +0200 Message-Id: <20210822161005.22467-4-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210822161005.22467-1-sergio.paracuellos@gmail.com> References: <20210822161005.22467-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org We have increase IO_SPACE_LIMIT for ralink platform to get PCI IO resources properly handled using PCI core APIs. To align those changes with driver code we have to set 'ioport_resource' end limit to IO_SPACE_LIMIT to avoid errors. Signed-off-by: Sergio Paracuellos Acked-by: Greg Kroah-Hartman --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index 691030e1a5ed..6301397c3987 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -522,6 +522,8 @@ static int mt7621_pci_probe(struct platform_device *pdev) if (!dev->of_node) return -ENODEV; + ioport_resource.end = IO_SPACE_LIMIT; + bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); if (!bridge) return -ENOMEM;