diff options
| author | Tom Rini <[email protected]> | 2026-05-21 08:16:56 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-05-21 08:16:56 -0600 |
| commit | 46b29a7d128047f6e42369b018752947beb1f751 (patch) | |
| tree | a837689f92fb2998561ceb9315fbc0c584747ced | |
| parent | 38dbe637c9dfcadbd1bc201bfbb27f96b2ad525a (diff) | |
| parent | 4f510505988928e129e109811587c4a00d28ec56 (diff) | |
Merge tag 'u-boot-nvme-fixes-20260521' of https://source.denx.de/u-boot/custodians/u-boot-ufs
- Add myself as Maintainer of NVMe
- fix command ID wraparound handling
- apple: Check memalign return value
- Staticize and constify driver ops
- Fix PRP list pointer arithmetic for chained transfers
| -rw-r--r-- | MAINTAINERS | 1 | ||||
| -rw-r--r-- | drivers/nvme/nvme-uclass.c | 2 | ||||
| -rw-r--r-- | drivers/nvme/nvme.c | 7 | ||||
| -rw-r--r-- | drivers/nvme/nvme_apple.c | 3 |
4 files changed, 10 insertions, 3 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index ea646f618a5..2613929cdf5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1506,6 +1506,7 @@ T: git https://source.denx.de/u-boot/custodians/u-boot-nios.git F: arch/nios2/ NVMe +M: Neil Armstrong <[email protected]> M: Bin Meng <[email protected]> S: Maintained F: drivers/nvme/ diff --git a/drivers/nvme/nvme-uclass.c b/drivers/nvme/nvme-uclass.c index 44c88ad27f3..4ab9567450f 100644 --- a/drivers/nvme/nvme-uclass.c +++ b/drivers/nvme/nvme-uclass.c @@ -44,7 +44,7 @@ UCLASS_DRIVER(nvme) = { .id = UCLASS_NVME, }; -struct bootdev_ops nvme_bootdev_ops = { +static const struct bootdev_ops nvme_bootdev_ops = { }; static const struct udevice_id nvme_bootdev_ids[] = { diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c index 2b14437f69c..0631b190b97 100644 --- a/drivers/nvme/nvme.c +++ b/drivers/nvme/nvme.c @@ -94,7 +94,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, *(prp_pool + i) = cpu_to_le64((ulong)prp_pool + page_size); i = 0; - prp_pool += page_size; + prp_pool = (u64 *)((uintptr_t)prp_pool + page_size); } *(prp_pool + i++) = cpu_to_le64(dma_addr); dma_addr += page_size; @@ -112,7 +112,10 @@ static __le16 nvme_get_cmd_id(void) { static unsigned short cmdid; - return cpu_to_le16((cmdid < USHRT_MAX) ? cmdid++ : 0); + if (cmdid >= USHRT_MAX) + cmdid = 0; + + return cpu_to_le16(cmdid++); } static u16 nvme_read_completion_status(struct nvme_queue *nvmeq, u16 index) diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c index 3e7d95c2b54..e674eda8344 100644 --- a/drivers/nvme/nvme_apple.c +++ b/drivers/nvme/nvme_apple.c @@ -88,6 +88,9 @@ static int apple_nvme_setup_queue(struct nvme_queue *nvmeq) } priv->tcbs[nvmeq->qid] = (void *)memalign(4096, ANS_NVMMU_TCB_SIZE); + if (!priv->tcbs[nvmeq->qid]) + return -ENOMEM; + memset((void *)priv->tcbs[nvmeq->qid], 0, ANS_NVMMU_TCB_SIZE); switch (nvmeq->qid) { |
