From patchwork Fri Apr 1 12:37:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 12798267 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 CA9E6C433F5 for ; Fri, 1 Apr 2022 12:37:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3447610E2B9; Fri, 1 Apr 2022 12:37:18 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id A285510E2AE; Fri, 1 Apr 2022 12:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648816636; x=1680352636; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=tFRynHxMS+RjyyqC9TaSFhKuaHycRvpVH8isMAFz1Ww=; b=OvzbMKBPZckVyvrLW1Fz7i/dQfkGIC+yiNJXU9aAnxZHqIv0WNblm2+k 9Pc/E1LBBPVbR7xa909JmotflRF6PnR/S4sGA1/JEgstYsh17R0I/Fnjn PtYiwivcJd4Km08TRRz5j5vCl3WEY6dnjoObkE++Q0QHPjlmsUxOWc2F6 Sf/iTzr1dcdHtkJkcRvDjyaq/wqhW2plNeUbeUG+4B5H/jCmexE9GoW+r xXRKZc06gptNYMraCx150+TfIe/eyO+2TdhKAahusg+jZ59xvIAqwJmPM qogdVOVUuZoEWtECetOVln3F8Y21KIvFiNSDjDS/DGOwZUr1yge2of22w w==; X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="257708067" X-IronPort-AV: E=Sophos;i="5.90,227,1643702400"; d="scan'208";a="257708067" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 05:37:16 -0700 X-IronPort-AV: E=Sophos;i="5.90,227,1643702400"; d="scan'208";a="606725198" Received: from ramaling-i9x.iind.intel.com ([10.203.144.108]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 05:37:15 -0700 From: Ramalingam C To: intel-gfx , dri-devel Subject: [PATCH v7 5/9] drm/i915/selftest_migrate: Consider the possible roundup of size Date: Fri, 1 Apr 2022 18:07:47 +0530 Message-Id: <20220401123751.27771-6-ramalingam.c@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220401123751.27771-1-ramalingam.c@intel.com> References: <20220401123751.27771-1-ramalingam.c@intel.com> MIME-Version: 1.0 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" Consider the possible round up happened at obj size alignment to min_page_size during the obj allocation. Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/i915/gt/selftest_migrate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c index c9c4f391c5cc..b5da8b8cd039 100644 --- a/drivers/gpu/drm/i915/gt/selftest_migrate.c +++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c @@ -152,6 +152,9 @@ static int clear(struct intel_migrate *migrate, if (IS_ERR(obj)) return 0; + /* Consider the rounded up memory too */ + sz = obj->base.size; + for_i915_gem_ww(&ww, err, true) { err = i915_gem_object_lock(obj, &ww); if (err)