Skip to contentSkip to conversation

PMP and SEMB messages to SEP

DISCUSSION Herbert Poetzl 4 participants 23 messages Jan 13, 2011 – Apr 3, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I'm currently trying to wrap my head around SEMB and sending messages to an attached SEP on some Port Multiplier connected via eSATA ...

I found that the AHCI driver supports certain well defined messages (for the activity leds) but I'm not sure what they actually are, and I have no idea how to utilize them from userspace at the moment

Basically what I want to do is the following:

- attach a Smart Enclosure via I2C to the PMP (the SEP is basically under my control)
- retrieve certain values like temperature readings from that Smart Enclosure via the SEMB
- send specific 'command' messages to the SEP to control user visible lights on the enclosure

My current Test Setup includes a simple Sil 3726 based PMP (Dawicontrol DC-6510 PM) which has a connector for a SEP using I2C (via the SEMB), connected to an eSATA Port which is PMP capable and handles the connected drives quite well.

I had a quick read on the (S)ATA specification regarding PMP and sending/retrieving messages from the SEMB, but at the moment, I have no clue how to 'map' that to existing? code in the Linux kernel or how that should/could be exposed to userspace ...

Any hints/pointers/information would be greatly appreciated.

Many thanks in advance,
Herbert

#1 lore raw

Hello,

Quoted 7 lines · Herbert Poetzl

I had a quick read on the (S)ATA specification regarding PMP and sending/retrieving messages from the SEMB, but at the moment, I have no clue how to 'map' that to existing? code in the Linux kernel or how that should/could be exposed to userspace ...

Any hints/pointers/information would be greatly appreciated.

Unfortunately, it hasn't been implemented yet. I didn't have access to any SEMB aware device and no one else worked on it, so...

Signature · 1 line
tejun
#2 lore raw
Quoted 9 lines · Tejun Heo

Hello,

Quoted 5 lines · Herbert Poetzl

I had a quick read on the (S)ATA specification regarding PMP and sending/retrieving messages from the SEMB, but at the moment, I have no clue how to 'map' that to existing? code in the Linux kernel or how that should/could be exposed to userspace ...

Quoted 3 lines
Quoted 1 line

Any hints/pointers/information would be greatly appreciated.

Unfortunately, it hasn't been implemented yet.

Okay, so any ideas/suggestions how to implement it?

Quoted 2 lines

I didn't have access to any SEMB aware device and no one else worked on it, so...

No problem there, AFAIK, any SiI3726 based PMP should have everything required for a SEMB, but most PMP products do not add the required header to actually connect it to a SEP (at lest the SiI3726 specification says so :)

I have no problem digging into it and doing the testing, but of course, all input on how to address this is quite welcome

Thanks in advance,
Herbert

Quoted 2 lines
Signature · 1 line
tejun
#3 lore raw

Hello,

Quoted 3 lines · Herbert Poetzl
Quoted 1 line

Unfortunately, it hasn't been implemented yet.

Okay, so any ideas/suggestions how to implement it?

I'll be happy to answer questions / review patches but I don't really have much idea how it should be implemented at this point. I guess libata would just serve as transport layer for the enclosure management high level driver (there were two variants, IIRC). There also was something added to ahci which is exported through sysfs.

Good luck!

Signature · 1 line
tejun
#4 lore raw
Quoted 5 lines · Tejun Heo

Hello,

Quoted 1 line · Herbert Poetzl
Quoted 1 line

Unfortunately, it hasn't been implemented yet.

Quoted 7 lines
Quoted 1 line

Okay, so any ideas/suggestions how to implement it?

I'll be happy to answer questions / review patches but I don't really have much idea how it should be implemented at this point. I guess libata would just serve as transport layer for the enclosure management high level driver (there were two variants, IIRC).

Fair enough, let's start with a bunch of simple questions I got from looking at the code (which I did just recently, so don't expect deep understanding of the inner workings, or even intelligent questions FWIW :)

- libata is used in the kernel for ata, sata and to some extend for scsi (via (s)ata), as a helper library. is there any counterpart in userspace to communicate with (s)ata host/devices or how are the interfaces to userspace designed to work?

- the SiI3726 supports SAF-TE and SES protocols for the SEMB/SEP and the EMCs are sent through the SATA interface (according to the docu, SEP_ATTN in the command register and SEP command code in the features register)

+ how would I send such a command and retrieve the result (if there is one) from within the kernel (maybe with libata or from the ahci layer)?

- the SiI3726 supports GPIO pins, which can be reached via the General Status and Control Register [130] and accoring to the docu, the Read/Write Port Multiplier command can be used to read/write that register.

+ how would I go about issuing such a command and where should it be done? i.e. what about interference with other commands? what about retrieving return values?

