Re: CVS commit: src/sys/arch/arm/iomd

2012-02-14 Thread David Brownlee
On 14 February 2012 21:09, Michael  wrote:
> Hello,
>
> On Tue, 14 Feb 2012 14:25:18 +
> Nick Hudson  wrote:
>
>> On Tuesday 14 February 2012 13:11:34 Izumi Tsutsui wrote:
>> > skrll@ wrote:
>> > > Module Name:      src
>> > > Committed By:     skrll
>> > > Date:             Tue Feb 14 13:04:52 UTC 2012
>> > >
>> > > Modified Files:
>> > >   src/sys/arch/arm/iomd: vidcvideo.c
>> > >
>> > > Log Message:
>> > > Pass RI_NO_AUTO to rasops_init so that rasops doesn't attempt to allocate
>> > > memory as we're too early in kernel startup for this.
>> >
>> > I always think we should make RI_NO_AUTO default and
>> > RI_AUTO should be optional, because too many MD drivers
>> > have been trapped by this silent panic...
>>
>> Can't argue with that.
>
> Yeah. I wish there was a way to know wether we can kmem_alloc() or not.

Surely it must be possible to be able to query the kmem subsystem for
whether its too soon for kmem_alloc()?


Re: CVS commit: src/sys/arch/arm/iomd

2012-02-14 Thread Michael
Hello,

On Tue, 14 Feb 2012 14:25:18 +
Nick Hudson  wrote:

> On Tuesday 14 February 2012 13:11:34 Izumi Tsutsui wrote:
> > skrll@ wrote:
> > > Module Name:  src
> > > Committed By: skrll
> > > Date: Tue Feb 14 13:04:52 UTC 2012
> > > 
> > > Modified Files:
> > >   src/sys/arch/arm/iomd: vidcvideo.c
> > > 
> > > Log Message:
> > > Pass RI_NO_AUTO to rasops_init so that rasops doesn't attempt to allocate
> > > memory as we're too early in kernel startup for this.
> > 
> > I always think we should make RI_NO_AUTO default and
> > RI_AUTO should be optional, because too many MD drivers
> > have been trapped by this silent panic...
> 
> Can't argue with that.

Yeah. I wish there was a way to know wether we can kmem_alloc() or not.

have fun
Michael


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

2012-02-14 Thread Paul Goyette

Log message has been updated in cvs:

Replace the xxx_acquire()/xxx_release() rwlocks with mutexes.  There are
only RW_WRITERs for these, and no RW_READERs, so no need to incur the
extra overhead of allowing for both.  As discussed on tech-kern.

For piixpm and ichsmb, the acquire/release protocol needs to be used, 
even if the request is I2C_F_POLL'd (or if the device supports only

polled mode).  Otherwise multiple requests can be running at the same
time, and they stomp on each other and create anomolous results.

Part 2 addresses my PR kern/45889

3 ACKs from releng



On Tue, 14 Feb 2012, Marc Balmer wrote:


Am 14.02.12 16:08, schrieb Paul Goyette:

Module Name:src
Committed By:   pgoyette
Date:   Tue Feb 14 15:08:07 UTC 2012

Modified Files:
src/sys/dev/pci: amdpm_smbus.c amdpmvar.h ichsmb.c nfsmb.c piixpm.c

Log Message:
/home/paul/COMMIT


could you please be a bit more verbose?




