From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 E2076374743 for ; Thu, 29 Jan 2026 23:14:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769728474; cv=none; b=U5WUsjpEu8M8Ty9qxzWoGPEqg4wby7y3c2TpyyrPCK6nY7p0kcOiyiirjg0+FZNmvopMsVTtoHtqt8eDQfebI6XYWzc/WHbzX0dN7cRYOcgYqCSoUdi99r6piSPN75xF/MXk6wXFKqGMz1rRba4fP0K49KFGLxUiXNWrQdSq9PU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769728474; c=relaxed/simple; bh=CNkhoms0fVgkQcLTDpEcTgYvF746ADbHmb64eEZ1F+s=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=frXeUENIM+uHWJzKlrMc2t/MDjPqhuN5Rkxz8TyS4h2ZADAOz9Bu7qgiURCJxynMpcA6RPjvgO0xKlnRNGV1tf5s9cY62i5T8An6HmDwFN39qOrctGOGnK4YmUViJrG2GBYNPdRwZlo+De/JTslXFfWF4Lo8KRDrBI7f4GNRNfU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GqjxFawN; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GqjxFawN" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-47ee07570deso12734695e9.1 for ; Thu, 29 Jan 2026 15:14:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769728471; x=1770333271; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=5bYWxa4cZ5/1b/L5Q7G3vedzyBNRqZNi5CVbiTnOSeY=; b=GqjxFawNJJMxnwG+Oya6eE7X10SNnyZcxFPpSzpFPgeSuqtdueWHK6w2Bui7ip32K8 SjQhZnvyxS5upyauwphj3k7CjNa9sO3mPQzKw2vyiUgN4G6Omgz2RdMDrsuit0h9Durq 5iXJqdqJlOTWGLRuD0x07cMzpHaFyUPx5rU66tcrD6CxxUPzGPHOX18BfIETb70HK0fJ J9rYT6WJ76x5ZEoljyLGJOSIP8HUcrzrUgoAzBQDm+xLkF5fcHqsmXAIV+8Rwv2FjRB0 t4uCsPj9fkQ1bGgT+GhD3X0ymvAdRwZ3/MOyYQgFyzV496igtSjMJ5o3vlTXvHJmMGQ+ FGmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769728471; x=1770333271; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5bYWxa4cZ5/1b/L5Q7G3vedzyBNRqZNi5CVbiTnOSeY=; b=jyHQY9NfP4MX1BS6XBDi94p/uVmQDALVZWvSQAgwS+Qqkgd8b7OL9H/1isiy0taxsS dkUCF20WK+RRM+S+GNZ4NUMSjDxgaAV+AP/tHUCUKgNR8jc6z2KJdOJQPn+7TvmeioMp YWOTgsydY5O2R5cbr5DPdqvbBxaVch/lW8dLdhibyB5x+2n203YOXH/66UD/iG8KatqC /UJoaCxk5W8YfMECfFVac7kJgGNv6Gr9XIlGLizGFoqcIzKALjPBSH3ysd/nkhx7COYH 9b0Iu6Wu2gEkiiTdG5bRLGMM2cafT8RtxkX/2M1ojHJi4JK1CgUnyBXzQW6nwpw3obFi LOCA== X-Forwarded-Encrypted: i=1; AJvYcCWigUJSZ2JubT2e6fgkXfDR62uzwUtZ6daiJeUsXXMKYjOR1X5ynkSGR2yr/jzHoJpneBXFUf8n7zqs0yA=@vger.kernel.org X-Gm-Message-State: AOJu0YxdE14OuKZBv3+7DzOt9BsSDNL8KwYM4J/PNPUQbK6rTJkpsIFB bOZMVH9AODc2C6xiJ5aSop9Abrj88ADqNdWaPDtQDlFXdmV+41Sevt9P X-Gm-Gg: AZuq6aL9JrdxDXezSJ6MIrZO5fd2tvnEI+HWI96dt2i3jCoqrVEg86WSWFgxB8Z/Th+ BKvhVnASvnExcdqduGEx9xV+WUMzGt2auQSxvgzfOy0lV4j/9rCkcX1lgx4sPt3F3PfqiEWs793 u7ObNBg4bTBqVx//Jxoj63T1pBB+QhfNJGobY/8Flq7/z09RJgMGF9fSVJaJT+cKmCIBWzywhe3 pWchA0Pc1fh1wyjLf1Udo294CjTwRxptqZKG5lQfWW6oJ/1ywK9lHDsMzRSMVlwMo/oM9EvXWN6 m462PnQHUWo/NJmzg0jd0h0LrKWoatu98VFoiOn6g7EOVY/xY6RFP1pi9k+jBAc9g63dfizTHl4 tlafmUP4Z+OviqI0W7yOYpED8hKVcTjqKI6mVGLNMV5pG+Iompi/qWnWnOwoD/XzyQEbpwA9i06 3sndaimcbzswCXSE3JUXA8hnoRF0kvrgDDx8c5FFiKwQq2DPfpv2BJ X-Received: by 2002:a05:600c:8b27:b0:480:1c85:88bf with SMTP id 5b1f17b1804b1-482db4998ddmr7562745e9.27.1769728471022; Thu, 29 Jan 2026 15:14:31 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e1354114sm18802203f8f.42.2026.01.29.15.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 15:14:30 -0800 (PST) Date: Thu, 29 Jan 2026 23:14:29 +0000 From: David Laight To: Rob Clark Cc: Ekansh Gupta , Dmitry Baryshkov , srini@kernel.org, linux-arm-msm@vger.kernel.org, gregkh@linuxfoundation.org, quic_bkumar@quicinc.com, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, dri-devel@lists.freedesktop.org, arnd@arndb.de Subject: Re: [PATCH v3 3/3] misc: fastrpc: Support mapping userspace-allocated buffers Message-ID: <20260129231429.52f280f9@pumpkin> In-Reply-To: References: <20251230110225.3655707-1-ekansh.gupta@oss.qualcomm.com> <20251230110225.3655707-4-ekansh.gupta@oss.qualcomm.com> <69cb2d42-6672-4c42-935f-e3fff9bf38f8@oss.qualcomm.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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-Transfer-Encoding: 7bit On Thu, 29 Jan 2026 14:11:12 -0800 Rob Clark wrote: > But looking at the patch, this looks more like mapping an imported > dmabuf? Presumably going thru dma_buf_map_attachment() somewhere in > the existing fastrpc code? I think I might have had a related problem. I used dma_alloc_coherent() to get multiple 16kB blocks of kernel memory that a device can access. The device has an internal 'mmu' that makes them logically contiguous (from the device point of view). I then wanted to mmap() a 4k (page) aligned sub-range of that kernel memory into userspace so that it saw part of the same logically contiguous memory as the on-device hardware. Different parts of the devices (max 512 * 16kB) master window are used for different things, so mmap() offset zero is different for different mmap() requests. One of the 'old' methods still works provided the pages are physically contiguous - which isn't the default for systems with an iommu. IIRC there is a function that will map a single dma_alloc_coherent() allocated buffer into userspace - but that doesn't let you offset the addresses not join up multiple buffers. I can't have been the only person trying to do that? David