Skip to contentSkip to conversation

IDE-flash device and hard disk on same controller

DISCUSSION Adam J. Richter 3 participants 3 messages Aug 23, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 21 lines · Andre Hedrick
Quoted 6 lines · Adam J. Richter

1. Regardless of whatever specification you are referring to
or Andre's "31 second rule of [Power On Self Test]", it is genuinely useful to boot faster by overlapping some other kernel work before the drive is. Specifications ultimately exist only to serve this usefulness. When a specification impedes usefulness, sometimes it's the right decision to violate it. Of course, we're not talking about

Listen to yourself, and understand why 2.5 failed.

"When a specification impedes usefulness, sometimes it's the right decision to violate it."

"Gee there is no traffic in the on coming lanes, maybe I should use them."

There are rules for how the hardware works, and if everything out there comes up in 4 seconds great. If everything returns faster than the worst case great. You start assuming everything behaves that way and you repeat history.

Quoted 4 lines

You guys in 2.5 walked away from the rules because you thought you knew better, where did it get you? Lost interrupts, PIO command block exectution failures, dropping EOT on PRD's because reading something into the published documents which is not there, etc ...

Those are not examples of cases where the specification impedes
usefulness. Those are examples where a specification helped usefulness by helping compatability (not driving in oncoming lanes, not having timing problems), and a decision made either out of recklessness (driving into oncoming lanes) or, I infer, out of a misunderstanding of some document.

However, your point is well taken in that when I said
"sometimes it's the right decision to violate [a specification]," I did not mean by "sometimes" that this is a random event, like "sometimes it rains." I meant that it's a very careful decision, the details of which differ from case to case, and that the result is not always against.

Quoted 10 lines
Quoted 7 lines

your IDE code violating such a specification, but rather not relying on this particular guarantee.

2. Besides, if this code is supposed to be a generic IDE core,
it many need to run on platforms that do not provide that guarantee or where the boot code is not even capable of finding where all of the IDE controllers.

It is a means for probing signatures w/o identify to test for presence. It to has a 31 second rule. Break the worst case and device get lost.

Can you provide a reference for this "31 second rule?" If
your reference does not directly discuss how it would impede the test that you refer to, then you might want to explain that too. Thanks in advance.

Quoted 1 line

Please do not take this personal, because it is a technical arguemnet.

Of couse, likewise.

Quoted 2 lines

We do it by the books and then we cheat when we can, but only after we have all the proper stuff in place for compliance.

Let's keep in perspective that I am talking adding a test that
would cause a delay until it is safe to proceed (unless you're saying that waiting for the busy bit to clear is insufficient, in which case I'd like to know how, but it would still be no more dangerous), and you are advocating skipping that test.

Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America

"Free Software For The Rest Of Us."

#1 lore raw

Section 6.10

EXECUTE DIAGNOSTICS: Host Shall assert Reset (SRST) prior to issuing.

Section 6.2 SoftReset (SRST)

Device side State Diagram: D0SR3 "Set_Status_State"

second paragraph

"All actions required in this state shall be completed within 31 s"

Page 86 Volume 3 ATA/ATAPI 7 rev 0, 5 November 2001.

Sorry for the old reference it was the quickest hard copy I could find.

The world of the HOST driver does not live in software alone. You have to read the device side rules to obtain the rest of the solution. Yeah this stinks, but very few of us are nutty enough to get the entire process.

What I need most is people like yourself who are skilled in the kernel api to help me get that part correct. This stuff is easy and can drive you insane. Since I am there, you are welcome to come but I don't think you are weird enough yet :-). If you want to visit my world and stay, jump in and bring a barf bag for the first part of the ride. Also borrow Linus's crack pipe too, mine is in use.

Cheers,

Andre Hedrick
LAD Storage Consulting Group

Quoted 78 lines · Adam J. Richter
Quoted 21 lines · Andre Hedrick
Quoted 6 lines · Adam J. Richter

1. Regardless of whatever specification you are referring to
or Andre's "31 second rule of [Power On Self Test]", it is genuinely useful to boot faster by overlapping some other kernel work before the drive is. Specifications ultimately exist only to serve this usefulness. When a specification impedes usefulness, sometimes it's the right decision to violate it. Of course, we're not talking about

Listen to yourself, and understand why 2.5 failed.

"When a specification impedes usefulness, sometimes it's the right decision to violate it."

"Gee there is no traffic in the on coming lanes, maybe I should use them."

There are rules for how the hardware works, and if everything out there comes up in 4 seconds great. If everything returns faster than the worst case great. You start assuming everything behaves that way and you repeat history.

