From patchwork Tue Mar 22 16:06:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mian Yousaf Kaukab X-Patchwork-Id: 736 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:45:17 -0000 Delivered-To: patches@linaro.org Received: by 10.204.113.5 with SMTP id y5cs3385bkp; Tue, 22 Mar 2011 09:06:54 -0700 (PDT) Received: by 10.14.122.193 with SMTP id t41mr2012093eeh.198.1300810013876; Tue, 22 Mar 2011 09:06:53 -0700 (PDT) Received: from eu1sys200aog102.obsmtp.com (eu1sys200aog102.obsmtp.com [207.126.144.113]) by mx.google.com with SMTP id k50si9267765eei.100.2011.03.22.09.06.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2011 09:06:53 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of mian.yousaf.kaukab@stericsson.com) client-ip=207.126.144.113; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of mian.yousaf.kaukab@stericsson.com) smtp.mail=mian.yousaf.kaukab@stericsson.com Received: from source ([138.198.100.35]) (using TLSv1) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKTYjJDhln8F/ej/kWsHGvi9n1GOrP2P9s@postini.com; Tue, 22 Mar 2011 16:06:53 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 03601115; Tue, 22 Mar 2011 16:06:34 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id C00A8687; Tue, 22 Mar 2011 16:06:33 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id F0483A8074; Tue, 22 Mar 2011 17:06:26 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.2.254.0; Tue, 22 Mar 2011 17:06:32 +0100 From: Mian Yousaf Kaukab To: David Brownell , Cc: Felipe Balbi , Mian Yousaf Kaukab Subject: [PATCH 2/2] usb: usb_storage: do not set short_not_ok when short packet is expected Date: Tue, 22 Mar 2011 17:06:06 +0100 Message-ID: <1300809966-8401-2-git-send-email-mian.yousaf.kaukab@stericsson.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1300809966-8401-1-git-send-email-mian.yousaf.kaukab@stericsson.com> References: <1300809966-8401-1-git-send-email-mian.yousaf.kaukab@stericsson.com> MIME-Version: 1.0 It is incorrect to set short_not_ok when preparing the request to receive CBW. CBW will be a short-packet so short_not_ok must not be set. Signed-off-by: Mian Yousaf Kaukab --- drivers/usb/gadget/f_mass_storage.c | 2 +- drivers/usb/gadget/file_storage.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index b5ed42c..e9fe598 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -2317,7 +2317,7 @@ static int get_next_command(struct fsg_common *common) /* Queue a request to read a Bulk-only CBW */ set_bulk_out_req_length(common, bh, USB_BULK_CB_WRAP_LEN); - bh->outreq->short_not_ok = 1; + bh->outreq->short_not_ok = 0; if (!start_out_transfer(common, bh)) /* Don't know what to do if common->fsg is NULL */ return -EIO; diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index 9ecd3ac..7b06e8c 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -2683,7 +2683,7 @@ static int get_next_command(struct fsg_dev *fsg) /* Queue a request to read a Bulk-only CBW */ set_bulk_out_req_length(fsg, bh, USB_BULK_CB_WRAP_LEN); - bh->outreq->short_not_ok = 1; + bh->outreq->short_not_ok = 0; start_transfer(fsg, fsg->bulk_out, bh->outreq, &bh->outreq_busy, &bh->state);