Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13473595ybl; Sun, 29 Dec 2019 12:45:51 -0800 (PST) X-Google-Smtp-Source: APXvYqyNimUsALVke9pY/K3SVukB499LIMkCuwMcnuT9+CA2USKkRC/OqIy18TVNrBiH0UuD2wrV X-Received: by 2002:a9d:6045:: with SMTP id v5mr65879757otj.252.1577652351530; Sun, 29 Dec 2019 12:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652351; cv=none; d=google.com; s=arc-20160816; b=hk+c/IQds+lPvv4/kSqKI6yWkLEMHn8/dUMZaVrl6A2cfGqCMdVjVaN4kIDLJn3t67 rlwVw9yTzZOpWmt9NL0Mrp6FmZ037/XAEMBxCTcQgXCbHATcX313UIBb6UpIKO3Vewsy iZsSCoOcHYb8g8wKF57Ttecp52bDWghl8oImMNPaNqM2iLFXQSuddQ9EV2pA10cy0R0v B2O743f11W4mVQ2oj+abwPLFh2q1IFlha/FkZEYEWUyuXY/IpIo7raNweN/43v5nE/FJ drTBdkepUCQfTSjYPk6KPvt2t/0Aw0Yh2Qfh2iiqQunR5Fc6drs5sxpZwRLWzDwVAuMp tTkw== 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=HxaMNZpvPbJyeTve9MohhLLheNB4ep0CXhASbXRaE+A=; b=cRdUlhTVl3uSsUxgSr/9ziHMTc9vruzBOQwbETANNvj80xoaKuFsdKCbi5LSh45KJX 9V9AsOkb1EBiMLO85EogXjzxC8y8IIiurTBtBXLdJkaAJNyd/DqlSFw/rqIAQRYikovt QqvDsFZBFZw9XiGNBTuW6t0DPyEOde8bgiF9YKzDWXH2L3sARwLo6108jmxx4G7yk1vG ycVK0bcvdEOKvlGmLhAGCQ1EtC+7qt5S40KcqxOmURKGCq8xwo6kOyjppnb5ZFHI0yIw 0STa8CQQo3ri0fEJbgm+0dgQ8wAreJhZ5D1QggsD1QL60mglJllYQSnVPj0a5eL9XWf+ WLSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h+0gUGqd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14si16315117otp.210.2019.12.29.12.45.41; Sun, 29 Dec 2019 12:45:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h+0gUGqd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730727AbfL2Rq6 (ORCPT + 99 others); Sun, 29 Dec 2019 12:46:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:56790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731124AbfL2Rqp (ORCPT ); Sun, 29 Dec 2019 12:46:45 -0500 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 1A01820718; Sun, 29 Dec 2019 17:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641605; bh=n66rELhtRP7TuDCSuJ2fjZ2102XfdZBQlIS6TWQiDGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h+0gUGqdwfcb1pHzQHzIRqeWHS9GiBIPY72YdVNGM8bl3e5/MPKzD6PkDpcQEWvJo 0ALBAr6SoGrxkimHHUw7xJG4V3OXB9+Vyrg11Q/wzXW7JGo5R0/Qh+/MEV3iXpNaO6 duVs5WpUjd9kWlfE545ZyXSeCBk4Ilog669EBcrQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josip Pavic , Anthony Koo , Bhawanpreet Lakha , Alex Deucher , Sasha Levin Subject: [PATCH 5.4 134/434] drm/amd/display: wait for set pipe mcp command completion Date: Sun, 29 Dec 2019 18:23:07 +0100 Message-Id: <20191229172710.609979700@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@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: Josip Pavic [ Upstream commit 15caeabc5787c15babad7ee444afe9c26df1c8b3 ] [Why] When the driver sends a pipe set command to the DMCU FW, it does not wait for the command to complete. This can lead to unpredictable behavior if, for example, the driver were to request a pipe disable to the FW via MCP, then power down some hardware before the firmware has completed processing the command. [How] Wait for the DMCU FW to finish processing set pipe commands Signed-off-by: Josip Pavic Reviewed-by: Anthony Koo Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c index 58bd131d5b48..7700a855d77c 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c @@ -77,6 +77,9 @@ static bool dce_abm_set_pipe(struct abm *abm, uint32_t controller_id) /* notifyDMCUMsg */ REG_UPDATE(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 1); + REG_WAIT(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 0, + 1, 80000); + return true; } -- 2.20.1