From patchwork Mon Aug 19 16:51:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 1973905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UnoufWE/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:4601:e00::3; helo=am.mirrors.kernel.org; envelope-from=linux-pci+bounces-11816-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wndvl6sC4z1yfj for ; Tue, 20 Aug 2024 02:53:23 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8D3FA1F22E72 for ; Mon, 19 Aug 2024 16:53:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BEFE3187FF9; Mon, 19 Aug 2024 16:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UnoufWE/" X-Original-To: linux-pci@vger.kernel.org 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 39EEE187871 for ; Mon, 19 Aug 2024 16:52:38 +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=1724086360; cv=none; b=qbMLODhQMH8fpba2T+WIeXTY3b/28IWQIevGRpKSrqftR03s/TZpvHcHvVNeeHgU1CMDSFSMsoX56RGYD/sa5xBOJQopG/0Gujt9hfDh8xWoylgWweUN5Awsvol33Du4ll5MMRrYYW0Sx3QciWzKEbO41foDxj7cbMeMIJNCUGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724086360; c=relaxed/simple; bh=kHKzvvyyQCeBkpz1OciLUTykSAMmzD8brX9rJ76+fHY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EZo3dFn8ATN9jZrS6Oa3m0kI7H+BZG1yC53Ej5m3kD6hKIyMHCRCnBX3cBIMX20CFpFeMrjoUJ8D1ecJf0F6gxqk+BsOTjk6UdQ5r5MJgH3OwXXntsAPkAuwgMBbY9h5jpmdJnob5MJhFwumGBVdMi/H90BVUWFDMAQr5Xc3xcQ= 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=UnoufWE/; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724086358; 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=NwxbMRfa8A0AMonhiodSZXz8snc1ppjCUOJ6oxZMysE=; b=UnoufWE/RMXmczTYTxVtUKbiieZfpWNXHSrBMPSabPdytzx6xv/BXn/Aj5m4n9B2vNw+Q4 AztU6O3OdyLoTV3bf+M7TTsImXn5+gHPKyxKdVbdnKKFA7a6w18idtZunTn8y96GypXnke r5CAYsjs2Wp78G+EzRp5TXyANEcMIH8= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-489-BGYeMSFhM4-iahaOwSx8cA-1; Mon, 19 Aug 2024 12:52:36 -0400 X-MC-Unique: BGYeMSFhM4-iahaOwSx8cA-1 Received: by mail-ua1-f69.google.com with SMTP id a1e0cc1a2514c-84303cc34bdso77910241.3 for ; Mon, 19 Aug 2024 09:52:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724086355; x=1724691155; 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=NwxbMRfa8A0AMonhiodSZXz8snc1ppjCUOJ6oxZMysE=; b=qLe9GlSm8qGj1EOhG8uM56EmHDnLE0hD80L5uAja/8ZD1uUo9cSb7NLD1nG0u8ylB2 CiX533XJQ2Ry11Z7bVQ9wyigYwKayrkKXOPoGu8Ix4TSE9MWI2pfN35vEW/iAi670Peb m6yGT93x3tCPgVJ5MrABXQ22rmmtY8oK4d1N8wmUoopgmTtMYzQTIFMdxbEpWDBrUMjq v1hKcAueAKSthB/vkBGHUiSvXQ680TnwqkS6GgC89Ven90o6SoX74czdHSE4GW7Dy7Ua p1WHIqlX/lCfUVVXUvL5lqAKMCRFGfNRLoWfsIKIHJyWIAsWzLNRCP2kiEOODtOjgGqx qCUA== X-Forwarded-Encrypted: i=1; AJvYcCULerhave+Py0h8M7Dvf/yWhQMTXe+0u7xzOVnOJhQHMy27LeQx7il8xRu2GKOlq/MXan/XFb6JtVZsJcTlC0ktSAkT0qSmfKOL X-Gm-Message-State: AOJu0YzsXCC1fMa/7SMmFYehZwT15nBHJOT9K1Vgj+CIL2ol9tRAjzIt J37vjBdLZI9SeQVIOpb3516jP11v5wltErYxWHU9cC8AlK8YecSfu2QuD8E2J1OVayjfMcGZ1iG 1lqKQS3ZvPP9+wWFxMs34YeHQZ9Unb5ffAnwj465IRhvu9DxD1hGKfonuAw== X-Received: by 2002:a05:6102:5494:b0:495:c40b:f7ca with SMTP id ada2fe7eead31-4977bf0d2d4mr5497621137.3.1724086355226; Mon, 19 Aug 2024 09:52:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHysbKKqXtZq0nkk+KqqjyQL404GAu1sdBPta+GD7btYSYi5SLJQ3pijiCStxEYNXypkns3Gw== X-Received: by 2002:a05:6102:5494:b0:495:c40b:f7ca with SMTP id ada2fe7eead31-4977bf0d2d4mr5497574137.3.1724086354811; Mon, 19 Aug 2024 09:52:34 -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 af79cd13be357-7a4ff01e293sm446579885a.26.2024.08.19.09.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 09:52:34 -0700 (PDT) From: Philipp Stanner To: onathan 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?= , Jonathan Cameron , Philipp Stanner , Hannes Reinecke , Damien Le Moal , Chaitanya Kulkarni , "Martin K. Petersen" 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 1/9] PCI: Make pcim_release_region() a public function Date: Mon, 19 Aug 2024 18:51:41 +0200 Message-ID: <20240819165148.58201-3-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240819165148.58201-2-pstanner@redhat.com> References: <20240819165148.58201-2-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 pcim_release_region() is the managed counterpart of pci_release_region(). It can be useful in some cases where drivers want to manually release a requested region before the driver's remove() callback is invoked. Make pcim_release_region() a public function. Signed-off-by: Philipp Stanner Reviewed-by: Damien Le Moal --- drivers/pci/devres.c | 1 + drivers/pci/pci.h | 1 - include/linux/pci.h | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index b97589e99fad..608f13ef2a4b 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -906,6 +906,7 @@ void pcim_release_region(struct pci_dev *pdev, int bar) devres_release(&pdev->dev, pcim_addr_resource_release, pcim_addr_resources_match, &res_searched); } +EXPORT_SYMBOL(pcim_release_region); /** diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 2fe6055a334d..01b55ed2867c 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -889,7 +889,6 @@ static inline pci_power_t mid_pci_get_power_state(struct pci_dev *pdev) int pcim_intx(struct pci_dev *dev, int enable); int pcim_request_region_exclusive(struct pci_dev *pdev, int bar, const char *name); -void pcim_release_region(struct pci_dev *pdev, int bar); /* * Config Address for PCI Configuration Mechanism #1 diff --git a/include/linux/pci.h b/include/linux/pci.h index 01b9f1a351be..dfa9af3a9c22 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2295,6 +2295,7 @@ void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); 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); +void pcim_release_region(struct pci_dev *pdev, int bar); void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar, const char *name); int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name);