Reported-by: WangYuli <wangyuli@xxxxxxxxxxxxx> Hi all, During testing, we observed that reading CDs on an INSPUR CE3000F desktop computer (with a Phytium FT2000/4 processor [1]) running deepin 23 [2] distribution is very slow, taking over a minute. Further testing revealed that mounting the device from the command line is fast. e.g., executing "time mount /dev/sr0 /mnt" returns a value of only 0.898s. However, deepin's dde-file-manager reads more than just mounting when opening the optical drive; it also reads disc information (such as capacity, etc.). After using udisksctl to first mount and then unmount the disc to reset its state, and then using the cd_sessions tool to read disc information, we used strace to monitor system calls, testing commands are as follows: udisksctl mount -b /dev/sr0 udisksctl unmount -b /dev/sr0 strace -Ttt cd_sessions /dev/sr0 and found that openat was blocked for 42 seconds, and at this point, the process had entered kernel space. [1]. https://www.phytium.com.cn/homepage/production/6/ [2]. https://cdimage.deepin.com/releases/23/arm64/deepin-desktop-community-23-arm64.iso TEST REPORT: For this patch, before its introduction, with original system-integrated optical drives capable of recognizing discs, the total execution time for cd_sessions was 92.4 seconds, including 31.6 seconds for openat and 60.6 seconds for ioctl. With LITE-ON optical drives, under the same condition of disc recognition, the total execution time for cd_sessions was 108.2 seconds, with openat taking 45.4 seconds and ioctl taking 62.9 seconds. With RITEK optical drives, also when discs were recognizable, the total cd_sessions execution time was 98.2 seconds, with openat at 36.7 seconds and ioctl at 60.8 seconds. After the patch was introduced, the time to read disc information (using cd_sessions) with all optical drives was reduced to less than 0.5 seconds. I've tried different pairings of optical drives and SATA controllers, and the test results were consistent across the board. The Marvell 88SE9215 controller consistently emerges as the source of the problem, no matter the optical drive tested. Devices lists are as follow: CD-ROM DRIVER LIST: 1. original system-integrated optical drive *-cdrom description: DVD writer product: DVD A DH16AFSH vendor: ATAPI physical id: 0 bus info: scsi@2:0.0.0 logical name: /dev/cdrom logical name: /dev/sr0 version: DC2M capabilities: removable audio cd-r cd-rw dvd dvd-r configuration: ansiversion=5 status=ready *-medium physical id: 0 logical name: /dev/cdrom 2. a LITE-ON optical drive *-cdrom description: DVD writer product: DVD-RW DH16AFSH vendor: PLDS physical id: 0 bus info: scsi@2:0.0.0 logical name: /dev/cdrom logical name: /dev/sr0 version: DL3M capabilities: removable audio cd-r cd-rw dvd dvd-r configuration: ansiversion=5 status=nodisc 3. a RITEK optical drive *-cdrom description: DVD writer product: DH-16AFSH SUPDRV vendor: RIDATA physical id: 0 bus info: scsi@2:0.0.0 logical name: /dev/cdrom logical name: /dev/sr0 version: NWDN capabilities: removable audio cd-r cd-rw dvd dvd-r configuration: ansiversion=5 status=nodisc SATA Controllers LIST: 1. INSPUR CE3000F *-sata description: SATA controller product: 88SE9215 PCIe 2.0 x1 4-port SATA 6 Gb/s Controller vendor: Marvell Technology Group Ltd. physical id: 0 bus info: pci@0000:03:00.0 logical name: scsi2 logical name: scsi3 version: 11 width: 32 bits clock: 33MHz capabilities: sata pm msi pciexpress ahci_1.0 bus_master cap_list rom emulated configuration: driver=ahci latency=0 resources: irq:43 ioport:2020(size=8) ioport:2030(size=4) ioport:2028(size=8) ioport:2034(size=4) ioport:2000(size=32) memory:58140000-581407ff memory:58100000-5813ffff 2. Maxsun MS-WS W680 D4 Hardware Class: storage Model: "Intel SATA controller" Vendor: pci 0x8086 "Intel Corporation" Device: pci 0x7ae2 Revision: 0x11 Driver: "ahci" Driver Modules: "ahci" Memory Range: 0x82100000-0x82101fff (rw,non-prefetchable) Memory Range: 0x82102800-0x821028ff (rw,non-prefetchable) Memory Range: 0x82102000-0x821027ff (rw,non-prefetchable) IRQ: 166 (no events) Module Alias: "pci:v00008086d00007AE2sv00000000sd00000000bc01sc06i01" Driver Info #0: Driver Status: ahci is active Driver Activation Cmd: "modprobe ahci" Config Status: cfg=new, avail=yes, need=no, active=unknown Tested-by: Jie Fan <fanjie@xxxxxxxxxxxxx> Tested-by: Erpeng Xu <xuerpeng@xxxxxxxxxxxxx> Tested-by: WangYuli <wangyuli@xxxxxxxxxxxxx> Currently, due to the limited hardware I have access to, I'm unsure if this is a Marvell 88SE9215's specific issue or a general Marvell SATA controller problem. So, I think it's reasonable to add a quirk to handle this for the Marvell 88SE9215 now. Thanks, -- WangYuli