<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/mpr, branch release/12.3.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F12.3.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F12.3.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2021-01-11T14:43:37Z</updated>
<entry>
<title>mpr, mps: Fix a stack buffer overflow in the user passthru ioctl</title>
<updated>2021-01-11T14:43:37Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2021-01-08T18:32:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ed6fa9d618bff47dcd3fb000e5805e29d331578d'/>
<id>urn:sha1:ed6fa9d618bff47dcd3fb000e5805e29d331578d</id>
<content type='text'>
Previously we copied in the request into a stack-allocated structure
that could be smaller than the request size.  Furthermore, we checked
the request size only after doing the copyin.

Fix this by allocating a buffer to hold the request, then copying the
buffer's contents into a command descriptor.  This is a bit heavy-handed
but I expect the overhead will not be noticeable.  The approach of
coping the header in first is susceptible to TOCTOU problems.

Reviewed by:	imp
Reported by:	maxpl0it@protonmail.com
Differential Revision:	https://reviews.freebsd.org/D27963

(cherry picked from commit de828a91db29fb20440e0d92f3d3136b314a9584)
</content>
</entry>
<entry>
<title>mpr, mps: Fix an off-by-one bug in the BTDH_MAPPING ioctl</title>
<updated>2021-01-11T14:43:17Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2021-01-08T18:32:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ee01a1e7d862a5a33b43b8ae9da220d83f089c21'/>
<id>urn:sha1:ee01a1e7d862a5a33b43b8ae9da220d83f089c21</id>
<content type='text'>
The device mapping table contains sc-&gt;max_devices entries, so only
indices in [0, sc-&gt;max_devices) are valid.

Differential Revision:	https://reviews.freebsd.org/D27964

(cherry picked from commit adc0dcc352bb9f5a67a054d95c6959ea5aa26d91)
</content>
</entry>
<entry>
<title>MFC r367044: Introduce support of SCSI Command Priority.</title>
<updated>2020-11-24T13:17:12Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-11-24T13:17:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4b74fa5dd5aef9786aee4f9359be15b9da9a096d'/>
<id>urn:sha1:4b74fa5dd5aef9786aee4f9359be15b9da9a096d</id>
<content type='text'>
SAM-3 specification introduced concept of Task Priority, that was renamed
to Command Priority in SAM-4, and supported by all modern SCSI transports.
It provides 15 levels of relative priorities: 1 - highest, 15 - lowest and
0 - default.  SAT specification for SATA devices translates priorities 1-3
into NCQ high priority.

This change adds new "priority" field into empty spots of struct ccb_scsiio
and struct ccb_accept_tio of CAM and struct ctl_scsiio of CTL.  Respective
support is added into iscsi(4), isp(4), mpr(4), mps(4) and ocs_fc(4) drivers
for both initiator and where applicable target roles.  Minimal support was
added to CTL to receive the priority value from different frontends, pass it
between HA controllers and report in few places.

This patch does not add consumers of this functionality, so nothing should
really change yet, since the field is still set to 0 (default) on initiator
and not actively used on target.  Those are to be implemented separately.

I've confirmed priority working on WD Red SATA disks connected via mpr(4)
and properly transferred to CTL target via iscsi(4), isp(4) and ocs_fc(4).

While there, added missing tag_action support to ocs_fc(4) initiator role.
</content>
</entry>
<entry>
<title>MFC r363852: Remove extra memset() left after r342388.</title>
<updated>2020-08-11T00:41:48Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-08-11T00:41:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0611f3541ea76c9498330a78f6abd7cca4795321'/>
<id>urn:sha1:0611f3541ea76c9498330a78f6abd7cca4795321</id>
<content type='text'>
This memset() wiped MPI2_FUNCTION_SCSI_TASK_MGMT set by mprsas_alloc_tm(),
that broke target reset on device removal, making later re-insertion into
the same slot impossible, since firmware was still waiting for the driver
to finish with the removed device.
</content>
</entry>
<entry>
<title>MFC r363608:</title>
<updated>2020-08-03T23:06:33Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2020-08-03T23:06:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9c4a78a41a2cdce7b1a749ad9a295a8953faa9ab'/>
<id>urn:sha1:9c4a78a41a2cdce7b1a749ad9a295a8953faa9ab</id>
<content type='text'>
mpr(4), mps(4): Stop checking for failures from malloc(M_WAITOK).
</content>
</entry>
<entry>
<title>MFC r358308:</title>
<updated>2020-05-28T23:23:49Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2020-05-28T23:23:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b5ea3046503b88f95aa68e7f36a94e2503e8d1ef'/>
<id>urn:sha1:b5ea3046503b88f95aa68e7f36a94e2503e8d1ef</id>
<content type='text'>
    Before issing the REMOVE_DEVICE command to the firmware, make sure that all
    commands have completed.

    It's not OK to force complete any pending commands before we send the
    REMOVE_DEVICE. Instead, make sure that all pending commands are complete before
    sending that. By trying to second guess the firmware here, we run the risk of
    completing commands twice, which leads to corruption.

    This removes the forced completion of commands introduced in r218811. So it's a
    partial backout of that commit, but replaces it with a more rebust
    mechanism. Either these commands will complete due to the TARGET RESET, or they
    will timeout and be aborted, but they will all complete.

    Add assert that all commands are complete to REMOVE_DEVICE completion
    routine. We attempt to assure this programatically, so we shouldn't have any
    commands in the queue because we've waited for them all. Any commands that make
    it into our action routine after we mark the target in removal will complete
    immediately with an error.

    When we're removing a target that's not a volume, advertise up the stack that
    it's actually gone, as opposed to having a transient selection error we should
    retry. Do this both in the action routine, and when we get a notification of an
    aborted command. We don't do this for volumes because the driver tries hard not
    to advertise to the OS a volume has disappeared.

    Apply these changes to both mpr and mps since they are based on quite similar
    designs.

    Discussed with: scottl@
    Differential Revision: https://reviews.freebsd.org/D23768
</content>
</entry>
<entry>
<title>MFC r359937:</title>
<updated>2020-04-28T17:59:37Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2020-04-28T17:59:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=18fec7394da653a176be797ebcdd1eaf55897f9d'/>
<id>urn:sha1:18fec7394da653a176be797ebcdd1eaf55897f9d</id>
<content type='text'>
Centralize compatability translation macros.

Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h
and replace existing definitation with includes where required. This
eliminates duplicate code and allows Linux and FreeBSD compatability
headers to be included in the same files.

Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24275
</content>
</entry>
<entry>
<title>MFC r358959: Increase buffer in mprsas_log_command() from 192 to 224 bytes.</title>
<updated>2020-03-27T13:29:24Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-03-27T13:29:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=bd16e78b164d15f30584d83bfa87d3cd3b31d0f3'/>
<id>urn:sha1:bd16e78b164d15f30584d83bfa87d3cd3b31d0f3</id>
<content type='text'>
192 bytes are not enough to print long commands, such as ATA COMMAND PASS
THROUGH(16), that makes debug output difficult to read.
</content>
</entry>
<entry>
<title>Catch up with stability fixes to mpr/mps in -current since 12</title>
<updated>2019-09-26T01:54:24Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2019-09-26T01:54:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=40d21e921a551c61306276dfee10a5529ffe6dbf'/>
<id>urn:sha1:40d21e921a551c61306276dfee10a5529ffe6dbf</id>
<content type='text'>
was branched.

MFC r341755,r342354,r342355,r342386,r342387,r342388,r342526,r342528,
r342530,r342531,r342533,r342534,r342535,r342536,r342659,r345479,
r345485,r345573,r347237,r349849,r349909:

  r341755:
    Copy and clear the reply descriptor atomically.  This prevents concurrency
    in the interrupt handlers (usually due to timeout/error recovery) from
    seeing and processing the same descriptor twice.
  r342354:
    mps(4), mpr(4): Fix lifetime of command buffer for mp?sas_get_sata_identify
  r342355:
    mps(4), mpr(4): remove SATA ID command cancellation hack
  r342386:
    First step in refactoring and fixing the error recovery and task management
    code in the mpr and mps drivers.  Eliminate duplicated code and fix some
    comments.
  r342387:
    Commands for user-initated device resets should come from the high-priority
    allocator.  Prior to this change, they would leak from the normal
    allocator.
  r342388:
    Further refactoring for task management commands.  Also fix a related typo
    from the previous commit.
  r342526:
    Update MPI header files version to 2.00.52 from 2.00.48
  r342528:
    Copy back the Sense data at proper location expected by the application
  r342530:
    Added support for NVMe Task Management
  r342531:
    Add Sea,Aero adapter support
  r342533:
    Enable atomic type descriptor support only for Sea &amp; Aero cards
  r342534:
    On Aero/Sea A0 cards retry MPT Fusion registers reads for max three times
  r342535:
    Update copyright information
  r342536:
    Update mpr driver version to v23.00.00.00-fbsd
  r342659:
    Fix whitespace from r342528
  r345479:
    r329522 created problemss with commands that enter the TIMEDOUT state but
    are successfully returned by the card (usually due to an abort being issued
    as part of timeout recovery). Remove what amounts to an insufficient
    KASSERT, and don't overwrite the state value. State should probably be
    re-designed, and that will be done with a future commit.
  r345485:
    Add event table decoding for SAS Broadcast Primitive events.
  r345573:
    Add missing break statements.  Coverity CID 1400446.
  r347237:
    Add missing newline to debug printf.
  r349849:
    Fix bugs in recovery path and improve cm tracking
  r349909:
    More fully implement the state machine.

Sponsored by: Netflix, Inc
</content>
</entry>
<entry>
<title>MFC r348417: Fix busy status leak in case of incorrect passthrough args.</title>
<updated>2019-06-06T01:16:04Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2019-06-06T01:16:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9f7521af587c2de56a2c19a7240f6beab2c7a81e'/>
<id>urn:sha1:9f7521af587c2de56a2c19a7240f6beab2c7a81e</id>
<content type='text'>
</content>
</entry>
</feed>
