CVS commit: src/sys/dev/ic

2019-10-18 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Oct 19 06:40:20 UTC 2019

Modified Files:
src/sys/dev/ic: dwc_gmac.c

Log Message:
awge: drop redundant m_adj(). Handled via uipc_mbuf.c r1.235 instead.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/ic/dwc_gmac.c

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



CVS commit: src/sys/dev/ic

2019-10-18 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Oct 19 06:40:20 UTC 2019

Modified Files:
src/sys/dev/ic: dwc_gmac.c

Log Message:
awge: drop redundant m_adj(). Handled via uipc_mbuf.c r1.235 instead.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/ic/dwc_gmac.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/dwc_gmac.c
diff -u src/sys/dev/ic/dwc_gmac.c:1.67 src/sys/dev/ic/dwc_gmac.c:1.68
--- src/sys/dev/ic/dwc_gmac.c:1.67	Tue Oct 15 17:19:05 2019
+++ src/sys/dev/ic/dwc_gmac.c	Sat Oct 19 06:40:20 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac.c,v 1.67 2019/10/15 17:19:05 tnn Exp $ */
+/* $NetBSD: dwc_gmac.c,v 1.68 2019/10/19 06:40:20 tnn Exp $ */
 
 /*-
  * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.67 2019/10/15 17:19:05 tnn Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.68 2019/10/19 06:40:20 tnn Exp $");
 
 /* #define	DWC_GMAC_DEBUG	1 */
 
@@ -501,7 +501,6 @@ dwc_gmac_alloc_rx_ring(struct dwc_gmac_s
 		}
 		data->rd_m->m_len = data->rd_m->m_pkthdr.len
 		= data->rd_m->m_ext.ext_size;
-		m_adj(data->rd_m, (-(uintptr_t)data->rd_m->m_data) & 0x3f);
 		if (data->rd_m->m_len > AWGE_MAX_PACKET) {
 			data->rd_m->m_len = data->rd_m->m_pkthdr.len
 			= AWGE_MAX_PACKET;
@@ -1275,7 +1274,6 @@ dwc_gmac_rx_intr(struct dwc_gmac_softc *
 			goto skip;
 		}
 		mnew->m_len = mnew->m_pkthdr.len = mnew->m_ext.ext_size;
-		m_adj(mnew, (-(uintptr_t)mnew->m_data) & 0x3f);
 		if (mnew->m_len > AWGE_MAX_PACKET) {
 			mnew->m_len = mnew->m_pkthdr.len = AWGE_MAX_PACKET;
 		}



CVS commit: src/sys/kern

2019-10-18 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Oct 19 06:36:47 UTC 2019

Modified Files:
src/sys/kern: uipc_mbuf.c

Log Message:
mcl_cache: align items to COHERENCY_UNIT

Because we do cache incoherent DMA to/from mbufs we cannot safely share
share cache lines with adjacent items that may be concurrently accessed.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/kern/uipc_mbuf.c

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



CVS commit: src/sys/kern

2019-10-18 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Oct 19 06:36:47 UTC 2019

Modified Files:
src/sys/kern: uipc_mbuf.c

Log Message:
mcl_cache: align items to COHERENCY_UNIT

Because we do cache incoherent DMA to/from mbufs we cannot safely share
share cache lines with adjacent items that may be concurrently accessed.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/kern/uipc_mbuf.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/kern/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.234 src/sys/kern/uipc_mbuf.c:1.235
--- src/sys/kern/uipc_mbuf.c:1.234	Sat Sep 28 16:02:12 2019
+++ src/sys/kern/uipc_mbuf.c	Sat Oct 19 06:36:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.234 2019/09/28 16:02:12 jmcneill Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.235 2019/10/19 06:36:47 tnn Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001, 2018 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.234 2019/09/28 16:02:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.235 2019/10/19 06:36:47 tnn Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -188,8 +188,8 @@ mbinit(void)
 	NULL, IPL_VM, mb_ctor, NULL, NULL);
 	KASSERT(mb_cache != NULL);
 
-	mcl_cache = pool_cache_init(mclbytes, 0, 0, 0, "mclpl", NULL,
-	IPL_VM, NULL, NULL, NULL);
+	mcl_cache = pool_cache_init(mclbytes, COHERENCY_UNIT, 0, 0, "mclpl",
+	NULL, IPL_VM, NULL, NULL, NULL);
 	KASSERT(mcl_cache != NULL);
 
 	pool_cache_set_drain_hook(mb_cache, mb_drain, NULL);



CVS commit: src/sys/dev/pci

2019-10-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 18 23:08:29 UTC 2019

Modified Files:
src/sys/dev/pci: if_bce.c if_bcereg.h

