* ahci: host/target numbers change with detection order
@ 2014-05-19 20:46 Alan Evans
2014-05-21 15:16 ` Phillip Susi
0 siblings, 1 reply; 3+ messages in thread
From: Alan Evans @ 2014-05-19 20:46 UTC (permalink / raw)
To: linux-ide
I have a host that is used to process the data on removable drives.
It is essential to be able to indicate to an operator which drives are
done and can be removed.
When we were using a HighPoint card that uses sata_mv.ko we could
count on the results of 'udevadm info -q path -n <dev>' representing a
single physical port on the card.
I have been testing a new card based on a Marvell 88SE9230 (ahci.ko)
and I find that the scsi host number and corresponding target are
changing depending on the order drives are attached to the system, not
based on the port number.
Further for some reason in /sys/class/scsi_host I am seeing 8 hosts
created per card where I would expect 4.
Does anyone have any thoughts on why the behaviour differs between
ahci.ko and sata_mv.ko? Is it the chip? The module?
$ uname -a
Linux host01 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.54-2~bpo60+1 x86_64 GNU/Linux
I know its an old kernel, but at the moment I cannot do much about it.
$ sudo lspci -v -s 06:00.0
06:00.0 SATA controller: Marvell Technology Group Ltd. Device 9230
(rev 10) (prog-if 01 [AHCI 1.0])
Subsystem: Marvell Technology Group Ltd. Device 9230
Flags: bus master, fast devsel, latency 0, IRQ 51
I/O ports at ec00 [size=8]
I/O ports at e880 [size=4]
I/O ports at e800 [size=8]
I/O ports at e480 [size=4]
I/O ports at e400 [size=32]
Memory at faffe000 (32-bit, non-prefetchable) [size=2K]
Expansion ROM at fafe0000 [disabled] [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit-
Capabilities: [70] Express Legacy Endpoint, MSI 00
Capabilities: [e0] SATA HBA v0.0
Capabilities: [100] Advanced Error Reporting
Kernel driver in use: ahci
$ ls -ld /sys/devices/pci0000:00/0000:00:09.0/0000:06:00.0/host*
drwxr-xr-x 4 root root 0 May 19 14:16
/sys/devices/pci0000:00/0000:00:09.0/0000:06:00.0/host10
drwxr-xr-x 4 root root 0 May 19 14:16
/sys/devices/pci0000:00/0000:00:09.0/0000:06:00.0/host11
drwxr-xr-x 4 root root 0 May 19 14:16
/sys/devices/pci0000:00/0000:00:09.0/0000:06:00.0/host12
drwxr-xr-x 5 root root 0 May 19 14:16
/sys/devices/pci0000:00/0000:00:09.0/0000:06:00.0/host13
drwxr-xr-x 5 root root 0 May 19 14:16
/sys/devices/pci0000:00/0000:00:09.0/0000:06:00.0/host6
drwxr-xr-x 5 root root 0 May 19 14:16
/sys/devices/pci0000:00/0000:00:09.0/0000:06:00.0/host7
drwxr-xr-x 5 root root 0 May 19 14:16
/sys/devices/pci0000:00/0000:00:09.0/0000:06:00.0/host8
drwxr-xr-x 5 root root 0 May 19 14:16
/sys/devices/pci0000:00/0000:00:09.0/0000:06:00.0/host9
--- and the HighPoint Card ---
$ sudo lspci -v -s 04:00.0
04:00.0 SCSI storage controller: HighPoint Technologies, Inc.
RocketRAID 2310 4 Port SATA-II Controller (rev 02)
Subsystem: Marvell Technology Group Ltd. Device 11ab
Flags: bus master, fast devsel, latency 0, IRQ 30
Memory at fad00000 (64-bit, non-prefetchable) [size=1M]
I/O ports at d800 [size=256]
[virtual] Expansion ROM at fac80000 [disabled] [size=512K]
Capabilities: [40] Power Management version 2
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [60] Express Legacy Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Kernel driver in use: sata_mv
$ ls -ld /sys/devices/pci0000:00/0000:00:07.0/0000:04:00.0/host*
drwxr-xr-x 5 root root 0 May 19 14:40
/sys/devices/pci0000:00/0000:00:07.0/0000:04:00.0/host0
drwxr-xr-x 4 root root 0 May 19 14:42
/sys/devices/pci0000:00/0000:00:07.0/0000:04:00.0/host1
drwxr-xr-x 4 root root 0 May 19 14:42
/sys/devices/pci0000:00/0000:00:07.0/0000:04:00.0/host2
drwxr-xr-x 5 root root 0 May 19 14:42
/sys/devices/pci0000:00/0000:00:07.0/0000:04:00.0/host3
If this is a behaviour from the ahci module could someone point me in
the direction of how to alter it? A patch to make it behave like
sata_mv? Or is there another way to get the port number? Some low
level scsi or ahci command I can call?
Thanks in advance,
-Alan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ahci: host/target numbers change with detection order
2014-05-19 20:46 ahci: host/target numbers change with detection order Alan Evans
@ 2014-05-21 15:16 ` Phillip Susi
2014-05-22 19:14 ` Alan Evans
0 siblings, 1 reply; 3+ messages in thread
From: Phillip Susi @ 2014-05-21 15:16 UTC (permalink / raw)
To: AlanWEvans, linux-ide
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 5/19/2014 4:46 PM, Alan Evans wrote:
> I have a host that is used to process the data on removable
> drives. It is essential to be able to indicate to an operator which
> drives are done and can be removed.
>
> When we were using a HighPoint card that uses sata_mv.ko we could
> count on the results of 'udevadm info -q path -n <dev>'
> representing a single physical port on the card.
>
> I have been testing a new card based on a Marvell 88SE9230
> (ahci.ko) and I find that the scsi host number and corresponding
> target are changing depending on the order drives are attached to
> the system, not based on the port number.
These numbers are assigned on a first come first serve basis, so if
another device initializes first, then it jumps in front. If you want
to know the port number, look in the port_no file of the ata_port.
> Further for some reason in /sys/class/scsi_host I am seeing 8
> hosts created per card where I would expect 4.
Apparently the controller supports 8 ports.
> Does anyone have any thoughts on why the behaviour differs between
> ahci.ko and sata_mv.ko? Is it the chip? The module?
It looks like sata_mv does not support parallel scanning of all ports,
but ahci does. In other words, sata_mv scanned one port at a time, in
order, so they always registered in order, but ahci scans them all at
the same time, so the order they finish in varies.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJTfMNaAAoJEI5FoCIzSKrwG0UH/Rrkh25BSA+3vqj6aQUDW0Ox
Fyeklgj+inohLzed5ZmGur2vfr8GA5Xrs1vO6Sk6hvDVadRhcyt45qkxAlVT09YS
vwXAQQQoIXzbiqetX7TJYJwo5TzCc3mIjUJjHrpfPrbUc43gs89yuqKpGubXurQp
N+QUPI4X1U6HRORsbFO9WfzZT3hvj99Nv0KmoDQUaSkhOS7lOqEPep1v42HflJLF
DlHmJmsuQmAy7fn4i2MpllnJx99EdpeFgPi2GdsPWi8gOBviuPMz0AWclUwY4K/q
SD0mHDrj+w/kE9wqJNUs2etkCNYMZwyfin1jxLyVaioiK8OFXkcoYyObGI79TzI=
=758u
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ahci: host/target numbers change with detection order
2014-05-21 15:16 ` Phillip Susi
@ 2014-05-22 19:14 ` Alan Evans
0 siblings, 0 replies; 3+ messages in thread
From: Alan Evans @ 2014-05-22 19:14 UTC (permalink / raw)
To: Phillip Susi; +Cc: linux-ide
Phillip,
Thank you very much for your help.
>From the look of it port_no was added to ata_port in kernel 3.11. It
looks like I am out of luck without upgrading or back porting it
myself. I guess I'll have to weight my options.
Thanks again,
-Alan
On Wed, May 21, 2014 at 9:16 AM, Phillip Susi <psusi@ubuntu.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 5/19/2014 4:46 PM, Alan Evans wrote:
>> I have a host that is used to process the data on removable
>> drives. It is essential to be able to indicate to an operator which
>> drives are done and can be removed.
>>
>> When we were using a HighPoint card that uses sata_mv.ko we could
>> count on the results of 'udevadm info -q path -n <dev>'
>> representing a single physical port on the card.
>>
>> I have been testing a new card based on a Marvell 88SE9230
>> (ahci.ko) and I find that the scsi host number and corresponding
>> target are changing depending on the order drives are attached to
>> the system, not based on the port number.
>
> These numbers are assigned on a first come first serve basis, so if
> another device initializes first, then it jumps in front. If you want
> to know the port number, look in the port_no file of the ata_port.
>
>> Further for some reason in /sys/class/scsi_host I am seeing 8
>> hosts created per card where I would expect 4.
>
> Apparently the controller supports 8 ports.
>
>> Does anyone have any thoughts on why the behaviour differs between
>> ahci.ko and sata_mv.ko? Is it the chip? The module?
>
> It looks like sata_mv does not support parallel scanning of all ports,
> but ahci does. In other words, sata_mv scanned one port at a time, in
> order, so they always registered in order, but ahci scans them all at
> the same time, so the order they finish in varies.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.17 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQEcBAEBAgAGBQJTfMNaAAoJEI5FoCIzSKrwG0UH/Rrkh25BSA+3vqj6aQUDW0Ox
> Fyeklgj+inohLzed5ZmGur2vfr8GA5Xrs1vO6Sk6hvDVadRhcyt45qkxAlVT09YS
> vwXAQQQoIXzbiqetX7TJYJwo5TzCc3mIjUJjHrpfPrbUc43gs89yuqKpGubXurQp
> N+QUPI4X1U6HRORsbFO9WfzZT3hvj99Nv0KmoDQUaSkhOS7lOqEPep1v42HflJLF
> DlHmJmsuQmAy7fn4i2MpllnJx99EdpeFgPi2GdsPWi8gOBviuPMz0AWclUwY4K/q
> SD0mHDrj+w/kE9wqJNUs2etkCNYMZwyfin1jxLyVaioiK8OFXkcoYyObGI79TzI=
> =758u
> -----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-22 19:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-19 20:46 ahci: host/target numbers change with detection order Alan Evans
2014-05-21 15:16 ` Phillip Susi
2014-05-22 19:14 ` Alan Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox