From patchwork Thu Jul 29 08:42:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 60197 X-Patchwork-Delegate: stefan.bader@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id A86D5B70B4 for ; Thu, 29 Jul 2010 18:42:35 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OeOh6-0001on-4f; Thu, 29 Jul 2010 09:42:24 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OeOh4-0001oY-LC for kernel-team@lists.ubuntu.com; Thu, 29 Jul 2010 09:42:22 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1OeOh4-00004r-J6 for ; Thu, 29 Jul 2010 09:42:22 +0100 Received: from [85.210.148.55] (helo=localhost.localdomain) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OeOh4-0007Dw-FB for kernel-team@lists.ubuntu.com; Thu, 29 Jul 2010 09:42:22 +0100 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1] UBUNTU: SAUCE: (no-up) Modularize vesafb -- fix initialisation Date: Thu, 29 Jul 2010 09:42:21 +0100 Message-Id: <1280392941-27701-2-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1280392941-27701-1-git-send-email-apw@canonical.com> References: <1280392941-27701-1-git-send-email-apw@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com When this patch was rolled forward, likely between Dapper and Hardy a chunk of initialisation was lost. Pull this back in so we actually have an vesafb_info structure initialised. Else we may well panic when we rmmod vesafb. Signed-off-by: Andy Whitcroft Acked-by: Stefan Bader Acked-by: Brad Figg --- drivers/video/vesafb.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index 5a95b55..7137226 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c @@ -257,6 +257,7 @@ static int __init vesafb_setup(char *options) static int __init vesafb_probe(struct platform_device *dev) { struct fb_info *info; + struct vesafb_info *vfb_info; int i, err; unsigned int size_vmode; unsigned int size_remap; @@ -315,13 +316,14 @@ static int __init vesafb_probe(struct platform_device *dev) spaces our resource handlers simply don't know about */ } - info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev); + info = framebuffer_alloc(sizeof(struct vesafb_info), &dev->dev); if (!info) { release_mem_region(vesafb_fix.smem_start, size_total); return -ENOMEM; } - info->pseudo_palette = info->par; - info->par = NULL; + vfb_info = (struct vesafb_info *) info->par; + vfb_info->mtrr_hdl = -1; + info->pseudo_palette = vfb_info->pseudo_palette; /* set vesafb aperture size for generic probing */ info->apertures = alloc_apertures(1); @@ -464,18 +466,16 @@ static int __init vesafb_probe(struct platform_device *dev) } if (type) { - int rc; - /* Find the largest power-of-two */ while (temp_size & (temp_size - 1)) temp_size &= (temp_size - 1); /* Try and find a power of two to add */ do { - rc = mtrr_add(vesafb_fix.smem_start, temp_size, + vfb_info->mtrr_hdl = mtrr_add(vesafb_fix.smem_start, temp_size, type, 1); temp_size >>= 1; - } while (temp_size >= PAGE_SIZE && rc == -EINVAL); + } while (temp_size >= PAGE_SIZE && vfb_info->mtrr_hdl == -EINVAL); } } #endif