Quoted 2 lines

There also was something added to ahci which is exported through sysfs.

I saw that the ahci driver uses *em_message* which I think might be related to sending activity messages and it also lists capabilities (which include 'ems') on host adapters, but I'm not entirely sure this is SEMB related (yet)

thanks for your help,
Herbert

Quoted 4 lines

Good luck!

Signature · 1 line
tejun
#5 lore raw

(cc'ing linux-scsi)
Hello,

Quoted 7 lines · Herbert Poetzl

Fair enough, let's start with a bunch of simple questions I got from looking at the code (which I did just recently, so don't expect deep understanding of the inner workings, or even intelligent questions FWIW :)

- libata is used in the kernel for ata, sata and to some extend for scsi (via (s)ata), as a helper library.

The (s) there is Serial not SCSI, but yes some SAS drivers use libata to drive SATA devices attached to SAS controllers.

Quoted 3 lines

is there any counterpart in userspace to communicate with (s)ata host/devices or how are the interfaces to userspace designed to work?

SG_IO is the standard way to issue custom commands. You need to wrap ATA command inside a SCSI SCSI-ATA passthrough command. Take a look at hdparm, smartctl or any other tool which issues direct commands.

Quoted 8 lines

- the SiI3726 supports SAF-TE and SES protocols for the SEMB/SEP and the EMCs are sent through the SATA interface (according to the docu, SEP_ATTN in the command register and SEP command code in the features register)

+ how would I send such a command and retrieve the result (if there is one) from within the kernel (maybe with libata or from the ahci layer)?

If it's a proper command SAT passthrough via SG_IO should work but I'm not sure whether it is. Is it?

Quoted 8 lines

- the SiI3726 supports GPIO pins, which can be reached via the General Status and Control Register [130] and accoring to the docu, the Read/Write Port Multiplier command can be used to read/write that register.

+ how would I go about issuing such a command and where should it be done? i.e. what about interference with other commands? what about retrieving return values?

The problem is that the PMP device itself is currently not allocated a userland visible device, so it doesn't have any /dev/* node. Hmmm...

Quoted 8 lines
Quoted 2 lines

There also was something added to ahci which is exported through sysfs.

I saw that the ahci driver uses *em_message* which I think might be related to sending activity messages and it also lists capabilities (which include 'ems') on host adapters, but I'm not entirely sure this is SEMB related (yet)

The message sent there can be of any format and that's why it was added as a separate sysfs node.

ISTR there's a SCSI enclosure management driver. Maybe SCSI people have better clues about how enclosure management should be done?

Thanks.

Signature · 1 line
tejun
#6 lore raw
Quoted 28 lines · Tejun Heo

(cc'ing linux-scsi)
Hello,

Quoted 7 lines · Herbert Poetzl

Fair enough, let's start with a bunch of simple questions I got from looking at the code (which I did just recently, so don't expect deep understanding of the inner workings, or even intelligent questions FWIW :)

- libata is used in the kernel for ata, sata and to some extend for scsi (via (s)ata), as a helper library.

The (s) there is Serial not SCSI, but yes some SAS drivers use libata to drive SATA devices attached to SAS controllers.

Quoted 3 lines

is there any counterpart in userspace to communicate with (s)ata host/devices or how are the interfaces to userspace designed to work?

SG_IO is the standard way to issue custom commands. You need to wrap ATA command inside a SCSI SCSI-ATA passthrough command. Take a look at hdparm, smartctl or any other tool which issues direct commands.

Quoted 5 lines

- the SiI3726 supports SAF-TE and SES protocols for the SEMB/SEP and the EMCs are sent through the SATA interface (according to the docu, SEP_ATTN in the command register and SEP command code in the features register)

Quoted 6 lines
Quoted 3 lines

+ how would I send such a command and retrieve the result (if there is one) from within the kernel (maybe with libata or from the ahci layer)?

If it's a proper command SAT passthrough via SG_IO should work but I'm not sure whether it is. Is it?

it sounds like it can be sent via ATA_12 or ATA_16 then depending on what it does to the device state model.

Quoted 11 lines
Quoted 8 lines

- the SiI3726 supports GPIO pins, which can be reached via the General Status and Control Register [130] and accoring to the docu, the Read/Write Port Multiplier command can be used to read/write that register.

+ how would I go about issuing such a command and where should it be done? i.e. what about interference with other commands? what about retrieving return values?

The problem is that the PMP device itself is currently not allocated a userland visible device, so it doesn't have any /dev/* node. Hmmm...

So perhaps it should be. If you look at the equivalent topology on SAS, our expanders have a bsg device node precisely so that we can do this.

