From patchwork Sat Aug 7 07:24:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12424201 X-Patchwork-Delegate: bhelgaas@google.com 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.8 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 717C5C432BE for ; Sat, 7 Aug 2021 07:24:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F790610E7 for ; Sat, 7 Aug 2021 07:24:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231467AbhHGHYg (ORCPT ); Sat, 7 Aug 2021 03:24:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231440AbhHGHYg (ORCPT ); Sat, 7 Aug 2021 03:24:36 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35BD6C0613D3; Sat, 7 Aug 2021 00:24:14 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id c16so13966164wrp.13; Sat, 07 Aug 2021 00:24:14 -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=kOfa29VAz1NlQekE8P7/3E01ehCcTCDdZpc8rzXu9+8=; b=TGhhO0/U6iy8CTCCnuKpidFV3bVAKGjyFHC08l2wtYLPab/r+yk5oD6fGhXCHbLxd2 K2mn2qSorYg4FB7W+sJa00dDlVJOmNvoXX2o9BtaigdrFSWBPnInrQEPNkC9CWXmxyf5 eXNYN2U3yR/rtSJwa4swc8BmqYcThmrXA0xaw60tFy3Gm4dqy4Y7nZe7mqLwTowW/ieB DDSQwdVNPQvRSMZPIwKUd+Fh4uz+GnBK279vVNfniD6CpE7jBghKmazPZyUtH2nBckTr nHoRNxAXvDt6Co/QwN8BChk/ahEMkys+pzqjE0KNphbfblh/lqUDOUocZ3MSd+10wcqr VsRA== 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=kOfa29VAz1NlQekE8P7/3E01ehCcTCDdZpc8rzXu9+8=; b=bJ/9TaA5+Pule6+C0jIGdp9vYufaBqbPAbudFciD3m1dEbwdXJ+EFBrQ+r7lI4yQhG UFwHUmOESaDQit85sRYgDdu68Z8+u9Knwpwks/rYY0cZT8ynr/3vrFMEG2R5es9Ot86c VqKmT7P6rT90uA+3QB5/7FA3x2Kf4W76kTwvdFHyj/KOG2iSVNd8CBi9jQOzc8fIqVz/ PBfxkDz/+me/nAvmJaOEzD8JyKEnSALBwldsmnz0rA/XrqKEzPGYoHWhhur+9ut5yG2k 9PzWj8wNzsYf30HFsrQ7hqlh1NtcR4pBn60KhjoQi6tYkIS7UJC6JSf/1Sg8C2eWNgev MY7g== X-Gm-Message-State: AOAM5308s4uUa/lP+6h5vf9aP5wVxCdfyw5pLyz8XDCc2xCc3JOJb5AB xcBObRNiT45WYx9etbbvhPE= X-Google-Smtp-Source: ABdhPJysQAP0lK1qriodegnx5Hj0BurpjgKvd5yHBxHmXA0OugHLV7iTq7mxtI17CdFLqvJKir5NSw== X-Received: by 2002:adf:f383:: with SMTP id m3mr14107000wro.81.1628321052848; Sat, 07 Aug 2021 00:24:12 -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 g5sm13915017wmh.31.2021.08.07.00.24.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Aug 2021 00:24:12 -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 1/3] MIPS: ralink: don't define PC_IOBASE but increase IO_SPACE_LIMIT Date: Sat, 7 Aug 2021 09:24:07 +0200 Message-Id: <20210807072409.9018-2-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210807072409.9018-1-sergio.paracuellos@gmail.com> References: <20210807072409.9018-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@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 --- 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 Sat Aug 7 07:24:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12424203 X-Patchwork-Delegate: bhelgaas@google.com 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.8 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 83409C4320E for ; Sat, 7 Aug 2021 07:24:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62DD161163 for ; Sat, 7 Aug 2021 07:24:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231490AbhHGHYi (ORCPT ); Sat, 7 Aug 2021 03:24:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231317AbhHGHYg (ORCPT ); Sat, 7 Aug 2021 03:24:36 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39306C061798; Sat, 7 Aug 2021 00:24:15 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id m12so13975924wru.12; Sat, 07 Aug 2021 00:24:15 -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=yZpnRUE7Yphc08hk+DfeofGWDUldN9X75Xfsn9wH+PI=; b=tkuh9GwkNrziaUJcWCPMGArRfZFREuWJscQeOTFC2VdmpunXRGLccsjRmViIBy650D XOSRbSFpHjBi1x7WtDfb5P7qDUb2wGkF8j+qGWPQtLt6AO6MJfcvrt/V7gFgQEptTXny 5gZ/du1j83vMH0O0lOuFx+Lf1+637JAathlRJg5WAhcnODdpH/IJ2OJbzr+ugsOxRcl3 yds2YIZ2pcI9MDGv4P34nztU/dJzZQ9k7bl4NigCYMIv09yjsSjzCDRZdIfJ9pcnjXzh Sf9XsaSZRWU0LsMFNXNPtS5cBlCpNll9okhgIy2wsVVYhxBtaxMH/CRcYtA+quhKE/Wm JlNg== 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=yZpnRUE7Yphc08hk+DfeofGWDUldN9X75Xfsn9wH+PI=; b=CXvxrLAGij+rD5S03btpDJfSr4Q5vKXCPWd3l9EXk9jXlEWB0RwGwrC6BYhSYt49AI Gdnyeniz7VDtDsELpY3tnKdB35IUlVKwBBFiV3LIq9EOTNTZD/n+6wyP7e9lNDcYzk7K pKy61a3ixfHwlW1uBhGm3ZKlVowHgzkmJ6x+xY+NnTRe/7eREvs8ujYh6NXUXt+84FWv y1jkVMkZFRk8vGf9j1mIkHEIXbd7rCaN2lPdcnSsYPONY1nTFSc7QTgw2IpAml8zA4gS ooJg5L40j615XlqgkwIWGfchMaqwI8OjkhJZHhDvjv2S981j6qASluWPpBOVjnzV8nl0 dGbQ== X-Gm-Message-State: AOAM532sHDRPxcdd14L3zo4Nomi+2CTYF6HAQ0gjshKNoPHPYwVqGSad aesQPvIzUF3QB42pqGK50/A= X-Google-Smtp-Source: ABdhPJzKUcb0GlM7+05lEwrA4+pLfbrxh+7eaDz8GgEdAS/28Q2qBHVfYajgOFmAupBXq5171WCmew== X-Received: by 2002:adf:f88c:: with SMTP id u12mr14596257wrp.144.1628321053823; Sat, 07 Aug 2021 00:24:13 -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 g5sm13915017wmh.31.2021.08.07.00.24.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Aug 2021 00:24:13 -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 2/3] PCI: of: avoid 'devm_pci_remap_iospace' if PCI_IOBASE is not defined Date: Sat, 7 Aug 2021 09:24:08 +0200 Message-Id: <20210807072409.9018-3-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210807072409.9018-1-sergio.paracuellos@gmail.com> References: <20210807072409.9018-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Defining PCI_IOBASE for MIPS ralink in expected addresses results in PCI IO resources being assigned 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. To allow MIPS PCI drivers to properly use the PCI generic core we need to increase IO_SPACE_LIMIT since IO addresses are in addresses higher that 0xffff. We also need to avoid the call 'devm_pci_remap_iospace' when 'pci_parse_request_of_pci_ranges' is called to avoid the following problem: ------------[ 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] Hence don't call 'devm_pci_remap_iospace' if PCI_IOBASE is not defined to get a working PCI core APIs for MIPS ralink platforms. Signed-off-by: Sergio Paracuellos --- drivers/pci/of.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index a143b02b2dcd..657aef39bf63 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -564,12 +564,14 @@ static int pci_parse_request_of_pci_ranges(struct device *dev, switch (resource_type(res)) { case IORESOURCE_IO: +#ifdef PCI_IOBASE err = devm_pci_remap_iospace(dev, res, iobase); if (err) { dev_warn(dev, "error %d: failed to map resource %pR\n", err, res); resource_list_destroy_entry(win); } +#endif break; case IORESOURCE_MEM: res_valid |= !(res->flags & IORESOURCE_PREFETCH); From patchwork Sat Aug 7 07:24:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12424205 X-Patchwork-Delegate: bhelgaas@google.com 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.8 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 F40C8C432BE for ; Sat, 7 Aug 2021 07:24:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8EAF610E7 for ; Sat, 7 Aug 2021 07:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231531AbhHGHYj (ORCPT ); Sat, 7 Aug 2021 03:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231375AbhHGHYg (ORCPT ); Sat, 7 Aug 2021 03:24:36 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43AFAC061799; Sat, 7 Aug 2021 00:24:16 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id h14so13955479wrx.10; Sat, 07 Aug 2021 00:24:16 -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=sZLLxwEWV9J5yunhWg5//rALHj1gZZePQ7WsHujX4g9G03lxTND/mt4PkF5sMPYH+Q hrgWKrSW1DcTIfVsl9klcZlPu6SEvoffobF9yNgm6Irnj44wOP42jOqSb5bPnac+BZnN IRjOIDOKn71LkpnDNl0UW224yDmIxUMxp6xzQ2027jrwrKGbknmOXkMmXHM1qDQ5e6f6 Rhc/XiJO1j6Ftsx+WQU6RG9WcVRJZ9xnPcOW09YrDiKXmYjDr/Z6QswQVVjs1k2Vhs4n ttQMkVrb1tTGHBJENXW4N1QwKjQ0uRedyOxjyFohwu5uoxsFKLQ/rTIpceY8vFlM/ch+ pi/w== 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=Hi0MAPTk7bO2IZK8YeGzVSuVjTTMFTPRa+0KMbJq+cvnHqoXCbz8mXpFOuib6amN+j d+X5IHH8UQmbs3WPrAILYfzfk5gHNm2sNheiPzkekdLtZ9/2E5RRvMe3BhyBASML7QED 91pi7vUycVQeHt4BgzwK+LNhOzTGpULE8kThOByPjHbqOa5cjyJoENOr3oGPj//ycoom ZjSdR6rAWv0pW7C/u6MPJJ7+N6QT4octdYoQDHyPNqbm9d481ca8UwxdUxuGm3OKdg8G oZ0XkUkdsAiAey3FOMLbGZ2Ysvp0RoTq54kVQvQ7ZlWcR8zSEoi/QNoVzp8dZRQRtuQi i8gA== X-Gm-Message-State: AOAM530K7DRAKXZZJ4aV0KTVjm0/ZPOa9+32bHLL1k9eqAcLraAYremk NJXinMWze+zE1eBYiZdYpGc= X-Google-Smtp-Source: ABdhPJwNGEq+ZFP/ntg1NMH8/P4Ab2bebvv/2QrPdAwubsH8gqoIAFfnziwWMZ31+U5xcL5/IR4Xtw== X-Received: by 2002:a5d:5147:: with SMTP id u7mr14634265wrt.181.1628321054751; Sat, 07 Aug 2021 00:24:14 -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 g5sm13915017wmh.31.2021.08.07.00.24.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Aug 2021 00:24:14 -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 3/3] staging: mt7621-pci: set end limit for 'ioport_resource' Date: Sat, 7 Aug 2021 09:24:09 +0200 Message-Id: <20210807072409.9018-4-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210807072409.9018-1-sergio.paracuellos@gmail.com> References: <20210807072409.9018-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@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 --- 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;