Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Fix PR kern/48550 by aligning the single inst...



details:   https://anonhg.NetBSD.org/src/rev/c4dbec904c0e
branches:  trunk
changeset: 328794:c4dbec904c0e
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Apr 18 06:23:32 2014 +0000

description:
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.

diffstat:

 sys/dev/scsipi/cd.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r a948d0e7e4da -r c4dbec904c0e sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c       Fri Apr 18 05:22:13 2014 +0000
+++ b/sys/dev/scsipi/cd.c       Fri Apr 18 06:23:32 2014 +0000
@@ -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 @@
 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;



Home | Main Index | Thread Index | Old Index