Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5990712ybc; Wed, 27 Nov 2019 13:01:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyPrPfubpwP/cWHXCDWOXPwoAWk+uZWLl0DSJYu/H423Redddqfyyji6egv9Z8tYgTXDOJk X-Received: by 2002:aa7:c756:: with SMTP id c22mr33869367eds.25.1574888515014; Wed, 27 Nov 2019 13:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888515; cv=none; d=google.com; s=arc-20160816; b=oPv0aGJnKPVpsAGoVQE+FlEowyTJ6ToYOfYuMFomRUJtYQ9G33RBsfcggzhHx0SeCL ko4wFca3fMt8EmLBYnV3J5dvYdO2GKeNiGrqNhlpf1hq36kaRK7CP8nbObNEYJWqcdE7 QlCraMpDoFCwYYQbPVv+NJpdlwLSzQmgd8PLrkDsYhcOnqlycuTPb9Z8GINA+8OmnpID SB61TjHUvFdY82QR4bfTmEFNYbG4SfNzkSdvayAKHX5wIibU+VMF7NFTh0vYZvrsfvwk oN/rmWJrZj4pFtKA+J968oED+rrj6rvgBcqiEJWj90M3U8nutqthpbBfibFWTvSUn7D0 OkEw== 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=JWB5jBoM0oLcAXLlCg2TPmTf26wzFWbXH12fMOAFQlA=; b=R9lgwyUXC1u4FfE2qhuNHyk/AY5wjdOd8uFyRH2WlKTEMvwzvpAmeCOh0xySJp6Bgk 3JedhzZ3ZjlLhEo4EZTElELJugUUjdiP6sQ1mD+ed55tLXD3HzDYRZoGei3HKkHnueNw GTKOEy+P301/MSWPRC9VbFQuzIUVfJeffzRQn5jbqMR2JEukh88LYa/5OsItP3YGkdDX YMcGbx+8N/+ytnX3qYgYUamsf3Bexn1S2OBTNKp8qjFYN0KDrOovZZ8OnBQaTMdSFGSM /HsIM0hVRQmadDQ2Nw6g8/+Ya1GSjL0bcszfemYfuOWyVmkYbXjl1nO0VKGG6xh6QQL9 +ZwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VC/5Rz5/"; 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 t30si12433422edi.207.2019.11.27.13.01.30; Wed, 27 Nov 2019 13:01:55 -0800 (PST) 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="VC/5Rz5/"; 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 S1727913AbfK0U6g (ORCPT + 99 others); Wed, 27 Nov 2019 15:58:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:49854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731331AbfK0U6b (ORCPT ); Wed, 27 Nov 2019 15:58:31 -0500 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 24350215B2; Wed, 27 Nov 2019 20:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888310; bh=/ZJI/4gyijIuk0UAleXk9pAGE4qXIMVC+2rzUpbTqLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VC/5Rz5/omUP6q3cCo1/DNvOU4Kopj+ONscvF1e8RTB2//PeXBbQECQlhRtJeJAS3 XgInYepBg6WPfbX5BbEabJzziRg9tMMe14aRkSO3AAZ7v6KWSGv1Qq8xE2gfu2te88 Nk8cO3Zl/CuN+bxqC3kdLxIaQi3ZAp9CJdEXpf2U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Finn Thain , Michael Schmitz , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 084/306] scsi: zorro_esp: Limit DMA transfers to 65535 bytes Date: Wed, 27 Nov 2019 21:28:54 +0100 Message-Id: <20191127203121.071497032@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@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 [ Upstream commit b7ded0e8b0d11b6df1c4e5aa23a26e6629c21985 ] 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 ("scsi: zorro_esp: New driver for Amiga Zorro NCR53C9x boards") Signed-off-by: Finn Thain Cc: Michael Schmitz Tested-by: Michael Schmitz Reviewed-by: Michael Schmitz Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- 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 bb70882e6b56e..be79127db5946 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.20.1