[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190614142816.GA2574@sx9>
Date: Fri, 14 Jun 2019 16:28:16 +0200
From: Fredrik Noring <noring@...rew.org>
To: Guenter Roeck <linux@...ck-us.net>
Cc: laurentiu.tudor@....com, hch@....de, stern@...land.harvard.edu,
gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
marex@...x.de, leoyang.li@....com, linux-kernel@...r.kernel.org,
robin.murphy@....com, JuergenUrban@....de
Subject: Re: [PATCH v7 3/5] usb: host: ohci-sm501: init genalloc for local
memory
Hi Guenter,
> You are right, the patch below fixes the problem. I did not get the warning
> with order==5. Nevertheless, I also tested with order==8; that works as well.
>
> Thanks a lot for tracking this down!
You are welcome, and thanks for your report!
This patch series needs some redesign, I think, because the problem you
reported would come back if one attaches two or more devices to the
system. Local memory devices are typically memory constrained and so it
has to be used efficiently. I believe there are four kinds of alignments
to consider when memory is allocated in the pool:
- 256 bytes for the host controller communication area (HCCA);
- 32 bytes for the general transfer descriptors (TDs);
- 16 bytes for the endpoint descriptors (EDs);
- buffer alignment for data.
Using the greatest common alignment for all is clearly an undesirable
regression. The TDs and EDs could have their own subpools, perhaps, as
they are abundant. There is only one instance of the HCCA.
As mentioned, the USB subsystem could be improved to properly report
allocation failures, and the logic to retry allocations could be more
efficient by avoiding polling loops.
Fredrik
Powered by blists - more mailing lists