Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp417104rdb; Tue, 16 Jan 2024 04:36:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2yXm9c08HxEWV+EIDTSmobjbkgcJwKTFxTyK2ssORAjQ2ZMT+BGbUBO18VnG/FRe22KXN X-Received: by 2002:a17:907:d383:b0:a2d:16d:d32c with SMTP id vh3-20020a170907d38300b00a2d016dd32cmr1668324ejc.86.1705408612145; Tue, 16 Jan 2024 04:36:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705408612; cv=none; d=google.com; s=arc-20160816; b=gPQ9vhLZJTs6zzWPHqd2QBrqSUs4bqWV2Iqvpm7oIekmK3uZjUHGyOekqv6M3bKhjq xNJ8HxCq6hTTZ4BC+fgpZk25e4bIgEMKUm8KtTAulykIyexiMHxxlM7Z6ysB2UOC/wUp wyfYRUwHnFXir4VNiwLUgd5STKW+ll9h4p9DW1OZtg0M35rWUuts1i+HF54VLa3RWNqX 1P1wILfjArwRpAONX0PFmrF7dI9TK5thejWYbNq3LvDJXK6efq2hIPq3MUsiG56ejTOE 21YytaaT+hjJe5cdtsojshFhuSkIbl/hKTB9mOjxApCuilYuUkr3g35YNgDf1zJqYoLU bljw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date; bh=hI6Ih1vNSrRQ7UR7I7mH5hXv1iyhOBReh0pyU/a/+Qs=; fh=mIL69XSslmxGCzVxQAoIXbkjVTPg7WBnc++bbs058u8=; b=rUkvlytUzJtfLAuRUVI1+0A3HjlhlN3cf9NUQeEKtruABRLFFJHTx9xQco3hiaLWWM qTyxQN7eS9RH2rQQJ/QNq2WFtmjLYROODGfL6n2hsuHmelJ0fGe8zpIoo99J6MIkddcu fXX+oHR3wV0aiAz7N2pE+cWoC1G8KPkVX+BbXTrHv7WXptSDLryjIFnw7GceKq9JZ6nm Cl7+q/z2L1IA8teUzwmLUPEskWB2+fwXikT9wfQsGdwSGW+MrbwYhxzR5I3yTeHyV++N jKSGDU8ESyb+BVQfPG4V3+3LkHWQB//xktjobpGcWoveUAATJRH6Lh3oOmI9bqixiKf+ zF+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27384-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27384-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q7-20020a1709066ac700b00a2e7932d485si502888ejs.793.2024.01.16.04.36.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 04:36:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27384-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27384-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27384-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C5BDB1F24502 for ; Tue, 16 Jan 2024 12:36:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 820101BC31; Tue, 16 Jan 2024 12:36:42 +0000 (UTC) Received: from mail.wantstofly.org (hmm.wantstofly.org [213.239.204.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0725A1BC26; Tue, 16 Jan 2024 12:36:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wantstofly.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wantstofly.org Received: by mail.wantstofly.org (Postfix, from userid 1000) id AB7DD7F5C3; Tue, 16 Jan 2024 14:27:40 +0200 (EET) Date: Tue, 16 Jan 2024 14:27:40 +0200 From: Lennert Buytenhek To: Damien Le Moal , Niklas Cassel , linux-ide@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: ASMedia ASM1062 (AHCI) hang after "ahci 0000:28:00.0: Using 64-bit DMA addresses" Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On kernel 6.6.x, with an ASMedia ASM1062 (AHCI) controller, on an ASUSTeK Pro WS WRX80E-SAGE SE WIFI mainboard, PCI ID 1b21:0612 and subsystem ID 1043:858d, I got a total apparent controller hang, rendering the two attached SATA devices unavailable, that was immediately preceded by the following kernel messages: [Thu Jan 4 23:12:54 2024] ahci 0000:28:00.0: Using 64-bit DMA addresses [Thu Jan 4 23:12:54 2024] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00000 flags=0x0000] [Thu Jan 4 23:12:54 2024] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00300 flags=0x0000] [Thu Jan 4 23:12:54 2024] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00380 flags=0x0000] [Thu Jan 4 23:12:54 2024] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00400 flags=0x0000] [Thu Jan 4 23:12:54 2024] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00680 flags=0x0000] [Thu Jan 4 23:12:54 2024] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00700 flags=0x0000] It seems as if the controller has problems with 64-bit DMA addresses, and the comments around the source of the message in drivers/iommu/dma-iommu.c seem to point into that same direction: /* * Try to use all the 32-bit PCI addresses first. The original SAC vs. * DAC reasoning loses relevance with PCIe, but enough hardware and * firmware bugs are still lurking out there that it's safest not to * venture into the 64-bit space until necessary. * * If your device goes wrong after seeing the notice then likely either * its driver is not setting DMA masks accurately, the hardware has * some inherent bug in handling >32-bit addresses, or not all the * expected address bits are wired up between the device and the IOMMU. */ if (dma_limit > DMA_BIT_MASK(32) && dev->iommu->pci_32bit_workaround) { iova = alloc_iova_fast(iovad, iova_len, DMA_BIT_MASK(32) >> shift, false); if (iova) goto done; dev->iommu->pci_32bit_workaround = false; dev_notice(dev, "Using %d-bit DMA addresses\n", bits_per(dma_limit)); } Are there any tests you can think of that I can run to further narrow down this issue? By itself, the issue reproduces only rarely. Thank you in advance. Kind regards, Lennert