Typo at line 184 in xhci-pci.c makes trouble for Renesas USB chipset in Bionic 18.04

Bug #1773704 reported by Jeffrey Miller on 2018-05-27
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Medium
Unassigned
Bionic
Medium
Unassigned

Bug Description

A typo at line 184 in /drivers/usb/host/xhci-pci.c trashes a good fix.

183 if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
184 pdev->device == 0x0014)
185 xhci->quirks |= XHCI_TRUST_TX_LENGTH;
186 if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
187 pdev->device == 0x0015)
188 xhci->quirks |= XHCI_RESET_ON_RESUME;

Line 184 should be identical to line 187, ie: should read pdev->device == 0x0015)

I've compiled the kernel both with and without the typo. As written, hundreds of messages fill dmesg suggesting XHCI_TRUST_TX_LENGTH may be needed when zoneminder tries to access my USB webcams. With the fix applied as I've suggested the messages disappear.

The typo is still present in 4.15.0-22.24

For more background, you may refer to bug ID #1710548

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1773704

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: bionic

Don't see the point in adding log files for a simple and obvious typo, but before code was added for this fix I believe I did generate before and after logs under bug ID #1710548. In any case I'm running kernels in which I've fixed the typo.

Status changed to confirmed.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Changed in linux (Ubuntu Bionic):
status: New → Triaged
Changed in linux (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Medium
Changed in linux (Ubuntu Bionic):
importance: Undecided → Medium
tags: added: kernel-da-key
Changed in linux (Ubuntu Bionic):
assignee: nobody → Joseph Salisbury (jsalisbury)
Changed in linux (Ubuntu):
assignee: nobody → Joseph Salisbury (jsalisbury)
Changed in linux (Ubuntu Bionic):
status: Triaged → In Progress
Changed in linux (Ubuntu):
status: Triaged → In Progress
Joseph Salisbury (jsalisbury) wrote :

I built a patched test kernel. The test kernel can be downloaded from:
http://kernel.ubuntu.com/~jsalisbury/lp1773704

Can you test this kernel and see if it resolves this bug?

Note about installing test kernels:
• If the test kernel is prior to 4.15(Bionic) you need to install the linux-image and linux-image-extra .deb packages.
• If the test kernel is 4.15(Bionic) or newer, you need to install the linux-modules, linux-modules-extra and linux-image-unsigned .deb packages.

Thanks in advance!

 Dear Mr. Salisbury,
I can't believe it's been 12 days since I filed this report. Seems like it was just yesterday. And in fact it's just today I found your missives. Shame on me!
I'm having a bad case of battle fatigue with this issue. I'm deploying like TODAY.  Do I live with errors? Do I compile my own kernel ( have done for 6 mos now)? Do I try your kernel? Do I live with errors until the typo  is fixed?
I hope you can trust me on this one, This is a single-character typo. Fix the typo, everything works fine.
The only question at this point is how to run it up the flagpole as quickly as possible. I suspect it's upstream of Ubuntu.
    On Tuesday, May 29, 2018, 11:51:15 AM PDT, Joseph Salisbury <email address hidden> wrote:

 ** Changed in: linux (Ubuntu Bionic)
    Assignee: (unassigned) => Joseph Salisbury (jsalisbury)

** Changed in: linux (Ubuntu)
    Assignee: (unassigned) => Joseph Salisbury (jsalisbury)

** Changed in: linux (Ubuntu Bionic)
      Status: Triaged => In Progress

** Changed in: linux (Ubuntu)
      Status: Triaged => In Progress

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1773704

Title:
  Typo at line 184 in xhci-pci.c makes trouble for Renesas USB chipset
  in Bionic 18.04

Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Bionic:
  In Progress

Bug description:
  A typo at line 184 in /drivers/usb/host/xhci-pci.c trashes a good fix.

  183        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  184                        pdev->device == 0x0014)
  185                xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  186        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  187                        pdev->device == 0x0015)
  188                xhci->quirks |= XHCI_RESET_ON_RESUME;

  Line 184 should be identical to line 187, ie: should read pdev->device
  == 0x0015)

  I've compiled the kernel both with and without the typo. As written,
  hundreds of messages fill dmesg suggesting XHCI_TRUST_TX_LENGTH may be
  needed when zoneminder tries to access my USB webcams. With the fix
  applied as I've suggested the messages disappear.

  The typo is still present in 4.15.0-22.24

  For more background, you may refer to bug ID #1710548

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1773704/+subscriptions

 Just though of something..... reinstalled a system from daily build yesterday.
