From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com ([209.85.212.179]:38370 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758530AbbEEMEG (ORCPT ); Tue, 5 May 2015 08:04:06 -0400 Received: by wiun10 with SMTP id n10so143352886wiu.1 for ; Tue, 05 May 2015 05:04:04 -0700 (PDT) Message-ID: <5548B1B2.6050304@suse.cz> Date: Tue, 05 May 2015 14:04:02 +0200 From: Jiri Slaby MIME-Version: 1.0 To: Andrzej Pietrasiewicz , stable@vger.kernel.org CC: Felipe Balbi , Greg Kroah-Hartman , Sebastian Andrzej Siewior , Marek Szyprowski Subject: Re: [PATCH] usb: gadget: printer: enqueue printer's response for setup request References: <14304272315944@kroah.com> <1430821812-25950-1-git-send-email-andrzej.p@samsung.com> In-Reply-To: <1430821812-25950-1-git-send-email-andrzej.p@samsung.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 05/05/2015, 12:30 PM, Andrzej Pietrasiewicz wrote: > This is eb132ccbdec5df46e29c9814adf76075ce83576b > "usb: gadget: printer: enqueue printer's response for setup request" > ported to stable. Ported to which stable -- where do you want this to be applied? Thanks. > Function-specific setup requests should be handled in such a way, that > apart from filling in the data buffer, the requests are also actually > enqueued: if function-specific setup is called from composte_setup(), > the "usb_ep_queue()" block of code in composite_setup() is skipped. > > The printer function lacks this part and it results in e.g. get device id > requests failing: the host expects some response, the device prepares it > but does not equeue it for sending to the host, so the host finally asserts > timeout. > > This patch adds enqueueing the prepared responses. > > Fixes: 2e87edf49227: "usb: gadget: make g_printer use composite" > Signed-off-by: Andrzej Pietrasiewicz > Signed-off-by: Felipe Balbi > [ported to stable] > Signed-off-by: Andrzej Pietrasiewicz > --- > drivers/usb/gadget/printer.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c > index bf7a56b..a0dfdbd 100644 > --- a/drivers/usb/gadget/printer.c > +++ b/drivers/usb/gadget/printer.c > @@ -975,6 +975,15 @@ unknown: > break; > } > /* host either stalls (value < 0) or reports success */ > + if (value >= 0) { > + req->length = value; > + req->zero = value < wLength; > + value = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC); > + if (value < 0) { > + ERROR(dev, "%s:%d Error!\n", __func__, __LINE__); > + req->status = 0; > + } > + } > return value; > } > > -- js suse labs