Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3520927ybl; Tue, 21 Jan 2020 02:16:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwtcYZpub3Q/05B3VRxoZhuFG8kzQqCx/A0JNFWZFM/CyZF5+odxsaNvlP1Q8lPtmg5/vZJ X-Received: by 2002:a9d:2028:: with SMTP id n37mr3061635ota.127.1579601807420; Tue, 21 Jan 2020 02:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579601807; cv=none; d=google.com; s=arc-20160816; b=MKIwpkFqUzBveMgt6r6tqWFYeDbEjJ/dkZbm2SmpUhMjVOo/zN29vzCClSS6/nPJ7x UE97FiHOrpAaT/3q9v6Z0mymjJVMOyTlfJrKCcnVittFwNro1Gte+me9pN5g+mjdO/W4 2Y1FP79ejVNPUiZvIcqqkksHztBugyHUqJdcFMr7NR0eeJ6PQ8g9NpbajoiBCFI84ow2 qhTiEHPsu2Yy6Uf+wCYtuEqYOrAUzeFLWFhAVPHA16Ow0rfZpRAK4rtNYyam0f+WAp8l IIv1fSdKn1L+GOdROmnzA/cuIE9VticEDWvxkU+wFJu2O6TOhuBqBBoQdy7AED4qlbee RTkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:to :from:dkim-signature; bh=fDNwiFZy5CZXyHgGGVM3ojrT2gDVM3TeYsu274+e8sk=; b=zXt9M7WQQQ1K8INa3NxtXr3WPLaLHWbI20VdLD2x6osnBYmSCD7zs6zLZC9XMXbgTv uo2mOB6nyrhzAg8m/Uf0XRdfEgF8XJCxrR36p6T1n/KJuDHG8rmGIA/XoPYe08IqjTsK dfqXbGn3mf8HNNQ/7Kk+tjzKHDgVh8JO25IAD9HalAC/ndz5DW84CSFRAPqnrl+ahb8O FPG94/LqLlZuluhL74o7X1DzbKJqfunMfT/DLFmq3yTvgFOvyPc8d+j2UvufS0m75zW7 HWdf4Xttl6xfME95xv+9ZsNSu5BGB5kuBRDT7ViDuDSfvt3hL3SnH9L5u8qz9FRRPty4 mOkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="kvcb/h3l"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si21880340otj.38.2020.01.21.02.16.35; Tue, 21 Jan 2020 02:16:47 -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=@st.com header.s=STMicroelectronics header.b="kvcb/h3l"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729449AbgAUKOV (ORCPT + 99 others); Tue, 21 Jan 2020 05:14:21 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:24102 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727220AbgAUKOU (ORCPT ); Tue, 21 Jan 2020 05:14:20 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00LA7mnA015236; Tue, 21 Jan 2020 11:14:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=fDNwiFZy5CZXyHgGGVM3ojrT2gDVM3TeYsu274+e8sk=; b=kvcb/h3lu7vWmL9lvSxH0sm7BiUsG94BYCNDhj1TbPVhaT1jq9iL0Pixr+riZJXA30H1 HKpYFQKiAaSXqgURAQAdjXBsN2PRQwcHbNHFH0QY/n/FxECQS3RYHSK1+dwxU44m0e23 6xUYuLO0jNgmaqs2rZMpfXrpyJchzeWzb7TZG3Dn8SefPmJcC+rSOVA+jO454IqSKwKq xC8Efn4kXkCDewkVMtMWpqc+9O77kHuX29CH/5DGsJ/HaCU2fZIgZ9MvKJ+4vIRZWkqy CBZn+HE9EthdiJF2iaduoCbjGYq8MyR5BHJU2L0zaI3EwFQXXXmXXYcxVqkuSLC6aZGO rQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2xkr1dx2q1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jan 2020 11:14:13 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CA87110002A; Tue, 21 Jan 2020 11:14:12 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag6node1.st.com [10.75.127.16]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BAC9F2B1872; Tue, 21 Jan 2020 11:14:12 +0100 (CET) Received: from localhost (10.75.127.45) by SFHDAG6NODE1.st.com (10.75.127.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 21 Jan 2020 11:14:11 +0100 From: Yannick Fertre To: Yannick Fertre , Philippe Cornu , Benjamin Gaignard , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre Torgue , , , , Subject: [PATCH] drm/stm: ltdc: check crtc state before enabling LIE Date: Tue, 21 Jan 2020 11:14:10 +0100 Message-ID: <1579601650-7055-1-git-send-email-yannick.fertre@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG3NODE3.st.com (10.75.127.9) To SFHDAG6NODE1.st.com (10.75.127.16) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-21_02:2020-01-21,2020-01-21 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Following investigations of a hardware bug, the LIE interrupt can occur while the display controller is not activated. LIE interrupt (vblank) don't have to be set if the CRTC is not enabled. Signed-off-by: Yannick Fertre --- drivers/gpu/drm/stm/ltdc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index c2815e8..ea654c7 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -648,9 +648,14 @@ static const struct drm_crtc_helper_funcs ltdc_crtc_helper_funcs = { static int ltdc_crtc_enable_vblank(struct drm_crtc *crtc) { struct ltdc_device *ldev = crtc_to_ltdc(crtc); + struct drm_crtc_state *state = crtc->state; DRM_DEBUG_DRIVER("\n"); - reg_set(ldev->regs, LTDC_IER, IER_LIE); + + if (state->enable) + reg_set(ldev->regs, LTDC_IER, IER_LIE); + else + return -EPERM; return 0; } -- 2.7.4