imx6 sata cdrom driver issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6 sata cdrom driver issue

7,395 Views
Jon_Bagg
Contributor III

Mounting a SATA CDROM fails aprox 1/20 times with this error....

 

root@freescale /tmp$ mount /dev/sr0 test/

UDF-fs: No partition found (1)

mount: mounting /dev/sr0 on test/ failed: Invalid argument

 

I'm using a Sabre imx6q board, freescale kernel 3.0.35 built with imx6_defconfig and the following extra configs

 

CONFIG_BLK_DEV_SR=y

CONFIG_UDF_FS=y

CONFIG_UDF_NLS=y

CONFIG_ISO9660_FS=y

 

I've tried several disks and dvd drivers.  They all experience this issue on the Sabra board.  The same disks mount 100% of the time in an x86 machine.

 

I first noticed the issue on our own imx6d boards running mainline kernel 3.19.  Once in a while the kernel would dump out a backtrace (attached) when mounting.

Original Attachment has been moved to: mount_cdrom_backtrace.txt.zip

Labels (3)
Tags (4)
0 Kudos
33 Replies

1,021 Views
richard_zhu
NXP Employee
NXP Employee

Hi Jonathan:

Sorry, I can't download the rootfs pasted above.
It reports the following info. :smileysad:

This page can't be displayed

  • Make sure the web address https://lenbrook.sharefile.com is correct.
  • Look for the page with your search engine.
  • Refresh the page in a few minutes.
  • Make sure TLS and SSL protocols are enabled. Go to Tools > Internet Options > Advanced > Settings > Security

Anyway,  did you ever do the tests with the external power supply?

What I did is listed below, the mount operations can be finished successfuly, although there maybe mount failure on the first mount sometimes.

both board and dvd_rom is powered off --> boot up board--> power on dvd_rom --> kernel booting--> mount dvd_rom.

The logs when there maybe mount failure on the first mount sometimes.

root@imx6sxsabresd:~# mount /dev/sr0 /mnt/cdrom/

UDF-fs: warning (device sr0): udf_fill_super: No partition found (2)

mount: mounting /dev/sr0 on /mnt/cdrom/ failed: Invalid argument

root@imx6sxsabresd:~# mount /dev/sr0 /mnt/cdrom/

root@imx6sxsabresd:~# df

Filesystem                                                          1K-blocks      Used  Available Use% Mounted on

10.192.224.44:/data/rootfs_home/r65037/yacto/rootfs_2014_310_110ga 1922197336 673339540 1151192824  37% /

devtmpfs                                                               216592         4     216588   1% /dev

tmpfs                                                                      40         0         40   0% /mnt/.psplash

tmpfs                                                                  380624       276     380348   1% /run

tmpfs                                                                  380624        96     380528   1% /var/volatile

/dev/mmcblk3p1                                                        7494760    432628    6658372   7% /run/media/mmcblk3p1

/dev/mmcblk2p1                                                         117760        48     117712   1% /run/media/mmcblk2p1

/dev/sr0                                                                 7274      7274          0 100% /mnt/cdrom

root@imx6sxsabresd:~#

0 Kudos

1,021 Views
Jon_Bagg
Contributor III

Both my boss and I tested the link and it is ok.  If you are still unsuccessful, please let me know and I try something else.

Over the past several weeks I have had multiple ways of powering the CDROM....

1. slim drive CDROM connected to sabre

2. slim drive CDROM powered from external supply

3. full 5-1/4" CDROM +12v powered from external supply

4. full 5-1/4" CDROM +5v & +12v powered from external supply when using port multiplier.

0 Kudos

1,021 Views
Jon_Bagg
Contributor III

If you apply ata_debug.patch, you can see some differences between the imx6 and imx53 when you run cdparanoia

dmesg | grep CDB

(note the time stamp on the last message to find the new one caused by cdparanoia )

cdparanoia -vsQ

dmesg | grep CDB

imx53

ata_scsi_dump_cdb: CDB (1:0,0,-571258880) 00 00 4a 01 00 00 10 00 00

CDB rbuf: [4a 01 00 00 10 00 00 00 08]

CDB rbuf: 00000000: 00 06 04 56 00 02 00 00

imx6 - third line is always zeros

ata_scsi_dump_cdb: CDB (1:0,0,-1122908160) 00 00 4a 01 00 00 10 00 00

CDB rbuf: [4a 01 00 00 10 00 00 00 08]

CDB rbuf: 00000000: 00 00 00 00 00 00 00 00    