Log Message:
>From OpenBSD:
 - Mark ETHERCAP_VLAN_MTU.
 - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
 - Set proper LED modes.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_bcereg.h

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/pci/if_bce.c
diff -u src/sys/dev/pci/if_bce.c:1.55 src/sys/dev/pci/if_bce.c:1.56
--- src/sys/dev/pci/if_bce.c:1.55	Fri Oct 18 23:06:57 2019
+++ src/sys/dev/pci/if_bce.c	Fri Oct 18 23:08:29 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.55 2019/10/18 23:06:57 msaitoh Exp $	 */
+/* $NetBSD: if_bce.c,v 1.56 2019/10/18 23:08:29 msaitoh Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.55 2019/10/18 23:06:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.56 2019/10/18 23:08:29 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -421,6 +421,8 @@ bce_attach(device_t parent, device_t sel
 	ifp->if_stop = bce_stop;
 	IFQ_SET_READY(&ifp->if_snd);
 
+	sc->ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU;
+
 	/* Initialize our media structures and probe the MII. */
 
 	mii->mii_ifp = ifp;
@@ -918,10 +920,15 @@ bce_init(struct ifnet *ifp)
 	sc->bce_txsnext = 0;
 	sc->bce_txin = 0;
 
-	/* enable crc32 generation */
+	/* enable crc32 generation and set proper LED modes */
 	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
 	bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) |
-	BCE_EMC_CG);
+	BCE_EMC_CRC32_ENAB | BCE_EMC_LED);
+
+	/* reset or clear powerdown control bit  */
+	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
+	bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) &
+	~BCE_EMC_PDOWN);
 
 	/* setup DMA interrupt control */
 	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_DMAI_CTL, 1 << 24);	/* MAGIC */

Index: src/sys/dev/pci/if_bcereg.h
diff -u src/sys/dev/pci/if_bcereg.h:1.4 src/sys/dev/pci/if_bcereg.h:1.5
--- src/sys/dev/pci/if_bcereg.h:1.4	Sun Dec 11 12:22:49 2005
+++ src/sys/dev/pci/if_bcereg.h	Fri Oct 18 23:08:29 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bcereg.h,v 1.4 2005/12/11 12:22:49 christos Exp $	 */
+/* $NetBSD: if_bcereg.h,v 1.5 2019/10/18 23:08:29 msaitoh Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -71,7 +71,10 @@
 /* Ethernet MAC Control */
 #define BCE_MACCTL			0x00A8	/* ethernet mac control */
 /* mac control bits */
-#define BCE_EMC_CG			0x0001	/* crc32 generation */
+#define BCE_EMC_CRC32_ENAB		0x0001	/* crc32 generation */
+#define BCE_EMC_PDOWN			0x0004	/* PHY powerdown */
+#define BCE_EMC_EDET			0x0008	/* PHY energy detect */
+#define BCE_EMC_LED			0x00e0	/* PHY LED control */
 
 /* DMA Interrupt control */
 #define BCE_DMAI_CTL			0x0100



CVS commit: src/sys/dev/pci

2019-10-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 18 23:08:29 UTC 2019

Modified Files:
src/sys/dev/pci: if_bce.c if_bcereg.h

Log Message:
>From OpenBSD:
 - Mark ETHERCAP_VLAN_MTU.
 - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
 - Set proper LED modes.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_bcereg.h

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



CVS commit: src/sys/dev/pci

2019-10-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 18 23:06:57 UTC 2019

Modified Files:
src/sys/dev/pci: if_bce.c

Log Message:
- Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
- Remove unneccesary inclusion.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pci/if_bce.c

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



CVS commit: src/sys/dev/pci

2019-10-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 18 23:06:57 UTC 2019

Modified Files:
src/sys/dev/pci: if_bce.c

Log Message:
- Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
- Remove unneccesary inclusion.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pci/if_bce.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/pci/if_bce.c
diff -u src/sys/dev/pci/if_bce.c:1.54 src/sys/dev/pci/if_bce.c:1.55
--- src/sys/dev/pci/if_bce.c:1.54	Fri Oct 18 04:09:02 2019
+++ src/sys/dev/pci/if_bce.c	Fri Oct 18 23:06:57 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.54 2019/10/18 04:09:02 msaitoh Exp $	 */
+/* $NetBSD: if_bce.c,v 1.55 2019/10/18 23:06:57 msaitoh Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.54 2019/10/18 04:09:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.55 2019/10/18 23:06:57 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -63,8 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1
 
 #include 
 #include 
-#include 
-#include 
 
 #include 
 
@@ -653,7 +651,7 @@ bce_watchdog(struct ifnet *ifp)
 {
 	struct bce_softc *sc = ifp->if_softc;
 
-	aprint_error_dev(sc->bce_dev, "device timeout\n");
+	device_printf(sc->bce_dev, "device timeout\n");
 	ifp->if_oerrors++;
 
 	(void) bce_init(ifp);
@@ -1476,9 +1474,11 @@ static void
 bce_tick(void *v)
 {
 	struct bce_softc *sc = v;
+	int s;
 
-	/* Tick the MII. */
+	s = splnet();
 	mii_tick(&sc->bce_mii);