That said, SAS expanders have a defined protocol (SAS Management Protocol) to talk to the outside world, so they are real visible objects always in our topology ... I'm not sure PMP has this ... it seems that all PMP visibility is an extension to the standard?

Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

There also was something added to ahci which is exported through sysfs.

I saw that the ahci driver uses *em_message* which I think might be related to sending activity messages and it also lists capabilities (which include 'ems') on host adapters, but I'm not entirely sure this is SEMB related (yet)

Quoted 5 lines

The message sent there can be of any format and that's why it was added as a separate sysfs node.

ISTR there's a SCSI enclosure management driver. Maybe SCSI people have better clues about how enclosure management should be done?

Sure, as long as it speaks standard ses-2, there shouldn't be a protocol problem. The main problem is recognition: ses has to bind to an enclosure device. It can bind either to an explicit device (about all the enclosures I've seen so far) where the ses device has a separate address in the SCSI topology or an implicit device (where another SCSI device indicates it has an enclosure port embedded in it). As currently coded, our ses driver only does the former probably the best way is to expose the ses device via libata and we'll simply bind to it.

James

However,

#7 lore raw
Quoted 48 lines · James Bottomley
Quoted 28 lines · Tejun Heo

(cc'ing linux-scsi)
Hello,

Quoted 7 lines · Herbert Poetzl

Fair enough, let's start with a bunch of simple questions I got from looking at the code (which I did just recently, so don't expect deep understanding of the inner workings, or even intelligent questions FWIW :)

- libata is used in the kernel for ata, sata and to some extend for scsi (via (s)ata), as a helper library.

The (s) there is Serial not SCSI, but yes some SAS drivers use libata to drive SATA devices attached to SAS controllers.

Quoted 3 lines

is there any counterpart in userspace to communicate with (s)ata host/devices or how are the interfaces to userspace designed to work?

SG_IO is the standard way to issue custom commands. You need to wrap ATA command inside a SCSI SCSI-ATA passthrough command. Take a look at hdparm, smartctl or any other tool which issues direct commands.

Quoted 5 lines

- the SiI3726 supports SAF-TE and SES protocols for the SEMB/SEP and the EMCs are sent through the SATA interface (according to the docu, SEP_ATTN in the command register and SEP command code in the features register)

Quoted 6 lines
Quoted 3 lines

+ how would I send such a command and retrieve the result (if there is one) from within the kernel (maybe with libata or from the ahci layer)?

If it's a proper command SAT passthrough via SG_IO should work but I'm not sure whether it is. Is it?

it sounds like it can be sent via ATA_12 or ATA_16 then depending on what it does to the device state model.

Quoted 9 lines
Quoted 8 lines

- the SiI3726 supports GPIO pins, which can be reached via the General Status and Control Register [130] and accoring to the docu, the Read/Write Port Multiplier command can be used to read/write that register.

+ how would I go about issuing such a command and where should it be done? i.e. what about interference with other commands? what about retrieving return values?

Quoted 7 lines
Quoted 3 lines

The problem is that the PMP device itself is currently not allocated a userland visible device, so it doesn't have any /dev/* node. Hmmm...

So perhaps it should be. If you look at the equivalent topology on SAS, our expanders have a bsg device node precisely so that we can do this.

I agree, the PMP should get a device or at least some kind of interface to address them, especially as the SATA topology can get quite complicated too, for example it seems that PMPs can be daisy chained in an infinite sequence like this

/ / /
--[PM]---[PM]---[PM]-- - -

       \      \      \
Quoted 4 lines

That said, SAS expanders have a defined protocol (SAS Management Protocol) to talk to the outside world, so they are real visible objects always in our topology ... I'm not sure PMP has this ... it seems that all PMP visibility is an extension to the standard?

At least to me it seems, PMPs do have a defined protocol as well, otherwise the PM 1.0/1.1 protocol specificiation would not make much sense, IMHO ...

Quoted 15 lines
Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

There also was something added to ahci which is exported through sysfs.

I saw that the ahci driver uses *em_message* which I think might be related to sending activity messages and it also lists capabilities (which include 'ems') on host adapters, but I'm not entirely sure this is SEMB related (yet)

Quoted 5 lines

The message sent there can be of any format and that's why it was added as a separate sysfs node.

ISTR there's a SCSI enclosure management driver. Maybe SCSI people have better clues about how enclosure management should be done?

Quoted 9 lines

Sure, as long as it speaks standard ses-2, there shouldn't be a protocol problem. The main problem is recognition: ses has to bind to an enclosure device. It can bind either to an explicit device (about all the enclosures I've seen so far) where the ses device has a separate address in the SCSI topology or an implicit device (where another SCSI device indicates it has an enclosure port embedded in it). As currently coded, our ses driver only does the former probably the best way is to expose the ses device via libata and we'll simply bind to it.

