Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp388011rdb; Thu, 22 Feb 2024 06:59:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXo8TTsaheyXL9dE+kYfNdzgBJjsqnopQ8Vt0lUuoquwszEyLCLR535OY3khloCn4z3lwHIu51GS0lU/NacT/fWXEcn96WRUjgt+wO8IA== X-Google-Smtp-Source: AGHT+IE3s7w+0hYsf1jkZG1uBL1Vkm4814hZU54irxvbQVuGTwRve+K29aFTo5/AGZbLA3GHD/kJ X-Received: by 2002:a17:906:d107:b0:a3e:50ac:c5c9 with SMTP id b7-20020a170906d10700b00a3e50acc5c9mr8632307ejz.72.1708613943517; Thu, 22 Feb 2024 06:59:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708613943; cv=pass; d=google.com; s=arc-20160816; b=Z8pjeB2/k8Xl6Ae8zaxaQQNTkafSKGpynjcAjuU4MRP+FyUVS0lPHrJrX2ybjazA9l Wmi8eAXqr9UvV8UjIDk9a1y/evkpmg3H0h4IVSKBqP2lHShAi+ch+t1UMuiiB2bw68w4 XpVRc+1HQZD0h9WTpI7wCVx4urJPqVwjLbRKrYb1RIdWYn9JCBIzIS90A7iapZ/T2sxc R3Vt1nM/q8OGj+mVjtiV7h6xJM9Q4Py9c6XFaYazbMT9gQSoH1F6dKxD5aV1aJ+sLoIx 8uQFAyDxv0klGHgdnRTXPaUB4jyeBUKVNXx1ibcCz+ZQcyVgCmVKus8ffr5RT/COfyHt nrYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=l5ePKEMjQcRZh4Zi2X0yiL6JjpvWNtIoa4YonEfJsII=; fh=68YnZwUY/YTM7H/1j4ueo4aKELdMQghOSTjrYS1QDiU=; b=SnCNlKVVzrRu2/nBCsJhb6naMe8UFwkxNUtL1Bl2cN93/tIMqwnz06LfhSF6weYiac MI8IlJou91eIS3Ly1Y6yjkqp0oMJyXJKf+g6exSPTffNQmkNPcmKZYvaU0n0Xh4jMzyr FNxUcLjTlCSyYKhkvEInko42L6/q6M9CeuXEexX/dER2EBeuQ1OhAgWwR4svfevXiUNc ykEcyQQRWqQXt3OKSpvngweam+/B+52QVRVW1N8k64X/IcEBWJAySz/eHiy9VYmek1bC dt8pftfiTuezdFd9Dcdyqi7TJ0WzKnRE+TMUvJYfnNS4yw7OQsLIlvEWt0krC4dQJKXt 0j7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ALJmU1DO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76734-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76734-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dv19-20020a170906b81300b00a3ef7c0e120si2629257ejb.958.2024.02.22.06.59.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 06:59:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76734-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ALJmU1DO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76734-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76734-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 47C791F25017 for ; Thu, 22 Feb 2024 14:59:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E22CA148FE0; Thu, 22 Feb 2024 14:58:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ALJmU1DO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F1BC91474BF; Thu, 22 Feb 2024 14:58:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708613926; cv=none; b=BHK1H79zU3h/t8ZKPGe30FuEnnMevkxhOe/1v0jBTI52Z0+sf5BfTj+FgwcZafJgj61ZS1HQ8VqFz01Ehx9f+jO2Xqiwn7NWZtzzWetctuoSJNUqd1ZmZU+eoN8eicDg0K0bjMBOreayYrkwNUak2Ar8NZ7yszKUFnO+1okw+DA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708613926; c=relaxed/simple; bh=sU70cMz1yfymjOqSB1LBgx6TJXTSzu9SGscJYJXAATw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Li2ieQXzRF6EGwbsdN6Me5CSJ7UNf83yRszFE7r/Dto4NCYEzOuC/xohawTmWIpXfRus7t9l46Wpj7apP8jPbabdjAj5HoMCm8NSViRf/Uge8zYgwEf5r/Ohic3cFKlWEShlQnieC3+gE8vZHPE9Wp+GbVGgBUBZjE1Vc9AtI8c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ALJmU1DO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A9FCC433C7; Thu, 22 Feb 2024 14:58:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708613925; bh=sU70cMz1yfymjOqSB1LBgx6TJXTSzu9SGscJYJXAATw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ALJmU1DOFbaEnQAP2l/WnjDpdmPh9P9A8yzVVGUqxm/iULpw25DtYbnepbDpWljFZ nswvWaUHszQQImYnnozcHN9TXtv7vvg+8ZH0YLQUPKGE4c31fqInZgIvjvDrY5c+fc snVVhKsccDTX3G7XNGYsQI37fEDXcJOYXNW6h2rINqWe8xtxO+fiC+X37fKi39EoEN BUbAPzY25/QUo0NGzGDJOVr8cL1+DUyIBOogA6NswC6d5bmreGJfo9yzvbMKG8Zv4e JdAbvGJOV9nDODKeK8G74ENKRxKHXX3sTLFwezHpfTQ3jG0w81qMBb9EC2/lzhwcGS GHldtfp9zRtUQ== Date: Thu, 22 Feb 2024 15:58:39 +0100 From: Niklas Cassel To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Lennert Buytenhek , dlemoal@kernel.org, linux-ide@vger.kernel.org Subject: Re: [PATCH AUTOSEL 6.7 19/23] ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers Message-ID: References: <20240202183926.540467-1-sashal@kernel.org> <20240202183926.540467-19-sashal@kernel.org> 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 In-Reply-To: <20240202183926.540467-19-sashal@kernel.org> Hello Sasha, On Fri, Feb 02, 2024 at 01:39:15PM -0500, Sasha Levin wrote: > From: Lennert Buytenhek > > [ Upstream commit 20730e9b277873deeb6637339edcba64468f3da3 ] > > With one of the on-board ASM1061 AHCI controllers (1b21:0612) on an > ASUSTeK Pro WS WRX80E-SAGE SE WIFI mainboard, a controller hang was > observed that was immediately preceded by the following kernel > messages: > > ahci 0000:28:00.0: Using 64-bit DMA addresses > ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00000 flags=0x0000] > ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00300 flags=0x0000] > ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00380 flags=0x0000] > ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00400 flags=0x0000] > ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00680 flags=0x0000] > ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00700 flags=0x0000] > > The first message is produced by code in drivers/iommu/dma-iommu.c > which is accompanied by the following comment that seems to apply: > > /* > * 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. > */ > > Asking the ASM1061 on a discrete PCIe card to DMA from I/O virtual > address 0xffffffff00000000 produces the following I/O page faults: > > vfio-pci 0000:07:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0021 address=0x7ff00000000 flags=0x0010] > vfio-pci 0000:07:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0021 address=0x7ff00000500 flags=0x0010] > > Note that the upper 21 bits of the logged DMA address are zero. (When > asking a different PCIe device in the same PCIe slot to DMA to the > same I/O virtual address, we do see all the upper 32 bits of the DMA > address as 1, so this is not an issue with the chipset or IOMMU > configuration on the test system.) > > Also, hacking libahci to always set the upper 21 bits of all DMA > addresses to 1 produces no discernible effect on the behavior of the > ASM1061, and mkfs/mount/scrub/etc work as without this hack. > > This all strongly suggests that the ASM1061 has a 43 bit DMA address > limit, and this commit therefore adds a quirk to deal with this limit. > > This issue probably applies to (some of) the other supported ASMedia > parts as well, but we limit it to the PCI IDs known to refer to > ASM1061 parts, as that's the only part we know for sure to be affected > by this issue at this point. > > Link: https://lore.kernel.org/linux-ide/ZaZ2PIpEId-rl6jv@wantstofly.org/ > Signed-off-by: Lennert Buytenhek > [cassel: drop date from error messages in commit log] > Signed-off-by: Niklas Cassel > Signed-off-by: Sasha Levin > --- I still don't see this commit in stable/linux-6.7.y branch? Nor in: https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git What am I missing? ($subject had this patch marked as AUTOSEL, so I would have assumed that it should have been merged by now, since this was 20 days ago.) This patch in $subject is needed for another follow up patch which failed to be backported because $subject patch is not in stable/linux-6.7.y: https://lore.kernel.org/stable/2024021945-jockey-spending-9e68@gregkh/ (The follup up patch had CC: stable tag, but the patch in $subject unfortunately forgot to add CC: stable tag.) Could you please help to get both: 20730e9b2778 ("ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers") and 51af8f255bda ("ahci: Extend ASM1061 43-bit DMA address quirk to other ASM106x parts") backported to kernel 6.6 and 6.7. No need to backport to older kernels, as this problem was first exposed by: 791c2b17fb40 ("iommu: Optimise PCI SAC address trick") which started to put devices into >4GB DMA address range. Kind regards, Niklas