Skip to content

Commit 87cf460

Browse files
calebsanderigaw
authored andcommitted
ioctl: set correct bits in Set Features commands
A few nvme_set_features_*() functions are setting the wrong bits in CDW11 based on their inputs. Correct the fields passed to NVME_SET(). Signed-off-by: Caleb Sander <[email protected]>
1 parent 85631b4 commit 87cf460

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/nvme/ioctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ int nvme_set_features_power_mgmt(int fd, __u8 ps, __u8 wh, bool save,
585585
__u32 *result)
586586
{
587587
__u32 value = NVME_SET(ps, FEAT_PWRMGMT_PS) |
588-
NVME_SET(wh, FEAT_PWRMGMT_PS);
588+
NVME_SET(wh, FEAT_PWRMGMT_WH);
589589

590590
return __nvme_set_features(fd, NVME_FEAT_FID_POWER_MGMT, value, save,
591591
result);
@@ -630,8 +630,8 @@ int nvme_set_features_volatile_wc(int fd, bool wce, bool save, __u32 *result)
630630
int nvme_set_features_irq_coalesce(int fd, __u8 thr, __u8 time, bool save,
631631
__u32 *result)
632632
{
633-
__u32 value = NVME_SET(thr, FEAT_IRQC_TIME) |
634-
NVME_SET(time, FEAT_IRQC_THR);
633+
__u32 value = NVME_SET(thr, FEAT_IRQC_THR) |
634+
NVME_SET(time, FEAT_IRQC_TIME);
635635

636636
return __nvme_set_features(fd, NVME_FEAT_FID_IRQ_COALESCE, value, save,
637637
result);

0 commit comments

Comments
 (0)