On Wed, 13 Aug 2014, Michael Schmitz wrote:
For NCR5380_information_transfer() and PHASE_DATAIN, atari will use
PIO for transfersize <= 31 bytes whereas sun3 will use PIO for <= 128
bytes.
IIRC the ST-DMA can't be programmed for shorter transfers than 512
bytes. The condition
(transfersize = NCR5380_dma_xfer_len(instance,cmd,phase)) > 31)
enforces that - transfersize will be 0 on reads that are not multiples
of 512 bytes (and even some where the advertised transfer size does meet
that condition, but the command is not guranteed to be a block mode
command (tape reads).
I see.
However, atari never uses DMA here if cmd->device->borken.
Different semantics of borken, I presume. On Atari, this means a DMA
transfer has failed earlier.
Right. I suppose the question of using PIO in this situation on sun3 would
have to be put to the test.
When cmd->device->borken, I assume sun3_NCR5380 inhibits PIO because
PIO was itself expected to be problematic?
OTOH, if PIO works up to 128 bytes in all cases, why not larger
transfers?
Performance, perhaps.
Well, sun3_scsi has this:
static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted,
struct scsi_cmnd *cmd,
int write_flag)
{
if (cmd->request->cmd_type == REQ_TYPE_FS)
return wanted;
else
return 0;
}
This does suggest that PIO does work beyond 128 bytes, even if it is
avoided for filesystem requests. Which suggests that the atari reselect
code might work on sun3.
(As for performance, I don't know why the REQ_TYPE_FS is significant: why
not just raise the DMA size limit to 512 instead?)
PIO would work, but hog the CPU. In fact, PIO for everything _does_
work, on Falcon as well as Mac (I tried the PIO only mode on the Falcon
before trying on Mac). Did I eve mention how reallly incredibly
painfully slow that is?
Does the sun3_scsi driver still work after removing #define REAL_DMA?
For NCR5380_information_transfer() and PHASE_CMDOUT, the sun3 version
applies the same size limit but only does DMA setup if cmd type is
REQ_TYPE_FS (i.e. filesystem request). This command is then sent by
PIO, so the DMA setup here seems to assume that the next phase will
always be PHASE_DATAIN...
Might be a similar limitation to certain transfer sizes here. Block mode
vs. char mode.
That suggests that the test for REQ_TYPE_FS in
NCR5380_information_transfer() in sun3_NCR5380 could be improved upon by
using NCR5380_dma_xfer_len() when checking the size limit. That way it
would work on atari as well, without #ifdefs.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html