Commit 08348b1c authored by Finn Thain's avatar Finn Thain Committed by Martin K. Petersen

scsi: ncr5380: Improve interrupt latency during PIO tranfers

Large PIO transfers are broken up into chunks to try to avoid disabling
local IRQs for long periods. But IRQs are still disabled for too long
and this causes SCC FIFO overruns during serial port transfers.

This patch reduces the PIO chunk size to reduce interrupt latency to
something on the order of milliseconds, at the expense of additional CPU
overhead from extra iterations of the NCR5380_main() loop.

That CPU overhead is a problem for slow machines (e.g. mac_scsi on 25
MHz 68030) but these machines generally use PDMA not PIO. This patch
doesn't make the overhead any worse on my Mac LC III (because it only
gets about 510 accesses per ms).

This patch decreases disk performance by a fraction of one percent for
dmx3191d on my 333 MHz PowerPC 750. Other affected hardware (such as
g_NCR5380 on x86) was not tested but 5380 ISA cards generally use PDMA
and not PIO.

[mkp: fix whitespace]
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Reviewed-by: default avatarLaurence Oberman <loberman@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e8f81420
...@@ -1847,11 +1847,11 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) ...@@ -1847,11 +1847,11 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
/* XXX - need to source or sink data here, as appropriate */ /* XXX - need to source or sink data here, as appropriate */
} }
} else { } else {
/* Break up transfer into 3 ms chunks, /* Transfer a small chunk so that the
* presuming 6 accesses per handshake. * irq mode lock is not held too long.
*/ */
transfersize = min((unsigned long)cmd->SCp.this_residual, transfersize = min(cmd->SCp.this_residual,
hostdata->accesses_per_ms / 2); NCR5380_PIO_CHUNK_SIZE);
len = transfersize; len = transfersize;
NCR5380_transfer_pio(instance, &phase, &len, NCR5380_transfer_pio(instance, &phase, &len,
(unsigned char **)&cmd->SCp.ptr); (unsigned char **)&cmd->SCp.ptr);
......
...@@ -250,6 +250,8 @@ struct NCR5380_cmd { ...@@ -250,6 +250,8 @@ struct NCR5380_cmd {
#define NCR5380_CMD_SIZE (sizeof(struct NCR5380_cmd)) #define NCR5380_CMD_SIZE (sizeof(struct NCR5380_cmd))
#define NCR5380_PIO_CHUNK_SIZE 256
static inline struct scsi_cmnd *NCR5380_to_scmd(struct NCR5380_cmd *ncmd_ptr) static inline struct scsi_cmnd *NCR5380_to_scmd(struct NCR5380_cmd *ncmd_ptr)
{ {
return ((struct scsi_cmnd *)ncmd_ptr) - 1; return ((struct scsi_cmnd *)ncmd_ptr) - 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment