Bug 30915

Summary: Kernel error 'Transfer event TRB DMA ptr' when downloading images using Digikam
Product: Mageia Reporter: DariuszSki <linuxstuff>
Component: RPM PackagesAssignee: Kernel and Drivers maintainers <kernel>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Normal CC: davidwhodgins
Version: 8   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: 5.15.65-desktop-1.mga8 and latest Mag8 Digikam CVE:
Status comment:
Attachments: Syslog events describing what's going on
Connecting card reader syslog output

Description DariuszSki 2022-09-29 20:54:09 CEST
Using Mageia 8, x86_64, AMD, fully up to date.

Description of problem:
Start Digikam to download images from CFExpress card using a dedicated USB3.x reader, the download should be REALLY fast, but it keeps stalling multiple times during the download process, and does not do full speed download after it encounters the kernel error the first time (probably as it encounters the errors before it can get up to fast copy speed again).

The card is formatted in camera then new images written to it, but the same problem of kernel error and stalling happens when copying the images. The CFExpreess card is brand new the camera doesn't appear to have a problem with it.

Version-Release number of selected component (if applicable):
Kernel 5.15.65-desktop-1.mga8, and latest (for Mageia8) Digikam.

How reproducible:
Download images from CFExpress card using Digikam.

Steps to Reproduce:
1. Download images from CFExpress card using Digikam.
Comment 1 DariuszSki 2022-09-29 21:02:21 CEST
Created attachment 13404 [details]
Syslog events describing what's going on

Edited list of what events logged in syslog. (this website would not let me add the text file as an attachment).
Comment 2 Dave Hodgins 2022-09-29 21:33:42 CEST
Possible patch at https://linux.kernel.narkive.com/CucXYPDz/xhci-hcd-0000-00-14-0-error-transfer-event-trb-dma-ptr-not-part-of-current-td-ep-index-2-comp-code-1


diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 94416ff..77da8fe 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -82,7 +82,7 @@ dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg,
return 0;
/* offset in TRBs */
segment_offset = trb - seg->trbs;
- if (segment_offset > TRBS_PER_SEGMENT)
+ if (segment_offset > TRBS_PER_SEGMENT - 1)
return 0;
return seg->dma + (segment_offset * sizeof(*trb));
}

Assigning to kernel team.

Assignee: bugsquad => kernel
CC: (none) => davidwhodgins

Comment 3 DariuszSki 2022-10-28 12:53:14 CEST
Is it possible for a user to try installing this "patch" and seeing if it works? I can't find anything definitive on how to do so or even if it is possible, especially for Mageia. I've only tried test RPMs from developers, I have no knowledge of patches.
Comment 4 Thomas Backlund 2022-10-28 13:32:21 CEST
That's an ancient fix, and it landed in upstream v4.2-rc6~10^2~2


I wonder if the usb3 reader is one of those "broken ones" that needs a kernel quirk to work...

Also, can you try it in another  port like an usb2 one ...
Comment 5 DariuszSki 2022-11-19 13:24:36 CET
Created attachment 13522 [details]
Connecting card reader syslog output

A recent Kernel update hasn't improved anything.

As I now have more files to test the card reader more fully, I tried the SD reader slot in this reader, and an older USB2 card reader with an SD Card slot. The new card reader slows down for SD cards as well as CF-Express, the old reader downloaded full speed (USB2) the files the USB reader could not, which leads to the conclusion there is something up with the new card reader, some sort of weird compatibility problem.

Attached is the readout from syslog on connecting the reader to USB3, also connecting with Dolphin.