<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/scsi/device_handler, branch master</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: rdac: Keep the error status when controller lookup fails</title>
<updated>2026-11-09T02:20:31+00:00</updated>
<author>
<name>Shao Mingyin</name>
<email>shao.mingyin@zte.com.cn</email>
</author>
<published>2026-10-26T11:54:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=46846939d5f33c9333612662c52475f92e753407'/>
<id>46846939d5f33c9333612662c52475f92e753407</id>
<content type='text'>
initialize_controller() records SCSI_DH_RES_TEMP_UNAVAIL when
get_controller() fails, but then overwrites it with SCSI_DH_OK
unconditionally. It therefore reports success with h-&gt;ctlr == NULL and
rdac_bus_attach() continues with check_ownership(), which dereferences
h-&gt;ctlr:

  BUG: kernel NULL pointer dereference, address: 0000000000000000
  ...
  check_ownership
  rdac_bus_attach

get_controller() only fails when its GFP_ATOMIC allocation fails, so the
crash happens exactly when memory is already scarce.

Only report success after the controller was found and the device was added
to its list.

Fixes: 327825574132 ("scsi_dh_rdac: switch to scsi_execute_req_flags()")
Signed-off-by: Shao Mingyin &lt;shao.mingyin@zte.com.cn&gt;
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261026195409354OWEI2b6HO7swSphvv1FOc@zte.com.cn
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
initialize_controller() records SCSI_DH_RES_TEMP_UNAVAIL when
get_controller() fails, but then overwrites it with SCSI_DH_OK
unconditionally. It therefore reports success with h-&gt;ctlr == NULL and
rdac_bus_attach() continues with check_ownership(), which dereferences
h-&gt;ctlr:

  BUG: kernel NULL pointer dereference, address: 0000000000000000
  ...
  check_ownership
  rdac_bus_attach

get_controller() only fails when its GFP_ATOMIC allocation fails, so the
crash happens exactly when memory is already scarce.

Only report success after the controller was found and the device was added
to its list.

Fixes: 327825574132 ("scsi_dh_rdac: switch to scsi_execute_req_flags()")
Signed-off-by: Shao Mingyin &lt;shao.mingyin@zte.com.cn&gt;
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261026195409354OWEI2b6HO7swSphvv1FOc@zte.com.cn
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: device_handlers: alua: Use combined sense codes</title>
<updated>2026-09-16T14:42:46+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-09-08T09:02:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8c88a8614870903ea2a454cac0851a3198bc93ce'/>
<id>8c88a8614870903ea2a454cac0851a3198bc93ce</id>
<content type='text'>
Refactor the SCSI ALUA devie handler driver to use the 16-bit sense_code
field of struct scsi_sense_hdr and replace all hard-coded additional sense
codes and additional sense code qualifiers with the enum values defined in
include/scsi/scsi_sense.h. This helps with code clarity as the sense codes
being processed are easier to test and self-documented.

No functional change intended.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-17-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactor the SCSI ALUA devie handler driver to use the 16-bit sense_code
field of struct scsi_sense_hdr and replace all hard-coded additional sense
codes and additional sense code qualifiers with the enum values defined in
include/scsi/scsi_sense.h. This helps with code clarity as the sense codes
being processed are easier to test and self-documented.

No functional change intended.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-17-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: device_handlers: emc: Use combined sense codes</title>
<updated>2026-09-16T14:42:46+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-09-08T09:02:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9f543ed64b1ea0f02af797cc1a88137651aa41fe'/>
<id>9f543ed64b1ea0f02af797cc1a88137651aa41fe</id>
<content type='text'>
Refactor the EMC SCSI device handler driver to use the 16-bit sense_code
field of struct scsi_sense_hdr and replace all hard-coded additional sense
codes and additional sense code qualifiers with the enum values defined in
include/scsi/scsi_sense.h. This helps with code clarity as the sense codes
being processed are easier to test and self-documented.

No functional change intended.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-16-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactor the EMC SCSI device handler driver to use the 16-bit sense_code
field of struct scsi_sense_hdr and replace all hard-coded additional sense
codes and additional sense code qualifiers with the enum values defined in
include/scsi/scsi_sense.h. This helps with code clarity as the sense codes
being processed are easier to test and self-documented.

No functional change intended.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-16-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: device_handlers: rdac: Use combined sense codes</title>
<updated>2026-09-16T14:42:46+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-09-08T09:02:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5c0ae0bcee35b9864702cd7866d2acf618ff9fb3'/>
<id>5c0ae0bcee35b9864702cd7866d2acf618ff9fb3</id>
<content type='text'>
Refactor the NetApp E-Series RDAC SCSI device handler driver to use the
16-bit sense_code field of struct scsi_sense_hdr and struct scsi_failure
and replace all hard-coded additional sense codes and additional sense code
qualifiers with the enum values defined in include/scsi/scsi_sense.h.  This
helps with code clarity as the sense codes being processed are easier to
test and self-documented.

No functional change intended.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-15-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactor the NetApp E-Series RDAC SCSI device handler driver to use the
16-bit sense_code field of struct scsi_sense_hdr and struct scsi_failure
and replace all hard-coded additional sense codes and additional sense code
qualifiers with the enum values defined in include/scsi/scsi_sense.h.  This
helps with code clarity as the sense codes being processed are easier to
test and self-documented.

No functional change intended.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-15-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: device_handlers: hp_sw: Use combined sense codes</title>
<updated>2026-09-16T14:42:46+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-09-08T09:02:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=700ab5e27925f883888501e9e2630ad8b8da49f7'/>
<id>700ab5e27925f883888501e9e2630ad8b8da49f7</id>
<content type='text'>
Refactor the HP sw device handler driver to use the 16-bit sense_code field
of struct scsi_sense_hdr and struct scsi_failure and replace all hard-coded
additional sense codes and additional sense code qualifiers with the enum
values defined in include/scsi/scsi_sense.h. This helps with code clarity
as the sense codes being processed are easier to test and self-documented.

No functional change intended.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-14-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactor the HP sw device handler driver to use the 16-bit sense_code field
of struct scsi_sense_hdr and struct scsi_failure and replace all hard-coded
additional sense codes and additional sense code qualifiers with the enum
values defined in include/scsi/scsi_sense.h. This helps with code clarity
as the sense codes being processed are easier to test and self-documented.

No functional change intended.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-14-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: core: Rename sense field of struct scsi_failure</title>
<updated>2026-09-16T14:42:45+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-09-08T09:02:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=45cdf8164237277e52af5d8aa4218c3cb6199bf2'/>
<id>45cdf8164237277e52af5d8aa4218c3cb6199bf2</id>
<content type='text'>
Rename the sense field of struct scsi_failure to sense_key. This makes it
clear that this field stores the sense key, and also unifies this structure
field names with the names used in struct scsi_sense_hdr.

To be consistent with this change, the macro SCMD_FAILURE_SENSE_ANY is
renamed SCMD_FAILURE_SENSE_KEY_ANY.

Of note is that the definition of the array any_sense_failure_defs in
scsi_lib_test_any_sense() is modified to change the initialization of the
result field to use SCMD_FAILURE_RESULT_ANY and add the .sense_key field
initialization to SCMD_FAILURE_SENSE_KEY_ANY to match the test target case.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-5-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename the sense field of struct scsi_failure to sense_key. This makes it
clear that this field stores the sense key, and also unifies this structure
field names with the names used in struct scsi_sense_hdr.

To be consistent with this change, the macro SCMD_FAILURE_SENSE_ANY is
renamed SCMD_FAILURE_SENSE_KEY_ANY.

