Skip to content

Commit

Permalink
Merge pull request #96 from nicktehrany/fix_nvme_cc_5.19-Linux
Browse files Browse the repository at this point in the history
Fix 5.19 Kernel NVMe CC issue
  • Loading branch information
huaicheng authored Feb 21, 2023
2 parents d298883 + 68e57dd commit 262f3ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hw/femu/femu.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ static void nvme_write_bar(FemuCtrl *n, hwaddr offset, uint64_t data, unsigned s
n->bar.intmc = n->bar.intms;
break;
case 0x14:
/* If first sending data, then sending enable bit */
if (!NVME_CC_EN(data) && !NVME_CC_EN(n->bar.cc) &&
!NVME_CC_SHN(data) && !NVME_CC_SHN(n->bar.cc))
{
n->bar.cc = data;
}

if (NVME_CC_EN(data) && !NVME_CC_EN(n->bar.cc)) {
n->bar.cc = data;
if (nvme_start_ctrl(n)) {
Expand Down

0 comments on commit 262f3ba

Please sign in to comment.