Re: hide iwn firmware error log

2016-10-12 Thread Stefan Sperling
On Tue, Oct 11, 2016 at 11:32:27PM +0200, Jan Stary wrote:
> On Oct 06 12:46:21, s...@stsp.name wrote:
> > Disable the detailed fatal firmware error log in iwn(4) by default.
> 
> These are my iwm errors of today
> on a Dell Latitude E5570.

> I sure don't know what to do with them,
> but I'm glad I can at least report them.
> If this goes in, which one of them will disappear?

iwm is not the same driver as iwn.



Re: hide iwn firmware error log

2016-10-11 Thread Jan Stary
On Oct 06 12:46:21, s...@stsp.name wrote:
> Disable the detailed fatal firmware error log in iwn(4) by default.

These are my iwm errors of today
on a Dell Latitude E5570.

Oct 11 16:26:56 dell /bsd: iwm0: fatal firmware error
Oct 11 16:26:56 dell /bsd: iwm0: device timeout
Oct 11 16:26:56 dell /bsd: iwm0: device timeout
Oct 11 16:26:57 dell /bsd: iwm0: could not add MAC context (error 35)
Oct 11 16:34:03 dell /bsd: iwm0: fatal firmware error
Oct 11 16:34:03 dell /bsd: iwm0: device timeout
Oct 11 16:34:03 dell /bsd: iwm0: device timeout
Oct 11 16:34:04 dell /bsd: iwm0: could not add MAC context (error 35)
Oct 11 16:37:34 dell /bsd: iwm0: fatal firmware error
Oct 11 16:37:34 dell /bsd: iwm0: device timeout
Oct 11 16:37:34 dell /bsd: iwm0: device timeout
Oct 11 16:37:35 dell /bsd: iwm0: could not add MAC context (error 35)
Oct 11 17:04:28 dell /bsd: iwm0: fatal firmware error
Oct 11 17:04:28 dell /bsd: iwm0: device timeout
Oct 11 17:04:28 dell /bsd: iwm0: device timeout
Oct 11 17:04:29 dell /bsd: iwm0: could not add MAC context (error 35)
Oct 11 17:08:37 dell /bsd: iwm0: fatal firmware error
Oct 11 17:08:37 dell /bsd: iwm0: device timeout
Oct 11 17:08:37 dell /bsd: iwm0: device timeout
Oct 11 17:08:38 dell /bsd: iwm0: could not add MAC context (error 35)
Oct 11 17:27:47 dell /bsd: iwm0: fatal firmware error
Oct 11 17:27:47 dell /bsd: iwm0: device timeout
Oct 11 17:27:47 dell /bsd: iwm0: device timeout
Oct 11 17:27:48 dell /bsd: iwm0: could not add MAC context (error 35)
Oct 11 17:31:20 dell /bsd: iwm0: fatal firmware error
Oct 11 17:31:20 dell /bsd: iwm0: device timeout
Oct 11 17:31:20 dell /bsd: iwm0: device timeout
Oct 11 17:31:21 dell /bsd: iwm0: could not add MAC context (error 35)

I sure don't know what to do with them,
but I'm glad I can at least report them.
If this goes in, which one of them will disappear?
(Are they all firmware errors?)

I don't understand the motivation to hide them,
but I can build the kernel with IWN_DEBUG.

Jan