+	splx(s);
 
 	callout_reset(&sc->bce_timeout, hz, bce_tick, sc);
 }



CVS commit: src/sys/dev/mii

2019-10-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Oct 18 20:42:10 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs miidevs.h miidevs_data.h

Log Message:
Fix typo. from vezhlys


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/mii/miidevs
cvs rdiff -u -r1.156 -r1.157 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/mii/miidevs_data.h

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/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.158 src/sys/dev/mii/miidevs:1.159
--- src/sys/dev/mii/miidevs:1.158	Thu Oct 17 09:21:40 2019
+++ src/sys/dev/mii/miidevs	Fri Oct 18 20:42:10 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.158 2019/10/17 09:21:40 msaitoh Exp $
+$NetBSD: miidevs,v 1.159 2019/10/18 20:42:10 maya Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -94,7 +94,7 @@ oui TI0x080028	Texas Instruments
 oui BROADCOM4			0x18c086	Broadcom Corporation
 oui RENESAS			0x749050	Renesas
 
-/* Unregisterd or wrong OUI */
+/* Unregistered or wrong OUI */
 oui yyREALTEK			0x04	Realtek
 oui yyAMD			0x58	Advanced Micro Devices
 oui xxMYSON			0x00032d	Myson Technology

Index: src/sys/dev/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.156 src/sys/dev/mii/miidevs.h:1.157
--- src/sys/dev/mii/miidevs.h:1.156	Thu Oct 17 09:22:00 2019
+++ src/sys/dev/mii/miidevs.h	Fri Oct 18 20:42:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: miidevs.h,v 1.156 2019/10/17 09:22:00 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.157 2019/10/18 20:42:10 maya Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -101,7 +101,7 @@
 #define	MII_OUI_BROADCOM4	0x18c086	/* Broadcom Corporation */
 #define	MII_OUI_RENESAS	0x749050	/* Renesas */
 
-/* Unregisterd or wrong OUI */
+/* Unregistered or wrong OUI */
 #define	MII_OUI_yyREALTEK	0x04	/* Realtek */
 #define	MII_OUI_yyAMD	0x58	/* Advanced Micro Devices */
 #define	MII_OUI_xxMYSON	0x00032d	/* Myson Technology */

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.144 src/sys/dev/mii/miidevs_data.h:1.145
--- src/sys/dev/mii/miidevs_data.h:1.144	Thu Oct 17 09:22:00 2019
+++ src/sys/dev/mii/miidevs_data.h	Fri Oct 18 20:42:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: miidevs_data.h,v 1.144 2019/10/17 09:22:00 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.145 2019/10/18 20:42:10 maya Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.



CVS commit: src/sys/dev/mii

2019-10-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Oct 18 20:42:10 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs miidevs.h miidevs_data.h

Log Message:
Fix typo. from vezhlys


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/mii/miidevs
cvs rdiff -u -r1.156 -r1.157 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/mii/miidevs_data.h

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



CVS commit: src/sys/kern

2019-10-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 18 19:43:49 UTC 2019

Modified Files:
src/sys/kern: kern_event.c

