{"id":2219710,"url":"http://patchwork.ozlabs.org/api/patches/2219710/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ide/patch/20260403225314.96459-1-artmoty@gmail.com/","project":{"id":13,"url":"http://patchwork.ozlabs.org/api/projects/13/?format=json","name":"Linux IDE development","link_name":"linux-ide","list_id":"linux-ide.vger.kernel.org","list_email":"linux-ide@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260403225314.96459-1-artmoty@gmail.com>","list_archive_url":null,"date":"2026-04-03T22:53:14","name":"[v2] ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"f645cd7206507ed8c8ffebff4189344183417c69","submitter":{"id":93046,"url":"http://patchwork.ozlabs.org/api/people/93046/?format=json","name":"Arthur Husband","email":"artmoty@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ide/patch/20260403225314.96459-1-artmoty@gmail.com/mbox/","series":[{"id":498682,"url":"http://patchwork.ozlabs.org/api/series/498682/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ide/list/?series=498682","date":"2026-04-03T22:53:14","name":"[v2] ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585","version":2,"mbox":"http://patchwork.ozlabs.org/series/498682/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2219710/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2219710/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-ide+bounces-5441-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ide@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=OlVFUOTz;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-ide+bounces-5441-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"OlVFUOTz\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.214.177","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnYsy4KS8z1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 09:53:26 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 2B9823008988\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 22:53:23 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 2F8C8374E7A;\n\tFri,  3 Apr 2026 22:53:22 +0000 (UTC)","from mail-pl1-f177.google.com (mail-pl1-f177.google.com\n [209.85.214.177])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id E2B273624A7\n\tfor <linux-ide@vger.kernel.org>; Fri,  3 Apr 2026 22:53:20 +0000 (UTC)","by mail-pl1-f177.google.com with SMTP id\n d9443c01a7336-2b24fcc2b5dso15112295ad.1\n        for <linux-ide@vger.kernel.org>; Fri, 03 Apr 2026 15:53:20 -0700 (PDT)","from fedora.mshome.net ([162.247.45.47])\n        by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b2749c38adsm84776375ad.69.2026.04.03.15.53.19\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Fri, 03 Apr 2026 15:53:19 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775256802; cv=none;\n b=D0Qi73Tftlj20/kZ5kaXMaNM3yJUc+0kZWoP65AN0mO3uvuksJuPhiDcb5SKtTpDtnT8lcqyFu0r6In+WcWI4Spyj3/DPUBx5uqfqRdrAR6ILZb+AW8uXEchchtbITwt0XkeRNVhymQFU53G0V1UPu8qrpTwfAcY2M2/quZ28o0=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775256802; c=relaxed/simple;\n\tbh=eprISpmCG1iTcAbl9gyLBENb03Bt3s33TR+VmRDN2O0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=ZfOiccAfhHAzMgQbd+w3vt+/yf/uHK3F8U1/2yoPW97qqQZsnXyNqdRWInqU7bIh/9RaIYewykzTwDOarA5L+EHcXCcPxIN92IqYgLWT7nBsLtR44GK2EdBpqVzEKAKExL08CWVvvSh7i6dTQ054k2brG/dJa98f/Nvzvuil5Lg=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=OlVFUOTz; arc=none smtp.client-ip=209.85.214.177","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1775256800; x=1775861600;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=vP3I7x1aHfaau206ls0y7NJ32arb32yUHOQgHg/w8ZY=;\n        b=OlVFUOTzWbMgCDctERojBw3WkNDdcxmDJWjbU2tLInfHg2FCBUzl9YsfuvYVazbkd2\n         8MVHVFQ+oBp2PwfLU6qsbziERFNe5gsZXcb/xqQxJM0SUNcY0rCllOpuSPc31byScIfC\n         hF9zNLMKuuL2ViV2yTL7Rbo7SNzbhjZEeJK6fPHWoMDXLXsbdAF8SLpsTRs32zL6mEdt\n         Xb2vTPbUdxhTO72xmB6lJ7Gdt5qafaA4EvOlqF4pZ73wp8mvB1Le4Z9V3L8V3SdGvEYo\n         9rQ0zjjvtvk9EboXlkXw1dIT2XvuISntC8yG+R6QeRxfvS4Og0qtz6MuhM3vJMxSMpDk\n         SZkg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775256800; x=1775861600;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=vP3I7x1aHfaau206ls0y7NJ32arb32yUHOQgHg/w8ZY=;\n        b=K/eoLWKN+YtVb42mRQUbHVXYzR1UB5aTdmZYmTcbWyAlRY/4I7T+B5FLheNnh09/dF\n         iQCN6H4tPxH5G3arEKXtJ1QSKw1z6SLag7bAOhRUs9HTBpAokxKJEJ701Lai2aUosN6w\n         yXIfC2DrHyg8VM6oUzPKUk9n1fZT5nQN0lBX5FVmZqIxp95EiK6st2C43EWcwxHs5uAx\n         XsbwvCmAFiQinN7EX2A2k5AJSx1SRWP7c1iyQd/cWwTeWDVF88gezrn8fgNLLCjjiDkC\n         inalYHz94c8O4gxiZeuT+RUF0BW0/PNN+cMiZeGbAocFtQQQdRTSpbadgLEZoC931mY5\n         da2A==","X-Gm-Message-State":"AOJu0Yx4QuitD8fWRdZhHkzs3T2ussesNyM72QEHtRLkqsqQxeeY1C1A\n\tqimjP+eVZAzbrj6j0SA0VyOYhoJcUaMU9fjggdES5ttbV4+Z/vYZ6nTC/0xAK3Nhj2s=","X-Gm-Gg":"AeBDieu6g5rWQDDF+Apt5wXgNsjmuGeIyQS0tVb2QjoABPDHMqzncBBhNaevDkbeTHG\n\tV81Lz2JIHqL0BRlPqVVlYQ0STmMnwh34I2p4ddGXLiJ29Dn46yCKrU8/F/6k3l9Z0ricm2eTFZb\n\thfTmhSesMzp0wrjcxt40VP5sYUyGOmcSJ5bfw0OmMpEENxAOJ+xuD1yhNQhV1nkeThNLV3XqmkT\n\tnFbmDWPTSL89XdV7c2U6NByKW7HpKm3jwzt3RkwaSO29KiNCiGdAE3qE0fsVR8FRLMlfHAE2Dt2\n\tW2hhs3Dx4lyinYtM10TrdEYQXXg5vAs05sco6yT9BaW14XOJPunafTDet7nWff61E2hQ6mqIRqr\n\tRvNdvGyL0iqK/Tl7Cf50CJm2T5b4yNgL/v+ANOEXZH6pfnlGqi4k4sqaTowspOYjpaoHvmP9tco\n\tnbmfx21pJIPmJPjR9Rs2oqWycpQQX2YCMrM94N","X-Received":"by 2002:a17:903:b0e:b0:2b0:65e8:4041 with SMTP id\n d9443c01a7336-2b28186117fmr43241355ad.36.1775256799953;\n        Fri, 03 Apr 2026 15:53:19 -0700 (PDT)","From":"Arthur Husband <artmoty@gmail.com>","To":"linux-ide@vger.kernel.org","Cc":"dlemoal@kernel.org,\n\tcassel@kernel.org,\n\tartmoty@gmail.com","Subject":"[PATCH v2] ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585","Date":"Fri,  3 Apr 2026 15:53:14 -0700","Message-ID":"<20260403225314.96459-1-artmoty@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260403050418.50398-1-artmoty@gmail.com>","References":"<20260403050418.50398-1-artmoty@gmail.com>","Precedence":"bulk","X-Mailing-List":"linux-ide@vger.kernel.org","List-Id":"<linux-ide.vger.kernel.org>","List-Subscribe":"<mailto:linux-ide+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ide+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"The JMicron JMB585 (and JMB582) SATA controllers advertise 64-bit DMA\nsupport via the S64A bit in the AHCI CAP register, but their 64-bit DMA\nimplementation is defective. Under sustained I/O, DMA transfers targeting\naddresses above 4GB silently corrupt data -- writes land at incorrect\nmemory addresses with no errors logged.\n\nThe failure pattern is similar to the ASMedia ASM1061 (commit\n2073d0e9b2778 (\"ahci: add 43-bit DMA address quirk for ASMedia ASM1061\ncontrollers\")), which also falsely advertised full 64-bit DMA support.\nHowever, the JMB585 requires a stricter 32-bit DMA mask rather than\n43-bit, as corruption occurs with any address above 4GB.\n\nOn the Minisforum N5 Pro specifically, the combination of the JMB585's\nbroken 64-bit DMA with the AMD Family 1Ah (Strix Point) IOMMU causes\nsilent data corruption that is only detectable via checksumming\nfilesystems (BTRFS/ZFS scrub). The corruption occurs when 32-bit IOVA\nspace is exhausted and the kernel transparently switches to 64-bit DMA\naddresses.\n\nAdd device-specific PCI ID entries for the JMB582 (0x0582) and JMB585\n(0x0585) before the generic JMicron class match, using a new board type\nthat combines AHCI_HFLAG_IGN_IRQ_IF_ERR (preserving existing behavior)\nwith AHCI_HFLAG_32BIT_ONLY to force 32-bit DMA masks.\n\nSigned-off-by: Arthur Husband <artmoty@gmail.com>\n---\n drivers/ata/ahci.c | 16 +++++++++++++++-\n 1 file changed, 15 insertions(+), 1 deletion(-)\n\n \tboard_ahci_mcp89,\n@@ -115,6 +116,14 @@ static const struct ata_port_info ahci_port_info[] = {\n \t\t.udma_mask\t= ATA_UDMA6,\n \t\t.port_ops\t= &ahci_ops,\n \t},\n+\t/* JMicron JMB582/585: 64-bit DMA is broken, force 32-bit */\n+\t[board_ahci_jmb585] = {\n+\t\tAHCI_HFLAGS\t(AHCI_HFLAG_IGN_IRQ_IF_ERR |\n+\t\t\t\t AHCI_HFLAG_32BIT_ONLY),\n+\t\t.flags\t\t= AHCI_FLAG_COMMON,\n+\t\t.pio_mask\t= ATA_PIO4,\n+\t\t.udma_mask\t= ATA_UDMA6,\n+\t\t.port_ops\t= &ahci_ops,\n+\t},\n \t[board_ahci_no_debounce_delay] = {\n \t\t.flags\t\t= AHCI_FLAG_COMMON,\n \t\t.link_flags\t= ATA_LFLAG_NO_DEBOUNCE_DELAY,\n@@ -XXX,7 +XXX,12 @@ static const struct pci_device_id ahci_pci_tbl[] = {\n \t...\n\n-\t/* JMicron 360/1/3/5/6, match class to avoid IDE function */\n+\t/* JMicron JMB582/585: force 32-bit DMA (broken 64-bit implementation) */\n+\t{ PCI_VDEVICE(JMICRON, 0x0582), board_ahci_jmb585 },\n+\t{ PCI_VDEVICE(JMICRON, 0x0585), board_ahci_jmb585 },\n+\n+\t/* JMicron 360/1/3/5/6, match class to avoid IDE function */\n \t{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,\n \t  PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr },\n\n--","diff":"diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c\nindex XXXXXXX..XXXXXXX 100644\n--- a/drivers/ata/ahci.c\n+++ b/drivers/ata/ahci.c\n@@ -51,6 +51,7 @@ enum board_ids {\n\n \t/* board IDs for specific chipsets in alphabetical order */\n \tboard_ahci_al,\n \tboard_ahci_avn,\n+\tboard_ahci_jmb585,\n \tboard_ahci_mcp65,\n \tboard_ahci_mcp77,\n","prefixes":["v2"]}