This message is from the T13 list server.
On Tue, 16 Nov 2004 09:04:27 -0800, Curtis Stevens wrote: >This message is from the T13 list server. >Dan >Now that I look at the text more closely, I think this needs an >agenda item. Sounds like it should be for no other reason than to allow people to understand how PATA works and why the text you object to has been in the ATA/ATAPI-x standards since ATA/ATAPI-4 and probably was in ATA-x prior to ATA/ATAPI-4. Yes, the text may not be the best in the world but it is correct. >Hale >The reason that it says "Shall not set the DRQ bit to one" instead >of shall not change the DRQ bit is because of the ATAPI devices I talked >about earlier. I still don't understand the problem with ATAPI devices... When talking about these ATAPI devices which command protocol(s) show this "problem/bug" and where in that command protocol does the device do something wrong? >I think we have found an inconsistency in ATA/ATAPI-7 between >5.14.5.5 and 5.14.5.7. 5.14.5.7 states that: >The ERR bit shall be set to one by the device: >1) when BSY or DRQ is set to one and an error occurs in the >executing command. Yes, it has always been legal for a device to have BSY=0 DRQ=1 and ERR=1. This does not mean the device has data to transfer (oh I'm sure that is going to confuse people!). It means the command has ended with an error and the host needs to read the Error register and then do a Soft Reset. It has always meant this. Yes, some hosts will delay looking at ERR=1 and see DRQ=1 and attempt to transfer data - some devices will have data ready to transfer - some device will not - it doesn't matter the ERR=1 means the command failed and any data transferred by the host was "invalid" - the device must be reset (because the status is not BSY=0 DRQ=0) and then the host should retry the command. >Please note the "or" in the clause. I have seen devices set the ERR bit >when DRQ=1. This is the section they quote. Yes, this is an old scheme that should have been made obsolete back in ATA-x. But the device sets DRQ=1 and ERR=1 BEFORE setting BSY=0 - a device is never allowed to change the ERR bit (or the DRQ bit) once the device has set BSY=0. >Please also note 5.14.5.1: "After the host has written the Command register >the device shall have either the BSY bit set to one, or the DRQ bit set to >one, ..." >If this is truly the case, then if you are a device that sets DRQ=1 when the >command register is stored, you would have to be able to set ERR=1 when >BSY=0. When the host writes the Command register is is legal for a device to move immediately to any of the following status: BSY=1 BSY=0 DRQ=1 ERR=0 BSY=0 DRQ=0 ERR=1 BSY=0 DRQ=1 ERR=1 The last two states are equivalent - the command failed - there really isn't any data to transfer. >I think the text of the paragraph you are quoting is a little unclear. It >is in direct conflict with the list of reasons for setting BSY=1 item number >two. It is also in conflict with 5.15.5.5. I think that it is interesting >because in 5.15.5.5 it also says you can't set the BSY bit if you have set >the DRQ bit to indicate that the command has started. OK, but be *VERY* *CAREFUL* here... Any change to this wording could completely break PATA hosts or PATA devices. I don't see that there is a real problem here - if there is and any wording is changed that change must be done with the greatest care possible. Hale *** Hale Landis *** www.ata-atapi.com ***
