Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp315442imm; Thu, 2 Aug 2018 19:56:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd9NtHs9HUV/R/FkLlrqa5/3SzTDZsntgNoBsCNMc9Try9IKqW65/YPC0PBg6fjoy4Ea3ZL X-Received: by 2002:a17:902:7586:: with SMTP id j6-v6mr1784593pll.295.1533265019753; Thu, 02 Aug 2018 19:56:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533265019; cv=none; d=google.com; s=arc-20160816; b=pbiUjuQWsn8IP0QX/Dwo0Pb3YWYcqKHuacoZVxZI25kV+WrgxnrRaDu7LpHAcVG915 SqtDrSBKuAVoOjD/wY3KTITa+5GujiCzqMX8Hw8GpoXi6rLX+8Gmuh8nIWQPysO4lbVO jtdVKDXQNtv0KyOAngfrootrYrQjiCHLA3N5GOpFsrthQF5zN3PFadUcxv5aXCoZ2UKQ ygh7FLgB5Ve7mTXimSl6YL4mxPNhw2YEuXhXEg03eSn8T+SyfE4qNt5m8tozkfUqHHdN 9fQruFd2bLgEJenBnY9KjkuHF72k52GKEwG733uzkwMEDCMIoFXIFXj22n/DQCrkK5wH WZ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date:arc-authentication-results; bh=eNnpN+AFc9Lx3kdH+M3iHEzA7okrHokWlHnnbmUqp6I=; b=TbbvfzSAgoir+HjXDPZKaSFba8BQxXHWRfp5yuzWzRhfyh5RsOVJ9qJehbanq0IUe8 y12FY9O62Oo43XlbEVpihEr37Z/oJ6ptKtQHFC+V+qrz/BUIVS2ncAI1RN/ZcnSzFXrU b5o32Sg/K3Xk6nj9f+7NjcyubQIFZJNJtsZYa86mRHBBcAFjH+eyPXdokP4n/zDfb+fa avVmcNNdMgogreALy/fTIH8HaF7I12Dw6zufjnm5L/NufyQQ/71HD1jBckZjRw9ItEEw RxsEZUmUfjWFNti7QLMNA/lv/TbAxsZHPFRkpZd3h25u8v9wym/Ewt1OMYzM7xMA65YK 42Jw== 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 1-v6si2665429ply.354.2018.08.02.19.56.44; Thu, 02 Aug 2018 19:56:59 -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 S1726602AbeHCEuB (ORCPT + 99 others); Fri, 3 Aug 2018 00:50:01 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:59394 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbeHCEuB (ORCPT ); Fri, 3 Aug 2018 00:50:01 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 7C87D27E24; Thu, 2 Aug 2018 22:55:54 -0400 (EDT) Date: Fri, 3 Aug 2018 12:56:23 +1000 (AEST) From: Finn Thain To: Michael Schmitz cc: zhong jiang , Bart Van Assche , "jejb@linux.vnet.ibm.com" , "martin.petersen@oracle.com" , "andy.shevchenko@gmail.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "john.garry@huawei.com" Subject: Re: [PATCH] scsi:NCR5380: remove same check condition in NCR5380_select In-Reply-To: <928ae07a-8c4a-05fc-16af-48fb6e9c341d@gmail.com> Message-ID: References: <1533179408-20631-1-git-send-email-zhongjiang@huawei.com> <5B627E71.5020600@huawei.com> <928ae07a-8c4a-05fc-16af-48fb6e9c341d@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2 Aug 2018, Michael Schmitz wrote: > > This redundant load of the ICR has been in the driver code for a long > time. There's a small chance it is intentional, Actually, it is intentional. > so at least minimal testing might be in order. > Minimal testing is almost useless if you are trying to prove the absence of race conditions. SCSI arbitration is a race between targets by design; so a race between the CPU and the 5380 is going to be hard to observe. > Finn - does the ICR_ARBITRATION_LOST bit have to be cleared by a write > to the mode register? > Something like that: the write to the mode register does clear the ICR_ARBITRATION_LOST bit, because it clears the MR_ARBITRATE bit. > In that case, the first load would have been redundant and can be > omitted without changing driver behaviour? This code is a faithful rendition of the arbitration flow chart in the datasheet, so even if you are right, I wouldn't want to change the code. Besides, I think your argument assumes that ICR and MR are synchronized, and also assumes that targets are obeying the spec. -- > Cheers, > > Michael > >