0 Kudos

1,021 Views
Jon_Bagg
Contributor III

We've also discovered that cdparanoia will not function with audio disks on imx6 running mainline kernel, 3.19, 3.14 or 3.12.  This is 100% repeatable...

cdparanoia -vsQ

cdparanoia III release 10.2 (September 11, 2008)

Using cdda library version: 10.2

Using paranoia library version: 10.2

Checking /dev/cdrom for cdrom...

        Testing /dev/cdrom for SCSI/MMC interface

                SG_IO device: /dev/sr0

                Drive is neither a CDROM nor a WORM device

        Testing /dev/cdrom for cooked ioctl() interface

                /dev/sr0 is not a cooked ioctl CDROM.

I tried the same CDROM drive, audio disk and root filesystem on a mx53 Quick Start Board using the same kernel and cdparanoia works fine.  The only differences were the mx53 device tree (imx53-qsb.dtb) and the load address (0x72000000) was changed before re-compiling the kernel (it just rebuilt uImage).  It appears the kernel's imx6 sata driver has some weird quirk with CDROMs or there is a bug in the imx6 sata silicon.

cdparanoia -vsQ

cdparanoia III release 10.2 (September 11, 2008)

Using cdda library version: 10.2

Using paranoia library version: 10.2

Checking /dev/cdrom for cdrom...

        Testing /dev/cdrom for SCSI/MMC interface

                SG_IO device: /dev/sr0

CDROM model sensed sensed: TEAC DV-W28SS-B 1.2A

Checking for SCSI emulation...

        Drive is ATAPI (using SG_IO host adaptor emulation)

Checking for MMC style command set...

        Drive is MMC style

        DMA scatter/gather table entries: 1

        table entry size: 131072 bytes

        maximum theoretical transfer: 55 sectors

        Setting default read size to 27 sectors (63504 bytes).

Verifying CDDA command set...

        Expected command set reads OK.

Attempting to set cdrom to full speed...

        drive returned OK.

Table of contents (audio tracks only):

track        length               begin        copy pre ch

===========================================================

  1.    16305 [03:37.30]       33 [00:00.33]    no   no  2

  2.    49937 [11:05.62]    16338 [03:37.63]    no   no  2

  3.    29725 [06:36.25]    66275 [14:43.50]    no   no  2

  4.    14373 [03:11.48]    96000 [21:20.00]    no   no  2

  5.     7302 [01:37.27]   110373 [24:31.48]    no   no  2

  6.    12793 [02:50.43]   117675 [26:09.00]    no   no  2

  7.     9785 [02:10.35]   130468 [28:59.43]    no   no  2

  8.    19347 [04:17.72]   140253 [31:10.03]    no   no  2

  9.    10928 [02:25.53]   159600 [35:28.00]    no   no  2

10.    33980 [07:33.05]   170528 [37:53.53]    no   no  2

11.    24910 [05:32.10]   204508 [45:26.58]    no   no  2

12.    19277 [04:17.02]   229418 [50:58.68]    no   no  2

13.     7773 [01:43.48]   248695 [55:15.70]    no   no  2

TOTAL  256435 [56:59.10]    (audio only)

0 Kudos

1,021 Views
Jon_Bagg
Contributor III

Software setup for above comparison....

------[ Sabre Board setup ]------

u-boot (2015.01-rc1-00014-g63f7af9)

 

export PATH="$PATH:/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/"

export ARCH=arm

export CROSS_COMPILE=arm-none-linux-gnueabi-

make mx6qsabresd_defconfig

make

 

kernel (3.19 or mainline)

 

export PATH="$PATH:/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/"

export ARCH=arm

export CROSS_COMPILE=arm-none-linux-gnueabi-

export LOADADDR=10008000

make imx_v6_v7_defconfig

make menuconfig

1. Enable CDROM support (Drivers -> SCSI device support -> SCSI CDROM support)

2. Enable CDROM file system support (File system -> CD-ROM/DVD Filesystems -> select all)

make uImage dtbs

sdcard (sdf in PC)

sudo dd if=arch/arm/boot/uImage of=/dev/sdf bs=512 seek=2048 && sync

sudo dd if=arch/arm/boot/dts/imx6q-sabresd.dtb of=/dev/sdf bs=512 seek=20480 && sync

u-boot environment

bootargs=console=ttymxc0,115200 root=/dev/mmcblk0p1

