<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/scsi/cxlflash, branch v4.10</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: cxlflash: Migrate scsi command pointer to AFU command</title>
<updated>2016-12-01T00:53:02+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:43:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fe7f96982a4e7103ffab45fba34c57ee19b62639'/>
<id>fe7f96982a4e7103ffab45fba34c57ee19b62639</id>
<content type='text'>
Currently, when sending a SCSI command, the pointer is stored in a
reserved field of the AFU command descriptor for retrieval once the
SCSI command has completed. In order to support new descriptor formats
that make use of the reserved field, the pointer is migrated to outside
the descriptor where it can still be found during completion processing.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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>
Currently, when sending a SCSI command, the pointer is stored in a
reserved field of the AFU command descriptor for retrieval once the
SCSI command has completed. In order to support new descriptor formats
that make use of the reserved field, the pointer is migrated to outside
the descriptor where it can still be found during completion processing.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: cxlflash: Migrate IOARRIN specific routines to function pointers</title>
<updated>2016-12-01T00:53:02+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:43:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=48b4be36edf8a2cb0dedcb2d28f598e51249e805'/>
<id>48b4be36edf8a2cb0dedcb2d28f598e51249e805</id>
<content type='text'>
As staging for supporting hardware with a different queuing mechanism,
move the send_cmd() and context_reset() routines to function pointers
that are configured when the AFU is initialized. In addition, rename
the existing routines to better reflect the queue model they support.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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>
As staging for supporting hardware with a different queuing mechanism,
move the send_cmd() and context_reset() routines to function pointers
that are configured when the AFU is initialized. In addition, rename
the existing routines to better reflect the queue model they support.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: cxlflash: Cleanup queuecommand()</title>
<updated>2016-12-01T00:53:02+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:43:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9d89326c6660bc287b74983b51239460da10e189'/>
<id>9d89326c6660bc287b74983b51239460da10e189</id>
<content type='text'>
The queuecommand routine is disorganized where it populates the
private command and also contains some logic/statements that are
not needed given that cxlflash devices do not (and likely never
will) support scatter-gather.

Restructure the code to remove the unnecessary logic and create an
organized flow:

	handle state -&gt; DMA map -&gt; populate command -&gt; send command

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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 queuecommand routine is disorganized where it populates the
private command and also contains some logic/statements that are
not needed given that cxlflash devices do not (and likely never
will) support scatter-gather.

