Re: [PATCH 01/10] gdth: refactor ioc_general

2018-12-06 Thread Finn Thain
On Thu, 6 Dec 2018, Christoph Hellwig wrote: > This function is a huge mess with duplicated error handling. Split out > a few useful helpers and use goto labels to untangle the error handling > and no-data ioctl handling. > > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/gdth.c |

Re: DISABLE_CLUSTERING in scsi drivers

2018-12-03 Thread Finn Thain
On Mon, 3 Dec 2018, Hannes Reinecke wrote: > As I said: I need to do PIO for the last two bytes of the data buffer. > For everything else DMA works nicely, it's just the last two bytes which > might be left over in the FIFO buffer under certain circumstances. I read the driver a few times

Re: DISABLE_CLUSTERING in scsi drivers

2018-12-02 Thread Finn Thain
On Sun, 2 Dec 2018, Hannes Reinecke wrote: > On 12/2/18 10:21 PM, Finn Thain wrote: > > On Sun, 2 Dec 2018, Hannes Reinecke wrote: > > > > > Well, that lone 'kmap' is due to a quirk/errata in the datasheet; > > > essentially > > > we have to PIO

Re: DISABLE_CLUSTERING in scsi drivers

2018-12-02 Thread Finn Thain
On Sun, 2 Dec 2018, Hannes Reinecke wrote: > Well, that lone 'kmap' is due to a quirk/errata in the datasheet; essentially > we have to PIO a lone byte out of the FIFO to clear it up. > And this byte is technically still part of the SCSI data, so we need to > stuff it onto the end of the actual

Re: DISABLE_CLUSTERING in scsi drivers

2018-11-26 Thread Finn Thain
On Mon, 26 Nov 2018, Christoph Hellwig wrote: > On Thu, Nov 22, 2018 at 09:02:13AM +1100, Finn Thain wrote: > > > you in the To list maintain or wrote SCSI drivers that set the > > > DISABLE_CLUSTERING flag, which basically disable merges of any > > > bio segment

Re: DISABLE_CLUSTERING in scsi drivers

2018-11-21 Thread Finn Thain
On Wed, 21 Nov 2018, Christoph Hellwig wrote: > Hi all, > > you in the To list maintain or wrote SCSI drivers that set the > DISABLE_CLUSTERING flag, which basically disable merges of any > bio segments. We already have the actual max_segment size limit > to say which length a segment should

Re: [PATCH 1/4] gdth: refactor ioc_general

