From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-ide@vger.kernel.org, xxjack12xx@gmail.com,
Niklas Cassel <cassel@kernel.org>
Subject: [PATCH 3/3] ata: libata: Allow more quirks
Date: Mon, 24 Nov 2025 14:44:18 +0100 [thread overview]
Message-ID: <20251124134414.3057512-8-cassel@kernel.org> (raw)
In-Reply-To: <20251124134414.3057512-5-cassel@kernel.org>
We have currently used up all 32-bits in the struct ata_device struct
member quirks. Thus, it is currently not possible to add another quirk.
Change the struct ata_device struct member quirks from an unsigned int to
an unsigned long long.
Doing this core level change now, will make it easier for whoever needs to
add another quirk, as they will not need to also do core level changes.
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
drivers/ata/libata-core.c | 4 ++--
include/linux/libata.h | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index be320c3e0fef..d8ab5bc56fc6 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4341,8 +4341,8 @@ static unsigned int ata_dev_quirks(const struct ata_device *dev)
unsigned char model_rev[ATA_ID_FW_REV_LEN + 1];
const struct ata_dev_quirks_entry *ad = __ata_dev_quirks;
- /* dev->quirks is an unsigned int. */
- BUILD_BUG_ON(__ATA_QUIRK_MAX > 32);
+ /* dev->quirks is an unsigned long long. */
+ BUILD_BUG_ON(__ATA_QUIRK_MAX > 64);
ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
ata_id_c_string(dev->id, model_rev, ATA_ID_FW_REV, sizeof(model_rev));
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 39534fafa36a..4ed7bca91691 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -46,7 +46,8 @@
/*
* Quirk flags bits.
- * ata_device->quirks is an unsigned int, so __ATA_QUIRK_MAX must not exceed 32.
+ * ata_device->quirks is an unsigned long long, so __ATA_QUIRK_MAX must not
+ * exceed 64.
*/
enum ata_quirks {
__ATA_QUIRK_DIAGNOSTIC, /* Failed boot diag */
@@ -723,7 +724,7 @@ struct ata_cdl {
struct ata_device {
struct ata_link *link;
unsigned int devno; /* 0 or 1 */
- unsigned int quirks; /* List of broken features */
+ unsigned long long quirks; /* List of broken features */
unsigned long flags; /* ATA_DFLAG_xxx */
struct scsi_device *sdev; /* attached SCSI device */
void *private_data;
--
2.52.0
next prev parent reply other threads:[~2025-11-24 13:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 13:44 [PATCH 0/3] ata: libata: Quirk DELLBOSS VD MV.R00-0 max_sectors Niklas Cassel
2025-11-24 13:44 ` [PATCH 1/3] ata: libata: Move quirk flags to their own enum Niklas Cassel
2025-11-25 4:29 ` Damien Le Moal
2025-11-24 13:44 ` [PATCH 2/3] ata: libata-core: Quirk DELLBOSS VD MV.R00-0 max_sectors Niklas Cassel
2025-11-24 14:09 ` Niklas Cassel
2025-11-24 20:51 ` Jack L.
2025-11-25 0:00 ` Jack L.
2025-11-25 0:20 ` Damien Le Moal
2025-11-24 13:44 ` Niklas Cassel [this message]
2025-11-25 4:30 ` [PATCH 3/3] ata: libata: Allow more quirks 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=20251124134414.3057512-8-cassel@kernel.org \
--to=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=xxjack12xx@gmail.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