so AHCI em_messages use standard ses-2 or did I misinterpret this (for me cryptical) information?

in any case, thanks,
Herbert

Quoted 3 lines

James

However,

#8 lore raw
Quoted 4 lines · Herbert Poetzl
Quoted 3 lines

So perhaps it should be. If you look at the equivalent topology on SAS, our expanders have a bsg device node precisely so that we can do this.

Quoted 8 lines

I agree, the PMP should get a device or at least some kind of interface to address them, especially as the SATA topology can get quite complicated too, for example it seems that PMPs can be daisy chained in an infinite sequence like this

/ / /
--[PM]---[PM]---[PM]-- - -

       \      \      \

Oh, no, that's not allowed. You can't address destinations that way. PMP is primarily a switch, not a router.

Quoted 10 lines
Quoted 9 lines

Sure, as long as it speaks standard ses-2, there shouldn't be a protocol problem. The main problem is recognition: ses has to bind to an enclosure device. It can bind either to an explicit device (about all the enclosures I've seen so far) where the ses device has a separate address in the SCSI topology or an implicit device (where another SCSI device indicates it has an enclosure port embedded in it). As currently coded, our ses driver only does the former probably the best way is to expose the ses device via libata and we'll simply bind to it.

Quoted 2 lines

so AHCI em_messages use standard ses-2 or did I misinterpret this (for me cryptical) information?

AFAIK, it just doesn't care. It could be ses-2 or whatever else. It just transmits the binary blob it receives via sysfs and vice-versa.

Thanks.

Signature · 1 line
tejun
#9 lore raw
Quoted 10 lines · Tejun Heo
Quoted 9 lines · Herbert Poetzl
Quoted 3 lines

So perhaps it should be. If you look at the equivalent topology on SAS, our expanders have a bsg device node precisely so that we can do this.

I agree, the PMP should get a device or at least some kind of interface to address them, especially as the SATA topology can get quite complicated too, for example it seems that PMPs can be daisy chained in an infinite sequence like this

Quoted 6 lines
Quoted 3 lines

/ / /
--[PM]---[PM]---[PM]-- - -

       \      \      \

Oh, no, that's not allowed. You can't address destinations that way. PMP is primarily a switch, not a router.

hmm, haven't had the time to dig through the specs yet, but at least addonics seems to disagree here:

http://www.addonics.com/products/host_controller/tutorial_pm.asp

but maybe that's just a marketing page with no relation to reality ....

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

Sure, as long as it speaks standard ses-2, there shouldn't be a protocol problem. The main problem is recognition: ses has to bind to an enclosure device. It can bind either to an explicit device (about all the enclosures I've seen so far) where the ses device has a separate address in the SCSI topology or an implicit device (where another SCSI device indicates it has an enclosure port embedded in it). As currently coded, our ses driver only does the former probably the best way is to expose the ses device via libata and we'll simply bind to it.

Quoted 5 lines
Quoted 2 lines

so AHCI em_messages use standard ses-2 or did I misinterpret this (for me cryptical) information?

AFAIK, it just doesn't care. It could be ses-2 or whatever else. It just transmits the binary blob it receives via sysfs and vice-versa.

the interesting part here is, that the AHCI host controller my PMP is connected to recognizes the PMP perfectly fine (i.e. more than one drive works just as expected), but doesn't seem to allow for the em_message part (despite the fact that the attached PMP seems to be SEMB/SEP capable) ...

maybe this is just a bug in the kernel code, maybe the AHCI implementation doesn't allow a PMP to receive enclosure management messages at all ...

best,
Herbert

Quoted 4 lines

Thanks.

Signature · 1 line
tejun
#10 lore raw
Quoted 7 lines · Herbert Poetzl

hmm, haven't had the time to dig through the specs yet, but at least addonics seems to disagree here:

http://www.addonics.com/products/host_controller/tutorial_pm.asp

but maybe that's just a marketing page with no relation to reality ....

That's hardware RAID PMP. It would just show up as a single drive to the host. They can do whatever they want to if they do that.

Quoted 9 lines
Quoted 2 lines

AFAIK, it just doesn't care. It could be ses-2 or whatever else. It just transmits the binary blob it receives via sysfs and vice-versa.

the interesting part here is, that the AHCI host controller my PMP is connected to recognizes the PMP perfectly fine (i.e. more than one drive works just as expected), but doesn't seem to allow for the em_message part (despite the fact that the attached PMP seems to be SEMB/SEP capable) ...

Quoted 3 lines

