CVS commit: src/sys/dev/ieee1394

2019-09-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 06:56:20 UTC 2019

Modified Files:
src/sys/dev/ieee1394: sbp.c

Log Message:
Remove unused assignment. Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ieee1394/sbp.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/ieee1394

2019-09-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 06:56:20 UTC 2019

Modified Files:
src/sys/dev/ieee1394: sbp.c

Log Message:
Remove unused assignment. Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ieee1394/sbp.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/ieee1394/sbp.c
diff -u src/sys/dev/ieee1394/sbp.c:1.37 src/sys/dev/ieee1394/sbp.c:1.38
--- src/sys/dev/ieee1394/sbp.c:1.37	Mon Sep  3 16:29:31 2018
+++ src/sys/dev/ieee1394/sbp.c	Mon Sep 23 06:56:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbp.c,v 1.37 2018/09/03 16:29:31 riastradh Exp $	*/
+/*	$NetBSD: sbp.c,v 1.38 2019/09/23 06:56:20 maxv Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbp.c,v 1.37 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbp.c,v 1.38 2019/09/23 06:56:20 maxv Exp $");
 
 
 #include 
@@ -2052,7 +2052,6 @@ sbp_free_sdev(struct sbp_dev *sdev)
 		bus_dmamap_destroy(sc->sc_dmat, sdev->ocb[i].dmamap);
 	fwdma_free(sdev->dma.dma_tag, sdev->dma.dma_map, sdev->dma.v_addr);
 	free(sdev, M_SBP);
-	sdev = NULL;
 }
 
 static void



CVS commit: src/sys/dev/ieee1394

2019-10-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 15 18:21:47 UTC 2019

Modified Files:
src/sys/dev/ieee1394: firewire.c fwohci.c fwohcireg.h

Log Message:
 Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/ieee1394/firewire.c
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/ieee1394/fwohci.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ieee1394/fwohcireg.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/ieee1394/firewire.c
diff -u src/sys/dev/ieee1394/firewire.c:1.48 src/sys/dev/ieee1394/firewire.c:1.49
--- src/sys/dev/ieee1394/firewire.c:1.48	Mon Sep  3 16:29:31 2018
+++ src/sys/dev/ieee1394/firewire.c	Tue Oct 15 18:21:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: firewire.c,v 1.48 2018/09/03 16:29:31 riastradh Exp $	*/
+/*	$NetBSD: firewire.c,v 1.49 2019/10/15 18:21:47 msaitoh Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.48 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.49 2019/10/15 18:21:47 msaitoh Exp $");
 
 #include 
 #include 
@@ -1407,12 +1407,12 @@ fw_reset_csr(struct firewire_comm *fc)
 	CSRARC(fc, BANDWIDTH_AV) = 4915;
 	CSRARC(fc, CHANNELS_AV_HI) = 0x;
 	CSRARC(fc, CHANNELS_AV_LO) = 0x;
-	CSRARC(fc, IP_CHANNELS) = (1 << 31);
+	CSRARC(fc, IP_CHANNELS) = (1U << 31);
 
 	CSRARC(fc, CONF_ROM) = 0x04 << 24;
 	CSRARC(fc, CONF_ROM + 4) = 0x31333934; /* means strings 1394 */
 	CSRARC(fc, CONF_ROM + 8) =
-	1 << 31 | 1 << 30 | 1 << 29 | 1 << 28 | 0xff << 16 | 0x09 << 8;
+	1U << 31 | 1 << 30 | 1 << 29 | 1 << 28 | 0xff << 16 | 0x09 << 8;
 	CSRARC(fc, CONF_ROM + 0xc) = 0;
 
 /* DV depend CSRs see blue book */

