mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
nvme: expose active quirks in sysfs
Currently, there is no straightforward way for a user to inspect which quirks are active for a given device from userspace. Add a new "quirks" sysfs attribute to the nvme controller device. Reading this file will display a human-readable list of all active quirks, with each quirk name on a new line. If no quirks are active, it will display "none". Tested-by: John Meneghini <jmeneghi@redhat.com> Reviewed-by: John Meneghini <jmeneghi@redhat.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
This commit is contained in:
committed by
Keith Busch
parent
f947d9e77b
commit
ddfb8b322b
@@ -180,6 +180,60 @@ enum nvme_quirks {
|
||||
NVME_QUIRK_DMAPOOL_ALIGN_512 = (1 << 22),
|
||||
};
|
||||
|
||||
static inline char *nvme_quirk_name(enum nvme_quirks q)
|
||||
{
|
||||
switch (q) {
|
||||
case NVME_QUIRK_STRIPE_SIZE:
|
||||
return "stripe_size";
|
||||
case NVME_QUIRK_IDENTIFY_CNS:
|
||||
return "identify_cns";
|
||||
case NVME_QUIRK_DEALLOCATE_ZEROES:
|
||||
return "deallocate_zeroes";
|
||||
case NVME_QUIRK_DELAY_BEFORE_CHK_RDY:
|
||||
return "delay_before_chk_rdy";
|
||||
case NVME_QUIRK_NO_APST:
|
||||
return "no_apst";
|
||||
case NVME_QUIRK_NO_DEEPEST_PS:
|
||||
return "no_deepest_ps";
|
||||
case NVME_QUIRK_QDEPTH_ONE:
|
||||
return "qdepth_one";
|
||||
case NVME_QUIRK_MEDIUM_PRIO_SQ:
|
||||
return "medium_prio_sq";
|
||||
case NVME_QUIRK_IGNORE_DEV_SUBNQN:
|
||||
return "ignore_dev_subnqn";
|
||||
case NVME_QUIRK_DISABLE_WRITE_ZEROES:
|
||||
return "disable_write_zeroes";
|
||||
case NVME_QUIRK_SIMPLE_SUSPEND:
|
||||
return "simple_suspend";
|
||||
case NVME_QUIRK_SINGLE_VECTOR:
|
||||
return "single_vector";
|
||||
case NVME_QUIRK_128_BYTES_SQES:
|
||||
return "128_bytes_sqes";
|
||||
case NVME_QUIRK_SHARED_TAGS:
|
||||
return "shared_tags";
|
||||
case NVME_QUIRK_NO_TEMP_THRESH_CHANGE:
|
||||
return "no_temp_thresh_change";
|
||||
case NVME_QUIRK_NO_NS_DESC_LIST:
|
||||
return "no_ns_desc_list";
|
||||
case NVME_QUIRK_DMA_ADDRESS_BITS_48:
|
||||
return "dma_address_bits_48";
|
||||
case NVME_QUIRK_SKIP_CID_GEN:
|
||||
return "skip_cid_gen";
|
||||
case NVME_QUIRK_BOGUS_NID:
|
||||
return "bogus_nid";
|
||||
case NVME_QUIRK_NO_SECONDARY_TEMP_THRESH:
|
||||
return "no_secondary_temp_thresh";
|
||||
case NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND:
|
||||
return "force_no_simple_suspend";
|
||||
case NVME_QUIRK_BROKEN_MSI:
|
||||
return "broken_msi";
|
||||
case NVME_QUIRK_DMAPOOL_ALIGN_512:
|
||||
return "dmapool_align_512";
|
||||
}
|
||||
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
/*
|
||||
* Common request structure for NVMe passthrough. All drivers must have
|
||||
* this structure as the first member of their request-private data.
|
||||
|
||||
Reference in New Issue
Block a user