To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/amdpm_smbus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/amdpmvar.h
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ichsmb.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/nfsmb.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/piixpm.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/amdpm_smbus.c
diff -u src/sys/dev/pci/amdpm_smbus.c:1.17 src/sys/dev/pci/amdpm_smbus.c:1.18
--- src/sys/dev/pci/amdpm_smbus.c:1.17  Sat Nov 19 02:39:14 2011
+++ src/sys/dev/pci/amdpm_smbus.c   Tue Feb 14 15:08:07 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: amdpm_smbus.c,v 1.17 2011/11/19 02:39:14 christos Exp $ */
+/* $NetBSD: amdpm_smbus.c,v 1.18 2012/02/14 15:08:07 pgoyette Exp $ */

 /*
  * Copyright (c) 2005 Anil Gopinath (anil_pub...@yahoo.com)
@@ -32,14 +32,14 @@
  * AMD-8111 HyperTransport I/O Hub
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdpm_smbus.c,v 1.17 2011/11/19 02:39:14 christos Exp 
$");
+__KERNEL_RCSID(0, "$NetBSD: amdpm_smbus.c,v 1.18 2012/02/14 15:08:07 pgoyette Exp 
$");

 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
+#include 

 #include 
 #include 
@@ -83,7 +83,7 @@ amdpm_smbus_attach(struct amdpm_softc *s
sc->sc_i2c.ic_write_byte = NULL;
sc->sc_i2c.ic_exec = amdpm_smbus_exec;

-   rw_init(&sc->sc_rwlock);
+   mutex_init(&sc->sc_mutex, MUTEX_DEFAULT, IPL_NONE);

iba.iba_tag = &sc->sc_i2c;
(void)config_found_ia(&sc->sc_dev, "i2cbus", &iba, iicbus_print);
@@ -94,7 +94,7 @@ amdpm_smbus_acquire_bus(void *cookie, in
 {
struct amdpm_softc *sc = cookie;

-   rw_enter(&sc->sc_rwlock, RW_WRITER);
+   mutex_enter(&sc->sc_mutex);
return 0;
 }

@@ -103,7 +103,7 @@ amdpm_smbus_release_bus(void *cookie, in
 {
struct amdpm_softc *sc = cookie;

-   rw_exit(&sc->sc_rwlock);
+   mutex_exit(&sc->sc_mutex);
 }

 static int

Index: src/sys/dev/pci/amdpmvar.h
diff -u src/sys/dev/pci/amdpmvar.h:1.7 src/sys/dev/pci/amdpmvar.h:1.8
--- src/sys/dev/pci/amdpmvar.h:1.7  Sat Nov 19 22:51:23 2011
+++ src/sys/dev/pci/amdpmvar.h  Tue Feb 14 15:08:07 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: amdpmvar.h,v 1.7 2011/11/19 22:51:23 tls Exp $ */
+/* $NetBSD: amdpmvar.h,v 1.8 2012/02/14 15:08:07 pgoyette Exp $*/

 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #ifndef _DEV_PCI_AMDPMVAR_H_
 #define _DEV_PCI_AMDPMVAR_H_