Restructure the code to remove the unnecessary logic and create an
organized flow:

	handle state -&gt; DMA map -&gt; populate command -&gt; send command

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: cxlflash: Cleanup send_tmf()</title>
<updated>2016-12-01T00:53:02+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:42:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d4ace35166e55e73afe72a05d166342996063d35'/>
<id>d4ace35166e55e73afe72a05d166342996063d35</id>
<content type='text'>
The send_tmf() routine includes some copy/paste cruft that can be
removed as well as the setting of an AFU command-specific while
holding the tmf_slock. While not a bug, it is out of place and
should be shifted down alongside the other command initialization
statements for clarity.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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 send_tmf() routine includes some copy/paste cruft that can be
removed as well as the setting of an AFU command-specific while
holding the tmf_slock. While not a bug, it is out of place and
should be shifted down alongside the other command initialization
statements for clarity.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: cxlflash: Remove AFU command lock</title>
<updated>2016-12-01T00:53:02+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:42:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9ba848acbf4fbc6d99a0992df9ef5eb1b4842ba9'/>
<id>9ba848acbf4fbc6d99a0992df9ef5eb1b4842ba9</id>
<content type='text'>
The original design of the cxlflash driver required AFU commands
to convey state information across multiple threads. The IOASA
"host use" byte was used to track if a command was done, errored,
or timed out. A per-command spin lock was used to serialize access
to this byte. As this is no longer required with the introduction
of completions and various refactoring over time, the spin lock,
state tracking, and associated code can be removed. To support the
simplification, the wait_resp() routine is refactored to return a
success or failure. Additionally, as the simplification to the
AFU internal command routine, explicit assignments of AFU command
fields to zero are removed as the memory is zeroed upon allocation.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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 original design of the cxlflash driver required AFU commands
to convey state information across multiple threads. The IOASA
"host use" byte was used to track if a command was done, errored,
or timed out. A per-command spin lock was used to serialize access
to this byte. As this is no longer required with the introduction
of completions and various refactoring over time, the spin lock,
state tracking, and associated code can be removed. To support the
simplification, the wait_resp() routine is refactored to return a
success or failure. Additionally, as the simplification to the
AFU internal command routine, explicit assignments of AFU command
fields to zero are removed as the memory is zeroed upon allocation.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: cxlflash: Wait for active AFU commands to timeout upon tear down</title>
<updated>2016-12-01T00:53:02+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:42:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=de01283baa334b1d938cfd9121198c517ad6dc89'/>
<id>de01283baa334b1d938cfd9121198c517ad6dc89</id>
<content type='text'>
With the removal of the static private command pool, the ability to
'complete' outstanding commands was lost. While not an issue for the
commands originating outside the driver, internal AFU commands are
synchronous and therefore have a timeout associated with them. To
avoid a stale memory access, the tear down sequence needs to ensure
that there are not any active commands before proceeding. As these
internal AFU commands are rare events, the simplest way to accomplish
this is detecting the activity and waiting for it to timeout.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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>
With the removal of the static private command pool, the ability to
'complete' outstanding commands was lost. While not an issue for the
commands originating outside the driver, internal AFU commands are
synchronous and therefore have a timeout associated with them. To
avoid a stale memory access, the tear down sequence needs to ensure
that there are not any active commands before proceeding. As these
internal AFU commands are rare events, the simplest way to accomplish
this is detecting the activity and waiting for it to timeout.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: cxlflash: Remove private command pool</title>
<updated>2016-12-01T00:53:02+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:42:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=25bced2b61b43b6372a73008dafa2183c5d53c39'/>
<id>25bced2b61b43b6372a73008dafa2183c5d53c39</id>
<content type='text'>
Clean up and remove the remaining private command pool infrastructure
that is no longer required.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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>
Clean up and remove the remaining private command pool infrastructure
that is no longer required.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: cxlflash: Use cmd_size for private commands</title>
<updated>2016-12-01T00:53:02+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:42:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5fbb96c8f1ba89fb220efb7e4eeed7cb5112becd'/>
<id>5fbb96c8f1ba89fb220efb7e4eeed7cb5112becd</id>
<content type='text'>
Instead of using a private pool of AFU commands, use cmd_size to prime
the private pool of SCSI commands such that they are allocated with a
size large enough to contain an aligned AFU command. Use scsi_cmd_priv()
to derive the aligned/zeroed private command on queuecommand and TMF
paths. Remove cmd_checkout() as it is no longer required. The remaining
AFU private command infrastructure will be removed in a cleanup commit.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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>
Instead of using a private pool of AFU commands, use cmd_size to prime
the private pool of SCSI commands such that they are allocated with a
size large enough to contain an aligned AFU command. Use scsi_cmd_priv()
to derive the aligned/zeroed private command on queuecommand and TMF
paths. Remove cmd_checkout() as it is no longer required. The remaining
AFU private command infrastructure will be removed in a cleanup commit.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: cxlflash: Allocate memory instead of using command pool for AFU sync</title>
<updated>2016-12-01T00:53:01+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:42:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=350bb478f57387df1e0b830fc64be2d1c3d55b6b'/>
<id>350bb478f57387df1e0b830fc64be2d1c3d55b6b</id>
<content type='text'>
As staging for the removal of the AFU command pool, remove the reliance
upon the pool for the internal AFU sync command. Instead of obtaining an
AFU command from the pool, dynamically allocate memory with the appropriate
alignment requirements. Since the AFU sync service is only executed from
the process environment, blocking is acceptable.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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>
As staging for the removal of the AFU command pool, remove the reliance
upon the pool for the internal AFU sync command. Instead of obtaining an
AFU command from the pool, dynamically allocate memory with the appropriate
alignment requirements. Since the AFU sync service is only executed from
the process environment, blocking is acceptable.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: cxlflash: Remove unused buffer from AFU command</title>
<updated>2016-12-01T00:53:01+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mrochs@linux.vnet.ibm.com</email>
</author>
<published>2016-11-29T00:42:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e7ab2d401dbf633eaafe5bd1f39e84492848668f'/>
<id>e7ab2d401dbf633eaafe5bd1f39e84492848668f</id>
<content type='text'>
The cxlflash driver originally required a per-command 4K buffer that
hosted data passed to the AFU. When the routines that initiate AFU
and internal SCSI commands were refactored to use scsi_execute(), the
need for this buffer became obsolete. As it is no longer necessary,
the buffer is removed.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&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 cxlflash driver originally required a per-command 4K buffer that
hosted data passed to the AFU. When the routines that initiate AFU
and internal SCSI commands were refactored to use scsi_execute(), the
need for this buffer became obsolete. As it is no longer necessary,
the buffer is removed.

Signed-off-by: Matthew R. Ochs &lt;mrochs@linux.vnet.ibm.com&gt;
Acked-by: Uma Krishnan &lt;ukrishn@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
