Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp746937yba; Thu, 16 May 2019 08:18:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwXdqORaC0PavzkPd7oA0rfIHVH8ockrMOBexvdBWQa1ouPTgQXTE8I1vvSk0PRpR5mwGl X-Received: by 2002:a17:902:22:: with SMTP id 31mr51604667pla.15.1558019882745; Thu, 16 May 2019 08:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558019882; cv=none; d=google.com; s=arc-20160816; b=OvU3o9xOTgjQPZmOMWnEy9tNJIxAYzLFb8hw6c5Tvirbj0IDig7vRPAEquSgTSgQo2 8b0A5HzbGvd8LDr1BQvSj6JBc9lSu/1f8bNhZa/88VySmjSa5IGsr0lBNxoZZKno2lWb oiAOhMDijBYFf/V34DmcqNb4qwoGO/xdxCSh9s7Y3QJ4k2+U8EIT+JwjpkgLP/59jhvO 5W8apyB28arGT0OQR3caEexnAc2s0iZrEgOv3R4gs3eqGsTeXF8kiufrQUkCGYyYR3bY iVmMaKRQN9tEDbXHNWBmGIC3x6xJSkbD11kNjkOJMXroLlU+KYpK9JrgivckXWbgviHo Kw3g== 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; bh=/k2PR9dDSeDq4UiiYFymZ+c0b/PnMnhzEOvCSGO9TEs=; b=kstMJpm9/7LMeEX16lMuvPFoyUBFXu2r6FkHM4mci8DCUOAmblgoJmdW6P2of7/PhJ MHOTnIqk5cya/YX+EScQh9hZPWE/gkaBIInfI8/ieIdHivvSnI7ntLzsCSY5RfbjFaTG 5BxBhuOkmh6DOUSTdLjHST14oTQXqp/Fjmh+yyjWQYwjDW087mju3+eMe3i5OAnO6iKZ ceYVG4nhNTNhFHdtQthG4amNGGKRmH0n07LWnJBf8IBXIueeXyl4GpeQcnojmGJ0qD6n Yq6T6YOh47R+MTRSZmoFpa0K2F69l9ciW3ntJzJgKLBwuDShMrb93prmyt4lQF9856S2 YTXQ== 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 u28si5885754pfl.138.2019.05.16.08.17.45; Thu, 16 May 2019 08:18:02 -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 S1727294AbfEPPP5 (ORCPT + 99 others); Thu, 16 May 2019 11:15:57 -0400 Received: from ste-pvt-msa2.bahnhof.se ([213.80.101.71]:25841 "EHLO ste-pvt-msa2.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbfEPPP4 (ORCPT ); Thu, 16 May 2019 11:15:56 -0400 Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 308A33F7BB; Thu, 16 May 2019 17:15:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-999 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rg8RyAX5x_3t; Thu, 16 May 2019 17:15:48 +0200 (CEST) Received: from localhost (h-41-252.A163.priv.bahnhof.se [46.59.41.252]) (Authenticated sender: mb547485) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 7DC0A3F5A0; Thu, 16 May 2019 17:15:48 +0200 (CEST) Date: Thu, 16 May 2019 17:15:48 +0200 From: Fredrik Noring To: Laurentiu Tudor Cc: Robin Murphy , "hch@lst.de" , "stern@rowland.harvard.edu" , "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , "marex@denx.de" , "JuergenUrban@gmx.de" , Leo Li , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH v2 0/3] prerequisites for device reserved local mem rework Message-ID: <20190516151548.GB53952@sx9> References: <20190514143807.7745-1-laurentiu.tudor@nxp.com> <9d34015d-c219-179b-3141-4b0de3530ac3@arm.com> <20190514182931.GA2559@sx9> <0e5f3b86-7a80-eec7-691b-34a123194208@nxp.com> <20190515162858.GB17162@sx9> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laurentiu, > I took your code, added the missing mapping and placed it in a patch. > Please see attached (compile tested only). Thanks! Unfortunately, the OHCI fails with errors such as usb 1-1: device descriptor read/64, error -12 that I tracked down to the calls hub_port_init -> usb_control_msg -> usb_internal_control_msg -> usb_start_wait_urb -> usb_submit_urb -> usb_hcd_submit_urb -> hcd->driver->urb_enqueue -> ohci_urb_enqueue -> ed_get -> ed_alloc -> dma_pool_zalloc -> dma_pool_alloc -> pool_alloc_page, which returns NULL. Then I noticed /* pool_alloc_page() might sleep, so temporarily drop &pool->lock */ that might be a problem considering that the HCD handles pool memory in IRQ handlers, for instance: do_IRQ -> generic_handle_irq -> handle_level_irq -> handle_irq_event -> handle_irq_event_percpu -> __handle_irq_event_percpu -> usb_hcd_irq -> ohci_irq -> ohci_work -> finish_urb -> __usb_hcd_giveback_urb -> usb_hcd_unmap_urb_for_dma -> hcd_buffer_free Also, DMA_BUFFER_SIZE in ohci-ps2.c is only 256 KiB in total. Is the new pool implementation at least as efficient as the previous one? Fredrik