From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C25A188CCB for ; Tue, 20 Aug 2024 07:22:07 +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=1724138529; cv=none; b=PzL0h7t5z0ZkLL29lKpa9Rnd5k9Zbc6vEDFcPPtol19WxyaLBOoIVpVggUBaEzV8OFCisV8RhHUSEDxnDfzAwJxHIi8SR5OqbBRxsAg9YIkAB0fuS3za5AzNSvd6VX+vDhQySYXg8R31iaYXyJUE0SSRq0J0ZPkcy97Wzbbtg+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724138529; c=relaxed/simple; bh=CwAJcF6bJ+g48Ud2pzdceQkOvdF0s36dJmUP+WwsYDg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=gtHUNCE8OpZxHqWXv/QgeJnW2eiMogk9i5gdZAzWTyunUrBjHEMkiIW1r71arlgiZgs31l58+vJII+UXnx5Z4wTrRp2JcCScAUJJxr5jatSjZii3u3/F60gYrg1V5nSpeleCk9pIZ/nCNFrGTpVDApbtbhho39jcVgTT37EAL9Q= 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=F2q70F6C; 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="F2q70F6C" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724138527; 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=ASIEWrzHXogS2+yni6jFmR1o/WYm2ANcxSxU4DhoyQc=; b=F2q70F6C6i4n2LFBptboSqzVFALyoTAy9csRmXhdSSn6o46l1t446t4axzzVjswKXLxAVn wddazw23VQL2/fyuBqWC8gtZSMHhkE/GrQGruUaGLqhpwQgdQznFQV9t8afYWSNfcT/VK8 w/AUoDlvjS0G6DTMzHAPkzkjJwDELAQ= 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-213-Z_8iJEndNUy2rHMeW49l-Q-1; Tue, 20 Aug 2024 03:22:04 -0400 X-MC-Unique: Z_8iJEndNUy2rHMeW49l-Q-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4290cc01eb3so9507295e9.3 for ; Tue, 20 Aug 2024 00:22:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724138523; x=1724743323; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ASIEWrzHXogS2+yni6jFmR1o/WYm2ANcxSxU4DhoyQc=; b=SFokCEVOuh1l9LHmEjGWEwt8ExSc91RVgmdG2+USipgQESIqFun5JY+nPZGHOdJz6p m+FnaSxOPXQY2/bIK2vuwaOnTHNzw3s6FMvFhBLwZXz8uQlJFNZZWjTxkY7VxCPQpo0H wlwmuTZ4F9DtzVmoy6IbUDuq573/GCFc+uTEFU8Ze7HH/dNFFAPq5D4kzFip4UWnCXNx 9aWhVKV5BNSQc53BmsDD77tCrj1VBSni0J7p7BVQgGKXRrOlJB51fP0Ki1T1WD8RAmIM bQIqGfzce3UYQf8w1jXJhoEAUryAybKA3gRLwuuoOQwqnVEMQTYPm88el2sfA9E4ua9S /yBw== X-Forwarded-Encrypted: i=1; AJvYcCVkuwLLBmWP4Q6kA4Cmgj4zWwcK/Q0hyrUR09hPWyFF9WT9N+MVLDkoGDA7hNRqGAO4Gl4NQfuy0pLYvQypkfszhO4sfJU5Z2BFnw== X-Gm-Message-State: AOJu0YxyacAnaQ7FDvF47qvt8shz2oSvZ2tymcOHIwU+uBx4LH+srlea ovjKN4wUBiklvUUBaMkrhci83pyuY1s+jsO0WwXcRCESytSy1zcJkXksVwDN+eTE+cDE2J6uqK8 lPuIZXE4zqLxz1YjcbI4N93wXCvFbg6+BtlkaljpdBaBXkGR2Ols2pLNEJPc= X-Received: by 2002:a05:600c:1ca9:b0:425:65b1:abb4 with SMTP id 5b1f17b1804b1-429ed62f54cmr55367875e9.0.1724138522941; Tue, 20 Aug 2024 00:22:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtu6sXluOG26PWy70qwsbDcaM81TTK+UTUTvyjs1U84scjqTgJELEGk3SrTeSIfdGLnjJpqA== X-Received: by 2002:a05:600c:1ca9:b0:425:65b1:abb4 with SMTP id 5b1f17b1804b1-429ed62f54cmr55367605e9.0.1724138522431; Tue, 20 Aug 2024 00:22:02 -0700 (PDT) Received: from eisenberg.fritz.box ([2001:16b8:3dcc:1f00:bec1:681e:45eb:77e2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429eeadfafbsm130634445e9.47.2024.08.20.00.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 00:22:02 -0700 (PDT) Message-ID: <267a021781f59d6efe798dbca63f29dd25359f2d.camel@redhat.com> Subject: Re: [PATCH 4/9] block: mtip32xx: Replace deprecated PCI functions 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 , Eugenio =?ISO-8859-1?Q?P=E9rez?= , Richard Cochran , Mark Brown , David Lechner , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , Jonathan Cameron , 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 Date: Tue, 20 Aug 2024 09:22:00 +0200 In-Reply-To: <20240819165148.58201-6-pstanner@redhat.com> References: <20240819165148.58201-2-pstanner@redhat.com> <20240819165148.58201-6-pstanner@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) Precedence: bulk X-Mailing-List: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2024-08-19 at 18:51 +0200, Philipp Stanner wrote: > 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()"). >=20 > In mtip32xx, these functions can easily be replaced by their > respective > successors, pcim_request_region() and pcim_iomap(). Moreover, the > driver's call to pcim_iounmap_regions() is not necessary, because > it's > invoked in the remove() function. Cleanup can, hence, be performed by > PCI devres automatically. >=20 > Replace pcim_iomap_regions() and pcim_iomap_table(). >=20 > Remove the call to pcim_iounmap_regions(). >=20 > Signed-off-by: Philipp Stanner > --- > =C2=A0drivers/block/mtip32xx/mtip32xx.c | 11 ++++++----- > =C2=A01 file changed, 6 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/block/mtip32xx/mtip32xx.c > b/drivers/block/mtip32xx/mtip32xx.c > index c6ef0546ffc9..c7da6090954e 100644 > --- a/drivers/block/mtip32xx/mtip32xx.c > +++ b/drivers/block/mtip32xx/mtip32xx.c > @@ -2716,7 +2716,9 @@ static int mtip_hw_init(struct driver_data *dd) > =C2=A0 int rv; > =C2=A0 unsigned long timeout, timetaken; > =C2=A0 > - 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; > =C2=A0 > =C2=A0 mtip_detect_product(dd); > =C2=A0 if (dd->product_type =3D=3D MTIP_PRODUCT_UNKNOWN) { > @@ -3726,9 +3728,9 @@ static int mtip_pci_probe(struct pci_dev *pdev, > =C2=A0 } > =C2=A0 > =C2=A0 /* Map BAR5 to memory. */ > - rv =3D pcim_iomap_regions(pdev, 1 << MTIP_ABAR, > MTIP_DRV_NAME); > + rv =3D pcim_request_region(pdev, 1, MTIP_DRV_NAME); That's a bug here, btw. Should be MTIP_ABAR instead of 1. Will fix in v2. P. > =C2=A0 if (rv < 0) { > - dev_err(&pdev->dev, "Unable to map regions\n"); > + dev_err(&pdev->dev, "Unable to request regions\n"); > =C2=A0 goto iomap_err; > =C2=A0 } > =C2=A0 > @@ -3849,7 +3851,7 @@ static int mtip_pci_probe(struct pci_dev *pdev, > =C2=A0 drop_cpu(dd->work[2].cpu_binding); > =C2=A0 } > =C2=A0setmask_err: > - pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); > + pcim_release_region(pdev, MTIP_ABAR); > =C2=A0 > =C2=A0iomap_err: > =C2=A0 kfree(dd); > @@ -3925,7 +3927,6 @@ static void mtip_pci_remove(struct pci_dev > *pdev) > =C2=A0 > =C2=A0 pci_disable_msi(pdev); > =C2=A0 > - pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); > =C2=A0 pci_set_drvdata(pdev, NULL); > =C2=A0 > =C2=A0 put_disk(dd->disk);