Skip to content

ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585#504

Merged
HeyMeco merged 1 commit into
armbian:rk-6.1-rkr5.1from
HeyMeco:jmb58x-fix-backport
Jun 14, 2026
Merged

ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585#504
HeyMeco merged 1 commit into
armbian:rk-6.1-rkr5.1from
HeyMeco:jmb58x-fix-backport

Conversation

@HeyMeco

@HeyMeco HeyMeco commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

The JMicron JMB585 (and JMB582) SATA controllers advertise 64-bit DMA support via the S64A bit in the AHCI CAP register, but their 64-bit DMA implementation is defective. Under sustained I/O, DMA transfers targeting addresses above 4GB silently corrupt data -- writes land at incorrect memory addresses with no errors logged.

Add device-specific PCI ID entries for the JMB582 (0x0582) and JMB585 (0x0585) before the generic JMicron class match, using a new board type that combines AHCI_HFLAG_IGN_IRQ_IF_ERR (preserving existing behavior) with AHCI_HFLAG_32BIT_ONLY to force 32-bit DMA masks.

Backport from upstream commit 105c425 ("ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585").


This bug is present on RK3588 as it reports 64 bit wide dma.

The JMicron JMB585 (and JMB582) SATA controllers advertise 64-bit DMA
support via the S64A bit in the AHCI CAP register, but their 64-bit DMA
implementation is defective. Under sustained I/O, DMA transfers targeting
addresses above 4GB silently corrupt data -- writes land at incorrect
memory addresses with no errors logged.

Add device-specific PCI ID entries for the JMB582 (0x0582) and JMB585
(0x0585) before the generic JMicron class match, using a new board type
that combines AHCI_HFLAG_IGN_IRQ_IF_ERR (preserving existing behavior)
with AHCI_HFLAG_32BIT_ONLY to force 32-bit DMA masks.

Backport from upstream commit 105c425 ("ata: ahci: force 32-bit DMA
for JMicron JMB582/JMB585").
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1edd0ef3-fbee-4206-b054-4ab237a9eaea

📥 Commits

Reviewing files that changed from the base of the PR and between 64a8171 and 2c237ac.

📒 Files selected for processing (1)
  • drivers/ata/ahci.c

Walkthrough

drivers/ata/ahci.c is extended with a new board quirk for JMicron JMB582/585 AHCI controllers. A new board_ahci_jmb585 identifier is added to the board_ids enum. A corresponding entry is inserted into the ahci_port_info array, setting the IGN_IRQ_IF_ERR and 32BIT_ONLY flags with standard ahci_ops. Two entries are appended to ahci_pci_tbl to match JMicron PCI device IDs 0x0582 and 0x0585 to this new board configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: forcing 32-bit DMA for specific JMicron SATA controllers.
Description check ✅ Passed The description provides detailed context about the hardware defect, the fix approach, and relevance to RK3588, clearly relating to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HeyMeco

HeyMeco commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator Author

@igorpecovnik when this is merged can we issue a kernel update via apt?

@x13-me x13-me left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, no concerns

@HeyMeco
HeyMeco merged commit 95e85f6 into armbian:rk-6.1-rkr5.1 Jun 14, 2026
2 checks passed
@HeyMeco
HeyMeco deleted the jmb58x-fix-backport branch June 14, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants