Module Name: src
Committed By: martin
Date: Sun Jun 30 19:00:10 UTC 2019
Modified Files:
src/sys/dev/ic [netbsd-8]: mvsata.c
Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1283):
sys/dev/ic/mvsata.c: revision 1.47
sys/dev/ic/mvsata.c: revision 1.48
Fix "mvsata:0:0:1: buffer load failed: error=27" failure. PR/54205
Ok'ed by jdolecek@.
Should be pulled up to netbsd-8.
Add a missing newline in an error message. Noticed in PR/54205
To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.10.1 src/sys/dev/ic/mvsata.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/ic/mvsata.c
diff -u src/sys/dev/ic/mvsata.c:1.35 src/sys/dev/ic/mvsata.c:1.35.10.1
--- src/sys/dev/ic/mvsata.c:1.35 Mon May 2 19:18:29 2016
+++ src/sys/dev/ic/mvsata.c Sun Jun 30 19:00:10 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: mvsata.c,v 1.35 2016/05/02 19:18:29 christos Exp $ */
+/* $NetBSD: mvsata.c,v 1.35.10.1 2019/06/30 19:00:10 martin Exp $ */
/*
* Copyright (c) 2008 KIYOHARA Takashi
* All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.35 2016/05/02 19:18:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.35.10.1 2019/06/30 19:00:10 martin Exp $");
#include "opt_mvsata.h"
@@ -103,7 +103,8 @@ int mvsata_debug = 2;
sending a cmd */
#define ATAPI_MODE_DELAY 1000 /* 1s, timeout for SET_FEATURE cmds */
-#define MVSATA_EPRD_MAX_SIZE (sizeof(struct eprd) * (MAXPHYS / PAGE_SIZE))
+#define MVSATA_MAX_SEGS (MAXPHYS / PAGE_SIZE + 1)
+#define MVSATA_EPRD_MAX_SIZE (sizeof(struct eprd) * MVSATA_MAX_SEGS)
static void mvsata_probe_drive(struct ata_channel *);
@@ -2918,7 +2919,7 @@ mvsata_port_init(struct mvsata_hc *mvhc,
}
for (i = 0; i < MVSATA_EDMAQ_LEN; i++) {
rv = bus_dmamap_create(mvport->port_dmat, MAXPHYS,
- MAXPHYS / PAGE_SIZE, MAXPHYS, 0, BUS_DMA_NOWAIT,
+ MVSATA_MAX_SEGS, MAXPHYS, 0, BUS_DMA_NOWAIT,
&mvport->port_reqtbl[i].data_dmamap);
if (rv != 0) {
aprint_error("%s:%d:%d:"
@@ -3125,7 +3126,7 @@ mvsata_dma_bufload(struct mvsata_port *m
rv = bus_dmamap_load(mvport->port_dmat, data_dmamap, databuf, datalen,
NULL, BUS_DMA_NOWAIT | lop);
if (rv) {
- aprint_error("%s:%d:%d: buffer load failed: error=%d",
+ aprint_error("%s:%d:%d: buffer load failed: error=%d\n",
device_xname(MVSATA_DEV2(mvport)), mvport->port_hc->hc,
mvport->port, rv);
return rv;