<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/libata.h, branch v7.3-rc1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.3-rc1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.3-rc1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-08-19T19:31:50+00:00</updated>
<entry>
<title>Merge tag 'ata-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux</title>
<updated>2026-08-19T19:31:50+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-08-19T19:31:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=faabe2db712e8310dbe38fb81d33e5313ff0f059'/>
<id>urn:sha1:faabe2db712e8310dbe38fb81d33e5313ff0f059</id>
<content type='text'>
Pull ata updates from Damien Le Moal:

 - Some code cleanups to rename the function used to identify ZAC
   devices and declare some local functions static (me)

 - Refactoring and improvement of the translation of the SCSI REPORT
   SUPPORTED OPCODES command to allow users access to the entire list of
   supported commands (me)

 - Fix the translation of the WRITE SAME command with UNMAP bit set (DSM
   TRIM) for devices with a sector size larger than 2K and devices that
   support multiple TRIM segments (Niklas)

 - Add support detecting support for and translating the SCSI commands
   related to the storage elements depopulation feature (GET PHYSICAL
   ELEMENT STATUS, REMOVE ELEMENT AND TRUCATE, REMOVE ELEMENT AND MODIFY
   ZONES and RESTORE ELEMENTS AND REBUILD) (me)

 - Improvements to the sata_mv driver probe code (clocks and IRQ
   initialization) (Rosen)

 - Improve resource initialization in the pata_rb532_cf, pata_pxa,
   sata_highbank and ahci_da850 drivers (Rosen)

 - Improve PIO data-in command completions to better hndle slow devices,
   e.g. CF cards (Richard)

 - Improve the DMA channel management using device resources in the
   pata_pxa driver (Rosen)

 - Fix the pata_ep93xx driver to correctly fallback to PIO mode if DMA
   initialization fails (Rosen)

 - Use named initializers to define the match tables of the ahci_xgene,
   ahci_qoriq and ahci_platform drivers (Pawel)

* tag 'ata-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux: (28 commits)
  ata: use named initializers for acpi_device_id
  ata: pata_ep93xx: fix PIO fallback when DMA init fails
  ata: pata_pxa: use devres for DMA channel management
  ata: libata-sff: don't busy-wait for PIO data-in command completion
  ata: ahci_da850: use devm_platform_ioremap_resource()
  ata: sata_highbank: use devm_platform_ioremap_resource
  ata: pata_pxa: use devm_platform_ioremap_resource
  ata: pata_rb532_cf: use devm_platform_ioremap_resource()
  ata: sata_mv: use devm clock helpers
  ata: sata_mv: Use platform_get_irq() to get interrupt
  ata: pata_mpc52xx: Remove redundant dev_err()
  ata: libata-eh: make ata_eh_qc_complete() and ata_eh_qc_retry() static
  ata: libata-scsi: add support for the REMOVE ELEMENT AND MODIFY ZONES command
  ata: libata-scsi: add support for the RESTORE ELEMENTS AND REBUILD command
  ata: libata-scsi: add support for the REMOVE ELEMENT AND TRUNCATE command
  ata: libata-scsi: add support for the GET PHYSICAL ELEMENT STATUS command
  ata: libata-core: detect support for depopulation capabilities
  ata: libata-scsi: improve ata_get_xlat_func
  ata: libata: improve the definition of device flags
  scsi: define depopulation capabilities related service actions
  ...
</content>
</entry>
<entry>
<title>scsi: libsas: terminate deferred commands on time out</title>
<updated>2026-07-29T01:52:04+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-07-09T07:02:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=de202d2251bc181c6019b1ad3c0ba8133e5ec68d'/>
<id>urn:sha1:de202d2251bc181c6019b1ad3c0ba8133e5ec68d</id>
<content type='text'>
If a command times out while we have deferred non-NCQ commands waiting to
be issued, the SCSI EH task is not immediately woken up as the waiting
deferred commands are never issued nor completed, thus leaving the SCSI
host in a busy state (shost-&gt;host_failed != scsi_host_busy(shost)) which
prevents the SCSI EH task from being woken up. Eventually, when the
deferred commands also time out, the SCSI EH task is woken up and the
timeout processing occurs.