Log Message:
print which process asked for an unsupported event so we can fix it.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/kern/kern_event.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/kern/kern_event.c
diff -u src/sys/kern/kern_event.c:1.104 src/sys/kern/kern_event.c:1.105
--- src/sys/kern/kern_event.c:1.104	Tue Nov 13 01:58:14 2018
+++ src/sys/kern/kern_event.c	Fri Oct 18 15:43:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_event.c,v 1.104 2018/11/13 06:58:14 maxv Exp $	*/
+/*	$NetBSD: kern_event.c,v 1.105 2019/10/18 19:43:49 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.104 2018/11/13 06:58:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.105 2019/10/18 19:43:49 christos Exp $");
 
 #include 
 #include 
@@ -1122,9 +1122,12 @@ kqueue_register(struct kqueue *kq, struc
 			KERNEL_UNLOCK_ONE(NULL);	/* XXXSMP */
 			if (error != 0) {
 #ifdef DEBUG
+struct proc *p = curlwp->l_proc;
 const file_t *ft = kn->kn_obj;
-uprintf("%s: event type %d not supported for "
-"file type %d/%s (error %d)\n", __func__,
+printf("%s: %s[%d]: event type %d not "
+"supported for file type %d/%s "
+"(error %d)\n", __func__,
+p->p_comm, p->p_pid,
 kn->kn_filter, ft ? ft->f_type : -1,
 ft ? ft->f_ops->fo_name : "?", error);
 #endif



CVS commit: src/sys/kern

2019-10-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 18 19:43:49 UTC 2019

Modified Files:
src/sys/kern: kern_event.c

Log Message:
print which process asked for an unsupported event so we can fix it.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/kern/kern_event.c

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



Re: CVS commit: src/sys/dev/pci

2019-10-18 Thread Tobias Nygren
On Fri, 18 Oct 2019 20:32:53 +0200
Tom Ivar Helbekkmo  wrote:

> Tobias Nygren  writes:
> 
> > Module Name:src
> > Committed By:   tnn
> > Date:   Fri Oct 18 17:16:50 UTC 2019
> >
> > Modified Files:
> > src/sys/dev/pci: ahcisata_pci.c
> >
> > Log Message:
> > ahcisata: make sure bus mastering and memory space are actually enabled
> >
> > This makes the "ROCKPro64 PCI-e to Dual SATA-II Interface Card" work.
> 
> Um.  I've been using that interface card for a while, on my Rockpro64,
> which is, in fact, running with root on a raidframe mirror of two SATA
> disks connected to it.  I did have to make a small change to make it
> work, though: I had to force it to not use MSI(X) interrupts.  Do you
> think I can revert that local modification with your change?

Yep, MSI works now. According to the PCI Express Base Specification,
Revision 3.0, table 7-3, having the bus master bit set to 0 disables
MSI. Asmedia chip seems to have a bug which makes DMA work regardless ...

-Tobias


Re: CVS commit: src/sys/dev/pci

2019-10-18 Thread Tom Ivar Helbekkmo
Tobias Nygren  writes:

> Module Name:  src
> Committed By: tnn
> Date: Fri Oct 18 17:16:50 UTC 2019
>
> Modified Files:
>   src/sys/dev/pci: ahcisata_pci.c
>
> Log Message:
> ahcisata: make sure bus mastering and memory space are actually enabled
>
> This makes the "ROCKPro64 PCI-e to Dual SATA-II Interface Card" work.

Um.  I've been using that interface card for a while, on my Rockpro64,
which is, in fact, running with root on a raidframe mirror of two SATA
disks connected to it.  I did have to make a small change to make it
work, though: I had to force it to not use MSI(X) interrupts.  Do you
think I can revert that local modification with your change?

ahcisata0 at pci1 dev 0 function 0: vendor 1b21 product 0612 (rev. 0x01)
ahcisata0: 64-bit DMA unavailable
ahcisata0: AHCI revision 1.20, 2 ports, 32 slots, CAP 
0xeb32ffa1
ahcisata0: interrupting at GICv3 irq 82
atabus0 at ahcisata0 channel 0
atabus1 at ahcisata0 channel 1
wd0 at atabus0 drive 0
wd0: 
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 931 GB, 1938021 cyl, 16 head, 63 sec, 512 bytes/sect x 1953525168 sectors
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133), NCQ 
(32 tags) w/PRIO
wd0(ahcisata0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) 
(using DMA), NCQ (31 tags) w/PRIO
wd1 at atabus1 drive 0
wd1: 
wd1: drive supports 16-sector PIO transfers, LBA48 addressing
wd1: 931 GB, 1938021 cyl, 16 head, 63 sec, 512 bytes/sect x 1953525168 sectors
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133), NCQ 
(32 tags) w/PRIO
wd1(ahcisata0:1:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) 
(using DMA), NCQ (31 tags) w/PRIO
raid0: RAID Level 1
raid0: Components: /dev/wd0a /dev/wd1a
raid0: Total Sectors: 1936551168 (945581 MB)
root on raid0a dumps on wd1b
root file system type: ffs

-tih
-- 
Most people who graduate with CS degrees don't understand the significance
of Lisp.  Lisp is the most important idea in computer science.  --Alan Kay


CVS commit: src/sys/dev/pci

2019-10-18 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Oct 18 17:16:50 UTC 2019

Modified Files:
src/sys/dev/pci: ahcisata_pci.c

Log Message:
ahcisata: make sure bus mastering and memory space are actually enabled

This makes the "ROCKPro64 PCI-e to Dual SATA-II Interface Card" work.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/ahcisata_pci.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/pci/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.55 src/sys/dev/pci/ahcisata_pci.c:1.56
--- src/sys/dev/pci/ahcisata_pci.c:1.55	Sun Jan 27 02:08:42 2019
+++ src/sys/dev/pci/ahcisata_pci.c	Fri Oct 18 17:16:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.55 2019/01/27 02:08:42 pgoyette Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.56 2019/10/18 17:16:50 tnn Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.55 2019/01/27 02:08:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.56 2019/10/18 17:16:50 tnn Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ahcisata_pci.h"
@@ -394,6 +394,7 @@ ahci_pci_attach(device_t parent, device_
 	struct ahci_softc *sc = &psc->ah_sc;
 	bool ahci_cap_64bit;
 	bool ahci_bad_64bit;
+	pcireg_t reg;
 
 	sc->sc_atac.atac_dev = self;
 
@@ -447,6 +448,10 @@ ahci_pci_attach(device_t parent, device_
 		AHCIDEBUG_PRINT(("%s: SATA mode\n", AHCINAME(sc)), DEBUG_PROBE);
 	}
 
+	reg = pci_conf_read(psc->sc_pc, psc->sc_pcitag, PCI_COMMAND_STATUS_REG);
+	reg |= (PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE);
+	pci_conf_write(psc->sc_pc, psc->sc_pcitag, PCI_COMMAND_STATUS_REG, reg);
+
 	ahci_attach(sc);
 
 	if (!pmf_device_register(self, NULL, ahci_pci_resume))



CVS commit: src/sys/dev/pci

2019-10-18 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Oct 18 17:16:50 UTC 2019

Modified Files:
src/sys/dev/pci: ahcisata_pci.c

Log Message:
ahcisata: make sure bus mastering and memory space are actually enabled

This makes the "ROCKPro64 PCI-e to Dual SATA-II Interface Card" work.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/ahcisata_pci.c

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



CVS commit: src/sys/arch/x86/x86

2019-10-18 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Oct 18 16:26:38 UTC 2019

Modified Files:
src/sys/arch/x86/x86: vm_machdep.c

Log Message:
Remove unused call to savectx().


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/x86/x86/vm_machdep.c

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



CVS commit: src/sys/arch/x86/x86

2019-10-18 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Oct 18 16:26:38 UTC 2019

Modified Files:
src/sys/arch/x86/x86: vm_machdep.c

Log Message:
Remove unused call to savectx().


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/x86/x86/vm_machdep.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/arch/x86/x86/vm_machdep.c
diff -u src/sys/arch/x86/x86/vm_machdep.c:1.38 src/sys/arch/x86/x86/vm_machdep.c:1.39
--- src/sys/arch/x86/x86/vm_machdep.c:1.38	Sat Oct 12 06:31:04 2019
+++ src/sys/arch/x86/x86/vm_machdep.c	Fri Oct 18 16:26:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.38 2019/10/12 06:31:04 maxv Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.39 2019/10/18 16:26:38 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.38 2019/10/12 06:31:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.39 2019/10/18 16:26:38 maxv Exp $");
 
 #include "opt_mtrr.h"
 
@@ -136,19 +136,11 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 	struct switchframe *sf;
 	vaddr_t uv;
 
+	KASSERT(l1 == curlwp || l1 == &lwp0);
+
 	pcb1 = lwp_getpcb(l1);
 	pcb2 = lwp_getpcb(l2);
 
-	/*
-	 * Sync the PCB before we copy it.
-	 */
-	if (l1 == curlwp) {
-		KASSERT(pcb1 == curpcb);
-		savectx(pcb1);
-	} else {
-		KASSERT(l1 == &lwp0);
-	}
-
 	/* Copy the PCB from parent, except the FPU state. */
 	memcpy(pcb2, pcb1, offsetof(struct pcb, pcb_savefpu));
 



CVS commit: src/sys/arch/i386/pci

2019-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Oct 18 15:00:15 UTC 2019

Modified Files:
src/sys/arch/i386/pci: piixpcib.c

Log Message:
Add missing include -- kernel ALL/i386 compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/i386/pci/piixpcib.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/arch/i386/pci/piixpcib.c
diff -u src/sys/arch/i386/pci/piixpcib.c:1.23 src/sys/arch/i386/pci/piixpcib.c:1.24
--- src/sys/arch/i386/pci/piixpcib.c:1.23	Fri Oct 18 01:00:25 2019
+++ src/sys/arch/i386/pci/piixpcib.c	Fri Oct 18 15:00:15 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpcib.c,v 1.23 2019/10/18 01:00:25 manu Exp $ */
+/* $NetBSD: piixpcib.c,v 1.24 2019/10/18 15:00:15 hannken Exp $ */
 
 /*-
  * Copyright (c) 2004, 2006 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpcib.c,v 1.23 2019/10/18 01:00:25 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpcib.c,v 1.24 2019/10/18 15:00:15 hannken Exp $");
 
 #include 
 #include 
@@ -47,6 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: piixpcib.c,v
 
 #include 
 #include 
+#include 
 
 #include 
 #include 



CVS commit: src/sys/arch/i386/pci

2019-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Oct 18 15:00:15 UTC 2019

Modified Files:
src/sys/arch/i386/pci: piixpcib.c

Log Message:
Add missing include -- kernel ALL/i386 compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/i386/pci/piixpcib.c

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



CVS commit: src/sys/arch/x86/x86

2019-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Oct 18 14:59:22 UTC 2019

Modified Files:
src/sys/arch/x86/x86: multiboot2.c

Log Message:
Make compile with "options DEBUG".


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/multiboot2.c

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



CVS commit: src/sys/arch/x86/x86

2019-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Oct 18 14:59:22 UTC 2019

Modified Files:
src/sys/arch/x86/x86: multiboot2.c

Log Message:
Make compile with "options DEBUG".


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/multiboot2.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/arch/x86/x86/multiboot2.c
diff -u src/sys/arch/x86/x86/multiboot2.c:1.1 src/sys/arch/x86/x86/multiboot2.c:1.2
--- src/sys/arch/x86/x86/multiboot2.c:1.1	Fri Oct 18 01:38:28 2019
+++ src/sys/arch/x86/x86/multiboot2.c	Fri Oct 18 14:59:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: multiboot2.c,v 1.1 2019/10/18 01:38:28 manu Exp $	*/
+/*	$NetBSD: multiboot2.c,v 1.2 2019/10/18 14:59:22 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: multiboot2.c,v 1.1 2019/10/18 01:38:28 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: multiboot2.c,v 1.2 2019/10/18 14:59:22 hannken Exp $");
 
 #include "opt_multiboot.h"
 
@@ -784,6 +784,9 @@ multiboot2_print_info(void)
 	char *cp;
 	uint32_t total_size;
 	uint32_t reserved;
+#ifdef DEBUG
+	int i = 0;
+#endif
 
 	if (multiboot2_enabled == false)
 		goto out;



CVS commit: src/sys

2019-10-18 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Fri Oct 18 12:53:09 UTC 2019

Modified Files:
src/sys/arch/arm/imx/fdt: if_enet_imx.c imx6_platform.c
src/sys/dev/mii: atphy.c

Log Message:
Modified atphy(4)

* Support CLK_25M clock out.
* Support internal delay for RGMII interface.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/fdt/if_enet_imx.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/fdt/imx6_platform.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/atphy.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/arch/arm/imx/fdt/if_enet_imx.c
diff -u src/sys/arch/arm/imx/fdt/if_enet_imx.c:1.3 src/sys/arch/arm/imx/fdt/if_enet_imx.c:1.4
--- src/sys/arch/arm/imx/fdt/if_enet_imx.c:1.3	Mon Aug 19 03:45:51 2019
+++ src/sys/arch/arm/imx/fdt/if_enet_imx.c	Fri Oct 18 12:53:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_enet_imx.c,v 1.3 2019/08/19 03:45:51 hkenken Exp $	*/
+/*	$NetBSD: if_enet_imx.c,v 1.4 2019/10/18 12:53:08 hkenken Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.3 2019/08/19 03:45:51 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.4 2019/10/18 12:53:08 hkenken Exp $");
 
 #include "opt_fdt.h"
 
@@ -71,6 +71,7 @@ enet_attach(device_t parent, device_t se
 	struct enet_fdt_softc * const efsc = device_private(self);
 	struct enet_softc *sc = &efsc->sc_enet;
 	struct fdt_attach_args * const faa = aux;
+	prop_dictionary_t prop = device_properties(self);
 	const int phandle = faa->faa_phandle;
 	bus_space_tag_t bst = faa->faa_bst;
 	bus_space_handle_t bsh;
@@ -103,15 +104,35 @@ enet_attach(device_t parent, device_t se
 	aprint_naive("\n");
 	aprint_normal(": Gigabit Ethernet Controller\n");
 
-	enet_phy_reset(efsc, phandle);
-
 	sc->sc_dev = self;
 	sc->sc_iot = bst;
 	sc->sc_ioh = bsh;
 	sc->sc_dmat = faa->faa_dmat;
 
 	sc->sc_imxtype = 6;	/* i.MX6 */
-	sc->sc_rgmii = 1;
+	sc->sc_unit = 0;
+
+	const char *phy_mode = fdtbus_get_string(phandle, "phy-mode");
+	if (phy_mode == NULL) {
+		aprint_error(": missing 'phy-mode' property\n");
+		goto failure;
+	}
+
+	if (strcmp(phy_mode, "rgmii-txid") == 0) {
+		prop_dictionary_set_bool(prop, "tx_internal_delay", true);
+		sc->sc_rgmii = 1;
+	} else if (strcmp(phy_mode, "rgmii-rxid") == 0) {
+		prop_dictionary_set_bool(prop, "rx_internal_delay", true);
+		sc->sc_rgmii = 1;
+	} else if (strcmp(phy_mode, "rgmii-id") == 0) {
+		prop_dictionary_set_bool(prop, "tx_internal_delay", true);
+		prop_dictionary_set_bool(prop, "rx_internal_delay", true);
+		sc->sc_rgmii = 1;
+	} else if (strcmp(phy_mode, "rgmii") == 0) {
+		sc->sc_rgmii = 1;
+	} else {
+		sc->sc_rgmii = 0;
+	}
 
 	char intrstr[128];
 	if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
@@ -128,7 +149,9 @@ enet_attach(device_t parent, device_t se
 	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 
 	enet_init_clocks(sc);
-	sc->sc_pllclock = clk_get_rate(sc->sc_clk_enet);
+	sc->sc_pllclock = clk_get_rate(sc->sc_clk_enet_ref);
+
+	enet_phy_reset(efsc, phandle);
 
 	if (enet_attach_common(self) != 0)
 		goto failure;

Index: src/sys/arch/arm/imx/fdt/imx6_platform.c
diff -u src/sys/arch/arm/imx/fdt/imx6_platform.c:1.6 src/sys/arch/arm/imx/fdt/imx6_platform.c:1.7
--- src/sys/arch/arm/imx/fdt/imx6_platform.c:1.6	Mon Aug 19 10:44:35 2019
+++ src/sys/arch/arm/imx/fdt/imx6_platform.c	Fri Oct 18 12:53:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_platform.c,v 1.6 2019/08/19 10:44:35 hkenken Exp $	*/
+/*	$NetBSD: imx6_platform.c,v 1.7 2019/10/18 12:53:08 hkenken Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.6 2019/08/19 10:44:35 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.7 2019/10/18 12:53:08 hkenken Exp $");
 
 #include "arml2cc.h"
 #include "opt_console.h"
@@ -116,6 +116,20 @@ imx_platform_early_putchar(char c)
 static void
 imx_platform_device_register(device_t self, void *aux)
 {
+	prop_dictionary_t prop = device_properties(self);
+
+	if (device_is_a(self, "atphy")) {
+		const char * compat[] = {
+			"fsl,imx6dl-sabresd",
+			"fsl,imx6q-sabresd",
+			"fsl,imx6qp-sabresd",
+			"solidrun,hummingboard2/q",
+			"solidrun,hummingboard2/dl",
+			NULL
+		};
+		if (of_match_compatible(OF_finddevice("/"), compat))
+			prop_dictionary_set_uint32(prop, "clk_25m", 12500);
+	}
 }
 
 static u_int

Index: src/sys/dev/mii/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.23 src/sys/dev/mii/atphy.c:1.24
--- src/sys/dev/mii/atphy.c:1.23	Mon Sep  2 12:48:52 2019
+++ src/sys/dev/mii/atphy.c	Fri Oct 18 12:53:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.23 2019/09/0

CVS commit: src/sys

2019-10-18 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Fri Oct 18 12:53:09 UTC 2019

Modified Files:
src/sys/arch/arm/imx/fdt: if_enet_imx.c imx6_platform.c
src/sys/dev/mii: atphy.c

Log Message:
Modified atphy(4)

* Support CLK_25M clock out.
* Support internal delay for RGMII interface.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/fdt/if_enet_imx.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/fdt/imx6_platform.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/atphy.c

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



CVS commit: src/sys/fs/ntfs

2019-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Oct 18 08:19:33 UTC 2019

Modified Files:
src/sys/fs/ntfs: ntfs_subr.c

Log Message:
When the MFT record size is lower than the cluster size we have
to read consecutive clusters to fill the MFT record.

Should fix PR kern/54598: mount ntfs panic


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/fs/ntfs/ntfs_subr.c

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



CVS commit: src/sys/fs/ntfs

2019-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Oct 18 08:19:33 UTC 2019

Modified Files:
src/sys/fs/ntfs: ntfs_subr.c

Log Message:
When the MFT record size is lower than the cluster size we have
to read consecutive clusters to fill the MFT record.

Should fix PR kern/54598: mount ntfs panic


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/fs/ntfs/ntfs_subr.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/fs/ntfs/ntfs_subr.c
diff -u src/sys/fs/ntfs/ntfs_subr.c:1.61 src/sys/fs/ntfs/ntfs_subr.c:1.62
--- src/sys/fs/ntfs/ntfs_subr.c:1.61	Sat Mar 28 19:24:05 2015
+++ src/sys/fs/ntfs/ntfs_subr.c	Fri Oct 18 08:19:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntfs_subr.c,v 1.61 2015/03/28 19:24:05 maxv Exp $	*/
+/*	$NetBSD: ntfs_subr.c,v 1.62 2019/10/18 08:19:33 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko (sem...@freebsd.org)
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.61 2015/03/28 19:24:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.62 2019/10/18 08:19:33 hannken Exp $");
 
 #include 
 #include 
@@ -271,6 +271,8 @@ ntfs_loadntnode(struct ntfsmount *ntmp, 
 		struct buf *bp;
 		daddr_t bn;
 		off_t boff;
+		size_t resid, l;
+		char *data;
 
 		dprintf(("%s: read system node\n", __func__));
 
@@ -281,17 +283,26 @@ ntfs_loadntnode(struct ntfsmount *ntmp, 
 		boff = ntfs_cntob(ntmp->ntm_mftcn) +
 		ntfs_bntob(ntmp->ntm_bpmftrec) * ip->i_number;
 		bn = ntfs_cntobn(ntfs_btocn(boff));
-		off = ntfs_btocnoff(boff);
+		boff = ntfs_btocnoff(boff);
+		resid = ntfs_bntob(ntmp->ntm_bpmftrec);
+		data = (char *)mfrp;
+		while (resid > 0) {
+			l = MIN(resid, ntfs_cntob(1) - boff);
+
+			error = bread(ntmp->ntm_devvp, bn, ntfs_cntob(1),
+			0, &bp);
+			if (error) {
+printf("%s: BREAD FAILED\n", __func__);
+goto out;
+			}
+			memcpy(data, (char *)bp->b_data + boff, l);
+			bqrelse(bp);
 
-		error = bread(ntmp->ntm_devvp, bn, ntfs_cntob(1),
-		0, &bp);
-		if (error) {
-			printf("%s: BREAD FAILED\n", __func__);
-			goto out;
+			bn += ntfs_cntobn(1);
+			boff = 0;
+			data += l;
+			resid -= l;
 		}
-		memcpy(mfrp, (char *)bp->b_data + off,
-		ntfs_bntob(ntmp->ntm_bpmftrec));
-		bqrelse(bp);
 	} else {
 		struct vnode   *vp;
 



CVS commit: src/sys/fs/ntfs

2019-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Oct 18 08:18:40 UTC 2019

Modified Files:
src/sys/fs/ntfs: ntfs_vfsops.c

Log Message:
It is not possible to call vflush() from xxx_mount().

Replace with a vnode iterator and use vrecycle().


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/fs/ntfs/ntfs_vfsops.c

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



CVS commit: src/sys/fs/ntfs

2019-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Oct 18 08:18:40 UTC 2019

Modified Files:
src/sys/fs/ntfs: ntfs_vfsops.c

Log Message:
It is not possible to call vflush() from xxx_mount().

Replace with a vnode iterator and use vrecycle().


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/fs/ntfs/ntfs_vfsops.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/fs/ntfs/ntfs_vfsops.c
diff -u src/sys/fs/ntfs/ntfs_vfsops.c:1.107 src/sys/fs/ntfs/ntfs_vfsops.c:1.108
--- src/sys/fs/ntfs/ntfs_vfsops.c:1.107	Mon Apr 17 08:32:00 2017
+++ src/sys/fs/ntfs/ntfs_vfsops.c	Fri Oct 18 08:18:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntfs_vfsops.c,v 1.107 2017/04/17 08:32:00 hannken Exp $	*/
+/*	$NetBSD: ntfs_vfsops.c,v 1.108 2019/10/18 08:18:40 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.107 2017/04/17 08:32:00 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.108 2019/10/18 08:18:40 hannken Exp $");
 
 #include 
 #include 
@@ -322,6 +322,7 @@ ntfs_mountfs(struct vnode *devvp, struct
 	dev_t dev = devvp->v_rdev;
 	int error, i;
 	struct vnode *vp;
+	struct vnode_iterator *marker;
 
 	ntmp = NULL;
 
@@ -471,9 +472,13 @@ out1:
 		if (ntmp->ntm_sysvn[i])
 			vrele(ntmp->ntm_sysvn[i]);
 
-	if (vflush(mp, NULLVP, 0)) {
-		dprintf(("ntfs_mountfs: vflush failed\n"));
+	vfs_vnode_iterator_init(mp, &marker);
+	while ((vp = vfs_vnode_iterator_next(marker, NULL, NULL))) {
+		if (vrecycle(vp))
+			continue;
+		panic("%s: cannot recycle vnode %p", __func__, vp);
 	}
+	vfs_vnode_iterator_destroy(marker);
 out:
 	spec_node_setmountedfs(devvp, NULL);
 	if (bp)