Re: dwc2 - ChHltd set, but reason is unknown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/19/2017 2:22 PM, Anders Montonen wrote:
> On Thu, 19 Oct 2017, Minas Harutyunyan wrote:
> 
>> Could you please apply this patch.
>> If you confirm that this patch fix your issue with "Transaction Error"
>> and " ChHltd set, but reason is unknown" I'll submit to LKML as final patch.
>>
>> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index
>> f4ef159b538e..7da22152df68 100644
>> --- a/drivers/usb/dwc2/hcd.c
>> +++ b/drivers/usb/dwc2/hcd.c
>> @@ -331,6 +331,9 @@ static void dwc2_gusbcfg_init(struct dwc2_hsotg *hsotg)
>>          usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
>>          usbcfg &= ~(GUSBCFG_HNPCAP | GUSBCFG_SRPCAP);
>>
>> +       /* Set HS/FS Timeout Calibration */
>> +       usbcfg |= GUSBCFG_TOUTCAL(7);
>> +
>>          switch (hsotg->hw_params.op_mode) {
>>          case GHWCFG2_OP_MODE_HNP_SRP_CAPABLE:
>>                  if (hsotg->params.otg_cap ==
> 
> Hi Minas,
> 
> The patch clearly reduced the amount of errors logged, but did not fully
> fix the problem. This was with kernel 4.9.39, I can also try with a 4.13
> kernel.
> 
> Regards,
> Anders Montonen
> 
Hi Anders,

In addition to above patch please apply new one:


@@ -2311,10 +2314,17 @@ static int dwc2_core_init(struct dwc2_hsotg 
*hsotg, bool initial_setup)
   */
  static void dwc2_core_host_init(struct dwc2_hsotg *hsotg)
  {
-       u32 hcfg, hfir, otgctl;
+       u32 hcfg, hfir, otgctl, usbcfg, trdtrim;

         dev_dbg(hsotg->dev, "%s(%p)\n", __func__, hsotg);

+       /* Set USBTrdTim value */
+       usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
+       usbcfg &= ~GUSBCFG_USBTRDTIM_MASK;
+       trdtrim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
+       usbcfg |= (trdtrim << GUSBCFG_USBTRDTIM_SHIFT);
+       dwc2_writel(usbcfg, hsotg->regs + GUSBCFG);
+
         /* Restart the Phy Clock */
         dwc2_writel(0, hsotg->regs + PCGCTL);


Thanks,
Minas

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux