Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1394741ybc; Sat, 16 Nov 2019 22:30:48 -0800 (PST) X-Google-Smtp-Source: APXvYqz+bmBWVz5lnTvZQIO3o0S2D5+A72ejt2oh1Vme4PKuJFfLt2cLDQMDwCcLyx9B6NmYhYAl X-Received: by 2002:a17:906:8591:: with SMTP id v17mr16051840ejx.185.1573972248470; Sat, 16 Nov 2019 22:30:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573972248; cv=none; d=google.com; s=arc-20160816; b=Aua7jJV2/OEiot2JAgXEEaQHxA1BwryqiBtxU+vgSaFmULfhrlCSLLx6J5ODnqW4WY vDCxJv2WcgjZ6QLWuUX9A/ns/D8xp+fbDY4dSlpzzucTtLvVyXc76HQHk3VVu/xfmAlw ETgD2uhKfMsj9N+rZNz526u0fKdz770cxOEhzt4qiO4cC/6LvYe6FmHMMwOJ87Y0mKsK uF6rNybccQ7HjsnDTjyaAJ0fSG7nxE6x+bCU65t74QokRVopqZ2Lz2EqQL2AQkGAD/2O 6ZgvCowdO0dwokyYeA0bVjf75jfisMi6y5/DCCBCTZc5NoCVoNtF4JJf/5kRgUpRyLRV WkBA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=vx0c09j/CuLVUe7o7wtKPmOKjbpNdRigdxvVVN0y07Y=; b=wHRIyz9QTdS7CaYx2yLMQffgmX3yUQ9QDNVLmAZDAAxhReiVmxzBoJZFgCZNZJqvkZ +LPn5L52byVYnOryqqtC0EwrtDMqpnW5YFE3c9RTo8uIJ6kaFptjNwoASl25cys78ajv 61ntc2iP4F5B2HozFwUpIAD+gz/z3c9adVuxZgn1/sTqKZWjfjQh8m6+foENDhaFp8wp Cy2M+8OEY/DYjabHlsIrGnsuo0QJJxsUHEomDzwGGjYp6B5opEI7yyX3UngitGOtuk67 fILG7vQnXL2PXbUAcxHvbM2s/T4DGjnRz4HTl/kFkkzZz4IhFsLpmZJ3kUcUDXcgSDjd e7ZQ== 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 c15si9305322ejd.74.2019.11.16.22.30.23; Sat, 16 Nov 2019 22:30:48 -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; 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 S1726059AbfKQG0a convert rfc822-to-8bit (ORCPT + 99 others); Sun, 17 Nov 2019 01:26:30 -0500 Received: from smtpq3.tb.mail.iss.as9143.net ([212.54.42.166]:44428 "EHLO smtpq3.tb.mail.iss.as9143.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbfKQG0a (ORCPT ); Sun, 17 Nov 2019 01:26:30 -0500 Received: from [212.54.42.110] (helo=smtp7.tb.mail.iss.as9143.net) by smtpq3.tb.mail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iWE0x-0007YD-OO; Sun, 17 Nov 2019 07:26:27 +0100 Received: from mail-wr1-f48.google.com ([209.85.221.48]) by smtp7.tb.mail.iss.as9143.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1iWE0x-0006Gp-KN; Sun, 17 Nov 2019 07:26:27 +0100 Received: by mail-wr1-f48.google.com with SMTP id t1so15698555wrv.4; Sat, 16 Nov 2019 22:26:27 -0800 (PST) X-Gm-Message-State: APjAAAUWyX6EW93DYvOqoWxmCGEel5fYnfh4NMFQs8x+XksIc3YihCTL 2GVzWkcBMD94/QL978LkZHmtAfUsHZZ5mQ8RajM= X-Received: by 2002:adf:e391:: with SMTP id e17mr4518946wrm.372.1573971987207; Sat, 16 Nov 2019 22:26:27 -0800 (PST) MIME-Version: 1.0 References: <2bbb6359d542f5882be67c415ecc25ad2d9eeb5e.1573875417.git.fthain@telegraphics.com.au> In-Reply-To: <2bbb6359d542f5882be67c415ecc25ad2d9eeb5e.1573875417.git.fthain@telegraphics.com.au> From: Kars de Jong Date: Sun, 17 Nov 2019 07:26:16 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] esp_scsi: Clear Transfer Count registers before PIO transfers To: Finn Thain Cc: "James E.J. Bottomley" , "Martin K. Petersen" , Michael Schmitz , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-SourceIP: 209.85.221.48 X-Authenticated-Sender: karsdejong@home.nl (via SMTP) X-Ziggo-spambar: / X-Ziggo-spamscore: 0.0 X-Ziggo-spamreport: CMAE Analysis: v=2.3 cv=cPSeTWWN c=1 sm=1 tr=0 a=9+rZDBEiDlHhcck0kWbJtElFXBc=:19 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=MeAgGD-zjQ4A:10 a=8981fWPbAAAA:8 a=-vbD31fikyHGdj6aEf8A:9 a=QEXdDO2ut3YA:10 a=o72u2rHnfW5qNJ_4I8LD:22 X-Ziggo-Spam-Status: No X-Spam-Status: No X-Spam-Flag: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Finn, Op za 16 nov. 2019 om 04:36 schreef Finn Thain : > > The zorro_esp driver uses both PIO and DMA transfers. If a failed DMA > transfer happened to be followed by a PIO transfer, the TCLOW and TCMED > registers would not get cleared. It is theoretically possible that the > stale value from the transfer counter or the TCLOW/TCMED registers > could then be used by the controller and the driver. Avoid that by > clearing these registers before each PIO transfer. Are you sure this is really needed? The only place where the driver reads these registers is after a data transfer. These are done using DMA on all Zorro boards, so I don’t think there’s a risk of stale values from a PIO transfer there. The only place the controller reads these registers is when a DMA command is issued. The only place where that is done is in the zorro_esp send_dma_command() functions. These all set both registers explicitly before issuing the DMA command to the controller, so I don’t think there’s a risk there either. Kind regards, Kars.