maybe this is just a bug in the kernel code, maybe the AHCI implementation doesn't allow a PMP to receive enclosure management messages at all ...

AFAIK, the ahci em message thing is not via PMP. It's for cases where the ahci controller is directly connected to an enclosure. Well, that's my understanding anyway.

Signature · 1 line
tejun
#11 lore raw
Quoted 11 lines · Tejun Heo
Quoted 7 lines · Herbert Poetzl

hmm, haven't had the time to dig through the specs yet, but at least addonics seems to disagree here:

http://www.addonics.com/products/host_controller/tutorial_pm.asp

but maybe that's just a marketing page with no relation to reality ....

That's hardware RAID PMP. It would just show up as a single drive to the host. They can do whatever they want to if they do that.

okay, understood.

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

AFAIK, it just doesn't care. It could be ses-2 or whatever else. It just transmits the binary blob it receives via sysfs and vice-versa.

the interesting part here is, that the AHCI host controller my PMP is connected to recognizes the PMP perfectly fine (i.e. more than one drive works just as expected), but doesn't seem to allow for the em_message part (despite the fact that the attached PMP seems to be SEMB/SEP capable) ...

Quoted 7 lines
Quoted 3 lines

maybe this is just a bug in the kernel code, maybe the AHCI implementation doesn't allow a PMP to receive enclosure management messages at all ...

AFAIK, the ahci em message thing is not via PMP. It's for cases where the ahci controller is directly connected to an enclosure. Well, that's my understanding anyway.

okay, so something similar would be useful for controlling enclosures attached to PMPs then?

what would be the 'proper' place in the sysfs tree, espceically as the PMP doesn't show up there (yet)?

how would I go about adding something like that to the kernel and where should it be placed (sysfs and code wise)?

thanks in advance,
Herbert

Quoted 2 lines
Signature · 1 line
tejun
#12 lore raw
Quoted 32 lines · Herbert Poetzl
Quoted 11 lines · Tejun Heo
Quoted 7 lines · Herbert Poetzl

hmm, haven't had the time to dig through the specs yet, but at least addonics seems to disagree here:

http://www.addonics.com/products/host_controller/tutorial_pm.asp

but maybe that's just a marketing page with no relation to reality ....

That's hardware RAID PMP. It would just show up as a single drive to the host. They can do whatever they want to if they do that.

okay, understood.

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

AFAIK, it just doesn't care. It could be ses-2 or whatever else. It just transmits the binary blob it receives via sysfs and vice-versa.

the interesting part here is, that the AHCI host controller my PMP is connected to recognizes the PMP perfectly fine (i.e. more than one drive works just as expected), but doesn't seem to allow for the em_message part (despite the fact that the attached PMP seems to be SEMB/SEP capable) ...

Quoted 7 lines
Quoted 3 lines

maybe this is just a bug in the kernel code, maybe the AHCI implementation doesn't allow a PMP to receive enclosure management messages at all ...

AFAIK, the ahci em message thing is not via PMP. It's for cases where the ahci controller is directly connected to an enclosure. Well, that's my understanding anyway.

Quoted 8 lines

okay, so something similar would be useful for controlling enclosures attached to PMPs then?

what would be the 'proper' place in the sysfs tree, espceically as the PMP doesn't show up there (yet)?

how would I go about adding something like that to the kernel and where should it be placed (sysfs and code wise)?

OK, just so we're not at cross purposes:

1. For an enclosure processor to show up and be attached to the enclosure driver, it has to present as a SCSI target. This often means handling nasty encapsulations somewhere (SES is most often used on non-standard busses like i2c or GPIO). If it's within a PMP and has a defined encapsulation which ATA recognises, it sounds like libata is the best place for this.
2. The above has nothing to do with whether the PMP device shows up in sysfs or has a bsg command port. That's a completely separate discussion based on whether it makes sense (and whether we can cope with the topological complexity). Just by way of example, it's mostly not possible to use expanders with enclosure devices via our expander bsg device, because there's no SMP encapsulation of SES. What mostly happens is that the expander has two or more target ports, one of which is SMP and the other (completely separate one) is an addressable SES target.

James

#13 lore raw
Quoted 42 lines · James Bottomley
Quoted 32 lines · Herbert Poetzl
Quoted 11 lines · Tejun Heo
Quoted 7 lines · Herbert Poetzl

hmm, haven't had the time to dig through the specs yet, but at least addonics seems to disagree here:

http://www.addonics.com/products/host_controller/tutorial_pm.asp

but maybe that's just a marketing page with no relation to reality ....

That's hardware RAID PMP. It would just show up as a single drive to the host. They can do whatever they want to if they do that.

okay, understood.

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

AFAIK, it just doesn't care. It could be ses-2 or whatever else. It just transmits the binary blob it receives via sysfs and vice-versa.

the interesting part here is, that the AHCI host controller my PMP is connected to recognizes the PMP perfectly fine (i.e. more than one drive works just as expected), but doesn't seem to allow for the em_message part (despite the fact that the attached PMP seems to be SEMB/SEP capable) ...

Quoted 7 lines
Quoted 3 lines

maybe this is just a bug in the kernel code, maybe the AHCI implementation doesn't allow a PMP to receive enclosure management messages at all ...

AFAIK, the ahci em message thing is not via PMP. It's for cases where the ahci controller is directly connected to an enclosure. Well, that's my understanding anyway.

Quoted 8 lines

okay, so something similar would be useful for controlling enclosures attached to PMPs then?

what would be the 'proper' place in the sysfs tree, espceically as the PMP doesn't show up there (yet)?

how would I go about adding something like that to the kernel and where should it be placed (sysfs and code wise)?

Quoted 8 lines

OK, just so we're not at cross purposes:

1. For an enclosure processor to show up and be attached to the enclosure driver, it has to present as a SCSI target. This often means handling nasty encapsulations somewhere (SES is most often used on non-standard busses like i2c or GPIO). If it's within a PMP and has a defined encapsulation which ATA recognises, it sounds like libata is the best place for this.

it seems that the SATA specification, specifically the PMP part 'defines' something called SEMB (Smart Enclosure Management Bridge) which is controlled via specific SATA PMP commands to send 'messages' over (typically) I2C to an SEP (Smart Enclosure Processor) which can act upon them and even generate data/replies to retrieve information like the temperature, fan status, etc

Quoted 10 lines

2. The above has nothing to do with whether the PMP device shows up in sysfs or has a bsg command port. That's a completely separate discussion based on whether it makes sense (and whether we can cope with the topological complexity). Just by way of example, it's mostly not possible to use expanders with enclosure devices via our expander bsg device, because there's no SMP encapsulation of SES. What mostly happens is that the expander has two or more target ports, one of which is SMP and the other (completely separate one) is an addressable SES target.

as far as I understood, the SEMB is a separate and well defined entity controllable via special PMP commands ...

not every PMP has to have one, but if they do, it should conform to the specification, even on the I2C layer

HTC,
Herbert

Quoted 2 lines

James

#14 lore raw
Quoted 52 lines · Herbert Poetzl
Quoted 42 lines · James Bottomley
Quoted 32 lines · Herbert Poetzl
Quoted 11 lines · Tejun Heo
Quoted 7 lines · Herbert Poetzl

hmm, haven't had the time to dig through the specs yet, but at least addonics seems to disagree here:

http://www.addonics.com/products/host_controller/tutorial_pm.asp

but maybe that's just a marketing page with no relation to reality ....

That's hardware RAID PMP. It would just show up as a single drive to the host. They can do whatever they want to if they do that.

okay, understood.

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

AFAIK, it just doesn't care. It could be ses-2 or whatever else. It just transmits the binary blob it receives via sysfs and vice-versa.

the interesting part here is, that the AHCI host controller my PMP is connected to recognizes the PMP perfectly fine (i.e. more than one drive works just as expected), but doesn't seem to allow for the em_message part (despite the fact that the attached PMP seems to be SEMB/SEP capable) ...

Quoted 7 lines
Quoted 3 lines

maybe this is just a bug in the kernel code, maybe the AHCI implementation doesn't allow a PMP to receive enclosure management messages at all ...

AFAIK, the ahci em message thing is not via PMP. It's for cases where the ahci controller is directly connected to an enclosure. Well, that's my understanding anyway.

Quoted 8 lines

okay, so something similar would be useful for controlling enclosures attached to PMPs then?

what would be the 'proper' place in the sysfs tree, espceically as the PMP doesn't show up there (yet)?

how would I go about adding something like that to the kernel and where should it be placed (sysfs and code wise)?

Quoted 8 lines

OK, just so we're not at cross purposes:

1. For an enclosure processor to show up and be attached to the enclosure driver, it has to present as a SCSI target. This often means handling nasty encapsulations somewhere (SES is most often used on non-standard busses like i2c or GPIO). If it's within a PMP and has a defined encapsulation which ATA recognises, it sounds like libata is the best place for this.

Quoted 6 lines

it seems that the SATA specification, specifically the PMP part 'defines' something called SEMB (Smart Enclosure Management Bridge) which is controlled via specific SATA PMP commands to send 'messages' over (typically) I2C to an SEP (Smart Enclosure Processor) which can act upon them and even generate data/replies to retrieve information like the temperature, fan status, etc

