From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9BA6C61DDA for ; Sat, 21 Feb 2026 09:03:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4823C10E17C; Sat, 21 Feb 2026 09:03:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="LJAcMjCn"; dkim-atps=neutral Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 310A310E17C for ; Sat, 21 Feb 2026 09:03:04 +0000 (UTC) Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-4837907ec88so36971025e9.0 for ; Sat, 21 Feb 2026 01:03:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771664583; x=1772269383; darn=lists.freedesktop.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Xqof4s0oT0bzk2vKcOSU+aeQbztw0Mc+PhxZBmWcX5o=; b=LJAcMjCnFZv4aGYRfILeQy6EvhXP6TxbaIBvODsqduAfqa2zdarEeBansNMRSAy3R/ VkqxWR3cINhEdebYYCAnQh2iVEzrVkIffAy4npJKfXbgRzJ7JG6mNf0fdWc/vmPAP9ro iuxr2IwLS9AJe8eCSfrXwshDNlvLcS37FrdHRzbfiSGZXLB+UcZo0m+VS+1MIQv3cFYA n8W7lCtIZiAsi4tmfCg3++Wbk85DX7ZsDLoUGwGN39CsPWcTiWnfrs8Di+B2XWGIy97a iZyqDaeXMYDoKfOkqEgGkmqWng+yPJRi6L6hN4WVdUo+y/hHb4eM5LP+/eq4Zx3BrLkG sRuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771664583; x=1772269383; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Xqof4s0oT0bzk2vKcOSU+aeQbztw0Mc+PhxZBmWcX5o=; b=MVtunVQaZlodA532LmVNAC+JZcEQ5VeQyFdoFNv8aRNYWVYlwBp01gHLwvHP8lYHyp zJ6Um7eijPv3SrXwWOvM7erA91VdoiRuAPt+PBDDrZbykvPv+DD8NeCvk0Lss40wDFnv YDkecSxGkAT1DOh9dtmKuw/jtUky1FKtB4Nbs13RFju+2qP6uIblwdv6W1OPuWpBniuQ zmEVsndPTNgr5i8kH+CPgBZ9OsMEeUbAroLQqCAeQYOtWl3De15ChZnyj+kcRlf3lbcY LXLpAd2haGz9vFyBwb0GB/r4MqiMmhkRW6eeaWTUJTCTobW5JXVvUZ9yYXYnb6imY+O0 KVVQ== X-Gm-Message-State: AOJu0YzpAt/vGypCQTUx1ste10HYpvFaCoH2DNHy2m0TpHbe6nF8Ux5N ZrrxfBlbh4vAZ4QlHSHQYrJ1a48XFg7P1QcntiMBnuC8fZI/7hVsLeouUOzidWYEUiny9PKjqQw 14pX3J/WpvrFMLcgLWQ== X-Received: from wmbjp4.prod.google.com ([2002:a05:600c:5584:b0:483:27fd:cf47]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3b17:b0:483:71f9:37ef with SMTP id 5b1f17b1804b1-483a95b5405mr30650555e9.8.1771664582473; Sat, 21 Feb 2026 01:03:02 -0800 (PST) Date: Sat, 21 Feb 2026 09:03:01 +0000 In-Reply-To: <20260212013713.304343-5-deborah.brouwer@collabora.com> Mime-Version: 1.0 References: <20260212013713.304343-1-deborah.brouwer@collabora.com> <20260212013713.304343-5-deborah.brouwer@collabora.com> Message-ID: Subject: Re: [PATCH 04/12] drm/tyr: set DMA mask using GPU physical address From: Alice Ryhl To: Deborah Brouwer Cc: dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org, daniel.almeida@collabora.com, boris.brezillon@collabora.com, beata.michalska@arm.com, lyude@redhat.com Content-Type: text/plain; charset="utf-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Feb 11, 2026 at 05:37:05PM -0800, Deborah Brouwer wrote: > From: Beata Michalska > > Configure the device DMA mask during probe using the GPU's physical > address capability reported in GpuInfo. This ensures DMA allocations > use an appropriate address mask. > > Signed-off-by: Beata Michalska > Co-developed-by: Deborah Brouwer > Signed-off-by: Deborah Brouwer Reviewed-by: Alice Ryhl > + // SAFETY: No concurrent DMA allocations or mappings can be made because > + // the device is still being probed and therefore isn't being used by > + // other threads of execution. > + unsafe { > + pdev.dma_set_mask_and_coherent(DmaMask::try_new(gpu_info.pa_bits())?)?; > + } Nit: We usually move the semicolon outside of unsafe blocks: unsafe { pdev.dma_set_mask_and_coherent(DmaMask::try_new(gpu_info.pa_bits())?)? }; Most of the time, this allows rustfmt to format the unsafe block on one line like the above (but it depends on line length).