Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2582153imm; Sat, 13 Oct 2018 23:36:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV63IG1oMMlhQue1f1jE+R4T4beDshpK1DNjrlq2YCe8jB0NtrNQsn4tOlLGPTtCTZrTIp+Qm X-Received: by 2002:a62:cd45:: with SMTP id o66-v6mr12654889pfg.12.1539498983617; Sat, 13 Oct 2018 23:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539498983; cv=none; d=google.com; s=arc-20160816; b=isv1GqWlYvvLQE1v0rNJqSC91+lipDG2oMpX/GpEhEVu8dUDaZRpKRVonYqjyrsyYw +16gLFc2hkf2I9IOwQart4ylRwr/IwhOj1n65vRJ+wpCWDOe+FlVLc6DpciU6+47rSMu q810VeLGZSZJljAsTJUnRVX+BrtSbXasQIrJAfqkmBZL7hullAtffpsWKjkD7OPYse0E mG0L8BgNzB0dYPmj09LB0iDaZMu8iUFF4MVc7CtJhjku952ilgbqV/2Ywy08pDm92tbG 2lwKTGyNb7GiUTTrwiIfYtc1a03ARq9lVlPU+j/oA7HroIf58xywlHlZNfsjon+qA0y1 G4mw== 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=/Sy990J4/bSyJ2MUOFnBTE3J18aXIUxVHSp96VWFZz0=; b=g9p2JFWhofznTDpjK3cxgNhb73iO7EC3o85wjraSTSpNQRXn64h8ern/IjghrfwaeH YwMuZHyGp5aEucmiJ3HMKlVMR6jFSaihfP4IEdl9V5Ig+CSBaLk0ZLXRTb3SuJTZTd0U npWGnVnErOIck69IkDyLXRzKHbP0VcEht260UcTEdne6YmWXJW7iEim40Adp8BrN+kNJ SQhM+Qf6eswly/ZxTa5MyQmQvAHovaZfEUKIfPrjtNdZcuBOT4Uq1axuuioVOUQ+NGEX erGJpXosX3DO6j+0rdE7/8Dl1K+yc+0t+CCYRjB7358GRmw1bvLvld8bdxNxPX8szV7k +QWg== 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 g17-v6si6214955pfo.130.2018.10.13.23.36.08; Sat, 13 Oct 2018 23:36:23 -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 S1726515AbeJNOOO (ORCPT + 99 others); Sun, 14 Oct 2018 10:14:14 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:42566 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726356AbeJNOON (ORCPT ); Sun, 14 Oct 2018 10:14:13 -0400 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id F042A2A1C6; Sun, 14 Oct 2018 02:34:17 -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: <022a8c581d228f3f01dfa783aadd183a53169daa.1539497520.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH v2 1/6] zorro_esp: Limit DMA transfers to 65535 bytes Date: Sun, 14 Oct 2018 17:12:00 +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 Tested-by: 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.18.1