Index: src/sys/dev/ieee1394/fwohci.c
diff -u src/sys/dev/ieee1394/fwohci.c:1.142 src/sys/dev/ieee1394/fwohci.c:1.143
--- src/sys/dev/ieee1394/fwohci.c:1.142	Tue May 28 08:59:34 2019
+++ src/sys/dev/ieee1394/fwohci.c	Tue Oct 15 18:21:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci.c,v 1.142 2019/05/28 08:59:34 msaitoh Exp $	*/
+/*	$NetBSD: fwohci.c,v 1.143 2019/10/15 18:21:47 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.142 2019/05/28 08:59:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.143 2019/10/15 18:21:47 msaitoh Exp $");
 
 #include 
 #include 
@@ -224,7 +224,7 @@ static void fwohci_arcv(struct fwohci_so
 #define	OHCI_ATRETRY		0x008
 #define	OHCI_CROMHDR		0x018
 #define	OHCI_BUS_OPT		0x020
-#define	OHCI_BUSIRMC		(1 << 31)
+#define	OHCI_BUSIRMC		(1U << 31)
 #define	OHCI_BUSCMC		(1 << 30)
 #define	OHCI_BUSISC		(1 << 29)
 #define	OHCI_BUSBMC		(1 << 28)
@@ -250,7 +250,7 @@ static void fwohci_arcv(struct fwohci_so
 
 #define	OHCI_SID_BUF		0x064
 #define	OHCI_SID_CNT		0x068
-#define OHCI_SID_ERR		(1 << 31)
+#define OHCI_SID_ERR		(1U << 31)
 #define OHCI_SID_CNT_MASK	0xffc
 
 #define	OHCI_IT_STAT		0x090
@@ -752,7 +752,7 @@ fwohci_set_bus_manager(struct firewire_c
 	OWRITE(sc, OHCI_CSR_DATA, node);
 	OWRITE(sc, OHCI_CSR_COMP, 0x3f);
 	OWRITE(sc, OHCI_CSR_CONT, OHCI_BUS_MANAGER_ID);
- 	for (i = 0; !(OREAD(sc, OHCI_CSR_CONT) & (1<<31)) && (i < 1000); i++)
+ 	for (i = 0; !(OREAD(sc, OHCI_CSR_CONT) & (1U <<31)) && (i < 1000); i++)
 		DELAY(10);
 	bm = OREAD(sc, OHCI_CSR_DATA);
 	if ((bm & 0x3f) == 0x3f)
@@ -1296,7 +1296,7 @@ fwohci_reset(struct fwohci_softc *sc)
 	/* AT Retries */
 	OWRITE(sc, FWOHCI_RETRY,
 	/* CycleLimit   PhyRespRetries ATRespRetries ATReqRetries */
-	(0x << 16) | (0x0f << 8) | (0x0f << 4) | 0x0f);
+	(0xU << 16) | (0x0f << 8) | (0x0f << 4) | 0x0f);
 
 	sc->atrq.top = STAILQ_FIRST(&sc->atrq.db_trq);
 	sc->atrs.top = STAILQ_FIRST(&sc->atrs.db_trq);
@@ -2013,7 +2013,7 @@ fwohci_intr_core(struct fwohci_softc *sc
 		OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_PHY_BUS_R);
 
 		/* Allow async. request to us */
