Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6485133yba; Tue, 14 May 2019 08:19:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwftBELFUmkG/dGM2pOUZiWC7FEq8irYICK95bdQZFyjf8X5LpZ6hvRaKuzDlywqt0dRdm/ X-Received: by 2002:a17:902:b782:: with SMTP id e2mr39132204pls.228.1557847154012; Tue, 14 May 2019 08:19:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557847154; cv=none; d=google.com; s=arc-20160816; b=GSywsf719CcyeumAp1W0ev3FHkQykg5x2Hmleq/RoGr9eoHixQORcEqyD3A5TGqyhW yOxFg9dTxffQMv/mKUMCdX3TdmNsNmwFoV/PvNeHTAD0u6wN4IZTO6HBFS9AEdgj8nin AJzl8TVcSLp0Z+a1DMmtZUdNRTPIRqV5BfTDQ7P2kZkFocdbRvutZeoN5Jvy50B8+Krr uZzP4SnNF0W/OhDjyrRoQyq7faWPSLlOrQ3hHaUm0hIyuKj8XoLWGSf7WDmC0fu5KTeX gR3ecM44d+LZOW6COlG2/fpHTgrn5CaNP1VGmKNApIgkMahsnCbrfnDoQnlhHHKk7+ok x5Wg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=fBOr7ZERq98biPK1vqxtgZBvZpTMCMRjm1B045lyyLQ=; b=qm2bQ4vZA70vksFPUGQp6mU29y/tG0vR3TgSwi0Wa+HGvHUbt6JnJtbAtnfQziInxd hNzw44kcGkmc3MDyIGZktSroYxvIZn7hflbMlDIyyNuFCSxC/I6eXUkiZfBYf6Ji0onp z7PZ+U7wntc5Jc8Z/Qj2Ej7zPuRvQc8zJQgEuqEOvauZYfIpWxGkISzm5ooARtovO8lD LWGupNNQ8xeG5SrTYCAg8A6khlxhA451DxFoHqSKV6/8L/bv1qbmEvIpFoNHRBLfWNbV +3MwVXVG8Edl9Yo9iLV1BEf6aZnMEK8yBlojv7HbQyHD70Dk9T+k89TegkGO1PgG03Pv iDVQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s205si19474228pgs.467.2019.05.14.08.18.58; Tue, 14 May 2019 08:19:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbfENPRl (ORCPT + 99 others); Tue, 14 May 2019 11:17:41 -0400 Received: from foss.arm.com ([217.140.101.70]:57540 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbfENPRj (ORCPT ); Tue, 14 May 2019 11:17:39 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 71362374; Tue, 14 May 2019 08:17:39 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AFDAD3F703; Tue, 14 May 2019 08:17:37 -0700 (PDT) Subject: Re: [RFC PATCH v2 0/3] prerequisites for device reserved local mem rework To: laurentiu.tudor@nxp.com, hch@lst.de, stern@rowland.harvard.edu, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, marex@denx.de, noring@nocrew.org, JuergenUrban@gmx.de Cc: leoyang.li@nxp.com, linux-kernel@vger.kernel.org References: <20190514143807.7745-1-laurentiu.tudor@nxp.com> From: Robin Murphy Message-ID: <9d34015d-c219-179b-3141-4b0de3530ac3@arm.com> Date: Tue, 14 May 2019 16:17:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190514143807.7745-1-laurentiu.tudor@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Fredrik, Juergen On 14/05/2019 15:38, laurentiu.tudor@nxp.com wrote: > From: Laurentiu Tudor > > For HCs that have local memory, replace the current DMA API usage > with a genalloc generic allocator to manage the mappings for these > devices. > This is in preparation for dropping the existing "coherent" dma > mem declaration APIs. Current implementation was relying on a short > circuit in the DMA API that in the end, was acting as an allocator > for these type of devices. > > Only compiled tested, so any volunteers willing to test are most welcome. I recall an out-of-tree PlayStation 2 OHCI driver being another HCD_LOCAL_MEM user - if Fredrik and Juergen are still active on that, hopefully they might be able to comment on whether this approach can work for them too. Patchwork link just in case: https://patchwork.kernel.org/project/linux-usb/list/?series=117433 Robin. > > Thank you! > > For context, see thread here: https://lkml.org/lkml/2019/4/22/357 > > Changes in v2: > - use genalloc also in core usb (based on comment from Robin) > - moved genpool decl to usb_hcd to be accesible from core usb > > Laurentiu Tudor (3): > USB: use genalloc for USB HCs with local memory > usb: host: ohci-sm501: init genalloc for local memory > usb: host: ohci-tmio: init genalloc for local memory > > drivers/usb/core/buffer.c | 12 ++++++- > drivers/usb/host/ohci-hcd.c | 23 +++++++++++--- > drivers/usb/host/ohci-sm501.c | 60 +++++++++++++++++++---------------- > drivers/usb/host/ohci-tmio.c | 23 +++++++++----- > include/linux/usb/hcd.h | 3 ++ > 5 files changed, 80 insertions(+), 41 deletions(-) >