actually SEMS stands for Seria ATA Enclosure Management Bridge, and SEP for Storage Enclosure Processor .. just looked up the terms in the specification ...

Quoted 11 lines
Quoted 10 lines

2. The above has nothing to do with whether the PMP device shows up in sysfs or has a bsg command port. That's a completely separate discussion based on whether it makes sense (and whether we can cope with the topological complexity). Just by way of example, it's mostly not possible to use expanders with enclosure devices via our expander bsg device, because there's no SMP encapsulation of SES. What mostly happens is that the expander has two or more target ports, one of which is SMP and the other (completely separate one) is an addressable SES target.

Quoted 5 lines

as far as I understood, the SEMB is a separate and well defined entity controllable via special PMP commands ...

not every PMP has to have one, but if they do, it should conform to the specification, even on the I2C layer

the protocols used on I2C is IPMI, the command protocol to communicate with the SEP is either SAF-TE or SES, AFAICT but it might be proprietary if both the SEMB and the SEP are from the same manufacturer ...

sorry for the confusion,
Herbert

Quoted 5 lines

HTC,
Herbert

Quoted 2 lines

James

#15 lore raw
In reply to James Bottomley

Hello, James.

Quoted 10 lines · James Bottomley
Quoted 2 lines

The problem is that the PMP device itself is currently not allocated a userland visible device, so it doesn't have any /dev/* node. Hmmm...

So perhaps it should be. If you look at the equivalent topology on SAS, our expanders have a bsg device node precisely so that we can do this.

That said, SAS expanders have a defined protocol (SAS Management Protocol) to talk to the outside world, so they are real visible objects always in our topology ... I'm not sure PMP has this ... it seems that all PMP visibility is an extension to the standard?

SATA PMP is mostly a dumb switch and there isn't much which can be done by issuing custom commands (and IIRC we didn't have bsg back then), so it was never made visible to userland, but yeah probably exporting a bsg node is a good idea. Inside libata, the PMP device has its device representation and all so it shouldn't be too difficult either. Not really sure how the inquiry and stuff should be handled tho.

Thanks.

Signature · 1 line
tejun
#16 lore raw
Quoted 14 lines · Tejun Heo

Hello, James.

Quoted 10 lines · James Bottomley
Quoted 2 lines

The problem is that the PMP device itself is currently not allocated a userland visible device, so it doesn't have any /dev/* node. Hmmm...

So perhaps it should be. If you look at the equivalent topology on SAS, our expanders have a bsg device node precisely so that we can do this.

That said, SAS expanders have a defined protocol (SAS Management Protocol) to talk to the outside world, so they are real visible objects always in our topology ... I'm not sure PMP has this ... it seems that all PMP visibility is an extension to the standard?

Quoted 7 lines

SATA PMP is mostly a dumb switch and there isn't much which can be done by issuing custom commands (and IIRC we didn't have bsg back then), so it was never made visible to userland, but yeah probably exporting a bsg node is a good idea. Inside libata, the PMP device has its device representation and all so it shouldn't be too difficult either. Not really sure how the inquiry and stuff should be handled tho.

Expanders aren't SCSI devices either ... that means they don't appear as visible to standard SCSI mechanisms like INQUIRY (SMP isn't a SCSI protocol it's a SAS extension). They just appear as part of the topology in the device tree.

James

#17 lore raw
Quoted 4 lines · James Bottomley

Expanders aren't SCSI devices either ... that means they don't appear as visible to standard SCSI mechanisms like INQUIRY (SMP isn't a SCSI protocol it's a SAS extension). They just appear as part of the topology in the device tree.

Ah, okay. Then, things would be much simpler. I was worrying about how it would map to SCSI layer including INQUIRY emulations and all those stuff. Thanks for the info.

Signature · 1 line
tejun
#18 lore raw
Quoted 9 lines · Tejun Heo
Quoted 4 lines · James Bottomley

Expanders aren't SCSI devices either ... that means they don't appear as visible to standard SCSI mechanisms like INQUIRY (SMP isn't a SCSI protocol it's a SAS extension). They just appear as part of the topology in the device tree.

Ah, okay. Then, things would be much simpler. I was worrying about how it would map to SCSI layer including INQUIRY emulations and all those stuff. Thanks for the info.

So, any thoughts on how and where to add the PMP to the devices available for sending SCSI or ATA commands to?

I'm willing to try to add the required code, but I'm sure I'll benefit from a few hints from the experts ...

thanks,
Herbert

Quoted 6 lines
Signature · 5 lines
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#19 lore raw
Quoted 11 lines · Herbert Poetzl
Quoted 9 lines · Tejun Heo
Quoted 4 lines · James Bottomley

