Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* is there a simple graphic of SATA port multiplier structures?
@ 2019-04-23 17:00 Robert P. J. Day
  0 siblings, 0 replies; only message in thread
From: Robert P. J. Day @ 2019-04-23 17:00 UTC (permalink / raw)
  To: Kernel Newbies


  was just asked to take a look at how SATA II port multipliers are
supported in the linux kernel and, in the midst of all the code and
header files, what seems to be missing is a simple graphic of the main
structures and how many of them there are. let me elucidate.

  imagine, say, a 1-to-4 PMP -- single port multiplexing to four SATA
HDDs. from include/linux/libata.h, i can see the ATA-related
structures that will be involved, but it would be just ducky if there
was a short description as to *how* *many* of each would be involved
in this scenario; that is, a simple counting demonstration would be
massively informative.

  first, it appears that there would be a single ata_port structure:

struct ata_port {
        struct Scsi_Host        *scsi_host; /* our co-allocated scsi host */
        struct ata_port_operations *ops;
        spinlock_t              *lock;
        /* Flags owned by the EH context. Only EH should touch these once the
           port is active */
        unsigned long           flags;  /* ATA_FLAG_xxx */
        ... snip ...

where one of the possible "flags" settings is:

        ATA_FLAG_PMP            = (1 << 19), /* controller supports PMP */

so, having only glanced at all of this so far, i assume i would have
one "struct ata_port" with that flag set.

  on the other hand, it would appear i would have four "struct
ata_link"s:

struct ata_link {
        struct ata_port         *ap;
        int                     pmp;            /* port multiplier port # */
        ... snip ...

finally, what about "struct ata_device":

struct ata_device {
        struct ata_link         *link;
        unsigned int            devno;          /* 0 or 1 */
        ... snip ...

not having read any further just yet, it's not clear whether there
would be one or four of those, depending on how libata views the
storage devices themselves, but i'm sure i'll figure it out as i keep
reading.

  in the end, it would be terrifically useful if there was a simple
example of how all these structures connected to support a basic
scenario. is that written down anywhere? it doesn't need to be crazy
comprehensive, just the enumeration of the structures involved.

  thoughts?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                         http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 17:00 is there a simple graphic of SATA port multiplier structures? Robert P. J. Day

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox