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

2018-06-07 Thread maya
You've changed a default and selectively fixed the one driver that
people noticed breaks from it. How do you know the rest aren't broken?

On Thu, Jun 07, 2018 at 01:35:31PM +, Jason R Thorpe wrote:
> Module Name:  src
> Committed By: thorpej
> Date: Thu Jun  7 13:35:31 UTC 2018
> 
> Modified Files:
>   src/sys/arch/x86/x86: x86_autoconf.c
> 
> Log Message:
> In device_register(), if the device is an "iic" child of "imcsmb",
> attach a I2C_PROP_INDIRECT_DEVICE_WHITELIST property that limits
> the allowed devices to "spdmem" and "sdtemp".  Also set the
> I2C_PROP_INDIRECT_PROBE_STRATEGY property to I2C_PROBE_STRATEGY_NONE,
> since that controller can't issue any of the "quick" commands.
> 
> XXX It would be nice to be able to do this in the imcsmb driver
> itself, but the way autoconfiguration works makes that infeasible.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.76 -r1.77 src/sys/arch/x86/x86/x86_autoconf.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/x86_autoconf.c
> diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.76 
> src/sys/arch/x86/x86/x86_autoconf.c:1.77
> --- src/sys/arch/x86/x86/x86_autoconf.c:1.76  Thu Nov  9 01:02:56 2017
> +++ src/sys/arch/x86/x86/x86_autoconf.c   Thu Jun  7 13:35:31 2018
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: x86_autoconf.c,v 1.76 2017/11/09 01:02:56 christos Exp $   
> */
> +/*   $NetBSD: x86_autoconf.c,v 1.77 2018/06/07 13:35:31 thorpej Exp $
> */
>  
>  /*-
>   * Copyright (c) 1990 The Regents of the University of California.
> @@ -35,7 +35,7 @@
>   */
>  
>  #include 
> -__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.76 2017/11/09 01:02:56 
> christos Exp $");
> +__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.77 2018/06/07 13:35:31 
> thorpej Exp $");
>  
>  #include 
>  #include 
> @@ -54,6 +54,8 @@ __KERNEL_RCSID(0, "$NetBSD: x86_autoconf
>  #include 
>  #include 
>  
> +#include 
> +
>  #include "acpica.h"
>  #include "wsdisplay.h"
>  
> @@ -547,6 +549,36 @@ device_register(device_t dev, void *aux)
>  {
>   device_t isaboot, pciboot;
>  
> + /*
> +  * The Intel Integrated Memory Controller has a built-in i2c
> +  * controller that's rather limited in capability; it is intended
> +  * only for reading memory module EERPOMs and sensors.
> +  */
> + if (device_is_a(dev, "iic") &&
> + device_is_a(dev->dv_parent, "imcsmb")) {
> + static const char *imcsmb_device_whitelist[] = {
> + "spdmem",
> + "sdtemp",
> + NULL,
> + };
> + prop_array_t whitelist = prop_array_create();
> + prop_dictionary_t props = device_properties(dev);
> + int i;
> +
> + for (i = 0; imcsmb_device_whitelist[i] != NULL; i++) {
> + prop_string_t pstr = prop_string_create_cstring_nocopy(
> + imcsmb_device_whitelist[i]);
> + (void) prop_array_add(whitelist, pstr);
> + prop_object_release(pstr);
> + }
> + (void) prop_dictionary_set(props,
> +I2C_PROP_INDIRECT_DEVICE_WHITELIST,
> +whitelist);
> + (void) prop_dictionary_set_cstring_nocopy(props,
> +I2C_PROP_INDIRECT_PROBE_STRATEGY,
> +I2C_PROBE_STRATEGY_NONE);
> + }
> +
>   device_acpi_register(dev, aux);
>  
>   isaboot = device_isa_register(dev, aux);
> 



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

2018-06-07 Thread Jason Thorpe



> On Jun 7, 2018, at 5:14 AM, Jonathan A. Kollasch  
> wrote:
> 
> I don't disagree.  That said, making use of this hardware design did not
> seem the most straightforward to me.  If you can find a better way to do
> it, that'd be great.

Yah, it’s definitely awkward to use, although one advantage it does have is 
making it easy to use the high-speed i2c modes.  The way it supports 10-bit 
addressing is just totally brain-dead, though.

I have some ideas how I want to do it, but it’s not critical right now.

-- thorpej



Re: CVS commit: src/external/cddl/osnet/lib/libdtrace

2018-06-07 Thread Kamil Rytarowski
On 07.06.2018 15:08, Joerg Sonnenberger wrote:
> On Thu, Jun 07, 2018 at 10:07:27AM +0200, Kamil Rytarowski wrote:
>> On 07.06.2018 00:03, Joerg Sonnenberger wrote:
>>> On Wed, Jun 06, 2018 at 02:18:39PM +, Kamil Rytarowski wrote:
 Module Name:   src
 Committed By:  kamil
 Date:  Wed Jun  6 14:18:39 UTC 2018

 Modified Files:
src/external/cddl/osnet/lib/libdtrace: Makefile

 Log Message:
 Make cddl/osnet/lib/libdtrace buildable with MKLLVM=yes
>>>
>>> This is not the correct way to fix this. First of all, the flags are
>>> conditional even for GCC, but more importantly, HAVE_GCC does not mean
>>> that the compiler is GCC. See i.e. ah_regdomain.c handling in sys/conf.
>>>
>>> Joerg
>>>
>>
>> Do you mean to change the switch to: ${ACTIVE_CC} == "clang"?
> 
> == "gcc", but otherwise yes.
> 
> Joerg
> 

I'm test building a patch with ${ACTIVE_CC} for GCC and LLVM
distribution and I will commit it once it will build.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/cddl/osnet/lib/libdtrace

2018-06-07 Thread Joerg Sonnenberger
On Thu, Jun 07, 2018 at 10:07:27AM +0200, Kamil Rytarowski wrote:
> On 07.06.2018 00:03, Joerg Sonnenberger wrote:
> > On Wed, Jun 06, 2018 at 02:18:39PM +, Kamil Rytarowski wrote:
> >> Module Name:   src
> >> Committed By:  kamil
> >> Date:  Wed Jun  6 14:18:39 UTC 2018
> >>
> >> Modified Files:
> >>src/external/cddl/osnet/lib/libdtrace: Makefile
> >>
> >> Log Message:
> >> Make cddl/osnet/lib/libdtrace buildable with MKLLVM=yes
> > 
> > This is not the correct way to fix this. First of all, the flags are
> > conditional even for GCC, but more importantly, HAVE_GCC does not mean
> > that the compiler is GCC. See i.e. ah_regdomain.c handling in sys/conf.
> > 
> > Joerg
> > 
> 
> Do you mean to change the switch to: ${ACTIVE_CC} == "clang"?

== "gcc", but otherwise yes.

Joerg


Re: CVS commit: src/external/cddl/osnet/lib/libdtrace

2018-06-07 Thread Joerg Sonnenberger
On Thu, Jun 07, 2018 at 10:07:27AM +0200, Kamil Rytarowski wrote:
> On 07.06.2018 00:03, Joerg Sonnenberger wrote:
> > On Wed, Jun 06, 2018 at 02:18:39PM +, Kamil Rytarowski wrote:
> >> Module Name:   src
> >> Committed By:  kamil
> >> Date:  Wed Jun  6 14:18:39 UTC 2018
> >>
> >> Modified Files:
> >>src/external/cddl/osnet/lib/libdtrace: Makefile
> >>
> >> Log Message:
> >> Make cddl/osnet/lib/libdtrace buildable with MKLLVM=yes
> > 
> > This is not the correct way to fix this. First of all, the flags are
> > conditional even for GCC, but more importantly, HAVE_GCC does not mean
> > that the compiler is GCC. See i.e. ah_regdomain.c handling in sys/conf.
> > 
> > Joerg
> > 
> 
> Do you mean to change the switch to: ${ACTIVE_CC} == "clang"?
> 
> I've followed the approach in share/mk/bsd.sys.mk:
> 
> .if (defined(HAVE_GCC) \
>  && (${MACHINE_ARCH} == "coldfire" || \
>  ${MACHINE_CPU} == "sh3" || \
>  ${MACHINE_CPU} == "m68k"))
> # XXX GCC 4.5 for sh3 and m68k (which we compile with -Os) is extra
> noisy for
> # cases it should be better with
> CFLAGS+=-Wno-uninitialized
> CFLAGS+=-Wno-maybe-uninitialized
> .endif
> 
> And this works.

It only works because those architectures are (currently) GCC only.

Joerg


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

2018-06-07 Thread Jonathan A. Kollasch
On Thu, Jun 07, 2018 at 05:07:28AM +, Jason R Thorpe wrote:
> Module Name:  src
> Committed By: thorpej
> Date: Thu Jun  7 05:07:28 UTC 2018
> 
> Modified Files:
>   src/sys/arch/arm/broadcom: bcm2835_bsc.c
> 
> Log Message:
> A minimal change to prevent the Raspberry Pi i2c driver from
> looping forever if the command buffer and data buffer are both
> NULL.  XXX This driver needs an overhaul.

I don't disagree.  That said, making use of this hardware design did not
seem the most straightforward to me.  If you can find a better way to do
it, that'd be great.

With apologies,
Jonathan Kollasch


Re: CVS commit: src/external/cddl/osnet/lib/libdtrace

2018-06-07 Thread Kamil Rytarowski
On 07.06.2018 00:03, Joerg Sonnenberger wrote:
> On Wed, Jun 06, 2018 at 02:18:39PM +, Kamil Rytarowski wrote:
>> Module Name: src
>> Committed By:kamil
>> Date:Wed Jun  6 14:18:39 UTC 2018
>>
>> Modified Files:
>>  src/external/cddl/osnet/lib/libdtrace: Makefile
>>
>> Log Message:
>> Make cddl/osnet/lib/libdtrace buildable with MKLLVM=yes
> 
> This is not the correct way to fix this. First of all, the flags are
> conditional even for GCC, but more importantly, HAVE_GCC does not mean
> that the compiler is GCC. See i.e. ah_regdomain.c handling in sys/conf.
> 
> Joerg
> 

Do you mean to change the switch to: ${ACTIVE_CC} == "clang"?

I've followed the approach in share/mk/bsd.sys.mk:

.if (defined(HAVE_GCC) \
 && (${MACHINE_ARCH} == "coldfire" || \
 ${MACHINE_CPU} == "sh3" || \
 ${MACHINE_CPU} == "m68k"))
# XXX GCC 4.5 for sh3 and m68k (which we compile with -Os) is extra
noisy for
# cases it should be better with
CFLAGS+=-Wno-uninitialized
CFLAGS+=-Wno-maybe-uninitialized
.endif

And this works.



signature.asc
Description: OpenPGP digital signature