Larry Finger <Larry.Finger@xxxxxxxxxxxx> writes: > On 02/29/2016 06:28 AM, Jes Sorensen wrote: >> That one I have never seen before - could you try and insert some debug >> prints to see where the RF initialization fails? > > The call to usb_control_msg() is returning -EPROTO (-71), but > sometimes the system works. I added the following patch: > > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c > b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c > index 38aa3c2..8ab77a0 100644 > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c > @@ -1979,9 +1979,12 @@ static int rtl8xxxu_write_rfreg(struct rtl8xxxu_priv *priv, > > /* Use XB for path B */ > ret = rtl8xxxu_write32(priv, rtl8xxxu_rfregs[path].lssiparm, dataaddr); > - if (ret != sizeof(dataaddr)) > + if (ret != sizeof(dataaddr)) { > + pr_info("**** rtl8xxxu_write32() error %d: path %d, > reg: 0x%x, data 0x%x, dataaddr 0x%x, lssiparm 0x%x\n", > + ret, path, reg, data, dataaddr, > rtl8xxxu_rfregs[path].lssiparm); > + dump_stack(); > retval = -EIO; > - else > + } else > retval = 0; > > udelay(1); > > When the error happens, my log contains Odd, I wonder if my code writes the reigsters out to the device too fast. You could try adding a call to read back the RF register before exiting the function - preferably after the udelay(). Cheers, Jes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html