libata: Initialize nbytes for internal sg commands
PATCH 2/3 libata: Initialize nbytes for internal sg commands
In reply to a message not in the archiveSome LLDDs, like ipr, use nbytes and pad_len to determine the total data transfer length of a command. Make sure nbytes gets initialized for internally generated commands.
---
linux-2.6-bjking1/drivers/ata/libata-core.c | 1 + 1 files changed, 1 insertion(+)
drivers/ata/libata-core.c renamed from drivers/ata/libata-core.c~libata_fix_nbytes +1 -0
@@ -1250,6 +1250,7 @@ unsigned ata_exec_internal_sg(struct ataata_sg_init (qc, sg, n_elem); qc->nsect = buflen /ATA_SECT_SIZE ; + qc->nbytes = buflen; } qc->private_data = &wait;
_
PATCH 3/3 libata: Initialize qc->pad_len
In reply to a message not in the archiveInitialize qc->pad_len for each new command. This ensures that pad_len is not set to a stale value for zero data length commands.
---
linux-2.6-bjking1/include/linux/libata.h | 1 + 1 files changed, 1 insertion(+)
include/linux/libata.h renamed from include/linux/libata.h~libata_init_pad_len +1 -0
@@ -1151,6 +1151,7 @@ static inline void ata_qc_reinit(struct qc->nbytes = qc->curbytes =0 ; qc->n_elem =0 ; qc->err_mask =0 ; + qc->pad_len =0 ;ata_tf_init (qc->dev, &qc->tf);
_
Quoted 3 lines · Brian King
Some LLDDs, like ipr, use nbytes and
pad_lento determine the total data transfer length of a command. Make sure nbytes gets initialized for internally generated commands.
I think it's better to apply the following patch instead of this one.
http://article.gmane.org/gmane.linux.ide/14792
Signature · 1 line
tejun
Quoted 8 lines · Tejun Heo
Quoted 3 lines · Brian King
Some LLDDs, like ipr, use nbytes and
pad_lento determine the total data transfer length of a command. Make sure nbytes gets initialized for internally generated commands.I think it's better to apply the following patch instead of this one.
Works for me. I loaded that patch in place of this one and verified it solved my problem as well. I still need the other two patches in this series, however.
Thanks,
Brian
Signature · 3 lines
Brian King eServer Storage I/O IBM Linux Technology Center
Quoted 5 lines · Brian King
Quoted 4 lines · Tejun Heo
Quoted 3 lines · Brian King
Some LLDDs, like ipr, use nbytes and
pad_lento determine the total data transfer length of a command. Make sure nbytes gets initialized for internally generated commands.
Quoted 7 lines
Quoted 3 lines
I think it's better to apply the following patch instead of this one.
Works for me. I loaded that patch in place of this one and verified it solved my problem as well. I still need the other two patches in this series, however.
Jeff,
Do you plan to pull this patch series into upstream-fixes? Without these three patches (or 1 & 3 plus Tejun's patch referenced above), ipr SATA is broken in 2.6.20.
Thanks,
Brian
Signature · 3 lines
Brian King eServer Storage I/O IBM Linux Technology Center