Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp169704lqr; Wed, 5 Jun 2024 02:25:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUuSfsQUHrYTOVnjjPWvRZrHLm5Ly+SV5bHobSY4lYBZOH2u1vomBEHpwiqwk+7thp9frh+9VQvXRPQsak9V3QWT1/CvDqxaTJObloCCQ== X-Google-Smtp-Source: AGHT+IFSFTtC5yBRrK7h3CqHJCeGudwvVCH3nLcOdWXdv2BqcITgWt+MQpO2s4JulTwQaoiAnuHu X-Received: by 2002:a50:9fa3:0:b0:57a:1aa8:b4ae with SMTP id 4fb4d7f45d1cf-57a8b696d15mr1950737a12.3.1717579538535; Wed, 05 Jun 2024 02:25:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717579538; cv=pass; d=google.com; s=arc-20160816; b=TxsJuwTcIhYhpZ9huRV1A6JOBF+xzKj7rbE6Ji20wNy//kUkP+z99TiYARgpG0JCed F52RtiROTNRqS5yuUYzgy24bQzNoJ0VxikAXSiF38uRM536pGhI3IGSt5I7kOJNmTp5j XaPeHrrS2LCT+bUyyzA/hPFVfU9Q4lsD6Ojj9zTXR8t/mYvyhiqFHEoxvOZVe1c8kBy6 qB7wBedFj/DM6R1rbaqQnjvQuTPbAoz2yUzsHFu5yklVbq+iNgDyQSQukSrz31vfbZ2R zJ7HgQVWc+ZTtmgffHxRVwAjjd/7ujrhaYhjj5RuoYnb+66urlERlxCes58w/dR9uGQ4 8iMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=EoJWhO/kN/nIDMel5oucInBCEkvezehjU4YBYZFp3Zg=; fh=epSJsfW0rPPWc+bUmX9ep27TMYKMt5ZR02h1XHy/kd8=; b=W2dDb2me0yBIPEyXFKNt6IG2uYCv7fh6czUek1d2Hcqec/LFxSFcAegqttGOnAXfeo YqspnWXXoSj0roDFo4V4VznwTvmWc1M0RBFRFa1abTnieMmfRGm1lMXNfp44YqsDcAde notIopONDV2hOCWL+hc5vmX+cVC4RM2UEftZjYjqLcXX430TU5MG+/1L57PdBmFCEyPI e7hHh+Qv1vl5jihfmotPQ1dD/MR7hA0J0uK618rJZBb9ZC6aYk/X2k24Il/jurcEz+4x IM2fiJUQ2Kkzq4znPBZ2siish1uNwHG1+DA0IVaiOK8AnidA99l86M9vfZ9Ffvifmvo4 KRXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F/P1LCHk"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-202091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31cae9cdsi6308482a12.599.2024.06.05.02.25.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 02:25:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202091-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; dkim=pass header.i=@linaro.org header.s=google header.b="F/P1LCHk"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-202091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 39C8C1F21E8C for ; Wed, 5 Jun 2024 09:25:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1681C18FC71; Wed, 5 Jun 2024 09:25:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="F/P1LCHk" Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 9E070200CD for ; Wed, 5 Jun 2024 09:25:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717579527; cv=none; b=EHvXPY3SHGneeHmmtoxbmZRaHRmRrbwf7eiE2rWXmBXhQICooV7M6/7kIhhtoMxIJq3oXd0n2OyJrm1rLYG3ONMicRTPVlDUeBnZRc9tqjhiWTqyC7i7XE9Dxrht95l6KmAqTijRk+MxLUg6w6UztjzjBezUgPYKWEK7Fk0dJwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717579527; c=relaxed/simple; bh=jDIMASg0bbSoa59nEMmcvY5ZQPMiGKrt21tWciEt5bQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=GDHaROiNvGaBYNvy7x53BNc3nOBl0l71zWV0eYvRJ/ROFpnHnT3lNVvqv99b7JU1OJNLFz5yMwtsUzmtN/TGXDPQoHOBg0a030dYkAImtHfmjDjhACEqUIwqlS/2Q9KW0ywpvbm5s5PaDhvWUU4/vG+3Wo7YFCKFWro09iycYNg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=F/P1LCHk; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-57a6985ab58so1710291a12.2 for ; Wed, 05 Jun 2024 02:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717579523; x=1718184323; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EoJWhO/kN/nIDMel5oucInBCEkvezehjU4YBYZFp3Zg=; b=F/P1LCHk0wJMEW2LFzaxw6AYQPJWyEM4G27vsBD/rcfdTLk90iSH7KjdPqZSAU0fRp Ib0BQgQmywaOI9OzqmXD7W7gEW0d4Ypr5G7GAYFmpGim250B93t6QHCN4IzYyioxI41k W0jKttazCsbX28q6S4Q6t2Fka1v5IZ61zAHWVLDQ4lYx1fj00OnEu/adafn2jCXY6B/N 4FuxGB7koP/iSyyXbKHrqCTUIh71flTAwXGLdL6Vue2mE65zaKhkjBrfPYYlxLS/ugqu WAh9zkLjGP5zqofN8iWiKUt3s1psGgqfyRiTSsskucxOWtYoObfwGWc7uUr9DKjCI1Db vJxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717579523; x=1718184323; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EoJWhO/kN/nIDMel5oucInBCEkvezehjU4YBYZFp3Zg=; b=UAGIfocEsXLB2ybjTwojNG9yNc6rOaEmyVJxH6jdyW97YQnKGInHoZtHW5Zc3Hg2m8 eigSTwt9RS7ZUWSEibrL+7uaEr4/heMCL1qIFZIfZPMdkTXZrnf+/hEl6uKWHx14tmq7 GYBqV/iOqkFBAqJM8cnGBVogHxL8/Bevg6m4RMRbG9o0oaaDT+cL5XYtYJUEMNI4UdtJ FWdo3mhaJkAW375GxgPcrnbrtBRlZNHXjf+dXgXLlfKaP1+Zz6JZ++HFllMHDepnkoUe iVRhcmhwvtqEaqsQgTxnoaCEWgbWb85ydPhguxlXEfCLBcoyXmclogj+UBGc0xkqkbqV nHxg== X-Forwarded-Encrypted: i=1; AJvYcCWTen5WCyyCsv90yRI7cPV52gS2w+0p8Z6MF+ZVAS5VhfdjibVAGx81lwXJNPagMs/0egF902p7RmOC9hNZZY856zFjor9T4kdS8sE9 X-Gm-Message-State: AOJu0Yw7dYalK1FfXREjh5XRNme7FlK66xYTt8Qzr1g/Gg1WnDXpFP4D pK8p5BxXgaBV177zaaEfRmUry2xQSstvJg/hGJ+cek0LrpUBgsc6LGRx3X397xinnOBpZ3TVrZW J0iTXC+sGzp56TQUZPTuCJvnO3s8cVwPC9YVIuw== X-Received: by 2002:a50:ab56:0:b0:57a:9159:df05 with SMTP id 4fb4d7f45d1cf-57a9159df5fmr1279266a12.36.1717579522861; Wed, 05 Jun 2024 02:25:22 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240605012605.5341-1-21cnbao@gmail.com> In-Reply-To: <20240605012605.5341-1-21cnbao@gmail.com> From: Sumit Semwal Date: Wed, 5 Jun 2024 14:55:11 +0530 Message-ID: Subject: Re: [PATCH v2] dma-buf: align fd_flags and heap_flags with dma_heap_allocation_data To: Barry Song <21cnbao@gmail.com> Cc: linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, Brian.Starkey@arm.com, benjamin.gaignard@collabora.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, jstultz@google.com, linux-kernel@vger.kernel.org, tjmercier@google.com, v-songbaohua@oppo.com, hailong.liu@oppo.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Barry, On Wed, 5 Jun 2024 at 06:56, Barry Song <21cnbao@gmail.com> wrote: > > From: Barry Song > > dma_heap_allocation_data defines the UAPI as follows: > > struct dma_heap_allocation_data { > __u64 len; > __u32 fd; > __u32 fd_flags; > __u64 heap_flags; > }; > > However, dma_heap_buffer_alloc() casts both fd_flags and heap_flags > into unsigned int. We're inconsistent with types in the non UAPI > arguments. This patch fixes it. Thank you for your patch; I've pushed it to drm-misc-next. Best, Sumit. > > Signed-off-by: Barry Song > Acked-by: John Stultz > --- > -v2: > collect ack of John, thanks! > refine commit message; > > drivers/dma-buf/dma-heap.c | 4 ++-- > include/uapi/linux/dma-heap.h | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c > index 84ae708fafe7..2298ca5e112e 100644 > --- a/drivers/dma-buf/dma-heap.c > +++ b/drivers/dma-buf/dma-heap.c > @@ -50,8 +50,8 @@ static struct class *dma_heap_class; > static DEFINE_XARRAY_ALLOC(dma_heap_minors); > > static int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len, > - unsigned int fd_flags, > - unsigned int heap_flags) > + u32 fd_flags, > + u64 heap_flags) > { > struct dma_buf *dmabuf; > int fd; > diff --git a/include/uapi/linux/dma-heap.h b/include/uapi/linux/dma-heap.= h > index 6f84fa08e074..a4cf716a49fa 100644 > --- a/include/uapi/linux/dma-heap.h > +++ b/include/uapi/linux/dma-heap.h > @@ -19,7 +19,7 @@ > #define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE) > > /* Currently no heap flags */ > -#define DMA_HEAP_VALID_HEAP_FLAGS (0) > +#define DMA_HEAP_VALID_HEAP_FLAGS (0ULL) > > /** > * struct dma_heap_allocation_data - metadata passed from userspace for > -- > 2.34.1 > --=20 Thanks and regards, Sumit Semwal (he / him) Tech Lead - LCG, Vertical Technologies Linaro.org =E2=94=82 Open source software for ARM SoCs