Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754593AbYLCTuY (ORCPT ); Wed, 3 Dec 2008 14:50:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751659AbYLCTuA (ORCPT ); Wed, 3 Dec 2008 14:50:00 -0500 Received: from kroah.org ([198.145.64.141]:34447 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754194AbYLCTt7 (ORCPT ); Wed, 3 Dec 2008 14:49:59 -0500 Date: Wed, 3 Dec 2008 11:48:08 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Richard =?iso-8859-1?Q?R=C3=B6jfors?= , David Brownell Subject: [patch 001/104] USB: gadget rndis: send notifications Message-ID: <20081203194808.GB8950@kroah.com> References: <20081203193901.715896543@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline; filename="usb-gadget-rndis-send-notifications.patch" Content-Transfer-Encoding: 8bit In-Reply-To: <20081203194725.GA8950@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1355 Lines: 39 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Richard R?jfors commit ff3495052af48f7a2bf7961b131dc9e161dae19c upstream. It turns out that atomic_inc_return() returns the *new* value not the original one, so the logic in rndis_response_available() kept the first RNDIS response notification from getting out. This prevented interoperation with MS-Windows (but not Linux). Fix this to make RNDIS behave again. Signed-off-by: Richard R?jfors Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/f_rndis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c @@ -303,7 +303,7 @@ static void rndis_response_available(voi __le32 *data = req->buf; int status; - if (atomic_inc_return(&rndis->notify_count)) + if (atomic_inc_return(&rndis->notify_count) != 1) return; /* Send RNDIS RESPONSE_AVAILABLE notification; a -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/