Thread (25 messages) 25 messages, 6 authors, 2025-08-29

Re: [PATCH v2 7/9] nvme: apple: Add Apple A11 support

From: Christoph Hellwig <hch@lst.de>
Date: 2025-08-19 08:30:46
Also in: asahi, linux-devicetree, linux-iommu, linux-nvme, lkml

On Mon, Aug 18, 2025 at 04:43:00PM +0800, Nick Chan wrote:
 };
 
+struct apple_nvme_hw {
+	bool has_lsq_nvmmu;
+	u32 max_queue_depth;
+	void (*submit_cmd)(struct apple_nvme_queue *q, struct nvme_command *cmd);
Please stick to 80 character lines for the NVMe code.

Also I don't think an indirect call here is a good idea.  This is right
in the command submission fast path.  A simple branch will be a lot
faster.
+
+	if (q->is_adminq)
+		memcpy(&q->sqes[tag], cmd, sizeof(*cmd));
+	else
+		memcpy((void *)q->sqes + (tag << APPLE_NVME_IOSQES), cmd, sizeof(*cmd));
This could use a helper and / or comment to make the calculation
more obvious.
+	anv->hw = (const struct apple_nvme_hw *)of_device_get_match_data(&pdev->dev);
Do we even need this cast?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help