summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authortsutsui <tsutsui@NetBSD.org>2019-06-23 06:29:22 +0000
committertsutsui <tsutsui@NetBSD.org>2019-06-23 06:29:22 +0000
commit27ed18abdec9987f4a22e4b8eb40f2a1af548e72 (patch)
tree039703c02a9ffd8dd80a819fe3e0b756d6647451 /sys/dev/ic
parent25cd775436820054f54bbc1642ee085ffa67dc6d (diff)
Fix "mvsata:0:0:1: buffer load failed: error=27" failure. PR/54205
Ok'ed by jdolecek@. Should be pulled up to netbsd-8.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/mvsata.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/ic/mvsata.c b/sys/dev/ic/mvsata.c
index 2834f0ab6b9..23968c434fb 100644
--- a/sys/dev/ic/mvsata.c
+++ b/sys/dev/ic/mvsata.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mvsata.c,v 1.46 2018/11/12 20:54:03 jdolecek Exp $ */
+/* $NetBSD: mvsata.c,v 1.47 2019/06/23 06:29:22 tsutsui 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.46 2018/11/12 20:54:03 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.47 2019/06/23 06:29:22 tsutsui Exp $");
#include "opt_mvsata.h"
@@ -113,7 +113,8 @@ int mvsata_debug = 0;
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 *);
@@ -3110,7 +3111,7 @@ mvsata_port_init(struct mvsata_hc *mvhc, int port)
}
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:"