Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1326716ybg; Wed, 29 Jul 2020 11:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJPcL77Q7PdfxnSXmXwmi254Tw7MgoGcYJQnBvPxAAeDTrE+oE/gAwQvn1F6zhxn+t8Xw3 X-Received: by 2002:a17:906:ef2:: with SMTP id x18mr30976456eji.547.1596046264478; Wed, 29 Jul 2020 11:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596046264; cv=none; d=google.com; s=arc-20160816; b=c0Y5mwsKJhpRYB+o9biR+23nfOQ4XFmOnylOG2UhenhJnp5azrgyzQ8G91zgP09kWb qAs8XiTPLwZt65i8h1GhbS2B6PBiCakk3lz5zzs+++2oGrfxSMKjczBUzFUsjReY846l 3CZSGhl6FUgTB/rsclpAh6uzSrJhvDP2PNIgl1uBNDrm4OCYi8uhEmPsw/EKhvQMV8hS R7AK11Vk4mAAqwR2m0zghfzSc8hI78W33cq5VBrDJaBUtRXTyf1FE1sIFYobQNYS/u7m Ia9Ad4U5q66uknx9lUBnWRkX4q3bAtppAI3lH9njgz57Msfv5FfS7Up4lXAAd5aYobGK 7vQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1Krxl1GvFbA1WWD9zXx5UhETQ4OJ61M+EH3cH8paiuk=; b=YZ8Nt/LTa/QOzHSBoCUj3QGXK8HQm65atCF3jr3eI99MVMDpxXoayB+/zRvvzcG694 FwpYLLNcDMumeTVT4dTYSCI52N58dG/5elKN7uDQRzRlgFAuHahA6eSGzvTRSjif9HZ1 vLyODyCDtE0xCVHVbGcOTcZ8yhP0kI2rhQpgsKPMkM/753+Zo8MZ2OjAMQ/co7wG8Juo I7MhE/v9+vUPnSeHzznh7FRChPvqWjyaPJMrxa+9+ikukbI02bbYCt7Dms/e1hSaP0F7 b5Y8ay9f+03alBgM/8+D+QdBSjORZUcfwlj6EQPgp/NPBtePQvJkgE69uXPj6P4ifxY2 2Tyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UlDkrCz5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x94si1980475ede.416.2020.07.29.11.10.41; Wed, 29 Jul 2020 11:11:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UlDkrCz5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbgG2SHi (ORCPT + 99 others); Wed, 29 Jul 2020 14:07:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbgG2SHi (ORCPT ); Wed, 29 Jul 2020 14:07:38 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17224C061794; Wed, 29 Jul 2020 11:07:38 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id d4so14695856pgk.4; Wed, 29 Jul 2020 11:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1Krxl1GvFbA1WWD9zXx5UhETQ4OJ61M+EH3cH8paiuk=; b=UlDkrCz5awqZE0HM0RaCzHfiq0jfLK0AXl6ZeG0o0voJ8ynShSEAZwEiChOHJrNHZB wICpuZpxZ6AjcNfygmgRHR2EeMGhnWl2Con4e0OUjgb7m/fL10YjgeRaYtL8VDXzwy4I U2gzW40r1PcsOvsTWNJ6NdILKgSXEfVehzFYshg3lQKXv4ZgI/g43MCR1drmNpJoj8en JMUMXU4aanI3OlyROTeY26gWAUGeh4DIOqsJlYM706LnHnYX0FVKl8wXaAWSjnKBz/qg wwbfcWA8lN4P51Ftuoex1E+WtoQoXgmgkiLfSGIUJKUQVnCplTXvv8QfhCn50TzfCgIT g2+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1Krxl1GvFbA1WWD9zXx5UhETQ4OJ61M+EH3cH8paiuk=; b=dXKOT6qSYIGzia9k7vLElrCPhnvcmFh57NSghFEoH1H1Yip3iwsWNOXSbF0yL4QOcH eLGok8p1QHT1k/IORmL8i4r/+XDPT+mo7ndrAHtOvfvYSX3wSFe98V/bMxLx0CH6y8/9 fvgcOaooULZUa885yceSzrcd/RutDZ6JgSWaBZyZ9haA7uRunAdLifGzFG0qP5pUjaqd IHf374/Xvo6jE41X3u8PoOnoQIujZsKKiTN0X1DIiFxJB83GuupKdZX/KXNVwzqy8BDR rj2a87NmEHv5vTbv6wyjjGtfy6HPJBVknBpGPjpFrBIt+SSdaQK3n4NonEuBvLqxOkVw kNgw== X-Gm-Message-State: AOAM530c07jI/4a2F39WAh/ifYExGVKBEuy664MNZig/g+cqiUIIaFLM lvM2fWlE7hZtqzbhetsGGOE= X-Received: by 2002:a63:6c1:: with SMTP id 184mr31367480pgg.262.1596046057615; Wed, 29 Jul 2020 11:07:37 -0700 (PDT) Received: from blackclown ([103.88.82.91]) by smtp.gmail.com with ESMTPSA id s18sm3109246pfd.132.2020.07.29.11.07.34 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Jul 2020 11:07:36 -0700 (PDT) Date: Wed, 29 Jul 2020 23:37:24 +0530 From: Suraj Upadhyay To: jejb@linux.ibm.com, martin.petersen@oracle.com, hare@suse.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@linux-kernel.org Subject: [PATCH 2/7] scsi: aic7xxx: Remove pci-dma-compat wrapper APIs. Message-ID: <790a8751b5c2b5393c3021b8def08e47bb1597c0.1596045683.git.usuraj35@gmail.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The legacy API wrappers in include/linux/pci-dma-compat.h should go away as it creates unnecessary midlayering for include/linux/dma-mapping.h APIs. Instead use dma-mapping.h APIs directly. The patch has been generated with the coccinelle script below. And has been hand modified to replace each GFP_ with the correct flag depending upon the context. Compile-tested. @@@@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@@@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@@@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@@@ - PCI_DMA_NONE + DMA_NONE @@ expression E1, E2, E3; @@ - pci_alloc_consistent(E1, E2, E3) + dma_alloc_coherent(&E1->dev, E2, E3, GFP_) @@ expression E1, E2, E3; @@ - pci_zalloc_consistent(E1, E2, E3) + dma_alloc_coherent(&E1->dev, E2, E3, GFP_) @@ expression E1, E2, E3, E4; @@ - pci_free_consistent(E1, E2, E3, E4) + dma_free_coherent(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_map_single(E1, E2, E3, E4) + dma_map_single(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_unmap_single(E1, E2, E3, E4) + dma_unmap_single(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4, E5; @@ - pci_map_page(E1, E2, E3, E4, E5) + dma_map_page(&E1->dev, E2, E3, E4, E5) @@ expression E1, E2, E3, E4; @@ - pci_unmap_page(E1, E2, E3, E4) + dma_unmap_page(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_map_sg(E1, E2, E3, E4) + dma_map_sg(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_unmap_sg(E1, E2, E3, E4) + dma_unmap_sg(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_single_for_cpu(E1, E2, E3, E4) + dma_sync_single_for_cpu(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_single_for_device(E1, E2, E3, E4) + dma_sync_single_for_device(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_sg_for_cpu(E1, E2, E3, E4) + dma_sync_sg_for_cpu(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_sg_for_device(E1, E2, E3, E4) + dma_sync_sg_for_device(&E1->dev, E2, E3, E4) @@ expression E1, E2; @@ - pci_dma_mapping_error(E1, E2) + dma_mapping_error(&E1->dev, E2) @@ expression E1, E2; @@ - pci_set_consistent_dma_mask(E1, E2) + dma_set_coherent_mask(&E1->dev, E2) @@ expression E1, E2; @@ - pci_set_dma_mask(E1, E2) + dma_set_mask(&E1->dev, E2) Signed-off-by: Suraj Upadhyay --- drivers/scsi/aic7xxx/aic79xx_osm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic7= 9xx_osm.c index d019e3f2bb9b..7599eec08bf2 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -952,8 +952,8 @@ int ahd_dmamem_alloc(struct ahd_softc *ahd, bus_dma_tag_t dmat, void** vaddr, int flags, bus_dmamap_t *mapp) { - *vaddr =3D pci_alloc_consistent(ahd->dev_softc, - dmat->maxsize, mapp); + *vaddr =3D dma_alloc_coherent(&ahd->dev_softc->dev, dmat->maxsize, mapp, + GFP_ATOMIC); if (*vaddr =3D=3D NULL) return (ENOMEM); return(0); @@ -963,8 +963,7 @@ void ahd_dmamem_free(struct ahd_softc *ahd, bus_dma_tag_t dmat, void* vaddr, bus_dmamap_t map) { - pci_free_consistent(ahd->dev_softc, dmat->maxsize, - vaddr, map); + dma_free_coherent(&ahd->dev_softc->dev, dmat->maxsize, vaddr, map); } =20 int --=20 2.17.1 --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE7AbCa0kOsMJ4cx0j+gRsbIfe744FAl8hutsACgkQ+gRsbIfe 745duBAAkXYF7tWrnY8CRU1qgU5+Q8BEsnJe6jHa4k5Fgj/9MrGGxO66rCaQlWKZ 2ggk7psvFy0ovS+KVbygAN6i6uSRrBx7C5jIeyjRu8RJ72ODNcjXyUA2E8JJKPS/ k3YEHYGCPDSqRxuM/nZCrU3NtxTFe6UVLVf06H/OhO9ocOIWksOGq7Dk9CZpLeOr ew4GLuYczWWdrCO4lYoAu82Q7xNcREwF7dKxxy/YOobkazyMkXGloeI43kL3d4RU P88NKCKsafIZc96F8EwafTQRlT95BM8yR6t9Yx8fy+pQzkEJptYwIOCkMvcUZ3/y uBBeIlnTZulqQ+s5XuoiI+ZNu9Vk2JMLmcnPWuydqKN3h4IJQuFRmNzHyBDL87x4 Iix9qocZtlwjr1Sz8PMLOZ7vuYbOcryANkystbeeqgwIdMi7nrWDt3xTxUcozOEc nugh942pt0plNBSlX5qXwsZeen+oA4nEMuv+BCBAa25EjksBi8D2COpigWNMtPSc 3xT8RJ5o371Y/5WDGw/7WoNW9tXyPlnkrZkBMk35UJ0mqtd5FV3XV/r1GNPJiVAg HxG9KxgehdWFiSlDgaWSyDoFFdZxqEXOq+8RTfqEKAAs0niC9pXfGx+kxcdx9JuB t1g4U2v/+GH6tSGSGEfzEbSyJH5HyeC/jUOoTEo8bTS0dH9ZpaI= =P43Z -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm--