<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/hptnr, branch upstream/11.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r311305 (by asomers):</title>
<updated>2017-03-23T06:40:20+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2017-03-23T06:40:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6352900b3df2d8e5409dbf52d6b3d6c494817605'/>
<id>6352900b3df2d8e5409dbf52d6b3d6c494817605</id>
<content type='text'>
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR:		215474
Reported by:    Coverity
CID:            1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID:            1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID:            1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID:            1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID:            1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID:            1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID:            1010035 1010036 1010042 1010041 1010040 1010039
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR:		215474
Reported by:    Coverity
CID:            1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID:            1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID:            1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID:            1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID:            1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID:            1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID:            1010035 1010036 1010042 1010041 1010040 1010039
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r313554:</title>
<updated>2017-02-24T21:20:48+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-02-24T21:20:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=82196c7d0029b7f1df0d4bcd1b50faf66abba62d'/>
<id>82196c7d0029b7f1df0d4bcd1b50faf66abba62d</id>
<content type='text'>
Clean redundant MIN/MAX declarations in some HighPoint drivers.

The hpt27xx(4), hptnr(4), and hptrr(4) drivers declare MIN() and MAX()
internally which match the macros from sys/param.h.

MIN() is not used, MAX is only used once and can be replaced with the
max() version in libkern.h which operates on u_ints.

MFC after:	2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clean redundant MIN/MAX declarations in some HighPoint drivers.

The hpt27xx(4), hptnr(4), and hptrr(4) drivers declare MIN() and MAX()
internally which match the macros from sys/param.h.

MIN() is not used, MAX is only used once and can be replaced with the
max() version in libkern.h which operates on u_ints.

MFC after:	2 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>sys/dev: minor spelling fixes.</title>
<updated>2016-05-03T03:41:25+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2016-05-03T03:41:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=453130d9bfc1c6d68b366dfcb041689d69f81295'/>
<id>453130d9bfc1c6d68b366dfcb041689d69f81295</id>
<content type='text'>
Most affect comments, very few have user-visible effects.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most affect comments, very few have user-visible effects.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace several bus_alloc_resource() calls with bus_alloc_resource_any()</title>
<updated>2016-02-27T03:34:01+00:00</updated>
<author>
<name>Justin Hibbits</name>
<email>jhibbits@FreeBSD.org</email>
</author>
<published>2016-02-27T03:34:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=eff83876b694c469eb9385a3bc106c8f66c72e75'/>
<id>eff83876b694c469eb9385a3bc106c8f66c72e75</id>
<content type='text'>
Most of these are BARs, and we allocate them in their entirety.  The one outlier
in this is amdsbwd, which calls bus_set_resource() prior.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D5370 (partial)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most of these are BARs, and we allocate them in their entirety.  The one outlier
in this is amdsbwd, which calls bus_set_resource() prior.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D5370 (partial)
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace several bus_alloc_resource() calls using default arguments with bus_alloc_resource_any()</title>
<updated>2016-02-19T03:37:56+00:00</updated>
<author>
<name>Justin Hibbits</name>
<email>jhibbits@FreeBSD.org</email>
</author>
<published>2016-02-19T03:37:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=43cd61606b6bfae52bb09856277751103bfa28fd'/>
<id>43cd61606b6bfae52bb09856277751103bfa28fd</id>
<content type='text'>
Since these calls only use default arguments, bus_alloc_resource_any() is the
right call.

Differential Revision: https://reviews.freebsd.org/D5306
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since these calls only use default arguments, bus_alloc_resource_any() is the
right call.

Differential Revision: https://reviews.freebsd.org/D5306
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge changes from vendor driver 1.1.4:</title>
<updated>2015-06-25T06:15:08+00:00</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2015-06-25T06:15:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7d379626b12e2bb4b66ea6a406fde6b82795904c'/>
<id>7d379626b12e2bb4b66ea6a406fde6b82795904c</id>
<content type='text'>
  v1.1.4 2015-06-09
   * Fix a bug that FailLED was not initialized properly.
  v1.1.3 2015-05-19
   * Support Report Luns command.
  v1.1.2 2015-05-05
   * Fix a bug that report wrong physical sector size for 512e HDD.

Many thanks to HighPoint for continued support of FreeBSD!

This driver update is intended for 10.2-RELEASE.

Submitted by:	Steve Chang
MFC after:	3 days
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  v1.1.4 2015-06-09
   * Fix a bug that FailLED was not initialized properly.
  v1.1.3 2015-05-19
   * Support Report Luns command.
  v1.1.2 2015-05-05
   * Fix a bug that report wrong physical sector size for 512e HDD.

Many thanks to HighPoint for continued support of FreeBSD!

This driver update is intended for 10.2-RELEASE.

Submitted by:	Steve Chang
MFC after:	3 days
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge changes from vendor driver version 1.1.1:</title>
<updated>2015-04-11T00:45:03+00:00</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2015-04-11T00:45:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e157d5973c7ccb33a3c1dc93dae7b04214062c7c'/>
<id>e157d5973c7ccb33a3c1dc93dae7b04214062c7c</id>
<content type='text'>
v1.1.1 2015-03-26
 * Support 4Kn drive.
 * Change the SCSI target ID of the disk to be the index of physical
   connetion to the HBA.
 * Support staggered drive spin up.
 * Fix a bug that command would be timeout because of improper
   interrupt service routine.
 * Error handling to avoid scsi command lost which caused system
   hang up.
 * Fix a bug that fail to get the devcie's serial number via
   FreeNAS WebGUI.

Many thanks to HighPoint for continued support of FreeBSD!

MFC after:	2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
v1.1.1 2015-03-26
 * Support 4Kn drive.
 * Change the SCSI target ID of the disk to be the index of physical
   connetion to the HBA.
 * Support staggered drive spin up.
 * Fix a bug that command would be timeout because of improper
   interrupt service routine.
 * Error handling to avoid scsi command lost which caused system
   hang up.
 * Fix a bug that fail to get the devcie's serial number via
   FreeNAS WebGUI.

Many thanks to HighPoint for continued support of FreeBSD!

MFC after:	2 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent overflow issues in timeout processing</title>
<updated>2014-11-21T21:01:24+00:00</updated>
<author>
<name>Steven Hartland</name>
<email>smh@FreeBSD.org</email>
</author>
<published>2014-11-21T21:01:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=85c9dd9d895261632d58cf98da6608b93dd5d7f8'/>
<id>85c9dd9d895261632d58cf98da6608b93dd5d7f8</id>
<content type='text'>
Previously, any timeout value for which (timeout * hz) will overflow the
signed integer, will give weird results, since callout(9) routines will
convert negative values of ticks to '1'. For unsigned integer overflow we
will get sufficiently smaller timeout values than expected.

Switch from callout_reset, which requires conversion to int based ticks
to callout_reset_sbt to avoid this.

Also correct isci to correctly resolve ccb timeout.

This was based on the original work done by Eygene Ryabinkin
&lt;rea@freebsd.org&gt; back in 5 Aug 2011 which used a macro to help avoid
the overlow.

Differential Revision:	https://reviews.freebsd.org/D1157
Reviewed by:	mav, davide
MFC after:	1 month
Sponsored by:	Multiplay
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, any timeout value for which (timeout * hz) will overflow the
signed integer, will give weird results, since callout(9) routines will
convert negative values of ticks to '1'. For unsigned integer overflow we
will get sufficiently smaller timeout values than expected.

Switch from callout_reset, which requires conversion to int based ticks
to callout_reset_sbt to avoid this.

Also correct isci to correctly resolve ccb timeout.

This was based on the original work done by Eygene Ryabinkin
&lt;rea@freebsd.org&gt; back in 5 Aug 2011 which used a macro to help avoid
the overlow.

Differential Revision:	https://reviews.freebsd.org/D1157
Reviewed by:	mav, davide
MFC after:	1 month
Sponsored by:	Multiplay
</pre>
</div>
</content>
</entry>
<entry>
<title>Update hptnr(4) driver to version 1.0.1 supplied by the vendor.</title>
<updated>2014-08-23T01:52:43+00:00</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2014-08-23T01:52:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=090234abd352e06767d85c3c67d6bd7ac7461d7b'/>
<id>090234abd352e06767d85c3c67d6bd7ac7461d7b</id>
<content type='text'>
v1.0.1 2014-8-19
  * Do not retry the command and reset the disk when failed to enable or
    disable spin up feature.
  * Fix up a bug that disk failed to probe if driver failed to access the
    10th LBA.
  * Fix a bug that request timeout but it has been completed in certain
    cases.
  * Support smartmontool for R750.

Many thanks to HighPoint for continued support of FreeBSD!

MFC after:	3 days
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
v1.0.1 2014-8-19
  * Do not retry the command and reset the disk when failed to enable or
    disable spin up feature.
  * Fix up a bug that disk failed to probe if driver failed to access the
    10th LBA.
  * Fix a bug that request timeout but it has been completed in certain
    cases.
  * Support smartmontool for R750.

Many thanks to HighPoint for continued support of FreeBSD!

MFC after:	3 days
</pre>
</div>
</content>
</entry>
<entry>
<title>Various fixes to hptnr(4):</title>
<updated>2014-08-05T23:39:35+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2014-08-05T23:39:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=630a43402356668b38fae65baf56b513c3fa966d'/>
<id>630a43402356668b38fae65baf56b513c3fa966d</id>
<content type='text'>
- Use the existing vbus locks instead of Giant for the CAM sim lock.
- Use callout(9) instead of timeout(9).
- Mark the interrupt handler MPSAFE.
- Don't attempt to pass data in the softc from probe() to attach().
- Remove compat shims for FreeBSD versions older than 8.0.

Reviewed by:	Steve Chang &lt;ychang@highpoint-tech.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Use the existing vbus locks instead of Giant for the CAM sim lock.
- Use callout(9) instead of timeout(9).
- Mark the interrupt handler MPSAFE.
- Don't attempt to pass data in the softc from probe() to attach().
- Remove compat shims for FreeBSD versions older than 8.0.

Reviewed by:	Steve Chang &lt;ychang@highpoint-tech.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