> Index: if_iwn.c
> ===
> RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
> retrieving revision 1.172
> diff -u -p -r1.172 if_iwn.c
> --- if_iwn.c  5 Sep 2016 08:18:18 -   1.172
> +++ if_iwn.c  6 Oct 2016 10:42:41 -
> @@ -2595,6 +2595,7 @@ iwn_wakeup_intr(struct iwn_softc *sc)
>   }
>  }
>  
> +#ifdef IWN_DEBUG
>  /*
>   * Dump the error log of the firmware when a firmware panic occurs.  Although
>   * we can't debug the firmware because it is neither open source nor free, it
> @@ -2606,9 +2607,6 @@ iwn_fatal_intr(struct iwn_softc *sc)
>   struct iwn_fw_dump dump;
>   int i;
>  
> - /* Force a complete recalibration on next init. */
> - sc->sc_flags &= ~IWN_FLAG_CALIB_DONE;
> -
>   /* Check that the error log address is valid. */
>   if (sc->errptr < IWN_FW_DATA_BASE ||
>   sc->errptr + sizeof (dump) >
> @@ -2657,6 +2655,7 @@ iwn_fatal_intr(struct iwn_softc *sc)
>   printf("  rx ring: cur=%d\n", sc->rxq.cur);
>   printf("  802.11 state %d\n", sc->sc_ic.ic_state);
>  }
> +#endif
>  
>  int
>  iwn_intr(void *arg)
> @@ -2711,8 +2710,14 @@ iwn_intr(void *arg)
>   }
>   if (r1 & (IWN_INT_SW_ERR | IWN_INT_HW_ERR)) {
>   printf("%s: fatal firmware error\n", sc->sc_dev.dv_xname);
> +
> + /* Force a complete recalibration on next init. */
> + sc->sc_flags &= ~IWN_FLAG_CALIB_DONE;
> +
>   /* Dump firmware error log and stop. */
> +#ifdef IWN_DEBUG
>   iwn_fatal_intr(sc);
> +#endif
>   iwn_stop(ifp, 1);
>   task_add(systq, >init_task);
>   return 1;
> 



Re: hide iwn firmware error log

2016-10-08 Thread Mark Kettenis
> Date: Thu, 6 Oct 2016 12:46:21 +0200
> From: Stefan Sperling 
> 
> Disable the detailed fatal firmware error log in iwn(4) by default.

You're the best judge on how useful this information is.

ok kettenis@

> Index: if_iwn.c
> ===
> RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
> retrieving revision 1.172
> diff -u -p -r1.172 if_iwn.c
> --- if_iwn.c  5 Sep 2016 08:18:18 -   1.172
> +++ if_iwn.c  6 Oct 2016 10:42:41 -
> @@ -2595,6 +2595,7 @@ iwn_wakeup_intr(struct iwn_softc *sc)
>   }
>  }
>  
> +#ifdef IWN_DEBUG
>  /*
>   * Dump the error log of the firmware when a firmware panic occurs.  Although
>   * we can't debug the firmware because it is neither open source nor free, it
> @@ -2606,9 +2607,6 @@ iwn_fatal_intr(struct iwn_softc *sc)
>   struct iwn_fw_dump dump;
>   int i;
>  
> - /* Force a complete recalibration on next init. */
> - sc->sc_flags &= ~IWN_FLAG_CALIB_DONE;
> -
>   /* Check that the error log address is valid. */
>   if (sc->errptr < IWN_FW_DATA_BASE ||
>   sc->errptr + sizeof (dump) >
> @@ -2657,6 +2655,7 @@ iwn_fatal_intr(struct iwn_softc *sc)
>   printf("  rx ring: cur=%d\n", sc->rxq.cur);
>   printf("  802.11 state %d\n", sc->sc_ic.ic_state);
>  }
> +#endif
>  
>  int
>  iwn_intr(void *arg)
> @@ -2711,8 +2710,14 @@ iwn_intr(void *arg)
>   }
>   if (r1 & (IWN_INT_SW_ERR | IWN_INT_HW_ERR)) {
>   printf("%s: fatal firmware error\n", sc->sc_dev.dv_xname);
> +
> + /* Force a complete recalibration on next init. */
> + sc->sc_flags &= ~IWN_FLAG_CALIB_DONE;
> +
>   /* Dump firmware error log and stop. */
> +#ifdef IWN_DEBUG
>   iwn_fatal_intr(sc);
> +#endif
>   iwn_stop(ifp, 1);
>   task_add(systq, >init_task);
>   return 1;
> 
> 



hide iwn firmware error log

2016-10-06 Thread Stefan Sperling
Disable the detailed fatal firmware error log in iwn(4) by default.

Index: if_iwn.c
===
RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
retrieving revision 1.172
diff -u -p -r1.172 if_iwn.c
--- if_iwn.c5 Sep 2016 08:18:18 -   1.172
+++ if_iwn.c6 Oct 2016 10:42:41 -
@@ -2595,6 +2595,7 @@ iwn_wakeup_intr(struct iwn_softc *sc)
}
 }
 
+#ifdef IWN_DEBUG
 /*
  * Dump the error log of the firmware when a firmware panic occurs.  Although
  * we can't debug the firmware because it is neither open source nor free, it
@@ -2606,9 +2607,6 @@ iwn_fatal_intr(struct iwn_softc *sc)
struct iwn_fw_dump dump;
int i;
 
-   /* Force a complete recalibration on next init. */
-   sc->sc_flags &= ~IWN_FLAG_CALIB_DONE;
-
/* Check that the error log address is valid. */
if (sc->errptr < IWN_FW_DATA_BASE ||
sc->errptr + sizeof (dump) >
@@ -2657,6 +2655,7 @@ iwn_fatal_intr(struct iwn_softc *sc)
printf("  rx ring: cur=%d\n", sc->rxq.cur);
printf("  802.11 state %d\n", sc->sc_ic.ic_state);
 }
+#endif
 
 int
 iwn_intr(void *arg)
@@ -2711,8 +2710,14 @@ iwn_intr(void *arg)
}
if (r1 & (IWN_INT_SW_ERR | IWN_INT_HW_ERR)) {
printf("%s: fatal firmware error\n", sc->sc_dev.dv_xname);
+
+   /* Force a complete recalibration on next init. */
+   sc->sc_flags &= ~IWN_FLAG_CALIB_DONE;
+
/* Dump firmware error log and stop. */
+#ifdef IWN_DEBUG
iwn_fatal_intr(sc);
+#endif
iwn_stop(ifp, 1);
task_add(systq, >init_task);
return 1;