NetBSD Problem Report #51141

From root@diablo.13thmonkey.org  Sun May 15 15:32:27 2016
Return-Path: <root@diablo.13thmonkey.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E22807A471
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 15 May 2016 15:32:26 +0000 (UTC)
Message-Id: <20160515153221.D5067C1363D@diablo.13thmonkey.org>
Date: Sun, 15 May 2016 17:32:21 +0200 (CEST)
From: root@diablo.13thmonkey.org
Reply-To: root@diablo.13thmonkey.org
To: gnats-bugs@NetBSD.org
Subject: Errors in SCSIPI command results due to alignment
X-Send-Pr-Version: 3.95

>Number:         51141
>Category:       kern
>Synopsis:       Errors in SCSIPI command results due to alignment
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Sun May 15 15:35:00 +0000 2016
>Last-Modified:  Sun May 15 15:40:01 +0000 2016
>Originator:     Reinoud Zandijk
>Release:        NetBSD 7.99.29
>Organization:
NetBSD

>Environment:


System: NetBSD diablo.13thmonkey.org 7.99.29 NetBSD 7.99.29 (GENERIC) #17: Sun May 15 16:42:12 CEST 2016 root@diablo.13thmonkey.org:/usr/sources/cvs.netbsd.org/src-udf/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64

device dump with dmassage -t :

root
 \-mainbus0
...
    \-pci0
       |-ahcisata1
       |  |-atabus3
       |  |  \-atapibus0
       |  |     \-cd0
       |  |-atabus4
       |  |  \-wd0
       |  |     \-dk0
       |  |-atabus5
       |  |-atabus6
       |  |  \-wd1
       |  |     |-dk1
       |  |     \-dk2
       |  |-atabus7
       |  \-atabus8
...
       |-ehci1
       |  \-usb7
       |     \-uhub7
       |        \-umass0
       |           \-atapibus1
       |              \-cd1
...
>Description:

Result data of SCSI commands executed in the kernel are shifted one byte if the
alignment of the result data blob is not aligned correctly. This only occures
in this machine with `cd0' at atapi, not with `cd1'.

If the data blob is aligned with __align(2) it works fine. This is the current
workaround in sys/dev/scsipi/cd.c


>How-To-Repeat:
Execute a SCSI command in kernel with the result blob at an oneven address.


>Fix:
The workaround i to use __align(2) for the result data blobs. The real problem
might be in the ata/atapi bus implementation or in the DMA setup.



>Audit-Trail:
From: "Reinoud Zandijk" <reinoud@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51141 CVS commit: src/sys/dev/scsipi
Date: Sun, 15 May 2016 15:37:38 +0000

 Module Name:	src
 Committed By:	reinoud
 Date:		Sun May 15 15:37:38 UTC 2016

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

 Log Message:
 Use _align(2) workaround for PR kern/51141. This fixes odd CD length
 reporting.


 To generate a diff of this commit:
 cvs rdiff -u -r1.330 -r1.331 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.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.