Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1130257rdb; Wed, 24 Jan 2024 05:58:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEy1bb9NBNbqyxxe9LfcNBtmgQrbiau+4Nz+30qQiHbTwDqYVia0xMfhj4CKX63zOoAzFA3 X-Received: by 2002:a05:600c:21d0:b0:40e:5320:2582 with SMTP id x16-20020a05600c21d000b0040e53202582mr785271wmj.107.1706104701078; Wed, 24 Jan 2024 05:58:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706104701; cv=pass; d=google.com; s=arc-20160816; b=g7qd0fzUDGkqmkvm33E7z+QjMwiPtB9EaIqdzThUn67jEZKh7lfmkb2c/ujR14XNzy BRmUDALUP083QJJzIy5qhWoUj3Ui0NnTlPCmR4WPKjiisfDNi+X0TURSIlKJhhTKbBnH BBcG0tGLV3l+i/gUQngNTCz8i60CYjoSeOiYY0/u/d9YBcRH7RJnvZydKQxcuQaXoFQ1 kr/R7ZRrjLDurFVScPA7g4qx+tOR6cK6r7ZnKOu++4KNDM1RmMGBP0TooF8ki5NwF1DT SWr1jpu/K20VT6y6h19aEmIiNxo7aYI12/HOz/z6EcuxrIqRD1nTMRItC3QtCP/3vV6R Ww/g== 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; bh=EgRDUrjKkaMYLYyVuEqq7eV3fDMp6mPl5oL7OegZuVo=; fh=zjU946mIYTYKaYW32jnGINAoO5kjq0Rrf10MCOspxMY=; b=ZO0/u8yvTQrf5QRy9edb5VaDvjNMIkGUgEsCEAd8MAJCINLvemtc0G3mvTPAmVX0ho 0iFlHifWeDN8+sCUBOsMWFcVBKsil6Qsc7+s7w3iX2A48BcwFUTT7hfEfjn2abQsW5Xq HHqrp6GEhlz1gpmzggWxJ9lhVsS3iSHYd7gBp3oHYzLVYoVM9jQwLkH5ylcVmOaK37PT ufHU3wYw6J2C3sln6usvejSgFTpcnuSk8KXJ49d9aLE8o0BobuQsdh5J02lT0gMnDQf/ O60B6o1m2GsKR4ps0FtLswcnEnHRyRFBU4qFLOGMMUVBg5oLJ4W4t3WJ0724COOrZfZk qaqw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=wantstofly.org); spf=pass (google.com: domain of linux-kernel+bounces-37082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37082-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 v5-20020a509545000000b0055c2e91b96esi3465529eda.363.2024.01.24.05.58.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 05:58:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37082-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; arc=pass (i=1 spf=pass spfdomain=wantstofly.org); spf=pass (google.com: domain of linux-kernel+bounces-37082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37082-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 C3D6B1F25B47 for ; Wed, 24 Jan 2024 13:58:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BFC887A700; Wed, 24 Jan 2024 13:58:13 +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 1FCA377658; Wed, 24 Jan 2024 13:58:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.239.204.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706104693; cv=none; b=F1SNGpKWyks0zO8/3N/FJV96GGSWX6BvOa/WLnL3F1NDmn6vrdW/9E8xNwE4UBMku6IMAUkzAGHLs4PExM3XmQS2ALxoxuKbD2gS1dnC6GQb8TZ6yq4dpOFoZ6cRuVSr+/iIMLngjenRU7te39eTGQyDTG2syeX9JHkmcbnjSf8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706104693; c=relaxed/simple; bh=q/2/V58ITZlDDjL2VM6IfKb7G4x7oTR6z6aY16ImCkw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q/cBE641TscChXDNAUbG+64BIEafA2KmYnrc38qYLkBt70WjIdQTvgbzfbvQFZwfZ/4RPOblCaNI+BKz7qUMpjvgI+p6R91Z2kcbpAWFboKecwesMVDHKAuUtfAtuSoAbbw8zMknW0YuUmuLZe26bEWF3+XpPVnvr0ej926bITM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wantstofly.org; spf=pass smtp.mailfrom=wantstofly.org; arc=none smtp.client-ip=213.239.204.108 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 8EDCB7F712; Wed, 24 Jan 2024 15:58:08 +0200 (EET) Date: Wed, 24 Jan 2024 15:58:08 +0200 From: Lennert Buytenhek To: Niklas Cassel Cc: Niklas Cassel , Damien Le Moal , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: ASMedia ASM1062 (AHCI) hang after "ahci 0000:28:00.0: Using 64-bit DMA addresses" Message-ID: References: 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: On Wed, Jan 24, 2024 at 02:40:51PM +0200, Lennert Buytenhek wrote: > > > There are two ways to handle this -- either set the DMA mask for ASM106x > > > parts to 43 bits, or take the lazy route and just use AHCI_HFLAG_32BIT_ONLY > > > for these parts. I feel that the former would be more appropriate, as > > > there seem to be plenty of bits beyond bit 31 that do work, but I will > > > defer to your judgement on this matter. What do you think the right way > > > to handle this apparent hardware quirk is? > > > > I've seen something similar for NVMe, where some NVMe controllers from > > Amazon was violating the spec, and only supported 48-bit DMA addresses, > > even though NVMe spec requires you to support 64-bit DMA addresses, see: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4bdf260362b3be529d170b04662638fd6dc52241 > > > > It is possible that ASMedia ASM1061 has a similar problem (but for AHCI) > > and only supports 43-bit DMA addresses, even though it sets AHCI CAP.S64A, > > which says "Indicates whether the HBA can access 64-bit data structures.". > > > > I think the best thing is to do a similar quirk, where we set the dma_mask > > accordingly. > > I'll give that a try. I've sent out a patch that appears (from printk debugging) to do the right thing, but I haven't validated that that patch fixes the original issue, as the original issue is not trivial to trigger, and the hardware that it triggered on is currently unavailable. I've also made the quirk apply to all ASMedia ASM106x parts, because I expect them to be affected by the same issue, but let's see what the ASMedia folks have to say about that. Thanks for your help! Kind regards, Lennert