-#include 
+#include 

 struct amdpm_softc {
struct device sc_dev;
@@ -47,7 +47,7 @@ struct amdpm_softc {

i2c_addr_t sc_smbus_slaveaddr;  /* address of smbus slave */
struct i2c_controller sc_i2c;   /* i2c controller info */
-   krwlock_t sc_rwlock;
+   kmutex_t sc_mutex;

void *sc_ih;


Index: src/sys/dev/pci/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.26 src/sys/dev/pci/ichsmb.c:1.27
--- src/sys/dev/pci/ichsmb.c:1.26   Mon Jan 30 19:41:19 2012
+++ src/sys/dev/pci/ichsmb.cTue Feb 14 15:08:07 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ichsmb.c,v 1.26 2012/01/30 19:41:19 drochner Exp $ */
+/* $NetBSD: ichsmb.c,v 1.27 2012/02/14 15:08:07 pgoyette Exp $ */
 /* $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */

 /*
@@ -22,13 +22,13 @@
  */

 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.26 2012/01/30 19:41:19 drochner Exp 
$");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.27 2012/02/14 15:08:07 pgoyette Exp 
$");

 #include 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 

 #include 
@@ -59,7 +59,7 @@ struct ichsmb_softc {
int sc_poll;

struct i2c_controller   sc_i2c_tag;
-   krwlock_t   sc_i2c_rwlock;
+   kmutex_tsc_i2c_mutex;
struct {
i2c_op_t op;
void *   buf;
@@ -166,7 +166,7 @@ ichsmb_attach(device_t parent, device_t
}

/* Attach I2C bus */
-   rw_init(&sc->sc_i2c_rwlock);
+

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

2012-02-14 Thread Marc Balmer
Am 14.02.12 16:08, schrieb Paul Goyette:
> Module Name:  src
> Committed By: pgoyette
> Date: Tue Feb 14 15:08:07 UTC 2012
> 
> Modified Files:
>   src/sys/dev/pci: amdpm_smbus.c amdpmvar.h ichsmb.c nfsmb.c piixpm.c
> 
> Log Message:
> /home/paul/COMMIT

could you please be a bit more verbose?

> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/amdpm_smbus.c
> cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/amdpmvar.h
> cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ichsmb.c
> cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/nfsmb.c
> cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/piixpm.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/amdpm_smbus.c
> diff -u src/sys/dev/pci/amdpm_smbus.c:1.17 src/sys/dev/pci/amdpm_smbus.c:1.18
> --- src/sys/dev/pci/amdpm_smbus.c:1.17Sat Nov 19 02:39:14 2011
> +++ src/sys/dev/pci/amdpm_smbus.c Tue Feb 14 15:08:07 2012
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: amdpm_smbus.c,v 1.17 2011/11/19 02:39:14 christos Exp $ */
> +/*   $NetBSD: amdpm_smbus.c,v 1.18 2012/02/14 15:08:07 pgoyette Exp $ */
>  
>  /*
>   * Copyright (c) 2005 Anil Gopinath (anil_pub...@yahoo.com)
> @@ -32,14 +32,14 @@
>   * AMD-8111 HyperTransport I/O Hub
>   */
>  #include 
> -__KERNEL_RCSID(0, "$NetBSD: amdpm_smbus.c,v 1.17 2011/11/19 02:39:14 
> christos Exp $");
> +__KERNEL_RCSID(0, "$NetBSD: amdpm_smbus.c,v 1.18 2012/02/14 15:08:07 
> pgoyette Exp $");
>  
>  #include 
>  #include 
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  
>  #include 
>  #include 
> @@ -83,7 +83,7 @@ amdpm_smbus_attach(struct amdpm_softc *s
>   sc->sc_i2c.ic_write_byte = NULL;
>   sc->sc_i2c.ic_exec = amdpm_smbus_exec;
>  
> - rw_init(&sc->sc_rwlock);
> + mutex_init(&sc->sc_mutex, MUTEX_DEFAULT, IPL_NONE);
>  
>   iba.iba_tag = &sc->sc_i2c;
>   (void)config_found_ia(&sc->sc_dev, "i2cbus", &iba, iicbus_print);
> @@ -94,7 +94,7 @@ amdpm_smbus_acquire_bus(void *cookie, in
>  {
>   struct amdpm_softc *sc = cookie;
>  
> - rw_enter(&sc->sc_rwlock, RW_WRITER);
> + mutex_enter(&sc->sc_mutex);
>   return 0;
>  }
>  
> @@ -103,7 +103,7 @@ amdpm_smbus_release_bus(void *cookie, in
>  {
>   struct amdpm_softc *sc = cookie;
>  
> - rw_exit(&sc->sc_rwlock);
> + mutex_exit(&sc->sc_mutex);
>  }
>  
>  static int
> 
> Index: src/sys/dev/pci/amdpmvar.h
> diff -u src/sys/dev/pci/amdpmvar.h:1.7 src/sys/dev/pci/amdpmvar.h:1.8
> --- src/sys/dev/pci/amdpmvar.h:1.7Sat Nov 19 22:51:23 2011
> +++ src/sys/dev/pci/amdpmvar.hTue Feb 14 15:08:07 2012
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: amdpmvar.h,v 1.7 2011/11/19 22:51:23 tls Exp $ */
> +/*   $NetBSD: amdpmvar.h,v 1.8 2012/02/14 15:08:07 pgoyette Exp $*/
>  
>  /*-
>   * Copyright (c) 2002 The NetBSD Foundation, Inc.
> @@ -32,7 +32,7 @@
>  #ifndef _DEV_PCI_AMDPMVAR_H_
>  #define _DEV_PCI_AMDPMVAR_H_
>  
> -#include 
> +#include 
>  
>  struct amdpm_softc {
>   struct device sc_dev;
> @@ -47,7 +47,7 @@ struct amdpm_softc {
>  
>   i2c_addr_t sc_smbus_slaveaddr;  /* address of smbus slave */
>   struct i2c_controller sc_i2c;   /* i2c controller info */
> - krwlock_t sc_rwlock;
> + kmutex_t sc_mutex;
>  
>   void *sc_ih;
>  
> 
> Index: src/sys/dev/pci/ichsmb.c
> diff -u src/sys/dev/pci/ichsmb.c:1.26 src/sys/dev/pci/ichsmb.c:1.27
> --- src/sys/dev/pci/ichsmb.c:1.26 Mon Jan 30 19:41:19 2012
> +++ src/sys/dev/pci/ichsmb.c  Tue Feb 14 15:08:07 2012
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: ichsmb.c,v 1.26 2012/01/30 19:41:19 drochner Exp $ */
> +/*   $NetBSD: ichsmb.c,v 1.27 2012/02/14 15:08:07 pgoyette Exp $ */
>  /*   $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */
>  
>  /*
> @@ -22,13 +22,13 @@
>   */
>  
>  #include 
> -__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.26 2012/01/30 19:41:19 drochner Exp 
> $");
> +__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.27 2012/02/14 15:08:07 pgoyette Exp 
> $");
>  
>  #include 
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  
>  #include 
> @@ -59,7 +59,7 @@ struct ichsmb_softc {
>   int sc_poll;
>  
>   struct i2c_controller   sc_i2c_tag;
> - krwlock_t   sc_i2c_rwlock;
> + kmutex_tsc_i2c_mutex;
>   struct {
>   i2c_op_t op;
>   void *   buf;
> @@ -166,7 +166,7 @@ ichsmb_attach(device_t parent, device_t 
>   }
>  
>   /* Attach I2C bus */
> - rw_init(&sc->sc_i2c_rwlock);
> + mutex_init(&sc->sc_i2c_mutex, MUTEX_DEFAULT, IPL_NONE);
>   sc->sc_i2c_tag.ic_cookie = sc;
>   sc->sc_i2c_tag.ic_acquire_bus = ichsmb_i2c_acquire_bus;
>   sc->sc_i2c_tag.ic_release_bus = ichsmb_i2c_release_bus;
> @@ -186,10 +186,10 @@ ichsmb_i2c_acquire_bus(void *cookie, int
>  {
>   struct ichsmb_softc *sc = cookie;
>  
> - if (cold || sc->sc

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

2012-02-14 Thread Paul Goyette

Ooops - I will fix the log message shortly.

On Tue, 14 Feb 2012, Paul Goyette wrote:


Module Name:src
Committed By:   pgoyette
Date:   Tue Feb 14 15:08:07 UTC 2012

Modified Files:
src/sys/dev/pci: amdpm_smbus.c amdpmvar.h ichsmb.c nfsmb.c piixpm.c

Log Message:
/home/paul/COMMIT


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/amdpm_smbus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/amdpmvar.h
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ichsmb.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/nfsmb.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/piixpm.c

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


!DSPAM:4f3a78f52061782010291!





-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-


Re: CVS commit: src/sys/arch/arm/iomd

2012-02-14 Thread Nick Hudson
On Tuesday 14 February 2012 13:11:34 Izumi Tsutsui wrote:
> skrll@ wrote:
> > Module Name:src
> > Committed By:   skrll
> > Date:   Tue Feb 14 13:04:52 UTC 2012
> > 
> > Modified Files:
> > src/sys/arch/arm/iomd: vidcvideo.c
> > 
> > Log Message:
> > Pass RI_NO_AUTO to rasops_init so that rasops doesn't attempt to allocate
> > memory as we're too early in kernel startup for this.
> 
> I always think we should make RI_NO_AUTO default and
> RI_AUTO should be optional, because too many MD drivers
> have been trapped by this silent panic...

Can't argue with that.

> 
> ---
> Izumi Tsutsui

Nick


Re: CVS commit: src/sys/arch/arm/iomd

2012-02-14 Thread Izumi Tsutsui
skrll@ wrote:

> Module Name:  src
> Committed By: skrll
> Date: Tue Feb 14 13:04:52 UTC 2012
> 
> Modified Files:
>   src/sys/arch/arm/iomd: vidcvideo.c
> 
> Log Message:
> Pass RI_NO_AUTO to rasops_init so that rasops doesn't attempt to allocate
> memory as we're too early in kernel startup for this.

I always think we should make RI_NO_AUTO default and
RI_AUTO should be optional, because too many MD drivers
have been trapped by this silent panic...

---
Izumi Tsutsui