Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2618389imm; Sun, 14 Oct 2018 00:35:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV63JR5MrpXEzXS9t0JQEjtBy/bDbDrkrQ1GKCVgXQ2phro5h1sXzBrDqhIRhT4Uthy+UWPKG X-Received: by 2002:a62:425b:: with SMTP id p88-v6mr12857074pfa.96.1539502553769; Sun, 14 Oct 2018 00:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539502553; cv=none; d=google.com; s=arc-20160816; b=CpDxTJ/bDcVDwdnkBD2DEXzg4u8Wu1aRl2FMBYd2bZZZdRovOtDWjH/20xNnLsu1Rg vibX2ilFRf9M8qZc+U7oBOzDnZTQEoFNBy8Zmoy468ayROZ28oQXxYr2t5ve7iFxS5yB qdKrQfo7SKN92tU+aEZON2VY5NeD17G9cU9Jqm26mwDj48dCCtt4DTdZzcLPHROEm8ME II+6hDk0iMzszagTHiaqdg35l8UuU4MWZrDAL5YQ4AO7abCr+W0gq7Tj/nRVAUCWfV2P yfJgJiBTVelU2ah/0e7sS7pyVLr2TUujobouBjbI8QhNFlX3FyTgtLnbcFpRFwshNLPe B5dg== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=xrEAzE94gTclvu/rFqA5CT7mODu4kML+W0LD6u+FTkw=; b=Od0XhbTlKXvdG3kwFWME1gKjs9qQv9me1323PqIQwKFEv0VFhwN3YapdirT38x8Edq 7VVyWTCJj6OubIfc/H8kY3c3rsvaP5UKhG0G9IYMptQekaHIEF/hiMlLbDtRG3N5QbZr /QbuL4boVg4wmG+A7YgxT9kPEvpgBBlHMapMod3tyZstLx+wdWUUPRcbSRCoZCJeoXDV iRLkd0sWf4snlyRYB6hcBpdj1Cz48TGNHPlgaVq+BsaLT29RIvh5oMBZPG2O5NWxySW0 Bf48ORfGAe0qdew6vj0r0xBjbZZHCX/bs8u2G7fHDJUlaEndmcX1FXiyI+/F0XNAd1fA vaDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qV0lA7DO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h32-v6si6884060pgb.290.2018.10.14.00.35.38; Sun, 14 Oct 2018 00:35:53 -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=@gmail.com header.s=20161025 header.b=qV0lA7DO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726413AbeJNPPW (ORCPT + 99 others); Sun, 14 Oct 2018 11:15:22 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33066 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbeJNPPW (ORCPT ); Sun, 14 Oct 2018 11:15:22 -0400 Received: by mail-pf1-f196.google.com with SMTP id 78-v6so5776074pfq.0; Sun, 14 Oct 2018 00:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=xrEAzE94gTclvu/rFqA5CT7mODu4kML+W0LD6u+FTkw=; b=qV0lA7DOR/XSWBIl1ip1FTT9CQMvJOytZHIKeP9Ctw91I4PUeNpgDgGChc5gVxwoIM yS/Vwpx/aYLFOtsAkjgHyI4VJSIwQFiSwn9eAWDFG3cIvLo4YFKIb7UDUCAwm5x/g+26 fYElyDOcJXtjSw/bHTcngUK5tr2RUT2p44frWIH0A/VUNC23n/+5gcr4mEwl2UQYzXjo 5TtaE1L9R+PHUMIfJVmi2zw1KtrDwGjPFat5t8Ina8LXJNxDAjw078GWk7vVavY47+nP 8P4yh487lNKAJPEvpJ+Vf9bsGzeqJXeUknBFxe3kidmMV/HstPZdwGTyQnRQS8TlpKIG i56A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=xrEAzE94gTclvu/rFqA5CT7mODu4kML+W0LD6u+FTkw=; b=Qcys8jXdEsbsLxcA/JGeaIsp1HY85MYzqK3g6qAyq1sTe0yJpLmYWMSiWU/KWvqe6R GIIbIgyyfndNNoBwp8uvN5dmL0K9YKARAKzcIAoctMaqdEVF5rwRFNAJjS2qbIQ8vlFK JU7sUe8UCDvyCfEfOt/2QdgqE1Me7tOZsrBtRtGkRTAX34YEQKh6knlM6Vx77y1UN9rq Xz4CGbJ/9eQUT9HA/HCTpQgBkj8P0wgVmzDW0V+FSNMc3Bsn+RZ6i0VOEvzObYFXPqFm 5hLCUdwO6ab8pjCYY4tuwQFe5dDaFKpnPvtkOHszWYE7yLd34CXF2yWs0+x1E1x+vej8 BfxQ== X-Gm-Message-State: ABuFfoj+6zhlaHX/qmlmiF6T8UowDSJH2Y6pFfvu5Et4ckA/LzCJhqYi Rnf+0vgUzW9eMkOVicm4GqR6camJZ2I= X-Received: by 2002:a63:525c:: with SMTP id s28-v6mr11546902pgl.78.1539502515670; Sun, 14 Oct 2018 00:35:15 -0700 (PDT) Received: from [192.168.1.101] (122-62-216-69-adsl.sparkbb.co.nz. [122.62.216.69]) by smtp.gmail.com with ESMTPSA id a14-v6sm7947273pgi.75.2018.10.14.00.35.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Oct 2018 00:35:15 -0700 (PDT) Subject: Re: [PATCH v2 1/6] zorro_esp: Limit DMA transfers to 65535 bytes To: Finn Thain , "James E.J. Bottomley" , "Martin K. Petersen" References: <022a8c581d228f3f01dfa783aadd183a53169daa.1539497520.git.fthain@telegraphics.com.au> Cc: Hannes Reinecke , linux-scsi@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org From: Michael Schmitz Message-ID: <19de2671-ea20-3917-7ed6-4b8217fe17ad@gmail.com> Date: Sun, 14 Oct 2018 20:35:23 +1300 User-Agent: Mozilla/5.0 (X11; Linux ppc; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <022a8c581d228f3f01dfa783aadd183a53169daa.1539497520.git.fthain@telegraphics.com.au> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Finn, thanks for spotting this! Am 14.10.2018 um 19:12 schrieb Finn Thain: > 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 Reviewed-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 */ >