From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 504DA264A92 for ; Fri, 28 Nov 2025 16:35:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764347752; cv=none; b=ICdTXdkGXznfxmZSYkUROyDkCeY72wnYr8nMPKu8LAqwwT8EKxC5Doz6m8gpr2YElmbUxpml5K+EwwCQUBAh6QqbGFqDDWwS0SrpX4+BsdvzcnKvo7xg0a6DOBqIYffHSjnnQuxMVhkB/gbn5QbW4NM5tCjOsdmsQ/3B/+eD06s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764347752; c=relaxed/simple; bh=GOP/kpxv/SiG8IleAVvu3y+ovNM3AHbdlm/tdl/uDsI=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=VPL71TLdgPJNb/Fd4EMNUEQ9IbXNKk40mg1z1stSDTMEZ14/XZ7ikULywj/pL0gY3o0gVOp1i8NyxOrle/qI7h987YTVaS34Wa5inNXYLrDD3FGea8nyN/WdVXiBbsM3qXxdlRkKUHPwlEpxpiJJzx6MKtvmBnGZeK95kKg9aZA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marek.ca; spf=pass smtp.mailfrom=marek.ca; dkim=pass (2048-bit key) header.d=marek.ca header.i=@marek.ca header.b=AKGvIonl; arc=none smtp.client-ip=209.85.160.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marek.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marek.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marek.ca header.i=@marek.ca header.b="AKGvIonl" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-4ee158187aaso21716031cf.0 for ; Fri, 28 Nov 2025 08:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marek.ca; s=google; t=1764347749; x=1764952549; darn=vger.kernel.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=dsIiGN2rbV6QEaM41dIcddlDyFwba69ep6ezkRocLRE=; b=AKGvIonlFOQigaHBKSSeGgckHwdMJM9QTUckb5hessWdzB+1Y0kaicVncYT9owjoQj YBe/S/psKdU158bN/jOWntQoHYfOZW8v2OJs+jfpL5hY2DSendg7/vJM80+gHqTLAOmK rd0hm9+ijsZvgekLw/CtV9Y4zSIDPd/IhoFX9f0mAPmYQV4gE5H1IfikUa1rr2jymL1P gUq13GOECj2nH0LWnC5pP5QXOnNDFd+oo/MbkngWoY15SqO0vDi9RnfJ36f9hgjEf+Zx YQHQuSsoBO8UAdPxPFN5FigAH0rczTnvB0y7pxi8Zw5CGAQdlSHopKQSHBWJckqq5+dV DBEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764347749; x=1764952549; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dsIiGN2rbV6QEaM41dIcddlDyFwba69ep6ezkRocLRE=; b=jT8/0IHPGuOK2d/a4LJgbu0n43wvq03jgCSh7YQscdWBqb5iHmIypB+yVmTdOBi4FG I8f9sb4TxFW5nOvAjOM1HL3wBcxwZ1xS44gT6YpS5uiYBBknHJTUPvVr0XhEPURrj5Ro m1R8V10cPMQwn0IFKfoRfgizJgOfkdQNrkpszgTXli0+eM14Z5xMM1yrh/XEU4Jh9pEv 07KjB5DOhOEpRXsyw2Aa8zjQ3HY7oCtw3n2gdDA/kHUE4z6gVIv7o13NRG+v/XrbpqKr BIoyVIkQzLAeZaCHbeh/Q6soIPenF0qx905upvUOzfIrMo0EQIJXLaLknoKXo12hSA6R SYFg== X-Forwarded-Encrypted: i=1; AJvYcCVpUVgeNevjhUGYTZFPR9HOZqBPeNmo0tsTbOGl4N+OZgg4pnhRkDZsm2EBt/wQnK8ymiJQNXMMgSZpzAA=@vger.kernel.org X-Gm-Message-State: AOJu0YzSmtgjXH3m0UhS8PApyfdsMMhAqjyRXAbb11OxKQJ+MdGBGtzm 8KlR6QtRwe8HiX+FZVDO1uGyr6RjJ/dNCtkrTW0UNpvCsmJO3rhn7my7qLFaliYo8l7ekGL37NG HVrBb X-Gm-Gg: ASbGncu+8AakNLeITUB2U9sRbdUaATmmVOJhtos1O8Knr3Scx/YaYDUfE9axJ7Wi8wR DbDo4NNN/hi6XfGykExJad+3XVMAdduXNR4abt5UX46ULGCMvMazyayRMyHS4zZsZQ4b68f7ZIM 37MvXmUKxXFhGULIUucyTlKgB2BmykPRV7vll7JuXajdOlM0e67KArUJCGEPYiYgbhPXYfdOx6o ZkTIUtBzNC588218Aepg1yJy5pwlV1qpciwzP+q9T6GclujPsLgmbDBQJWLj2cJofdWtHz0E/4S vRmc6MegZ+2vyCX9hd37vDu/XqQSUdrHhRutEdv7re95n0oqrAUwrDktvhIIlS+pgxH1REc8RJi 1Y48AOtPPOVqW1ZHQLET5S0BVoJ1XrzZ1obGiPbMmWHeJRlaVcmxXNAzBPUbFmPvKPoXyDhrh7V oVreX9tOJzlWNplDNEh3vmT1hJyRLXXC5HwBy5syoif7i1mrAlGszKwbKfSA== X-Google-Smtp-Source: AGHT+IEid5PwFVhxwHcg2m8sj1oMjCxEDjABwlPhJ94vWnRIxAYTmRy804ezhMM72PRfoULBpaYSRw== X-Received: by 2002:a05:622a:591:b0:4d2:f9e3:c12d with SMTP id d75a77b69052e-4ee5883f8f2mr405538631cf.14.1764347747428; Fri, 28 Nov 2025 08:35:47 -0800 (PST) Received: from [192.168.0.189] (modemcable125.110-19-135.mc.videotron.ca. [135.19.110.125]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4efd34365b4sm28012621cf.26.2025.11.28.08.35.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Nov 2025 08:35:47 -0800 (PST) Subject: Re: [PATCH] arm64: dts: qcom: x1e: bus is 40-bits (fix 64GB models) To: Stephan Gerhold Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sibi Sankar , Abel Vesa , Rajendra Nayak , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list References: <20251127212943.24480-1-jonathan@marek.ca> From: Jonathan Marek Message-ID: <1aa75dd2-6fb4-e9ca-ca27-c0bd910246fe@marek.ca> Date: Fri, 28 Nov 2025 11:34:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/28/25 11:03 AM, Stephan Gerhold wrote: > On Fri, Nov 28, 2025 at 09:39:52AM -0500, Jonathan Marek wrote: >> On 11/28/25 5:26 AM, Stephan Gerhold wrote: ... >> >> I am using EL2. >> >> Without this patch, DMA buffers allocated in the upper 36-bit physical range >> will try to use bounce buffers. The dma range from the dts is compared >> against the physical address, not the virtual address. > > I don't think this is the case for the dma-iommu layer. I debugged a > crash caused by USB in EL1 on a 64 GiB device earlier this year and it > was happily using buffers above the 36-bit physical range without using > bounce buffers. There is some code inside dma-iommu for using swiotlb, > but it's used only for "untrusted" PCI devices and some edge cases with > unaligned/small buffers. > >> >> The crash I see is display driver crashes/freezes once a buffer is allocated >> in the upper 36-bit range and it tries to use bounce buffers. This can >> happens very quickly under load. >> > > You could be right about the MSM display driver though, since that > bypasses dma-iommu and manages the IOMMU itself. I stared at the code a > bit and I'm not immediately seeing where it would end up calling into > swiotlb, but it might be hidden somewhere in the endless nesting. > Looks like you are right about this, MSM driver ends up going through dma_direct_map_phys(), which decides to use bounce buffers. I didn't try to see if other drivers end up using bounce buffers, but it would make sense that only MSM driver is affected. >> The same crash would happen for EL1 as well. I wasn't aware of the EL1 >> broken firmware when I sent this patch, but instead of display freezing I >> guess the behavior would a hard reset now, which is a bit worse but still >> unusable unles display/gpu driver is disabled. >> >> This patch is correct and should be applied regardless of broken-firmware >> EL1 cases (where 64GB isn't usable anyway), but I guess the Fixes tag >> can/should be dropped. >> > > Please clarify the commit message a bit and mention the two separate use > cases (EL1 and EL2). I'll leave it up to Bjorn/Konrad to decide whether > to merge it. At the end you are right and using 64 GiB RAM in EL1 is > kind of a lost cause anyway. > > Thanks, > Stephan >