Avoid this unnecessary additional SCSI EH wake up time with the same
method as implemented in libata-scsi, using the eh_timed_out SCSI host
template operation. The function sas_eh_timed_out() implements this
operation and executes the function ata_scsi_retry_deferred_qc()
for SATA devices.

Co-developed-by: Igor Pylypiv &lt;ipylypiv@google.com&gt;
Signed-off-by: Igor Pylypiv &lt;ipylypiv@google.com&gt;
Fixes: 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Tested-by: Igor Pylypiv &lt;ipylypiv@google.com&gt;
Reviewed-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>ata: libata-scsi: terminate deferred commands on time out</title>
<updated>2026-07-29T01:51:57+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-07-09T01:01:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2e1d2e65e773d67dab163127f11a47dab0fbca9f'/>
<id>urn:sha1:2e1d2e65e773d67dab163127f11a47dab0fbca9f</id>
<content type='text'>
If a command times out while we have deferred non-NCQ commands waiting to
be issued, the SCSI EH task is not immediately woken up as the waiting
deferred commands are never issued nor completed, thus leaving the SCSI
host in a busy state (shost-&gt;host_failed != scsi_host_busy(shost)) which
prevents the SCSI EH task from being woken up. Eventually, when the
deferred commands also time out, the SCSI EH task is woken up and the
timeout processing occurs.

Avoid this unnecessary SCSI EH task wake-up additional time by scheduling
a retry of all waiting deferred QCs, using the eh_timed_out SCSI host
template operation. The function ata_scsi_eh_timed_out() is introduced to
implement this operation.

However, terminating deferred commands with DID_REQUEUE to force a retry
by calling the function ata_scsi_requeue_deferred_qc() may still keep the
SCSI host in a busy state because the block layer may immediately re-issue
these commands. The solution to this is to schedule libata EH for the
port which suffered the command timeout to prevent accepting any new
command. ata_scsi_requeue_deferred_qc() is modified to add a call to
ata_port_schedule_eh() for this purpose.

In addition to this change, ata_scsi_requeue_deferred_qc() is also
modified to take a new timedout_scmd scsi command argument which indicates
the SCSI command that timed out. With this additional argument,
ata_scsi_requeue_deferred_qc() can now also terminate with DID_TIME_OUT
any timed out deferred qc, which simplifies ata_scsi_cmd_error_handler().
In this case, ata_scsi_requeue_deferred_qc() returns SCSI_EH_DONE, with
this return value propagated back to the ata_scsi_eh_timed_out() operation
to indicate to scsi_timeout() that the timed out command was handled and
no further processing is needed.

For non-timed out deferred qc that need to be retried,
ata_scsi_requeue_deferred_qc() returns SCSI_EH_NOT_HANDLED, thus
indicating to scsi_timeout() that the timed out command needs to go
through the SCSI EH (and libata EH) processing by adding it to the EH work
queue with scsi_eh_scmd_add().

One side effect of these changes is that the function atapi_qc_complete()
needs to be modified to ensure that a deferred ATAPI command that needs
to be retried is completed with DID_REQUEUE instead of the default
SAM_STAT_GOOD status, and a command that timed out is completed with
DID_TIME_OUT instead of SAM_STAT_CHECK_CONDITION.

Fixes: 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Igor Pylypiv &lt;ipylypiv@google.com&gt;
Tested-by: Igor Pylypiv &lt;ipylypiv@google.com&gt;
Reviewed-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>ata: libata-eh: Increase STANDBY IMMEDIATE timeout</title>
<updated>2026-07-28T03:04:17+00:00</updated>
<author>
<name>Matt Vollrath</name>
<email>tactii@gmail.com</email>
</author>
<published>2026-07-24T07:39:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1e024d2b41ee32bc06818f7f09a3562c58842cf9'/>
<id>urn:sha1:1e024d2b41ee32bc06818f7f09a3562c58842cf9</id>
<content type='text'>
Correct a previous change (see Fixes) which reduced the standby timeout
from 30 to 5 seconds. Increase it to 15 seconds.

