Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Michael Schmitz <schmitzmic@gmail.com>,
	scsi <linux-scsi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable <stable@vger.kernel.org>,
	linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [PATCH 5/7] scsi: mac_scsi: Fix pseudo DMA implementation, take 2
Date: Mon, 3 Jun 2019 09:32:36 +1000 (AEST)	[thread overview]
Message-ID: <alpine.LNX.2.21.1906030903510.20@nippy.intranet> (raw)
In-Reply-To: <CAMuHMdWxRtJU2aRQQjXzR2mvpfpDezCVu42Eo1eXDsQaPb+j6Q@mail.gmail.com>

On Sun, 2 Jun 2019, Geert Uytterhoeven wrote:

> Hi Finn,
> 
> On Sun, Jun 2, 2019 at 3:29 AM Finn Thain <fthain@telegraphics.com.au> 
> wrote:
> > A system bus error during a PDMA transfer can mess up the calculation 
> > of the transfer residual (the PDMA handshaking hardware lacks a byte 
> > counter). This results in data corruption.
> >
> > The algorithm in this patch anticipates a bus error by starting each 
> > transfer with a MOVE.B instruction. If a bus error is caught the 
> > transfer will be retried. If a bus error is caught later in the 
> > transfer (for a MOVE.W instruction) the transfer gets failed and 
> > subsequent requests for that target will use PIO instead of PDMA.
> >
> > This avoids the "!REQ and !ACK" error so the severity level of that 
> > message is reduced to KERN_DEBUG.
> >
> > Cc: Michael Schmitz <schmitzmic@gmail.com>
> > Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> > Cc: stable@vger.kernel.org # v4.14+
> > Fixes: 3a0f64bfa907 ("mac_scsi: Fix pseudo DMA implementation")
> > Reported-by: Chris Jones <chris@martin-jones.com>
> > Tested-by: Stan Johnson <userm57@yahoo.com>
> > Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> 
> Thanks for your patch!
> 
> > ---
> >  arch/m68k/include/asm/mac_pdma.h | 179 +++++++++++++++++++++++++++
> >  drivers/scsi/mac_scsi.c          | 201 ++++++++-----------------------
> 
> Why have you moved the PDMA implementation to a header file under 
> arch/m68k/? Do you intend to reuse it by other drivers?
> 

There are a couple of reasons: the mac_esp driver also uses PDMA and the 
NuBus PowerMac port also uses mac_scsi.c. OTOH, the NuBus PowerMac port is 
still out-of-tree, and it is unclear whether the mac_esp driver will ever 
benefit from this code.

> If not, please keep it in the driver, so (a) you don't need an ack from 
> me ;-), and (b) your change may be easier to review.
> 

I take your wink to mean that you don't want to ask the SCSI maintainers 
to review m68k asm. Putting aside the code review process for a moment, do 
you have an opinion on the most logical way to organise this sort of code, 
from the point-of-view of maintainability, re-usability, readability etc.?

Thanks.

-- 

> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> 

  reply	other threads:[~2019-06-02 23:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-02  1:24 [PATCH 0/7] NCR5380 drivers: fixes and improvements Finn Thain
2019-06-02  1:24 ` [PATCH 1/7] Revert "scsi: ncr5380: Increase register polling limit" Finn Thain
2019-06-02  1:24 ` [PATCH 5/7] scsi: mac_scsi: Fix pseudo DMA implementation, take 2 Finn Thain
2019-06-02  9:07   ` Geert Uytterhoeven
2019-06-02 23:32     ` Finn Thain [this message]
2019-06-03  6:23       ` Geert Uytterhoeven
2019-06-03  7:40         ` Finn Thain
2019-06-03  7:53           ` Geert Uytterhoeven
2019-06-03 21:25           ` Michael Schmitz
2019-06-04  0:05             ` Finn Thain
2019-06-02  1:24 ` [PATCH 6/7] scsi: mac_scsi: Enable PDMA on Mac IIfx Finn Thain
2019-06-02  9:04   ` Geert Uytterhoeven
2019-06-02  1:24 ` [PATCH 3/7] scsi: NCR5380: Handle PDMA failure reliably Finn Thain
2019-06-02  1:24 ` [PATCH 4/7] scsi: mac_scsi: Increase PIO/PDMA transfer length threshold Finn Thain
2019-06-02  1:24 ` [PATCH 7/7] scsi: mac_scsi: Treat Last Byte Sent time-out as failure Finn Thain
2019-06-02  1:24 ` [PATCH 2/7] scsi: NCR5380: Always re-enable reselection interrupt Finn Thain

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=alpine.LNX.2.21.1906030903510.20@nippy.intranet \
    --to=fthain@telegraphics.com.au \
    --cc=geert@linux-m68k.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=schmitzmic@gmail.com \
    --cc=stable@vger.kernel.org \
    /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