Expanders aren't SCSI devices either ... that means they don't appear as visible to standard SCSI mechanisms like INQUIRY (SMP isn't a SCSI protocol it's a SAS extension). They just appear as part of the topology in the device tree.

Ah, okay. Then, things would be much simpler. I was worrying about how it would map to SCSI layer including INQUIRY emulations and all those stuff. Thanks for the info.

Quoted 5 lines

So, any thoughts on how and where to add the PMP to the devices available for sending SCSI or ATA commands to?

I'm willing to try to add the required code, but I'm sure I'll benefit from a few hints from the experts ...

Well, I'm not sure I'd count as an expert on this piece: I haven't read the relevant ATA standards. From what I understand, SES packets are encapsulated over an ATA command for SEMB. In that case, it should be fairly simple to recognise this and present a SCSI device which simply encapsulates everything sent to it over this protocol. That would allow the ses ULD to attach seamlessly.

James

#20 lore raw
Quoted 15 lines · James Bottomley
Quoted 13 lines · Herbert Poetzl
Quoted 9 lines · Tejun Heo
Quoted 4 lines · James Bottomley

Expanders aren't SCSI devices either ... that means they don't appear as visible to standard SCSI mechanisms like INQUIRY (SMP isn't a SCSI protocol it's a SAS extension). They just appear as part of the topology in the device tree.

Ah, okay. Then, things would be much simpler. I was worrying about how it would map to SCSI layer including INQUIRY emulations and all those stuff. Thanks for the info.

So, any thoughts on how and where to add the PMP to the devices available for sending SCSI or ATA commands to?

Quoted 8 lines
Quoted 2 lines

I'm willing to try to add the required code, but I'm sure I'll benefit from a few hints from the experts ...

Well, I'm not sure I'd count as an expert on this piece:
I haven't read the relevant ATA standards.

From what I understand, SES packets are encapsulated over an ATA command for SEMB.

correct, just that it can be any protocol (it's just another bus, usually i2c) with the common protocols being SES and SAF_TE AFAIK

Quoted 3 lines

In that case, it should be fairly simple to recognise this and present a SCSI device which simply encapsulates everything sent to it over this protocol.

do you have any pointers for me how that is done for SCSI?

Quoted 1 line

That would allow the ses ULD to attach seamlessly.

any pointers to such an SES ULD (maybe for testing)?

thanks in advance,
Herbert

Quoted 7 lines

James

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

#21 lore raw
Quoted 16 lines · Herbert Poetzl
Quoted 11 lines
Quoted 5 lines

So, any thoughts on how and where to add the PMP to the devices available for sending SCSI or ATA commands to?

I'm willing to try to add the required code, but I'm sure I'll benefit from a few hints from the experts ...

Well, I'm not sure I'd count as an expert on this piece:
I haven't read the relevant ATA standards.

From what I understand, SES packets are encapsulated over an ATA command for SEMB.

correct, just that it can be any protocol (it's just another bus, usually i2c) with the common protocols being SES and SAF_TE AFAIK

Quoted 5 lines
Quoted 3 lines

In that case, it should be fairly simple to recognise this and present a SCSI device which simply encapsulates everything sent to it over this protocol.

do you have any pointers for me how that is done for SCSI?

I don't think I understand the question. It happens automatically for anything part of the SCSI domain. For SEMB you have to unwind the encapsulation and expose the resulting device into the SCSI domain for the SES ULD to attach, presumably as a libata target or LUN. If you're asking for basic documentation about how SCSI works, that's in Documentation/scsi/ plus some of the kernel docbook stuff.

Quoted 3 lines
Quoted 1 line

That would allow the ses ULD to attach seamlessly.

any pointers to such an SES ULD (maybe for testing)?

it's drivers/scsi/ses.c

James

#22 lore raw
In reply to James Bottomley
Quoted 13 lines · James Bottomley
Quoted 11 lines · Tejun Heo
Quoted 8 lines

- the SiI3726 supports GPIO pins, which can be reached via the General Status and Control Register [130] and accoring to the docu, the Read/Write Port Multiplier command can be used to read/write that register.

+ how would I go about issuing such a command and where should it be done? i.e. what about interference with other commands? what about retrieving return values?

The problem is that the PMP device itself is currently not allocated a userland visible device, so it doesn't have any /dev/* node. Hmmm...

Quoted 7 lines

So perhaps it should be. If you look at the equivalent topology on SAS, our expanders have a bsg device node precisely so that we can do this.

That said, SAS expanders have a defined protocol (SAS Management Protocol) to talk to the outside world, so they are real visible objects always in our topology ... I'm not sure PMP has this ... it seems that all PMP visibility is an extension to the standard?

Yes, we do need a way to address these devices.

Jeff