linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* AHCI driver preferring nr_ports over port map
@ 2008-02-01 15:12 Jan Beulich
  2008-02-02  8:16 ` Tejun Heo
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Beulich @ 2008-02-01 15:12 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide

Jeff,

while I realize that Intel's documentation may not be consistent with
anything more generic (which I don't know where to look for), this
current behavior seems to contradict what Intel documents for ESB2:

"23.3.1.4 PI – Ports Implemented Register (D31:F2)
Address Offset: ABAR + 0Ch–0Fh Attribute: R/WO, RO
Default Value: 00000000h Size: 32 bits

This register indicates which ports are exposed to the Intel®
631xESB/632xESB I/O Controller Hub. It is loaded by platform BIOS. It
indicates which ports that the device supports are available for
software to use. For ports that are not available, software must not
read or write to registers within that port."

Could you shed any extra light on this?

Thanks, Jan

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: AHCI driver preferring nr_ports over port map
@ 2008-02-04 13:10 Jan Beulich
  2008-02-04 13:16 ` Tejun Heo
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Beulich @ 2008-02-04 13:10 UTC (permalink / raw)
  To: htejun; +Cc: jgarzik, linux-ide

>>> Tejun Heo <htejun@gmail.com> 02/02/08 9:16 AM >>>
>Jan Beulich wrote:
>> Jeff,
>> 
>> while I realize that Intel's documentation may not be consistent with
>> anything more generic (which I don't know where to look for), this
>> current behavior seems to contradict what Intel documents for ESB2:
>> 
>> "23.3.1.4 PI – Ports Implemented Register (D31:F2)
>> Address Offset: ABAR + 0Ch–0Fh Attribute: R/WO, RO
>> Default Value: 00000000h Size: 32 bits
>> 
>> This register indicates which ports are exposed to the Intel®
>> 631xESB/632xESB I/O Controller Hub. It is loaded by platform BIOS. It
>> indicates which ports that the device supports are available for
>> software to use. For ports that are not available, software must not
>> read or write to registers within that port."
>
>nr_ports is preferred over port_map when they disagree which shouldn't
>happen in the first place.  On some earlier ahcis, PI was cleared to
>zero and lower nr_port number of ports should be used.  The reason why
>nr_ports is preferred over PI comes from similar place.  Hardware/BIOSen
>are more likely to get PI wrong than nr_ports, so...
>
>Do you have any real case where the above behavior causes problem?

It's not strictly a problem (i.e. nothing really mis-behaves), but it made
me wonder why the box I saw this on gets 6 ahci device instances set
up when spec as well as port map say there ought to be only 5. After
looking at the ESB2 spec it seemed that behavior was clearly violating
the spec: "For ports that are not available, software must not read or
write to registers within that port.", which contradicts status being
displayed for (and therefore status being read) from the 6th (not
present) port.

Jan

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: AHCI driver preferring nr_ports over port map
@ 2008-02-04 13:24 Jan Beulich
  2008-02-04 13:38 ` Tejun Heo
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Beulich @ 2008-02-04 13:24 UTC (permalink / raw)
  To: htejun; +Cc: jgarzik, linux-ide

>Well, two values don't agree with each other and we know for a fact that
>vendors sometimes get PI wrong, so we trust n_ports in such cases.  We
>can reverse the behavior but that's likely to cause more problems than
>it fixes.

I understand your concern, but I think you also understand mine. So
I'm not really asking for general reversal of the logic, but to perhaps
make it just a little smarter. The (not generally usable according to
what you said earlier) experiment I made was to use the smaller of
the two sets - if either set is empty this of course wouldn't be correct.
But perhaps, if you have a non-empty port map, that should be
preferred over nr_ports? Otherwise, chipset specific knowledge may
need to be applied here (i.e. for ESB2, port map ought to always be
used)...

Jan

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

end of thread, other threads:[~2008-02-05 14:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-01 15:12 AHCI driver preferring nr_ports over port map Jan Beulich
2008-02-02  8:16 ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2008-02-04 13:10 Jan Beulich
2008-02-04 13:16 ` Tejun Heo
2008-02-04 13:24 Jan Beulich
2008-02-04 13:38 ` Tejun Heo
2008-02-05  7:47   ` Jan Beulich
2008-02-05 12:21     ` Tejun Heo
2008-02-05 12:40       ` Jan Beulich
2008-02-05 13:17         ` Tejun Heo
2008-02-05 14:51           ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).