<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/scsi/arcmsr, branch v4.16-rc4</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>scsi: arcmsr: avoid do_gettimeofday</title>
<updated>2018-01-23T01:04:02+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-01-21T23:12:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=45596c7889a4454e340863c112dbc6cf525e5647'/>
<id>45596c7889a4454e340863c112dbc6cf525e5647</id>
<content type='text'>
The arcmsr uses its own implementation of time_to_tm(), along with
do_gettimeofday() to read the current time. While the algorithm used
here is fine in principle, it suffers from two problems:

- it assigns the seconds portion of the timeval to a 32-bit unsigned
  integer that overflows in 2106 even on 64-bit architectures.

- do_gettimeofday() returns a time_t that overflows in 2038 on all
  32-bit systems.

This changes the time retrieval function to ktime_get_real_seconds(),
which returns a proper 64-bit value, and replaces the open-coded
time_to_tm() algorithm with a call to the safe time64_to_tm().

I checked way all numbers are indexed and found that months are given in
range 0..11 while the days are in range 1..31, same as 'struct tm', but
the year value that the firmware expects starts in 2000 while 'struct
tm' is based on year 1900, so it needs a small adjustment.

[mkp: checkpatch tweaks]

Fixes: b416c099472a ("scsi: arcmsr: Add a function to set date and time to firmware")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The arcmsr uses its own implementation of time_to_tm(), along with
do_gettimeofday() to read the current time. While the algorithm used
here is fine in principle, it suffers from two problems:

- it assigns the seconds portion of the timeval to a 32-bit unsigned
  integer that overflows in 2106 even on 64-bit architectures.

- do_gettimeofday() returns a time_t that overflows in 2038 on all
  32-bit systems.

This changes the time retrieval function to ktime_get_real_seconds(),
which returns a proper 64-bit value, and replaces the open-coded
time_to_tm() algorithm with a call to the safe time64_to_tm().

I checked way all numbers are indexed and found that months are given in
range 0..11 while the days are in range 1..31, same as 'struct tm', but
the year value that the firmware expects starts in 2000 while 'struct
tm' is based on year 1900, so it needs a small adjustment.

[mkp: checkpatch tweaks]

Fixes: b416c099472a ("scsi: arcmsr: Add a function to set date and time to firmware")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: arcmsr: simplify arcmsr_request_device_map routine</title>
<updated>2017-12-21T02:11:51+00:00</updated>
<author>
<name>Ching Huang</name>
<email>ching2048@areca.com.tw</email>
</author>
<published>2017-12-13T08:33:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ae9abe0bde53fb92c51d0f4e2a3f310a1cf5d38'/>
<id>6ae9abe0bde53fb92c51d0f4e2a3f310a1cf5d38</id>
<content type='text'>
Simplify arcmsr_request_device_map routine.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simplify arcmsr_request_device_map routine.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: arcmsr: simplify all arcmsr_hbaX_get_config routine by call a new get_adapter_config function</title>
<updated>2017-12-21T02:11:50+00:00</updated>
<author>
<name>Ching Huang</name>
<email>ching2048@areca.com.tw</email>
</author>
<published>2017-12-12T10:53:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1e9c81080ddc1076d7735502f3ed778e4b96d3e3'/>
<id>1e9c81080ddc1076d7735502f3ed778e4b96d3e3</id>
<content type='text'>
Simplify all arcmsr_hbaX_get_config routine by call a new
get_adapter_config function.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simplify all arcmsr_hbaX_get_config routine by call a new
get_adapter_config function.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: arcmsr: simplify arcmsr_hbaE_get_config function</title>
<updated>2017-12-21T02:11:50+00:00</updated>
<author>
<name>Ching Huang</name>
<email>ching2048@areca.com.tw</email>
</author>
<published>2017-12-12T10:50:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=22c4ae5b9906afcaea6184092a78b9164dfebcae'/>
<id>22c4ae5b9906afcaea6184092a78b9164dfebcae</id>
<content type='text'>
Simplify arcmsr_hbaE_get_config function.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simplify arcmsr_hbaE_get_config function.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: arcmsr: waiting for iop firmware ready before issue get_config command to iop</title>
<updated>2017-12-21T02:11:49+00:00</updated>
<author>
<name>Ching Huang</name>
<email>ching2048@areca.com.tw</email>
</author>
<published>2017-12-12T10:48:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b6b3084acb58cced555cd6710a345f0080c31737'/>
<id>b6b3084acb58cced555cd6710a345f0080c31737</id>
<content type='text'>
Waiting for iop firmware ready before issue get_config command to iop
for adapter type A and D.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Waiting for iop firmware ready before issue get_config command to iop
for adapter type A and D.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: arcmsr: simplify arcmsr_hbaC_get_config function</title>
<updated>2017-12-21T02:11:49+00:00</updated>
<author>
<name>Ching Huang</name>
<email>ching2048@areca.com.tw</email>
</author>
<published>2017-12-12T10:42:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=df9f0ee9d57166501516eb8b93fe54a4b88534d6'/>
<id>df9f0ee9d57166501516eb8b93fe54a4b88534d6</id>
<content type='text'>
Simplify arcmsr_hbaC_get_config function.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simplify arcmsr_hbaC_get_config function.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: arcmsr: remove redundant check for secs &lt; 0</title>
<updated>2017-12-12T02:37:08+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2017-12-09T00:34:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3c62ecda0e24f4ae84181184457d4e37f5250c7f'/>
<id>3c62ecda0e24f4ae84181184457d4e37f5250c7f</id>
<content type='text'>
The check for secs being less than zero is redundant for two reasons.
Firstly, secs is unsigned so the check is always going to be false.
Secondly, if secs was signed the proceeding calculation of secs is never
going to be negative.  Hence we can remove this redundant check and day
and secs re-adjustment.

