From patchwork Wed Oct 16 09:49:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13838045 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 2CB9A206065 for ; Wed, 16 Oct 2024 09:49:26 +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=1729072168; cv=none; b=SefFdcJ7kFFdQTwSnrKrPsr2noYbE+G2rjrayjlRLOsAXMFC8Dps6NqxW9C08+w4ic+y7RujF9itRG0lKnjFpOKOyWlolItYBjb7kZyGVYMq+lqRXDNVhcJG69dSZV9NzbTpbQfOOnmy9bH+6yPKUjH+OnVpppJPCOt1AJ8PAtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072168; c=relaxed/simple; bh=tJu5U2oC9OD6rR3Vcl19luaP+UNIfavq6ySX6Ao35wc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B/eHABOzFy0WmGT0g9Nx9WiCtqzy4/1rNnZ3SC8IvkFEUuVneu6m+Njlxizd2hI15pMkq6zM9B/htxkro718Rvdx6BvIMXpeFpWLo+DJ5Va+5pQmHaJerzb4PN4k5bGdR7z54fyCIPBQrlApSM3n074RvuXT9pkK1L62PQyu6Uc= 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=CYX13cgS; 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="CYX13cgS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729072165; 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=CYX13cgSEOWYEM8IJA9CtL9EF/Z5+WUocyFbbUBFwgffjzMtWJGUt1Xbs0GdcJgkHe/E/b Tipo7j2iOd5Z3gB1LlaWdRYMivsD0mzQDWgkuB08zcuNsQI9ov0cUxDurjNl0PD+amrx/9 ZRXsXvwgk6e+iEthviAxj7/VD8FREaA= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-563-cfOsL-SfMiyX41XxtBUYaw-1; Wed, 16 Oct 2024 05:49:20 -0400 X-MC-Unique: cfOsL-SfMiyX41XxtBUYaw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-431248c438eso3971275e9.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=XIR9uSWAJj95X4hiYoOFyiL3YirVsP03F60jAcT99a+EEK2fntKcggSm5ql7HMJ4pG mz5vyGuhiNATE1ww6DInogZZGM92pDQltNpbaIZdRMpOW3H9hcGx7XL8QMgAvOcp6HAP lP+mKcy3xzM2M9ENrbNrr8cjuB1LD/tfW5mW163yp+554OYK9PRQzxB/OWiYXKhSJ19r QUzm0RQhEFVvM0kwNxtUbofMKdWsgU+8zYMM7kzxS4jltZ41Aq/Cd+XH4gA8qS1sPLYJ tXjbIdKPDuSlNLexevk2sxvalntxuBhnQtFkqfuWg3ptQ+ohr8A8Rhgtbg0UQfHGow62 hsuA== X-Forwarded-Encrypted: i=1; AJvYcCWafQIEM8wSAZw1ehkF8+3uhuCkWkqlESg7hvU33p3CqwndCbvd0cc3V2wgXYAcU7SGiEVjvj4LHIRk@vger.kernel.org X-Gm-Message-State: AOJu0Yw/Ti+lEWPdn+g8jNxVyjsfeAPxFyPQgSl0yBsnZwe2whhk0lHN XgbZ+0IMYgNAyENPdvU9Xh4i7utv8XP6oU7XsT6iTC1m85Tl/X0aQYBVOd14HKDx1KSaLs2Bv4e 95nv1b6LezxduxFltFEOPPEwBY87/J4dqRZCG/dhwNIl1sz+tseNmX475MKE= X-Received: by 2002:a05:600c:54cc:b0:431:52da:9d89 with SMTP id 5b1f17b1804b1-43152daa0ecmr7721025e9.1.1729072159442; 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: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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); From patchwork Wed Oct 16 09:49:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13838048 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 3AD702071E0 for ; Wed, 16 Oct 2024 09:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072172; cv=none; b=A0d17VH8Ms1I2ji7T/EKFdfWybUK2YPbjaf35YJSrk+I0PjyJreiJsVgnyTegTPw5qHb7tgPfxxOnJpjjA4XzrvFRr/JrXHx1qPpL6rQxs2fsJPNnAqd3eQF2OTjYqOGWqyQaJ3GTuwFH9dPO8OZ1Yn5o63o3w76CvvOX1+D5ks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072172; c=relaxed/simple; bh=+7VXObVbimU6RXAVe8MLDd0WB1BZiq/LjoM6c454k1c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XgrvGj7cZPsXL0rZUWQ2ltyWjWBrp6J2Q6hCL4b1Vy1xPvUfn2q89BMM7N0IPyfSSWdF5tNk0M4WFWbykN6G1gwv5+EXfXl1VcJspfy1qdzF6YthvUtX9/oSUX0E8gQ5fI4r6TIO5NF2RnBqnJ7pzpnutSAE/lLiR/elnTM6/8U= 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=K3Qt4bSe; arc=none smtp.client-ip=170.10.133.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="K3Qt4bSe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729072169; 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=PtS5zdbiO/gsUv0EMgDDobhsGGQ7SjCkZAyLsDHRQIY=; b=K3Qt4bSeAmGh+oYPvOE03HinLJ5FhMVPVIRofuQLGx1KFMLLMlbb8T2SYJSoSDZaJ3dD22 FQm8DA20CSMqP0aQHa3J2wIYhSB7y2t8U7NFUkhns82Nmp3fGJjq0k4V47drwy7SzBO0QR qiqmvFj6rFREzPpEgqq19+IsI0ffwLY= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-438-EMMbErIXP9-JHyjaoGOrHw-1; Wed, 16 Oct 2024 05:49:22 -0400 X-MC-Unique: EMMbErIXP9-JHyjaoGOrHw-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-37d49887a2cso386592f8f.0 for ; Wed, 16 Oct 2024 02:49:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729072161; x=1729676961; 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=PtS5zdbiO/gsUv0EMgDDobhsGGQ7SjCkZAyLsDHRQIY=; b=gulbZb5wpeqQCIdTvwNMmh0hTIX38k1HUjpl/16oSCR85D/WQVrfMq+6H1j1ojwnGU PAnJzaQNqnDVBflBQ39N0hwsr1QK3jw8axlfBm3/TeKlFlAdhx6F1ZgV0YQ4NaIUkBsr JiGdp/OufE0pMMS88cffmvDocThtpzPEToNL+0zOiu4Z0JtuJZcRHVpuLltBnc+3AeWC 2weEkRiutraHNOoc3QDqY8Jwfg3dlb3S7j9dbm2XhvZZ1ZfJE4fA9N2L/G+/FLXG0ZC8 OTrm+NKhayofSKnoKoZ4wD74oOumsJsehz3FohIZkHXKhgCLjV3iu9SFqAoSaUKjbtmb GtJQ== X-Forwarded-Encrypted: i=1; AJvYcCXMznnqYn9PGRtCwbSkef/JqVwxywhPj/Yc8TbKjFO5HdmE+zbzr8QA0lsLUi+vXAfZFlTbAyXVVo3o@vger.kernel.org X-Gm-Message-State: AOJu0Yz/mJ0ogHLYMi5GLmKIPV8fhoF7WidZDy9pMcMZ2XFcJEJoHqG7 ah+/MRzu32q4iPUK/DZQCDkTFGjVGh3zn5XlpasxAMdXwCEk8C9PfMza/DlgSC08nbzAMviucUx 53Owpaf8r2w28Z2wvv53hzLlLshVWYbgq3X6GaOetUhycWZ+44e3oIcWltmQ= X-Received: by 2002:adf:f751:0:b0:37d:321e:ef0c with SMTP id ffacd0b85a97d-37d86285f99mr2815638f8f.11.1729072161039; Wed, 16 Oct 2024 02:49:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaiw/v72XpyvrLMQueXB69KM2bCaEPDc1zEe4UONM9jeIbxwKmu8+nYGsv9DDcnBz2ZvwW7g== X-Received: by 2002:adf:f751:0:b0:37d:321e:ef0c with SMTP id ffacd0b85a97d-37d86285f99mr2815611f8f.11.1729072160611; Wed, 16 Oct 2024 02:49:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 02:49:19 -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 2/6] PCI: Deprecate pcim_iounmap_regions() Date: Wed, 16 Oct 2024 11:49:05 +0200 Message-ID: <20241016094911.24818-4-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: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 pcim_ionumap_region() has recently been made a public function and does not have the disadvantage of having to deal with the legacy iomap table, as pcim_iounmap_regions() does. Deprecate pcim_iounmap_regions(). Signed-off-by: Philipp Stanner --- drivers/pci/devres.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index 7b12e2a3469c..a486bce18e0d 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -1016,11 +1016,14 @@ int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask, EXPORT_SYMBOL(pcim_iomap_regions_request_all); /** - * pcim_iounmap_regions - Unmap and release PCI BARs + * pcim_iounmap_regions - Unmap and release PCI BARs (DEPRECATED) * @pdev: PCI device to map IO resources for * @mask: Mask of BARs to unmap and release * * Unmap and release regions specified by @mask. + * + * This function is DEPRECATED. Do not use it in new code. + * Use pcim_iounmap_region() instead. */ void pcim_iounmap_regions(struct pci_dev *pdev, int mask) { From patchwork Wed Oct 16 09:49:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13838046 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 33E15206067 for ; Wed, 16 Oct 2024 09:49:27 +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=1729072169; cv=none; b=dQp7IJIdjIiRpmFjEqWImgoeS1D9Bdi3MgB5jbmjgGU5Krea82DV1V4e8JmbMH7beihu5LDETwfPy0ZGaC633WI4g9HZNXRnAFr5wB0j6XqgH0VZ+OWd1UGVREX2TEUhNyhm3/sV39T+catQqle4OIcxhMANMY2Fkl5vvQadbFY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072169; c=relaxed/simple; bh=73TDRRq/zYwVvdvTcMvRKEXzW3B5e+Rcch7EgZqO0Rk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UuMY1KmqMYxQsvHmZFhwMfEWkPLj88+eK+2F2xwnTGGL0KlxzcSfamQ5+OSPKg5f/CYhwc0fmOjRq3vLlBkE2xTv62WPHGzbCsuUPtjpQXRETNHYbHGwysRD6DwZ2/yNl3Ha0ZNqGPkoSEhNRVY/mMiocPbYMINjTgVrHbvqywQ= 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=LK6PM3M4; 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="LK6PM3M4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729072166; 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=99YHQrhHcKN4EzxQy/kG1c7OXMv2lQ3JH0aSkE1MYKM=; b=LK6PM3M4MwBe6G45KCCcqddK5j2gTJrRIj81Ap9pDZBTvFhUxr8kQAq1+TcO/xYFc2tgd9 m3XJ+sovx4HqHtIPNEnPyJld49ZUCNn/0uPCWY9BF/WSzL4U8PV90ZkbKdtNq9T31apYKI Cg4/WcifTEJMQmc4DHFHn6o6Hv3BNKs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-125-A_JnqDTXOSG-lPFyaWSyqA-1; Wed, 16 Oct 2024 05:49:24 -0400 X-MC-Unique: A_JnqDTXOSG-lPFyaWSyqA-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-43052e05c8fso42997355e9.2 for ; Wed, 16 Oct 2024 02:49:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729072163; x=1729676963; 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=99YHQrhHcKN4EzxQy/kG1c7OXMv2lQ3JH0aSkE1MYKM=; b=h64HI7ZQ7pjWNz4m2qlFiAMWw1gkaYZWWtPZsLPykGRizmV7GGl+gZdlDSNZgSirm+ B+WlMNyt6fOHShH57eGd03XFp99xT3Mftxuid6TLKtzw99zssuwloezGBbVXqsiqPdeZ v+ZXeqeYmT9F5YpJptmK3ljU0vygQ2rIS6p0zQbss3t6/XiwkrFBoWcd4khU1/ZWWHbB wzgXqNF/UfyxX5h8j0Syn5qQDWyikGGiOwd7EV4GX21RBOvF27R5W7Uz7GRESHMwWs1y Szb/9M4ULBfld2bEmLv0r8Z1glVp2UAFpv/i6WgB3QVKHBSf2gWHoEeuLwIG2NkuwQS7 uJhQ== X-Forwarded-Encrypted: i=1; AJvYcCWqOT2mG+DdAlTxCqTg92RczQwuWuV6BHfbWoLhF0F9jZE9zY9mQCdiO4E2jGVMAz7eNjspUJ+tT9A2@vger.kernel.org X-Gm-Message-State: AOJu0YyFEPb1QLOtOB8ZDvMtHqVymLM8PIY/iVJEvtKbBgvXrmdp13zB IlMmBQfnX69ULq0m3KYfwjuytVvbiw8tFrfZyyDvIWtzf27TjYp3SEhcIMh4XCyD4wv3WYUd39T fPOjviFbCwXD47Z6qf5mlV4JJBoxdkIGqLUnpafrjk72Q8UsnXsVXllAjnfY= X-Received: by 2002:a05:600c:1c04:b0:42c:aeaa:6aff with SMTP id 5b1f17b1804b1-4311ded42e9mr155157695e9.10.1729072162882; Wed, 16 Oct 2024 02:49:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8GDQhvsGyXA0X961v7Lmwi/hfrpQA8HclfLV7tXU7H8VLe8dIqSWkJPDQe2YmlweB9M9Vbw== X-Received: by 2002:a05:600c:1c04:b0:42c:aeaa:6aff with SMTP id 5b1f17b1804b1-4311ded42e9mr155157405e9.10.1729072162522; Wed, 16 Oct 2024 02:49:22 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 02:49:21 -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 3/6] fpga/dfl-pci.c: Replace deprecated PCI functions Date: Wed, 16 Oct 2024 11:49:06 +0200 Message-ID: <20241016094911.24818-5-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: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 pcim_iomap_regions() and pcim_iomap_table() have been deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Port dfl-pci.c to the successor, pcim_iomap_region(). Consistently, replace pcim_iounmap_regions() with pcim_iounmap_region(). Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko Acked-by: Xu Yilun --- drivers/fpga/dfl-pci.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/fpga/dfl-pci.c b/drivers/fpga/dfl-pci.c index 80cac3a5f976..602807d6afcc 100644 --- a/drivers/fpga/dfl-pci.c +++ b/drivers/fpga/dfl-pci.c @@ -39,14 +39,6 @@ struct cci_drvdata { struct dfl_fpga_cdev *cdev; /* container device */ }; -static void __iomem *cci_pci_ioremap_bar0(struct pci_dev *pcidev) -{ - if (pcim_iomap_regions(pcidev, BIT(0), DRV_NAME)) - return NULL; - - return pcim_iomap_table(pcidev)[0]; -} - static int cci_pci_alloc_irq(struct pci_dev *pcidev) { int ret, nvec = pci_msix_vec_count(pcidev); @@ -235,9 +227,9 @@ static int find_dfls_by_default(struct pci_dev *pcidev, u64 v; /* start to find Device Feature List from Bar 0 */ - base = cci_pci_ioremap_bar0(pcidev); - if (!base) - return -ENOMEM; + base = pcim_iomap_region(pcidev, 0, DRV_NAME); + if (IS_ERR(base)) + return PTR_ERR(base); /* * PF device has FME and Ports/AFUs, and VF device only has one @@ -296,7 +288,7 @@ static int find_dfls_by_default(struct pci_dev *pcidev, } /* release I/O mappings for next step enumeration */ - pcim_iounmap_regions(pcidev, BIT(0)); + pcim_iounmap_region(pcidev, 0); return ret; } From patchwork Wed Oct 16 09:49:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13838050 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 BCE6F2076B6 for ; Wed, 16 Oct 2024 09:49:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072174; cv=none; b=SmJJ5BESBwvujfJ5Xod9FZuBA+LLKr3AfstcYzPoF/A/n05DDrK78V41riWDHgYJaoXdKhfxTko7huWRUOS581y4AWhpQgD2bCC4UiZPDlDHiUVfOu3j2Sg8xYoXCqxjGGDsYXss80900i2DRnpYNekriG0Sv7g/+ilnNXDExN4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072174; c=relaxed/simple; bh=AIDTKBNi6INPgWrqEoX/M1WCIYgi7NbFsk/YqCNjmvE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VXJMh3GZvBWYrw38tJePJIJlAp4+Cn9bnXRClvQjq28qTtNds0Ud8M7VL4CQkKPCJjECMjZBk5/vd9TxWPtLMm6B1vrI7KOgUT+0Ta85xH+0U8zpMMzlAhKOJ3GpWksB2z972FMGiD06AUZ7JEamwfMqaHQrZ6voo530dDoexTE= 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=cl4zOyR9; arc=none smtp.client-ip=170.10.133.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="cl4zOyR9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729072171; 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=2wzWvQZgtWYEM1IVY+pxRBRf1z1HRk5bBfpP9Hkr1wM=; b=cl4zOyR9AdGQI232h8+2yaGTTLMA00iNHzc8Oa4Xj1dc1lyyblcw2SqDXxyvOLCGM9c3AD whCZkgisXNE9f4owG7BMThQCxcw/11FRTZPYFijfZF7WvhFafHuZ/exQ2EH5ebgs30fqv1 AN3WMmlHtxF/dq0mQdxW3f4s9R0+5L4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-P3Qs7fV6OI6hDimkQ-THjw-1; Wed, 16 Oct 2024 05:49:25 -0400 X-MC-Unique: P3Qs7fV6OI6hDimkQ-THjw-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4315544642eso449425e9.3 for ; Wed, 16 Oct 2024 02:49:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729072164; x=1729676964; 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=2wzWvQZgtWYEM1IVY+pxRBRf1z1HRk5bBfpP9Hkr1wM=; b=e4waa4xAKx3MOQSHXCUxxQTtej2B9qTn4E4WsH/iA3lhfMFoQ4zla6s25Bb9dphtjz X9vmOmVJ0e7isPrLM7rrGyjVLnqREPPHIdK2jB/Bh1ly2AW1Powz7u3v1T6yx2iazfzV AsTF0rohICQDiyNaVVQp1tp5h59S4Bc8euxqzlwTt6v/ykegxEfBr4Rggy4LYaZc5bXm Zz7/6b4s3A7KV7YOfjlv8/VrGu1t+5CbQfr71IjF29rXTZ+UpuolU7w1znvf0hJ/Q89X eozP3cLiTuDMDLHsOvWu4AXjZbMAttI1NA6vamb6ExswzP46WCuemymzmKJ5+xdZb5t1 HBlA== X-Forwarded-Encrypted: i=1; AJvYcCWOwLzRjHZveMHRAEE4Gx3pNw+iPzCgJRm77WGXGZfcTXeVg/bOWu8+aboDHBFY7xn11p21HQxspdZY@vger.kernel.org X-Gm-Message-State: AOJu0YxLfK3oDN/7rbspXyuub7zHqqOrJ9oSbfXM98a6PXRVn0tHk1v8 WC9sq+vbhxn4fzJ18PwvALjfSeRSuic5rKiuLrsz0dHZWAqU26r5QwJonCS19e99I+OlIeLZYTO lp/gRGnFdP4M2ayQuu9WMjkeFeuKQ1v0a3XHJHYOHqe0SX409HN7xDrAjiKY= X-Received: by 2002:a05:600c:5122:b0:42c:b22e:fc2e with SMTP id 5b1f17b1804b1-4311dede4efmr150405715e9.15.1729072164383; Wed, 16 Oct 2024 02:49:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7fGzU9EW+z54YfNFr1pxyVsd7IutBOseOI3u2H3FWr96L1yS4FiMaLxnWP3CY/3VpM3y6Lw== X-Received: by 2002:a05:600c:5122:b0:42c:b22e:fc2e with SMTP id 5b1f17b1804b1-4311dede4efmr150405425e9.15.1729072163927; Wed, 16 Oct 2024 02:49:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 02:49:23 -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 4/6] block: mtip32xx: Replace deprecated PCI functions Date: Wed, 16 Oct 2024 11:49:07 +0200 Message-ID: <20241016094911.24818-6-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: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 pcim_iomap_regions() and pcim_iomap_table() have been deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). In mtip32xx, these functions can easily be replaced by their respective successors, pcim_request_region() and pcim_iomap(). Moreover, the driver's calls to pcim_iounmap_regions() in probe()'s error path and in remove() are not necessary. Cleanup can be performed by PCI devres automatically. Replace pcim_iomap_regions() and pcim_iomap_table(). Remove the calls to pcim_iounmap_regions(). Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko Reviewed-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 223faa9d5ffd..a10a87609310 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2701,7 +2701,9 @@ static int mtip_hw_init(struct driver_data *dd) int rv; unsigned long timeout, timetaken; - dd->mmio = pcim_iomap_table(dd->pdev)[MTIP_ABAR]; + dd->mmio = pcim_iomap(dd->pdev, MTIP_ABAR, 0); + if (!dd->mmio) + return -ENOMEM; mtip_detect_product(dd); if (dd->product_type == MTIP_PRODUCT_UNKNOWN) { @@ -3707,14 +3709,14 @@ static int mtip_pci_probe(struct pci_dev *pdev, rv = pcim_enable_device(pdev); if (rv < 0) { dev_err(&pdev->dev, "Unable to enable device\n"); - goto iomap_err; + goto setmask_err; } - /* Map BAR5 to memory. */ - rv = pcim_iomap_regions(pdev, 1 << MTIP_ABAR, MTIP_DRV_NAME); + /* Request BAR5. */ + rv = pcim_request_region(pdev, MTIP_ABAR, MTIP_DRV_NAME); if (rv < 0) { - dev_err(&pdev->dev, "Unable to map regions\n"); - goto iomap_err; + dev_err(&pdev->dev, "Unable to request regions\n"); + goto setmask_err; } rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); @@ -3834,9 +3836,6 @@ static int mtip_pci_probe(struct pci_dev *pdev, drop_cpu(dd->work[2].cpu_binding); } setmask_err: - pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); - -iomap_err: kfree(dd); pci_set_drvdata(pdev, NULL); return rv; @@ -3910,7 +3909,6 @@ static void mtip_pci_remove(struct pci_dev *pdev) pci_disable_msi(pdev); - pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); pci_set_drvdata(pdev, NULL); put_disk(dd->disk); From patchwork Wed Oct 16 09:49:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13838047 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 4CFBC206E80 for ; Wed, 16 Oct 2024 09:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072171; cv=none; b=K7cqVaNUk00ewMMuv87Wa8fHQA4NvkA0CI5XRuSNex1qAH/QF4BUk+KdZItdgPej2wQ+FdRp4z0F2rw1LYTJduhcetvpQeB12lFBgcrQbnka3b5tWnUyFQVrL8kh1IdsJtBX/dWrGJqe1KWX05Wqbs6CXoesPXxflenZk+CAxDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072171; c=relaxed/simple; bh=IPYwte1jdHAl0RXA+w3cBwPZngFH1bdGCu0keKv5zz0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T+JMupg5nTdYZUVP3CBpLrJ4Pg7dJ3wNQdN6Sm/QrkckEXMb1T6uuV/b+WKsLk2kSOUKoKtz5w3K6sm38OYDaJtAA03fHB+erqE1JMA16UmYAeEKhSnCYPdWLJNMBVVmN/HyxRovSTrXTR+fxAlr/LJyP5OVU/hXJzRGAk1N+cY= 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=JOoe6sUt; arc=none smtp.client-ip=170.10.133.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="JOoe6sUt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729072168; 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=fYrvd5koRqIGUA/KmbRFK2qg2itve32eBCe6OW52Vvs=; b=JOoe6sUtuABye/dsEGIQM4Nblq94QdJlqXf753UiClibnr40GuMNzxcAJ8DR+usCXJFUws qwj9V3lTLrVkFPUMr+vuwtTm0E0lFnrqjVXU6WLENsO+clZHBH/tfBNDZh6Qk47a5S7HyG rcX2NgQnleRiI/bdOophpA86O4j+goQ= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-538-hIjESl8kN0WC_EH_Vp5Ijw-1; Wed, 16 Oct 2024 05:49:27 -0400 X-MC-Unique: hIjESl8kN0WC_EH_Vp5Ijw-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-43117b2a901so54372195e9.1 for ; Wed, 16 Oct 2024 02:49:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729072166; x=1729676966; 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=fYrvd5koRqIGUA/KmbRFK2qg2itve32eBCe6OW52Vvs=; b=DdU1k7EFcH2zMv8tdQXBbA3IjW/Lxa2FobJlflRFZlzDvgNjeH6m8OT9kJiJ3Fui8C 2HrF+9L9AlVcrjAsWTPcH77QX6foGKPgaSv7p5oGzKHsvK0ZnOtJZ8Wanh6Iy4SqOq7R yFi6w6V5Utwj/eYDxvG+EPF+A0xIzojN2bmdu7O2b0VD/YF6XBftLNYaFEO8HQap1isS VRVzZzuRHWaV0L5dz8epq40NnOYy6Jzq8Os9QgFds0wwBV4jscX76aQRW7UPdPtcg++o rfK3/UneQFjwyGN0JFQy0wcmD6Qm2sm/l/JCyIgSccOIf5vaxGyfhr9iHYvbsbPVi/Rr F6UQ== X-Forwarded-Encrypted: i=1; AJvYcCWjuEfr4kISLppSOhpl7L6MvFZkQxLYBqvkp1CPxEUUfTLM4M108xjzy5/HcRVL81FmIXDHCjTbNvss@vger.kernel.org X-Gm-Message-State: AOJu0YwqVZOFd0Mxc2lnRNyJ6CvHhgebsv1ZnK7W6EHmRnxlYQnC5Nlv 5xGeEC7czHwQdDjrX5g99ZXYmCxaEGSU7dgHCv4O7V/Nq0eO/urAfjiCcOAHiqLbUVSai9G2MsN eNPWkX0AyFM+S9h/Ow6bRSdkGDzF+MGZB4N+xKnzispEZ8Q2y7dzhSCPzips= X-Received: by 2002:a05:600c:19c6:b0:431:52a3:d9d5 with SMTP id 5b1f17b1804b1-43152a3db6amr13401245e9.0.1729072165710; Wed, 16 Oct 2024 02:49:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAkaJZ2lSkUiW+EXBvu4lsvkJ7W5vgIpbgoPIk0XAjxqd5XGQFT0XY1/aB9+8xJFuJprrz9Q== X-Received: by 2002:a05:600c:19c6:b0:431:52a3:d9d5 with SMTP id 5b1f17b1804b1-43152a3db6amr13400915e9.0.1729072165229; Wed, 16 Oct 2024 02:49:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 02:49:24 -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, Bartosz Golaszewski Subject: [PATCH v8 5/6] gpio: Replace deprecated PCI functions Date: Wed, 16 Oct 2024 11:49:08 +0200 Message-ID: <20241016094911.24818-7-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: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 pcim_iomap_regions() and pcim_iomap_table() have been deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Replace those functions with calls to pcim_iomap_region(). Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski --- drivers/gpio/gpio-merrifield.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c index 421d7e3a6c66..cd20604f26de 100644 --- a/drivers/gpio/gpio-merrifield.c +++ b/drivers/gpio/gpio-merrifield.c @@ -78,24 +78,25 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id if (retval) return retval; - retval = pcim_iomap_regions(pdev, BIT(1) | BIT(0), pci_name(pdev)); - if (retval) - return dev_err_probe(dev, retval, "I/O memory mapping error\n"); - - base = pcim_iomap_table(pdev)[1]; + base = pcim_iomap_region(pdev, 1, pci_name(pdev)); + if (IS_ERR(base)) + return dev_err_probe(dev, PTR_ERR(base), "I/O memory mapping error\n"); irq_base = readl(base + 0 * sizeof(u32)); gpio_base = readl(base + 1 * sizeof(u32)); /* Release the IO mapping, since we already get the info from BAR1 */ - pcim_iounmap_regions(pdev, BIT(1)); + pcim_iounmap_region(pdev, 1); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; priv->dev = dev; - priv->reg_base = pcim_iomap_table(pdev)[0]; + priv->reg_base = pcim_iomap_region(pdev, 0, pci_name(pdev)); + if (IS_ERR(priv->reg_base)) + return dev_err_probe(dev, PTR_ERR(priv->reg_base), + "I/O memory mapping error\n"); priv->pin_info.pin_ranges = mrfld_gpio_ranges; priv->pin_info.nranges = ARRAY_SIZE(mrfld_gpio_ranges); From patchwork Wed Oct 16 09:49:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13838049 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 44063206052 for ; Wed, 16 Oct 2024 09:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072173; cv=none; b=mzQbq1OOV8wYacgHEZf/CtPUvdBoXm7cfcxxfwSl9BcxXz3eJqQJwupcJvNiDrFQaO/aGM3UnKge6ZyuYu29ZlTxKXHbuOKifZDW7D0GzfXr6+XNCunuXtm+uO5ucKPAclLGawbzlfznA3hxGqAl8Y2JOKwrYH6gMJ+n3CGCC/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072173; c=relaxed/simple; bh=htHW4nC4bbnEa+ZM/uajB/3THIEyeC3KtURYUab+gk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fqTdJnSB/j/cjclb8ZWhD2PZ0GvzFtM7a8akBWE9kvzRzt+17+Qg+La6MUQ36N7vMeoxZXxIqAgTn7+AsU2DvS7czgVcOmh4c8CkCOvguOhsbdybGgsmB33K++apAWpCYQVa30V5iQ2p8PQmWZuLVo8BxWbaAdgSIQdisinzOzc= 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=PAMsMcQv; arc=none smtp.client-ip=170.10.133.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="PAMsMcQv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729072170; 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=eAXbZXITqmfuNpuSA5zLMkRUqa2IYxNYDUv+NC55td4=; b=PAMsMcQvkUYrWUKsVAKMR6MQTkZoyqnVv3r/aJF9G3c9NXErptBNerPWDIO8MpT5T+C14g s3MMgb/IQ0vLPSwRSjbfQHE2FbYmrNR9gSjJhKwrJfUm7O44rAvmDi8+BaE/IpVhBhRgvB pMy8cY0iutaIIM0J5TMdA/LV7i380Cs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-AkM1OwUYNg6_jqGF6NF2CQ-1; Wed, 16 Oct 2024 05:49:28 -0400 X-MC-Unique: AkM1OwUYNg6_jqGF6NF2CQ-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4311db0f3f1so34234225e9.2 for ; Wed, 16 Oct 2024 02:49:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729072167; x=1729676967; 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=eAXbZXITqmfuNpuSA5zLMkRUqa2IYxNYDUv+NC55td4=; b=umOq1BaQGn/HIerlG5cCB4mUCp6UgxSg0Cl9nIJkjUo6MvbeG3Mf4ZfXL4/6hXYohV KbuX7ap5PX9c41vNbOiGIzDO8B4stziTi3XaKIehKDXtc4+ZEQ3V1Mt+KyDPEPjctZr+ nwJ0OgXZRbvefq8WWdpACKYoHIE5E+CVIPdM4iDv52xPiNl1kzFA5CZmO/l28rZ0Czf9 33t3bI78942WQBQosfdpkFjFzDhebaNBRidSlCT5qFTPYI5GQtVZO9YJIUPonmZ+Nsts 14fHbodpypm5u6qyi9xBxih3Nf0SDAimSmBu+NhfwBR43t0/0PPebuR79fCJ+mn3b9g6 QMiA== X-Forwarded-Encrypted: i=1; AJvYcCVhHKYqNPfjb98MJxvKn3t0xykn6zT4FejAvTWnGiuf+86KfiX5UzGSTIJCjGCKvtbUaDTc+0Iu3H/2@vger.kernel.org X-Gm-Message-State: AOJu0YwPPDgnpWcKaD2k/LjwlCJQs4xsT/v5f6Ob7W1bonpx3+85+hfO LXZsJcJkDve0xgHEPW4RcLzsHf5z8cCInVeZGdgAMIeCCVuzmSqZPZYMKVY3tuIG9x67p+y6td4 Xy1i6wo4eoQNiAPPMjbUTIYbnTGx7LvSz2nGdEnKwHywtvgjHIenrI8Okz/w= X-Received: by 2002:a05:600c:1f8c:b0:42c:b220:4778 with SMTP id 5b1f17b1804b1-4311df5c639mr160032985e9.33.1729072167219; Wed, 16 Oct 2024 02:49:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmQuyn8hv0hBqxE0+BXi1ZnR8824mqMCiYlhK9JU94GmSaFPjJpOmCYUVQWoBnqBXMHnWe8Q== X-Received: by 2002:a05:600c:1f8c:b0:42c:b220:4778 with SMTP id 5b1f17b1804b1-4311df5c639mr160032565e9.33.1729072166725; Wed, 16 Oct 2024 02:49:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 02:49:26 -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 6/6] ethernet: cavium: Replace deprecated PCI functions Date: Wed, 16 Oct 2024 11:49:09 +0200 Message-ID: <20241016094911.24818-8-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: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 pcim_iomap_regions() and pcim_iomap_table() have been deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Replace the deprecated PCI functions with their successors. Signed-off-by: Philipp Stanner Acked-by: Paolo Abeni --- drivers/net/ethernet/cavium/common/cavium_ptp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cavium/common/cavium_ptp.c b/drivers/net/ethernet/cavium/common/cavium_ptp.c index 9fd717b9cf69..984f0dd7b62e 100644 --- a/drivers/net/ethernet/cavium/common/cavium_ptp.c +++ b/drivers/net/ethernet/cavium/common/cavium_ptp.c @@ -239,12 +239,11 @@ static int cavium_ptp_probe(struct pci_dev *pdev, if (err) goto error_free; - err = pcim_iomap_regions(pdev, 1 << PCI_PTP_BAR_NO, pci_name(pdev)); + clock->reg_base = pcim_iomap_region(pdev, PCI_PTP_BAR_NO, pci_name(pdev)); + err = PTR_ERR_OR_ZERO(clock->reg_base); if (err) goto error_free; - clock->reg_base = pcim_iomap_table(pdev)[PCI_PTP_BAR_NO]; - spin_lock_init(&clock->spin_lock); cc = &clock->cycle_counter; @@ -292,7 +291,7 @@ static int cavium_ptp_probe(struct pci_dev *pdev, clock_cfg = readq(clock->reg_base + PTP_CLOCK_CFG); clock_cfg &= ~PTP_CLOCK_CFG_PTP_EN; writeq(clock_cfg, clock->reg_base + PTP_CLOCK_CFG); - pcim_iounmap_regions(pdev, 1 << PCI_PTP_BAR_NO); + pcim_iounmap_region(pdev, PCI_PTP_BAR_NO); error_free: devm_kfree(dev, clock);