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: 13768712 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 2D8B0C3DA4A for ; Mon, 19 Aug 2024 17:00:33 +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=NwxbMRfa8A0AMonhiodSZXz8snc1ppjCUOJ6oxZMysE=; b=3F70BlQe1FQm1ddEpP7tLqKxE3 esnyMa6cs8qtXCI5TAhdXyiMJ1Owm3Qh+xz3gV/O13zizbMAN7cE1Wi2WBGRvfFDXGF3Iv8CllJLI 2ViLqCwqG6dRQCiT29yNTAgasQTKhpYeoB/dtS6ZngvXmX2wAWGdqYpMY9d5AKcolLwTTXT3GdG6j t9y/XtD8Q4tJaRDXmsMBx/jFYM4RHD1g/o6t7YDcQ5LjEJJ4KpbQ6GKSg20P7WdV8HYbOlawUEqd0 64paNKjU9qqSzGPI8bY5xUq70Ake48eNRGuL1LzTzQAcbB0AkVcA/bNvRO2qPaN+mAmFDASdUlFGZ U3OeddGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5jw-00000002I41-38Om; Mon, 19 Aug 2024 17:00:20 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5ce-00000002Fbw-3J9j for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Aug 2024 16:52:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=NwxbMRfa8A0AMonhiodSZXz8snc1ppjCUOJ6oxZMysE=; b=oK2bI8o8vm/KlWqUuyzXuqi0ZR 9uQE9SUh/DSaxxtHXlZuazY4a4UyQPRF26PKmpJ1wSsuR9kc3FI6fc+8yLUoUhqgJMTVgGhEYoZOM VVFFc5qifadmXtqAEe9S++Ptq0tZTJZFNOLWRHtlkZ+Tqh0+Ubzx10NylYQNk2yOI3w9OEdeAp/KK cbFVwZhL4R1Zdc1MyFYutj8ER+7fq7T0owxCrt5kqwYeBzrz2BTTJWj1r9ZZQXLn/mQXraOcd352/ a8E/fpTRHNr+remQJ/WLEvSFmaQPvSERn+qm16oPO32nQJAg67CBfCQZjddnZfRWi+faGbL5sOKoJ +ySIUEQA==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5ca-00000009AuH-3rRe for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2024 16:52:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724086357; 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=NwxbMRfa8A0AMonhiodSZXz8snc1ppjCUOJ6oxZMysE=; b=AJiUOVWzj1XGIRu+4UsoXR5O7MpVsv18d6TnYjP9YxUhwSwb6NaV5w3lXJeSo7Es01cTwW NyqoFRB89o7z0QWesxIdY3CJBAmQC8L4BpVtZfvDGJn/LirlmbUsPp4Z9/nZuQ6LhJObAu L85sBvB8GqXaSoR5WIpgczsKEX0co2w= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724086364; 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=NwxbMRfa8A0AMonhiodSZXz8snc1ppjCUOJ6oxZMysE=; b=KrZsJim5+BYDIcyKlhnjqcwKCG9Tgc+fzdG/FAZScseHkTd5/C6Ykekp7akv1UvMK9l49N fY5IPK6L5Kncx8S1M6i7uK+7tnH6MgqqR5RvNbcCbFGWK23Ky8vWL+jvgX2mxxI9xN10RN VaGh9lNlmql+sMtxrD0F7GGy/TW7+Ds= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-422-ichCu8pGMtyNkxJxYDuGuA-1; Mon, 19 Aug 2024 12:52:36 -0400 X-MC-Unique: ichCu8pGMtyNkxJxYDuGuA-1 Received: by mail-ua1-f72.google.com with SMTP id a1e0cc1a2514c-842f65a51e9so91512241.1 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=HeUGb2vZi8zGHF2jRrtvHXQXFHO7HcEUPM4Jr0AZy1L73KMWbtiSU9uqtHO4rQSN7/ /Y0qM4ah38o4AWb2UAVGS4/7Hk8u+vrNI0MVfEhwvLC9UQA3NTcZ45yaBRzVpI8oDSPl 3eyS7A4Zby+XuVE7/hNfOH05rEgchxmLKogt6lBLGDKBuJ5vUPRyqAAA4A0N7v7rp00g ebEw5J5G0UvJc1mWF/gElkXk9D1OTEbCSeKfO8J4c5z3wzShbOAiIIlfZG0ZOph4vKB1 pHGynFQjGlHOBFKNP/Tgziy+u+evz+XUSGTV/ADgZLX3c+CzBBCPDxc9dYc09gZw+DxV 61FQ== X-Forwarded-Encrypted: i=1; AJvYcCWgw71W7j/AR9sovLnJkPCFop0wjQP9SM9PSbEWqAszM+uY2+xb6j6+puz0rUSpaHa5yajxy4LV8DraGLv4YmeMH9pbRGmm0F2eNlHHEXY/BsXmw8E= X-Gm-Message-State: AOJu0YzwxwdodT2QZKHgnBRy9NeCEHVbtowB3ml3ytnsRKJ8y6RN2ju1 hg6IhOTX/7T9X3G+LjKO08VDG2s/o5QVb7oao4in9EYBIGoVGT7ZgMx6aLcS9zAupWIo8bssM6n REKtWD5Xu2GP8EhUhooieCqtk0VWKg/jPwmUpcyMDve0p8lvgoT2RIjiiOB8u6Z/WuzAAXcxF X-Received: by 2002:a05:6102:5494:b0:495:c40b:f7ca with SMTP id ada2fe7eead31-4977bf0d2d4mr5497593137.3.1724086355211; 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> 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-20240819_175245_204710_69CD0575 X-CRM114-Status: GOOD ( 14.07 ) 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 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);