2018-10-18 Thread Finn Thain
On Thu, 18 Oct 2018, Christoph Hellwig wrote: > + > +static int ioc_general(void __user *arg, char *cmnd) > +{ > + gdth_ioctl_general gen; > + gdth_ha_str *ha; > + char *buf = NULL; > + u64 paddr; > + int rval; > + > + if (copy_from_user(, arg, sizeof(gdth_ioctl_general)))

Re: [PATCH 4/4] gdth: use generic DMA API

2018-10-18 Thread Finn Thain
On Thu, 18 Oct 2018, Christoph Hellwig wrote: > Switch from the legacy PCI DMA API to the generic DMA API. Also switch > to dma_map_single from pci_map_page in one case where this makes the code > simpler. > > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/gdth.c | 111

Re: [PATCH 2/4] gdth: reuse dma coherent allocation in gdth_show_info

2018-10-18 Thread Finn Thain
On Thu, 18 Oct 2018, Christoph Hellwig wrote: > gdth_show_info currently allocs and frees a dma buffer four times, > which isn't very efficient. Reuse a single allocation instead. > > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/gdth_proc.c | 18 +- > 1 file changed, 5

Re: various esp_scsi cleanups V3

2018-10-13 Thread Finn Thain
e the pointless union in struct esp_cmd_priv > > Changes since v1: > - fix a sun_esp compiler failure in an intermediate patch > - drop the dev argument to scsi_esp_register > Tested-by: Finn Thain Thanks. --

Re: [PATCH 5/5] esp_scsi: move dma mapping into the core code

2018-10-13 Thread Finn Thain
On Sat, 13 Oct 2018, Christoph Hellwig wrote: > On Sat, Oct 13, 2018 at 09:24:51AM +1100, Finn Thain wrote: > > > struct scatterlist *sg = scsi_sglist(cmd); > > > - int dir = cmd->sc_data_direction; > > > - int total, i; > > > + int total =

Re: [PATCH 3/5] esp_scsi: use strong typing for the dev field

2018-10-12 Thread Finn Thain
> On Fri, 12 Oct 2018, Christoph Hellwig wrote: > > > > > > diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c > > > index eb551f3cc471..85d067889a9b 100644 > > > --- a/drivers/scsi/mac_esp.c > > > +++ b/drivers/scsi/mac_esp.c > > > @@ -58,8 +58,7 @@ static struct esp *esp_chips[2]; >

Re: [PATCH 5/5] esp_scsi: move dma mapping into the core code

2018-10-12 Thread Finn Thain
On Thu, 11 Oct 2018, Christoph Hellwig wrote: > diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c > index 90604bff8dd2..73fcbd65b9fe 100644 > --- a/drivers/scsi/esp_scsi.c > +++ b/drivers/scsi/esp_scsi.c > @@ -369,19 +369,25 @@ static void esp_map_dma(struct esp *esp, struct >

Re: [PATCH 3/5] esp_scsi: use strong typing for the dev field

2018-10-11 Thread Finn Thain
On Thu, 11 Oct 2018, Christoph Hellwig wrote: > esp->dev is a void pointer that points either to a struct device, or a > struct platform_device. As we can easily get from the device to the > platform_device if needed change it to always point to a struct device > and properly type the pointer to

Re: [PATCH 5/5] esp_scsi: move dma mapping into the core code

2018-10-11 Thread Finn Thain
On Thu, 11 Oct 2018, Christoph Hellwig wrote: > index 90604bff8dd2..73fcbd65b9fe 100644 > --- a/drivers/scsi/esp_scsi.c > +++ b/drivers/scsi/esp_scsi.c > @@ -369,19 +369,25 @@ static void esp_map_dma(struct esp *esp, struct > scsi_cmnd *cmd) > { > struct esp_cmd_priv *spriv =

Re: [PATCH 3/4] esp_scsi: use strong typing for the dev field

2018-10-10 Thread Finn Thain
On Wed, 10 Oct 2018, Christoph Hellwig wrote: > esp->dev is a void pointer that points either to a struct device, or a > struct platform_device. As we can easily get from the device to the > platform_device if needed change it to always point to a struct device > and properly type the pointer to

Re: [PATCH 06/40] proc: introduce proc_create_single{,_data}

2018-04-25 Thread Finn Thain
On Wed, 25 Apr 2018, Christoph Hellwig wrote: > > -/* > - * /proc/nubus stuff > - */ > - I don't think that the introduction of proc_create_single{,_data} alters the value of that comment. That comment and similar comments in the same file do have a purpose, which is to keep separate the

Re: [VERY EARLY RFC 08/13] treewide: use set_host_byte

2018-04-18 Thread Finn Thain
On Wed, 18 Apr 2018, Johannes Thumshirn wrote: > diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c > index d670cfe4d0e7..a0b79899bce3 100644 > --- a/drivers/scsi/NCR5380.c > +++ b/drivers/scsi/NCR5380.c > @@ -548,7 +548,8 @@ static int NCR5380_queue_command(struct Scsi_Host >

Re: [VERY EARLY RFC 01/13] scsi: use host_byte() accessor

2018-04-18 Thread Finn Thain
On Wed, 18 Apr 2018, Johannes Thumshirn wrote: > --- a/drivers/scsi/dc395x.c > +++ b/drivers/scsi/dc395x.c > @@ -3473,7 +3473,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct > DeviceCtlBlk *dcb, > > /*if( srb->cmd->cmnd[0] == INQUIRY && */ > /* (host_byte(cmd->result)

Re: [PATCH v6] scsi: new zorro_esp.c for Amiga Zorro NCR53C9x boards

2018-04-06 Thread Finn Thain
On Sat, 7 Apr 2018, Michael Schmitz wrote: > Changes since v5: > > Christoph Hellwig: > > - fix comment style > - drop initialization to zero in driver data init > - fix alignment in struct declarations > - drop braces around asm macros > - change board_base type to void __iomem * > - drop

Re: [PATCH v5] scsi: new zorro_esp.c for Amiga Zorro NCR53C9x boards

2018-04-03 Thread Finn Thain
On Tue, 3 Apr 2018, Christoph Hellwig wrote: > > +static void zorro_esp_send_pio_cmd(struct esp *esp, u32 addr, u32 > > esp_count, > > +u32 dma_count, int write, u8 cmd) > > +{ > > + struct zorro_esp_priv *zep = dev_get_drvdata(esp->dev); > > + u8 __iomem *fifo =

Re: [PATCH v5] scsi: new zorro_esp.c for Amiga Zorro NCR53C9x boards

2018-04-03 Thread Finn Thain
On Tue, 3 Apr 2018, Christoph Hellwig wrote: > > > + > > + if (zep->zorro3) { > > + /* Only Fastlane Z3 for now - add switch for correct struct > > +* dma_registers size if adding any more > > +*/ > > + esp->dma_regs = ioremap_nocache(dmaaddr, > > +

Re: [PATCH v3] m68k/amiga - Amiga Zorro NCR53C9x boards: new zorro_esp.c

2018-03-16 Thread Finn Thain
On Fri, 16 Mar 2018, Michael Schmitz wrote: > Hi Finn, Geert, > > In the interest of making minimal changes between the Mac and Amiga > versions, I'd leave the macros as they are, and add a comment to the > macro definitions stating that both addr and fifo are local-scope > variables in the

Re: [PATCH v3] m68k/amiga - Amiga Zorro NCR53C9x boards: new zorro_esp.c

2018-03-15 Thread Finn Thain
On Wed, 14 Mar 2018, Michael Schmitz wrote: > > > > Please pass "addr" and "fifo" as macro parameters, too, so it's easier > > for the reviewer to notice they are used. > > Yes, I can do that (meaning Finn would need to make the same change to > keep our versions in sync). Personally, I

Re: [PATCH v3] m68k/amiga - Amiga Zorro NCR53C9x boards: new zorro_esp.c

2018-03-14 Thread Finn Thain
> > I forgot to add your Reviewed-by tag - will do that for the next > version, OK? Sure. Geert's tag may be harder to bag though :-) --

Re: [PATCH v3] m68k/amiga - Amiga Zorro NCR53C9x boards: new zorro_esp.c

2018-03-12 Thread Finn Thain
013 Tuomas Vainikka (tuomas.vaini...@aalto.fi) for > + * Blizzard 1230 DMA and probe function fixes > + * > + * Copyright (C) 2017 Finn Thain for PIO code from Mac ESP driver adapted > here > + */ > +/* > + * ZORRO bus code from: > + */ > +/* > + * De

[PATCH] scsi: jazz_esp, sun3x_esp: Pass struct device pointer in dma calls

2018-03-06 Thread Finn Thain
In jazz_esp and sun3x_esp, the esp_driver_ops methods pass esp->dev in dma api calls as if it was a pointer to a struct device. But it actually points to a struct platform_device. Fix this. Cc: Thomas Bogendoerfer <tsbog...@alpha.franken.de> Signed-off-by: Finn Thain <fth...@telegra

Re: [PATCH 2/2] m68k/amiga - Zorro ESP: new zorro_esp.c

2018-03-06 Thread Finn Thain
On Wed, 7 Mar 2018, Michael Schmitz wrote: > The major obstacle now seems to be dynamic allocation of the driver > private data and storing a pointer to that in a way that it can be > retrieved using just the esp pointer. dev_set_drvdata(esp->dev, zep) > causes the module load to crash ...

Re: [PATCH 2/2] m68k/amiga - Zorro ESP: new zorro_esp.c

2018-03-06 Thread Finn Thain
On Tue, 6 Mar 2018, Michael Schmitz wrote: > The whole !write branch will never be executed, and I could just omit it > entirely for now, or leave it as it was in the Mac driver. > We could make use of the !write branch in zorro_esp, even if it was only to figure out the SELAS/MSG OUT issue

Re: [PATCH 2/2] m68k/amiga - Zorro ESP: new zorro_esp.c

2018-03-05 Thread Finn Thain
On Tue, 6 Mar 2018, Michael Schmitz wrote: > >> +static void zorro_esp_send_pio_cmd(struct esp *esp, u32 addr, u32 > >> esp_count, > >> +u32 dma_count, int write, u8 cmd) > >> +{ > >> + struct zorro_esp_priv *zep = ZORRO_ESP_GET_PRIV(esp); > >> + u8

Re: [PATCH 2/2] m68k/amiga - Zorro ESP: new zorro_esp.c

2018-03-04 Thread Finn Thain
On Mon, 5 Mar 2018, Michael Schmitz wrote: > All Zorro-3 boards have to have both their regs and dma_regs remapped. > I see. > What's confusing is that there is only a single Zorro-3 board currently > supported by the driver. Others will be added and I"ll use a switch > statement to pick the

Re: [PATCH 2/2] m68k/amiga - Zorro ESP: new zorro_esp.c

2018-03-04 Thread Finn Thain
On Mon, 5 Mar 2018, Michael Schmitz wrote: > > The TCQ issue showed up on the AV Quadras becasue mac_esp doesn't know > > how to do PDMA or DMA on that hardware, and so it always uses PIO. It > > sounds like this bug would show up too given the right kind of target. > > If so, I will need to

Re: [PATCH 2/2] m68k/amiga - Zorro ESP: new zorro_esp.c

2018-03-04 Thread Finn Thain
On Mon, 5 Mar 2018, Michael Schmitz wrote: > >> +fail_unmap_dma_regs: > >> + if (ioaddr > 0xff) > >> + iounmap(esp->dma_regs); > > > > I think you need to test for ZORRO_PROD_PHASE5_BLIZZARD_1230_IV_1260 here? > > On second thought - no, I don't. the ID check above only

Re: [PATCH 2/2] m68k/amiga - Zorro ESP: new zorro_esp.c

2018-03-04 Thread Finn Thain
On Sun, 4 Mar 2018, Michael Schmitz wrote: > Am 04.03.2018 um 15:55 schrieb Finn Thain: > >> +/* zorro_esp.c: ESP front-end for Amiga ZORRO SCSI systems. > >> + * > >> + * Copyright (C) 1996 Jesper Skov (js...@cygnus.co.uk) > >> + * > >> +

Re: [PATCH 2/2] m68k/amiga - Zorro ESP: new zorro_esp.c

2018-03-03 Thread Finn Thain
On Sun, 4 Mar 2018, I wrote: > > + } else { > > + scsi_esp_cmd(esp, ESP_CMD_FLUSH); > > + > > + if (esp_count >= ZORRO_ESP_FIFO_SIZE) { > > + ZORRO_ESP_PIO_FILL("%0@+,%2@", esp_count); > > + } else { > > +

Re: [PATCH 2/2] m68k/amiga - Zorro ESP: new zorro_esp.c

2018-03-03 Thread Finn Thain
one. > Code largely based on board specific parts of the old drivers (blz1230.c, > blz2060.c, cyberstorm.c, cyberstormII.c, fastlane.c which were removed > after the 2.6 kernel series for lack of maintenance) with contributions > by Tuomas Vainikka (TCQ bug tests and workaround) an

Re: [4.4-stable 08/22] ncr5380: shut up gcc indentation warning

2018-02-20 Thread Finn Thain
in mainline kernels as part of a rework on commit > 12150797d064 ("ncr5380: Use runtime register mapping"). Acked-by: Finn Thain <fth...@telegraphics.com.au> > We don't want the entire patch backported to stable kernels, but we can > backport one hunk to get r

Re: [PATCH] [RESEND] scsi: ips: fix firmware timestamps for 32-bit

2018-01-18 Thread Finn Thain
On Wed, 17 Jan 2018, Arnd Bergmann wrote: > do_gettimeofday() is deprecated since it will stop working in 2038 on > 32-bit platforms. The firmware interface here actually supports times > until year 25500, so we should use longer timestamps. > I think that reasoning is flawed. If the firmware

Re: [PATCH] scsi: remove extra white space at the end of the line

2017-12-23 Thread Finn Thain
Hi Bart, On Thu, 21 Dec 2017, Bart Van Assche wrote: > There are several reasons why most kernel maintainers ignore patches > like this one silently: > I don't disagree with your conclusion but I think that these objections may have solutions, at least in principle. Your message prompted me

Re: [PATCH] NCR5380: Fix a possible sleep-in-atomic bug in NCR5380_poll_politely2

2017-12-11 Thread Finn Thain
On Tue, 12 Dec 2017, Jia-Ju Bai wrote: > From: Jia-Ju Bai > > The kernel module may sleep under a spinlock. The spinlock is always taken in irq mode, and the schedule_timeout_uninterruptible() is conditional on !irqs_disabled(). > The function call paths are: >

Re: [PATCH] scsi: fix race condition when removing target

2017-11-30 Thread Finn Thain
On Thu, 30 Nov 2017, James Bottomley wrote: > +#define __sdev_for_each_get(sdev, head, list) > \ > + list_for_each_entry(sdev, head, list) \ > + if (kobject_get_unless_zero(>sdev_gendev.kobj)) > + I think that should have

scsi/NCR5380: Suppress SDTR and WDTR message logging

2017-10-25 Thread Finn Thain
to scmd_printk(). Tested-by: Stan Johnson <user...@yahoo.com> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index acc33440bca0..3cf16bca0dc6 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -1907,8 +1907,6 @@

Re: [PATCH] scsi: ncr5380: constify pnp_device_id

2017-08-16 Thread Finn Thain
@gmail.com> Acked-by: Finn Thain <fth...@telegraphics.com.au> > --- > drivers/scsi/g_NCR5380.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c > index c34fc91..1968d81 100644 > --- a/drivers/s

[PATCH 3/5] scsi/esp_scsi: Clean up control flow and dead code

2017-08-03 Thread Finn Thain
eanup also eliminates a warning from "make W=1": drivers/scsi/esp_scsi.c: In function 'esp_finish_select': drivers/scsi/esp_scsi.c:1233:5: warning: variable 'orig_select_state' set but not used [-Wunused-but-set-variable] u8 orig_select_state; Tested-by: Stan Johnson <user...@yahoo.com>

[PATCH 4/5] scsi/esp_scsi: Avoid sending ABORT TASK SET messages

2017-08-03 Thread Finn Thain
resolves this issue because the bus reset causes the INQUIRY command to fail earlier, and return the appropriate result code. Tested-by: Stan Johnson <user...@yahoo.com> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/esp_scsi.c | 11 +++ 1 file changed,

[PATCH 5/5] scsi/esp_scsi: Always clear msg_out_len after MESSAGE OUT phase

2017-08-03 Thread Finn Thain
After sending a message, always clear esp->msg_out_len. Otherwise, eh_abort_handler may subsequently fail to send an ABORT TASK SET message. Tested-by: Stan Johnson <user...@yahoo.com> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/esp_scsi.c | 2 ++ 1

[PATCH 1/5] scsi/mac_esp: Avoid type warning from sparse

2017-08-03 Thread Finn Thain
got void [noderef] * Tested-by: Stan Johnson <user...@yahoo.com> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/mac_esp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c index cdb61eaa2d1

[PATCH 2/5] scsi/mac_esp: Fix PIO transfers for MESSAGE IN phase

2017-08-03 Thread Finn Thain
patch also improves on the weak tests for unexpected interrupts and phase changes during PIO transfers. Tested-by: Stan Johnson <user...@yahoo.com> Fixes: 02507a80b35e ("[PATCH] [SCSI] mac_esp: fix PIO mode, take 2") Signed-off-by: Finn Thain <fth...@telegraphics.com.au>

[PATCH 0/5] esp_scsi, mac_esp: Various fixes and cleanups

2017-08-03 Thread Finn Thain
This series has been tested on m68k Macs (ESP236 equivalent). Some more testing with different targets and devices (FAS236 etc) might be nice. Being that the esp_scsi fixes are on error paths, more review may actually be more valuable than more testing... Finn Thain (5): scsi/mac_esp: Avoid

Re: [PATCH v7 0/6] g_NCR5380: PDMA fixes and cleanup

2017-07-04 Thread Finn Thain
On Tue, 4 Jul 2017, Ondrej Zary wrote: > > Everything works fine! No corruption, no hangs, rescan-scsi-bus works. > > Tested cards: > Canon FG2-5202 (53C400 chip, MMIO) > DTC-3181L (DTCT-436P chip, PIO) > HP C2502 (53C400A chip, PIO) > > Tested devices: > QUANTUM LP240S GM240S01X 4.6 > IBM

[PATCH v7 3/6] g_NCR5380: Cleanup comments and whitespace

2017-07-03 Thread Finn Thain
Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 61 ++-- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 911a4300ea51..dedaed2d16e4

[PATCH v7 5/6] g_NCR5380: Re-work PDMA loops

2017-07-03 Thread Finn Thain
ed-off-by: Ondrej Zary <li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 183 ++- 1 file changed, 102 insertions(+), 81 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/driv

Re: [PATCH v6 0/6] g_NCR5380: PDMA fixes and cleanup

2017-07-03 Thread Finn Thain
On Sun, 2 Jul 2017, Ondrej Zary wrote: > On Sunday 02 July 2017 05:11:27 Finn Thain wrote: > > On Sat, 1 Jul 2017, Ondrej Zary wrote: > > > The write corruption is still present - "start" must be rolled back > > > in both IRQ and timeout cases. > > >

[PATCH v7 6/6] g_NCR5380: Two DTC436 PDMA workarounds

2017-07-03 Thread Finn Thain
r what causes this. Documentation for the DTC436 chip has not been made available. Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi

[PATCH v7 1/6] g_NCR5380: Fix PDMA transfer size

2017-07-03 Thread Finn Thain
t;li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 67c8dac321ad..14ef4e8c4713 100644 --- a/driver

[PATCH v7 0/6] g_NCR5380: PDMA fixes and cleanup

2017-07-03 Thread Finn Thain
the residual value when it is known to be zero. Finn Thain (2): g_NCR5380: Cleanup comments and whitespace g_NCR5380: Use unambiguous terminology for PDMA send and receive Ondrej Zary (4): g_NCR5380: Fix PDMA transfer size g_NCR5380: End PDMA transfer correctly on target disconnection

[PATCH v7 2/6] g_NCR5380: End PDMA transfer correctly on target disconnection

2017-07-03 Thread Finn Thain
; Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 14ef4e8c4713..911a4300ea51 10

[PATCH v7 4/6] g_NCR5380: Use unambiguous terminology for PDMA send and receive

2017-07-03 Thread Finn Thain
The word "read" may be used to mean "DMA read operation" or "SCSI READ command", though a READ command implies writing to memory. Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 14 +++--- 1 file changed, 7 inser

Re: [PATCH v6 0/6] g_NCR5380: PDMA fixes and cleanup

2017-07-01 Thread Finn Thain
On Sat, 1 Jul 2017, Ondrej Zary wrote: > > The write corruption is still present - "start" must be rolled back in > both IRQ and timeout cases. Your original algorithm aborts the transfer for a timeout. Same with mine. The bug must be a elsewhere. > And 128 B is not enough , 256 is OK (why

[PATCH v6 0/6] g_NCR5380: PDMA fixes and cleanup

2017-06-30 Thread Finn Thain
for on-chip buffer swap. - Attempt to retain the disconnect/IRQ detection in the DTC436 workaround. - Move all DTC436 workarounds to final patch. Finn Thain (2): g_NCR5380: Cleanup comments and whitespace g_NCR5380: Use unambiguous terminology for PDMA send and receive Ondrej Zary (4

[PATCH v6 6/6] g_NCR5380: Various DTC436 workarounds

2017-06-30 Thread Finn Thain
r what causes this. Documentation for the DTC436 chip has not been made available. On DTC chips, Gated IRQ (for End of DMA) arrives early, and needs special handling. Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 39 +++

[PATCH v6 1/6] g_NCR5380: Fix PDMA transfer size

2017-06-30 Thread Finn Thain
t;li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 67c8dac321ad..14ef4e8c4713 100644 --- a/driver

[PATCH v6 2/6] g_NCR5380: End PDMA transfer correctly on target disconnection

2017-06-30 Thread Finn Thain
; Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 14ef4e8c4713..911a4300ea51 10

[PATCH v6 5/6] g_NCR5380: Re-work PDMA loops

2017-06-30 Thread Finn Thain
ed-off-by: Ondrej Zary <li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 173 +-- 1 file changed, 92 insertions(+), 81 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/driver

[PATCH v6 4/6] g_NCR5380: Use unambiguous terminology for PDMA send and receive

2017-06-30 Thread Finn Thain
The word "read" may be used to mean "DMA read operation" or "SCSI READ command", though a READ command implies writing to memory. Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 14 +++--- 1 file changed, 7 inser

[PATCH v6 3/6] g_NCR5380: Cleanup comments and whitespace

2017-06-30 Thread Finn Thain
Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 61 ++-- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 911a4300ea51..dedaed2d16e4

Re: [PATCH v5 0/6] g_NCR5380: PDMA fixes and cleanup

2017-06-30 Thread Finn Thain
On Fri, 30 Jun 2017, Ondrej Zary wrote: > > > No more log spamming on DTC but reads are corrupted even more than > > > before. The IRQ check after data transfer increases the chance of > > > catching an IRQ before the buffer could become ready. > > > > If we delay the IRQ check, that just means

Re: [PATCH v5 0/6] g_NCR5380: PDMA fixes and cleanup

2017-06-30 Thread Finn Thain
On Thu, 29 Jun 2017, Ondrej Zary wrote: > The write corruption is still there. I'm afraid it can't be fixed > without rolling "start" back (or inceasing residual) if an error > occured, something like this: > > --- a/drivers/scsi/g_NCR5380.c > +++ b/drivers/scsi/g_NCR5380.c > @@ -619,6 +621,9

Re: [PATCH v4 0/5] g_NCR5380: PDMA fixes and cleanup

2017-06-28 Thread Finn Thain
On Wed, 28 Jun 2017, Ondrej Zary wrote: > > Now read seems to work on non-DTC chips. Writes continue in PDMA after > disconnect but there's a corruption - one 128 B block missing on > disconnect. > > On DTC, the log is spammed with errors like this: > sd 2:0:1:0: [sdb] tag#0

[PATCH v5 5/6] g_NCR5380: Re-work PDMA loops

2017-06-28 Thread Finn Thain
or-out common code as wait_for_53c80_access(). -- F.T.] Signed-off-by: Ondrej Zary <li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 168 +-- 1 file changed, 88 insertions(+), 80

[PATCH v5 3/6] g_NCR5380: Cleanup comments and whitespace

2017-06-28 Thread Finn Thain
Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 61 ++-- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 911a4300ea51..dedaed2d16e4

[PATCH v5 4/6] g_NCR5380: Limit PDMA send to 512 B to avoid data corruption on DTC3181E

2017-06-28 Thread Finn Thain
t been made available. Hence this workaround. Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index dedaed2d16e4..5fd227b

[PATCH v5 0/6] g_NCR5380: PDMA fixes and cleanup

2017-06-28 Thread Finn Thain
of transfer loops when Gated IRQ gets asserted. (Again.) - Always call wait_for_53c80_registers() at end of transfer. - Drain chip buffers after PDMA receive is interrupted. - Rework residual calculation. - Add new patch to correct DMA terminology. Finn Thain (2): g_NCR5380: Cleanup comments

[PATCH v5 6/6] g_NCR5380: Use unambiguous terminology for PDMA send and receive

2017-06-28 Thread Finn Thain
The word "read" may be used to mean "DMA read operation" or "SCSI READ command", though a READ command implies writing to memory. Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 14 +++--- 1 file changed, 7 inser

[PATCH v5 1/6] g_NCR5380: Fix PDMA transfer size

2017-06-28 Thread Finn Thain
t;li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 67c8dac321ad..14ef4e8c4713 100644 --- a/driver

[PATCH v5 2/6] g_NCR5380: End PDMA transfer correctly on target disconnection

2017-06-28 Thread Finn Thain
; Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 14ef4e8c4713..911a4300ea51 10

Re: [PATCH v4 5/5] g_NCR5380: Re-work PDMA loops

2017-06-27 Thread Finn Thain
I'm afraid I accidentally introduced a regression into v4 of this patch. Ondrej, please test the patch below instead. Sorry for the inconvenience. diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index b1e0a08e49c1..98d5360b0c78 100644 --- a/drivers/scsi/g_NCR5380.c +++

Re: [PATCH v3 0/4] g_NCR5380: PDMA fixes and cleanup

2017-06-27 Thread Finn Thain
On Tue, 27 Jun 2017, Ondrej Zary wrote: > On Tuesday 27 June 2017 14:42:29 Finn Thain wrote: > > > > ... it triggers sometimes: the value is 1 instead of 0. As we use > > > only 16-bit writes, I don't see how the value could ever be odd. > > > Looks like a bu

Re: [PATCH v3 0/4] g_NCR5380: PDMA fixes and cleanup

2017-06-27 Thread Finn Thain
On Tue, 27 Jun 2017, Ondrej Zary wrote: > On Tuesday 27 June 2017 03:49:16 Finn Thain wrote: > > > > ... As long as there's no gated IRQ, we poll for buffer readiness > > until timeout. And when there is a gated IRQ, we break both the > > polling loop and the tran

[PATCH v4 4/5] g_NCR5380: Limit PDMA send to 512 B to avoid random corruption on DTC3181E

2017-06-27 Thread Finn Thain
t been made available. Hence this workaround. Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 9f18082415c4..b1e0a08

[PATCH v4 5/5] g_NCR5380: Re-work PDMA loops

2017-06-27 Thread Finn Thain
or-out common code as wait_for_53c80_access(). -- F.T.] Signed-off-by: Ondrej Zary <li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 147 ++- 1 file changed, 69 insertions(+), 78

[PATCH v4 3/5] g_NCR5380: Cleanup comments and whitespace

2017-06-27 Thread Finn Thain
Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 61 ++-- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 911a4300ea51..9f18082415c4

[PATCH v4 2/5] g_NCR5380: End PDMA transfer correctly on target disconnection

2017-06-27 Thread Finn Thain
; Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 14ef4e8c4713..911a4300ea51 10

[PATCH v4 0/5] g_NCR5380: PDMA fixes and cleanup

2017-06-27 Thread Finn Thain
. - Drop sg_tablesize patch due to performance regression. Changed since v3: - Add Ondrej's workaround for corrupt WRITE commands on DTC boards. - Reset the 53c400 logic after any short PDMA transfer. - Don't fail the transfer if the 53c400 logic got a reset. Finn Thain (1): g_NCR5380: Cleanup

[PATCH v4 1/5] g_NCR5380: Fix PDMA transfer size

2017-06-27 Thread Finn Thain
t;li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 67c8dac321ad..14ef4e8c4713 100644 --- a/driver

Re: [PATCH v3 0/4] g_NCR5380: PDMA fixes and cleanup

2017-06-27 Thread Finn Thain
On Tue, 27 Jun 2017, Michael Schmitz wrote: > Ondrej, > > could this be a partial write (target did not transfer the last byte)? > We do wait for TCR_LAST_BYTE_SENT, but only when there is no residual. Perhaps we should wait for TCR_LAST_BYTE_SENT whenever the 53c400 asserts /EOP. That is,

Re: [PATCH v3 0/4] g_NCR5380: PDMA fixes and cleanup

2017-06-27 Thread Finn Thain
On Tue, 27 Jun 2017, Ondrej Zary wrote: > BTW. I've probably found the DTC write corruption. Added the following > check (13 is host buffer index register) - That register is not mentioned in my 53c400 datasheet. > and it triggers sometimes: the value is 1 instead of 0. As we use only >

Re: [PATCH v3 0/4] g_NCR5380: PDMA fixes and cleanup

2017-06-26 Thread Finn Thain
On Mon, 26 Jun 2017, Ondrej Zary wrote: > > No apparent change in behavior, the first write test resulted in: > [ 842.830802] sd 2:0:1:0: [sdb] tag#0 53c80 registers not accessible, device > will be reset > [ 842.830802] sd 2:0:1:0: [sdb] tag#0 switching to slow handshake > > Checking for

Re: [PATCH v2 0/5] g_NCR5380: PDMA fixes and cleanup

2017-06-26 Thread Finn Thain
On Sun, 25 Jun 2017, Ondrej Zary wrote: > > It mostly works, but there are some problems: > > It's not reliable - we continue the data transfer after poll_politely2 > returns zero but we don't know if it returned because of host buffer > being ready of because of an IRQ. So if a device

[PATCH v3 4/4] g_NCR5380: Re-work PDMA loops

2017-06-26 Thread Finn Thain
or-out common code as wait_for_53c80_access(). -- F.T.] Signed-off-by: Ondrej Zary <li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 160 ++- 1 file changed, 75 insertions(+), 85

[PATCH v3 3/4] g_NCR5380: Cleanup comments and whitespace

2017-06-26 Thread Finn Thain
Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 61 ++-- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 911a4300ea51..9f18082415c4

[PATCH v3 0/4] g_NCR5380: PDMA fixes and cleanup

2017-06-26 Thread Finn Thain
. - Drop sg_tablesize patch due to performance regression. Finn Thain (1): g_NCR5380: Cleanup comments and whitespace Ondrej Zary (3): g_NCR5380: Fix PDMA transfer size g_NCR5380: End PDMA transfer correctly on target disconnection g_NCR5380: Re-work PDMA loops drivers/scsi/g_NCR5380.c

[PATCH v3 2/4] g_NCR5380: End PDMA transfer correctly on target disconnection

2017-06-26 Thread Finn Thain
; Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 14ef4e8c4713..911a4300ea51 10

[PATCH v3 1/4] g_NCR5380: Fix PDMA transfer size

2017-06-26 Thread Finn Thain
t;li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 67c8dac321ad..14ef4e8c4713 100644 --- a/driver

Re: [PATCH 17/35] NCR5380: Move bus reset to host reset

2017-06-24 Thread Finn Thain
the same style that is used later in this routine? I.e. list_for_each_entry(ncmd, >unissued, list) { struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd); cmd->result = DID_RESET << 16; cmd->scsi_done(cmd); } INIT_LIST

[PATCH v2 2/5] g_NCR5380: End PDMA transfer correctly on target disconnection

2017-06-24 Thread Finn Thain
; Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 14ef4e8c4713..911a4300ea51 10

[PATCH v2 3/5] g_NCR5380: Limit sg_tablesize to avoid PDMA read overruns on DTC436

2017-06-24 Thread Finn Thain
Back-to-back DMA receive transfers can lose a byte due to a 5380 flaw. This makes scatter-receive difficult or impossible on affected hardware, so limit the scatter/gather tablesize to 1. Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 1 + 1 file chan

[PATCH v2 4/5] g_NCR5380: Cleanup comments and whitespace

2017-06-24 Thread Finn Thain
Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 61 ++-- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 7b3626fe120b..d51a2ba07a24

[PATCH v2 5/5] g_NCR5380: Re-work PDMA loops

2017-06-24 Thread Finn Thain
n code as wait_for_53c80_access(). -- F.T.] Signed-off-by: Ondrej Zary <li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 149 --- 1 file changed, 64 insertions(+), 85 deletions(-) di

[PATCH v2 1/5] g_NCR5380: Fix PDMA transfer size

2017-06-24 Thread Finn Thain
t;li...@rainbow-software.org> Signed-off-by: Finn Thain <fth...@telegraphics.com.au> --- drivers/scsi/g_NCR5380.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 67c8dac321ad..14ef4e8c4713 100644 --- a/driver

  1   2   3   4   5   6   7   8   9   >