* [Bug 15185] New: Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor
@ 2010-01-31 11:30 bugzilla-daemon
2010-02-01 18:11 ` Douglas Gilbert
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: bugzilla-daemon @ 2010-01-31 11:30 UTC (permalink / raw)
To: linux-scsi
http://bugzilla.kernel.org/show_bug.cgi?id=15185
Summary: Sending a 48bit ATA-Command with "CheckCondition"
through SG_IO does not return correct 48bit sense
descriptor
Product: SCSI Drivers
Version: 2.5
Kernel Version: 2.6.31
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Other
AssignedTo: scsi_drivers-other@kernel-bugs.osdl.org
ReportedBy: stefan.huebner@stud.tu-ilmenau.de
Regression: No
Example: sending a correct "READ_NATIVE_MAX_ADDRESS_EXT" to /dev/sdd (opened
O_RDWR | O_NONBLOCK) via ATA_PASSTHROUGH_16 (SCSI-Command 0x85) with the EXTEND
and the CHECK_CONDITION bits set to 1 yields sense data in descriptor-format.
Unfortunately, the descriptor does not have EXTEND set, and by that only
returns 24 Bits of LBA.
This obviously is a bug, as the SAT-2 Draft says: "If the sense data is for an
ATA PASS-THROUGH (16) command with the EXTEND bit set to one, then the SATL
shall return the 48-bit extended status and shall set the EXTEND bit to one."
Contents of important data-structures for SG_IO:
sg_io_hdr.cmdlen = 16
*sg_io_hdr.cmdp = {0x85 0x07 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x27 0x00}
sense-data after command:
0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x00 0x00 0x00 0x00 0x00 0xaf
0x00 0x6d 0x00 0x70 0x00 0x50
meaning: descriptor-sense, no error
descriptor:
code=0x09 -> ATA-Return descriptor
length=0x0c
EXTEND=0
Error = 0x00
SectorCount = 0x00
LBA_Low = 0xaf
LBA_Mid = 0x6d
LBA_High= 0x70
Device = 0
Status = DeviceReady | DeferredWriteError
The drive used should be reporting a native max lba of 0x74706daf (1.02TB), so
the expected sense data should look like:
0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x01 0x00 0x00 0x00 0x6d 0xaf
0x74 0x70 0x00 0x00 0x00 0x50
--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bug 15185] New: Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor
2010-01-31 11:30 [Bug 15185] New: Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor bugzilla-daemon
@ 2010-02-01 18:11 ` Douglas Gilbert
2010-02-01 18:25 ` Douglas Gilbert
2010-02-01 19:01 ` [Bug 15185] " bugzilla-daemon
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Douglas Gilbert @ 2010-02-01 18:11 UTC (permalink / raw)
To: bugzilla-daemon; +Cc: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 2445 bytes --]
bugzilla-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=15185
>
> Summary: Sending a 48bit ATA-Command with "CheckCondition"
> through SG_IO does not return correct 48bit sense
> descriptor
> Product: SCSI Drivers
> Version: 2.5
> Kernel Version: 2.6.31
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: Other
> AssignedTo: scsi_drivers-other@kernel-bugs.osdl.org
> ReportedBy: stefan.huebner@stud.tu-ilmenau.de
> Regression: No
>
>
> Example: sending a correct "READ_NATIVE_MAX_ADDRESS_EXT" to /dev/sdd (opened
> O_RDWR | O_NONBLOCK) via ATA_PASSTHROUGH_16 (SCSI-Command 0x85) with the EXTEND
> and the CHECK_CONDITION bits set to 1 yields sense data in descriptor-format.
> Unfortunately, the descriptor does not have EXTEND set, and by that only
> returns 24 Bits of LBA.
>
> This obviously is a bug, as the SAT-2 Draft says: "If the sense data is for an
> ATA PASS-THROUGH (16) command with the EXTEND bit set to one, then the SATL
> shall return the 48-bit extended status and shall set the EXTEND bit to one."
>
> Contents of important data-structures for SG_IO:
> sg_io_hdr.cmdlen = 16
> *sg_io_hdr.cmdp = {0x85 0x07 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x00 0x00 0x27 0x00}
>
> sense-data after command:
> 0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x00 0x00 0x00 0x00 0x00 0xaf
> 0x00 0x6d 0x00 0x70 0x00 0x50
> meaning: descriptor-sense, no error
> descriptor:
> code=0x09 -> ATA-Return descriptor
> length=0x0c
> EXTEND=0
> Error = 0x00
> SectorCount = 0x00
> LBA_Low = 0xaf
> LBA_Mid = 0x6d
> LBA_High= 0x70
> Device = 0
> Status = DeviceReady | DeferredWriteError
>
> The drive used should be reporting a native max lba of 0x74706daf (1.02TB), so
> the expected sense data should look like:
> 0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x01 0x00 0x00 0x00 0x6d 0xaf
> 0x74 0x70 0x00 0x00 0x00 0x50
This bug does not occur in lk 2.6.30 but does in lk
2.6.32 . There was a pretty large rework of libata
in that period and there is obvious bug in
drivers/ata/libata-scsi.c that causes this.
The attached patch fixes this problem in lk 2.6.32 in
my test.
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
[-- Attachment #2: latascsi2632.diff --]
[-- Type: text/x-patch, Size: 492 bytes --]
--- linux/drivers/ata/libata-scsi.c 2009-12-03 11:11:13.000000000 -0500
+++ linux/drivers/ata/libata-scsi.c2632dpg1 2010-02-01 10:55:36.000000000 -0500
@@ -2825,7 +2825,7 @@
* write indication (used for PIO/DMA setup), result TF is
* copied back and we don't whine too much about its failure.
*/
- tf->flags = ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
+ tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
if (scmd->sc_data_direction == DMA_TO_DEVICE)
tf->flags |= ATA_TFLAG_WRITE;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bug 15185] New: Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor
2010-02-01 18:11 ` Douglas Gilbert
@ 2010-02-01 18:25 ` Douglas Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Douglas Gilbert @ 2010-02-01 18:25 UTC (permalink / raw)
To: bugzilla-daemon; +Cc: linux-scsi
Douglas Gilbert wrote:
> bugzilla-daemon@bugzilla.kernel.org wrote:
>> http://bugzilla.kernel.org/show_bug.cgi?id=15185
>>
>> Summary: Sending a 48bit ATA-Command with "CheckCondition"
>> through SG_IO does not return correct 48bit sense
>> descriptor
>> Product: SCSI Drivers
>> Version: 2.5
>> Kernel Version: 2.6.31
>> Platform: All
>> OS/Version: Linux
>> Tree: Mainline
>> Status: NEW
>> Severity: normal
>> Priority: P1
>> Component: Other
>> AssignedTo: scsi_drivers-other@kernel-bugs.osdl.org
>> ReportedBy: stefan.huebner@stud.tu-ilmenau.de
>> Regression: No
>>
>>
>> Example: sending a correct "READ_NATIVE_MAX_ADDRESS_EXT" to /dev/sdd
>> (opened
>> O_RDWR | O_NONBLOCK) via ATA_PASSTHROUGH_16 (SCSI-Command 0x85) with
>> the EXTEND
>> and the CHECK_CONDITION bits set to 1 yields sense data in
>> descriptor-format. Unfortunately, the descriptor does not have EXTEND
>> set, and by that only
>> returns 24 Bits of LBA.
>>
>> This obviously is a bug, as the SAT-2 Draft says: "If the sense data
>> is for an
>> ATA PASS-THROUGH (16) command with the EXTEND bit set to one, then the
>> SATL
>> shall return the 48-bit extended status and shall set the EXTEND bit
>> to one."
>>
>> Contents of important data-structures for SG_IO:
>> sg_io_hdr.cmdlen = 16
>> *sg_io_hdr.cmdp = {0x85 0x07 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00
>> 0x00 0x00
>> 0x00 0x00 0x27 0x00}
>>
>> sense-data after command:
>> 0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x00 0x00 0x00 0x00
>> 0x00 0xaf
>> 0x00 0x6d 0x00 0x70 0x00 0x50
>> meaning: descriptor-sense, no error
>> descriptor:
>> code=0x09 -> ATA-Return descriptor
>> length=0x0c
>> EXTEND=0
>> Error = 0x00
>> SectorCount = 0x00
>> LBA_Low = 0xaf
>> LBA_Mid = 0x6d
>> LBA_High= 0x70
>> Device = 0
>> Status = DeviceReady | DeferredWriteError
>>
>> The drive used should be reporting a native max lba of 0x74706daf
>> (1.02TB), so
>> the expected sense data should look like:
>> 0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x01 0x00 0x00 0x00
>> 0x6d 0xaf
>> 0x74 0x70 0x00 0x00 0x00 0x50
>
> This bug does not occur in lk 2.6.30 but does in lk
> 2.6.32 . There was a pretty large rework of libata
> in that period and there is obvious bug in
> drivers/ata/libata-scsi.c that causes this.
>
> The attached patch fixes this problem in lk 2.6.32 in
> my test.
>
> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Changelog:
- Fix assignment which overwrote SAT ATA PASS-THROUGH
command EXTEND bit setting (ATA_TFLAG_LBA48)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug 15185] Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor
2010-01-31 11:30 [Bug 15185] New: Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor bugzilla-daemon
2010-02-01 18:11 ` Douglas Gilbert
@ 2010-02-01 19:01 ` bugzilla-daemon
2010-02-01 19:06 ` bugzilla-daemon
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2010-02-01 19:01 UTC (permalink / raw)
To: linux-scsi
http://bugzilla.kernel.org/show_bug.cgi?id=15185
--- Comment #1 from Anonymous Emailer <anonymous@kernel-bugs.osdl.org> 2010-02-01 19:01:55 ---
Reply-To: dgilbert@interlog.com
Douglas Gilbert wrote:
> bugzilla-daemon@bugzilla.kernel.org wrote:
>> http://bugzilla.kernel.org/show_bug.cgi?id=15185
>>
>> Summary: Sending a 48bit ATA-Command with "CheckCondition"
>> through SG_IO does not return correct 48bit sense
>> descriptor
>> Product: SCSI Drivers
>> Version: 2.5
>> Kernel Version: 2.6.31
>> Platform: All
>> OS/Version: Linux
>> Tree: Mainline
>> Status: NEW
>> Severity: normal
>> Priority: P1
>> Component: Other
>> AssignedTo: scsi_drivers-other@kernel-bugs.osdl.org
>> ReportedBy: stefan.huebner@stud.tu-ilmenau.de
>> Regression: No
>>
>>
>> Example: sending a correct "READ_NATIVE_MAX_ADDRESS_EXT" to /dev/sdd
>> (opened
>> O_RDWR | O_NONBLOCK) via ATA_PASSTHROUGH_16 (SCSI-Command 0x85) with
>> the EXTEND
>> and the CHECK_CONDITION bits set to 1 yields sense data in
>> descriptor-format. Unfortunately, the descriptor does not have EXTEND
>> set, and by that only
>> returns 24 Bits of LBA.
>>
>> This obviously is a bug, as the SAT-2 Draft says: "If the sense data
>> is for an
>> ATA PASS-THROUGH (16) command with the EXTEND bit set to one, then the
>> SATL
>> shall return the 48-bit extended status and shall set the EXTEND bit
>> to one."
>>
>> Contents of important data-structures for SG_IO:
>> sg_io_hdr.cmdlen = 16
>> *sg_io_hdr.cmdp = {0x85 0x07 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00
>> 0x00 0x00
>> 0x00 0x00 0x27 0x00}
>>
>> sense-data after command:
>> 0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x00 0x00 0x00 0x00
>> 0x00 0xaf
>> 0x00 0x6d 0x00 0x70 0x00 0x50
>> meaning: descriptor-sense, no error
>> descriptor:
>> code=0x09 -> ATA-Return descriptor
>> length=0x0c
>> EXTEND=0
>> Error = 0x00
>> SectorCount = 0x00
>> LBA_Low = 0xaf
>> LBA_Mid = 0x6d
>> LBA_High= 0x70
>> Device = 0
>> Status = DeviceReady | DeferredWriteError
>>
>> The drive used should be reporting a native max lba of 0x74706daf
>> (1.02TB), so
>> the expected sense data should look like:
>> 0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x01 0x00 0x00 0x00
>> 0x6d 0xaf
>> 0x74 0x70 0x00 0x00 0x00 0x50
>
> This bug does not occur in lk 2.6.30 but does in lk
> 2.6.32 . There was a pretty large rework of libata
> in that period and there is obvious bug in
> drivers/ata/libata-scsi.c that causes this.
>
> The attached patch fixes this problem in lk 2.6.32 in
> my test.
>
> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Changelog:
- Fix assignment which overwrote SAT ATA PASS-THROUGH
command EXTEND bit setting (ATA_TFLAG_LBA48)
--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug 15185] Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor
2010-01-31 11:30 [Bug 15185] New: Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor bugzilla-daemon
2010-02-01 18:11 ` Douglas Gilbert
2010-02-01 19:01 ` [Bug 15185] " bugzilla-daemon
@ 2010-02-01 19:06 ` bugzilla-daemon
2010-02-01 21:22 ` bugzilla-daemon
2010-02-09 16:13 ` bugzilla-daemon
4 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2010-02-01 19:06 UTC (permalink / raw)
To: linux-scsi
http://bugzilla.kernel.org/show_bug.cgi?id=15185
--- Comment #2 from Anonymous Emailer <anonymous@kernel-bugs.osdl.org> 2010-02-01 19:06:55 ---
Reply-To: dgilbert@interlog.com
bugzilla-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=15185
>
> Summary: Sending a 48bit ATA-Command with "CheckCondition"
> through SG_IO does not return correct 48bit sense
> descriptor
> Product: SCSI Drivers
> Version: 2.5
> Kernel Version: 2.6.31
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: Other
> AssignedTo: scsi_drivers-other@kernel-bugs.osdl.org
> ReportedBy: stefan.huebner@stud.tu-ilmenau.de
> Regression: No
>
>
> Example: sending a correct "READ_NATIVE_MAX_ADDRESS_EXT" to /dev/sdd (opened
> O_RDWR | O_NONBLOCK) via ATA_PASSTHROUGH_16 (SCSI-Command 0x85) with the EXTEND
> and the CHECK_CONDITION bits set to 1 yields sense data in descriptor-format.
> Unfortunately, the descriptor does not have EXTEND set, and by that only
> returns 24 Bits of LBA.
>
> This obviously is a bug, as the SAT-2 Draft says: "If the sense data is for an
> ATA PASS-THROUGH (16) command with the EXTEND bit set to one, then the SATL
> shall return the 48-bit extended status and shall set the EXTEND bit to one."
>
> Contents of important data-structures for SG_IO:
> sg_io_hdr.cmdlen = 16
> *sg_io_hdr.cmdp = {0x85 0x07 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x00 0x00 0x27 0x00}
>
> sense-data after command:
> 0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x00 0x00 0x00 0x00 0x00 0xaf
> 0x00 0x6d 0x00 0x70 0x00 0x50
> meaning: descriptor-sense, no error
> descriptor:
> code=0x09 -> ATA-Return descriptor
> length=0x0c
> EXTEND=0
> Error = 0x00
> SectorCount = 0x00
> LBA_Low = 0xaf
> LBA_Mid = 0x6d
> LBA_High= 0x70
> Device = 0
> Status = DeviceReady | DeferredWriteError
>
> The drive used should be reporting a native max lba of 0x74706daf (1.02TB), so
> the expected sense data should look like:
> 0x72 0x00 0x00 0x00 0x00 0x00 0x00 0x0e 0x09 0x0c 0x01 0x00 0x00 0x00 0x6d 0xaf
> 0x74 0x70 0x00 0x00 0x00 0x50
This bug does not occur in lk 2.6.30 but does in lk
2.6.32 . There was a pretty large rework of libata
in that period and there is obvious bug in
drivers/ata/libata-scsi.c that causes this.
The attached patch fixes this problem in lk 2.6.32 in
my test.
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug 15185] Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor
2010-01-31 11:30 [Bug 15185] New: Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor bugzilla-daemon
` (2 preceding siblings ...)
2010-02-01 19:06 ` bugzilla-daemon
@ 2010-02-01 21:22 ` bugzilla-daemon
2010-02-09 16:13 ` bugzilla-daemon
4 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2010-02-01 21:22 UTC (permalink / raw)
To: linux-scsi
http://bugzilla.kernel.org/show_bug.cgi?id=15185
Stefan Hübner <stefan.huebner@stud.tu-ilmenau.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Kernel Version|2.6.31 |2.6.32
--- Comment #3 from Stefan Hübner <stefan.huebner@stud.tu-ilmenau.de> 2010-02-01 21:22:04 ---
Just to clear up: sorry, I forgot I recently updated to 2.6.32. Changed
bug-description accordingly.
--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug 15185] Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor
2010-01-31 11:30 [Bug 15185] New: Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor bugzilla-daemon
` (3 preceding siblings ...)
2010-02-01 21:22 ` bugzilla-daemon
@ 2010-02-09 16:13 ` bugzilla-daemon
4 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2010-02-09 16:13 UTC (permalink / raw)
To: linux-scsi
http://bugzilla.kernel.org/show_bug.cgi?id=15185
Alan <alan@lxorguk.ukuu.org.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |alan@lxorguk.ukuu.org.uk
Component|Other |Serial ATA
Resolution| |CODE_FIX
AssignedTo|scsi_drivers-other@kernel-b |jgarzik@pobox.com
|ugs.osdl.org |
Product|SCSI Drivers |IO/Storage
--- Comment #4 from Alan <alan@lxorguk.ukuu.org.uk> 2010-02-09 16:13:13 ---
commit bc496ed00ab1411d3efaf295b72e0c9eb343e1a3
--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-02-09 16:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-31 11:30 [Bug 15185] New: Sending a 48bit ATA-Command with "CheckCondition" through SG_IO does not return correct 48bit sense descriptor bugzilla-daemon
2010-02-01 18:11 ` Douglas Gilbert
2010-02-01 18:25 ` Douglas Gilbert
2010-02-01 19:01 ` [Bug 15185] " bugzilla-daemon
2010-02-01 19:06 ` bugzilla-daemon
2010-02-01 21:22 ` bugzilla-daemon
2010-02-09 16:13 ` bugzilla-daemon
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).