I was troubleshooting an error spotted during system suspend:

    [ 1217.152867] ata1.00: Entering standby power mode
    [ 1222.322948] ata1.00: qc timeout after 5000 msecs (cmd 0xe0)
    [ 1222.324010] ata1.00: STANDBY IMMEDIATE failed (err_mask=0x4)

This drive is a Samsung 870 EVO SSD in good SMART standing, and I wasn't
aware of any reason it should be taking so long to standby. The issue is
intermittent, but I observed it sometimes taking 7 seconds to manually
standby. I assume this was interruption of background maintenance after
a power outage.

As a desktop user, I would prefer to wait the extra 2 seconds at suspend
to let the drive finish its business rather than drop the rails from
under it.

The change from 30 to 5 seconds was implicit when switching suspend
from START STOP UNIT to an internal command with no timeout table entry.
No reason was stated for the change.

Fixes: aa3998dbeb3a ("ata: libata-scsi: Disable scsi device manage_system_start_stop")
Cc: stable@vger.kernel.org
Signed-off-by: Matt Vollrath &lt;tactii@gmail.com&gt;
Assisted-by: Claude:claude-5-fable
Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ata: libata-eh: make ata_eh_qc_complete() and ata_eh_qc_retry() static</title>
<updated>2026-07-18T01:09:19+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-07-13T04:16:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9bf9aefdc0f5ef24674e7787e169b7d4d389009c'/>
<id>urn:sha1:9bf9aefdc0f5ef24674e7787e169b7d4d389009c</id>
<content type='text'>
The functions ata_eh_qc_complete() and ata_eh_qc_retry() are used only in
libata-eh.c. So remove the declaration of these functions from
include/linux/libata.h and define them as static. While at it, add a
missing blank line between variable declaration and code in these two
functions.

No functional changes intended.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Niklas Cassel &lt;cassel@kernel.org&gt;
</content>
</entry>
<entry>
<title>ata: libata-core: detect support for depopulation capabilities</title>
<updated>2026-07-18T01:08:56+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-06-20T11:04:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4ba5eb54c2c8671f741a161b4f0d5162a4cb9b1b'/>
<id>urn:sha1:4ba5eb54c2c8671f741a161b4f0d5162a4cb9b1b</id>
<content type='text'>
Introduce the device flags ATA_DFLAG_DEPOP to indicate support by a device
for the basic commands of the storage element depopulation feature set,
that is, the GET PHYSICAL ELEMENT STATUS and REMOVE ELEMENT AND TRUNCATE
commands. The device flag ATA_DFLAG_DEPOP_RESTORE flag is introduced to
indicate support for the RESTORE ELEMENTS AND REBUILD command. Both flags
are obtained from the command support bits of the qword at bytes 152 to
159 of the supported capabilities log page.

For ZAC devices, the device flag ATA_DFLAG_DEPOP_MODIFY is introduced to
indicate support for the REMOVE ELEMENT AND MODIFY ZONES command. This
support is indicated by the REMOVE ELEMENT AND MODIFY ZONES SUPPORTED bit
in the qword at byte 8 to 15 of the zoned device information log page.

The function ata_dev_config_depop() is introduced to set these flags
based on the content of the supported capabilities log and zoned device
information log. As per the ACS specifications, NCQ autosense support is
also mandatory if these flags are set.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
</content>
</entry>
<entry>
<title>ata: libata: improve the definition of device flags</title>
<updated>2026-07-18T01:08:52+00:00</updated>
<author>
<name>Damien Le Moal</name>
<email>dlemoal@kernel.org</email>
</author>
<published>2026-07-06T03:27:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ee1badfde360e3b95289ed359b4416f0fbb66eb1'/>
<id>urn:sha1:ee1badfde360e3b95289ed359b4416f0fbb66eb1</id>
<content type='text'>
The flags field of struct ata_device has the unsigned long type. Define
all the ATA_DFLAG_XXX flags using a 1UL bit shift to match this type, thus
avoiding flags to become signed values (e.g. for bit 31 flag).