-		OWRITE(sc, OHCI_AREQHI, 1 << 31);
+		OWRITE(sc, OHCI_AREQHI, 1U << 31);
 		if (firewire_phydma_enable) {
 			/* allow from all nodes */
 			OWRITE(sc, OHCI_PREQHI, 0x7fff);

Index: src/sys/dev/ieee1394/fwohcireg.h
diff -u src/sys/dev/ieee1394/fwohcireg.h:1.19 src/sys/dev/ieee1394/fwohcireg.h:1.20
--- src/sys/dev/ieee1394/fwohcireg.h:1.19	Sat Mar 31 14:50:45 2018
+++ src/sys/dev/ieee1394/fwohcireg.h	Tue Oct 15 18:21:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohcireg.h,v 1.19 2018/03/31 14:50:45 sevan Exp $	*/
+/*	$NetBSD: fwohcireg.h,v 1.20 2019/10/15 18:21:47 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -285,13 +285,13 @@ struct ohci_registers {
 	fwohcireg_t	link_cntl_clr;	/* Chip control clear 0xe4*/
 #define FWOHCI_NODEID	0xe8
 	fwohcireg_t	node;		/* Node ID 0xe8 */
-#define	OHCI_NODE_VALID	(1 << 31)
+#define	OHCI_NODE_VALID	(1U <

CVS commit: src/sys/dev/ieee1394

2019-10-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 15 18:21:47 UTC 2019

Modified Files:
src/sys/dev/ieee1394: firewire.c fwohci.c fwohcireg.h

Log Message:
 Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/ieee1394/firewire.c
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/ieee1394/fwohci.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ieee1394/fwohcireg.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/ieee1394

2021-12-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Dec 20 19:56:42 UTC 2021

Modified Files:
src/sys/dev/ieee1394: firewire.c

Log Message:
ieee1394: Need kernel lock around config_found.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/ieee1394/firewire.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/ieee1394/firewire.c
diff -u src/sys/dev/ieee1394/firewire.c:1.53 src/sys/dev/ieee1394/firewire.c:1.54
--- src/sys/dev/ieee1394/firewire.c:1.53	Mon Oct  4 20:48:05 2021
+++ src/sys/dev/ieee1394/firewire.c	Mon Dec 20 19:56:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: firewire.c,v 1.53 2021/10/04 20:48:05 andvar Exp $	*/
+/*	$NetBSD: firewire.c,v 1.54 2021/12/20 19:56:42 riastradh Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.53 2021/10/04 20:48:05 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.54 2021/12/20 19:56:42 riastradh Exp $");
 
 #include 
 #include 
@@ -2041,9 +2041,11 @@ fw_attach_dev(struct firewire_comm *fc)
 
 			fwa.name = fw_get_devclass(fwdev);
 			fwa.fwdev = fwdev;
+			KERNEL_LOCK(1, NULL);
 			fwdev->dev = config_found(sc->dev, &fwa, firewire_print,
 			CFARGS(.submatch = config_stdsubmatch,
    .locators = locs));
+			KERNEL_UNLOCK_ONE(NULL);
 			if (fwdev->dev == NULL) {
 free(devlist, M_DEVBUF);
 break;



CVS commit: src/sys/dev/ieee1394

2021-12-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Dec 20 19:56:42 UTC 2021

Modified Files:
src/sys/dev/ieee1394: firewire.c

Log Message:
ieee1394: Need kernel lock around config_found.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/ieee1394/firewire.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/ieee1394

2021-11-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 10 16:08:17 UTC 2021

Modified Files:
src/sys/dev/ieee1394: fwdev.c

Log Message:
s/avaliable/available/


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ieee1394/fwdev.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/ieee1394/fwdev.c
diff -u src/sys/dev/ieee1394/fwdev.c:1.32 src/sys/dev/ieee1394/fwdev.c:1.33
--- src/sys/dev/ieee1394/fwdev.c:1.32	Sun Jun 25 12:39:27 2017
+++ src/sys/dev/ieee1394/fwdev.c	Wed Nov 10 16:08:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwdev.c,v 1.32 2017/06/25 12:39:27 maxv Exp $	*/
+/*	$NetBSD: fwdev.c,v 1.33 2021/11/10 16:08:17 msaitoh Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.32 2017/06/25 12:39:27 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.33 2021/11/10 16:08:17 msaitoh Exp $");
 
 #include 
 #include 
@@ -264,7 +264,7 @@ readloop:
 		}
 	}
 	if (ir->stproc == NULL) {
-		/* no data avaliable */
+		/* no data available */
 		if (slept == 0) {
 			slept = 1;
 			ir->flag |= FWXFERQ_WAKEUP;



CVS commit: src/sys/dev/ieee1394

2021-11-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 10 16:08:17 UTC 2021

Modified Files:
src/sys/dev/ieee1394: fwdev.c

Log Message:
s/avaliable/available/


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ieee1394/fwdev.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/ieee1394

2021-12-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 08:17:21 UTC 2021

Modified Files:
src/sys/dev/ieee1394: fwohci.c

Log Message:
s/transcat/transact/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/dev/ieee1394/fwohci.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/ieee1394

2021-12-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 08:17:21 UTC 2021

Modified Files:
src/sys/dev/ieee1394: fwohci.c

Log Message:
s/transcat/transact/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/dev/ieee1394/fwohci.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/ieee1394/fwohci.c
diff -u src/sys/dev/ieee1394/fwohci.c:1.148 src/sys/dev/ieee1394/fwohci.c:1.149
--- src/sys/dev/ieee1394/fwohci.c:1.148	Sat Aug 21 11:55:25 2021
+++ src/sys/dev/ieee1394/fwohci.c	Sun Dec  5 08:17:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci.c,v 1.148 2021/08/21 11:55:25 andvar Exp $	*/
+/*	$NetBSD: fwohci.c,v 1.149 2021/12/05 08:17:21 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.148 2021/08/21 11:55:25 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.149 2021/12/05 08:17:21 msaitoh Exp $");
 
 #include 
 #include 
@@ -1670,7 +1670,7 @@ fwohci_txd(struct fwohci_softc *sc, stru
 			mutex_enter(&dbch->xferq.q_mtx);
 			/*
 			 * The watchdog timer takes care of split
-			 * transcation timeout for ACKPEND case.
+			 * transaction timeout for ACKPEND case.
 			 */
 		} else
 			aprint_error_dev(fc->dev, "this shouldn't happen\n");



CVS commit: src/sys/dev/ieee1394

2022-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Aug 20 19:01:32 UTC 2022

Modified Files:
src/sys/dev/ieee1394: if_fwip.c

Log Message:
fwip_async_output(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ieee1394/if_fwip.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/ieee1394/if_fwip.c
diff -u src/sys/dev/ieee1394/if_fwip.c:1.30 src/sys/dev/ieee1394/if_fwip.c:1.31
--- src/sys/dev/ieee1394/if_fwip.c:1.30	Wed Jan 29 06:19:39 2020
+++ src/sys/dev/ieee1394/if_fwip.c	Sat Aug 20 19:01:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_fwip.c,v 1.30 2020/01/29 06:19:39 thorpej Exp $	*/
+/*	$NetBSD: if_fwip.c,v 1.31 2022/08/20 19:01:31 thorpej Exp $	*/
 /*-
  * Copyright (c) 2004
  *	Doug Rabson
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.30 2020/01/29 06:19:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.31 2022/08/20 19:01:31 thorpej Exp $");
 
 #include 
 #include 
@@ -552,7 +552,7 @@ fwip_async_output(struct fwip_softc *sc,
 #endif
 			break;
 		}
-		IF_DEQUEUE(&ifp->if_snd, m);
+		IF_POLL(&ifp->if_snd, m);
 		if (m == NULL) {
 			mutex_exit(&sc->sc_mtx);
 			break;
@@ -663,9 +663,9 @@ fwip_async_output(struct fwip_softc *sc,
 			mutex_enter(&sc->sc_mtx);
 			STAILQ_INSERT_TAIL(&sc->sc_xferlist, xfer, link);
 			mutex_exit(&sc->sc_mtx);
-			IF_PREPEND(&ifp->if_snd, m);
 			break;
 		}
+		IF_DEQUEUE(&ifp->if_snd, m);
 		if (error) {
 			/* error */
 			if_statinc(ifp, if_oerrors);



CVS commit: src/sys/dev/ieee1394

2022-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Aug 20 19:01:32 UTC 2022

Modified Files:
src/sys/dev/ieee1394: if_fwip.c

Log Message:
fwip_async_output(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ieee1394/if_fwip.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/ieee1394

2010-04-29 Thread Adam Hoka
On Thu, 29 Apr 2010 06:56:00 +
KIYOHARA Takashi  wrote:

> Module Name:  src
> Committed By: kiyohara
> Date: Thu Apr 29 06:56:00 UTC 2010
> 
> Modified Files:
>   src/sys/dev/ieee1394: fwdma.c
> 
> Log Message:
> Call malloc(M_ZERO) instead of malloc() and memset().

Why not kmem_zalloc()?


-- 
NetBSD - Simplicity is prerequisite for reliability


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

2010-04-29 Thread KIYOHARA Takashi
Hi!


From: Adam Hoka 
Date: Thu, 29 Apr 2010 09:38:31 +0200

> On Thu, 29 Apr 2010 06:56:00 +
> KIYOHARA Takashi  wrote:
> 
> > Module Name:src
> > Committed By:   kiyohara
> > Date:   Thu Apr 29 06:56:00 UTC 2010
> > 
> > Modified Files:
> > src/sys/dev/ieee1394: fwdma.c
> > 
> > Log Message:
> > Call malloc(M_ZERO) instead of malloc() and memset().
> 
> Why not kmem_zalloc()?

Oops, I learnt kmem(9) just now.
Also malloc(9) says 'These interfaces are being obsoleted and their new
use is discouraged.' in man-page.

Please wait a few days.  ;-)

Thanks,
--
kiyohara


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

2010-05-23 Thread KIYOHARA Takashi
Hi! Christos,


From: Christos Zoulas 
Date: Sun, 23 May 2010 14:56:59 -0400

> Module Name:  src
> Committed By: christos
> Date: Sun May 23 18:56:59 UTC 2010
> 
> Modified Files:
>   src/sys/dev/ieee1394: firewire.c firewirereg.h fwdev.c fwdma.c fwmem.c
>   fwohci.c fwohcivar.h if_fwip.c sbp.c
> 
> Log Message:
> Revert all previous kmem_ commits. This needs to be done in a different way
> because we cannot call kmem_ from an interrupt context. I opened PR/43341 for
> it.

Why you revert it all?
I had been investigating the problem of kmem since last week.  Was not
I reading the message from you?

Thanks,
--
kiyohara


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

2010-05-24 Thread Christos Zoulas
On May 24,  2:23pm, kiyoh...@kk.iij4u.or.jp (KIYOHARA Takashi) wrote:
-- Subject: Re: CVS commit: src/sys/dev/ieee1394

| Hi! Christos,
| 
| 
| From: Christos Zoulas 
| Date: Sun, 23 May 2010 14:56:59 -0400
| 
| > Module Name:src
| > Committed By:   christos
| > Date:   Sun May 23 18:56:59 UTC 2010
| > 
| > Modified Files:
| > src/sys/dev/ieee1394: firewire.c firewirereg.h fwdev.c fwdma.c fwmem.c
| > fwohci.c fwohcivar.h if_fwip.c sbp.c
| > 
| > Log Message:
| > Revert all previous kmem_ commits. This needs to be done in a different way
| > because we cannot call kmem_ from an interrupt context. I opened PR/43341 
for
| > it.
| 
| Why you revert it all?
| I had been investigating the problem of kmem since last week.  Was not
| I reading the message from you?

It is all in CVS, none of the changes are lost so I don't see the
problem.  If you sent mail saying that you were working on it and
when you expected to have it fixed, sorry I missed it. The code
has been broken since the 15th, so I thought I should do something.

christos


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

2010-05-24 Thread Izumi Tsutsui
> Why you revert it all?

Wasn't it broken?

> I had been investigating the problem of kmem since last week.  Was not

There is no reason to leave kernels broken even if
you have some idea for proper fixes.
You can put them even after you (or other guys) revert
the previous changes, can't you?
---
Izumi Tsutsui


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

2010-05-24 Thread KIYOHARA Takashi
Hi!


From: Izumi Tsutsui 
Date: Mon, 24 May 2010 22:08:21 +0900

> > Why you revert it all?
> 
> Wasn't it broken?

Yes. It knows I was broken, too. However, it worked on my ofppc and
it booted my amd64.


> > I had been investigating the problem of kmem since last week.  Was not
> 
> There is no reason to leave kernels broken even if
> you have some idea for proper fixes.

In many cases, there is a case that cannot be fixed in several days.  For
instance, MIPS cannot be booted since merge mips64.

Thanks,
--
kiyohara


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

2010-05-24 Thread Izumi Tsutsui
> In many cases, there is a case that cannot be fixed in several days.  For

In any case you should revert your changes first
if you know you broke the tree and you can't fix it soon.
---
Izumi Tsutsui


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

2010-05-24 Thread Christos Zoulas
On May 24, 10:32pm, kiyoh...@kk.iij4u.or.jp (KIYOHARA Takashi) wrote:
-- Subject: Re: CVS commit: src/sys/dev/ieee1394

| Hi!
| 
| 
| From: Izumi Tsutsui 
| Date: Mon, 24 May 2010 22:08:21 +0900
| 
| > > Why you revert it all?
| > 
| > Wasn't it broken?
| 
| Yes. It knows I was broken, too. However, it worked on my ofppc and
| it booted my amd64.

Try booting with DIAGNOSTIC. If you make any changes to the kernel you should
be really compiling with DIAGNOSTIC.

| > > I had been investigating the problem of kmem since last week.  Was not
| > 
| > There is no reason to leave kernels broken even if
| > you have some idea for proper fixes.
| 
| In many cases, there is a case that cannot be fixed in several days.  For
| instance, MIPS cannot be booted since merge mips64.

This is not also not acceptable it has pissed off everyone owning a MIPS box
who cannot boot current. If I had a MIPS box and could test this, I would
have reverted the MIPS changes too. (Hi Matt!).

I just want to highlight that this is not personal and it does not matter
who makes the changes. If you break HEAD and you leave it broken for days,
without communicating status, consider your changes a candidate for backout.

I want to also stress that I tried to fix the firewire code; I fixed two
issues already, and then I saw that it would require a lot of reworking
to fix the xfer code. I filed a PR, and I backed out the changes because
in my judgement there is no quick and easy fix for it. Prove me wrong
and commit today or tomorrow a change that works.

christos


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

2010-05-25 Thread Jun Ebihara
Hello Christos!

From: chris...@zoulas.com (Christos Zoulas)
Subject: Re: CVS commit: src/sys/dev/ieee1394
Date: Mon, 24 May 2010 10:36:49 -0400

> | In many cases, there is a case that cannot be fixed in several days.  For
> | instance, MIPS cannot be booted since merge mips64.
> This is not also not acceptable it has pissed off everyone owning a MIPS box
> who cannot boot current. If I had a MIPS box and could test this, I would
> have reverted the MIPS changes too. (Hi Matt!).

You can test with gxemul.

cd /usr/pkgsrc/emulators/gxemul
make package
gxemul -e mobilepro770 -X -M 512 hpcmipskernel/netbsd20091130  ... boot OK
gxemul -e mobilepro770 -X -M 512 hpcmipskernel/netbsd20091231  ... boot FAIL

see more information;
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=42934

--
jun ebihara


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

2010-05-25 Thread Christos Zoulas
On May 25,  4:33pm, j...@soum.co.jp (Jun Ebihara) wrote:
-- Subject: Re: CVS commit: src/sys/dev/ieee1394

| Hello Christos!
| 
| From: chris...@zoulas.com (Christos Zoulas)
| Subject: Re: CVS commit: src/sys/dev/ieee1394
| Date: Mon, 24 May 2010 10:36:49 -0400
| 
| > | In many cases, there is a case that cannot be fixed in several days.  For
| > | instance, MIPS cannot be booted since merge mips64.
| > This is not also not acceptable it has pissed off everyone owning a MIPS box
| > who cannot boot current. If I had a MIPS box and could test this, I would
| > have reverted the MIPS changes too. (Hi Matt!).
| 
| You can test with gxemul.
| 
| cd /usr/pkgsrc/emulators/gxemul
| make package
| gxemul -e mobilepro770 -X -M 512 hpcmipskernel/netbsd20091130  ... boot OK
| gxemul -e mobilepro770 -X -M 512 hpcmipskernel/netbsd20091231  ... boot FAIL
| 
| see more information;
| http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=42934

Good idea!

christos


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

2010-05-25 Thread Mindaugas Rasiukevicius
chris...@zoulas.com (Christos Zoulas) wrote:
> | Yes. It knows I was broken, too. However, it worked on my ofppc and
> | it booted my amd64.
> 
> Try booting with DIAGNOSTIC. If you make any changes to the kernel you
> should be really compiling with DIAGNOSTIC.

It should be tested both with DEBUG and DIAGNOSTIC enabled.  If involves
locking, then also LOCKDEBUG.

-- 
Mindaugas


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

2010-08-26 Thread Mindaugas Rasiukevicius
> Module Name:src
> Committed By:   cegger
> Date:   Thu Aug 26 12:48:19 UTC 2010
> 
> Modified Files:
> src/sys/dev/ieee1394: fwdev.c
> 
> Log Message:
> don't call tsleep() with any mutexes hold
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ieee1394/fwdev.c

The right fix would be to use condvar(9).  Generally, tsleep(9) should
be replaced and removed in the longer term.

-- 
Mindaugas


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

2010-08-30 Thread Christoph Egger
On 26.08.10 16:31, Mindaugas Rasiukevicius wrote:
>> Module Name:src
>> Committed By:   cegger
>> Date:   Thu Aug 26 12:48:19 UTC 2010
>>
>> Modified Files:
>> src/sys/dev/ieee1394: fwdev.c
>>
>> Log Message:
>> don't call tsleep() with any mutexes hold
>>
>>
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ieee1394/fwdev.c
> 
> The right fix would be to use condvar(9).  Generally, tsleep(9) should
> be replaced and removed in the longer term.

Sure. Two questions hold me back from doing this:
1. Which cv_*wait* variant should be used?
2. Where should I add the corresponding cv_signal/cv_broadcast ?

Is it possible to have an conversion example in the tsleep(9) manpage?

Christoph


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

2010-08-31 Thread Adam Hoka
On Tue, 31 Aug 2010 08:31:27 +0200
Christoph Egger  wrote:

> On 26.08.10 16:31, Mindaugas Rasiukevicius wrote:
> >> Module Name:src
> >> Committed By:   cegger
> >> Date:   Thu Aug 26 12:48:19 UTC 2010
> >>
> >> Modified Files:
> >> src/sys/dev/ieee1394: fwdev.c
> >>
> >> Log Message:
> >> don't call tsleep() with any mutexes hold
> >>
> >>
> >> To generate a diff of this commit:
> >> cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ieee1394/fwdev.c
> > 
> > The right fix would be to use condvar(9).  Generally, tsleep(9) should
> > be replaced and removed in the longer term.
> 
> Sure. Two questions hold me back from doing this:
> 1. Which cv_*wait* variant should be used?

I used cv_wait_sig when porting a piece of code from tsleep,
but it dpends on what do you want to do. (cv_timedwait(,_sig) if you
want timeout)

> 2. Where should I add the corresponding cv_signal/cv_broadcast ?

where the wakeup(9) was, if theres no need to signal, use kpause(9).

> Is it possible to have an conversion example in the tsleep(9) manpage?
> 
> Christoph

ps.: someone correct me if i wrote something stupid :)

-- 
NetBSD - Simplicity is prerequisite for reliability


Converting to condvar(9) [Was: Re: CVS commit: src/sys/dev/ieee1394]

2010-09-05 Thread Mindaugas Rasiukevicius
Christoph Egger  wrote:
> >> Log Message:
> >> don't call tsleep() with any mutexes hold
> >>
> >>
> >> To generate a diff of this commit:
> >> cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ieee1394/fwdev.c
> > 
> > The right fix would be to use condvar(9).  Generally, tsleep(9) should
> > be replaced and removed in the longer term.
> 
> Sure. Two questions hold me back from doing this:
> 1. Which cv_*wait* variant should be used?
> 2. Where should I add the corresponding cv_signal/cv_broadcast ?
> 
> Is it possible to have an conversion example in the tsleep(9) manpage?

OK, some notes.  The ltsleep(9)/tsleep(9)/mtsleep(9) and wakeup(9) pairs
should generally be replaced by cv_wait*(9) and cv_broadcast(9) pairs, as
the former API is obsolete.

It depends which cv_wait*(9) variant to use.  Simplistic way - look at the
corresponding ltsleep(9) usage.  There are two arguments of interest: timo
and priority.  The priority value may have ORed such flags: PNORELOCK and
PCATCH.  The PCATCH means that blocking thread should be awoken on signal,
which would be done by cv_wait_sig(9).  The timo value, if it is not zero,
indicates how long to sleep - replace it with cv_timedwait(9).  If both
specified, there is cv_timedwait_sig(9), and if none - there is cv_wait(9).
Interlock (mutex) must be held across cv_wait*/cv_broadcast calls, in order
to protect our state. Which means that some old code might require amending
(to remove PNORELOCK or replace simple_lock(9) use) or addition of locking.

That is "simplistic", because converting should not be done mechanically
i.e. "blindly".  Code logic should be understood before changing, and it
may also need to be revisited for the change.  Please also read condvar(9)
and ltsleep(9) manual pages - all the details are well described there.

-- 
Mindaugas