Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3834007ybi; Mon, 3 Jun 2019 00:42:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7pJJtDBc+5wYv4Ep/y5O2SFM9NtgZDXNX2kFAjtfxH9YUIVaKzVhnkW4EtUB4gqLB17D6 X-Received: by 2002:a63:af44:: with SMTP id s4mr26599990pgo.411.1559547755487; Mon, 03 Jun 2019 00:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559547755; cv=none; d=google.com; s=arc-20160816; b=T5Sd6xPypI3TNcQlqWRR5h7TM1qwDB50+zWvSoiGzGw3vF69Tn1A3clANlerTk6Rhh v6W/Xg47ba6oow6KyFf8tSCQJmQFlQVetVjF+LSYkIE1RoftexXxKtT9DUe88DAupM5Z b5tkQmWpEXtEPG7d7T10/IHWolG1zCsnpkfsNjM7stXlS95QFna9ClmhrLUzpqGKP4gx Z5aby1Iq1VguEivqhZN6jlk/CA6kiR9mQBmRdM5MCBiWIoFq19TsVV9Ivbp1YqA6aenf SZaFL9D2m2sfm98KnhfWNMCLi8eeQWEFrhzzh55WK/9ZD8xwJY6rkN99Z3nqdW0aFaUG hVWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=jRzSjXgksDlshdME3PcyLEKGOWI8uXr2P2SuehIy+Ak=; b=m5oPBEMuw1pdYGq1zGehXuyCNZ5rv5js4AWJivsv/fvjM47Eb7BvFHnI3wV1LeYOFN x5kmw53uP+usm2aP246zrK8niAvvK1l+tAb25usllFTVr2uFIVXNJJ5oRk+DGTGGbEOW 9QV6te1hkRE2OjeHnxKxjQ8gfHGQgiIvM1VMvnn1n1+r7362pzZvIWVdanyqYR6fCVf/ TjsCrgIA8qNrwjLK3B6t/DTP+KSUy9HV4rMH+ZRuMKiua7Gr7VroXseuPUdqbSJGVQtq qMGqjYeFdlerQe0tjL1a+gUNNSHqeeEdkNURUnFOm1SXivfZZ0RC7z3bdHGtHN20voMN JydQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si18381179plw.379.2019.06.03.00.42.19; Mon, 03 Jun 2019 00:42:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726842AbfFCHkP (ORCPT + 99 others); Mon, 3 Jun 2019 03:40:15 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:55556 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbfFCHkO (ORCPT ); Mon, 3 Jun 2019 03:40:14 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 08DAC27E6E; Mon, 3 Jun 2019 03:40:11 -0400 (EDT) Date: Mon, 3 Jun 2019 17:40:21 +1000 (AEST) From: Finn Thain To: Geert Uytterhoeven cc: "James E.J. Bottomley" , "Martin K. Petersen" , Michael Schmitz , scsi , Linux Kernel Mailing List , stable , linux-m68k Subject: Re: [PATCH 5/7] scsi: mac_scsi: Fix pseudo DMA implementation, take 2 In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Jun 2019, Geert Uytterhoeven wrote: > Hi Finn, > > On Mon, Jun 3, 2019 at 1:32 AM Finn Thain wrote: > > On Sun, 2 Jun 2019, Geert Uytterhoeven wrote: > > > On Sun, Jun 2, 2019 at 3:29 AM Finn Thain > > > 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 > > > > Cc: Geert Uytterhoeven > > > > Cc: stable@vger.kernel.org # v4.14+ > > > > Fixes: 3a0f64bfa907 ("mac_scsi: Fix pseudo DMA implementation") > > > > Reported-by: Chris Jones > > > > Tested-by: Stan Johnson > > > > Signed-off-by: Finn Thain > > > > > > 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. > > So you do have future sharing in mind... > > > > 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 > > I meant that apart from the code containing m68k assembler source, it is > not related to arch/m68k/, and thus belongs to the driver. That criterion seems insufficient. It could describe most of arch/m68k/mac (which has headers in arch/m68k/include). > There are several other drivers that contain pieces of assembler code. > Does any driver contain assembler code for multiple architectures? I was trying to avoid that -- though admittedly I don't yet have actual code for the PDMA implementation for mac_scsi for Nubus PowerMacs. However, the existence of that out-of-tree port suggests to me that arch/powerpc/include/mac_scsi.h and arch/m68k/include/mac_scsi.h would be an appropriate layout. But if there's no clear policy then perhaps we should ignore the whole question until the driver code actually becomes shared code. I don't mind re-working the patch to combine the two files. -- > > 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.? > > If the code is used by multiple SCSI drivers, you can move it to a header > file under drivers/scsi/. > If the code is shared by drivers belonging to multiple subsystems, you can > move it to a header file under include/linux/. > > Anyone who has a better solution? > Thanks! > > Gr{oetje,eeting}s, > > Geert > >