On Thu, May 14, 2020 at 5:55 AM Stefan Sperling <s...@stsp.name> wrote:
> 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) > Index: if_iwx.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_iwx.c,v retrieving revision 1.11 diff -u -p -r1.11 if_iwx.c --- if_iwx.c 29 Apr 2020 13:13:30 -0000 1.11 +++ if_iwx.c 15 May 2020 15:08:45 -0000 @@ -3222,6 +3222,9 @@ iwx_run_init_mvm_ucode(struct iwx_softc * Send init config command to mark that we are sending NVM * access commands */ + printf("%s: DELAYING\n", DEVNAME(sc)); + DELAY(5000); + 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) Gave iwx0: DELAYING iwx0: dumping device error log iwx0: Start Error Log Dump: iwx0: Status: 0x1, count: 6 iwx0: 0x00000071 | NMI_INTERRUPT_UMAC_FATAL iwx0: 0020A2F0 | trm_hw_status0 iwx0: 00000000 | trm_hw_status1 iwx0: 004FC308 | branchlink2 iwx0: 00016E5A | interruptlink1 iwx0: 00016E5A | interruptlink2 iwx0: 004F9F62 | data1 iwx0: 00001000 | data2 iwx0: F0000008 | data3 iwx0: 00000000 | beacon time iwx0: 000115E1 | tsf low iwx0: 00000000 | tsf hi iwx0: 00000000 | time gp1 iwx0: 000115E2 | time gp2 iwx0: 00000001 | uCode revision type iwx0: 0000002E | uCode version major iwx0: 177B3E46 | uCode version minor iwx0: 00000340 | hw version iwx0: 18889000 | board version iwx0: 800AFD0C | hcmd iwx0: 20020000 | isr0 iwx0: 00000000 | isr1 iwx0: 18F00002 | isr2 iwx0: 00C0000C | isr3 iwx0: 00000000 | isr4 iwx0: 00000000 | last cmd Id iwx0: 004F9F62 | wait_event iwx0: 00000000 | l2p_control iwx0: 00000020 | l2p_duration iwx0: 00000000 | l2p_mhvalid iwx0: 00000000 | l2p_addr_match iwx0: 00000009 | lmpm_pmg_sel iwx0: 19071335 | timestamp iwx0: 00000828 | flow_handler iwx0: Start UMAC Error Log Dump: iwx0: Status: 0x1, count: 7 iwx0: 0x201010A3 | ADVANCED_SYSASSERT iwx0: 0x00000000 | umac branchlink1 iwx0: 0xC008B1C0 | umac branchlink2 iwx0: 0xC0084E04 | umac interruptlink1 iwx0: 0x00000000 | umac interruptlink2 iwx0: 0x00000002 | umac data1 iwx0: 0x00000001 | umac data2 iwx0: 0xDEADBEEF | umac data3 iwx0: 0x0000002E | umac major iwx0: 0x177B3E46 | umac minor iwx0: 0x000115D2 | frame pointer iwx0: 0xC0886C6C | stack pointer iwx0: 0x00050C00 | last host cmd iwx0: 0x00000000 | isr status reg driver status: tx ring 0: qid=0 cur=6 queued=0 tx ring 1: qid=1 cur=0 queued=0 tx ring 2: qid=2 cur=0 queued=0 tx ring 3: qid=3 cur=0 queued=0 tx ring 4: qid=4 cur=0 queued=0 tx ring 5: qid=5 cur=0 queued=0 tx ring 6: qid=6 cur=0 queued=0 tx ring 7: qid=7 cur=0 queued=0 tx ring 8: qid=8 cur=0 queued=0 tx ring 9: qid=9 cur=0 queued=0 tx ring 10: qid=10 cur=0 queued=0 tx ring 11: qid=11 cur=0 queued=0 tx ring 12: qid=12 cur=0 queued=0 tx ring 13: qid=13 cur=0 queued=0 tx ring 14: qid=14 cur=0 queued=0 tx ring 15: qid=15 cur=0 queued=0 tx ring 16: qid=16 cur=0 queued=0 tx ring 17: qid=17 cur=0 queued=0 tx ring 18: qid=18 cur=0 queued=0 tx ring 19: qid=19 cur=0 queued=0 tx ring 20: qid=20 cur=0 queued=0 tx ring 21: qid=21 cur=0 queued=0 tx ring 22: qid=22 cur=0 queued=0 tx ring 23: qid=23 cur=0 queued=0 tx ring 24: qid=24 cur=0 queued=0 tx ring 25: qid=25 cur=0 queued=0 tx ring 26: qid=26 cur=0 queued=0 tx ring 27: qid=27 cur=0 queued=0 tx ring 28: qid=28 cur=0 queued=0 tx ring 29: qid=29 cur=0 queued=0 tx ring 30: qid=30 cur=0 queued=0 rx ring: cur=265 802.11 state INIT iwx0: fatal firmware error I think the delay must be somewhere after. I know it s a bit silly , but would a test with #ifdef IWX_DEBUG #define DPRINTF(x) do { if (iwx_debug > 0) printf x; } while (0) #define DPRINTFN(n, x) do { if (iwx_debug >= (n)) printf x; } while (0) int iwx_debug = 1; #else #define DPRINTF(x) do { DELAY(10); } while (1) #define DPRINTFN(n, x) do { DELAY(10); } while (1) #endif makes sense ? -- -- --------------------------------------------------------------------------------------------------------------------- Knowing is not enough; we must apply. Willing is not enough; we must do