From patchwork Tue Mar 2 02:56:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 390164 Delivered-To: patches@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp3888724jap; Mon, 1 Mar 2021 18:56:37 -0800 (PST) X-Received: by 2002:a63:d502:: with SMTP id c2mr15913882pgg.353.1614653797187; Mon, 01 Mar 2021 18:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614653797; cv=none; d=google.com; s=arc-20160816; b=p40bv1jl/EGlaUuvMu/05saapm0LidMjSW4GddySywhBPnXvyue1Wpzdzvpcp2laik ywlQF3cM8+SCyyl2URAxw/sJgoOdgyn2ur06Y2rtEX53cKuZSfGtLVmCnVPb/D575qUt hnmbtyAJI+Nt//Dp1ODmf5E3NEjurQr/47U8p7OOIumy8CgBFmMtgwzfdsfYoz0iyKyx QrRFgpki75G8STAQt4ZnvozfCu3yaS+pwwz1kfubQxUtybfOPRMiWUEG6VOEF/hgtexn 8S40/IKzpvEmz3gewRso03nvvtbja9y5tHbm1xbCUjyZqSypfqO3OxU/iEE6co5X50Vg lsng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=qLXJJyTj2yGmwufJrM80dinHQtmlczvZXDaE20Ufino=; b=bHWcczV9IGGzfKcpXPzRs7Ptg8Am3Cgemg1nsmuY3y9+sUSx67w2aLc6xX8Fe95yRL RCsUdEgmJWq5ixJSfQG4tQ/uPyZI88aQtLZzkM6XrGZ1Ai80/FgbmMjg9+B7K1CA3i3u daKxuXac7gj6U2zpcdt5xtJp7Wsf3X97MofKSqBO9MADr1Iog8Unha5csFypFVI2tyLw DZIEc3Zkh55FHAND11BCR1OR/m9UE8/IQ6hAL9SAjIKJjZ+pN9wP+DWzGhPK3Nyv6dCN Gvo8Vyfu93xEHooEfKYpY+uC9Xg9i9D9G+RpDP720rK7Ko8RCYAaIXQp3hZEd3hgYeS9 afbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=htFcUre7; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id h12sor10911802plt.73.2021.03.01.18.56.37 for (Google Transport Security); Mon, 01 Mar 2021 18:56:37 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=htFcUre7; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qLXJJyTj2yGmwufJrM80dinHQtmlczvZXDaE20Ufino=; b=htFcUre7nmJ937TM3BXjnoM2/k9jS0HNIBATgAqlEiVfL9DmC9GCGhliVgBKQ0mW0q KSNhTijHLDFsuBUkzog/Ge0LuUq49qwdfqMo7d6xKfuFj15nX0fCIv033jIIOPT22C8c Adks/asM17AtDNgEx+9zIgi4GvJ2ZG0J7QmxiR5LxhzKJOhYh67DgOd6lgYFE93Rej0q MOGxYRsCUSV2r69BKt4OInL1gGNV5935enQ85wzw/1gYbK1Kb7synjizSroNH31eHCMb ceowi6mkHPHx6dZwMJmEddKkmEMCv1Q57MPtKJxWjxpx7OwiHqVcr3ogjnkm7gHAOM68 TM4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qLXJJyTj2yGmwufJrM80dinHQtmlczvZXDaE20Ufino=; b=TYprBz2R7s7u6M7ZYaU62blGAtx5FbOL8HKVTQ7jsI4zU8EFkDnB096KcXlWxfJrSl /FMoWLgN69BTqPCQjVjqe6v4nBnuiyt/N74OeEj5327+my2gfSGeHFBwzQgJ6yHTV+Ik X+UzE5EE18GQMfh/m39Zej/fycWyqlGjmCFCnBzPHuJAatUgLoF3Fj44+4cNw1jx1ig7 FO6zm6lFRYWMmP2kRu49/YyDbFKBn+/r9EwDVWubxGdiUk+og/MDN+sNcMdQ1XUGSPYh RLNVKgfMAJ1LNR5slTMHSR2YL9p+U2NZsFoLHjMGDId6v07tUzr4nr4hb7SUy7/BUvTx 1MJQ== X-Gm-Message-State: AOAM532AGcMzek1UCq9FWF181RbrxzWNbN3mnr8M0luoFEnNhRh/lHhu 8CJqzObRX6jGtfZUsk7l32+zkkhVtkSN/3pv X-Google-Smtp-Source: ABdhPJxBHNAF2OwS2gBChuYXTnwdjSw4f0lQ7k1NHAI6CiKbCqzF3nuyVHTR6ygWHmzZuPm/qFfgtQ== X-Received: by 2002:a17:902:e20c:b029:e4:7a08:8452 with SMTP id u12-20020a170902e20cb02900e47a088452mr1563793plb.74.1614653796901; Mon, 01 Mar 2021 18:56:36 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id r16sm18928400pfh.168.2021.03.01.18.56.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Mar 2021 18:56:36 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Daniel Vetter , Sumit Semwal , Liam Mark , Chris Goldsworthy , Laura Abbott , Brian Starkey , Hridya Valsaraju , Suren Baghdasaryan , Sandeep Patil , Daniel Mentz , =?utf-8?q?=C3=98rjan_Eide?= , Robin Murphy , Ezequiel Garcia , Simon Ser , James Jones , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RESEND][PATCH v2 2/2] dma-buf: heaps: Fix the name used when exporting dmabufs to be the actual heap name Date: Tue, 2 Mar 2021 02:56:29 +0000 Message-Id: <20210302025629.2558215-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302025629.2558215-1-john.stultz@linaro.org> References: <20210302025629.2558215-1-john.stultz@linaro.org> MIME-Version: 1.0 By default dma_buf_export() sets the exporter name to be KBUILD_MODNAME. Unfortunately this may not be identical to the string used as the heap name (ie: "system" vs "system_heap"). This can cause some minor confusion with tooling, and there is the future potential where multiple heap types may be exported by the same module (but would all have the same name). So to avoid all this, set the exporter exp_name to the heap name. Cc: Daniel Vetter Cc: Sumit Semwal Cc: Liam Mark Cc: Chris Goldsworthy Cc: Laura Abbott Cc: Brian Starkey Cc: Hridya Valsaraju Cc: Suren Baghdasaryan Cc: Sandeep Patil Cc: Daniel Mentz Cc: Ørjan Eide Cc: Robin Murphy Cc: Ezequiel Garcia Cc: Simon Ser Cc: James Jones Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz --- drivers/dma-buf/heaps/cma_heap.c | 1 + drivers/dma-buf/heaps/system_heap.c | 1 + 2 files changed, 2 insertions(+) -- 2.25.1 diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index 5d64eccd21d6..0c05b79870f9 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -339,6 +339,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, buffer->pagecount = pagecount; /* create the dmabuf */ + exp_info.exp_name = dma_heap_get_name(heap); exp_info.ops = &cma_heap_buf_ops; exp_info.size = buffer->len; exp_info.flags = fd_flags; diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 29e49ac17251..23a7e74ef966 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -390,6 +390,7 @@ static struct dma_buf *system_heap_allocate(struct dma_heap *heap, } /* create the dmabuf */ + exp_info.exp_name = dma_heap_get_name(heap); exp_info.ops = &system_heap_buf_ops; exp_info.size = buffer->len; exp_info.flags = fd_flags;