From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFRgY-0005Iu-AB for barebox@lists.infradead.org; Tue, 12 Mar 2013 16:04:19 +0000 Received: by mail-la0-f46.google.com with SMTP id fq12so5425118lab.33 for ; Tue, 12 Mar 2013 09:03:55 -0700 (PDT) MIME-Version: 1.0 From: "Renaud C." Date: Tue, 12 Mar 2013 17:03:15 +0100 Message-ID: Content-Type: multipart/mixed; boundary=f46d04083f2dc546c804d7bc6f3e List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 4/7] AT91 UDC, fix recursive poll() To: barebox --f46d04083f2dc546c804d7bc6f3e Content-Type: multipart/alternative; boundary=f46d04083f2dc546c404d7bc6f3c --f46d04083f2dc546c404d7bc6f3c Content-Type: text/plain; charset=ISO-8859-1 I noticed some weird behavior using DFU gadget on AT91SAM9260 which worked 1 of 10 times. The bug was due to the usb_gadget_poll() being called while the previous call was still in progress : some USB calls may takes a lot of time (ex : DFU erase-then-write), resulting in the poller to be triggered again while still in the poll() function. This patch adds a poll lock to the AT91 UDC driver. --f46d04083f2dc546c404d7bc6f3c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I noticed some weird behavior using DFU gadget on AT91SAM9= 260 which worked 1 of 10 times. The bug was due to the usb_gadget_poll() be= ing called while the previous call was still in progress : some USB calls m= ay takes a lot of time (ex : DFU erase-then-write), resulting in the poller= to be triggered again while still in the poll() function.

This patch adds a poll lock to the AT91 UDC driver.
--f46d04083f2dc546c404d7bc6f3c-- --f46d04083f2dc546c804d7bc6f3e Content-Type: application/octet-stream; name="at91udc-added-missing-lock-for-poll.patch" Content-Disposition: attachment; filename="at91udc-added-missing-lock-for-poll.patch" Content-Trans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uMi41Cgo= --f46d04083f2dc546c804d7bc6f3e Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --f46d04083f2dc546c804d7bc6f3e--