Here are two simple fixes for the SCSI driver, so that the LSI adapter is able to boot FreeDOS.
Paolo Bonzini (2): lsi: do not reset on error scsi: fix detection of QEMU
src/blockcmd.c | 2 +- src/lsi-scsi.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
Resetting on any error (including for example a disconnected device) will cause a unit attention condition on all devices. So if we cannot probe for example target 6, the first read on target 0 will fail.
Reported-by: Frediano Ziglio freddy77@gmail.com Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/lsi-scsi.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/src/lsi-scsi.c b/src/lsi-scsi.c index 949d3f4..b70b3a5 100644 --- a/src/lsi-scsi.c +++ b/src/lsi-scsi.c @@ -115,8 +115,6 @@ lsi_scsi_cmd(struct lsi_lun_s *llun, struct disk_op_s *op, }
fail: - // sledge hammer to get back into a known-good state: hba reset - outb(LSI_ISTAT0_SRST, iobase + LSI_REG_ISTAT0); return DISK_RET_EBADTRACK; }
The vendor string is null-terminated by the time scsi_init_drive looks at it, so it is incorrect to pad the memcmp argument with spaces. Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/blockcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/blockcmd.c b/src/blockcmd.c index 95406c6..4365650 100644 --- a/src/blockcmd.c +++ b/src/blockcmd.c @@ -158,7 +158,7 @@ scsi_init_drive(struct drive_s *drive, const char *s, int prio) // but some old USB keys only support a very small subset of SCSI which // does not even include the MODE SENSE command! // - if (! CONFIG_COREBOOT && memcmp(vendor, "QEMU ", 8) == 0) { + if (! CONFIG_COREBOOT && memcmp(vendor, "QEMU", 5) == 0) { struct cdbres_mode_sense_geom geomdata; ret = cdb_mode_sense_geom(&dop, &geomdata); if (ret == 0) {
On Thu, Aug 02, 2012 at 06:22:42PM +0200, Paolo Bonzini wrote:
Here are two simple fixes for the SCSI driver, so that the LSI adapter is able to boot FreeDOS.
Thanks - I committed this series.
-Kevin