So here's the deal: I'l try to see if it's fixed as of yesterday....
But it will take me some hours to re-con zoneminder to trigger the bug.
-jeff
    On Tuesday, May 29, 2018, 1:11:03 PM PDT, Joseph Salisbury <email address hidden> wrote:

 I built a patched test kernel.  The test kernel can be downloaded from:
http://kernel.ubuntu.com/~jsalisbury/lp1773704

Can you test this kernel and see if it resolves this bug?

Note about installing test kernels:
• If the test kernel is prior to 4.15(Bionic) you need to install the linux-image and linux-image-extra .deb packages.
• If the test kernel is 4.15(Bionic) or newer, you need to install the linux-modules, linux-modules-extra and linux-image-unsigned .deb packages.

Thanks in advance!

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1773704

Title:
  Typo at line 184 in xhci-pci.c makes trouble for Renesas USB chipset
  in Bionic 18.04

Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Bionic:
  In Progress

Bug description:
  A typo at line 184 in /drivers/usb/host/xhci-pci.c trashes a good fix.

  183        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  184                        pdev->device == 0x0014)
  185                xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  186        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  187                        pdev->device == 0x0015)
  188                xhci->quirks |= XHCI_RESET_ON_RESUME;

  Line 184 should be identical to line 187, ie: should read pdev->device
  == 0x0015)

  I've compiled the kernel both with and without the typo. As written,
  hundreds of messages fill dmesg suggesting XHCI_TRUST_TX_LENGTH may be
  needed when zoneminder tries to access my USB webcams. With the fix
  applied as I've suggested the messages disappear.

  The typo is still present in 4.15.0-22.24

  For more background, you may refer to bug ID #1710548

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1773704/+subscriptions

 Hey! This bug may be fixed.As best I recall I did a fresh install from nightly build about 3 days ago, but had not installed zoneminder so no op to tickle the bug.
Today I did an upgrade and a dist-upgrade, then loaded zoneminder, started pulling data over renesas port, so far no dmesg errors, I think it's fixed.
Did you fix it? Well blessings on whoever did.
I'll let you know if it pops up again. Thank you so much
    On Tuesday, May 29, 2018, 1:11:03 PM PDT, Joseph Salisbury <email address hidden> wrote:

 I built a patched test kernel.  The test kernel can be downloaded from:
http://kernel.ubuntu.com/~jsalisbury/lp1773704

Can you test this kernel and see if it resolves this bug?

Note about installing test kernels:
• If the test kernel is prior to 4.15(Bionic) you need to install the linux-image and linux-image-extra .deb packages.
• If the test kernel is 4.15(Bionic) or newer, you need to install the linux-modules, linux-modules-extra and linux-image-unsigned .deb packages.

Thanks in advance!

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1773704

Title:
  Typo at line 184 in xhci-pci.c makes trouble for Renesas USB chipset
  in Bionic 18.04

Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Bionic:
  In Progress

Bug description:
  A typo at line 184 in /drivers/usb/host/xhci-pci.c trashes a good fix.

  183        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  184                        pdev->device == 0x0014)
  185                xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  186        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  187                        pdev->device == 0x0015)
  188                xhci->quirks |= XHCI_RESET_ON_RESUME;

  Line 184 should be identical to line 187, ie: should read pdev->device
  == 0x0015)

  I've compiled the kernel both with and without the typo. As written,
  hundreds of messages fill dmesg suggesting XHCI_TRUST_TX_LENGTH may be
  needed when zoneminder tries to access my USB webcams. With the fix
  applied as I've suggested the messages disappear.

  The typo is still present in 4.15.0-22.24

  For more background, you may refer to bug ID #1710548

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1773704/+subscriptions

 No, premature. Bug still exists. I'll try your kernel at the next sitting.
