From patchwork Fri Oct 17 17:16:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38928 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2EFB2202DB for ; Fri, 17 Oct 2014 17:17:58 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf720994lab.3 for ; Fri, 17 Oct 2014 10:17:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=5DQGTXWhkEcHt+t/kdcSqnDR6F9ffGXibj9CNoWIvHc=; b=USooVx0qaCzDPgGRZMPNgnW/aFwHtZuNBt1YTyGM5J7gcbyDX3ySXcwvVYXPV3wVZ9 QbUl6ObS84xB+KajbdqEariexB+8hd+DEKdqSl+XdgtgaO0j2u2d4jYjx7S63DSYQtwY XWz0GfSVG/wO2N3tdYo4OMwBubKKHjHTi1Usoh+dJCg8HA7PcaKn4vLlz1o/nlsFJLvm xFt97b1Qqlrm4do8WQlj2WrT7iOc4R2Ki6QhO+WLdzyiFh/rkkz/Ovnokqk1vz4kd7Qo ovqiKbcFEy397XAZAhVaIrqMQsU1c6fk+4wNqO8YKtczNnu9scJXGxAeBJlhhDdVvE6T RR2Q== X-Gm-Message-State: ALoCoQk9EeFMc07og0w7OdqOlmWcZKSOwOBMU+//Q6EbcFegCoc5bMcU97VXjtk1tFyucgw64u2S X-Received: by 10.112.154.194 with SMTP id vq2mr697033lbb.10.1413566277082; Fri, 17 Oct 2014 10:17:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.107 with SMTP id kx11ls284402lac.80.gmail; Fri, 17 Oct 2014 10:17:56 -0700 (PDT) X-Received: by 10.152.43.197 with SMTP id y5mr10392622lal.82.1413566276841; Fri, 17 Oct 2014 10:17:56 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id j5si3030751lam.25.2014.10.17.10.17.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:17:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id u10so1018161lbd.20 for ; Fri, 17 Oct 2014 10:17:56 -0700 (PDT) X-Received: by 10.112.221.197 with SMTP id qg5mr10208742lbc.32.1413566276291; Fri, 17 Oct 2014 10:17:56 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp268026lbz; Fri, 17 Oct 2014 10:17:55 -0700 (PDT) X-Received: by 10.66.187.234 with SMTP id fv10mr9969992pac.60.1413566275341; Fri, 17 Oct 2014 10:17:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si1686618pdm.75.2014.10.17.10.17.54 for ; Fri, 17 Oct 2014 10:17:55 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753426AbaJQRRw (ORCPT + 3 others); Fri, 17 Oct 2014 13:17:52 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:36327 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753313AbaJQRRn (ORCPT ); Fri, 17 Oct 2014 13:17:43 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHHWwp028703; Fri, 17 Oct 2014 12:17:33 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHWAZ000663; Fri, 17 Oct 2014 12:17:32 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 17 Oct 2014 12:17:32 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHVru002802; Fri, 17 Oct 2014 12:17:32 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Greg KH , , Paul Zimmerman , , , , , , , Felipe Balbi Subject: [PATCH 07/67] usb: gadget: composite: set our req->context to cdev Date: Fri, 17 Oct 2014 12:16:14 -0500 Message-ID: <1413566234-13537-8-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413566234-13537-1-git-send-email-balbi@ti.com> References: <1413566234-13537-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , by doing that we will be able to match our requests against req and os_desc_req and also clear our pending flags from complete callback. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/composite.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index f6a51fd..09602dc 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1428,6 +1428,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) * when we delegate to it. */ req->zero = 0; + req->context = cdev; req->complete = composite_setup_complete; req->length = 0; gadget->ep0->driver_data = cdev; @@ -1624,6 +1625,7 @@ unknown: int count = 0; req = cdev->os_desc_req; + req->context = cdev; req->complete = composite_setup_complete; buf = req->buf; os_desc_cfg = cdev->os_desc_config; @@ -1686,6 +1688,7 @@ unknown: break; } req->length = value; + req->context = cdev; req->zero = value < w_length; value = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC); if (value < 0) { @@ -1757,6 +1760,7 @@ unknown: /* respond with data transfer before status phase? */ if (value >= 0 && value != USB_GADGET_DELAYED_STATUS) { req->length = value; + req->context = cdev; req->zero = value < w_length; value = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC); if (value < 0) { @@ -1893,6 +1897,7 @@ int composite_dev_prepare(struct usb_composite_driver *composite, goto fail_dev; cdev->req->complete = composite_setup_complete; + cdev->req->context = cdev; gadget->ep0->driver_data = cdev; cdev->driver = composite; @@ -1937,6 +1942,7 @@ int composite_os_desc_req_prepare(struct usb_composite_dev *cdev, kfree(cdev->os_desc_req); goto end; } + cdev->os_desc_req->context = cdev; cdev->os_desc_req->complete = composite_setup_complete; end: return ret; @@ -2158,6 +2164,7 @@ void usb_composite_setup_continue(struct usb_composite_dev *cdev) } else if (--cdev->delayed_status == 0) { DBG(cdev, "%s: Completing delayed status\n", __func__); req->length = 0; + req->context = cdev; value = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC); if (value < 0) { DBG(cdev, "ep_queue --> %d\n", value);