Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264523AbTE1GaT (ORCPT ); Wed, 28 May 2003 02:30:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264552AbTE1GaS (ORCPT ); Wed, 28 May 2003 02:30:18 -0400 Received: from sullivan.realtime.net ([205.238.132.76]:64013 "EHLO sullivan.realtime.net") by vger.kernel.org with ESMTP id S264523AbTE1GaS (ORCPT ); Wed, 28 May 2003 02:30:18 -0400 Date: Wed, 28 May 2003 01:43:27 -0500 (CDT) Message-Id: <200305280643.h4S6hRQF028038@sullivan.realtime.net> From: Milton Miller To: Pavel Machek Cc: linux-kernel@vger.kernel.org, Andrew Morton Subject: [PATCH] fix oops on resume from apm bios initiated suspend Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1124 Lines: 32 Hi Pavel. Didn't know if you caught this one, but it fixes it for me and others who responded on the list. mm is NULL for kernel threads without their own context. active_mm is maintained the one we lazly switch from. Without this patch, apm bios initiated suspend events (eg panel close) cause an oops on resume in the LDT restore, killing kapmd, which causes further events to not be polled. milton ===== arch/i386/kernel/suspend.c 1.16 vs edited ===== --- 1.16/arch/i386/kernel/suspend.c Sat May 17 16:09:37 2003 +++ edited/arch/i386/kernel/suspend.c Sat May 24 05:00:02 2003 @@ -114,7 +114,7 @@ cpu_gdt_table[cpu][GDT_ENTRY_TSS].b &= 0xfffffdff; load_TR_desc(); /* This does ltr */ - load_LDT(¤t->mm->context); /* This does lldt */ + load_LDT(¤t->active_mm->context); /* This does lldt */ /* * Now maybe reload the debug registers - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/