From patchwork Wed Aug 3 20:10:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Morsing X-Patchwork-Id: 1032392 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p73KB4mB015854 for ; Wed, 3 Aug 2011 20:11:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755419Ab1HCULC (ORCPT ); Wed, 3 Aug 2011 16:11:02 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:41310 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754001Ab1HCULA (ORCPT ); Wed, 3 Aug 2011 16:11:00 -0400 Received: by eyx24 with SMTP id 24so1187219eyx.19 for ; Wed, 03 Aug 2011 13:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=xPg8jZEdYFVysI0YJei6R7XhpEXNj3jpJ8oFAAUb8wM=; b=us1MDQ6S6/bPKOypYR71xLFKy5vnvNJ0FLJpn6BMgnFRhKASamvmaCVWf41X317+oU u+SsphNdyBIMdFuXxfcuAPYk5wv3IxvVyI6AujqsFswxBo/ooJHMsavfTcOT/887fWzL fcL+D2GRtkBeYmnWK6UXssRXq5E01f2Z9iDbE= Received: by 10.14.28.66 with SMTP id f42mr427278eea.171.1312402259007; Wed, 03 Aug 2011 13:10:59 -0700 (PDT) Received: from localhost.localdomain (ip-60-249.bnaa.dk [84.238.60.249]) by mx.google.com with ESMTPS id h15sm479604eea.28.2011.08.03.13.10.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Aug 2011 13:10:57 -0700 (PDT) From: Daniel Morsing To: Tomi Valkeinen Cc: linux-omap@vger.kernel.org, Daniel Morsing , linux-fbdev@vger.kernel.org Subject: [PATCH] OMAP: DSS2: Don't allow moving managers away from enabled displays Date: Wed, 3 Aug 2011 22:10:51 +0200 Message-Id: <1312402251-31588-1-git-send-email-daniel.morsing@gmail.com> X-Mailer: git-send-email 1.7.6 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 03 Aug 2011 20:11:05 +0000 (UTC) If a manager is moved while attached to an enabled display, the DSS system will be left in an inconsistent state. This will eventually cause a kernel oops when the enabled display is disabled. Fix this by not allowing the user to move a manager away from an enabled display. Signed-off-by: Daniel Morsing --- drivers/video/omap2/dss/manager.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index 9aeea50..d3372d1 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c @@ -502,6 +502,13 @@ static int omap_dss_unset_device(struct omap_overlay_manager *mgr) return -EINVAL; } + /* + * Don't allow currently enabled displays to have the overlay manager + * pulled out from underneath them + */ + if (mgr->device->state != OMAP_DSS_DISPLAY_DISABLED) + return -EINVAL; + mgr->device->manager = NULL; mgr->device = NULL; mgr->device_changed = true;