-Jeff

    On Tuesday, May 29, 2018, 1:11:03 PM PDT, Joseph Salisbury <email address hidden> wrote:

 I built a patched test kernel.  The test kernel can be downloaded from:
http://kernel.ubuntu.com/~jsalisbury/lp1773704

Can you test this kernel and see if it resolves this bug?

Note about installing test kernels:
• If the test kernel is prior to 4.15(Bionic) you need to install the linux-image and linux-image-extra .deb packages.
• If the test kernel is 4.15(Bionic) or newer, you need to install the linux-modules, linux-modules-extra and linux-image-unsigned .deb packages.

Thanks in advance!

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1773704

Title:
  Typo at line 184 in xhci-pci.c makes trouble for Renesas USB chipset
  in Bionic 18.04

Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Bionic:
  In Progress

Bug description:
  A typo at line 184 in /drivers/usb/host/xhci-pci.c trashes a good fix.

  183        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  184                        pdev->device == 0x0014)
  185                xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  186        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  187                        pdev->device == 0x0015)
  188                xhci->quirks |= XHCI_RESET_ON_RESUME;

  Line 184 should be identical to line 187, ie: should read pdev->device
  == 0x0015)

  I've compiled the kernel both with and without the typo. As written,
  hundreds of messages fill dmesg suggesting XHCI_TRUST_TX_LENGTH may be
  needed when zoneminder tries to access my USB webcams. With the fix
  applied as I've suggested the messages disappear.

  The typo is still present in 4.15.0-22.24

  For more background, you may refer to bug ID #1710548

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1773704/+subscriptions

I downloaded the three files you mentioned and tried to install them using 'dpkg -i *.deb' as root. Two of the pkgs installed OK but the kernel proper did not, giving error:

  Selecting previously unselected package linux-image-unsigned-4.15.0-22-generic.
dpkg: regarding linux-image-unsigned-4.15.0-22-generic_4.15.0-22.25_lp1773704_amd64.deb containing linux-image-unsigned-4.15.0-22-generic:
 linux-image-unsigned-4.15.0-22-generic conflicts with linux-image-4.15.0-22-generic
  linux-image-4.15.0-22-generic (version 4.15.0-22.24) is present and installed.

dpkg: error processing archive linux-image-unsigned-4.15.0-22-generic_4.15.0-22.25_lp1773704_amd64.deb (--install):
 conflicting packages - not installing linux-image-unsigned-4.15.0-22-generic

I rebooted the system and as one might expect, the errors in dmesg log persist.

I read up a bit on dpkg hoping I could -f "force" the installation but it appears more complicated than that.

How to proceed? Strange, I've installed test kernels (for this same issue in fact, see bug ID #1710548, which did in fact fix the problem: but the typo in the re-write of the fix that found it's way into the distro uproots the fix).

Again I have to underscore the fact that I've built my own kernels with line 184 changed to be identical to line 187 and the problems are solved.

If that was your approach, please consider your fix to have been successfully tested.

I didn't have much trouble installing the kernels I built so the above errors from dpkg are a mystery to me.

The typo is still present in 4.15.0-29.31

The underlying bug is also described in bug ID #1737629, but I think that report was prior to the typo ie: before the "fix" with the typo was added.

Joseph Salisbury (jsalisbury) wrote :

Sorry for the delay. Just to confirm, the test kernel posted in comment #3 did in fact resolve this bug? If so, I'll submit an SRU request.

 I wasn't able to test the kernel you provided, dpkg -i complained of conflicting packages. I suspect because the kernel was down-rev relative to the running kernel. But I don't reslly know, I'm relatively new to compilling and installing kernels.
