Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3819859ybi; Mon, 29 Jul 2019 13:15:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmyc6/K1KgLM2XWAz0s7UndTbBOO9ZP/z479yCUGlI7owEa6stDgDj/MvOTgzvlQOmSiS3 X-Received: by 2002:a62:1b0c:: with SMTP id b12mr37745318pfb.17.1564431318863; Mon, 29 Jul 2019 13:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564431318; cv=none; d=google.com; s=arc-20160816; b=V9UQBynH/E2ebtiiD8jfsJHwEBORxclBQ3eHV5FLG45G5FC53W5+9DZnGeRoBw/Zq0 DVq4ZwYJJLOnsBKQHdQS5DGbZFnA1xcVj4wX0HCYI55oND+pR9gJ9c70kuyySrOkLXzk mNO2jlzWIkzXIGZH9dmKObgJYUemigh7WirGs+DV8xzsQHbSEjcTyDT6nMcQkYjIthrt VcKbyePCBNvKPWPbJTSsCVYs9nOZmwRw+G82wWeKHpSu5ia5zMtKnTeHgVGDBErMhifI jWzGNObsF8s/ez3XCDsQYOmc+22dI4BV29weNVxypZARqLTA232IZHPM/xGyetld4q9J UjIQ== 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=nJfNURzbhSlmNvVcubpvQwmEC8CH9J0LfpvVmAV4IxtGnr3Y9qw0lgT4ob3Sy/2f8E ptg8liouALGjb1VxQ1AhHHB6Jvml32bsZl281R9aDmUVI/f072hwvuEUgZd+Yzuf9tTk Tz1cVTdmdFAJdY6+wbvVQwu6Nr+JrfGBPbxaq77zOe8RiOaVKlNZei+96nB7pUWyQmFJ 5K1OXtuk+Xed67qn9cn4sls1Xu3YgJjhvRdQXjm1EkMO3lOPiS2PXKYxb1HNfp1Yokri mFoNvPeR2JWcc396kN2G9mgvMEsjRJMhfytSc9SaDra5YW5B18MN5WI+j+jaVYi4eOuy l7Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DVgqmETs; 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 ci19si25808719plb.165.2019.07.29.13.15.03; Mon, 29 Jul 2019 13:15:18 -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=DVgqmETs; 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 S1730491AbfG2UNu (ORCPT + 99 others); Mon, 29 Jul 2019 16:13:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:42102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727721AbfG2T3Z (ORCPT ); Mon, 29 Jul 2019 15:29:25 -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 EC1482070B; Mon, 29 Jul 2019 19:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428564; bh=UuliqgOTkTmntToZ81rjcCYcGZUswTVPwrY3Yz1BCyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DVgqmETs6QxFxBnLJg29Iv3GftPGSlDv3UiziWago28pgcnDrrwlOq4qPeEcyxhpB R+rruj2p/WdI8BPnofcH9bKR9O8ZLKDpLwqcPCkoT5vabVbBPe6WdEsRlMH/BW/QWF EmJV+PIvlbmHWKKixxal0lWdqou8e6lDQeaS5OGc= 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.14 117/293] scsi: mac_scsi: Increase PIO/PDMA transfer length threshold Date: Mon, 29 Jul 2019 21:20:08 +0200 Message-Id: <20190729190833.551407790@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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;