Skip to content

Commit

Permalink
Fix an existing bug for TIMER DMA phy mode
Browse files Browse the repository at this point in the history
The waiting for the last ACK to go low in `scsi_accel_dma.cpp:388`
timeout was too quick for an Adaptec AHA-2940AU. The timeout was based
on the iteration count through a tight loop. It has been switched
to a 500 millisecond timeout check.

Comments about right aligned vendor and product id SCSI strings
have been removed as they are misleading.
  • Loading branch information
morio committed Nov 13, 2023
1 parent 9e3bdc8 commit 7cbf0fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/ZuluSCSI_platform_GD32F205/scsi_accel_dma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,10 @@ extern "C" void SCSI_TIMER_DMACHB_IRQ()
else
{
// Wait for final ACK to go low, shouldn't take long.
int maxwait = 10000;
uint32_t start = millis();
while (TIMER_CNT(SCSI_TIMER) < 1)
{
if (maxwait-- < 0)
if ((uint32_t)(millis() - start) > 500)
{
logmsg("SCSI_TIMER_DMACHB_IRQ: timeout waiting for final ACK");
break;
Expand Down
3 changes: 1 addition & 2 deletions src/ZuluSCSI_disk.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ struct image_config_t: public S2S_TargetCfg
// Cue sheet file for CD-ROM images
FsFile cuesheetfile;

// Right-align vendor / product type strings (for Apple)
// Right-align vendor / product type strings
// Standard SCSI uses left alignment
// This field uses -1 for default when field is not set in .ini
int rightAlignStrings;

// Set Vendor / Product Id from image file name
Expand Down
2 changes: 1 addition & 1 deletion zuluscsi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#TypeModifier = 0 # Affects only INQUIRY response
#SectorsPerTrack = 63
#HeadsPerCylinder = 255
#RightAlignStrings = 0 # Right-align SCSI vendor / product strings, defaults on if Quirks = 1
#RightAlignStrings = 0 # Right-align SCSI vendor / product strings
#PrefetchBytes = 8192 # Maximum number of bytes to prefetch after a read request, 0 to disable
#ReinsertCDOnInquiry = 1 # Reinsert any ejected CD-ROM image on Inquiry command
#ReinsertAfterEject = 1 # Reinsert next CD image after eject, if multiple images configured.
Expand Down

0 comments on commit 7cbf0fe

Please sign in to comment.