However, I was able to compile and install my own kernel on the target machine. Once again, all I did was change line 184 to be identical to like 187 and it worked like a charm: no more errors.
So my suggestion was that if you made the exact same change, your test jernel _should_ work. But I can understand if that's just not the way it's done around here, and I'll be happy to test your kernel if I can get around the error message. Is there an option I can give to dpkg to force the installation?
-Jeff
    On Friday, July 27, 2018, 8:41:19 AM PDT, Joseph Salisbury <email address hidden> wrote:

 Sorry for the delay.  Just to confirm, the test kernel posted in comment
#3 did in fact resolve this bug?  If so, I'll submit an SRU request.

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1773704

Title:
  Typo at line 184 in xhci-pci.c makes trouble for Renesas USB chipset
  in Bionic 18.04

Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Bionic:
  In Progress

Bug description:
  A typo at line 184 in /drivers/usb/host/xhci-pci.c trashes a good fix.

  183        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  184                        pdev->device == 0x0014)
  185                xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  186        if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  187                        pdev->device == 0x0015)
  188                xhci->quirks |= XHCI_RESET_ON_RESUME;

  Line 184 should be identical to line 187, ie: should read pdev->device
  == 0x0015)

  I've compiled the kernel both with and without the typo. As written,
  hundreds of messages fill dmesg suggesting XHCI_TRUST_TX_LENGTH may be
  needed when zoneminder tries to access my USB webcams. With the fix
  applied as I've suggested the messages disappear.

  The typo is still present in 4.15.0-22.24

  For more background, you may refer to bug ID #1710548

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1773704/+subscriptions

Joseph Salisbury (jsalisbury) wrote :

I'll submit this patch upstream as well as SRU it to Ubuntu. Can you send me your email address, and I'll add you to the upstream patch? You can either post your email address here or send it to me at <email address hidden>.

Thank you Joseph, sorry I couldn't try your test kernel but I've just been chasing my tail trying to figure out why I can install some kernels and not others.

My email is <email address hidden>

Joseph Salisbury (jsalisbury) wrote :

There was the following response from the original patch author:

On Fri, Aug 10, 2018 at 12:13:53PM -0400, Joseph Salisbury wrote:
> Hi Daniel,
>
> A kernel bug report was opened against Ubuntu [0]. It was found the
> following patch introduced the regression:
>
> da9970668948 ("usb: xhci: Add XHCI_TRUST_TX_LENGTH for Renesas uPD720201")

I can see nothing in http://pad.lv/1773704 that indicates a regression
in this patch. How could there be? The patch does not not alter the
behaviour of uPD720202 devices (pdev->device == 0x0015).

> The bug reporter claims there is a typo in the patch that caused the
> regression. I built a test kernel with a change to the suspected typo
> and the bug reporter claims it resolved the regression. My test kernel
> had the following change:
>
> - pdev->device == 0x0014)
> + pdev->device == 0x0015)
>
> I was hoping to get your feedback, since you are the patch author. Do
> you think this is an actual typo, or maybe there really needs to be two
> quirks?

No, it is a not a typo (and the change above *does* introduce a regression
 ). From this git logs I believe that:

  0x0014 -> uPD720201
  0x0015 -> uPD720202

Daniel.

Ooops. I can see that point. The Startech card I'm using claims to be based on the uPD720202: perhaps it has two if them. I'd say that the uPD720202 needs the XHCI_TRUST_TX_LENGTH quirk as well.

-Jeff

Phil R (machack) wrote :

My bug report 1737629, of which this has been marked a duplicate, also involves a uPD720202 chipset card.

Changed in linux (Ubuntu Bionic):
status: In Progress → Confirmed
Changed in linux (Ubuntu):
status: In Progress → Confirmed
Changed in linux (Ubuntu Bionic):
assignee: Joseph Salisbury (jsalisbury) → nobody
Changed in linux (Ubuntu):
assignee: Joseph Salisbury (jsalisbury) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers