lkml.org 
[lkml]   [2003]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subjectre: PPC: slab error in cache_free_debugcheck() from sd_revalidate_disk [PATCH, -test9]
Date
I reported this one here over a week ago, and upon a suggestion from 'benh', 
i came up with a workaround patch for this bug, now documented in Bugzilla:

http://bugzilla.kernel.org/show_bug.cgi?id=1426

Attached below is said workaround patch which works for me. I don't like
it as i don't think platform-specific code belongs in 'drivers/scsi/sd.c'.
Hence i'm not necessarily recommending this for 2.6.0 unless important
people think otherwise. It does seem to make the problem go away and
eventually, 'benh' will fix this one properly.

-- JM

-------------------------------------------------------------------------------
--- drivers/scsi/sd.c.orig 2003-10-25 11:44:14.000000000 -0700
+++ drivers/scsi/sd.c 2003-10-26 10:11:11.020000000 -0800
@@ -1218,6 +1218,9 @@
struct scsi_device *sdp = sdkp->device;
struct scsi_request *sreq;
unsigned char *buffer;
+#ifdef CONFIG_SCSI_MESH
+ int mesh_fudge;
+#endif

SCSI_LOG_HLQUEUE(3, printk("sd_revalidate_disk: disk=%s\n", disk->disk_name));

@@ -1235,7 +1238,18 @@
goto out;
}

+#ifndef CONFIG_SCSI_MESH
buffer = kmalloc(512, GFP_KERNEL | __GFP_DMA);
+#else
+ /* According to 'benh', some MESH controllers have buggy hardware
+ that wants its buffer aligned to a specific byte boundary under
+ certain circumstances (we think it's a 16 byte boundary, but a
+ 32 byte boundary won't hurt). KD6PAG/Oct03 */
+ buffer = kmalloc(512+0x20, GFP_KERNEL | __GFP_DMA);
+
+ mesh_fudge = (0x20-(int)buffer)&0x1f; /* Result zero if NULL */
+ buffer += mesh_fudge;
+#endif
if (!buffer) {
printk(KERN_WARNING "(sd_revalidate_disk:) Memory allocation "
"failure.\n");
@@ -1265,6 +1279,9 @@
}

set_capacity(disk, sdkp->capacity);
+#ifdef CONFIG_SCSI_MESH
+ buffer -= mesh_fudge;
+#endif
kfree(buffer);

out_release_request:
===============================================================================
-
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/
\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.385 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site