public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Finn Thain <fthain@telegraphics.com.au>
Cc: Sam Creasey <sammy@sammy.net>,
	Christoph Hellwig <hch@infradead.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linux/m68k <linux-m68k@vger.kernel.org>
Subject: Re: Sun3 SCSI DMA, was Re: converting the NCR5380 drivers away from scsi_register
Date: Thu, 14 Aug 2014 20:57:47 +1200	[thread overview]
Message-ID: <53EC7A0B.4080807@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1408141114530.26526@nippy.intranet>

Hi Finn,
>>> 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.
>   

Yep - let's see whether Sam has a working test configuration with 
current kernels.

>   
>>> When cmd->device->borken, I assume sun3_NCR5380 inhibits PIO because 
>>> PIO was itself expected to be problematic?
>>>       

The sun3 driver does set the borken flag but never uses it later - can't 
see where it will inhibit PIO.

>>> 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?)
>   

No idea really - the sun3 DMA allows to read the correct residual so it 
probably is not necessary to strictly avoid DMA on anything not 
guaranteed to transfer the requested size.  Not sure what commands will 
transfer between 128 and 512 bytes ...

>   
>> 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.
>>     

Commands need to be sent by PIO always because of the DMA size limit. 
The DMA setup early on may save time if the next phase is indeed DATAIN 
or DATAOUT - if a command disconnects the DMA just won't be started. I 
would have thought the DMA setup could just as easily be done inside 
NCR5380_transfer_dma instead of splitting it in DMA setup and DMA start 
- any particular reason for this, Sammy?

> 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.
>   

The test for REQ_TYPE_FS could be done in the specific dma_xfer_len() 
function which would need to be used whenever DMA setup is going to be 
used. As it is, the separation of DMA setup from NCR5380_transfer_dma is 
a bit mysterious and makes it hard to merge the drivers without lots of 
ifdefs or runtime tests (think multiplatform kernels) anyway.

Cheers,

    Michael

  reply	other threads:[~2014-08-14  8:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 14:18 converting the NCR5380 drivers away from scsi_register Christoph Hellwig
2014-06-17  8:20 ` Finn Thain
2014-06-17  8:38   ` Geert Uytterhoeven
2014-07-30  8:32     ` Finn Thain
2014-07-31  5:31       ` Michael Schmitz
2014-08-01  3:13         ` Finn Thain
2014-08-01  8:15           ` Michael Schmitz
2014-08-02  1:27             ` Finn Thain
2014-08-02  8:51               ` Michael Schmitz
2014-08-03  3:43                 ` Finn Thain
2014-08-03  9:07                   ` Michael Schmitz
2014-08-04  3:28                     ` Finn Thain
2014-08-05  9:06                       ` Michael Schmitz
2014-08-06  1:25                         ` Sun3 SCSI DMA, was " Finn Thain
2014-08-06 14:42                           ` Sam Creasey
2014-08-08  8:46                             ` Michael Schmitz
2014-08-11 15:10                               ` Sam Creasey
2014-08-13  5:29                                 ` Finn Thain
2014-08-13  9:14                                   ` Michael Schmitz
2014-08-14  1:43                                     ` Finn Thain
2014-08-14  8:57                                       ` Michael Schmitz [this message]
2014-08-15  1:46                                         ` Finn Thain
2014-08-15  1:51                                           ` Michael Schmitz
2014-08-15  2:09                                         ` Finn Thain
2014-08-15  3:03                                           ` Michael Schmitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53EC7A0B.4080807@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=fthain@telegraphics.com.au \
    --cc=geert@linux-m68k.org \
    --cc=hch@infradead.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=sammy@sammy.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox