Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2026790pxa; Mon, 24 Aug 2020 03:01:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4rCsS48k23w4y2sDRj/qEMcFY1JYypC5Iu0UUbHsjFBy/n83dr/QwA9Jz6YrSItARY3AN X-Received: by 2002:aa7:db59:: with SMTP id n25mr4447373edt.276.1598263277571; Mon, 24 Aug 2020 03:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598263277; cv=none; d=google.com; s=arc-20160816; b=GJNjvhn6utxVZhmx+XqoFMAzOlBjVEALtE9xQlAt7/pdl3k2jpp5q1WXocoxBxdBx3 WjKURhuVXL/6ywYgg4nJWCvc7sEJZBLhKW3QoL3jaC5HlGFq0wyM2Na7fgylXhY8s3jS eFghqL+I6Cp+Fs3BtI94jgyZOTdSDRxEF2rXKTr0crEwKzPTxuN0L/374rJkFqzf6NHE Lr4HMK2btZNxsEXCK5U75tUmNAORq+fS56Gs+BcGH4gfxcKaMK516Hdu0W4iHU+Bo5UK G+MQoXYMc1kK06vDRYNRlcCyvmbChWu10i1sFEX78prfUdf7t0lgqss0bcKYgMLo4U+T sJ9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z2Dou/m3qX0Kr80ttu5IVB/1Go3yLLkj7ExRWxgkkyw=; b=Pgq69fTVJQAQnOXyqF4XzfYn0V6/AlAyd7naM50HhJvCdBpGWsJA3UCmkJDOp94dvC 9KnJfGCcHkZg4tmlQfySvX8bmlS5z5ty/0rYuxu7wGS4vZBCJAMdD097OrzXHliD3tfs 6kWyqTAhdZG+LSUKvNcgimjEA0p6oHIv+w5iQJkDo62gGylzswkHfDLAtAVw9iO2zKtr PpLa29RDS/4aPCJMCALgXxtw1a/Y4QFbUE33YzgQGAiZK9E9hS+PZbSua5iK4Wp7phEE 6ECb+sgMvjs/dbmrkB8qxRpBYeUqFHAQx+fCQJYKxQPW2+gDH5WMzG3AyB1T+DfYwEUS 532g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="N9qrY1E/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y27si260022ejj.603.2020.08.24.03.00.54; Mon, 24 Aug 2020 03:01:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="N9qrY1E/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbgHXIcj (ORCPT + 99 others); Mon, 24 Aug 2020 04:32:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:39538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbgHXIcg (ORCPT ); Mon, 24 Aug 2020 04:32:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 14228206F0; Mon, 24 Aug 2020 08:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598257955; bh=t8QFWqTolVo7c1qLgcmQjDz0wNlZ8unAbXNGpquMF7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N9qrY1E/L8ae2sNuqRomQfOzugotw0vUhHd7xBdG6mtoywRKMLKsMD4ZcvVm5VgGF 5a0jq3Jl+lu7GMGxNtVc5R/aqjs/W+jnbLoOLsTBReSp5a+FBvhTIFizp9Ta/xFMBE FxQe/dxh8Irq6PXyV618On3TKmtvaz+69kzT6UN0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Zimmermann , Sam Ravnborg , Benjamin Herrenschmidt , Joel Stanley , "Y.C. Chen" , Dave Airlie , Gerd Hoffmann , Daniel Vetter , Emil Velikov , Sasha Levin Subject: [PATCH 5.8 004/148] drm/ast: Initialize DRAM type before posting GPU Date: Mon, 24 Aug 2020 10:28:22 +0200 Message-Id: <20200824082414.156735452@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200824082413.900489417@linuxfoundation.org> References: <20200824082413.900489417@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Zimmermann [ Upstream commit 244d012801dae30c91983b360457c78d481584b0 ] Posting the GPU requires the correct DRAM type to be stored in struct ast_private. Therefore first initialize the DRAM info and then post the GPU. This restores the original order of instructions in this function. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Acked-by: Benjamin Herrenschmidt Fixes: bad09da6deab ("drm/ast: Fixed vram size incorrect issue on POWER") Cc: Joel Stanley Cc: Y.C. Chen Cc: Benjamin Herrenschmidt Cc: Dave Airlie Cc: Thomas Zimmermann Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Emil Velikov Cc: "Y.C. Chen" Cc: # v4.11+ Link: https://patchwork.freedesktop.org/patch/msgid/20200716125353.31512-6-tzimmermann@suse.de Signed-off-by: Sasha Levin --- drivers/gpu/drm/ast/ast_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index f48a9f62368c0..99c11b51f0207 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -458,9 +458,6 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) ast_detect_chip(dev, &need_post); - if (need_post) - ast_post_gpu(dev); - ret = ast_get_dram_info(dev); if (ret) goto out_free; @@ -469,6 +466,9 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size); + if (need_post) + ast_post_gpu(dev); + ret = ast_mm_init(ast); if (ret) goto out_free; -- 2.25.1