Re: [PATCH v2] scsi: NCR5380: use msecs_to_jiffies for conversions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 01 Feb 2015, Michael Schmitz wrote:

> Finn, Nicholas,
>
>> On Sat, 31 Jan 2015, Nicholas Mc Guire wrote:
>>
>>> This is only an API consolidation to make things more readable.
>>>
>>> Instances of  var * HZ / 1000  are replaced by  msecs_to_jiffies(var).
>>
>> ... and some instances of "value" are replaced by  
>> "msecs_to_jiffies(value)"
>> which seems to be completely wrong.
>
> The values for USLEEP_* are taken to be in units jiffies, according to  
> comments in NCR5380.c. Replacing them by the msecs_to_jiffies conversion 
> is in fact wrong.
>
> Please drop the changes to g_NCR5380.c for that reason.
>

right the comment indicates it should be jiffies - my interpretation
of that was that in NCR5380.c 
were  jiffies + (250 * HZ / 1000); constructs would be correctly
converted to e.g. jiffies + msecs_to_jiffies(250)

And defines like USLEEP_POLL are noted to be in jiffies:
* USLEEP_SLEEP - amount of time, in jiffies, to sleep

and then defined correctly as HZ indepenedent values:
#define USLEEP_SLEEP (20*HZ/1000)

and thus should be the same as msecs_to_jiffies(20)

now g_NCR5380.c defines
#define USLEEP_POLL     1
#define USLEEP_SLEEP    20
#define USLEEP_WAITLONG 500

for the DTC3181E card - but without the conversion to ms
from the use in the code though (e.g NCR5380_set_timer) it 
seemed to me that it actually should be jiffeis equivalent ms and
the intent was only to change the USLEEP_POLL and USLEEP_WAITLONG 
settings for the specific device but not the unit and thus it 
shuld have been converted by msecs_to_jiffies(1) resp. 
msecs_to_jiffies(500). The problem with this if it is left in its 
current form is that the timeouts would actually depend on the HZ
setting of the system which is probably not the intent.

Pleas do give this one more look if the argument above is
not sound I appologize for the noise.

thx!
hofrat
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux