Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10435316ybi; Wed, 24 Jul 2019 23:09:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVIZ4cXZiMsFKPPcyC+ycl+t2pGo5ht0oG+y4lZ95ZnHfcGvpciPcBwIiNjkaYrBUtmbK+ X-Received: by 2002:a63:20a:: with SMTP id 10mr84119518pgc.226.1564034988352; Wed, 24 Jul 2019 23:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034988; cv=none; d=google.com; s=arc-20160816; b=l3sZq5AygR0Sg+RRjYujNrnHolEkpf0eUZ0NxcR7UDcGrXpWJ5iUqNNOdNaEeIRmJy lhb1jURzhaZT72cgKwq1OUgD6/8EylesBMpxS0Q60DY2Z3AMTlASop4tt4ITGCd7fgAB 2Oxu0bk5ASz9gXtDfy0AUQ2N8oklM8IyJ7oH5PsvtyPqqMxsH0XagskwGgLWk1REj2zu CHshR5hq6LKt6J6wJDncaZrHag6e2n0fBvdcH1e/lEfBdnqXxr37fkZu71/UVZWG8cSe Dsr5uFNuup8VWUlIVMin3mQUUgvvSTrHGJfyAY3/PXJ04uaCZBnMkHQ6LKa2Wx1D9w9D 0AaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gzaF+RawvkD7NOHjWTUM4PRrfO8Jsk/2ZMZAyvMZAi0=; b=EKEiQYwgEat5SJ7b78MKgc6B05Bop/ZzyIoGlEJUj1JNjGzz8UhFITUsbBYeoNepz2 opLECK/a/X8Sz2xvKIAfVISqFTz2ExCrHAAQ1cF37gdA5bnh5CIhRm9kmMyQ0HniGaix EKuUUwnxWi8Sf7oPdHDu2DM0NpY94nW0SHDjGlbxehYunrD6jST0Ho9ZuvjwmMedXDFS gC1HbyDc6JZnefU3k02jJNO/r3tVvEkX2mu42qFyhpR5ZNksE1Uycodxzdd24I8ua109 kpPmrnoLpeVlaBPQRJS9zLzbDMzxbOp8bNl6NqlIM2UDSbNXqatiYgfbufWql3ONDU/Q WAQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LRVBcNrM; 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 e1si7849841pge.227.2019.07.24.23.09.33; Wed, 24 Jul 2019 23:09:48 -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; dkim=pass header.i=@kernel.org header.s=default header.b=LRVBcNrM; 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 S2387861AbfGYFoB (ORCPT + 99 others); Thu, 25 Jul 2019 01:44:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:58972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391125AbfGYFn4 (ORCPT ); Thu, 25 Jul 2019 01:43:56 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 491A222BF5; Thu, 25 Jul 2019 05:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033435; bh=UuliqgOTkTmntToZ81rjcCYcGZUswTVPwrY3Yz1BCyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LRVBcNrMZAGfibLqHm+R4+D3bTyQRFP65wKCakL3sT6wyqWDx7DkDXOzAdZnZWNOZ 5P02VfNAcOTXh+/4ETA2O6JImgTojip9Ve5STWbAkMsPpQyzeiW0b9E3YFZGT1OPcb OO5+GQYjWsMnN8Yvd53xuFNiWp7Wm4NZt/YaMSic= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Schmitz , Finn Thain , Stan Johnson , "Martin K. Petersen" Subject: [PATCH 4.19 170/271] scsi: mac_scsi: Increase PIO/PDMA transfer length threshold Date: Wed, 24 Jul 2019 21:20:39 +0200 Message-Id: <20190724191709.747624205@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Finn Thain commit 7398cee4c3e6aea1ba07a6449e5533ecd0b92cdd upstream. Some targets introduce delays when handshaking the response to certain commands. For example, a disk may send a 96-byte response to an INQUIRY command (or a 24-byte response to a MODE SENSE command) too slowly. Apparently the first 12 or 14 bytes are handshaked okay but then the system bus error timeout is reached while transferring the next word. Since the scsi bus phase hasn't changed, the driver then sets the target borken flag to prevent further PDMA transfers. The driver also logs the warning, "switching to slow handshake". Raise the PDMA threshold to 512 bytes so that PIO transfers will be used for these commands. This default is sufficiently low that PDMA will still be used for READ and WRITE commands. The existing threshold (16 bytes) was chosen more or less at random. However, best performance requires the threshold to be as low as possible. Those systems that don't need the PIO workaround at all may benefit from mac_scsi.setup_use_pdma=1 Cc: Michael Schmitz Cc: stable@vger.kernel.org # v4.14+ Fixes: 3a0f64bfa907 ("mac_scsi: Fix pseudo DMA implementation") Signed-off-by: Finn Thain Tested-by: Stan Johnson Tested-by: Michael Schmitz Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/mac_scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/scsi/mac_scsi.c +++ b/drivers/scsi/mac_scsi.c @@ -52,7 +52,7 @@ static int setup_cmd_per_lun = -1; module_param(setup_cmd_per_lun, int, 0); static int setup_sg_tablesize = -1; module_param(setup_sg_tablesize, int, 0); -static int setup_use_pdma = -1; +static int setup_use_pdma = 512; module_param(setup_use_pdma, int, 0); static int setup_hostid = -1; module_param(setup_hostid, int, 0); @@ -305,7 +305,7 @@ static int macscsi_dma_xfer_len(struct N struct scsi_cmnd *cmd) { if (hostdata->flags & FLAG_NO_PSEUDO_DMA || - cmd->SCp.this_residual < 16) + cmd->SCp.this_residual < setup_use_pdma) return 0; return cmd->SCp.this_residual;