Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1403876imm; Fri, 12 Oct 2018 18:13:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV61dPLB3xq70Z+ddofFePw3D8bgLEYEfOkRkl9boNOcof5R9gZbrX+UiY3Fzjrb6rCk2tzyj X-Received: by 2002:a63:1711:: with SMTP id x17-v6mr7450681pgl.364.1539393210313; Fri, 12 Oct 2018 18:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539393210; cv=none; d=google.com; s=arc-20160816; b=plVRtvRGTQzJZyvPtoW+BuJnY/q98ojuI0enGfGx9aPlyqd+T+qW/q+/QV35UscGBA N+yWB5k4T4en2EACos+EvxiG7HAf5HHl6JXBmECjcvdewcY+tZt9GNHFdXBlSTuMw1zP Ow1pk837WOc7nck8o5q/fo3A8FhGOv/QLkAiAH1xvE2/EcHFuTx9y3T8xL5Wn/12yFu1 GkHWp4qxglw5LHN4H6wJlbeVbvQU7lqCLFABXlZ8Q98QTDnebEz2fITdilX2Sf0OZDH3 dQAs4Hu2eBWZnBlj96pFGLQb8TJVH6ogSFbzH9nD3/oPqlwaJoPtqPF4ltFCQwd4UA5M SXtA== 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=AR1aT/yyzeJxYnqBCK7c6fBR3TJd3b2uHEalqcZmxA8=; b=Hmi4yC5sJMsjXoNZOF1ZixYfD4W3cQYzfP/Qd627uDtJrsOJ2HeYiCEer1E9I+QN3y 3euOUnIbEjuEBr67YjTvqYYndiwDFzPKidq1PFkqmSHujHKklhOspwV4szz7uLgJAtyp ItCO3TQdbo1Syfpf1cSDbIWKptrsuVy8Aieh5gsb95KtsVBM2PJvfJsfzUQVrmMUZuzT /bGeUA+h2fT9d/JW1KF6NzPwOGfN/7E3Ya9sZA2pxPA8GUp+Pq7QPOjdbcy+9duXHb43 IdT9xrHNiwoHMCG1mTGGXApan6dj4swi+osdl6uJj2waUJjNrZcx7UW5hlmFSx6UFHh5 upgQ== 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 c81-v6si3206012pfb.153.2018.10.12.18.13.15; Fri, 12 Oct 2018 18:13:30 -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 S1727242AbeJMIrM (ORCPT + 99 others); Sat, 13 Oct 2018 04:47:12 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:47180 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbeJMIqx (ORCPT ); Sat, 13 Oct 2018 04:46:53 -0400 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id A129529FC5; Fri, 12 Oct 2018 21:11:48 -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: <77b92ff87d96f127d4aae474367f474223412df8.1539391876.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH 1/6] zorro_esp: Limit DMA transfers to 65535 bytes 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 The core driver, esp_scsi, does not use the ESP_CONFIG2_FENAB bit, so the chip's Transfer Counter register is only 16 bits wide (not 24). A larger transfer cannot work and will theoretically result in a failed command and a "DMA length is zero" error. Fixes: 3109e5ae0311 Signed-off-by: Finn Thain Cc: Michael Schmitz --- drivers/scsi/zorro_esp.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/scsi/zorro_esp.c b/drivers/scsi/zorro_esp.c index bb70882e6b56..be79127db594 100644 --- a/drivers/scsi/zorro_esp.c +++ b/drivers/scsi/zorro_esp.c @@ -245,7 +245,7 @@ static int fastlane_esp_irq_pending(struct esp *esp) static u32 zorro_esp_dma_length_limit(struct esp *esp, u32 dma_addr, u32 dma_len) { - return dma_len > 0xFFFFFF ? 0xFFFFFF : dma_len; + return dma_len > 0xFFFF ? 0xFFFF : dma_len; } static void zorro_esp_reset_dma(struct esp *esp) @@ -484,7 +484,6 @@ static void zorro_esp_send_blz1230_dma_cmd(struct esp *esp, u32 addr, scsi_esp_cmd(esp, ESP_CMD_DMA); zorro_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW); zorro_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED); - zorro_esp_write8(esp, (esp_count >> 16) & 0xff, ESP_TCHI); scsi_esp_cmd(esp, cmd); } @@ -529,7 +528,6 @@ static void zorro_esp_send_blz1230II_dma_cmd(struct esp *esp, u32 addr, scsi_esp_cmd(esp, ESP_CMD_DMA); zorro_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW); zorro_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED); - zorro_esp_write8(esp, (esp_count >> 16) & 0xff, ESP_TCHI); scsi_esp_cmd(esp, cmd); } @@ -574,7 +572,6 @@ static void zorro_esp_send_blz2060_dma_cmd(struct esp *esp, u32 addr, scsi_esp_cmd(esp, ESP_CMD_DMA); zorro_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW); zorro_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED); - zorro_esp_write8(esp, (esp_count >> 16) & 0xff, ESP_TCHI); scsi_esp_cmd(esp, cmd); } @@ -599,7 +596,6 @@ static void zorro_esp_send_cyber_dma_cmd(struct esp *esp, u32 addr, zorro_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW); zorro_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED); - zorro_esp_write8(esp, (esp_count >> 16) & 0xff, ESP_TCHI); if (write) { /* DMA receive */ @@ -649,7 +645,6 @@ static void zorro_esp_send_cyberII_dma_cmd(struct esp *esp, u32 addr, zorro_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW); zorro_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED); - zorro_esp_write8(esp, (esp_count >> 16) & 0xff, ESP_TCHI); if (write) { /* DMA receive */ @@ -691,7 +686,6 @@ static void zorro_esp_send_fastlane_dma_cmd(struct esp *esp, u32 addr, zorro_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW); zorro_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED); - zorro_esp_write8(esp, (esp_count >> 16) & 0xff, ESP_TCHI); if (write) { /* DMA receive */ -- 2.16.4