Quoted 4 lines

You guys in 2.5 walked away from the rules because you thought you knew better, where did it get you? Lost interrupts, PIO command block exectution failures, dropping EOT on PRD's because reading something into the published documents which is not there, etc ...

Those are not examples of cases where the specification impedes
usefulness. Those are examples where a specification helped usefulness by helping compatability (not driving in oncoming lanes, not having timing problems), and a decision made either out of recklessness (driving into oncoming lanes) or, I infer, out of a misunderstanding of some document.

However, your point is well taken in that when I said
"sometimes it's the right decision to violate [a specification]," I did not mean by "sometimes" that this is a random event, like "sometimes it rains." I meant that it's a very careful decision, the details of which differ from case to case, and that the result is not always against.

Quoted 10 lines
Quoted 7 lines

your IDE code violating such a specification, but rather not relying on this particular guarantee.

2. Besides, if this code is supposed to be a generic IDE core,
it many need to run on platforms that do not provide that guarantee or where the boot code is not even capable of finding where all of the IDE controllers.

It is a means for probing signatures w/o identify to test for presence. It to has a 31 second rule. Break the worst case and device get lost.

Can you provide a reference for this "31 second rule?" If
your reference does not directly discuss how it would impede the test that you refer to, then you might want to explain that too. Thanks in advance.

Quoted 1 line

Please do not take this personal, because it is a technical arguemnet.

Of couse, likewise.

Quoted 2 lines

We do it by the books and then we cheat when we can, but only after we have all the proper stuff in place for compliance.

Let's keep in perspective that I am talking adding a test that
would cause a delay until it is safe to proceed (unless you're saying that waiting for the busy bit to clear is insufficient, in which case I'd like to know how, but it would still be no more dangerous), and you are advocating skipping that test.

Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America

"Free Software For The Rest Of Us."

#2 lore raw
In reply to Adam J. Richter
Quoted 1 line · Adam J. Richter

Can you provide a reference for this "31 second rule?"

Read e.g. ATA-6.

[If things work well, they may well be fast. But you are only entitled to conclude that something is wrong after waiting for 31 s. In particular, if you want to detect device 1 (the slave device), then only after 31 s you know that it is absent.]

See for example the Device power-on or hardware reset state diagram in 9.1. Some random quotes:

1) Following a hardware reset or software reset, the following steps may be used to reselect Device 1:
a) Write to the Device register with DEV bit set to one;
b) Using one or more of the Command Block registers that may be both written and read, such as the Sector Count or LBA Low, write a data pattern other than 00h or FFh to the register(s);
c) Read the register(s) written in step (b). If the data read is the same as the data written, proceed to step (e);
d) Repeat steps (a) to (c) until the data matches in step (c) or until 31 s has past. After 31 s the host may assume that Device 1 is not functioning properly;
e) Read the Status register and Error registers. Check the Status and Error register contents for any error conditions that Device 1 may have posted.

In Standby mode the device is capable of responding to commands but the device may take longer to complete commands than in the Idle mode. The time to respond could be as long as 30 s.

In Sleep mode the device requires a hardware or software reset or a DEVICE RESET command to be activated. The time to respond could be as long as 30 s.

Transition D0HR2b:D0HR3: When the sample indicates that PDIAG- is not asserted and 31 s have elapsed since the negation of RESET- (SRST), the device shall set bit 7 in the Error register and make a transition to the D0HR3: Set_status state.

D0SR3: Set_status State: All actions required in this state shall be completed within 31 s.

D1HR1: Set_status State: This state is entered when the device has asserted DASP-. When in this state the device shall complete any hardware initialization and self-diagnostic testing begun in the Set DASP- state if not already completed. The diagnostic code shall be placed in the Error register (see Table 26). If the device passed self-diagnostics, the device shall assert PDIAG-. All actions required in this state shall be completed in 30 s.

D1SR2: Set_status State: (idem for SRST)

DI1: Device_Idle_S State:
When entering this state from a power-on, hardware, or software reset, if the device does not implement the PACKET command feature set, the device shall set DRDY to one within 30 s of entering this state. When entering this state from a power-on, hardware, or software reset, if the device does implement the PACKET command feature set, the device shall not set DRDY to one.

DI2: Device_Idle_NS State:
When entering this state from a power-on, hardware, or software reset, if the device does not implement the PACKET command feature set, the device shall set DRDY to one within 30 s of entering this state and shall release DASP- and PDIAG- with 31 s of entering this state. When entering this state from a power-on, hardware, or software reset, if the device does implement the PACKET command feature set, the device shall not set DRDY to one.