Of note is that the definition of the array any_sense_failure_defs in
scsi_lib_test_any_sense() is modified to change the initialization of the
result field to use SCMD_FAILURE_RESULT_ANY and add the .sense_key field
initialization to SCMD_FAILURE_SENSE_KEY_ANY to match the test target case.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Link: https://patch.msgid.link/20260908090308.1085097-5-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: core: Enable context analysis</title>
<updated>2026-08-14T02:04:50+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2026-08-07T22:49:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fb0fc67db96292a65539e63f536c6f586490c78b'/>
<id>fb0fc67db96292a65539e63f536c6f586490c78b</id>
<content type='text'>
Enable context analysis for those SCSI core files that build without
triggering any context analysis warnings.

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Link: https://patch.msgid.link/2576d2f7e3530b721b5050ac6d25c413037d7e7e.1786142946.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enable context analysis for those SCSI core files that build without
triggering any context analysis warnings.

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Link: https://patch.msgid.link/2576d2f7e3530b721b5050ac6d25c413037d7e7e.1786142946.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: alua: Use access state macros</title>
<updated>2026-08-06T20:27:23+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@linux.dev</email>
</author>
<published>2026-08-05T14:59:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=610bece660b59a297ab3d4bd7c02685d7dc9a49b'/>
<id>610bece660b59a297ab3d4bd7c02685d7dc9a49b</id>
<content type='text'>
Use the SCSI access state macros in alua_rtpg(), which is better than
hardcoding.

Signed-off-by: John Garry &lt;john.g.garry@oracle.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/20260805145906.2825553-1-john.g.garry@oracle.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the SCSI access state macros in alua_rtpg(), which is better than
hardcoding.

Signed-off-by: John Garry &lt;john.g.garry@oracle.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/20260805145906.2825553-1-john.g.garry@oracle.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: scsi_dh_alua: Increase default ALUA timeout to maximum spec value</title>
<updated>2026-04-21T02:29:55+00:00</updated>
<author>
<name>Brian Bunker</name>
<email>brian@purestorage.com</email>
</author>
<published>2026-04-16T16:55:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=68c3a65a5a8e85643745fdde02cb63904e165620'/>
<id>68c3a65a5a8e85643745fdde02cb63904e165620</id>
<content type='text'>
The ALUA handler maps a 0 value (no implicit transition timeout provided
by the target) to the ALUA_FAILOVER_TIMEOUT constant, currently 60
seconds. This means the kernel already does not accept an infinite
transition time.

However, 60 seconds is insufficient for some arrays that may take longer
to complete ALUA transitions. Since the highest value allowed by the
SCSI specification for the implicit transition timeout is a single byte
(255 seconds), change the default to 255. This way, when a target does
not provide an explicit transition timeout, we default to the maximum
value the spec allows rather than an arbitrary 60 second limit.

Co-developed-by: Krishna Kant &lt;krishna.kant@purestorage.com&gt;
Signed-off-by: Krishna Kant &lt;krishna.kant@purestorage.com&gt;
Co-developed-by: Riya Savla &lt;rsavla@purestorage.com&gt;
Signed-off-by: Riya Savla &lt;rsavla@purestorage.com&gt;
Signed-off-by: Brian Bunker &lt;brian@purestorage.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Link: https://patch.msgid.link/20260416165512.26497-2-brian@purestorage.com
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 ALUA handler maps a 0 value (no implicit transition timeout provided
by the target) to the ALUA_FAILOVER_TIMEOUT constant, currently 60
seconds. This means the kernel already does not accept an infinite
transition time.

However, 60 seconds is insufficient for some arrays that may take longer
to complete ALUA transitions. Since the highest value allowed by the
SCSI specification for the implicit transition timeout is a single byte
(255 seconds), change the default to 255. This way, when a target does
not provide an explicit transition timeout, we default to the maximum
value the spec allows rather than an arbitrary 60 second limit.

Co-developed-by: Krishna Kant &lt;krishna.kant@purestorage.com&gt;
Signed-off-by: Krishna Kant &lt;krishna.kant@purestorage.com&gt;
Co-developed-by: Riya Savla &lt;rsavla@purestorage.com&gt;
Signed-off-by: Riya Savla &lt;rsavla@purestorage.com&gt;
Signed-off-by: Brian Bunker &lt;brian@purestorage.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Link: https://patch.msgid.link/20260416165512.26497-2-brian@purestorage.com
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert 'alloc_obj' family to use the new default GFP_KERNEL argument</title>
<updated>2026-02-22T01:09:51+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-02-22T00:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43'/>
<id>bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43</id>
<content type='text'>
This was done entirely with mindless brute force, using

    git grep -l '\&lt;k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was done entirely with mindless brute force, using

    git grep -l '\&lt;k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
