From nobody Tue Mar 11 05:07:39 2025 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 D477A206948 for ; Wed, 16 Oct 2024 09:49:26 +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=1729072168; cv=none; b=Ga9sHWea78F6K9r6ElTztBAHO2RdzBB5uzTv88SN295F6pNwOBoEGlyfN6vhYqcGZY06J9KjNTKrS26ClAaXvXmkC23F2Axq3q/l/2r4nk1BJOzLYwt9Jp1AVAoZefuP4m5cD/bU+n96JHHHbqD5B2rajKybBW5EvqoVzAeFpys= 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.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="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-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-578-EXssZosrNgyJGAXbOo42ng-1; Wed, 16 Oct 2024 05:49:20 -0400 X-MC-Unique: EXssZosrNgyJGAXbOo42ng-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-431248c438eso3971235e9.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=Op0NhdHvYo78uSDI1uXe5+y7Fy6cVlOZmUENjUyHvUC9+vq1UtbWeAiwZxnIwPoxqU kaI9RRvP6+TNrTvT4mL6bsWgCu3+ZIo1MCZTHTo+C2uq7Q/VhycircLdi6PALstUg9AZ 0OlOrYWPzbqfVgE7iQWv7NADXrqNkkUPQ2lJYsmK7Ce0NFbwyRmTezNWGL5Aiwjn9xiF v3F/OZm/OhC/bjCQJ2ixLgPqvuDktgP6+cR+d5qtrUS7jRpbhjX+6o8TJkRArKnFeHPM qYnTqJTdsMiKt4aqA7xfO6BrZih2eqJT2/Tfd6l3tAl6I9wLPIuk8SOa+wB2cuLQhuam coNA== X-Forwarded-Encrypted: i=1; AJvYcCVZLhgJyhXwsMpgLUJ71omVdKz6Zn6eKM28UNn2ESDuV38u68bZXKOHxUniNqCvX+UidaO2p/9MrD8Znw8=@vger.kernel.org X-Gm-Message-State: AOJu0YyTbqJ1R3C99GWPBKr2YA4vqXZd5TwgoO33Fv42FldblRnECpIf yNi2lE6VaUO+k0m+i5bHkXwk8Ymx9kh8rkENTmsqe2+atZzoUcwM6p5A5Ig0weQFAWvMTzcPx3x 1Gt1Iju90znyvGLaWq5dE497zzZhQ6jdMVOyoVaWL3HPi/DjbP5iXWTa1KUAZDg== X-Received: by 2002:a05:600c:54cc:b0:431:52da:9d89 with SMTP id 5b1f17b1804b1-43152daa0ecmr7721045e9.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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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; =20 @@ -784,6 +784,7 @@ static void pcim_iounmap_region(struct pci_dev *pdev, i= nt bar) devres_release(&pdev->dev, pcim_addr_resource_release, pcim_addr_resources_match, &res_searched); } +EXPORT_SYMBOL(pcim_iounmap_region); =20 /** * 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_pa= ss pass, void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxl= en); 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); --=20 2.47.0 From nobody Tue Mar 11 05:07:39 2025 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 A2AAE206079 for ; Wed, 16 Oct 2024 09:49:24 +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=1729072166; cv=none; b=AcPUb3gbh6dMq+PhMxGp9PAxoNTIor0UApfcwnbWOYTg720VY1aMeBxNGY8i6ohode5FmRxhO0OrSUvl33FLvB1VeusXF/4fnTjPHNJVuv0MTpH6nF6Wl0KmhPt5xCq4158bSNK1qO2mjMoOSCpBftnBEz3+zt5cZVqxXIQdZ5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072166; c=relaxed/simple; bh=+7VXObVbimU6RXAVe8MLDd0WB1BZiq/LjoM6c454k1c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pOZ1f7plfI8M1953VxvSTZ5rDCU7xtS+T/bTrrr0+F0vKPkZwTn3tH4f/QT+VWvaRYEVjvkeJDxrzS0wniPb6ykiwRT60bo8rTrK2aLnXPe7cMu1U5wrfEaQp/96sTynrxBZVd67pak4KGUvFq2ybwMn02OkMTIyTXmY4t2WCtQ= 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=YFaf+rwN; 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="YFaf+rwN" 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=PtS5zdbiO/gsUv0EMgDDobhsGGQ7SjCkZAyLsDHRQIY=; b=YFaf+rwNWRFme8Dz4/pXAxzpuAfJHzzVU+gKUbgLy8hYi99/5ASZCvswlNSQcjVAuClgSk FzfY+HNuuT5kOWHxLhEYsjmmeBZ+DaZW7WmC+U3xbgqfgUzpTsohchu4NzWrnIaNZDBq9E HnYwq3jlhK/91/eT+V7QQEU00tJaBP0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-170-8hTa-3MAPIGMNr6mVLxg9Q-1; Wed, 16 Oct 2024 05:49:22 -0400 X-MC-Unique: 8hTa-3MAPIGMNr6mVLxg9Q-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-37d5ca192b8so374810f8f.1 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=edzuTzI/VTLb2Jl07q8i7Pd7TFoeBrxgcTsSRGQa+f8eker+ROPuZM3c4Yt+1ws254 /GRVpgaG+RwDkSAeWJUqF0ajw04rx05EFl7PPCfZB4pRGW2KT1131rCqFj+gqzbVKC1J hR5O1bphEPRiZOgwZepEVAgbL9EaZCvciBza0e6gA8Bv0i+YUAoVLmmWL6Nget4wpLG1 M+Ahj3RZzKgVgCP4xmZf7+huJcBo6IjqHeAPOnhGxhNsAqSmM71lB7Gmr6D4Q9mLoqBN 9BNKr7folU+FKNFxmCIoS7M+T9Q+3zSws+LX0fmydlninVMAZ3vW6Kghh1Ol2qxBcbh4 7eWg== X-Forwarded-Encrypted: i=1; AJvYcCU1IyjiIe/HEsbKDmKDtWlbYFHPnx1+5gtUyIRo8yxWynwi6bFfM1Lah0Ob8DbunBIRgqWL22M6IiGgpi8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxqindi+5dyhB+PzGPtG+2g3ygA2tSz+Mi4dkHZNCu2iqUDEYUI Lj1yWF1blQoifnRIA4+TUy9zsQdTStSuXQCl6SrE4l3sj9LpEA0YhCwPFb+t6fPA8UiSCevAiU0 2qLwHAXVL0ssdberBE40BRAXk7nsM3ibe18U/mvg5/mj+3Tr/UJg8utozsh77ZQ== X-Received: by 2002:adf:f751:0:b0:37d:321e:ef0c with SMTP id ffacd0b85a97d-37d86285f99mr2815635f8f.11.1729072161037; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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); =20 /** - * 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) { --=20 2.47.0 From nobody Tue Mar 11 05:07:39 2025 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 386F2206971 for ; Wed, 16 Oct 2024 09:49:27 +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=1729072170; cv=none; b=Kq6a/E7zJdmGOvYAQ9jE73TpYLkaSLfg4mWdup0QUdPvTrk3PbfQny4Yj1Fy04UNDAhrXU/dI/sXkyLL4QCu6xPaJ9314Rq4s07NXP4YI5VUi5lKYLl+k3IF2U6wAmfGWziwcsO3PtPtYrMus3wh12gb9dQn9XHmsOPrYEAFnxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072170; c=relaxed/simple; bh=73TDRRq/zYwVvdvTcMvRKEXzW3B5e+Rcch7EgZqO0Rk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YRHf9ZIW8NusgYmeUdl8UnMoJN/Kl9cDBmWVxm9nHaLDFRy3/f1b9XMWV9KeRmCWqSIExFvN9SYN2KN/fX1owEn8Og/RBzWHqFr2FHxSe+RlGtahP7sTgNYq91CHl+EcMp6616CIfJUgZ1bApXAtFYMNeAFzh9ImdUSIqkh/djo= 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.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="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-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-320-mhGZuRybOQKX6cDQXHGw9A-1; Wed, 16 Oct 2024 05:49:24 -0400 X-MC-Unique: mhGZuRybOQKX6cDQXHGw9A-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-43052e05c8fso42997345e9.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=PksC8JuOJ0Z+FHeOb4R3mO82dgKSk6GshIy/dS97+ZR6IvUg378AEv9QuoVgMUOUEp D6uUDoACh3mujv582SfWebZni/TvPbhy5Y69kJgpTbEHKTL+Mb8GJkntbtbNQkzmDgRs T9uCuJYZ2Uyu+daIeFvtWNS4I4kWA7ZbxPMznHVPgwBiC4EuZHkP2D5elKTpQFOicrBf zMKmFKqUb/Bq1946aGRfW0jtBFlSpvcDhoNoJPJT9efQfApZhN1TAPiR4LGjQouSMbF4 /N9GwHbosmENwVZOR7s+bceXfxfdi/4yQfZwj0jDOo6oueATZRU/S61E89h9+qPRitnH UrtA== X-Forwarded-Encrypted: i=1; AJvYcCWZsCsCc+PBXZQ6IMIFimwsNmHQrzqprCJUTr3vFLbwKka8tKnhiUvt7cv95zkkGusIGCsutHDl7e9FPng=@vger.kernel.org X-Gm-Message-State: AOJu0YyDRUFkhL0AgFTEA0anq4q3Ct4k0Oo78M0QvrTzRr6lVXDi3HKl pGGct8bUqNd1E2Wgn2YYdC5CwDTMYb3SWEWYBUOrVNX0YrHUVVFQYHe3+lwHQP9H3jpADzyE2X6 3fwfiAg9KXlGPqxO4yIDD9EwTwQW6ZVHR2oTItVMbFp7JP+uHBPy/LLirmj4cYg== X-Received: by 2002:a05:600c:1c04:b0:42c:aeaa:6aff with SMTP id 5b1f17b1804b1-4311ded42e9mr155157755e9.10.1729072162885; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 */ }; =20 -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 =3D pci_msix_vec_count(pcidev); @@ -235,9 +227,9 @@ static int find_dfls_by_default(struct pci_dev *pcidev, u64 v; =20 /* start to find Device Feature List from Bar 0 */ - base =3D cci_pci_ioremap_bar0(pcidev); - if (!base) - return -ENOMEM; + base =3D pcim_iomap_region(pcidev, 0, DRV_NAME); + if (IS_ERR(base)) + return PTR_ERR(base); =20 /* * 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, } =20 /* release I/O mappings for next step enumeration */ - pcim_iounmap_regions(pcidev, BIT(0)); + pcim_iounmap_region(pcidev, 0); =20 return ret; } --=20 2.47.0 From nobody Tue Mar 11 05:07:39 2025 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 A0000206E6E for ; Wed, 16 Oct 2024 09:49:28 +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=1729072170; cv=none; b=G8RDoQWr8yOOWLuKHMn+a6nmoHlFrba+8velqWmmvdtOjqO0VPwRxdBed9XgNr3aFeXWksrv3ECZ2kTPZui0xdgqMq4Rj5d0evNQfeBChKPUb/B2Y67h+w7VA8pmccEtQmMz/2KUTpfZ8GCt4QBa61yMNYE/abU4v6ZkoDGheKk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072170; c=relaxed/simple; bh=AIDTKBNi6INPgWrqEoX/M1WCIYgi7NbFsk/YqCNjmvE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d+bjjE3w9fTAy1UeIe0W1pCTHVWKzr2WbtToFaPxClXo3Ueyxbuo3erbms+DNIMFKO+RirwUbbxIdjfEMbF4rsJL41marpXZRuCVR3SKuSj3K9SeIMigkCP6lPavdGc86WsTrpZcGBqhQ5dg7fXTjekbBks7Hk974R438ge5oDw= 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=Ubxs7w+x; 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="Ubxs7w+x" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729072167; 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=Ubxs7w+xSUwnQPd5M/TqaojMgWdme/Vqxx3U3Kn7ZLKwn36lW9YAIdF9U1PDyhP7bbxKJc iRv5YfPdCq2HVSumznWLS2pCHp6nNNfF8x8SicYODo26iuyE/iXiDn2KJe3ZGqgra7r2mV otCdl8/tQr7pgXKlMAgfdIYzZVrqWIk= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-653-F7OhL2KRN_Ol6KdKUOgr8g-1; Wed, 16 Oct 2024 05:49:25 -0400 X-MC-Unique: F7OhL2KRN_Ol6KdKUOgr8g-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4315544642eso449435e9.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=jG9EFG2k7NzHPa51vKcBpXd1+1rG0wAd/2yAnbLJXyvyf7ER+CkvqBi1EEEmKbVH+7 zoXBIyS2nxeXjMI4R+C9onIDanJiD0ZgVAna8lsDkguWia25BS/202KRIcEfUpr8se/F u5KoA7LeqY24Uqgq6wvjBHGex5oLzzsJwO6xb8tUq1csk0pVmwZIMViTyZiZqoyzxndW H2ofucULOoiKrWfFcR8kY/1IBod/FZYiopiWdSqfbfoIjAaZEMUXI2e2OxZeIoWMpSxK q1xODuW0bxq2npDoPo2q2qB+Ftl/N+ZQXOXqv+cjaWrzjUPCqET1BUckn6/Xz/cKZo8h EFTQ== X-Forwarded-Encrypted: i=1; AJvYcCXpiCwvgASNf5TADntilIQ6/nq8t3fWiqxrTS01DpSbini+3M7c+mP6DXptwhsfilDcwOAFO3k9GU/VlII=@vger.kernel.org X-Gm-Message-State: AOJu0YwZkN0oGg2MpKUCmqQjqjQWSvq1xM9zyhvaJv7OCwYPbIhM4CLu f7qs4ScmCtRX2WrUUMjtCYC/MuIfUvZONj62vr9+n9Ap4mMeTvUwhDMrPxiBdeEk/p7GEq8pyxx 8AdSws1HFiITt5cZdIy0agZw0M3zcZJI7hhbL/ucrI0xEwN9CsFP4ioAc12zCMg== X-Received: by 2002:a05:600c:5122:b0:42c:b22e:fc2e with SMTP id 5b1f17b1804b1-4311dede4efmr150405845e9.15.1729072164389; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/mti= p32xx.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; =20 - dd->mmio =3D pcim_iomap_table(dd->pdev)[MTIP_ABAR]; + dd->mmio =3D pcim_iomap(dd->pdev, MTIP_ABAR, 0); + if (!dd->mmio) + return -ENOMEM; =20 mtip_detect_product(dd); if (dd->product_type =3D=3D MTIP_PRODUCT_UNKNOWN) { @@ -3707,14 +3709,14 @@ static int mtip_pci_probe(struct pci_dev *pdev, rv =3D pcim_enable_device(pdev); if (rv < 0) { dev_err(&pdev->dev, "Unable to enable device\n"); - goto iomap_err; + goto setmask_err; } =20 - /* Map BAR5 to memory. */ - rv =3D pcim_iomap_regions(pdev, 1 << MTIP_ABAR, MTIP_DRV_NAME); + /* Request BAR5. */ + rv =3D 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; } =20 rv =3D 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) =20 pci_disable_msi(pdev); =20 - pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); pci_set_drvdata(pdev, NULL); =20 put_disk(dd->disk); --=20 2.47.0 From nobody Tue Mar 11 05:07:39 2025 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 CF9D82071FC for ; Wed, 16 Oct 2024 09:49:30 +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=1729072172; cv=none; b=p9yDcWXy2OQeCZ3VaAirqk2CtO8rVmMjwG4Dh53CP/hn6BlOoHl/dhIvUQsJ1f1Ip7fIfvptYGGGeTZQsrGd/cjm0Qsm+Bu0RsTLstHcfKO+eX+GOCCXHPhtHn0aIcQ19XJErLVKcPZrCxCobS9KGlccy2pTyQFPWIaNAgZIIp8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072172; c=relaxed/simple; bh=IPYwte1jdHAl0RXA+w3cBwPZngFH1bdGCu0keKv5zz0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R4oh7K+dAVJ4kcRsNT9kKKD1Zbl1/fuaMIGpRd1bQXDUf5mDKalV1E9pJncTGnsTYi2ifJRe+ykcqxkKuKm+VZJVcxCdydtjRczpXefEbzM5UK1hXhIGlZQ/waByMoot5KAcX95j2N+lTcR8WpciDnnCeozRsqG1ywAGZNSc5Lc= 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=e6RxSdC+; 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="e6RxSdC+" 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=fYrvd5koRqIGUA/KmbRFK2qg2itve32eBCe6OW52Vvs=; b=e6RxSdC+igWCNHNU9N6Kl4cYIKaa/6QE76g2FwWRmGgqV9THRPa+cdqTSGUXw8boRx7swD V9bNz8lzoT8kwU9z5o/OVPQitG56nT6pGsc6GsYQDfXde+1c0uyLTuVXE+rNA3pXz+lAFe PB68VPB5KQ/qbFvM5wqwImnZX77hwWA= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-363-Fm5mT7cbMXeedXR3aSITcQ-1; Wed, 16 Oct 2024 05:49:27 -0400 X-MC-Unique: Fm5mT7cbMXeedXR3aSITcQ-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-43117b2a901so54372245e9.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=NZ7CWTxM0hmJlQ8xEpgGbZzB2Xwk+bf4At+HIUGlOMhEMDPb4wrj5yWLXroVofPMjC X82GhcPlNjcsJj53YVBhYtDmLemRg0ETE02UrNLtrYQTT4YZyawbIIUGxPUhwbAwMVWZ EyFo8RZYMN5JkvK9RmQ3McZkfkGewRcLfBLB7Vu60zhfXww8wUFOjr44/hAAjLADDmZl C//SoflYvbi8S2nuacoNFUPki5TNi371IJ54VzRJsJjoZjoBkU5PpZy2znqTns8993P5 1faYbGWEKJBUoCjrgj0fnjZrp7acwfU4x8pCxbcnEUY4A/TinTCAv9VYVoa75UoRvcQd cftQ== X-Forwarded-Encrypted: i=1; AJvYcCV8Xr/8ePsh/wF5nLsro2uzV24uO7H4fE96VKjpdLuUj9AFDbr3l3QT1b+gwjwSbSVeCOYsVFfLRaHGrlQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwkvaHw0fLBlRXJbxp4AFSRmQuyUI3yv9fOxIKdkP17y/zfNEDz FblLsuQNc9Bb4WnQNR1o38VV/zGyOJYh7/Cgk45i3r6p7EZ96z8b19zzsaCe7Z651jUFmWJYtt9 ltegYU8vBCTcjF7mbswhyqSmDJSNyI/TAeEi1YBrt1o+XCHcTYmr9SUNCScdjjw== X-Received: by 2002:a05:600c:19c6:b0:431:52a3:d9d5 with SMTP id 5b1f17b1804b1-43152a3db6amr13401385e9.0.1729072165729; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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; =20 - retval =3D 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 =3D pcim_iomap_table(pdev)[1]; + base =3D 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"); =20 irq_base =3D readl(base + 0 * sizeof(u32)); gpio_base =3D readl(base + 1 * sizeof(u32)); =20 /* Release the IO mapping, since we already get the info from BAR1 */ - pcim_iounmap_regions(pdev, BIT(1)); + pcim_iounmap_region(pdev, 1); =20 priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; =20 priv->dev =3D dev; - priv->reg_base =3D pcim_iomap_table(pdev)[0]; + priv->reg_base =3D 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"); =20 priv->pin_info.pin_ranges =3D mrfld_gpio_ranges; priv->pin_info.nranges =3D ARRAY_SIZE(mrfld_gpio_ranges); --=20 2.47.0 From nobody Tue Mar 11 05:07:39 2025 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 59AAD2076AB for ; Wed, 16 Oct 2024 09:49:32 +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=1729072174; cv=none; b=Eg/CTuVowqxtLao3qHfXz3czirbTZOhoRB96KauxbP9Xy+QaxjjS/sDXQKBJkzP663PvpufYT4g7pLwCDoy/6cFrmIXQRLOKFS3YPXEqMBkTu1BB1xJtZlammB9pPddNN7AJ62YwpoalnUAXQMhmuh730DqTobOJqMatjt1M0k0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072174; c=relaxed/simple; bh=htHW4nC4bbnEa+ZM/uajB/3THIEyeC3KtURYUab+gk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S2FQbjiqe+12FQusZEtRcGsU/6NdDHXRvxvOn0/U3H6KGtUXH3IjjvzSGONGV/3YCxaD2DRr50lKCkQq16wBLhENsnLiRkHRnfA8dFngWJZiEaevxs6QueHuLMpWE/ZA2ChWDIgbL1GgxVMZhlzxQbVbigJQXTUsVrxzwTiNabo= 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.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="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-395-bzOS8GxfNgWZFfw_2oL4uA-1; Wed, 16 Oct 2024 05:49:28 -0400 X-MC-Unique: bzOS8GxfNgWZFfw_2oL4uA-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4314c6ca114so6097415e9.1 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=m5QMSM3nNdNvSEPA7OojYzXtN2UqUC/e/oBWuubhJOJIpdcpyF8MpjBizE8ZOSt3fR 7LSRtDDOkXbSeglfgY27SOPIbhQphB6Z9tYdv+PqiqOZ1j/pP0HN/hX+yvcusNr3YVay It204PJvVyisUxLVpWaV6MjAeh5B+xH4Lrc0NOjDbT+krg0B97BaTM2CDYM5G2a5g1zh DL8oPlM2L7/RFyLY5B8Jgb3wRkvaifAgbdl3o74iZusWmgQTszb05XI3vT0YPXK4q0mV EoUuDZiIOI0hCXKwLxY3Mb48PfeUZJVShT+MFVUkLhA/iCbp7Jo4iPGvgcR2XC9BmB/6 SsjA== X-Forwarded-Encrypted: i=1; AJvYcCVYomNmkVwdZ8wDPStuE/e0OgciBN55aWptsEZR17xabHMerTIMnl82PBf0ky55ktrR7JQiSrq43h3VWWA=@vger.kernel.org X-Gm-Message-State: AOJu0Yzt7DYUSkI6CODnTzLz+RjrPYMYidGMtM+HVxVaVcq7tTL7Tqqz X2YeQiC+zphNtBOF32iO5UeEhZ72U52dQXHkYxaaAOdFrgT4ZEwKF5S1+6LNz5Qhy4lsKlz36bM XNz/wqCJzgTsDrRfM2xI8pwaN+FyRKzlLqhiXhSmWRO33AxWnx/+r9bOO9CFiFA== X-Received: by 2002:a05:600c:1f8c:b0:42c:b220:4778 with SMTP id 5b1f17b1804b1-4311df5c639mr160032845e9.33.1729072167209; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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; =20 - err =3D pcim_iomap_regions(pdev, 1 << PCI_PTP_BAR_NO, pci_name(pdev)); + clock->reg_base =3D pcim_iomap_region(pdev, PCI_PTP_BAR_NO, pci_name(pdev= )); + err =3D PTR_ERR_OR_ZERO(clock->reg_base); if (err) goto error_free; =20 - clock->reg_base =3D pcim_iomap_table(pdev)[PCI_PTP_BAR_NO]; - spin_lock_init(&clock->spin_lock); =20 cc =3D &clock->cycle_counter; @@ -292,7 +291,7 @@ static int cavium_ptp_probe(struct pci_dev *pdev, clock_cfg =3D readq(clock->reg_base + PTP_CLOCK_CFG); clock_cfg &=3D ~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); =20 error_free: devm_kfree(dev, clock); --=20 2.47.0