From: Stefan Bruens Date: Sun, 27 Dec 2015 23:17:55 +0100 Subject: [U-Boot] [PATCH v3 2/5] usb: dwc2: Use shared wait_for_bit In-Reply-To: <1451237293-24497-3-git-send-email-mateusz.kulikowski@gmail.com> References: <1451237293-24497-1-git-send-email-mateusz.kulikowski@gmail.com> <1451237293-24497-3-git-send-email-mateusz.kulikowski@gmail.com> Message-ID: <181436916.aXENOq8L9R@pebbles.site> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sonntag, 27. Dezember 2015 18:28:09 CET Mateusz Kulikowski wrote: > Use existing library function to poll bit(s). > > Signed-off-by: Mateusz Kulikowski It might be useful to have not only a relative timeout, but also an absolute timeout. For dwc2, the timeout handling could be moved from the transactions wrappers to the chunk_msg function. As the USB timeouts are specified for the whole transaction, it would be very neat to calculate one deadline for the whole transaction and hand this absolute timeout to the wait_for_bit(..) function. At the end, this would also result in less code. Kind regards, Stefan -- Stefan Br?ns / Bergstra?e 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019 work: +49 2405 49936-424