bootcmd=run bootargs; mmc dev 1; mmc read 0x12000000 0x800 0x2f00; mmc read 0x18000000 0x5000 0x100;bootm 0x12000000 - 0x18000000

------[ imx53 Quick Start Board setup ]------

u-boot (2015.01-rc1-00014-g63f7af9)

export PATH="$PATH:/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/"

export ARCH=arm

export CROSS_COMPILE=arm-none-linux-gnueabi-

make mx53loco_defconfig

make

kernel (3.19 or mainline)

export PATH="$PATH:/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/"

export ARCH=arm

export CROSS_COMPILE=arm-none-linux-gnueabi-

export LOADADDR=72000000

make imx_v6_v7_defconfig

make menuconfig

1. Enable CDROM support (Drivers -> SCSI device support -> SCSI CDROM support)

2. Enable CDROM file system support (File system -> CD-ROM/DVD Filesystems -> select all)

make uImage dtbs

sdcard (sdf in PC)

sudo dd if=arch/arm/boot/uImage of=/dev/sdf bs=512 seek=2048 && sync

sudo dd if=arch/arm/boot/dts/imx53-qsb.dtb of=/dev/sdf bs=512 seek=20480 && sync

u-boot environment

bootargs=console=ttymxc0,115200 root=/dev/mmcblk0p1

bootcmd_mmc=run bootargs; mmc read 0x72000000 0x800 0x2f00; mmc read 0x71000000 0x5000 0x100; bootm 0x72000000 - 0x71000000

bootcmd=run bootcmd_mmc

0 Kudos

1,021 Views
fabio_estevam
NXP Employee
NXP Employee

That's interesting.

Could you remove the SATA settings from include/configs/mx53loco.h?

#define CONFIG_CMD_SATA

#ifdef CONFIG_CMD_SATA

    #define CONFIG_DWC_AHSATA

    #define CONFIG_SYS_SATA_MAX_DEVICE      1

    #define CONFIG_DWC_AHSATA_PORT_ID       0

    #define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_BASE_ADDR

    #define CONFIG_LBA48

    #define CONFIG_LIBATA

#endif

I just want to make sure that U-boot is not doing something to the SATA controller that 'fixes' the kernel issue.

Regards,

Fabio Estevam

0 Kudos

1,021 Views
Jon_Bagg
Contributor III

I commented out the whole CONFIG_CMD_SATA section, rebuilt and dd u-boot to the mx53 sdcard.  cdparanoia still works great.  Also, having a CDROM on a port multiplier on imx6 sabre breaks everything connected to the port multiplier.  The same port multiplier setup on the mx53-qsb works fine.

0 Kudos

1,021 Views
fabio_estevam
NXP Employee
NXP Employee

I am wondering if GP13 parameters need to be tweaked like done in arch/arm/boot/dts/imx6q-cubox-i.dts

0 Kudos

1,021 Views
Jon_Bagg
Contributor III

I put

&sata {

    status = "okay";

    fsl,transmit-level-mV = <1104>;

    fsl,transmit-boost-mdB = <0>;

    fsl,transmit-atten-16ths = <9>;

    fsl,no-spread-spectrum;

};

in arch/arm/boot/dts/imx6q-sabresd.dts.  cdparanoia is still very unhappy.

0 Kudos

1,021 Views
Jon_Bagg
Contributor III

I had tried similar values...

&sata {

        status = "okay";

       fsl,transmit-level-mV = <1025>;

       fsl,transmit-boost-mdB = <3330>;

       fsl,transmit-atten-16ths = <9>;

       fsl,receive-eq-mdB = <3000>;

};

Let me try the exact cubox's values on the Sabre.  We purchased a cubox to see if the CDROM worked, it has similar issues.

0 Kudos

1,021 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Jonathan,

I looked at your 3.19 logs and I would suggest you to report it to linux-ide@vger.kernel.org and linux-arm-kernel@lists.infradead.org.

Regards,

Fabio Estevam

1,021 Views
JohnBirch
NXP Employee
NXP Employee

Thanks Fabio.

Customer tried 3.19 on x86 to the same optical drive & disc and filesystem mounting is *not* intermittent on that setup.  They will report this to the kernel folks.

They are also going optical drive mounting with the same commands on i.MX53 and see what happens there.

0 Kudos

1,021 Views
fabio_estevam
NXP Employee
NXP Employee

Does it help to remove the UDF kernel options and mount it as

mount -t iso9660 /dev/sr0 /media/cdrom

Regards,

Fabio Estevam

0 Kudos