From patchwork Wed Mar 18 00:38:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jimmzhang X-Patchwork-Id: 451185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DC90514010F for ; Wed, 18 Mar 2015 11:39:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754391AbbCRAjk (ORCPT ); Tue, 17 Mar 2015 20:39:40 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:3282 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753867AbbCRAjg (ORCPT ); Tue, 17 Mar 2015 20:39:36 -0400 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Tue, 17 Mar 2015 17:38:51 -0700 Received: from hqemhub02.nvidia.com ([172.20.150.31]) by hqnvupgp07.nvidia.com (PGP Universal service); Tue, 17 Mar 2015 17:37:48 -0700 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Tue, 17 Mar 2015 17:37:48 -0700 Received: from jimmzhang-P9X79.nvidia.com (172.20.144.16) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.342.0; Tue, 17 Mar 2015 17:39:35 -0700 From: Jimmy Zhang To: , CC: Subject: [tegrarcm PATCH v1 5/8] tegrarcm: Better usb debug messages Date: Tue, 17 Mar 2015 17:38:58 -0700 Message-ID: <1426639141-12060-7-git-send-email-jimmzhang@nvidia.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1426639141-12060-1-git-send-email-jimmzhang@nvidia.com> References: <1426639141-12060-1-git-send-email-jimmzhang@nvidia.com> MIME-Version: 1.0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Allen Martin Print more explict messages when usb transition failed. Signed-off-by: Allen Martin --- src/nv3p.c | 2 +- src/usb.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nv3p.c b/src/nv3p.c index 7f8c72994396..7c7ef1c2f60c 100644 --- a/src/nv3p.c +++ b/src/nv3p.c @@ -848,7 +848,7 @@ static int nv3p_read(usb_device_t *usb, uint8_t *buf, int len) if (len > bytesleft) { ret = usb_read(usb, packet, sizeof(packet), &actual_len); if (ret) { - dprintf("USB read failed\n"); + dprintf("USB read failed: %d\n", ret); return ret; } diff --git a/src/usb.c b/src/usb.c index 8c9c72f38b1a..ed2ff28eef8d 100644 --- a/src/usb.c +++ b/src/usb.c @@ -231,7 +231,7 @@ int usb_write(usb_device_t *usb, uint8_t *buf, int len) ret = libusb_bulk_transfer(usb->handle, usb->endpt_out, buf, chunk_size, &actual_chunk, USB_TIMEOUT); if (ret != LIBUSB_SUCCESS) { - dprintf("write failure: %d\n", ret); + dprintf("libusb write failure: %d: %s\n", ret, libusb_error_name(ret)); return EIO; } if (actual_chunk != chunk_size) { @@ -258,7 +258,7 @@ int usb_read(usb_device_t *usb, uint8_t *buf, int len, int *actual_len) ret = libusb_bulk_transfer(usb->handle, usb->endpt_in, buf, chunk_size, &actual_chunk, USB_TIMEOUT); if (ret != LIBUSB_SUCCESS) { - dprintf("read failure: %d\n", ret); + dprintf("libusb read failure: %d: %s\n", ret, libusb_error_name(ret)); return EIO; } len -= chunk_size;