From patchwork Tue Sep 3 08:46:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11127405 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EC731395 for ; Tue, 3 Sep 2019 08:46:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F87F22DCC for ; Tue, 3 Sep 2019 08:46:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="JchuszWf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728306AbfICIqZ (ORCPT ); Tue, 3 Sep 2019 04:46:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34376 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbfICIqY (ORCPT ); Tue, 3 Sep 2019 04:46:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=A2X/lGbY6ny4Qh+4tWFl8dKaRYooojdfF0WMQcNmeAE=; b=JchuszWf/q9lBDyaxYo95Fdxc2 wcJkT0+3QL4v2MpRa/2Wrmc3Pc4uS0OymHAxcOVB1WqFYAwaZYfqobipoYPkWzF78MZHGSdto//oZ KQFwA9oS/WiFmEf2VnHxN2aH+ISCaq/rwyRCmCe4C9jY9LZOi9NO9nXHFWMgv1E2gQ6XksCT3oa/D 6OQu/CwR7/1GBZPso7+E+at+Sm2etoMmIlq4E2TR9ZirEjbzi5XyGvVqZr6A3ER9P1OHLARkUSZ1H jgnvq77YIrp95ZPGpTXo7pit65fJOMB7429JFlNndvRB6yXqMeg9k2/apb8IiMZIHvdUdvxq3DFZQ k9SP2bNQ==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i54SD-0003qv-58; Tue, 03 Sep 2019 08:46:21 +0000 From: Christoph Hellwig To: Greg Kroah-Hartman , Guenter Roeck , Lee Jones Cc: Alan Stern , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] usb/ohci-sm501: remove the HCD_DMA flag Date: Tue, 3 Sep 2019 10:46:10 +0200 Message-Id: <20190903084615.19161-2-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190903084615.19161-1-hch@lst.de> References: <20190903084615.19161-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This driver doesn't support normal DMA, only direct access to its local memory. Remove the HCD_DMA flag to properly express that fact. Fixes: 1e4946c4412e ("usb: add a HCD_DMA flag instead of guestimating DMA capabilities") Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig Tested-by: Guenter Roeck --- drivers/usb/host/ohci-sm501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index 0b2aea6e28d4..c158cda9e4b9 100644 --- a/drivers/usb/host/ohci-sm501.c +++ b/drivers/usb/host/ohci-sm501.c @@ -49,7 +49,7 @@ static const struct hc_driver ohci_sm501_hc_driver = { * generic hardware linkage */ .irq = ohci_irq, - .flags = HCD_USB11 | HCD_DMA | HCD_MEMORY, + .flags = HCD_USB11 | HCD_MEMORY, /* * basic lifecycle operations From patchwork Tue Sep 3 08:46:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11127413 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 037291395 for ; Tue, 3 Sep 2019 08:46:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDC3123400 for ; Tue, 3 Sep 2019 08:46:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="QlJ6KAk2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728358AbfICIq3 (ORCPT ); Tue, 3 Sep 2019 04:46:29 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34384 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728309AbfICIqZ (ORCPT ); Tue, 3 Sep 2019 04:46:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oKltuC+bB0pJtvp7qUclBSom6VtgzauxKPZ6u/A2tVA=; b=QlJ6KAk20XGkQDBVS98nV/rEN3 6Td6kdBXVqr9N0zcgE7xRDLUvdlVxBPRUH+s065LXXUY0/ukchTUvC9XCTzI0BFuqqbZTJV2kBOp7 JMjdXklo9soii250kn0j1raivpm13RZffrS+jqkHWeGFLKE0ABrO9RD5fauLQqzHb5K57Q92xBAv3 hFIn6LVBrlrb+hnwcfx5a6wmNxHLpGLY94B1ut95+1LrmuZcMMJ9rQpDr2ef8JAIDCz7tDH+tFkrB 8q6+Osk615QF2/2e7kA/37UMThCmBU+RxUnBHQcnoBiuuHjdENg9CqoBYp0/G/BUWKD22YFLnXJHR l+DK8KYQ==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i54SF-0003rU-BK; Tue, 03 Sep 2019 08:46:23 +0000 From: Christoph Hellwig To: Greg Kroah-Hartman , Guenter Roeck , Lee Jones Cc: Alan Stern , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] usb/ohci-tmio: remove the HCD_DMA flag Date: Tue, 3 Sep 2019 10:46:11 +0200 Message-Id: <20190903084615.19161-3-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190903084615.19161-1-hch@lst.de> References: <20190903084615.19161-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This driver doesn't support normal DMA, only direct access to its local memory. Remove the HCD_DMA flag to properly express that fact. Fixes: 1e4946c4412e ("usb: add a HCD_DMA flag instead of guestimating DMA capabilities") Signed-off-by: Christoph Hellwig --- drivers/usb/host/ohci-tmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c index 8edbacd3eb17..d5a293a707b6 100644 --- a/drivers/usb/host/ohci-tmio.c +++ b/drivers/usb/host/ohci-tmio.c @@ -153,7 +153,7 @@ static const struct hc_driver ohci_tmio_hc_driver = { /* generic hardware linkage */ .irq = ohci_irq, - .flags = HCD_USB11 | HCD_DMA | HCD_MEMORY, + .flags = HCD_USB11 | HCD_MEMORY, /* basic lifecycle operations */ .start = ohci_tmio_start, From patchwork Tue Sep 3 08:46:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11127415 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 266B41395 for ; Tue, 3 Sep 2019 08:46:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F0C232339D for ; Tue, 3 Sep 2019 08:46:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="urmie0jp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbfICIq2 (ORCPT ); Tue, 3 Sep 2019 04:46:28 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34406 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbfICIq2 (ORCPT ); Tue, 3 Sep 2019 04:46:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WowrPXJWXwRHe/ZfVy1xduZ4nYQkuT9srIDr2fzdgQ0=; b=urmie0jpX7kIOxzUC5bJPxUdzt 4QIxmuSU6F+JeljlXqUa4ZkB5j2RKtK4ouc1C5gEVrmHq54PZsrnY+XPqCdnDVdH1/nWMhIQ8DhVU FwGyFddo4xsQVaBtDxN8hI+YYKW9D+WcNjbUwHrwySdyQZMJ2et0BvebPmFRSButdTMNq5ry1I2HB hXZSX9NKZsuQMsIEErFVmQeL3lp/f/nIzHU8L6pRIvPcWj7evGqQgd6TlLIeUGLvPvooIwln31oCD AQ86ILYtYvBZyVa8TaHMlsjCzMdTniBBrZLX2RV8rbubyX6rFOIviivIXOIlj/9+Nmo+0tNmwR7Mq OB2JdhDQ==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i54SH-0003ro-GQ; Tue, 03 Sep 2019 08:46:25 +0000 From: Christoph Hellwig To: Greg Kroah-Hartman , Guenter Roeck , Lee Jones Cc: Alan Stern , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] usb-storage: use hcd_uses_dma to check for DMA capabilities Date: Tue, 3 Sep 2019 10:46:12 +0200 Message-Id: <20190903084615.19161-4-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190903084615.19161-1-hch@lst.de> References: <20190903084615.19161-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The dma_mask on its own doesn't mean much. Instead check for the actual flag. Signed-off-by: Christoph Hellwig --- drivers/usb/storage/scsiglue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 05b80211290d..7e0bc640c237 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -40,6 +40,7 @@ #include #include "usb.h" +#include #include "scsiglue.h" #include "debug.h" #include "transport.h" @@ -141,11 +142,10 @@ static int slave_configure(struct scsi_device *sdev) /* * Some USB host controllers can't do DMA; they have to use PIO. - * They indicate this by setting their dma_mask to NULL. For - * such controllers we need to make sure the block layer sets + * For such controllers we need to make sure the block layer sets * up bounce buffers in addressable memory. */ - if (!us->pusb_dev->bus->controller->dma_mask) + if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus))) blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_HIGH); /* From patchwork Tue Sep 3 08:46:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11127411 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5556214E5 for ; Tue, 3 Sep 2019 08:46:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34F7523431 for ; Tue, 3 Sep 2019 08:46:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="XSS6rWr6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728429AbfICIqb (ORCPT ); Tue, 3 Sep 2019 04:46:31 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34426 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728388AbfICIqa (ORCPT ); Tue, 3 Sep 2019 04:46:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4qtLPZ/aSLTeJY+KOJz9u948G4Y31mDFg0mnKh+tgA0=; b=XSS6rWr6nm3hI3nUzWLgrkPiDJ s3mVVveUNz8Pr37zpkzI30fd/vyx2O+2tOedMsPBTWp8SKhnuGtej6w8Oe5MtDeBRYE/VLoSHmj7k BxkskchsWMYAjkslu3fqY/G8XJubuyI36uH6lAsGbl1QGWWGSDC8sisoATN7gGPpCHcPKiyeX0/YO pmsUV0aHjKADatKf+bVTjjaeNbigsREPGdPduKB2YFMnkHQUbwusn1dtWqTNej+XD0Fjs7mZMuq3l 9WgW2+3LDd4AFPTLuzAIG5Ozd3Pt7rddD7bLHy+Xhe57wvpHaJK0DyXMwqGz+vqj2yQAwLRFx67EF 2OZP4A+w==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i54SJ-0003s6-Rj; Tue, 03 Sep 2019 08:46:28 +0000 From: Christoph Hellwig To: Greg Kroah-Hartman , Guenter Roeck , Lee Jones Cc: Alan Stern , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] usb: remove a stale comment in hcd_alloc_coherent Date: Tue, 3 Sep 2019 10:46:13 +0200 Message-Id: <20190903084615.19161-5-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190903084615.19161-1-hch@lst.de> References: <20190903084615.19161-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Now that we have the local memory pool implemented there is no need to use dma_declare_coherent_memory. Signed-off-by: Christoph Hellwig --- drivers/usb/core/hcd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index add2af4af766..4ccfc8e59604 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1249,9 +1249,6 @@ EXPORT_SYMBOL_GPL(usb_hcd_unlink_urb_from_ep); * To support host controllers with limited dma capabilities we provide dma * bounce buffers. This feature can be enabled by initializing * hcd->localmem_pool using usb_hcd_setup_local_mem(). - * For this to work properly the host controller code must first use the - * function dma_declare_coherent_memory() to point out which memory area - * that should be used for dma allocations. * * The initialized hcd->localmem_pool then tells the usb code to allocate all * data for dma using the genalloc API. From patchwork Tue Sep 3 08:46:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11127409 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F11A614E5 for ; Tue, 3 Sep 2019 08:46:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C800322DBF for ; Tue, 3 Sep 2019 08:46:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="LADrTaIL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728481AbfICIqd (ORCPT ); Tue, 3 Sep 2019 04:46:33 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34442 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728448AbfICIqc (ORCPT ); Tue, 3 Sep 2019 04:46:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=S41OOqXxO8zPAzI3PpNlItfxZvwx3OC+HSMNXC+BXd4=; b=LADrTaILYjCGBociB7xwvS3l3z 9aQEf6LUDeSPx50ISGXOdKxmBQ2sfAI10cDPmt6uwKlRQN44oGB3M53gcTMWpHPgn9xDct+d0Gwaa sRH8t3AeVUHX+14+zLPIGOMR0SJTQmX/0DMhgUDJ2Si2YkUTylL7rDzSf8kdTRkECUGtx5TOklB2Z APuUvWW5wtESDG6ZoojrhXsBlRMEU+aYhOaxXTaiObjHFtjLOV5S9hTg7I3K2sB57HoMc40ej6W2i dctZDqMuEVFQUR+qJG2FKQRV7lhvCI0ex55Qpt41aRxur3FxpK+hFY/mQGS2rQ9gF4bmPSO3ygaAZ q3khfkYQ==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i54SM-0003sq-2e; Tue, 03 Sep 2019 08:46:30 +0000 From: Christoph Hellwig To: Greg Kroah-Hartman , Guenter Roeck , Lee Jones Cc: Alan Stern , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] usb: remove commented out dma wrappers Date: Tue, 3 Sep 2019 10:46:14 +0200 Message-Id: <20190903084615.19161-6-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190903084615.19161-1-hch@lst.de> References: <20190903084615.19161-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org These wrappers have never seen use and have been commented out for a long time. Remove them for good. Signed-off-by: Christoph Hellwig --- drivers/usb/core/usb.c | 222 ----------------------------------------- 1 file changed, 222 deletions(-) diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 0ab8738047da..f16c26dc079d 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -933,228 +933,6 @@ void usb_free_coherent(struct usb_device *dev, size_t size, void *addr, } EXPORT_SYMBOL_GPL(usb_free_coherent); -/** - * usb_buffer_map - create DMA mapping(s) for an urb - * @urb: urb whose transfer_buffer/setup_packet will be mapped - * - * URB_NO_TRANSFER_DMA_MAP is added to urb->transfer_flags if the operation - * succeeds. If the device is connected to this system through a non-DMA - * controller, this operation always succeeds. - * - * This call would normally be used for an urb which is reused, perhaps - * as the target of a large periodic transfer, with usb_buffer_dmasync() - * calls to synchronize memory and dma state. - * - * Reverse the effect of this call with usb_buffer_unmap(). - * - * Return: Either %NULL (indicating no buffer could be mapped), or @urb. - * - */ -#if 0 -struct urb *usb_buffer_map(struct urb *urb) -{ - struct usb_bus *bus; - struct device *controller; - - if (!urb - || !urb->dev - || !(bus = urb->dev->bus) - || !(controller = bus->sysdev)) - return NULL; - - if (controller->dma_mask) { - urb->transfer_dma = dma_map_single(controller, - urb->transfer_buffer, urb->transfer_buffer_length, - usb_pipein(urb->pipe) - ? DMA_FROM_DEVICE : DMA_TO_DEVICE); - /* FIXME generic api broken like pci, can't report errors */ - /* if (urb->transfer_dma == DMA_ADDR_INVALID) return 0; */ - } else - urb->transfer_dma = ~0; - urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - return urb; -} -EXPORT_SYMBOL_GPL(usb_buffer_map); -#endif /* 0 */ - -/* XXX DISABLED, no users currently. If you wish to re-enable this - * XXX please determine whether the sync is to transfer ownership of - * XXX the buffer from device to cpu or vice verse, and thusly use the - * XXX appropriate _for_{cpu,device}() method. -DaveM - */ -#if 0 - -/** - * usb_buffer_dmasync - synchronize DMA and CPU view of buffer(s) - * @urb: urb whose transfer_buffer/setup_packet will be synchronized - */ -void usb_buffer_dmasync(struct urb *urb) -{ - struct usb_bus *bus; - struct device *controller; - - if (!urb - || !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP) - || !urb->dev - || !(bus = urb->dev->bus) - || !(controller = bus->sysdev)) - return; - - if (controller->dma_mask) { - dma_sync_single_for_cpu(controller, - urb->transfer_dma, urb->transfer_buffer_length, - usb_pipein(urb->pipe) - ? DMA_FROM_DEVICE : DMA_TO_DEVICE); - if (usb_pipecontrol(urb->pipe)) - dma_sync_single_for_cpu(controller, - urb->setup_dma, - sizeof(struct usb_ctrlrequest), - DMA_TO_DEVICE); - } -} -EXPORT_SYMBOL_GPL(usb_buffer_dmasync); -#endif - -/** - * usb_buffer_unmap - free DMA mapping(s) for an urb - * @urb: urb whose transfer_buffer will be unmapped - * - * Reverses the effect of usb_buffer_map(). - */ -#if 0 -void usb_buffer_unmap(struct urb *urb) -{ - struct usb_bus *bus; - struct device *controller; - - if (!urb - || !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP) - || !urb->dev - || !(bus = urb->dev->bus) - || !(controller = bus->sysdev)) - return; - - if (controller->dma_mask) { - dma_unmap_single(controller, - urb->transfer_dma, urb->transfer_buffer_length, - usb_pipein(urb->pipe) - ? DMA_FROM_DEVICE : DMA_TO_DEVICE); - } - urb->transfer_flags &= ~URB_NO_TRANSFER_DMA_MAP; -} -EXPORT_SYMBOL_GPL(usb_buffer_unmap); -#endif /* 0 */ - -#if 0 -/** - * usb_buffer_map_sg - create scatterlist DMA mapping(s) for an endpoint - * @dev: device to which the scatterlist will be mapped - * @is_in: mapping transfer direction - * @sg: the scatterlist to map - * @nents: the number of entries in the scatterlist - * - * Return: Either < 0 (indicating no buffers could be mapped), or the - * number of DMA mapping array entries in the scatterlist. - * - * Note: - * The caller is responsible for placing the resulting DMA addresses from - * the scatterlist into URB transfer buffer pointers, and for setting the - * URB_NO_TRANSFER_DMA_MAP transfer flag in each of those URBs. - * - * Top I/O rates come from queuing URBs, instead of waiting for each one - * to complete before starting the next I/O. This is particularly easy - * to do with scatterlists. Just allocate and submit one URB for each DMA - * mapping entry returned, stopping on the first error or when all succeed. - * Better yet, use the usb_sg_*() calls, which do that (and more) for you. - * - * This call would normally be used when translating scatterlist requests, - * rather than usb_buffer_map(), since on some hardware (with IOMMUs) it - * may be able to coalesce mappings for improved I/O efficiency. - * - * Reverse the effect of this call with usb_buffer_unmap_sg(). - */ -int usb_buffer_map_sg(const struct usb_device *dev, int is_in, - struct scatterlist *sg, int nents) -{ - struct usb_bus *bus; - struct device *controller; - - if (!dev - || !(bus = dev->bus) - || !(controller = bus->sysdev) - || !controller->dma_mask) - return -EINVAL; - - /* FIXME generic api broken like pci, can't report errors */ - return dma_map_sg(controller, sg, nents, - is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE) ? : -ENOMEM; -} -EXPORT_SYMBOL_GPL(usb_buffer_map_sg); -#endif - -/* XXX DISABLED, no users currently. If you wish to re-enable this - * XXX please determine whether the sync is to transfer ownership of - * XXX the buffer from device to cpu or vice verse, and thusly use the - * XXX appropriate _for_{cpu,device}() method. -DaveM - */ -#if 0 - -/** - * usb_buffer_dmasync_sg - synchronize DMA and CPU view of scatterlist buffer(s) - * @dev: device to which the scatterlist will be mapped - * @is_in: mapping transfer direction - * @sg: the scatterlist to synchronize - * @n_hw_ents: the positive return value from usb_buffer_map_sg - * - * Use this when you are re-using a scatterlist's data buffers for - * another USB request. - */ -void usb_buffer_dmasync_sg(const struct usb_device *dev, int is_in, - struct scatterlist *sg, int n_hw_ents) -{ - struct usb_bus *bus; - struct device *controller; - - if (!dev - || !(bus = dev->bus) - || !(controller = bus->sysdev) - || !controller->dma_mask) - return; - - dma_sync_sg_for_cpu(controller, sg, n_hw_ents, - is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); -} -EXPORT_SYMBOL_GPL(usb_buffer_dmasync_sg); -#endif - -#if 0 -/** - * usb_buffer_unmap_sg - free DMA mapping(s) for a scatterlist - * @dev: device to which the scatterlist will be mapped - * @is_in: mapping transfer direction - * @sg: the scatterlist to unmap - * @n_hw_ents: the positive return value from usb_buffer_map_sg - * - * Reverses the effect of usb_buffer_map_sg(). - */ -void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in, - struct scatterlist *sg, int n_hw_ents) -{ - struct usb_bus *bus; - struct device *controller; - - if (!dev - || !(bus = dev->bus) - || !(controller = bus->sysdev) - || !controller->dma_mask) - return; - - dma_unmap_sg(controller, sg, n_hw_ents, - is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); -} -EXPORT_SYMBOL_GPL(usb_buffer_unmap_sg); -#endif - /* * Notifications of device and interface registration */ From patchwork Tue Sep 3 08:46:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11127407 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2B9B1395 for ; Tue, 3 Sep 2019 08:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D337D22DBF for ; Tue, 3 Sep 2019 08:46:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="avP8nNbY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728508AbfICIqf (ORCPT ); Tue, 3 Sep 2019 04:46:35 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34454 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728496AbfICIqe (ORCPT ); Tue, 3 Sep 2019 04:46:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6pguZUqffeAIWG1P6RYECfJD+WZFqcyfjatQr1iJ62o=; b=avP8nNbYk/erK+VOiHrBGc5KyF mkzgA3hN/OmPaaxgqsUNLGf0YJqjmJ1UCXLxqrpXiFEeaOaCR+TuB0f19YXDg5UuWCjT75BzePIay XBF48xjmAFEoBQflJxuIEvNKnvH3sNdrhpYK8qPa7zpq5Rv0OtpccRahZgtIYf/ieGkm+hYFdYfg/ cl0C0RSY8yLLZf8jZQddmrNm+MKaSSsqB/liMsHnrU1411sjWZedyBizmF5FUkKhFQm7yol7pmqp9 YgCeN3JLabopP6XPQcI1stRS5q+hBDYl+oBgsta/RcN5illsOjXfFlN+MhZiDoJ5j01XYh5Y+eIhF /CUgW+/A==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i54SO-0003tL-80; Tue, 03 Sep 2019 08:46:32 +0000 From: Christoph Hellwig To: Greg Kroah-Hartman , Guenter Roeck , Lee Jones Cc: Alan Stern , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] mfd: don't select DMA_DECLARE_COHERENT for the sm501 and tc6393xb drivers Date: Tue, 3 Sep 2019 10:46:15 +0200 Message-Id: <20190903084615.19161-7-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190903084615.19161-1-hch@lst.de> References: <20190903084615.19161-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Now that these drivers use the usb localmem pool there is no need to select DMA_DECLARE_COHERENT. Signed-off-by: Christoph Hellwig --- drivers/mfd/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index f129f9678940..c8cbde59bbf6 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1105,7 +1105,6 @@ config MFD_SI476X_CORE config MFD_SM501 tristate "Silicon Motion SM501" depends on HAS_DMA - select DMA_DECLARE_COHERENT ---help--- This is the core driver for the Silicon Motion SM501 multimedia companion chip. This device is a multifunction device which may @@ -1714,7 +1713,6 @@ config MFD_TC6393XB select GPIOLIB select MFD_CORE select MFD_TMIO - select DMA_DECLARE_COHERENT help Support for Toshiba Mobile IO Controller TC6393XB