Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6139743ybi; Wed, 29 May 2019 03:30:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2JggFOmDg+TInobUK+KZYSRQoQBABiZMpjvZBTOVulY3Od7UcROfdLGlNaxaHvu7Lqddz X-Received: by 2002:a65:620d:: with SMTP id d13mr7713874pgv.109.1559125838737; Wed, 29 May 2019 03:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559125838; cv=none; d=google.com; s=arc-20160816; b=nljGNX08QbIQNjNcONzXCPzJGmV4TBFXMJUI66ZgjHuOFxaygzoK0N8FTCnY7ysw9+ rUwcipvy4NBxzn0VRvFABneHvU0rOo+YMqk7oTnYhUGwOdahrFkFMm1LHI1pjVbea9CL o6Y98lr1BYEJHBrWAkA3+0N3ugsow9FgCblnBOC7565T6AFM6vJhKtlfUSxn50j3P68S f7xCcdx4Ml8CT5XOoWNjfoJsFSLtsnNiFdM7JhOyQk+L4I3kvJbPA445LyTN4c9BSXf8 kmbGG9ZMXDyKb+IScq0g7aUU4dAiKhnKuoFOnjaPQxNm4sQ4U/5mtwaaifkgwlVAWvuw IkmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Yq3pTKL8zU834LLiGKml+yIw7V5gK2KuW169RTEbPwo=; b=qZ817H+NmDGi9blrYPa82JYdeiJ/dLaGOWPhQG+uHJIieKPRSZz1K+lG8rC6PSFL9f bmKdnKM2DrDJjIgQ2KWVvts7mF8VDv6ZxznyxEmLD6J8C/B9LBA2acGxTG/vZxRxcUFU ZIetqiygYAdR7UYQ7vT1b9gETv68YjRgQXhEb7sEHOqgHpNij0NGPfjUOqJ7V0/2ho03 g8yZFfljK71UjqnGQZoeqC1MCiwwBy6yF8hA+a/K15QeqsEd5TIa88eWi0dG9PdcLIsm n7ugmg62Xk/2yu3vM94ocKYc+Ci1pCN9byqnOA/dKeclHnTMEylxVhci/o99Tb6hhijw HzjQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si24967877pgj.57.2019.05.29.03.30.22; Wed, 29 May 2019 03:30:38 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726893AbfE2K24 (ORCPT + 99 others); Wed, 29 May 2019 06:28:56 -0400 Received: from inva021.nxp.com ([92.121.34.21]:51924 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726776AbfE2K2z (ORCPT ); Wed, 29 May 2019 06:28:55 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D380C2003EC; Wed, 29 May 2019 12:28:52 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D07112003F3; Wed, 29 May 2019 12:28:52 +0200 (CEST) Received: from fsr-ub1864-101.ea.freescale.net (fsr-ub1864-101.ea.freescale.net [10.171.82.13]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 512F7205E4; Wed, 29 May 2019 12:28:52 +0200 (CEST) From: laurentiu.tudor@nxp.com To: hch@lst.de, stern@rowland.harvard.edu, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, marex@denx.de Cc: leoyang.li@nxp.com, linux-kernel@vger.kernel.org, robin.murphy@arm.com, noring@nocrew.org, JuergenUrban@gmx.de, Laurentiu Tudor Subject: [PATCH v7 4/5] usb: host: ohci-tmio: init genalloc for local memory Date: Wed, 29 May 2019 13:28:42 +0300 Message-Id: <20190529102843.13174-5-laurentiu.tudor@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190529102843.13174-1-laurentiu.tudor@nxp.com> References: <20190529102843.13174-1-laurentiu.tudor@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Laurentiu Tudor In preparation for dropping the existing "coherent" dma mem declaration APIs, replace the current dma_declare_coherent_memory() based mechanism with the creation of a genalloc pool that will be used in the OHCI subsystem as replacement for the DMA APIs. For context, see thread here: https://lkml.org/lkml/2019/4/22/357 Signed-off-by: Laurentiu Tudor --- drivers/usb/host/ohci-tmio.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c index f88a0370659f..3b84ce0c3f29 100644 --- a/drivers/usb/host/ohci-tmio.c +++ b/drivers/usb/host/ohci-tmio.c @@ -224,11 +224,6 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev) goto err_ioremap_regs; } - ret = dma_declare_coherent_memory(&dev->dev, sram->start, sram->start, - resource_size(sram)); - if (ret) - goto err_dma_declare; - if (cell->enable) { ret = cell->enable(dev); if (ret) @@ -239,6 +234,11 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev) ohci = hcd_to_ohci(hcd); ohci_hcd_init(ohci); + ret = usb_hcd_setup_local_mem(hcd, sram->start, sram->start, + resource_size(sram)); + if (ret < 0) + goto err_enable; + ret = usb_add_hcd(hcd, irq, 0); if (ret) goto err_add_hcd; @@ -254,8 +254,6 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev) if (cell->disable) cell->disable(dev); err_enable: - dma_release_declared_memory(&dev->dev); -err_dma_declare: iounmap(hcd->regs); err_ioremap_regs: iounmap(tmio->ccr); @@ -276,7 +274,6 @@ static int ohci_hcd_tmio_drv_remove(struct platform_device *dev) tmio_stop_hc(dev); if (cell->disable) cell->disable(dev); - dma_release_declared_memory(&dev->dev); iounmap(hcd->regs); iounmap(tmio->ccr); usb_put_hcd(hcd); -- 2.17.1