From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44680206062 for ; Wed, 16 Oct 2024 09:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072166; cv=none; b=EpZwjnInbkCQZ43z+3n07Y4SiDygbIuYuvMtho3bYbJimU7hIyOWCI5aNNGM8Lkpf1EQJ+jAaASyRLj5ucVZQDA3gjjRlJZSMX3Vm3YfwSpE3bi63uSEo0ob3IoST2/GDRE7TtvUZzN2Jni2j+TU+MYkIKeu0XGxT4CjcDYM2AI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072166; c=relaxed/simple; bh=tJu5U2oC9OD6rR3Vcl19luaP+UNIfavq6ySX6Ao35wc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LTy757RepaIG3xl3U5cE6Vsa6rhzD5gXzRJ943xqdiGNtBl+nua6i1bVW7E2l5Ux4X4D+gVFEOs80IEmgXrpJzOYX3d3o+B8xqSSomP5WTW0SMlvflxKgKcGEPfA5AMuBG3kAbVTJYs8m7cvR0OfriljnfhtWu/jPmATcZCngOs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=TGFHXAoJ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TGFHXAoJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729072163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZnMvQjSP3jZBMFekrBQlY/hq8+zQym4SrGgl7pIccig=; b=TGFHXAoJsR2TsOQQQWjwAIPIZRb7S8R5vIBhCxCLw/YvNbNqc4bIWrtj6zGlQ5LtMVdHyw kreU/yxw+Gn0HESIDtyUN5TBh9WXWj2jmxE9FqcTAC3r/AyeLPng0jm0/V9UilJMHr8Ok0 YOFqcJw8CAq25+Is3mttrAOgAPR+aSk= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-439-tlGd7iL6PJSjTDwcnlM1aQ-1; Wed, 16 Oct 2024 05:49:20 -0400 X-MC-Unique: tlGd7iL6PJSjTDwcnlM1aQ-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-431248c438eso3971285e9.0 for ; Wed, 16 Oct 2024 02:49:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729072159; x=1729676959; 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=ZnMvQjSP3jZBMFekrBQlY/hq8+zQym4SrGgl7pIccig=; b=bFBkBVBe9yWyk31MeljjeKAxBUXCn1N5NqifPaYdT3yNAv5U0VoZXVzaVKSdlLppKo +ovxPUtha2djwFVwYVh2kjgEzontt+IZkiZ9UF6o4GG4vwqJD+HbEl1zgXZZgXr8gbtP tnt9rQ6mhZmJB5SNTzN9NjcBEcW7rWcyw0FMKTTL14Ua0GisAnw2oo6V38WoOX1eiBdc xJnzQxkB70Xg1q3bUE3XlRgm8ZfnegIBIiWvQPqd4VW8ApHyzIcoKPk6C2/HAIOj5B9D +0lj/b3gZ+L//aBSH36a8tZCOFxd9My5fIVzlRHwjnGv4s8x/0qdCVF4u/dOwjNeilbI mh3Q== X-Forwarded-Encrypted: i=1; AJvYcCU3qyGxG+whvGEuJ3Ji4PmMXUOuulBLske3zIznb9rDlHwL3VZrYVhkOGRUUtrnggrP3v0Nil4=@vger.kernel.org X-Gm-Message-State: AOJu0YxajwmLEfVHsrzYHNt8tRxzyIcVYZCGIkfQkcipyUbFqTv2z6AC cbbOy+jzU49vj0ifj7RQ2lR09gMJsZkYYBumsWLsHicwK9r88FWzM+rrWIQfP7v6C61vd+bdZfO ckyIFkcudhKl/EwaFKD7udZhCF/nxVaAQQrxGmC4+rywkmonnqzKD4A== X-Received: by 2002:a05:600c:54cc:b0:431:52da:9d89 with SMTP id 5b1f17b1804b1-43152daa0ecmr7721085e9.1.1729072159444; Wed, 16 Oct 2024 02:49:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfsAAAGgUBJ0f9Xs7hYUhseqFHC1b9z96yM3vsvYHHD2153BJru4vUCPyjdhRiv6k6fxkIdQ== X-Received: by 2002:a05:600c:54cc:b0:431:52da:9d89 with SMTP id 5b1f17b1804b1-43152daa0ecmr7720745e9.1.1729072159038; Wed, 16 Oct 2024 02:49:19 -0700 (PDT) Received: from eisenberg.muc.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4314b32e487sm28190235e9.25.2024.10.16.02.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 02:49:18 -0700 (PDT) From: Philipp Stanner To: 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 , Bjorn Helgaas , Richard Cochran , Damien Le Moal , Hannes Reinecke , Philipp Stanner , Chaitanya Kulkarni , Al Viro , Li Zetao Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v8 1/6] PCI: Make pcim_iounmap_region() a public function Date: Wed, 16 Oct 2024 11:49:04 +0200 Message-ID: <20241016094911.24818-3-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241016094911.24818-2-pstanner@redhat.com> References: <20241016094911.24818-2-pstanner@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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()"). pcim_iounmap_region() does not have that problem. Make it public as the successor of pcim_iounmap_regions(). Signed-off-by: Philipp Stanner --- 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 b133967faef8..7b12e2a3469c 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -773,7 +773,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; @@ -784,6 +784,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 573b4c4c2be6..c4221aca20f9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2296,6 +2296,7 @@ static inline void pci_fixup_device(enum pci_fixup_pass pass, void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar, const char *name); +void pcim_iounmap_region(struct pci_dev *pdev, int bar); void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); int pcim_request_region(struct pci_dev *pdev, int bar, const char *name); -- 2.47.0