Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1091158ybm; Tue, 21 May 2019 08:30:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfQ7HFo/mvnqrMUFzqMtK7AyNHcxBrL0mCnTyoVPA2IRjA3r+OZNnnMWrt8DmFjkpNYj4/ X-Received: by 2002:aa7:9203:: with SMTP id 3mr89047249pfo.123.1558452615613; Tue, 21 May 2019 08:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558452615; cv=none; d=google.com; s=arc-20160816; b=qtjfKtALahht6CvvFKMeQibqoP9yBeumh61/RBZ3J2JI+bOceO6lbYleo4/0pE8O/v Ti2Gd6hhwvGj6CPdFcOAAbvsCgeTt09PT+aDzsLY1nKpoMqqy35zg6k+xhYf6tB+NUKE 8YetPkWyMWj1+FRVWSi9UIJON2bU6S2Jdd8m2QJNKoyxRjmf7gECzC7XZgxdYE5gNASO gdSc4xerc3kHoJIdULoRxU9yjx3jVnEc6f2tz2+zXXojFBIXgn97BpbKwCcI93McQ+YE CwXpG6HGe8d3o1BeamP00nHrT5ztU7axnN8dl5FMfmmTqENMfug0iMakCSSv/uYSDDre xfIw== 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=Fx5kDTOtec1256A2C1HiyO33FO9Ebq8Sp1A0LVu0nZg=; b=dn6G9g3uJ1uL8hQfKeVF/eJFc+xYRuNzhd50DOh4vyNPewo6iXrqItFZY1iIKldVxX Rlz7AReQF796weySOWbivm+jIGdoeL9eJfkc/UP81yz1e7xh8DDYc8AgTr6/tWhGSpAM 1kJwB7nzx70TmXdTkh/R9JlEBp4RvmVuXQtTv5+jhZgiKr4GLjyCR/3oRL2Oj2KlAzJc 6L35WbHj3GBOzSyHrpdqAeUCWDHg2RFLAEj1PfRN68B5OFLkPcCWwgoV4fk2PWxBUvyu zmO7cOh4K7EVEBR8RI0b+JQL+1HJ3bmVRq4k2HiHSe/h+mDQWcl0sDiKlTcZ8ipt9d9h csLg== 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 m191si7444373pga.17.2019.05.21.08.29.58; Tue, 21 May 2019 08:30:15 -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 S1728306AbfEUP1r (ORCPT + 99 others); Tue, 21 May 2019 11:27:47 -0400 Received: from pio-pvt-msa2.bahnhof.se ([79.136.2.41]:50146 "EHLO pio-pvt-msa2.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727044AbfEUP1r (ORCPT ); Tue, 21 May 2019 11:27:47 -0400 Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTP id A52EE3F847; Tue, 21 May 2019 17:27:44 +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 pio-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pXdB0DCDnpoE; Tue, 21 May 2019 17:27:44 +0200 (CEST) Received: from localhost (h-41-252.A163.priv.bahnhof.se [46.59.41.252]) (Authenticated sender: mb547485) by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 9932C3F73E; Tue, 21 May 2019 17:27:43 +0200 (CEST) Date: Tue, 21 May 2019 17:27:43 +0200 From: Fredrik Noring To: laurentiu.tudor@nxp.com Cc: hch@lst.de, stern@rowland.harvard.edu, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, marex@denx.de, leoyang.li@nxp.com, linux-kernel@vger.kernel.org, robin.murphy@arm.com, JuergenUrban@gmx.de Subject: Re: [PATCH v5 2/5] USB: use genalloc for USB HCs with local memory Message-ID: <20190521152743.GA4693@sx9> References: <20190521140748.20012-1-laurentiu.tudor@nxp.com> <20190521140748.20012-3-laurentiu.tudor@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190521140748.20012-3-laurentiu.tudor@nxp.com> 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 Thanks Laurentiu! > --- a/include/linux/usb/hcd.h > +++ b/include/linux/usb/hcd.h > @@ -216,6 +216,9 @@ struct usb_hcd { > #define HC_IS_RUNNING(state) ((state) & __ACTIVE) > #define HC_IS_SUSPENDED(state) ((state) & __SUSPEND) > > + /* allocator for HCs having local memory */ > + struct gen_pool *localmem_pool; > + I have tested patches 1, 2 and 5, and they seem to work. Nice! May I suggest clarifying the NULL pointers? I think that may help someone debugging or maintaining this in the future. Something like this: --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -385,6 +385,8 @@ struct ohci_hcd { /* * memory management for queue data structures + * + * @td_cache and @ed_cache are %NULL if &usb_hcd.localmem_pool is used. */ struct dma_pool *td_cache; struct dma_pool *ed_cache; --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -211,7 +211,7 @@ struct usb_hcd { #define HC_IS_RUNNING(state) ((state) & __ACTIVE) #define HC_IS_SUSPENDED(state) ((state) & __SUSPEND) - /* allocator for HCs having local memory */ + /* allocator for HCs having local memory, or %NULL */ struct gen_pool *localmem_pool; /* more shared queuing code would be good; it should support Fredrik