Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1404796imm; Fri, 12 Oct 2018 18:14:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV618k6xyxG/38uuuH1RgOzVVXcuCiqyHecntE8akfcywbpu5ZO28USU8pIivqHfAcKS9TiqR X-Received: by 2002:a62:c2c1:: with SMTP id w62-v6mr8242333pfk.35.1539393295643; Fri, 12 Oct 2018 18:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539393295; cv=none; d=google.com; s=arc-20160816; b=P1LASKssvpNm2IEI26VWa4bPoYMoW7wk1S/t3Ytmct6g3Vj21AQMvtj1KDqU2S0tBu /Xm6QuI73sRfCzu/S8K8aecyqtWireSjUgN2A2FOyLGmX2nHm3iEHO7DwfX6Blw+jo9J noqOFcsC0cpXv8VTyhiZlOD1I+847YvmgjWR4Tk8kTLnRASbhyT30QUQFdgQXAB+dATy kI8O8AORDomAbIoB4fQdzq3JNWpkRSjmptIjbl0aGIdZy4QMoGGTHXgM3mG+MbtqOOIg CFqKJU7KjCp+eIYE5jnhMjXKJf61BFML+s6uJNetAGE2hjMjMkLYUIyfUELm09Cq8SCr nhTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:references:in-reply-to :message-id:cc:to; bh=dx/Sbm3tsnON7bGhR6cdfpLxJZUr9BFwp9rLEmbnvVs=; b=Re3m50Bo9h8r3Hu+1HwDrwlt4AH1kxNHS+/5M43PCo5uRiI37VsEx5iBdKAz5LLDV1 33hqxDoL/nPXJSOtzUlRKiWZwKRj4WN8VWhb2tmVhADwfv86HCPMOUPsNndEqrBpZ+52 7fQKi3gEYrUxTBYO6rU2eV2/tGWxFxLrgGyZu1six1xqtlbqne0phj8KouRmho6+Lfhx CEcuZph2fL+IeCt+trwy1Us7keBx1g7lMpbC74ms+l7Y2tWUYHdA4vcXEqPSYTeNa6s9 ZtbiPeRIRFCTZIWXXaTzoQvBWk9WO67cByZ46Yv+SGR2ZMGz5QJOhaCQrdt8Ose7YIco TtpA== 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 p19-v6si2981274pfi.12.2018.10.12.18.14.39; Fri, 12 Oct 2018 18:14:55 -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 S1727197AbeJMIrM (ORCPT + 99 others); Sat, 13 Oct 2018 04:47:12 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:47234 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbeJMIqx (ORCPT ); Sat, 13 Oct 2018 04:46:53 -0400 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 0E8EF29FCA; Fri, 12 Oct 2018 21:11:49 -0400 (EDT) To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: Michael Schmitz , Hannes Reinecke , linux-scsi@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-Id: <3a2534bff570653de6897afa081017e2a359747e.1539391876.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH 6/6] esp_scsi: Optimize PIO loops Date: Sat, 13 Oct 2018 11:51:16 +1100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid function calls in the inner PIO loops. On a Centris 660av this improves throughput for sequential read transfers by about 40% and sequential write by about 10%. Unfortunately it is not possible to have method calls like esp_write8() placed inline so this is always going to be slow (even with LTO). Tested-by: Stan Johnson Signed-off-by: Finn Thain --- drivers/scsi/esp_scsi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 646701fc22a4..9f0e68cd0e99 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -2788,7 +2788,7 @@ static inline unsigned int esp_wait_for_fifo(struct esp *esp) if (fbytes) return fbytes; - udelay(2); + udelay(1); } while (--i); pr_err("FIFO is empty (sreg %02x)\n", esp_read8(ESP_STATUS)); @@ -2804,7 +2804,7 @@ static inline int esp_wait_for_intr(struct esp *esp) if (esp->sreg & ESP_STAT_INTR) return 0; - udelay(2); + udelay(1); } while (--i); pr_err("IRQ timeout (sreg %02x)\n", esp->sreg); @@ -2831,7 +2831,7 @@ void esp_send_pio_cmd(struct esp *esp, u32 addr, u32 esp_count, if (!esp_wait_for_fifo(esp)) break; - *dst++ = esp_read8(ESP_FDATA); + *dst++ = readb(esp->fifo_reg); --esp_count; if (!esp_count) @@ -2852,15 +2852,15 @@ void esp_send_pio_cmd(struct esp *esp, u32 addr, u32 esp_count, } if (phase == ESP_MIP) - scsi_esp_cmd(esp, ESP_CMD_MOK); + esp_write8(ESP_CMD_MOK, ESP_CMD); - scsi_esp_cmd(esp, ESP_CMD_TI); + esp_write8(ESP_CMD_TI, ESP_CMD); } } else { unsigned int n = ESP_FIFO_SIZE; u8 *src = (u8 *)addr; - scsi_esp_cmd(esp, ESP_CMD_FLUSH); + esp_write8(ESP_CMD_FLUSH, ESP_CMD); if (n > esp_count) n = esp_count; @@ -2894,7 +2894,7 @@ void esp_send_pio_cmd(struct esp *esp, u32 addr, u32 esp_count, src += n; esp_count -= n; - scsi_esp_cmd(esp, ESP_CMD_TI); + esp_write8(ESP_CMD_TI, ESP_CMD); } } -- 2.16.4