From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-ide@vger.kernel.org,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Niklas Cassel <cassel@kernel.org>
Subject: [PATCH v4 5/6] ata: libata: Add libata.force parameter max_sec
Date: Tue, 2 Dec 2025 13:21:35 +0100 [thread overview]
Message-ID: <20251202122129.421783-13-cassel@kernel.org> (raw)
In-Reply-To: <20251202122129.421783-8-cassel@kernel.org>
Add a new libata.force parameter called max_sec.
The parameter can take an arbitrary value using the format:
libata.force=max_sec=<number of 512B sectors>
e.g. libata.force=max_sec=8191
or
libata.force=max_sec=2048
This will allow the user to set an arbitrary maximum command size
(dev->max_sectors) using libata.force.
We cannot remove the existing libata.force parameters "max_sec_128" and
"max_sec_1024", as these are a part of the exising user facing API.
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
---
Documentation/admin-guide/kernel-parameters.txt | 5 +++++
drivers/ata/libata-core.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 6c42061ca20e5..e47113cbd2fcc 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3294,6 +3294,11 @@
* [no]logdir: Enable or disable access to the general
purpose log directory.
+ * max_sec=<sectors>: Set the transfer size limit, in
+ number of 512-byte sectors, to the value specified in
+ <sectors>. The value specified in <sectors> has to be
+ a non-zero positive integer.
+
* max_sec_128: Set transfer size limit to 128 sectors.
* max_sec_1024: Set or clear transfer size limit to
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9a8da530e123a..2905aceba7038 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6536,6 +6536,7 @@ static const struct ata_force_param force_tbl[] __initconst = {
force_quirk_val(max_sec_128, ATA_QUIRK_MAX_SEC, 128),
force_quirk_val(max_sec_1024, ATA_QUIRK_MAX_SEC, 1024),
+ force_quirk_on(max_sec=, ATA_QUIRK_MAX_SEC),
force_quirk_on(max_sec_lba48, ATA_QUIRK_MAX_SEC_LBA48),
force_quirk_onoff(lpm, ATA_QUIRK_NOLPM),
--
2.52.0
next prev parent reply other threads:[~2025-12-02 12:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 12:21 [PATCH v4 0/6] ata: libata: Improve max sectors quirk handling Niklas Cassel
2025-12-02 12:21 ` [PATCH v4 1/6] ata: libata: Add ATA_QUIRK_MAX_SEC and convert all device quirks Niklas Cassel
2025-12-02 13:10 ` Martin K. Petersen
2025-12-02 12:21 ` [PATCH v4 2/6] ata: libata: Add ata_force_get_fe_for_dev() helper Niklas Cassel
2025-12-02 12:21 ` [PATCH v4 3/6] ata: libata: Change libata.force to use the generic ATA_QUIRK_MAX_SEC quirk Niklas Cassel
2025-12-02 12:21 ` [PATCH v4 4/6] ata: libata: Add support to parse equal sign in libata.force Niklas Cassel
2025-12-02 12:21 ` Niklas Cassel [this message]
2025-12-02 12:21 ` [PATCH v4 6/6] ata: libata: Allow more quirks Niklas Cassel
2025-12-08 3:48 ` [PATCH v4 0/6] ata: libata: Improve max sectors quirk handling Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251202122129.421783-13-cassel@kernel.org \
--to=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox