All of lore.kernel.org
 help / color / mirror / Atom feed
* DMA doesn't work since "make ata port as parent device of scsi host"
@ 2012-03-15  1:48 Jörg Sommer
  2012-03-15  1:59 ` Lin Ming
  0 siblings, 1 reply; 9+ messages in thread
From: Jörg Sommer @ 2012-03-15  1:48 UTC (permalink / raw)
  To: Lin Ming, Jeff Garzik; +Cc: Tejun Heo, linux-ide

[-- Attachment #1: Type: text/plain, Size: 8898 bytes --]

Hi,

I'm getting these messages in a KVM virtualized host and the access to
the disks is very slow. Using libata.dma=0 suppresses the warnings, but
the disks are still slow.

[    3.117419] pata-macio 0.00020000:ata-1: Activating pata-macio chipset Heathrow ATA, Apple bus ID 0
[    3.121637] scsi0 : pata_macio
[    3.123071] ata1: PATA max MWDMA2 irq 17
[    3.289181] ata1.00: ATA-7: QEMU HARDDISK, 1.0,1, max UDMA/100
[    3.290843] ata1.00: 3906250 sectors, multi 16: LBA48 
[    3.296526] ata1.01: ATA-7: QEMU HARDDISK, 1.0,1, max UDMA/100
[    3.301789] ata1.01: 1953125 sectors, multi 16: LBA48 
[    3.309588] ata1.00: configured for MWDMA2
[    3.322195] ata1.01: configured for MWDMA2
[    3.324375] scsi 0:0:0:0: Direct-Access     ATA      QEMU HARDDISK    1.0, PQ: 0 ANSI: 5
[    3.335681] sd 0:0:0:0: [sda] 3906250 512-byte logical blocks: (2.00 GB/1.86 GiB)
[    3.342118] scsi 0:0:1:0: Direct-Access     ATA      QEMU HARDDISK    1.0, PQ: 0 ANSI: 5
[    3.349779] sd 0:0:0:0: [sda] Write Protect is off
[    3.351558] sd 0:0:1:0: [sdb] 1953125 512-byte logical blocks: (1.00 GB/953 MiB)
[    3.361555] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[    3.377923]  sda: unknown partition table
[    3.387499] sd 0:0:1:0: [sdb] Write Protect is off
[    3.389902] sd 0:0:0:0: [sda] Attached SCSI disk
[    3.395363] sd 0:0:1:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[    3.407258]  sdb: unknown partition table
[    3.410463] sd 0:0:1:0: [sdb] Attached SCSI disk
[    4.137709] pata-macio 0.00021000:ata-2: Activating pata-macio chipset Heathrow ATA, Apple bus ID 0
[    4.141529] scsi1 : pata_macio
[    4.142797] ata2: PATA max MWDMA2 irq 19
[    4.302209] ata2.00: ATAPI: QEMU DVD-ROM, 1.0,1, max UDMA/100
[    4.306595] ata2.00: configured for MWDMA2
[    4.309863] scsi 1:0:0:0: CD-ROM            QEMU     QEMU DVD-ROM     1.0, PQ: 0 ANSI: 5
[    5.158307] pata-macio 0.00022000:ata-3: Activating pata-macio chipset Heathrow ATA, Apple bus ID 0
[    5.163497] scsi2 : pata_macio
[    5.164792] ata3: PATA max MWDMA2 irq 21
[    5.166278] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.168587] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    5.171020] mousedev: PS/2 mouse device common for all mice
[    5.174973] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
[    5.178453] zcache: cleancache enabled using kernel transcendent memory and compression buddies
[    5.181809] TCP cubic registered
[    5.183188] NET: Registered protocol family 17
[    5.184472] Registering the dns_resolver key type
[    5.201059] registered taskstats version 1
[    5.203025] Running tests on trace events:

[   10.524655] EXT4-fs (sda): couldn't mount as ext3 due to feature incompatibilities
[   10.528671] EXT4-fs (sda): couldn't mount as ext2 due to feature incompatibilities
[   10.574484] zcache: created ephemeral tmem pool, id=0, client=65535
[   10.577259] EXT4-fs (sda): mounted filesystem without journal. Opts: (null)
[   10.579299] VFS: Mounted root (ext4 filesystem) readonly on device 8:0.
[   10.583854] Freeing unused kernel memory: 280k freed
[   40.828762] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[   40.830697] ata1.00: failed command: READ DMA
[   40.831985] ata1.00: cmd c8/00:c8:38:22:00/00:00:00:00:00/e0 tag 0 dma 102400 in
[   40.831992]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus error)
[   40.840162] ata1.00: status: { DRDY }
[   45.923821] ata1.00: qc timeout (cmd 0xec)
[   45.925142] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[   45.926957] ata1.00: revalidation failed (errno=-5)
[   50.975553] ata1: link is slow to respond, please be patient (ready=0)
[   55.974506] ata1: device not ready (errno=-16), forcing hardreset
[   55.976336] ata1: soft resetting link
[   56.137659] ata1.00: configured for MWDMA2
[   56.142009] ata1.01: configured for MWDMA2
[   56.143237] ata1.00: device reported invalid CHS sector 0
[   56.144780] sd 0:0:0:0: [sda]  Result: hostbyte=0x00 driverbyte=0x08
[   56.146859] sd 0:0:0:0: [sda]  Sense Key : 0xb [current] [descriptor]
[   56.148833] Descriptor sense data with sense descriptors (in hex):
[   56.150542]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
[   56.153138]         00 00 00 00 
[   56.154286] sd 0:0:0:0: [sda]  ASC=0x0 ASCQ=0x0
[   56.155722] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 22 38 00 00 c8 00
[   56.161462] end_request: I/O error, dev sda, sector 8760
[   56.163069] ata1: EH complete
[   86.870671] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[   86.872494] ata1.00: failed command: READ DMA
[   86.873741] ata1.00: cmd c8/00:c0:40:22:00/00:00:00:00:00/e0 tag 0 dma 98304 in
[   86.873748]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus error)
[   86.877995] ata1.00: status: { DRDY }
[   91.961330] ata1.00: qc timeout (cmd 0xec)
[   91.962699] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[   91.964398] ata1.00: revalidation failed (errno=-5)
[   97.014555] ata1: link is slow to respond, please be patient (ready=0)
[  102.016502] ata1: device not ready (errno=-16), forcing hardreset
[  102.018329] ata1: soft resetting link
[  102.182355] ata1.00: configured for MWDMA2
[  102.186312] ata1.01: configured for MWDMA2
[  102.187498] ata1.00: device reported invalid CHS sector 0
[  102.189078] ata1: EH complete
[  132.862149] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[  132.864011] ata1.00: failed command: READ DMA
[  132.865674] ata1.00: cmd c8/00:c0:40:22:00/00:00:00:00:00/e0 tag 0 dma 98304 in
[  132.865682]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus error)
[  132.869786] ata1.00: status: { DRDY }
[  137.949377] ata1.00: qc timeout (cmd 0xec)
[  137.950632] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  137.952549] ata1.00: revalidation failed (errno=-5)
[  142.954461] ata1: link is slow to respond, please be patient (ready=0)

I've tracked this down to „ata: make ata port as parent device of scsi
host“ (9a6d6a2ddabbd32c07f6a38b659e5f3db319fa5a) with git biset.

    ata: make ata port as parent device of scsi host
    
    Currently, the device tree of ata port and scsi host looks as below,
    
            /sys/devices/pci0000:00/0000:00:1f.2    (ahci controller)
            |-- ata1                                (ata port)
            |-- host0                               (scsi host)
               |-- target0:0:0                      (scsi target)
                   |-- 0:0:0:0                      (disk)
    
    This patch makes ata port as parent device of scsi host, then it becomes
    
            /sys/devices/pci0000:00/0000:00:1f.2    (ahci controller)
            |-- ata1                                (ata port)
                |-- host0                           (scsi host)
                    |-- target0:0:0                 (scsi target)
                        |-- 0:0:0:0                 (disk)
    
    With this change, the ata port runtime PM is easier.
    For example, the ata port runtime suspend will happen as,
    
    disk suspend --> scsi target suspend --> scsi host suspend --> ata port
    suspend.
    
    Acked-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Lin Ming <ming.m.lin@intel.com>
    Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 2a5412e..7ae1e77 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3398,7 +3398,7 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
                 */
                shost->max_host_blocked = 1;
 
-               rc = scsi_add_host(ap->scsi_host, ap->host->dev);
+               rc = scsi_add_host(ap->scsi_host, &ap->tdev);
                if (rc)
                        goto err_add;
        }

Can you tell, what might be wrong?

% cat /proc/cpuinfo
processor	: 0
cpu		: 7455, altivec supported
clock		: 798.720000MHz
revision	: 3.3 (pvr 8001 0303)
bogomips	: 48.58
timebase	: 18432000
platform	: PowerMac
model		: PowerBook6,3
machine		: PowerBook6,3
motherboard	: PowerBook6,3 MacRISC3 Power Macintosh
detected as	: 287 (iBook G4)
pmac flags	: 0000001b
L2 cache	: 256K unified
pmac-generation	: NewWorld
Memory		: 640 MB

# qemu-system-ppc -enable-kvm -M mac99 -cpu G4 -k de \
  -kernel /boot/vmlinuz-3.3.0-rc5 \
  -append 'root=/dev/sda ro console=ttyPZ0 zcache' \
  -hda /mnt/data/debian-base-root.raw -hdb /mnt/data/debian-base-var.raw

Bye, Jörg.
-- 
If Java had true garbage collection, most programs would delete
themselves upon execution

[-- Attachment #2: Digital signature http://en.wikipedia.org/wiki/OpenPGP --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: DMA doesn't work since "make ata port as parent device of scsi host"
  2012-03-15  1:48 DMA doesn't work since "make ata port as parent device of scsi host" Jörg Sommer
@ 2012-03-15  1:59 ` Lin Ming
  2012-03-15  3:26   ` Lin Ming
  0 siblings, 1 reply; 9+ messages in thread
From: Lin Ming @ 2012-03-15  1:59 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: Jeff Garzik, Tejun Heo, linux-ide

On Thu, 2012-03-15 at 02:48 +0100, Jörg Sommer wrote:
> Hi,
> 
> I'm getting these messages in a KVM virtualized host and the access to
> the disks is very slow. Using libata.dma=0 suppresses the warnings, but
> the disks are still slow.

Hi Jörg,

Let me try to reproduce this issue first.

Thanks for the report.
Lin Ming

> 
> [    3.117419] pata-macio 0.00020000:ata-1: Activating pata-macio chipset Heathrow ATA, Apple bus ID 0
> [    3.121637] scsi0 : pata_macio
> [    3.123071] ata1: PATA max MWDMA2 irq 17
> [    3.289181] ata1.00: ATA-7: QEMU HARDDISK, 1.0,1, max UDMA/100
> [    3.290843] ata1.00: 3906250 sectors, multi 16: LBA48 
> [    3.296526] ata1.01: ATA-7: QEMU HARDDISK, 1.0,1, max UDMA/100
> [    3.301789] ata1.01: 1953125 sectors, multi 16: LBA48 
> [    3.309588] ata1.00: configured for MWDMA2
> [    3.322195] ata1.01: configured for MWDMA2
> [    3.324375] scsi 0:0:0:0: Direct-Access     ATA      QEMU HARDDISK    1.0, PQ: 0 ANSI: 5
> [    3.335681] sd 0:0:0:0: [sda] 3906250 512-byte logical blocks: (2.00 GB/1.86 GiB)
> [    3.342118] scsi 0:0:1:0: Direct-Access     ATA      QEMU HARDDISK    1.0, PQ: 0 ANSI: 5
> [    3.349779] sd 0:0:0:0: [sda] Write Protect is off
> [    3.351558] sd 0:0:1:0: [sdb] 1953125 512-byte logical blocks: (1.00 GB/953 MiB)
> [    3.361555] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
> [    3.377923]  sda: unknown partition table
> [    3.387499] sd 0:0:1:0: [sdb] Write Protect is off
> [    3.389902] sd 0:0:0:0: [sda] Attached SCSI disk
> [    3.395363] sd 0:0:1:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
> [    3.407258]  sdb: unknown partition table
> [    3.410463] sd 0:0:1:0: [sdb] Attached SCSI disk
> [    4.137709] pata-macio 0.00021000:ata-2: Activating pata-macio chipset Heathrow ATA, Apple bus ID 0
> [    4.141529] scsi1 : pata_macio
> [    4.142797] ata2: PATA max MWDMA2 irq 19
> [    4.302209] ata2.00: ATAPI: QEMU DVD-ROM, 1.0,1, max UDMA/100
> [    4.306595] ata2.00: configured for MWDMA2
> [    4.309863] scsi 1:0:0:0: CD-ROM            QEMU     QEMU DVD-ROM     1.0, PQ: 0 ANSI: 5
> [    5.158307] pata-macio 0.00022000:ata-3: Activating pata-macio chipset Heathrow ATA, Apple bus ID 0
> [    5.163497] scsi2 : pata_macio
> [    5.164792] ata3: PATA max MWDMA2 irq 21
> [    5.166278] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> [    5.168587] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
> [    5.171020] mousedev: PS/2 mouse device common for all mice
> [    5.174973] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
> [    5.178453] zcache: cleancache enabled using kernel transcendent memory and compression buddies
> [    5.181809] TCP cubic registered
> [    5.183188] NET: Registered protocol family 17
> [    5.184472] Registering the dns_resolver key type
> [    5.201059] registered taskstats version 1
> [    5.203025] Running tests on trace events:
> 
> [   10.524655] EXT4-fs (sda): couldn't mount as ext3 due to feature incompatibilities
> [   10.528671] EXT4-fs (sda): couldn't mount as ext2 due to feature incompatibilities
> [   10.574484] zcache: created ephemeral tmem pool, id=0, client=65535
> [   10.577259] EXT4-fs (sda): mounted filesystem without journal. Opts: (null)
> [   10.579299] VFS: Mounted root (ext4 filesystem) readonly on device 8:0.
> [   10.583854] Freeing unused kernel memory: 280k freed
> [   40.828762] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
> [   40.830697] ata1.00: failed command: READ DMA
> [   40.831985] ata1.00: cmd c8/00:c8:38:22:00/00:00:00:00:00/e0 tag 0 dma 102400 in
> [   40.831992]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus error)
> [   40.840162] ata1.00: status: { DRDY }
> [   45.923821] ata1.00: qc timeout (cmd 0xec)
> [   45.925142] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
> [   45.926957] ata1.00: revalidation failed (errno=-5)
> [   50.975553] ata1: link is slow to respond, please be patient (ready=0)
> [   55.974506] ata1: device not ready (errno=-16), forcing hardreset
> [   55.976336] ata1: soft resetting link
> [   56.137659] ata1.00: configured for MWDMA2
> [   56.142009] ata1.01: configured for MWDMA2
> [   56.143237] ata1.00: device reported invalid CHS sector 0
> [   56.144780] sd 0:0:0:0: [sda]  Result: hostbyte=0x00 driverbyte=0x08
> [   56.146859] sd 0:0:0:0: [sda]  Sense Key : 0xb [current] [descriptor]
> [   56.148833] Descriptor sense data with sense descriptors (in hex):
> [   56.150542]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
> [   56.153138]         00 00 00 00 
> [   56.154286] sd 0:0:0:0: [sda]  ASC=0x0 ASCQ=0x0
> [   56.155722] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 22 38 00 00 c8 00
> [   56.161462] end_request: I/O error, dev sda, sector 8760
> [   56.163069] ata1: EH complete
> [   86.870671] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
> [   86.872494] ata1.00: failed command: READ DMA
> [   86.873741] ata1.00: cmd c8/00:c0:40:22:00/00:00:00:00:00/e0 tag 0 dma 98304 in
> [   86.873748]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus error)
> [   86.877995] ata1.00: status: { DRDY }
> [   91.961330] ata1.00: qc timeout (cmd 0xec)
> [   91.962699] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
> [   91.964398] ata1.00: revalidation failed (errno=-5)
> [   97.014555] ata1: link is slow to respond, please be patient (ready=0)
> [  102.016502] ata1: device not ready (errno=-16), forcing hardreset
> [  102.018329] ata1: soft resetting link
> [  102.182355] ata1.00: configured for MWDMA2
> [  102.186312] ata1.01: configured for MWDMA2
> [  102.187498] ata1.00: device reported invalid CHS sector 0
> [  102.189078] ata1: EH complete
> [  132.862149] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
> [  132.864011] ata1.00: failed command: READ DMA
> [  132.865674] ata1.00: cmd c8/00:c0:40:22:00/00:00:00:00:00/e0 tag 0 dma 98304 in
> [  132.865682]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus error)
> [  132.869786] ata1.00: status: { DRDY }
> [  137.949377] ata1.00: qc timeout (cmd 0xec)
> [  137.950632] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
> [  137.952549] ata1.00: revalidation failed (errno=-5)
> [  142.954461] ata1: link is slow to respond, please be patient (ready=0)
> 
> I've tracked this down to „ata: make ata port as parent device of scsi
> host“ (9a6d6a2ddabbd32c07f6a38b659e5f3db319fa5a) with git biset.
> 
>     ata: make ata port as parent device of scsi host
>     
>     Currently, the device tree of ata port and scsi host looks as below,
>     
>             /sys/devices/pci0000:00/0000:00:1f.2    (ahci controller)
>             |-- ata1                                (ata port)
>             |-- host0                               (scsi host)
>                |-- target0:0:0                      (scsi target)
>                    |-- 0:0:0:0                      (disk)
>     
>     This patch makes ata port as parent device of scsi host, then it becomes
>     
>             /sys/devices/pci0000:00/0000:00:1f.2    (ahci controller)
>             |-- ata1                                (ata port)
>                 |-- host0                           (scsi host)
>                     |-- target0:0:0                 (scsi target)
>                         |-- 0:0:0:0                 (disk)
>     
>     With this change, the ata port runtime PM is easier.
>     For example, the ata port runtime suspend will happen as,
>     
>     disk suspend --> scsi target suspend --> scsi host suspend --> ata port
>     suspend.
>     
>     Acked-by: Tejun Heo <tj@kernel.org>
>     Signed-off-by: Lin Ming <ming.m.lin@intel.com>
>     Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
> 
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index 2a5412e..7ae1e77 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -3398,7 +3398,7 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
>                  */
>                 shost->max_host_blocked = 1;
>  
> -               rc = scsi_add_host(ap->scsi_host, ap->host->dev);
> +               rc = scsi_add_host(ap->scsi_host, &ap->tdev);
>                 if (rc)
>                         goto err_add;
>         }
> 
> Can you tell, what might be wrong?
> 
> % cat /proc/cpuinfo
> processor	: 0
> cpu		: 7455, altivec supported
> clock		: 798.720000MHz
> revision	: 3.3 (pvr 8001 0303)
> bogomips	: 48.58
> timebase	: 18432000
> platform	: PowerMac
> model		: PowerBook6,3
> machine		: PowerBook6,3
> motherboard	: PowerBook6,3 MacRISC3 Power Macintosh
> detected as	: 287 (iBook G4)
> pmac flags	: 0000001b
> L2 cache	: 256K unified
> pmac-generation	: NewWorld
> Memory		: 640 MB
> 
> # qemu-system-ppc -enable-kvm -M mac99 -cpu G4 -k de \
>   -kernel /boot/vmlinuz-3.3.0-rc5 \
>   -append 'root=/dev/sda ro console=ttyPZ0 zcache' \
>   -hda /mnt/data/debian-base-root.raw -hdb /mnt/data/debian-base-var.raw
> 
> Bye, Jörg.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: DMA doesn't work since "make ata port as parent device of scsi host"
  2012-03-15  1:59 ` Lin Ming
@ 2012-03-15  3:26   ` Lin Ming
  2012-03-15  7:48     ` Jörg Sommer
  0 siblings, 1 reply; 9+ messages in thread
From: Lin Ming @ 2012-03-15  3:26 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: Jeff Garzik, Tejun Heo, linux-ide

On Thu, 2012-03-15 at 09:59 +0800, Lin Ming wrote:
> On Thu, 2012-03-15 at 02:48 +0100, Jörg Sommer wrote:
> > Hi,
> > 
> > I'm getting these messages in a KVM virtualized host and the access to
> > the disks is very slow. Using libata.dma=0 suppresses the warnings, but
> > the disks are still slow.
> 
> Hi Jörg,
> 
> Let me try to reproduce this issue first.

I tried below commands on x86_32, but can't reproduce it.

qemu-system-i386 -kernel /root/vmlinuz-3.3.0-rc7 -append "root=/dev/sda1
zcache" -hda /root/debian-32.img -hdb /root/data.img

Maybe because i386 uses different ata controller than ppc(ata_piix vs
pata-macio).

I'll try qemu-system-ppc.

Did you need to run some workload to trigger these warings?
Or did you get these warnings right after booting the VM?

Would you please try to disable ata port runtime pm?
You can disable it by, for example,

# echo on > /sys/devices/pci0000:00/0000:00:01.1/ata1/control

