On Wed, May 13, 2020 at 07:55:02PM -0400, sven falempin wrote:
> 'good news'
> 
> I build a custom kernel with the DEBUG flag for the driver

> I 'works' ,

This means that the driver is doing something too fast on your hardware,
and some miscommunication happens with the card as a result.

One way to work around this is to add DELAY calls. It is not the ideal
solution but would be a good first step to get the card working.

Can you disable debugging again and try the patch below instead?
If the problem re-appears, try to increase the amount of delay (up to 5000
seems reasonable). If increasing the DELAY value does not help, try to move
the DELAY call further down until it works.

The DELAY may even need to be moved into the while loop inside iwx_nvm_init().
But please try using the DELAY outside of a loop first.

Finding the right spot might take some time. Welcome to driver development :)

If you cannot find a spot for the DELAY that makes this work, then we will
have to wait for someone else who is seeing the same problem and tries harder.

diff 4a0fa473f5ea308b63ffd39645f73b2195291973 /usr/src
blob - 64c3641a2d0d07a9d899c0b7ccdbe46d46e17b96
file + sys/dev/pci/if_iwx.c
--- sys/dev/pci/if_iwx.c
+++ sys/dev/pci/if_iwx.c
@@ -3222,6 +3222,7 @@ iwx_run_init_mvm_ucode(struct iwx_softc *sc, int readn
         * Send init config command to mark that we are sending NVM
         * access commands
         */
+       DELAY(1000);
        err = iwx_send_cmd_pdu(sc, IWX_WIDE_ID(IWX_SYSTEM_GROUP,
            IWX_INIT_EXTENDED_CFG_CMD), 0, sizeof(init_cfg), &init_cfg);
        if (err)

Reply via email to