From patchwork Thu Sep 26 10:52:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 11164015 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C18D7912 for ; Fri, 27 Sep 2019 07:41:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AA33620872 for ; Fri, 27 Sep 2019 07:41:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA33620872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aosc.io Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34CFB6EE83; Fri, 27 Sep 2019 07:41:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 343 seconds by postgrey-1.36 at gabe; Thu, 26 Sep 2019 10:59:21 UTC Received: from balrog.mythic-beasts.com (balrog.mythic-beasts.com [IPv6:2a00:1098:0:82:1000:0:2:1]) by gabe.freedesktop.org (Postfix) with ESMTPS id CAB496ECD2; Thu, 26 Sep 2019 10:59:21 +0000 (UTC) Received: from [199.195.250.187] (port=35715 helo=hermes.aosc.io) by balrog.mythic-beasts.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92.2) (envelope-from ) id 1iDROy-0008GR-Mn; Thu, 26 Sep 2019 11:53:37 +0100 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id 62C98407D0; Thu, 26 Sep 2019 10:53:28 +0000 (UTC) From: Icenowy Zheng To: Qiang Yu , David Airlie , Daniel Vetter Subject: [PATCH] drm/lima: allow to retry when allocating memory for BO Date: Thu, 26 Sep 2019 18:52:40 +0800 Message-Id: <20190926105240.43144-1-icenowy@aosc.io> MIME-Version: 1.0 X-BlackCat-Spam-Score: 50 X-Spam-Status: No, score=5.0 X-Mailman-Approved-At: Fri, 27 Sep 2019 07:40:57 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lima@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Icenowy Zheng Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently, when allocating the memory for BO by Mesa, the lima kernel driver set only GFP_DMA32 flag; and this allocation may fail when the memory is relatively adequate, thus retrying is needed. Add the GFP flags for retrying memory allocation. Signed-off-by: Icenowy Zheng --- drivers/gpu/drm/lima/lima_object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/lima/lima_object.c b/drivers/gpu/drm/lima/lima_object.c index 87123b1d083c..1389aa1b948b 100644 --- a/drivers/gpu/drm/lima/lima_object.c +++ b/drivers/gpu/drm/lima/lima_object.c @@ -91,7 +91,9 @@ struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size, goto err_out; } } else { - mapping_set_gfp_mask(bo->gem.filp->f_mapping, GFP_DMA32); + mapping_set_gfp_mask(bo->gem.filp->f_mapping, + GFP_DMA32 | __GFP_RETRY_MAYFAIL | + __GFP_NOWARN); bo->pages = drm_gem_get_pages(&bo->gem); if (IS_ERR(bo->pages)) { ret = ERR_CAST(bo->pages);