You need to change above path of "ata1" in the sysfs of your VM.

Thanks,
Lin Ming

> 
> Thanks for the report.
> Lin Ming
> 
> > 
> > [    3.117419] pata-macio 0.00020000:ata-1: Activating pata-macio chipset Heathrow ATA, Apple bus ID 0
> > [    3.121637] scsi0 : pata_macio
> > [    3.123071] ata1: PATA max MWDMA2 irq 17
> > [    3.289181] ata1.00: ATA-7: QEMU HARDDISK, 1.0,1, max UDMA/100
> > [    3.290843] ata1.00: 3906250 sectors, multi 16: LBA48 
> > [    3.296526] ata1.01: ATA-7: QEMU HARDDISK, 1.0,1, max UDMA/100
> > [    3.301789] ata1.01: 1953125 sectors, multi 16: LBA48 
> > [    3.309588] ata1.00: configured for MWDMA2
> > [    3.322195] ata1.01: configured for MWDMA2
> > [    3.324375] scsi 0:0:0:0: Direct-Access     ATA      QEMU HARDDISK    1.0, PQ: 0 ANSI: 5
> > [    3.335681] sd 0:0:0:0: [sda] 3906250 512-byte logical blocks: (2.00 GB/1.86 GiB)
> > [    3.342118] scsi 0:0:1:0: Direct-Access     ATA      QEMU HARDDISK    1.0, PQ: 0 ANSI: 5
> > [    3.349779] sd 0:0:0:0: [sda] Write Protect is off
> > [    3.351558] sd 0:0:1:0: [sdb] 1953125 512-byte logical blocks: (1.00 GB/953 MiB)
> > [    3.361555] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
> > [    3.377923]  sda: unknown partition table
> > [    3.387499] sd 0:0:1:0: [sdb] Write Protect is off
> > [    3.389902] sd 0:0:0:0: [sda] Attached SCSI disk
> > [    3.395363] sd 0:0:1:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
> > [    3.407258]  sdb: unknown partition table
> > [    3.410463] sd 0:0:1:0: [sdb] Attached SCSI disk
> > [    4.137709] pata-macio 0.00021000:ata-2: Activating pata-macio chipset Heathrow ATA, Apple bus ID 0
> > [    4.141529] scsi1 : pata_macio
> > [    4.142797] ata2: PATA max MWDMA2 irq 19
> > [    4.302209] ata2.00: ATAPI: QEMU DVD-ROM, 1.0,1, max UDMA/100
> > [    4.306595] ata2.00: configured for MWDMA2
> > [    4.309863] scsi 1:0:0:0: CD-ROM            QEMU     QEMU DVD-ROM     1.0, PQ: 0 ANSI: 5
> > [    5.158307] pata-macio 0.00022000:ata-3: Activating pata-macio chipset Heathrow ATA, Apple bus ID 0
> > [    5.163497] scsi2 : pata_macio
> > [    5.164792] ata3: PATA max MWDMA2 irq 21
> > [    5.166278] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> > [    5.168587] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
> > [    5.171020] mousedev: PS/2 mouse device common for all mice
> > [    5.174973] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
> > [    5.178453] zcache: cleancache enabled using kernel transcendent memory and compression buddies
> > [    5.181809] TCP cubic registered
> > [    5.183188] NET: Registered protocol family 17
> > [    5.184472] Registering the dns_resolver key type
> > [    5.201059] registered taskstats version 1
> > [    5.203025] Running tests on trace events:
> > 
> > [   10.524655] EXT4-fs (sda): couldn't mount as ext3 due to feature incompatibilities
> > [   10.528671] EXT4-fs (sda): couldn't mount as ext2 due to feature incompatibilities
> > [   10.574484] zcache: created ephemeral tmem pool, id=0, client=65535
> > [   10.577259] EXT4-fs (sda): mounted filesystem without journal. Opts: (null)
> > [   10.579299] VFS: Mounted root (ext4 filesystem) readonly on device 8:0.
> > [   10.583854] Freeing unused kernel memory: 280k freed
> > [   40.828762] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
> > [   40.830697] ata1.00: failed command: READ DMA
> > [   40.831985] ata1.00: cmd c8/00:c8:38:22:00/00:00:00:00:00/e0 tag 0 dma 102400 in
> > [   40.831992]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus error)
> > [   40.840162] ata1.00: status: { DRDY }
> > [   45.923821] ata1.00: qc timeout (cmd 0xec)
> > [   45.925142] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
> > [   45.926957] ata1.00: revalidation failed (errno=-5)
> > [   50.975553] ata1: link is slow to respond, please be patient (ready=0)
> > [   55.974506] ata1: device not ready (errno=-16), forcing hardreset
> > [   55.976336] ata1: soft resetting link
> > [   56.137659] ata1.00: configured for MWDMA2
> > [   56.142009] ata1.01: configured for MWDMA2
> > [   56.143237] ata1.00: device reported invalid CHS sector 0
> > [   56.144780] sd 0:0:0:0: [sda]  Result: hostbyte=0x00 driverbyte=0x08
> > [   56.146859] sd 0:0:0:0: [sda]  Sense Key : 0xb [current] [descriptor]
> > [   56.148833] Descriptor sense data with sense descriptors (in hex):
> > [   56.150542]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
> > [   56.153138]         00 00 00 00 
> > [   56.154286] sd 0:0:0:0: [sda]  ASC=0x0 ASCQ=0x0
> > [   56.155722] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 22 38 00 00 c8 00
> > [   56.161462] end_request: I/O error, dev sda, sector 8760
> > [   56.163069] ata1: EH complete
> > [   86.870671] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
> > [   86.872494] ata1.00: failed command: READ DMA
> > [   86.873741] ata1.00: cmd c8/00:c0:40:22:00/00:00:00:00:00/e0 tag 0 dma 98304 in
> > [   86.873748]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus error)
> > [   86.877995] ata1.00: status: { DRDY }
> > [   91.961330] ata1.00: qc timeout (cmd 0xec)
> > [   91.962699] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
> > [   91.964398] ata1.00: revalidation failed (errno=-5)
> > [   97.014555] ata1: link is slow to respond, please be patient (ready=0)
> > [  102.016502] ata1: device not ready (errno=-16), forcing hardreset
> > [  102.018329] ata1: soft resetting link
> > [  102.182355] ata1.00: configured for MWDMA2
> > [  102.186312] ata1.01: configured for MWDMA2
> > [  102.187498] ata1.00: device reported invalid CHS sector 0
> > [  102.189078] ata1: EH complete
> > [  132.862149] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
> > [  132.864011] ata1.00: failed command: READ DMA
> > [  132.865674] ata1.00: cmd c8/00:c0:40:22:00/00:00:00:00:00/e0 tag 0 dma 98304 in
> > [  132.865682]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus error)
> > [  132.869786] ata1.00: status: { DRDY }
> > [  137.949377] ata1.00: qc timeout (cmd 0xec)
> > [  137.950632] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
> > [  137.952549] ata1.00: revalidation failed (errno=-5)
> > [  142.954461] ata1: link is slow to respond, please be patient (ready=0)
> > 
> > I've tracked this down to „ata: make ata port as parent device of scsi
> > host“ (9a6d6a2ddabbd32c07f6a38b659e5f3db319fa5a) with git biset.
> > 
> >     ata: make ata port as parent device of scsi host
> >     
> >     Currently, the device tree of ata port and scsi host looks as below,
> >     
> >             /sys/devices/pci0000:00/0000:00:1f.2    (ahci controller)
> >             |-- ata1                                (ata port)
> >             |-- host0                               (scsi host)
> >                |-- target0:0:0                      (scsi target)
> >                    |-- 0:0:0:0                      (disk)
> >     
> >     This patch makes ata port as parent device of scsi host, then it becomes
> >     
> >             /sys/devices/pci0000:00/0000:00:1f.2    (ahci controller)
> >             |-- ata1                                (ata port)
> >                 |-- host0                           (scsi host)
> >                     |-- target0:0:0                 (scsi target)
> >                         |-- 0:0:0:0                 (disk)
> >     
> >     With this change, the ata port runtime PM is easier.
> >     For example, the ata port runtime suspend will happen as,
> >     
> >     disk suspend --> scsi target suspend --> scsi host suspend --> ata port
> >     suspend.
> >     
> >     Acked-by: Tejun Heo <tj@kernel.org>
> >     Signed-off-by: Lin Ming <ming.m.lin@intel.com>
> >     Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
> > 
> > diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> > index 2a5412e..7ae1e77 100644
> > --- a/drivers/ata/libata-scsi.c
> > +++ b/drivers/ata/libata-scsi.c
> > @@ -3398,7 +3398,7 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
> >                  */
> >                 shost->max_host_blocked = 1;
> >  
> > -               rc = scsi_add_host(ap->scsi_host, ap->host->dev);
> > +               rc = scsi_add_host(ap->scsi_host, &ap->tdev);
> >                 if (rc)
> >                         goto err_add;
> >         }
> > 
> > Can you tell, what might be wrong?
> > 
> > % cat /proc/cpuinfo
> > processor	: 0
> > cpu		: 7455, altivec supported
> > clock		: 798.720000MHz
> > revision	: 3.3 (pvr 8001 0303)
> > bogomips	: 48.58
> > timebase	: 18432000
> > platform	: PowerMac
> > model		: PowerBook6,3
> > machine		: PowerBook6,3
> > motherboard	: PowerBook6,3 MacRISC3 Power Macintosh
> > detected as	: 287 (iBook G4)
> > pmac flags	: 0000001b
> > L2 cache	: 256K unified
> > pmac-generation	: NewWorld
> > Memory		: 640 MB
> > 
> > # qemu-system-ppc -enable-kvm -M mac99 -cpu G4 -k de \
> >   -kernel /boot/vmlinuz-3.3.0-rc5 \
> >   -append 'root=/dev/sda ro console=ttyPZ0 zcache' \
> >   -hda /mnt/data/debian-base-root.raw -hdb /mnt/data/debian-base-var.raw
> > 
> > Bye, Jörg.
> 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: DMA doesn't work since "make ata port as parent device of scsi host"
  2012-03-15  3:26   ` Lin Ming
@ 2012-03-15  7:48     ` Jörg Sommer
  2012-03-15  8:19       ` Lin Ming
  0 siblings, 1 reply; 9+ messages in thread
From: Jörg Sommer @ 2012-03-15  7:48 UTC (permalink / raw)
  To: Lin Ming; +Cc: Jeff Garzik, Tejun Heo, linux-ide

[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]

Lin Ming hat am Thu 15. Mar, 11:26 (+0800) geschrieben:
> On Thu, 2012-03-15 at 09:59 +0800, Lin Ming wrote:
> > On Thu, 2012-03-15 at 02:48 +0100, Jörg Sommer wrote:
> > > Hi,
> > > 
> > > I'm getting these messages in a KVM virtualized host and the access to
> > > the disks is very slow. Using libata.dma=0 suppresses the warnings, but
> > > the disks are still slow.
> > 
> > Hi Jörg,
> > 
> > Let me try to reproduce this issue first.
> 
> I tried below commands on x86_32, but can't reproduce it.
> 
> qemu-system-i386 -kernel /root/vmlinuz-3.3.0-rc7 -append "root=/dev/sda1
> zcache" -hda /root/debian-32.img -hdb /root/data.img
> 
> Maybe because i386 uses different ata controller than ppc(ata_piix vs
> pata-macio).
> 
> I'll try qemu-system-ppc.
> 
> Did you need to run some workload to trigger these warings?
> Or did you get these warnings right after booting the VM?

These warnings come up before »INIT started«. I don't have to do
anything, just wait and see.

# truncate -s100M /mnt/data/new
# mke2fs -Fq /mnt/data/new
# mount -o loop /mnt/data/new /mnt/other
# cp --parents /bin/zsh-static /mnt/other/zsh
# umount /mnt/other
# qemu-system-ppc -enable-kvm -M mac99 -cpu G4 -k de -kernel /boot/vmlinuz-3.3.0-rc5-04520-g8d233c0 -append 'root=/dev/sda ro console=ttyPZ0 init=/zsh' -hda /mnt/data/new

I've uploaded my config and the kernel:
http://alioth.debian.org/~jo-guest/config-3.3.0-rc5-04520-g8d233c0
http://alioth.debian.org/~jo-guest/vmlinuz-3.3.0-rc5-04520-g8d233c0

You have to switch to the serial console (Ctrl-Alt-3 or with -nographic
Ctrl-a c). All kernel messages arrive there.

> Would you please try to disable ata port runtime pm?
> You can disable it by, for example,

Is this also possible with a kernel parameter? It takes very long until I
get a shell prompt.

Bye, Jörg.
-- 
But in the case of "git revert", it should be an ancestor (or the user
is just insane, in which case it doesn't matter - insane people can do
insane things)
Linus Torvalds <alpine.LFD.1.00.0801041031590.2811@woody.linux-foundation.org>

[-- Attachment #2: Digital signature http://en.wikipedia.org/wiki/OpenPGP --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: DMA doesn't work since "make ata port as parent device of scsi host"
  2012-03-15  7:48     ` Jörg Sommer
