lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.21.1808031548290.34@nippy.intranet>
Date:   Fri, 3 Aug 2018 16:04:33 +1000 (AEST)
From:   Finn Thain <fthain@...egraphics.com.au>
To:     Michael Schmitz <schmitzmic@...il.com>
cc:     zhong jiang <zhongjiang@...wei.com>,
        Bart Van Assche <Bart.VanAssche@....com>,
        "jejb@...ux.vnet.ibm.com" <jejb@...ux.vnet.ibm.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "andy.shevchenko@...il.com" <andy.shevchenko@...il.com>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "john.garry@...wei.com" <john.garry@...wei.com>
Subject: Re: [PATCH] scsi:NCR5380: remove same check condition in
 NCR5380_select

On Fri, 3 Aug 2018, Michael Schmitz wrote:

> > > 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.
> 
> Yes, but is that the only way the bit can get cleared? [...]

Short of a reset, yes.

> 
> > > 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.
> 
> I think that's a pretty clear hint that the 'arbitration lost' condition 
> isn't latched. [...]

It's not a hint. It's just an algorithm with fewer assumptions than the 
one you proposed.

As for latching, the datasheet is pretty clear on that. Writing MR_BASE to 
the mode register clears the ICR_ARBITRATION_LOST bit. As in,

        if ((NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) ||
            (NCR5380_read(CURRENT_SCSI_DATA_REG) & hostdata->id_higher_mask) ||
            (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST)) {
                NCR5380_write(MODE_REG, MR_BASE);

-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