From: Sam Creasey <sammy@sammy.net>
To: Michael Schmitz <schmitzmic@gmail.com>
Cc: Sam Creasey <sammy@sammy.net>,
Finn Thain <fthain@telegraphics.com.au>,
Christoph Hellwig <hch@infradead.org>,
Michael Schmitz <schmitz@debian.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: Mon, 11 Aug 2014 11:10:45 -0400 [thread overview]
Message-ID: <20140811151045.GO21346@anhedonia> (raw)
In-Reply-To: <53E48E50.8010600@gmail.com>
On Fri, Aug 08, 2014 at 08:46:08PM +1200, Michael Schmitz wrote:
> Hi Sam,
> >>>atari_NCR5390.c does things a bit different - instead of peeking at the
> >>>message byte, NCR5380_transfer_pio() is used for the first message byte
> >>>(ACK set there, cleared manually later). NCR5380_transfer_pio() sets the
> >>>current phase, so the subsequent transfer of the tag message may work
> >>>there (again ACK raised in NCR5380_transfer_pio(), cleared manually
> >>>later).
> >>>
> >>Yes, but why the discrepancy?
> >>
> >>Not unlike the use of DMA in NCR5380_reselect(), the sun3 version of
> >>NCR5380_information_transfer() also uses DMA in one situation where the
> >>atari version uses PIO. That is, when phase == PHASE_DATA_IN &&
> >>cmd->device->borken.
> >>
> >>Can we just use the PIO code from atari_NCR5380, or should we keep the
> >>DMA versions with #ifdef CONFIG_SUN3? Sam?
> >>
> >
> >Oof, my memory is hazy around this one, but I would strongly hesitate
> >to use the PIO version from the atari driver. IIRC, the DMA
> >controller for the sun3's NCR5380 implementation is extremely fussy
> >about what happens in which phase, and it's quick to anger if you
> >don't handle everything exactly how it expects.
> >
>
> Does the DMA controller also sit in between the bus and the NCR chip, as
> on Falcon? Otherwise, I can't see how it would matter if we just bypass
> it and use PIO instead.
>
> The PIO code from the Atari driver worked just fine for the Mac 5380 (in
> fact, the first Mac driver used PIO for everything, including data in/out).
PIO definitely works on the Sun3 implementation under the right
circumstances, I ran it in PIO mode only for a while (much like the
Mac driver).
I can't remember the bus configuration offhand.
> >
> >>>From what I've checked both should work, but the sun3 code never sets
> >>>'phase' so it should never actually have worked. It should not even
> >>>compile.
> >>>
> >>I guess that's why sun3_scsi leaves SUPPORT_TAGS undefined. I suppose we
> >>can ignore all the code in sun3_NCR5380.c that is conditional upon #ifdef
> >>SUPPORT_TAGS. (That's actually how I did my preliminary merge patches.)
> >>
> >>I guess having two versions of the NCR5380_transfer_dma() routine is
> >>reasonable but it would be nice if some of the other discrepancies could
> >>be resolved. Without knowledge of the Sun 3 DMA hardware it is difficult
> >>to avoid some questionable #ifdefs.
> >>
> >
> >I definitely remember that the DMA setup logic from the atari version
> >did not work at all on sun3.
>
> No surprise there - DMA is implementation specific and needs to be
> handled on a per-case basis.
>
> > Unfortunatly working from 15 year old
> >memories, I can't quickly recall what the discrepencies were. I never
> >did find any documentation for that DMA chip, so there was a heck of a
> >lot of trial and error on getting to a working driver.
> >
>
> Do you still have the hardware to test (PIO in reselection, to be
> specific)?
Yes, I still have hardware. I'll try to dig something out and make
sure the last kernel I've actually tested still works before trying
anything new...
-- Sam
> Cheers,
>
> Michael
>
next prev parent reply other threads:[~2014-08-11 15:11 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 [this message]
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
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=20140811151045.GO21346@anhedonia \
--to=sammy@sammy.net \
--cc=fthain@telegraphics.com.au \
--cc=geert@linux-m68k.org \
--cc=hch@infradead.org \
--cc=linux-m68k@vger.kernel.org \
--cc=schmitz@debian.org \
--cc=schmitzmic@gmail.com \
/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