From patchwork Wed Oct 30 11:27:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 839912 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 693111E572E for ; Wed, 30 Oct 2024 11:28:22 +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=1730287706; cv=none; b=Ui5GHhaZZyrnDjXZSfNhSKdVsW/30GU3iSinqePyqmEIDAbXroLJN2xgx+HvH1F4TaOIXn4RLHDK+4HkzjxJ64Zt8j3zEPWfeqQdxSFNgvECIRLx8F4ca2L+X1s5XTd2i6k8baATQf8y1CqsdA2+RHeEJ8rS3eJzwFi4mckD3KQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730287706; c=relaxed/simple; bh=YCSleCRL8+zgmB0F5bhpOuGHDhDr1YVS5o/lIBwlqhI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LHaezfC5dsm/K0mKg4wx9hz62HmDW8nq68BmCq6/KftjMfczQGrCAEU3xkbn76igxP9UqZtW5Ni86WIChMjjpDKrLFY89AzWJmqT0jYHCEut5QoP0G0WREemh4hiCp/4CTW7qXLPNOt95f7MViPnAG1ncws8Ir4Osr9kkixG5yE= 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=EVAxjaG4; 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="EVAxjaG4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730287701; 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=W8Pv00ipT6Qdh9I20/5aALEzhWkgYoXaIfeUPDxIxig=; b=EVAxjaG4Z4CAWwFRwkChz+W3EM6JNQi5hf+smGKVteSfT7wjRSWox7m2mkc/juG7d5122p qbMEU9JzoVzJjZNAcxdT0ivWDxo9oXg7vxjUr+gB3unXwiymfk7OTo5e071BnPOnBngVNT mF+F5BNwzJuuVbUv3nACXRc1Slcj2bk= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-oDkfgDxUN6Khex92wEiQ4g-1; Wed, 30 Oct 2024 07:28:20 -0400 X-MC-Unique: oDkfgDxUN6Khex92wEiQ4g-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-539f49f2443so7376520e87.2 for ; Wed, 30 Oct 2024 04:28:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730287699; x=1730892499; 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=W8Pv00ipT6Qdh9I20/5aALEzhWkgYoXaIfeUPDxIxig=; b=PyMloptp4wC9pjjeu2mAU8+DUDzx8tO1Q/o65ZOyV3Df++u1W2FvC4AAjOmEHev2c2 xbCrGMjpFqPgf/PagClEivkACpVa30lJJXRsctRBTNKWdfzpi6tw9f1XXcj4RWEF52aw Z5LsNG92kuxuGM31uSukwdAghtfjtJXA+khjTBTibJMBwdbNsDerfZykFh9YK4oo6jC6 tsXcOUV9WVsqB7Kge3vsWnGH7OMI1Lt33F//aoISxPc7PTfsKpReuKx6alSaKdVz0jmo CxUfBoePJqu6wRn434HOrw1hjg1alvXgktxHvFJRYF2rcf48EtWhL6RpfRHYPMze9dlq M3bA== X-Forwarded-Encrypted: i=1; AJvYcCWSTBjCm+u8K5seTwPMjvG3I3s5YmzBElZT5aN6Gm5JQLqd/g1aL+Eg6PGp21GT5XHHHV1BhJ5+uac2/kk=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1qA3NmjuM5Gzxw8svnlqmoTm02DCqPDuvyDy/bxJDVP5p+Zy2 EqQkaSCNee1TRgVnVScBsFYPrEgzL7C3b05oNPDCN2/OL5UIONa3IP+peBJVmwyaY699pEzIUKw PfFSHfygfItBCrj4EN4bt8/yEtrMMv8Env6pxuLddVWUfnCssTfs2stodEjSezw== X-Received: by 2002:a05:6512:3d06:b0:52c:deb9:904b with SMTP id 2adb3069b0e04-53b3491e062mr12333039e87.38.1730287698726; Wed, 30 Oct 2024 04:28:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBPHC+7mDGBZejhuxNPIAbldUy5rOv5CXnQgrngWn35PZTJpvTSwKiUrRZBkTh6tcloHeZoA== X-Received: by 2002:a05:6512:3d06:b0:52c:deb9:904b with SMTP id 2adb3069b0e04-53b3491e062mr12333000e87.38.1730287698209; Wed, 30 Oct 2024 04:28:18 -0700 (PDT) Received: from eisenberg.fritz.box ([2001:16b8:3db7:f800:98bb:372a:45f9:41e4]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9b30f58991sm557324566b.159.2024.10.30.04.28.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 04:28:17 -0700 (PDT) From: Philipp Stanner To: Jonathan Corbet , Damien Le Moal , Niklas Cassel , Giovanni Cabiddu , Herbert Xu , "David S. Miller" , Boris Brezillon , Arnaud Ebalard , Srujana Challa , Alexander Shishkin , Miri Korenblit , Kalle Valo , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Kevin Cernekee , Greg Kroah-Hartman , Jiri Slaby , Jaroslav Kysela , Takashi Iwai , Mark Brown , David Lechner , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Philipp Stanner , Jie Wang , Michal Witwicki , Przemek Kitszel , Adam Guerin , Damian Muszynski , Bharat Bhushan , Nithin Dabilpuram , Johannes Berg , Emmanuel Grumbach , Benjamin Berg , Breno Leitao , Yedidya Benshimol , Serge Semin , zhang jiao , Florian Fainelli , =?utf-8?q?Ilpo_J=C3=A4rvi?= =?utf-8?q?nen?= Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, linux-serial@vger.kernel.org, linux-sound@vger.kernel.org Subject: [PATCH v6 03/10] crypto: qat - replace deprecated PCI functions Date: Wed, 30 Oct 2024 12:27:36 +0100 Message-ID: <20241030112743.104395-4-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241030112743.104395-1-pstanner@redhat.com> References: <20241030112743.104395-1-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 pcim_iomap_table() and pcim_iomap_regions_request_all() have been deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Replace these functions with their successors, pcim_iomap() and pcim_request_all_regions(). Signed-off-by: Philipp Stanner Acked-by: Giovanni Cabiddu --- drivers/crypto/intel/qat/qat_420xx/adf_drv.c | 11 ++++++++--- drivers/crypto/intel/qat/qat_4xxx/adf_drv.c | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/intel/qat/qat_420xx/adf_drv.c b/drivers/crypto/intel/qat/qat_420xx/adf_drv.c index f49818a13013..788a11cdb34b 100644 --- a/drivers/crypto/intel/qat/qat_420xx/adf_drv.c +++ b/drivers/crypto/intel/qat/qat_420xx/adf_drv.c @@ -129,16 +129,21 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* Find and map all the device's BARS */ bar_mask = pci_select_bars(pdev, IORESOURCE_MEM) & ADF_GEN4_BAR_MASK; - ret = pcim_iomap_regions_request_all(pdev, bar_mask, pci_name(pdev)); + ret = pcim_request_all_regions(pdev, pci_name(pdev)); if (ret) { - dev_err(&pdev->dev, "Failed to map pci regions.\n"); + dev_err(&pdev->dev, "Failed to request PCI regions.\n"); goto out_err; } i = 0; for_each_set_bit(bar_nr, &bar_mask, PCI_STD_NUM_BARS) { bar = &accel_pci_dev->pci_bars[i++]; - bar->virt_addr = pcim_iomap_table(pdev)[bar_nr]; + bar->virt_addr = pcim_iomap(pdev, bar_nr, 0); + if (!bar->virt_addr) { + dev_err(&pdev->dev, "Failed to ioremap PCI region.\n"); + ret = -ENOMEM; + goto out_err; + } } pci_set_master(pdev); diff --git a/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c b/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c index 659905e45950..115eabfd1f6b 100644 --- a/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c +++ b/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c @@ -131,16 +131,21 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* Find and map all the device's BARS */ bar_mask = pci_select_bars(pdev, IORESOURCE_MEM) & ADF_GEN4_BAR_MASK; - ret = pcim_iomap_regions_request_all(pdev, bar_mask, pci_name(pdev)); + ret = pcim_request_all_regions(pdev, pci_name(pdev)); if (ret) { - dev_err(&pdev->dev, "Failed to map pci regions.\n"); + dev_err(&pdev->dev, "Failed to request PCI regions.\n"); goto out_err; } i = 0; for_each_set_bit(bar_nr, &bar_mask, PCI_STD_NUM_BARS) { bar = &accel_pci_dev->pci_bars[i++]; - bar->virt_addr = pcim_iomap_table(pdev)[bar_nr]; + bar->virt_addr = pcim_iomap(pdev, bar_nr, 0); + if (!bar->virt_addr) { + dev_err(&pdev->dev, "Failed to ioremap PCI region.\n"); + ret = -ENOMEM; + goto out_err; + } } pci_set_master(pdev);