@ 2012-03-15  8:19       ` Lin Ming
  2012-03-15 15:59         ` Jörg Sommer
  0 siblings, 1 reply; 9+ messages in thread
From: Lin Ming @ 2012-03-15  8:19 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: Jeff Garzik, Tejun Heo, linux-ide

On Thu, 2012-03-15 at 08:48 +0100, Jörg Sommer wrote:
> Lin Ming hat am Thu 15. Mar, 11:26 (+0800) geschrieben:
> > On Thu, 2012-03-15 at 09:59 +0800, Lin Ming wrote:
> > > On Thu, 2012-03-15 at 02:48 +0100, Jörg Sommer wrote:
> > > > Hi,
> > > > 
> > > > I'm getting these messages in a KVM virtualized host and the access to
> > > > the disks is very slow. Using libata.dma=0 suppresses the warnings, but
> > > > the disks are still slow.
> > > 
> > > Hi Jörg,
> > > 
> > > Let me try to reproduce this issue first.
> > 
> > I tried below commands on x86_32, but can't reproduce it.
> > 
> > qemu-system-i386 -kernel /root/vmlinuz-3.3.0-rc7 -append "root=/dev/sda1
> > zcache" -hda /root/debian-32.img -hdb /root/data.img
> > 
> > Maybe because i386 uses different ata controller than ppc(ata_piix vs
> > pata-macio).
> > 
> > I'll try qemu-system-ppc.
> > 
> > Did you need to run some workload to trigger these warings?
> > Or did you get these warnings right after booting the VM?
> 
> These warnings come up before »INIT started«. I don't have to do
> anything, just wait and see.
> 
> # truncate -s100M /mnt/data/new
> # mke2fs -Fq /mnt/data/new
> # mount -o loop /mnt/data/new /mnt/other
> # cp --parents /bin/zsh-static /mnt/other/zsh
> # umount /mnt/other
> # qemu-system-ppc -enable-kvm -M mac99 -cpu G4 -k de -kernel /boot/vmlinuz-3.3.0-rc5-04520-g8d233c0 -append 'root=/dev/sda ro console=ttyPZ0 init=/zsh' -hda /mnt/data/new
> 
> I've uploaded my config and the kernel:
> http://alioth.debian.org/~jo-guest/config-3.3.0-rc5-04520-g8d233c0
> http://alioth.debian.org/~jo-guest/vmlinuz-3.3.0-rc5-04520-g8d233c0
> 
> You have to switch to the serial console (Ctrl-Alt-3 or with -nographic
> Ctrl-a c). All kernel messages arrive there.
> 
> > Would you please try to disable ata port runtime pm?
> > You can disable it by, for example,
> 
> Is this also possible with a kernel parameter? It takes very long until I
> get a shell prompt.

