From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261986AbULVSfq (ORCPT ); Wed, 22 Dec 2004 13:35:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262019AbULVSfq (ORCPT ); Wed, 22 Dec 2004 13:35:46 -0500 Received: from news.suse.de ([195.135.220.2]:58578 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S261986AbULVSfY (ORCPT ); Wed, 22 Dec 2004 13:35:24 -0500 Date: Wed, 22 Dec 2004 19:35:22 +0100 Message-ID: From: Takashi Iwai To: torvalds@osdl.org Cc: akpm@osdl.org, perex@suse.cz, benh@kernel.crashing.org, linux-kernel@vger.kernel.org Subject: [PATCH] Fix Oops with ALSA OSS emulation on PPC (2.6.10-rc3) User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 15) (Security Through Obscurity) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi, Ben finally found out the cause of Oops happening on ALSA OSS emulation with powermac driver. It's because of the sign of char. The patch is simple as attached below. Could you apply it to 2.6.10? thanks, -- Takashi Iwai ALSA Developer - www.alsa-project.org ==== Summary: [ALSA] Fix Oops with ALSA OSS emulation on PPC Fix suggested by Benjamin Herrenschmidt On architectures like PPC, char is handled as "unsigned char", thus the pcm_format_data table entries with -1 give a positive 255. This results in Oops with OSS-emulation on such architectures. The patch simply adds the right signed/unsigned prefix to fix this problem. Signed-off-by: Takashi Iwai --- linux/sound/core/pcm_misc.c 8 Jun 2004 16:57:28 -0000 1.12 +++ linux/sound/core/pcm_misc.c 22 Dec 2004 18:07:29 -0000 1.14 @@ -25,11 +25,14 @@ #include #define SND_PCM_FORMAT_UNKNOWN (-1) +/* NOTE: "signed" prefix must be given below since the default char is + * unsigned on some architectures! + */ struct pcm_format_data { - char width; /* bit width */ - char phys; /* physical bit width */ - char le; /* 0 = big-endian, 1 = little-endian, -1 = others */ - char signd; /* 0 = unsigned, 1 = signed, -1 = others */ + unsigned char width; /* bit width */ + unsigned char phys; /* physical bit width */ + signed char le; /* 0 = big-endian, 1 = little-endian, -1 = others */ + signed char signd; /* 0 = unsigned, 1 = signed, -1 = others */ unsigned char silence[8]; /* silence data to fill */ };