Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp402092imm; Thu, 26 Jul 2018 05:46:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdrdA9bZjcpgfl551sBQxQtW5AzWJgrhIJ0JInX8a9YoPqfwupjZSFB9J4QNrAqbUHOvKfo X-Received: by 2002:a65:62cd:: with SMTP id m13-v6mr1822999pgv.280.1532609213371; Thu, 26 Jul 2018 05:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532609213; cv=none; d=google.com; s=arc-20160816; b=xqCGxkvI9JMAskr7yVuHUJi9NU2w8kC9uNh+OwYx80howOOjyhnTN6z9J6BhCmnuI6 rB8AY5etDmHz6UWbuS5c2bchhaPSby0l2IAwzVYeHvynZXhtCpJ8hvduF5T1MEgKCSal 9GNxhz1Z4cFTlfTsfqEKh2qjFUGgi6ym/gyRI7TMXAquOqaCJq9+9Tq2aHcCErbnx8yY z6QndN332oKI49pFePgzXJtwAhsaqRXbLP1cgDiw/xGLGpl3kchGYaPhSSyhMBruJQts WQotIpLL4KRGeTvLi5uty1BHiPn1nJ9FbuYUVMmsMBqrwk2BVu5Wucq3M706qWWRJz+1 XLAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=ONfmQKjWPMzWhYYTKpalypce3n9WwnHrutk4pFi6qvc=; b=k4dazsdA+LnCLR4Td71iXvd3ELoGx1JjsEDt5kZPnvMuJioSNNFrqdYW2uCeitheQq 2hphIiMe4hKGw0dSOeS69SP4tmZroOMiApbShc9g3UEoAld2wC28GvumVS7U/hTOqkpu 7qTL9mpOAIybdoA5BlOSvwQ7oIzFBIi1FYCuhvxedjk+AJqmUraxOlOKjltIAcK5ZUdO kqcSSwFadCIsmSyKU14xwOWHOoVQ13ilaVFpCO9/vMowpwS5sJCV/EFrhHk/FiLt9lQF /vdSHpy3KuqoUp3HjYxf4VjD8YDEbGIuoNFcdxCORqsgWUnVgRxLWyoQ5eNBWODeqh9M 40Ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10-v6si1231483pga.559.2018.07.26.05.46.37; Thu, 26 Jul 2018 05:46:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730457AbeGZOBr (ORCPT + 99 others); Thu, 26 Jul 2018 10:01:47 -0400 Received: from mga12.intel.com ([192.55.52.136]:60113 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730135AbeGZOBr (ORCPT ); Thu, 26 Jul 2018 10:01:47 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2018 05:45:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,405,1526367600"; d="asc'?scan'208";a="249130991" Received: from pipin.fi.intel.com (HELO localhost) ([10.237.68.37]) by fmsmga006.fm.intel.com with ESMTP; 26 Jul 2018 05:45:00 -0700 From: Felipe Balbi To: Anurag Kumar Vulisha , gregkh@linuxfoundation.org Cc: v.anuragkumar@gmail.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Anurag Kumar Vulisha Subject: Re: [PATCH v2] usb: dwc3: core: Add quirk for enabling AutoRetry feature in the controller In-Reply-To: <1532608663-4091-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1532608663-4091-1-git-send-email-anurag.kumar.vulisha@xilinx.com> Date: Thu, 26 Jul 2018 15:41:43 +0300 Message-ID: <87va92yxrs.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Anurag Kumar Vulisha writes: > By default when core sees any transaction error(CRC or overflow) > it replies with terminating retry ACK (Retry=3D1 and Nump =3D=3D 0). > Enabling this Auto Retry feature in controller, on seeing any > transaction errors makes the core to send a non-terminating ACK > transaction packet (that is, ACK TP with Retry=3D1 and Nump !=3D 0). > Doing so will give controller a chance to recover from the error > condition. > > Signed-off-by: Anurag Kumar Vulisha > --- > Changes in v2: > 1. As suggested by Rob Herring & Felipe Balbi removed the > quirk logic and setting the AutoRetry bits unconditionally > for hostmode > --- > drivers/usb/dwc3/core.c | 14 ++++++++++++++ > drivers/usb/dwc3/core.h | 3 +++ > 2 files changed, 17 insertions(+) > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > index 1038075..478c8a6 100644 > --- a/drivers/usb/dwc3/core.c > +++ b/drivers/usb/dwc3/core.c > @@ -883,6 +883,20 @@ static int dwc3_core_init(struct dwc3 *dwc) > dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); > } >=20=20 > + if (dwc->dr_mode =3D=3D USB_DR_MODE_HOST) { almost there. You also wanna check for dr_mode =3D=3D OTG. OTG configurations can switch between device and host mode at will. > + reg =3D dwc3_readl(dwc->regs, DWC3_GUCTL); > + > + /* Enable Auto retry Feature to make the controller operating in match the multi-line comment style already in this file: /* * Enable Auto .... =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAltZwYcACgkQzL64meEa mQZ/Lg/+MDJg6xsXXkHpcZLrMFu6bb2/c62RAQ3S4wlBNdB+endWIXb034swEC+S j8ATziCzQD1RbSyiyE4PK+0hNSQVhBHk42jsu0fQs3CJXdQwC6evcFX15iFxl/S6 Z9nrUUmhWGE+wBcSiOSeeQTgZ17CBH7+oHmHWUQ8aLx3FnIv/WvauE+pL+qrtPLT BS6Lr7IudP+rRoTUOFXiHlsbneNkbfMBmyQlJ5ry5XZ8zU8hNEnqFDRK0huN9j1F vLkZNF+EKOOaoA7onFnzWDP7+751emjjC3QDbBeu+GIhfI+C34fmwwglyyUHGHH1 9asy9NvJExOBfCSuVb8t3MGPBeC7MOyifW+WakqfZlibBwvxwGfFqMeVWWPcM1pg TbYW90kk1FiSvHDRlBvJ/KSr2riW0SpeNfagDVJPHFsGRpmIuaCF1uNS+1AdI+Hb PGg3CTEiJRnWkazgc16LlwunvbWGu/dEtdY2aJscTjW5DIEKSpZc9adID8AXl/Lr zPB3MT3Me2di0FmiLhV4Ylrkxc7jGFHZZZh/54ikhKZIGrvAF63/404X5Y6EmIxO v4JCrBLOTXm366BMntlv42fTV5xM4HWoq/qe9aePZJ8sJcfAjxMJ84U0fliBCDJC sCbpUjb7UPP+6ui4Jize2on6T/jn6F3G8DUL8KwFAIEwnYqmmA4= =tyh2 -----END PGP SIGNATURE----- --=-=-=--