Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp472439yba; Wed, 15 May 2019 04:44:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFMD/o1IxlvyEBuEnpn2+jsS1tEjZs/CuAmQni/tdLfPw9kb8KmQ5WQvYhRmQrHGzHcR0h X-Received: by 2002:a17:902:9a03:: with SMTP id v3mr44861235plp.27.1557920694652; Wed, 15 May 2019 04:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920694; cv=none; d=google.com; s=arc-20160816; b=0I/1TrBLm+HoguUqILcQEjSqkP4o6TlvPpj6EhasmVkA3XbIZ99w/rmqkMXoNN717H ez7RACXt9TSrW/JirvgXwr7dwDj4CaNyAB7RZxqjaapf+S9wm+Gki1AD7jWdQe6fOivx Z/W8GbY1cgLjYJWdLrHenhEYFadey7BV2hD8w8G64C5uYngtTAVKrHQmqPxvAlRKcyTt BXeD3F9XzWeS5HFAoj8iRixMgQT/Oak4bnxaGXQJcaUkUZuZZ6yNKD/8JdQpZdDTz9Tw 4EWMmbPjMnla0XJUBvddPVzYFafZJ6zteFDT1dy7pHaWU+bplHazZD3/dfxLKu4ObMv6 yzFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MaehNJ3sGDlk/8k/4mIcKa2VR8I6Zy5P9i7x5XaXa8c=; b=MjUdDFtySbQalXoeA+TxXw22EskFKa6gdzSXtUslx0NxkJN3pqPBFhzhZA0ashzCOY VEk2u0DV/AWp8plvDdVyuSAth6A7tZcnFNGkvNbGjAQTUAL88vxAmJMtIEbdOKfFlomi mPeS2TD3zB8jkucjl1gzuG5Qi53jA+oOcKSCSyG4/WZXd5kRmFUnO5Gf50YnQF493ylF WOsLGyuwdyzzb24BKJr7KjZfaI7nUArx+bsl+SJgoDE+InBdG7bP7tedgqyzZeoAPfdP BNaYfpRNCgHFtxkeHAMKhpU0WyGrj1dhTubj0iNP7huH8okFH0wt56WLqepdin5fejwI gf7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mTfJgbh8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si1567349pgj.451.2019.05.15.04.44.40; Wed, 15 May 2019 04:44:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mTfJgbh8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732375AbfEOL2T (ORCPT + 99 others); Wed, 15 May 2019 07:28:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:39314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732362AbfEOL2R (ORCPT ); Wed, 15 May 2019 07:28:17 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3469020881; Wed, 15 May 2019 11:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919696; bh=2nKhsu9tMWEjLlvM99c5ERV5jFbUMSCrYu3qMJU9t5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mTfJgbh8/xT7Rr1JcB3FTwHiRzUpnCVywPs9Q6t7O1GoDusS39lmuzMft5GiHpYRz Ir326ioHlyZlC1euyn+i3wRykSJrxMjoKtdpvBwutjQLULtV842Rut301DBPR5EkCB kAHtBTofWcuaGoqIdwXyKKWZjXiR+MgUc7eOkmCk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Whitehead , Christoph Hellwig , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.0 058/137] scsi: aic7xxx: fix EISA support Date: Wed, 15 May 2019 12:55:39 +0200 Message-Id: <20190515090657.699637201@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 144ec97493af34efdb77c5aba146e9c7de8d0a06 ] Instead of relying on the now removed NULL argument to pci_alloc_consistent, switch to the generic DMA API, and store the struct device so that we can pass it. Fixes: 4167b2ad5182 ("PCI: Remove NULL device handling from PCI DMA API") Reported-by: Matthew Whitehead Signed-off-by: Christoph Hellwig Tested-by: Matthew Whitehead Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/aic7xxx/aic7770_osm.c | 1 + drivers/scsi/aic7xxx/aic7xxx.h | 1 + drivers/scsi/aic7xxx/aic7xxx_osm.c | 10 ++++------ drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c index 3d401d02c0195..bdd177e3d7622 100644 --- a/drivers/scsi/aic7xxx/aic7770_osm.c +++ b/drivers/scsi/aic7xxx/aic7770_osm.c @@ -91,6 +91,7 @@ aic7770_probe(struct device *dev) ahc = ahc_alloc(&aic7xxx_driver_template, name); if (ahc == NULL) return (ENOMEM); + ahc->dev = dev; error = aic7770_config(ahc, aic7770_ident_table + edev->id.driver_data, eisaBase); if (error != 0) { diff --git a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h index 5614921b4041a..88b90f9806c99 100644 --- a/drivers/scsi/aic7xxx/aic7xxx.h +++ b/drivers/scsi/aic7xxx/aic7xxx.h @@ -943,6 +943,7 @@ struct ahc_softc { * Platform specific device information. */ ahc_dev_softc_t dev_softc; + struct device *dev; /* * Bus specific device information. diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 3c9c17450bb39..d5c4a0d237062 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -860,8 +860,8 @@ int ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr, int flags, bus_dmamap_t *mapp) { - *vaddr = pci_alloc_consistent(ahc->dev_softc, - dmat->maxsize, mapp); + /* XXX: check if we really need the GFP_ATOMIC and unwind this mess! */ + *vaddr = dma_alloc_coherent(ahc->dev, dmat->maxsize, mapp, GFP_ATOMIC); if (*vaddr == NULL) return ENOMEM; return 0; @@ -871,8 +871,7 @@ void ahc_dmamem_free(struct ahc_softc *ahc, bus_dma_tag_t dmat, void* vaddr, bus_dmamap_t map) { - pci_free_consistent(ahc->dev_softc, dmat->maxsize, - vaddr, map); + dma_free_coherent(ahc->dev, dmat->maxsize, vaddr, map); } int @@ -1123,8 +1122,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa host->transportt = ahc_linux_transport_template; - retval = scsi_add_host(host, - (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); + retval = scsi_add_host(host, ahc->dev); if (retval) { printk(KERN_WARNING "aic7xxx: scsi_add_host failed\n"); scsi_host_put(host); diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index 0fc14dac7070c..717d8d1082ce1 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c @@ -250,6 +250,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } } ahc->dev_softc = pci; + ahc->dev = &pci->dev; error = ahc_pci_config(ahc, entry); if (error != 0) { ahc_free(ahc); -- 2.20.1