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]
Date:   Thu, 2 Aug 2018 19:32:37 +1200
From:   Michael Schmitz <schmitzmic@...il.com>
To:     zhong jiang <zhongjiang@...wei.com>,
        Bart Van Assche <Bart.VanAssche@....com>
Cc:     "jejb@...ux.vnet.ibm.com" <jejb@...ux.vnet.ibm.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "fthain@...egraphics.com.au" <fthain@...egraphics.com.au>,
        "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



Am 02.08.2018 um 15:45 schrieb zhong jiang:
> On 2018/8/2 11:26, Bart Van Assche wrote:
>> On Thu, 2018-08-02 at 11:10 +0800, zhong jiang wrote:
>>> The same check condition is redundant, so remove one of them.
>>>
>>> Signed-off-by: zhong jiang <zhongjiang@...wei.com>
>>> ---
>>>  drivers/scsi/NCR5380.c | 3 +--
>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
>>> index 90ea0f5..2ecaf3f 100644
>>> --- a/drivers/scsi/NCR5380.c
>>> +++ b/drivers/scsi/NCR5380.c
>>> @@ -999,8 +999,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,
>>>
>>>  	/* Check for lost arbitration */
>>>  	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_read(CURRENT_SCSI_DATA_REG) & hostdata->id_higher_mask)) {
>>>  		NCR5380_write(MODE_REG, MR_BASE);
>>>  		dsprintk(NDEBUG_ARBITRATION, instance, "lost arbitration, deasserting MR_ARBITRATE\n");
>>>  		spin_lock_irq(&hostdata->lock);
>> Has this patch been tested?
>  I check the issue by doubletest.cocci. Just review the code by myself. Maybe I miss something else.
>  please tell let me know if you any objection.

This redundant load of the ICR has been in the driver code for a long 
time. There's a small chance it is intentional, so at least minimal 
testing might be in order.

Finn - does the ICR_ARBITRATION_LOST bit have to be cleared by a write 
to the mode register? In that case, the first load would have been 
redundant and can be omitted without changing driver behaviour?

Cheers,

	Michael


>
>  Thanks
>  zhong jiang
>> Thanks,
>>
>> Bart.
>>
>>
>>
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