[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.21.1810150902430.10@nippy.intranet>
Date: Mon, 15 Oct 2018 09:14:18 +1100 (AEDT)
From: Finn Thain <fthain@...egraphics.com.au>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
cc: "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Michael Schmitz <schmitzmic@...il.com>,
Hannes Reinecke <hare@...e.de>,
scsi <linux-scsi@...r.kernel.org>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/6] esp_scsi: Track residual for PIO transfers
On Sun, 14 Oct 2018, Geert Uytterhoeven wrote:
>
> > Fixes: 6fe07aaffbf0
>
> Fixes: 6fe07aaffbf0 ("[SCSI] m68k: new mac_esp scsi driver")
>
Fixed.
> > Tested-by: Stan Johnson <userm57@...oo.com>
> > Signed-off-by: Finn Thain <fthain@...egraphics.com.au>
> > Tested-by: Michael Schmitz <schmitzmic@...il.com>
>
> > --- a/drivers/scsi/esp_scsi.h
> > +++ b/drivers/scsi/esp_scsi.h
> > @@ -540,6 +540,8 @@ struct esp {
> >
> > void *dma;
> > int dmarev;
> > +
> > + int send_cmd_residual;
>
> unsigned int?
>
My first thought was to use u32, same as esp_count. But it turns out that
the end result really is an int --
static int esp_data_bytes_sent(struct esp *esp, struct esp_cmd_entry *ent,
struct scsi_cmnd *cmd)
{
int fifo_cnt, ecount, bytes_sent, flush_fifo;
...
bytes_sent = esp->data_dma_len;
bytes_sent -= ecount;
bytes_sent -= esp->send_cmd_residual;
...
return bytes_sent;
}
Apparently over/underflow is a real possibility, because there is a test
for this in esp_process_event().
--
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
Powered by blists - more mailing lists