Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2361240lqp; Sun, 24 Mar 2024 15:44:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3UeElaLrbV+0ZUb75Mt9g94gSn9lrkgNrRGnGPMmOQDwK4p9bfDk5qvUyUfZ0rxve8ZD0U0Gps1yfvObM+AU1n4pnTd/a3LHWQ1RDMQ== X-Google-Smtp-Source: AGHT+IGBJPlZJYS3FxryQah56wVvwf29Ibzy6YVICx05InlMw/xN4kczXvvAO+UH0OwUSUraXV53 X-Received: by 2002:a05:6a20:6d29:b0:1a3:5f43:a5ce with SMTP id fv41-20020a056a206d2900b001a35f43a5cemr5175875pzb.36.1711320298301; Sun, 24 Mar 2024 15:44:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711320298; cv=pass; d=google.com; s=arc-20160816; b=uv+pq7YAE2VQXX2Z6L15PctYUvTJ7Y9n1cdMGOzrKlIc2RRbKppjh7y3i5WV4iUN/y Nw7LxNiZd2kJk4RHM9GBaxzXzPn/qW6hrcRHMRwekFT//+ikNsKf8cg9ShUrKPkrJQmT cjPHwzXLDJMqZVU9ohM7zLZ+B2kEBNZTle1MHHJbKyMY0S0x7+lRCH1v4LfyE+SPrkO3 Q1RvijFTNZb+p3vhfUzhFHwC4QMPF+mvXi8mS7e7F/wCuPl+bRW19TUQIk0sCjvyvAPy fNrNF9D8PtkXh/QA2kD8Vzi7+ONzcoF6ZqAtowOBGzJ5v/HeKKWMdguI5VL9daXz1nYX OT0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=w2gymgH2/fqFMxVJ/sbcOqV2+bFDt+IaB4H6bwyuELE=; fh=mKMBGxuc+tyobxOh+2f6lhRhSgTZWtn0BdU9uEWc3qI=; b=kcJpFIJqXVf+1Y/MmoxydYGpk63XYG1T4wfpD1GbLGzxXRxZnp7dJ+pW4RZUFSo2eR XfeXnEH4vNqUFdS6QZB29PeJCKXKWK2OgQQ8tQQMePOa1pzvzjoItAXG4x+oisbzhqJs ro032QcqKe7KyraARFbVSRCB9KeAJUi6nwauPKhfI53L6bisDHgOSa74G1kz8jgIpB1P 9aDPL5VGjHc6GKG5PFno7g7fK4pWhUrIZJc4YdXEZZgeUPDuhh+QYQXZfFYxehDWH9lA Fh3tFX3IveFFjw4pQZg2uiVi6RrVtzWv0+EaAh70sI+LgYxfqE0pMi2UNw8QXYsZOa+D 6prw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AEWWheiW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i11-20020a056a00004b00b006e6ade7acfdsi4054275pfk.307.2024.03.24.15.44.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 15:44:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AEWWheiW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 69DFFB21B65 for ; Sun, 24 Mar 2024 22:41:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6200145973; Sun, 24 Mar 2024 22:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AEWWheiW" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 763366BFBF; Sun, 24 Mar 2024 22:35:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319724; cv=none; b=khqTzxz5BG8Xb/XSgoNouS9nVA9Vk/oFtbG+cp5rJnBF560qaQSFeBTSCIkFsC/7I5nJ8YBzStem2BwvgfSn4QOGcXGJAIxhWkyH4PltVaB3mj4NEsPGulkA2tdjYRBQdDuHe0q9i/VbBjcFlFWlWGlUPvGhElUYAtGv7XriU08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319724; c=relaxed/simple; bh=A9hhnNGKNJQvbzqjwj11sc2xcTjo7vfpsW+pBYyE2/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I6jQiOr0DSdomLskWaBCj9zH1dT6XvmeY8kceHoK6MMsCwHIxTaK44J8YzGsPrIRPxJ541LaJB3AAHkK9Kwa9mFTucPVcSxt5YlpHpr9EnLsXt8IDLfiH0D/uqzoCJV1V8MPbbd7hwUORlBGEPcNUB5zRGZITDH4APYcbsLHGuk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AEWWheiW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C9A7C433C7; Sun, 24 Mar 2024 22:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319724; bh=A9hhnNGKNJQvbzqjwj11sc2xcTjo7vfpsW+pBYyE2/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AEWWheiW6txc+xSEbVqe5FmchDSWK3vdqL2uDTRolvCrsJIXoylb2cXX7MX2d+qLI z5LCFL/shzVXyr0YBTsKfFW3YdQxY8wyha/drPADn/c/On1b63sIsW+oKBMZVDTfnT QRU0ODPP57sMuhZEHX4x5arbgw8QMXW9if04p1uo/9avDD5SFY1LfX6Qa3/aTzkHSI KwgloABaTjLko7dDJ/UEK8tWeByngqvVEecFrb/aMJQPE8e+4j0EEvbKG/odIrNYgJ XPajJ6MMnvr9VBFmcVHThz56facv2fINyCdEXsju8z/WwsJJc8qRpEdcWJ/F+rWn7W O5CXYjn1T/cmg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Maxime Ripard , Guenter Roeck , David Gow , Shuah Khan , Sasha Levin Subject: [PATCH 6.8 026/715] kunit: Setup DMA masks on the kunit device Date: Sun, 24 Mar 2024 18:23:25 -0400 Message-ID: <20240324223455.1342824-27-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Maxime Ripard [ Upstream commit c5215d54dc10e801a6cefef62445a00a4c28a515 ] Commit d393acce7b3f ("drm/tests: Switch to kunit devices") switched the DRM device creation helpers from an ad-hoc implementation to the new kunit device creation helpers introduced in commit d03c720e03bd ("kunit: Add APIs for managing devices"). However, while the DRM helpers were using a platform_device, the kunit helpers are using a dedicated bus and device type. That situation creates small differences in the initialisation, and one of them is that the kunit devices do not have the DMA masks setup. In turn, this means that we can't do any kind of DMA buffer allocation anymore, which creates a regression on some (downstream for now) tests. Let's set up a default DMA mask that should work on any platform to fix it. Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") Signed-off-by: Maxime Ripard Tested-by: Guenter Roeck Reviewed-by: David Gow Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- lib/kunit/device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/kunit/device.c b/lib/kunit/device.c index 644a38a1f5b1c..9ea399049749e 100644 --- a/lib/kunit/device.c +++ b/lib/kunit/device.c @@ -10,6 +10,7 @@ */ #include +#include #include #include @@ -133,6 +134,9 @@ static struct kunit_device *kunit_device_register_internal(struct kunit *test, return ERR_PTR(err); } + kunit_dev->dev.dma_mask = &kunit_dev->dev.coherent_dma_mask; + kunit_dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + kunit_add_action(test, device_unregister_wrapper, &kunit_dev->dev); return kunit_dev; -- 2.43.0