lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 19 May 2016 11:00:02 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Finn Thain <fthain@...egraphics.com.au>
Cc:	"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
	"Martin K. Petersen" <martin.petersen@...cle.com>,
	Michael Schmitz <schmitzmic@...il.com>,
	"Linux/m68k" <linux-m68k@...r.kernel.org>,
	scsi <linux-scsi@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Ondrej Zary <linux@...nbow-software.org>,
	Sam Creasey <sammy@...my.net>
Subject: Re: [PATCH v4 22/23] mac_scsi: Fix pseudo DMA implementation

Hi Finn,

On Wed, Mar 23, 2016 at 11:10 AM, Finn Thain <fthain@...egraphics.com.au> wrote:
> Fix various issues: Comments about bus errors are incorrect. The
> PDMA asm must return the size of the memory access that faulted so the
> transfer count can be adjusted accordingly. A phase change may cause a
> bus error but should not be treated as failure. A bus error does not
> always imply a phase change and generally the transfer may continue.
> Scatter/gather doesn't seem to work with PDMA due to overruns. This is
> a pity because peak throughput seems to double with SG_ALL.
> Tested on a Mac LC III and a PowerBook 520.
>
> Signed-off-by: Finn Thain <fthain@...egraphics.com.au>
> Reviewed-by: Hannes Reinecke <hare@...e.com>

> --- linux.orig/drivers/scsi/mac_scsi.c  2016-03-23 21:09:53.000000000 +1100
> +++ linux/drivers/scsi/mac_scsi.c       2016-03-23 21:10:05.000000000 +1100

> @@ -104,18 +105,9 @@ static int __init mac_scsi_setup(char *s

>  static int macscsi_pread(struct Scsi_Host *instance,
>                           unsigned char *dst, int len)
>  {
>         struct NCR5380_hostdata *hostdata = shost_priv(instance);
> -       unsigned char *d;
> -       unsigned char *s;
> -
> -       s = hostdata->pdma_base + (INPUT_DATA_REG << 4);
> -       d = dst;
> -
> -       /* These conditions are derived from MacOS */
> -
> -       while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) &&
> -              !(NCR5380_read(STATUS_REG) & SR_REQ))
> -               ;
> -
> -       if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) &&
> -           (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)) {
> -               pr_err("Error in macscsi_pread\n");
> -               return -1;
> -       }
> -
> -       CP_IO_TO_MEM(s, d, len);
> -
> -       if (len != 0) {
> -               pr_notice("Bus error in macscsi_pread\n");
> -               return -1;
> +       unsigned char *s = hostdata->pdma_base + (INPUT_DATA_REG << 4);
> +       unsigned char *d = dst;
> +       int n = len;
> +       int transferred;
> +
> +       while (!NCR5380_poll_politely(instance, BUS_AND_STATUS_REG,
> +                                     BASR_DRQ | BASR_PHASE_MATCH,
> +                                     BASR_DRQ | BASR_PHASE_MATCH, HZ / 64)) {
> +               CP_IO_TO_MEM(s, d, n);

This is now before the inclusion of NCR5380.c, causing

In file included from drivers/scsi/mac_scsi.c:335:
drivers/scsi/NCR5380.h:295: warning: ‘NCR5380_poll_politely’ declared
inline after being called
drivers/scsi/NCR5380.h:295: warning: previous declaration of
‘NCR5380_poll_politely’ was here

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