From patchwork Wed Aug 21 07:18:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13770942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B9AC9C52D6F for ; Wed, 21 Aug 2024 07:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6ch4IaqQVqf4n7EviAoZPVdER6FOrpbjt4F1+Z0pU5Q=; b=q/RKJ2vwoYc1L35BRbC8z4eejK q64pT5T7Zn4I4UY+j0xG2qpcUCn+1wUuIjLhA6XL6FgmawD8gW6jACbmznDkPCN4OgGS5wSS9p4NI 4R8QarIkVaTht0zjzu83+PTH/4yah0XVAtLGZ6ZXRKgOaAbq2SCLnJImhIjbIZxCgG1ztLCVkMdTu 9tWDwE/yckqbwt5mZG26uYQqMzTcX7OfBLfWE0e1SNL6m1zN+sUKMjee7BwtgmCBKcIwwTWnqYRJm q60uwkhMmYCpxurJgzkdr+yGUQ4RDb4IMRYsoUOfaAsKILdTynmdqeE5bbNivmMe92/ycSh35FUsz jWZQdOeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgfdv-00000007s83-14fk; Wed, 21 Aug 2024 07:20:31 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgfca-00000007rdH-1P6p for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2024 07:19:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724224746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6ch4IaqQVqf4n7EviAoZPVdER6FOrpbjt4F1+Z0pU5Q=; b=MpJMEIDtLQyxYgV1JExAICcmJSXmQj6MKGhgENSGFMlZxDoXGUKKt33XbqH0x9YtE3j3Ex VEV/y7gGJbB/SQ68EwoMaoQLDuzVidzJ0tf3nKINu9c7if0PVFMNq3YZsNLMV0hCx5pTFK 2ojgkwH3NmDx7/wcPmtaKL+N6d6b4S4= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-144-nr79jus3MyK7D0nXPpge7g-1; Wed, 21 Aug 2024 03:19:05 -0400 X-MC-Unique: nr79jus3MyK7D0nXPpge7g-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-44ff5210422so8219291cf.1 for ; Wed, 21 Aug 2024 00:19:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724224745; x=1724829545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6ch4IaqQVqf4n7EviAoZPVdER6FOrpbjt4F1+Z0pU5Q=; b=lmU66VXXqaoq4KjGdXx53G9bpIAES6EYIgNoIf8E/wDEYPOy5CIuKvzu6cQX7HsZ/l nf9pyQIXewJiE1WBlCW1MMTiF1pneRnbf4uol3ZTkb4op2Y3jzXMEXtpEcdTHooels7z aF3DhAK5pVNvn75M6OiA83t4gJ/6Gdkd/cvDhSDNJOWFjCTqcTbQ2LlGOFqrj4MtxleF tE+5XGRt5uTLIq25B/0UCpufZemMkel6C30DO7PKUfB5AcPIGHpQfjcxjTk0n1KkzirX QQzpB9Op6+/dI5AbfnUfB3jw7cQalCGkk9juiSUThHHnotpPj8PfC+swt68kehUYrp0G EzjQ== X-Forwarded-Encrypted: i=1; AJvYcCUfzpSJ4RjDcxQLWkAM+KU/Fed9XXwwVMoEWSGviRqeIOiXeNCFgAvRigU/+FkAW2e3BbpyTD8EPtlgreAjaKUh@lists.infradead.org X-Gm-Message-State: AOJu0YxPPP+ELXeIB8vhncM1YhoQ47UK/uWjSRQ4W+oFtgnbI8xYXbiL UhEu+XZyLXAy2pyBvaVXVKXS/+o0dmj8AC5D6+7NQHaXYJeQtWgv9fT0gQ6iJxosmYjFs0hiFJe aVVudTpOU+qlRuqh4HSkC+fMgFXp8QgFIR7LBT8t6h8QJab2R3HIgGw/eJfruxLuZF051fJgD X-Received: by 2002:a05:620a:28d2:b0:79e:fec7:d6e9 with SMTP id af79cd13be357-7a6753141cfmr220359985a.32.1724224744796; Wed, 21 Aug 2024 00:19:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVEMCIqqzymRUElFBuqPlu9emFwxQQrGNHV6b0BSUinl1kKKpb11Nr3ppWIzVNMM5PBVDB+w== X-Received: by 2002:a05:620a:28d2:b0:79e:fec7:d6e9 with SMTP id af79cd13be357-7a6753141cfmr220355985a.32.1724224744387; Wed, 21 Aug 2024 00:19:04 -0700 (PDT) Received: from eisenberg.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a4ff013ef2sm596207885a.11.2024.08.21.00.18.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 00:19:04 -0700 (PDT) From: Philipp Stanner To: Jonathan Corbet , Jens Axboe , Wu Hao , Tom Rix , Moritz Fischer , Xu Yilun , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Bjorn Helgaas , Alvaro Karsz , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?utf-8?q?Eugenio_P=C3=A9rez?= , Richard Cochran , Mark Brown , David Lechner , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Philipp Stanner , Damien Le Moal , Hannes Reinecke , Keith Busch Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fpga@vger.kernel.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, virtualization@lists.linux.dev Subject: [PATCH v2 1/9] PCI: Make pcim_iounmap_region() a public function Date: Wed, 21 Aug 2024 09:18:34 +0200 Message-ID: <20240821071842.8591-3-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240821071842.8591-2-pstanner@redhat.com> References: <20240821071842.8591-2-pstanner@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_001908_465034_D00768D5 X-CRM114-Status: GOOD ( 14.48 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The function pcim_iounmap_regions() is problematic because it uses a bitmask mechanism to release / iounmap multiple BARs at once. It, thus, prevents getting rid of the problematic iomap table mechanism which was deprecated in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Make pcim_iounmap_region() public as the successor of pcim_iounmap_regions(). Signed-off-by: Philipp Stanner Reviewed-by: Damien Le Moal --- drivers/pci/devres.c | 3 ++- include/linux/pci.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index b97589e99fad..4dbba385e6b4 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -771,7 +771,7 @@ EXPORT_SYMBOL(pcim_iomap_region); * Unmap a BAR and release its region manually. Only pass BARs that were * previously mapped by pcim_iomap_region(). */ -static void pcim_iounmap_region(struct pci_dev *pdev, int bar) +void pcim_iounmap_region(struct pci_dev *pdev, int bar) { struct pcim_addr_devres res_searched; @@ -782,6 +782,7 @@ static void pcim_iounmap_region(struct pci_dev *pdev, int bar) devres_release(&pdev->dev, pcim_addr_resource_release, pcim_addr_resources_match, &res_searched); } +EXPORT_SYMBOL(pcim_iounmap_region); /** * pcim_iomap_regions - Request and iomap PCI BARs (DEPRECATED) diff --git a/include/linux/pci.h b/include/linux/pci.h index 01b9f1a351be..9625d8a7b655 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2297,6 +2297,7 @@ void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); int pcim_request_region(struct pci_dev *pdev, int bar, const char *name); void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar, const char *name); +void pcim_iounmap_region(struct pci_dev *pdev, int bar); int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name); int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask, const char *name);