lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <36B40EDC960C005C+20250217070120.666907-1-wangyuli@uniontech.com>
Date: Mon, 17 Feb 2025 15:01:20 +0800
From: WangYuli <wangyuli@...ontech.com>
To: cassel@...nel.org
Cc: chenhuacai@...nel.org,
	chenhuacai@...ngson.cn,
	dlemoal@...nel.org,
	jiaxun.yang@...goat.com,
	kernel@...0n.name,
	linux-ide@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	WangYuli <wangyuli@...ontech.com>,
	Jie Fan <fanjie@...ontech.com>,
	Erpeng Xu <xuerpeng@...ontech.com>
Subject: Re: Re: [PATCH] ahci: Marvell controllers prefer DMA for ATAPI

Reported-by: WangYuli <wangyuli@...ontech.com>

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@...0: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@...ontech.com>
Tested-by: Erpeng Xu <xuerpeng@...ontech.com>
Tested-by: WangYuli <wangyuli@...ontech.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