To avoid all other values defined in the same enum as the ATA_DFLAG_XXX
flags to implicitly also become unsigned long values, move the device
flags definition to a separate enum.

Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>ata: Annotate functions in the issuing path with __must_hold()</title>
<updated>2026-06-01T17:14:41+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2026-05-28T17:28:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=042f5526cf2c44eac17ed2fa57a9a6e8d30d6279'/>
<id>urn:sha1:042f5526cf2c44eac17ed2fa57a9a6e8d30d6279</id>
<content type='text'>
Annotate the following functions used in the issuing path:
ata_qc_issue(), ata_sas_queuecmd(), ata_scsi_qc_issue(),
ata_scsi_translate(), __ata_scsi_queuecmd()

These functions are all used in the issuing path, so context analysis will
be able to verify that the ap lock is held, from it is taken in
sas_queuecommand() or ata_scsi_queuecmd() all the way down to
ata_qc_issue().

Commenting out the spin_lock_irqsave() successfully results in a compiler
error on Clang 23.

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Co-developed-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Reviewed-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Signed-off-by: Niklas Cassel &lt;cassel@kernel.org&gt;
</content>
</entry>
<entry>
<title>ata: libata: Document when host-&gt;eh_mutex should be held</title>
<updated>2026-06-01T17:09:08+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2026-05-29T18:03:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7725c45682abd7a6590676c33c35a7bdfdec6db5'/>
<id>urn:sha1:7725c45682abd7a6590676c33c35a7bdfdec6db5</id>
<content type='text'>
Annotate the following functions with __must_hold(&amp;host-&gt;eh_mutex):
 * All ata_port_operations.error_handler() implementations.
 * ata_eh_reset() and ata_eh_recover() because these functions call
   ata_eh_release() and ata_eh_acquire().
 * All callers of ata_eh_reset() and ata_eh_recover().

Enable Clang's context analysis. This will cause the build to fail if
e.g. a locking bug would be introduced in an error path. This patch
should not affect the generated assembler code.

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
[cassel: drop note about clang 23 from commit log]
Signed-off-by: Niklas Cassel &lt;cassel@kernel.org&gt;
</content>
</entry>
<entry>
<title>ata: libata-scsi: do not needlessly defer commands when using PMP with FBS</title>
<updated>2026-05-18T10:26:51+00:00</updated>
<author>
<name>Niklas Cassel</name>
<email>cassel@kernel.org</email>
</author>
<published>2026-05-14T07:39:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=759e8756da00aa115d504a18155b1d1ee1cc12e8'/>
<id>urn:sha1:759e8756da00aa115d504a18155b1d1ee1cc12e8</id>
<content type='text'>
The ACS specification does not allow a non-NCQ command to be issued while
an NCQ command is outstanding.

Commit 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
introduced a feature where a deferred non-NCQ command gets issued from a
workqueue. The design stores a single non-NCQ command per port.

However, when using Port Multipliers (PMPs), specifically PMPs that
support FIS-Based Switching (FBS), non-NCQ and NCQ commands can be mixed
on the same port, just not for the same link, see e.g. ata_std_qc_defer()
which is, and always has operated on a per-link basis.

Therefore, move the deferred_qc from struct ata_port to struct ata_link.
This way, when using a PMP with FBS, we will not needlessly defer commands
to all other links, just because one link issued a non-NCQ command while
having an NCQ command outstanding. Only commands for that specific link
will be deferred. This is in line with how PMPs with FBS worked before
commit 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation").

Fixes: 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
Tested-by: Tommy Kelly &lt;linux@tkel.ly&gt;
Reviewed-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Signed-off-by: Niklas Cassel &lt;cassel@kernel.org&gt;
</content>
</entry>
</feed>
