From patchwork Wed Sep 16 09:46:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ingo Molnar X-Patchwork-Id: 7195781 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2AA469F32B for ; Wed, 16 Sep 2015 14:34:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A4162083D for ; Wed, 16 Sep 2015 14:34:30 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 90D192086D for ; Wed, 16 Sep 2015 14:34:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CF216EB3C; Wed, 16 Sep 2015 07:34:23 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by gabe.freedesktop.org (Postfix) with ESMTPS id F25AA6EA65 for ; Wed, 16 Sep 2015 02:46:53 -0700 (PDT) Received: by wiclk2 with SMTP id lk2so62568549wic.1 for ; Wed, 16 Sep 2015 02:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=rpPMKlxhoWhUi+nlmnPF4SphNbdALkvhQ/DLMtgbKCE=; b=HYOZGWG9pfADsHLMmng/+coWKDJqnAKQ94pb1HBdm74cLB7VQjM35EhcqdLw1ay3nB ES2NMQ/e/2E3oVbq+Bn/fqkKpUs4PSP5b7GOGcZ4SP2LgVNBW1W6WFWbnRLdbo292SOv oL/G2f/Snh9Iv2+3bRLSxrsPrCyrQZZOWrIlmW3aAWdqyuA1i/dgpBPGBzDx4LZK7rGq nPcMBZCsMG02pKaaTYeKSDmIU8NE6EMPWgY9QnMFdI6NoGrh98HvoZ8rd8L6qNGFXdyp Xq1enL80QQrTtZCv+euzLfY+Vv6srGDNqktMHqmFnO5P4TiIXc4cixktp/Wfu4VLSv4f /hug== X-Received: by 10.180.84.196 with SMTP id b4mr17453241wiz.32.1442396812265; Wed, 16 Sep 2015 02:46:52 -0700 (PDT) Received: from gmail.com (54033495.catv.pool.telekom.hu. [84.3.52.149]) by smtp.gmail.com with ESMTPSA id ka10sm10844503wjc.30.2015.09.16.02.46.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 02:46:51 -0700 (PDT) Date: Wed, 16 Sep 2015 11:46:48 +0200 From: Ingo Molnar To: Archit Taneja , Daniel Vetter Subject: [PATCH] drm/mgag200: Fix calling drm_fb_helper_fini() twice Message-ID: <20150916094648.GA11711@gmail.com> References: <1441627110-13783-1-git-send-email-sudipm.mukherjee@gmail.com> <20150913093607.GA6074@gmail.com> <55F6E68D.8070800@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <55F6E68D.8070800@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Wed, 16 Sep 2015 07:34:15 -0700 Cc: Daniel Vetter , LKML , dri-devel , Archit Taneja , Sudip Mukherjee X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP * Archit Taneja wrote: > From: Archit Taneja > Date: Mon, 14 Sep 2015 20:11:43 +0530 > Subject: [PATCH] drm/mgag200: Prevent calling drm_fb_helper_fini twice > > mgag200_fbdev_init's error handling path calls drm_fb_helper_fini before > bailing out. The error handling path of mgag200_driver_load also ends > up calling drm_fb_helper_fini. > > This results in drm_fb_helper_fini being called twice if the driver load > drm op fails somewhere in between. > > Make only mgag200_driver_unload call drm_fb_helper_fini, remove the call > from mgag200_fbdev_init. > > Signed-off-by: Archit Taneja > --- > drivers/gpu/drm/mgag200/mgag200_fb.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c > b/drivers/gpu/drm/mgag200/mgag200_fb.c > index 87de15e..6259b0a 100644 > --- a/drivers/gpu/drm/mgag200/mgag200_fb.c > +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c > @@ -280,20 +280,16 @@ int mgag200_fbdev_init(struct mga_device *mdev) > > ret = drm_fb_helper_single_add_all_connectors(&mfbdev->helper); > if (ret) > - goto fini; > + return ret; > > /* disable all the possible outputs/crtcs before entering KMS mode */ > drm_helper_disable_unused_functions(mdev->dev); > > ret = drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel); > if (ret) > - goto fini; > + return ret; > > return 0; > - > -fini: > - drm_fb_helper_fini(&mfbdev->helper); > - return ret; > } > > void mgag200_fbdev_fini(struct mga_device *mdev) So this patch was whitespace damaged - I applied it by hand and made the commit below. This has solved the crash, thanks Archit! And yes, you are right that my config probably crashed with older kernels too. Ingo =============> From 60d733a3ec19dc72372e12207a0a86293cd40cf5 Mon Sep 17 00:00:00 2001 From: Archit Taneja Date: Mon, 14 Sep 2015 20:53:57 +0530 Subject: [PATCH] drm/mgag200: Fix calling drm_fb_helper_fini() twice mgag200_fbdev_init()'s error handling path calls drm_fb_helper_fini() before bailing out. The error handling path of mgag200_driver_load() also ends up calling drm_fb_helper_fini(). This results in drm_fb_helper_fini() being called twice if the driver load drm op fails somewhere in between. Make only mgag200_driver_unload() call drm_fb_helper_fini(), remove the call from mgag200_fbdev_init(). Reported-by: Ingo Molnar Signed-off-by: Archit Taneja Cc: Archit Taneja Cc: Daniel Vetter Cc: Dave Airlie Cc: David Airlie Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sudip Mukherjee Cc: Thomas Gleixner Cc: dri-devel Link: http://lkml.kernel.org/r/55F6E68D.8070800@codeaurora.org Signed-off-by: Ingo Molnar --- drivers/gpu/drm/mgag200/mgag200_fb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c index 87de15ea1f93..6259b0a5fc38 100644 --- a/drivers/gpu/drm/mgag200/mgag200_fb.c +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c @@ -280,20 +280,16 @@ int mgag200_fbdev_init(struct mga_device *mdev) ret = drm_fb_helper_single_add_all_connectors(&mfbdev->helper); if (ret) - goto fini; + return ret; /* disable all the possible outputs/crtcs before entering KMS mode */ drm_helper_disable_unused_functions(mdev->dev); ret = drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel); if (ret) - goto fini; + return ret; return 0; - -fini: - drm_fb_helper_fini(&mfbdev->helper); - return ret; } void mgag200_fbdev_fini(struct mga_device *mdev)