Detected by static analysis with smatch:
arcmsr_set_iop_datetime() warn: unsigned 'secs' is never less than zero.

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Acked-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The check for secs being less than zero is redundant for two reasons.
Firstly, secs is unsigned so the check is always going to be false.
Secondly, if secs was signed the proceeding calculation of secs is never
going to be negative.  Hence we can remove this redundant check and day
and secs re-adjustment.

Detected by static analysis with smatch:
arcmsr_set_iop_datetime() warn: unsigned 'secs' is never less than zero.

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Acked-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: arcmsr: Fix command result for CHECK_CONDITION</title>
<updated>2017-12-07T00:32:42+00:00</updated>
<author>
<name>Ching Huang</name>
<email>ching2048@areca.com.tw</email>
</author>
<published>2017-12-05T03:28:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fa576b43f66ef67d1db5730b5745c468b1f9ed2b'/>
<id>fa576b43f66ef67d1db5730b5745c468b1f9ed2b</id>
<content type='text'>
Fix report command result error when CHECK_CONDITION.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix report command result error when CHECK_CONDITION.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: arcmsr: Update driver version to v1.40.00.04-20171130</title>
<updated>2017-12-07T00:32:41+00:00</updated>
<author>
<name>Ching Huang</name>
<email>ching2048@areca.com.tw</email>
</author>
<published>2017-12-05T02:29:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bc81192eda8d94ab7a8d0040c44a58293516223a'/>
<id>bc81192eda8d94ab7a8d0040c44a58293516223a</id>
<content type='text'>
Update driver version to v1.40.00.04-20171130

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update driver version to v1.40.00.04-20171130

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: arcmsr: Add driver module parameter msix_enable</title>
<updated>2017-12-07T00:32:41+00:00</updated>
<author>
<name>Ching Huang</name>
<email>ching2048@areca.com.tw</email>
</author>
<published>2017-12-05T02:26:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=07640404bda59a6be3dea4ed2b9e6330c809112b'/>
<id>07640404bda59a6be3dea4ed2b9e6330c809112b</id>
<content type='text'>
Add module parameter msix_enable so user has the option of disabling
MSI-X interrupts if there is a platform problem.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add module parameter msix_enable so user has the option of disabling
MSI-X interrupts if there is a platform problem.

Signed-off-by: Ching Huang &lt;ching2048@areca.com.tw&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
