Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2744778imm; Sun, 14 Oct 2018 03:56:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV60bwT5dUoGdyTmWxbfrYJN8iGBcXuu5xV6x/GNUCfSb/Y+2aiKKs/1gHILUi3Zdmi7oIiiP X-Received: by 2002:a62:b09:: with SMTP id t9-v6mr13378938pfi.36.1539514603717; Sun, 14 Oct 2018 03:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539514603; cv=none; d=google.com; s=arc-20160816; b=pjf7FlPzty8AYNyTdGFF4zX3+z0AZPNB9gVU9Plrzf9jOg5hW2Pev1/QIYhY51R2ve 10oo5gW7cx6g/W9LhIx2n6QSlYQXrMMG8nqiLQpUM/v736fhyc2ZHdxE9iDuBxvZJw1b ocfa5bKQ/6KLbTKM0306HpYlE/IP3E31ogohxk7B58WduM9GWYi1xr2axjctjBW7SxuB LmMhEfz9vKMMqMWsrzTyUXpatJtvSVeEe1pDNLQr4qDRKCAm0YreLdOzbBf8GlX3eq89 ghRho4ca93KtJ3vFYcimp3TUIzd5wMGoe6We3qZ2CYdNKCPjxS1R/xt20HKgJXt0CfNi kTFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=12uVaPeoGXRWZptPmz/62EhI1PnN0nL5+4L/vlGvM0o=; b=KXPHu+2Pg9P5I3Rf+RZYKb+8BH2HUcYH5zykDJpS1n+JXPPMql/myICcVDF4eTjn8H Nj5EgP3RIA+R/e7blMxzNSQ3qSC822g3lmSmTZ2edOkHMNdxyzbho/vuhmmUYSSMKkdl tNnJvpdKGCArRjABu5ID8+svsrbgLRl3o5bCCaGqFpNnq5q1bZA3YQ8vCEsKUjvyH0Sr kgCfdkwSYdHJH+FWoiLkpE07HNTNo/RAyrZjHdBVkaMllZEKuonZTe8qVfX1sNAb1enZ 4Mt4zBvQnaaGD0EoXpiEC6V4XlQ2mk1VONHNH+KzODwYw/b2EX2UWIwch5IZRvyenj9p hRIA== 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 t10-v6si7145476pgh.338.2018.10.14.03.56.29; Sun, 14 Oct 2018 03:56:43 -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 S1726781AbeJNSgd (ORCPT + 99 others); Sun, 14 Oct 2018 14:36:33 -0400 Received: from mail-ua1-f67.google.com ([209.85.222.67]:36860 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbeJNSgd (ORCPT ); Sun, 14 Oct 2018 14:36:33 -0400 Received: by mail-ua1-f67.google.com with SMTP id b3so1047895uak.3; Sun, 14 Oct 2018 03:55:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=12uVaPeoGXRWZptPmz/62EhI1PnN0nL5+4L/vlGvM0o=; b=YZy4ctXA5Qv7Y3kcfAn6+peo1j11lEHlKZPURtXiqJzjNWnnc+Wo5CZA8eChmm9TiZ o8xRSlHNBSarSoXaUaAes9D0TeXe5XTQRYKFkFI7C+CX8kk/6xzL7+AF8pvLC4qDuhNa ehV51L9X7lhi5YglMUSbrFONypOZFWI9XZSAltlbZl26qTi1v65ZZOVg5PktEclphoyM ZtOzX7A1dmfasXl/DwfoeQJMiXmCB4pad1UOQk75iiQ1dbYAHTEBv4ej/rFTx9xUH8Tb oqiSeOPx8jIgl1dy92FD9GNFLc4wiJYt6BuNBxPcA/MaB16tXGfEDddpcEmtS3xDtPFJ YOHQ== X-Gm-Message-State: ABuFfoiST5CqIkOm0m1J7/+3m3gNLnDFwWNch5BmOy36OiJ7qraTscua 2JqXysYo1ohHoWCKJ+JHZI7EbMQ/2dMVi5L6n00= X-Received: by 2002:ab0:47ed:: with SMTP id w45mr5171273uac.78.1539514555183; Sun, 14 Oct 2018 03:55:55 -0700 (PDT) MIME-Version: 1.0 References: <11a3a80e74a006040460fa051747e6a79c6382ce.1539497520.git.fthain@telegraphics.com.au> In-Reply-To: <11a3a80e74a006040460fa051747e6a79c6382ce.1539497520.git.fthain@telegraphics.com.au> From: Geert Uytterhoeven Date: Sun, 14 Oct 2018 12:55:43 +0200 Message-ID: Subject: Re: [PATCH v2 2/6] esp_scsi: Track residual for PIO transfers To: Finn Thain Cc: "James E.J. Bottomley" , "Martin K. Petersen" , Michael Schmitz , Hannes Reinecke , scsi , linux-m68k , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Finn, On Sun, Oct 14, 2018 at 8:36 AM Finn Thain wrote: > If a target disconnects during a PIO data transfer the command may > fail when the target reconnects: > > scsi host1: DMA length is zero! > scsi host1: cur adr[04380000] len[00000000] > > The scsi bus is then reset. This happens because the residual reached > zero before the transfer was completed. > > The usual residual calculation relies on the Transfer Count registers > which works for DMA transfers but not for PIO transfers. Fix the problem > by storing the PIO transfer residual and using that to correctly > calculate bytes_sent. Thanks for yur patch! > Fixes: 6fe07aaffbf0 Fixes: 6fe07aaffbf0 ("[SCSI] m68k: new mac_esp scsi driver") > Tested-by: Stan Johnson > Signed-off-by: Finn Thain > Tested-by: Michael Schmitz > --- 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? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-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