Re: Build fails for kernels w/cd(4) but w/o wd(4)

2018-10-26 Thread Jaromír Doleček
Le sam. 27 oct. 2018 à 00:50,  a écrit :
>
> On Fri, Oct 26, 2018 at 05:27:05PM -0500, John D. Baker wrote:
> > --- wdc.o ---
> > /x/current/src/sys/dev/ic/wdc.c:138:1: error: missing initializer for field 
> > 'ata_recovery' of 'const struct ata_bustype' 
> > [-Werror=missing-field-initializers]
> >  };
> >  ^
> > In file included from /x/current/src/sys/dev/ic/wdc.c:90:0:
> > /x/current/src/sys/dev/ata/atavar.h:376:9: note: 'ata_recovery' declared 
> > here
> >   void (*ata_recovery)(struct ata_channel *, int, uint32_t);
> >  ^~~~
>
> I assume the fix is this, to set it to NULL like it would be in the NWD > 0 
> case.
> I've converted it to a C99 initializer while there.

Yes. Please commit this fix, I'm away next couple of days.

Jaromir

> Index: dev/ic/wdc.c
> ===
> RCS file: /cvsroot/src/sys/dev/ic/wdc.c,v
> retrieving revision 1.289
> diff -u -r1.289 wdc.c
> --- dev/ic/wdc.c22 Oct 2018 20:13:47 -  1.289
> +++ dev/ic/wdc.c26 Oct 2018 22:38:35 -
> @@ -126,15 +126,16 @@
>  #else
>  /* A fake one, the autoconfig will print "wd at foo ... not configured */
>  const struct ata_bustype wdc_ata_bustype = {
> -   SCSIPI_BUSTYPE_ATA,
> -   NULL,   /* wdc_ata_bio */
> -   NULL,   /* wdc_reset_drive */
> -   wdc_reset_channel,
> -   wdc_exec_command,
> -   NULL,   /* ata_get_params */
> -   NULL,   /* wdc_ata_addref */
> -   NULL,   /* wdc_ata_delref */
> -   NULL/* ata_kill_pending */
> +   .bus_type = SCSIPI_BUSTYPE_ATA,
> +   .ata_bio =  NULL,
> +   .wdc_reset_drive =  NULL,
> +   .ata_reset_channel =wdc_reset_channel,
> +   .ata_exec_command = wdc_exec_command,
> +   .ata_get_params =   NULL,
> +   .ata_addref =   NULL,
> +   .ata_delref =   NULL,
> +   .ata_killpending =  NULL,
> +   .ata_recovery = NULL,
>  };
>  #endif
>
>


Re: Build fails for kernels w/cd(4) but w/o wd(4)

2018-10-26 Thread maya
On Fri, Oct 26, 2018 at 05:27:05PM -0500, John D. Baker wrote:
> --- wdc.o ---
> /x/current/src/sys/dev/ic/wdc.c:138:1: error: missing initializer for field 
> 'ata_recovery' of 'const struct ata_bustype' 
> [-Werror=missing-field-initializers]
>  };
>  ^
> In file included from /x/current/src/sys/dev/ic/wdc.c:90:0:
> /x/current/src/sys/dev/ata/atavar.h:376:9: note: 'ata_recovery' declared here
>   void (*ata_recovery)(struct ata_channel *, int, uint32_t);
>  ^~~~

I assume the fix is this, to set it to NULL like it would be in the NWD > 0 
case.
I've converted it to a C99 initializer while there.

Index: dev/ic/wdc.c
===
RCS file: /cvsroot/src/sys/dev/ic/wdc.c,v
retrieving revision 1.289
diff -u -r1.289 wdc.c
--- dev/ic/wdc.c22 Oct 2018 20:13:47 -  1.289
+++ dev/ic/wdc.c26 Oct 2018 22:38:35 -
@@ -126,15 +126,16 @@
 #else
 /* A fake one, the autoconfig will print "wd at foo ... not configured */
 const struct ata_bustype wdc_ata_bustype = {
-   SCSIPI_BUSTYPE_ATA,
-   NULL,   /* wdc_ata_bio */
-   NULL,   /* wdc_reset_drive */
-   wdc_reset_channel,
-   wdc_exec_command,
-   NULL,   /* ata_get_params */
-   NULL,   /* wdc_ata_addref */
-   NULL,   /* wdc_ata_delref */
-   NULL/* ata_kill_pending */
+   .bus_type = SCSIPI_BUSTYPE_ATA,
+   .ata_bio =  NULL,
+   .wdc_reset_drive =  NULL,
+   .ata_reset_channel =wdc_reset_channel,
+   .ata_exec_command = wdc_exec_command,
+   .ata_get_params =   NULL,
+   .ata_addref =   NULL,
+   .ata_delref =   NULL,
+   .ata_killpending =  NULL,
+   .ata_recovery = NULL,
 };
 #endif
 



Build fails for kernels w/cd(4) but w/o wd(4)

2018-10-26 Thread John D. Baker
Following the ncqfixes branch merge, one of my kernel configs fails
as follows:

[...]
--- wdc.o ---
/x/current/src/sys/dev/ic/wdc.c:138:1: error: missing initializer for field 
'ata_recovery' of 'const struct ata_bustype' 
[-Werror=missing-field-initializers]
 };
 ^
In file included from /x/current/src/sys/dev/ic/wdc.c:90:0:
/x/current/src/sys/dev/ata/atavar.h:376:9: note: 'ata_recovery' declared here
  void (*ata_recovery)(struct ata_channel *, int, uint32_t);
 ^~~~
cc1: all warnings being treated as errors
*** [wdc.o] Error code 1

nbmake: stopped in /r0/build/current/obj/amd64/sys/arch/amd64/compile/FARADAY
[...]

Like a number (all amd64 and all but one i386) of my configs, this config
elides "wdc(4)" with:

# FARADAY - DELL PowerEdge 1850
#
include "arch/amd64/conf/GENERIC"
[...]
no wdc* at pcmcia?
no wdc0 at isa?
no wdc1 at isa?
[...]

with no ill effect (but why does it still try to build this object?).
This particular config goes on to elide "wd(4)":

[...]
no wd*  at atabus?
[...]

as, at the time the config was developed, the machine would hang probing
for non-existent IDE/ATA/SATA hard disks (machine has only SCSI disks and
only IDE/ATAPI CD-ROM drive).  Likewise, all non-CDROM ATA/ATAPI devices
are elided as well.

Restoring "wd(4)" by commenting out the elision allows it to build.  I
have not had the machine operating for some time, so I don't know if it
still hangs probing for non-existent IDE/ATA hard disks.

If I can manage to set it up again, I'll see how it behaves.

-- 
|/"\ John D. Baker, KN5UKS   NetBSD Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]comOpenBSDFreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645