From patchwork Tue Apr 11 01:23:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 749308 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3w28Sx01LHz9sNG for ; Tue, 11 Apr 2017 11:23:28 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A12F5C21CEC; Tue, 11 Apr 2017 01:23:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=FSL_HELO_NON_FQDN_1, RDNS_DYNAMIC autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9D44FC21C35; Tue, 11 Apr 2017 01:23:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 45158C21C35; Tue, 11 Apr 2017 01:23:19 +0000 (UTC) Received: from office-server2 (wsip-98-189-142-135.oc.oc.cox.net [98.189.142.135]) by lists.denx.de (Postfix) with ESMTPS id AB1A0C21C2B for ; Tue, 11 Apr 2017 01:23:18 +0000 (UTC) Received: from tkisky by office-server2 with local (Exim 4.86_2) (envelope-from ) id 1cxkWX-0001QL-5Y; Mon, 10 Apr 2017 18:23:13 -0700 From: Troy Kisky To: marex@denx.de, sjg@chromium.org Date: Mon, 10 Apr 2017 18:23:11 -0700 Message-Id: <1491873791-5435-1-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.7.4 Cc: u-boot@lists.denx.de, swarren@nvidia.com Subject: [U-Boot] [PATCH 1/1] usb: return 0 from usb_stor_get_info even if removable media X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This fixes a regression caused by commit 07b2b78ce4bc8ae25e066c65245eaf58c0d9a67c dm: usb: Convert USB storage to use driver-model for block devs which caused part_init to be called when it was not previously. Without this patch, the following happens when a USB sd card reader is used. => usb start starting USB... USB0: Port not available. USB1: USB EHCI 1.00 scanning bus 1 for devices... 3 USB Device(s) found scanning usb for storage devices... Device NOT ready Request Sense returned 02 3A 00 ### ERROR ### Please RESET the board ### This happens because dev_desc->blksz is 0. Signed-off-by: Troy Kisky --- common/usb_storage.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/usb_storage.c b/common/usb_storage.c index b524a15..83279c4 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -1440,10 +1440,8 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss, " Request Sense returned %02X %02X %02X\n", pccb->sense_buf[2], pccb->sense_buf[12], pccb->sense_buf[13]); - if (dev_desc->removable == 1) { + if (dev_desc->removable == 1) dev_desc->type = perq; - return 1; - } return 0; } pccb->pdata = (unsigned char *)cap;