No, but you can try below debug patch to disable port runtime pm.

diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 74aaee3..8def3fc 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -293,7 +293,6 @@ int ata_tport_add(struct device *parent,
 
 	device_enable_async_suspend(dev);
 	pm_runtime_set_active(dev);
-	pm_runtime_enable(dev);
 
 	transport_add_device(dev);
 	transport_configure_device(dev);


> 
> Bye, Jörg.



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: DMA doesn't work since "make ata port as parent device of scsi host"
  2012-03-15  8:19       ` Lin Ming
@ 2012-03-15 15:59         ` Jörg Sommer
  2012-03-19  8:55           ` Lin Ming
  2012-03-21  1:25           ` Lin Ming
  0 siblings, 2 replies; 9+ messages in thread
From: Jörg Sommer @ 2012-03-15 15:59 UTC (permalink / raw)
  To: Lin Ming; +Cc: Jeff Garzik, Tejun Heo, linux-ide

[-- Attachment #1: Type: text/plain, Size: 2870 bytes --]

Lin Ming hat am Thu 15. Mar, 16:19 (+0800) geschrieben:
> On Thu, 2012-03-15 at 08:48 +0100, Jörg Sommer wrote:
> > Lin Ming hat am Thu 15. Mar, 11:26 (+0800) geschrieben:
> > > On Thu, 2012-03-15 at 09:59 +0800, Lin Ming wrote:
> > > > On Thu, 2012-03-15 at 02:48 +0100, Jörg Sommer wrote:
> > > > > Hi,
> > > > > 
> > > > > I'm getting these messages in a KVM virtualized host and the access to
> > > > > the disks is very slow. Using libata.dma=0 suppresses the warnings, but
> > > > > the disks are still slow.
> > > > 
> > > > Hi Jörg,
> > > > 
> > > > Let me try to reproduce this issue first.
> > > 
> > > I tried below commands on x86_32, but can't reproduce it.
> > > 
> > > qemu-system-i386 -kernel /root/vmlinuz-3.3.0-rc7 -append "root=/dev/sda1
> > > zcache" -hda /root/debian-32.img -hdb /root/data.img
> > > 
> > > Maybe because i386 uses different ata controller than ppc(ata_piix vs
> > > pata-macio).
> > > 
> > > I'll try qemu-system-ppc.
> > > 
> > > Did you need to run some workload to trigger these warings?
> > > Or did you get these warnings right after booting the VM?
> > 
> > These warnings come up before »INIT started«. I don't have to do
> > anything, just wait and see.
> > 
> > # truncate -s100M /mnt/data/new
> > # mke2fs -Fq /mnt/data/new
> > # mount -o loop /mnt/data/new /mnt/other
> > # cp --parents /bin/zsh-static /mnt/other/zsh
> > # umount /mnt/other
> > # qemu-system-ppc -enable-kvm -M mac99 -cpu G4 -k de -kernel /boot/vmlinuz-3.3.0-rc5-04520-g8d233c0 -append 'root=/dev/sda ro console=ttyPZ0 init=/zsh' -hda /mnt/data/new
> > 
> > I've uploaded my config and the kernel:
> > http://alioth.debian.org/~jo-guest/config-3.3.0-rc5-04520-g8d233c0
> > http://alioth.debian.org/~jo-guest/vmlinuz-3.3.0-rc5-04520-g8d233c0
> > 
> > You have to switch to the serial console (Ctrl-Alt-3 or with -nographic
> > Ctrl-a c). All kernel messages arrive there.
> > 
> > > Would you please try to disable ata port runtime pm?
> > > You can disable it by, for example,
> > 
> > Is this also possible with a kernel parameter? It takes very long until I
> > get a shell prompt.
> 
> No, but you can try below debug patch to disable port runtime pm.
> 
> diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
> index 74aaee3..8def3fc 100644
> --- a/drivers/ata/libata-transport.c
> +++ b/drivers/ata/libata-transport.c
> @@ -293,7 +293,6 @@ int ata_tport_add(struct device *parent,
>  
>  	device_enable_async_suspend(dev);
>  	pm_runtime_set_active(dev);
> -	pm_runtime_enable(dev);

This patch doesn't change anything. The kernel still hangs. If you have
more patches or ideas, let me know.

Bye, Jörg.
-- 
Just because you’re paranoid doesn’t mean they’re not after you.
                                                  (Henry Kissinger)

[-- Attachment #2: Digital signature http://en.wikipedia.org/wiki/OpenPGP --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: DMA doesn't work since "make ata port as parent device of scsi host"
  2012-03-15 15:59         ` Jörg Sommer
@ 2012-03-19  8:55           ` Lin Ming
  2012-03-21  1:25           ` Lin Ming
  1 sibling, 0 replies; 9+ messages in thread
From: Lin Ming @ 2012-03-19  8:55 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: Jeff Garzik, Tejun Heo, linux-ide

On Thu, 2012-03-15 at 16:59 +0100, Jörg Sommer wrote:
> Lin Ming hat am Thu 15. Mar, 16:19 (+0800) geschrieben:
> > On Thu, 2012-03-15 at 08:48 +0100, Jörg Sommer wrote:
> > > Lin Ming hat am Thu 15. Mar, 11:26 (+0800) geschrieben:
> > > > On Thu, 2012-03-15 at 09:59 +0800, Lin Ming wrote:
> > > > > On Thu, 2012-03-15 at 02:48 +0100, Jörg Sommer wrote:
> > > > > > Hi,
> > > > > > 
> > > > > > I'm getting these messages in a KVM virtualized host and the access to
> > > > > > the disks is very slow. Using libata.dma=0 suppresses the warnings, but
> > > > > > the disks are still slow.
> > > > > 
> > > > > Hi Jörg,
> > > > > 
> > > > > Let me try to reproduce this issue first.
> > > > 
> > > > I tried below commands on x86_32, but can't reproduce it.
> > > > 
> > > > qemu-system-i386 -kernel /root/vmlinuz-3.3.0-rc7 -append "root=/dev/sda1
> > > > zcache" -hda /root/debian-32.img -hdb /root/data.img
> > > > 
> > > > Maybe because i386 uses different ata controller than ppc(ata_piix vs
> > > > pata-macio).
> > > > 
> > > > I'll try qemu-system-ppc.
> > > > 
> > > > Did you need to run some workload to trigger these warings?
> > > > Or did you get these warnings right after booting the VM?
> > > 
> > > These warnings come up before »INIT started«. I don't have to do
> > > anything, just wait and see.
> > > 
> > > # truncate -s100M /mnt/data/new
> > > # mke2fs -Fq /mnt/data/new
> > > # mount -o loop /mnt/data/new /mnt/other
> > > # cp --parents /bin/zsh-static /mnt/other/zsh
> > > # umount /mnt/other
> > > # qemu-system-ppc -enable-kvm -M mac99 -cpu G4 -k de -kernel /boot/vmlinuz-3.3.0-rc5-04520-g8d233c0 -append 'root=/dev/sda ro console=ttyPZ0 init=/zsh' -hda /mnt/data/new
> > > 
> > > I've uploaded my config and the kernel:
> > > http://alioth.debian.org/~jo-guest/config-3.3.0-rc5-04520-g8d233c0
> > > http://alioth.debian.org/~jo-guest/vmlinuz-3.3.0-rc5-04520-g8d233c0
> > > 
> > > You have to switch to the serial console (Ctrl-Alt-3 or with -nographic
> > > Ctrl-a c). All kernel messages arrive there.
> > > 
> > > > Would you please try to disable ata port runtime pm?
> > > > You can disable it by, for example,
> > > 
> > > Is this also possible with a kernel parameter? It takes very long until I
> > > get a shell prompt.
> > 
> > No, but you can try below debug patch to disable port runtime pm.
> > 
> > diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
> > index 74aaee3..8def3fc 100644
> > --- a/drivers/ata/libata-transport.c
> > +++ b/drivers/ata/libata-transport.c
> > @@ -293,7 +293,6 @@ int ata_tport_add(struct device *parent,
> >  
> >  	device_enable_async_suspend(dev);
> >  	pm_runtime_set_active(dev);
> > -	pm_runtime_enable(dev);
> 
> This patch doesn't change anything. The kernel still hangs. If you have
> more patches or ideas, let me know.

I have reproduced this issue with qemu-system-pcc on x86.

Now I am debugging where the problem is.

Thanks,
Lin Ming

> 
> Bye, Jörg.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: DMA doesn't work since "make ata port as parent device of scsi host"
  2012-03-15 15:59         ` Jörg Sommer
  2012-03-19  8:55           ` Lin Ming
@ 2012-03-21  1:25           ` Lin Ming
  2012-03-21 19:40             ` Jörg Sommer
  1 sibling, 1 reply; 9+ messages in thread
From: Lin Ming @ 2012-03-21  1:25 UTC (permalink / raw)
  To: Jörg Sommer
  Cc: Jeff Garzik, Tejun Heo, linux-ide, linux-scsi,
	James E.J. Bottomley

On Thu, 2012-03-15 at 16:59 +0100, Jörg Sommer wrote:
> Lin Ming hat am Thu 15. Mar, 16:19 (+0800) geschrieben:
> > On Thu, 2012-03-15 at 08:48 +0100, Jörg Sommer wrote:
> > > Lin Ming hat am Thu 15. Mar, 11:26 (+0800) geschrieben:
> > > > On Thu, 2012-03-15 at 09:59 +0800, Lin Ming wrote:
> > > > > On Thu, 2012-03-15 at 02:48 +0100, Jörg Sommer wrote:
> > > > > > Hi,
> > > > > > 
> > > > > > I'm getting these messages in a KVM virtualized host and the access to
> > > > > > the disks is very slow. Using libata.dma=0 suppresses the warnings, but
> > > > > > the disks are still slow.
> > > > > 
> > > > > Hi Jörg,
> > > > > 
> > > > > Let me try to reproduce this issue first.
> > > > 
> > > > I tried below commands on x86_32, but can't reproduce it.
> > > > 
> > > > qemu-system-i386 -kernel /root/vmlinuz-3.3.0-rc7 -append "root=/dev/sda1
> > > > zcache" -hda /root/debian-32.img -hdb /root/data.img
> > > > 
> > > > Maybe because i386 uses different ata controller than ppc(ata_piix vs
> > > > pata-macio).
> > > > 
> > > > I'll try qemu-system-ppc.
> > > > 
> > > > Did you need to run some workload to trigger these warings?
> > > > Or did you get these warnings right after booting the VM?
> > > 
> > > These warnings come up before »INIT started«. I don't have to do
> > > anything, just wait and see.
> > > 
> > > # truncate -s100M /mnt/data/new
> > > # mke2fs -Fq /mnt/data/new
> > > # mount -o loop /mnt/data/new /mnt/other
> > > # cp --parents /bin/zsh-static /mnt/other/zsh
> > > # umount /mnt/other
> > > # qemu-system-ppc -enable-kvm -M mac99 -cpu G4 -k de -kernel /boot/vmlinuz-3.3.0-rc5-04520-g8d233c0 -append 'root=/dev/sda ro console=ttyPZ0 init=/zsh' -hda /mnt/data/new
> > > 
> > > I've uploaded my config and the kernel:
> > > http://alioth.debian.org/~jo-guest/config-3.3.0-rc5-04520-g8d233c0
> > > http://alioth.debian.org/~jo-guest/vmlinuz-3.3.0-rc5-04520-g8d233c0
> > > 
> > > You have to switch to the serial console (Ctrl-Alt-3 or with -nographic
> > > Ctrl-a c). All kernel messages arrive there.
> > > 
> > > > Would you please try to disable ata port runtime pm?
> > > > You can disable it by, for example,
> > > 
> > > Is this also possible with a kernel parameter? It takes very long until I
> > > get a shell prompt.
> > 
> > No, but you can try below debug patch to disable port runtime pm.
> > 
> > diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
> > index 74aaee3..8def3fc 100644
> > --- a/drivers/ata/libata-transport.c
> > +++ b/drivers/ata/libata-transport.c
> > @@ -293,7 +293,6 @@ int ata_tport_add(struct device *parent,
> >  
> >  	device_enable_async_suspend(dev);
> >  	pm_runtime_set_active(dev);
> > -	pm_runtime_enable(dev);
> 
> This patch doesn't change anything. The kernel still hangs. If you have
> more patches or ideas, let me know.

Hi, 

Below patch should fix the problem.

Could you help to test it?

From a36022015c97c9a9f80e71b4283f0ff5f481ffc3 Mon Sep 17 00:00:00 2001
From: Lin Ming <ming.m.lin@intel.com>
Date: Tue, 20 Mar 2012 14:35:10 +0800
Subject: [PATCH] [SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue

Currently, __scsi_alloc_queue uses SCSI host's parent device
as DMA device to set segment boundary. But the parent device may not
refer to the DMA device. For example, for ATA disk, SCSI host's parent
device now refers to ATA port.

Since commit d139b9b([SCSI] scsi_lib_dma: fix bug with dma maps on
nested scsi objects), a new field Scsi_Host->dma_device was introduced
to refer to the real DMA device.

Use ->dma_device in __scsi_alloc_queue to correctly set segment
boundary.

And use scsi_add_host_with_dma in ata_scsi_add_hosts to pass in the
correct DMA device.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
 drivers/ata/libata-scsi.c |    3 ++-
 drivers/scsi/scsi_lib.c   |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 7ae1e77..e47f889 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3398,7 +3398,8 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
 		 */
 		shost->max_host_blocked = 1;
 
-		rc = scsi_add_host(ap->scsi_host, &ap->tdev);
+		rc = scsi_add_host_with_dma(ap->scsi_host,
+						&ap->tdev, ap->host->dev);
 		if (rc)
 			goto err_add;
 	}
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index f85cfa6..486088b 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1642,7 +1642,7 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,
 					 request_fn_proc *request_fn)
 {
 	struct request_queue *q;
-	struct device *dev = shost->shost_gendev.parent;
+	struct device *dev = shost->dma_dev;
 
 	q = blk_init_queue(request_fn, NULL);
 	if (!q)
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: DMA doesn't work since "make ata port as parent device of scsi host"
  2012-03-21  1:25           ` Lin Ming
@ 2012-03-21 19:40             ` Jörg Sommer
  0 siblings, 0 replies; 9+ messages in thread
From: Jörg Sommer @ 2012-03-21 19:40 UTC (permalink / raw)
  To: Lin Ming
  Cc: Jeff Garzik, Tejun Heo, linux-ide, linux-scsi,
	James E.J. Bottomley

[-- Attachment #1: Type: text/plain, Size: 4623 bytes --]

Lin Ming hat am Wed 21. Mar, 09:25 (+0800) geschrieben:
> On Thu, 2012-03-15 at 16:59 +0100, Jörg Sommer wrote:
> > Lin Ming hat am Thu 15. Mar, 16:19 (+0800) geschrieben:
> > > On Thu, 2012-03-15 at 08:48 +0100, Jörg Sommer wrote:
> > > > Lin Ming hat am Thu 15. Mar, 11:26 (+0800) geschrieben:
> > > > > On Thu, 2012-03-15 at 09:59 +0800, Lin Ming wrote:
> > > > > > On Thu, 2012-03-15 at 02:48 +0100, Jörg Sommer wrote:
> > > > > > > Hi,
> > > > > > > 
> > > > > > > I'm getting these messages in a KVM virtualized host and the access to
> > > > > > > the disks is very slow. Using libata.dma=0 suppresses the warnings, but
> > > > > > > the disks are still slow.
> > > > > > 
> > > > > > Hi Jörg,
> > > > > > 
> > > > > > Let me try to reproduce this issue first.
> > > > > 
> > > > > I tried below commands on x86_32, but can't reproduce it.
> > > > > 
> > > > > qemu-system-i386 -kernel /root/vmlinuz-3.3.0-rc7 -append "root=/dev/sda1
> > > > > zcache" -hda /root/debian-32.img -hdb /root/data.img
> > > > > 
> > > > > Maybe because i386 uses different ata controller than ppc(ata_piix vs
> > > > > pata-macio).
> > > > > 
> > > > > I'll try qemu-system-ppc.
> > > > > 
> > > > > Did you need to run some workload to trigger these warings?
> > > > > Or did you get these warnings right after booting the VM?
> > > > 
> > > > These warnings come up before »INIT started«. I don't have to do
> > > > anything, just wait and see.
> > > > 
> > > > # truncate -s100M /mnt/data/new
> > > > # mke2fs -Fq /mnt/data/new
> > > > # mount -o loop /mnt/data/new /mnt/other
> > > > # cp --parents /bin/zsh-static /mnt/other/zsh
> > > > # umount /mnt/other
> > > > # qemu-system-ppc -enable-kvm -M mac99 -cpu G4 -k de -kernel /boot/vmlinuz-3.3.0-rc5-04520-g8d233c0 -append 'root=/dev/sda ro console=ttyPZ0 init=/zsh' -hda /mnt/data/new
> > > > 
> > > > I've uploaded my config and the kernel:
> > > > http://alioth.debian.org/~jo-guest/config-3.3.0-rc5-04520-g8d233c0
> > > > http://alioth.debian.org/~jo-guest/vmlinuz-3.3.0-rc5-04520-g8d233c0
> > > > 
> > > > You have to switch to the serial console (Ctrl-Alt-3 or with -nographic
> > > > Ctrl-a c). All kernel messages arrive there.
> > > > 

> Hi, 
> 
> Below patch should fix the problem.
> 
> Could you help to test it?

Yes, it does. The kernel doesn't hang at bootup. Thanks for you
investigation.

> >From a36022015c97c9a9f80e71b4283f0ff5f481ffc3 Mon Sep 17 00:00:00 2001
> From: Lin Ming <ming.m.lin@intel.com>
> Date: Tue, 20 Mar 2012 14:35:10 +0800
> Subject: [PATCH] [SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue
> 
> Currently, __scsi_alloc_queue uses SCSI host's parent device
> as DMA device to set segment boundary. But the parent device may not
> refer to the DMA device. For example, for ATA disk, SCSI host's parent
> device now refers to ATA port.
> 
> Since commit d139b9b([SCSI] scsi_lib_dma: fix bug with dma maps on
> nested scsi objects), a new field Scsi_Host->dma_device was introduced
> to refer to the real DMA device.
> 
> Use ->dma_device in __scsi_alloc_queue to correctly set segment
> boundary.
> 
> And use scsi_add_host_with_dma in ata_scsi_add_hosts to pass in the
> correct DMA device.
> 
> Signed-off-by: Lin Ming <ming.m.lin@intel.com>

Tested-by: Jörg Sommer <joerg@alea.gnuu.de>

> ---
>  drivers/ata/libata-scsi.c |    3 ++-
>  drivers/scsi/scsi_lib.c   |    2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index 7ae1e77..e47f889 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -3398,7 +3398,8 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
>  		 */
>  		shost->max_host_blocked = 1;
>  
> -		rc = scsi_add_host(ap->scsi_host, &ap->tdev);
> +		rc = scsi_add_host_with_dma(ap->scsi_host,
> +						&ap->tdev, ap->host->dev);
>  		if (rc)
>  			goto err_add;
>  	}
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index f85cfa6..486088b 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1642,7 +1642,7 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,
>  					 request_fn_proc *request_fn)
>  {
>  	struct request_queue *q;
> -	struct device *dev = shost->shost_gendev.parent;
> +	struct device *dev = shost->dma_dev;
>  
>  	q = blk_init_queue(request_fn, NULL);
>  	if (!q)
> -- 
> 1.7.2.5
> 
> 

Regards, Jörg.
-- 
Dein Gesicht wird dir geschenkt. Lächeln musst du selber! (Inga Hermann)

[-- Attachment #2: Digital signature http://en.wikipedia.org/wiki/OpenPGP --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-03-21 21:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15  1:48 DMA doesn't work since "make ata port as parent device of scsi host" Jörg Sommer
2012-03-15  1:59 ` Lin Ming
2012-03-15  3:26   ` Lin Ming
2012-03-15  7:48     ` Jörg Sommer
2012-03-15  8:19       ` Lin Ming
2012-03-15 15:59         ` Jörg Sommer
2012-03-19  8:55           ` Lin Ming
2012-03-21  1:25           ` Lin Ming
2012-03-21 19:40             ` Jörg Sommer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.