Module Name:    src
Committed By:   martin
Date:           Fri Apr 18 06:23:32 UTC 2014

Modified Files:
        src/sys/dev/scsipi: cd.c

Log Message:
Fix PR kern/48550 by aligning the single instance of scsipi_read_cd_cap_data
that we found misaligned in the wild so far properly for the ahcisata
driver. Also point at PR kern/48754 for the real issue.


To generate a diff of this commit:
cvs rdiff -u -r1.318 -r1.319 src/sys/dev/scsipi/cd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.318 src/sys/dev/scsipi/cd.c:1.319
--- src/sys/dev/scsipi/cd.c:1.318	Wed Mar 19 15:48:23 2014
+++ src/sys/dev/scsipi/cd.c	Fri Apr 18 06:23:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.318 2014/03/19 15:48:23 martin Exp $	*/
+/*	$NetBSD: cd.c,v 1.319 2014/04/18 06:23:32 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.318 2014/03/19 15:48:23 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.319 2014/04/18 06:23:32 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1807,7 +1807,12 @@ static int
 read_cd_capacity(struct scsipi_periph *periph, u_int *blksize, u_long *last_lba)
 {
 	struct scsipi_read_cd_capacity    cap_cmd;
-	struct scsipi_read_cd_cap_data    cap;
+	/*
+	 * XXX: see PR 48550 and PR 48754:
+	 * the ahcisata(4) driver can not deal with unaligned
+	 * data, so align this "a bit"
+	 */
+	struct scsipi_read_cd_cap_data    cap __aligned(2);
 	struct scsipi_read_discinfo       di_cmd;
 	struct scsipi_read_discinfo_data  di;
 	struct scsipi_read_trackinfo      ti_cmd;

Reply via email to