Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42996 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753668AbcKUMY2 (ORCPT ); Mon, 21 Nov 2016 07:24:28 -0500 Date: Mon, 21 Nov 2016 13:20:16 +0100 From: Stanislaw Gruszka To: Amitkumar Karwar Cc: Nishant Sarmukadam , "linux-wireless@vger.kernel.org" , Charles Rose Subject: Re: Problems with mwifiex_pcie firmware activation Message-ID: <20161121122015.GA613@redhat.com> (sfid-20161121_132432_773696_F0A77804) References: <20160616115315.GB21199@redhat.com> <20160623120952.GA11157@redhat.com> <20160811090113.GA27059@redhat.com> <20160811122917.GB27059@redhat.com> <20160812081342.GA15538@redhat.com> <20160825150626.GA9256@redhat.com> <20161114101544.GA13943@redhat.com> <2165db278e1c486d8fffbd2db4150481@SC-EXCH04.marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <2165db278e1c486d8fffbd2db4150481@SC-EXCH04.marvell.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: Hi On Wed, Nov 16, 2016 at 06:03:49AM +0000, Amitkumar Karwar wrote: > > From: Stanislaw Gruszka [mailto:sgruszka@redhat.com] > > Sent: Monday, November 14, 2016 3:46 PM > > To: Amitkumar Karwar > > Cc: Nishant Sarmukadam; linux-wireless@vger.kernel.org > > Subject: Re: Problems with mwifiex_pcie firmware activation > > > > On Thu, Aug 25, 2016 at 05:06:26PM +0200, Stanislaw Gruszka wrote: > > > On Fri, Aug 12, 2016 at 10:13:43AM +0200, Stanislaw Gruszka wrote: > > > > On Fri, Aug 12, 2016 at 07:17:38AM +0000, Amitkumar Karwar wrote: > > > > > The problem looks strange. The patch just splits > > mwifiex_check_fw_status() and increases poll count. It should not have > > any side-effects. > > > > > Our code used to check winner status before this patch also. > > > > > > > > Ok, I misread the patch. Anyway checking "winner status" seems does > > > > not work well on some condition and prevent loading firmware into > > > > device. > > > > > > I debug this a bit more on latest wireless-testing-next tree + 3 > > > patches I just posted and debug_mask=0x700000ff. > > > > > > On broken system, we do not download FW to device when system is > > > rebooted, due to PCI-E is not the winner. However if system is > > powered > > > OFF and then powered ON, we do FW downloading. Hence download the new > > > FW into device does not make it work as was my theory. > > > > > > In attachments are full dmesgs of good/bad and reboot/power-off-on > > > cases. > > > > > > The difference is that on broken system FW (or HW) do not create new > > > USB Bluetooth device (1286:2046) and do not report > > > FIRMWARE_READY_PCIE. Additionally on reboot case there are errors > > from > > > USB xhci. > > > > It was discovered that not working device require pcie8897_uapsta.bin > > firmware from ubuntu package to work: > > What's the difference between working and non-working device? I can not find anything reasonable. Lspci gives almost the same print. There is some difference, but I think it comes from from fact that working device is enabled and non-working is disabled. Working: 03:00.0 Ethernet controller [0200]: Marvell Technology Group Ltd. 88W8897 [AVASTAR] 802.11ac Wireless [11ab:2b38] Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Capabilities: [160 v1] Latency Tolerance Reporting Max snoop latency: 71680ns Max no snoop latency: 71680ns Capabilities: [168 v1] L1 PM Substates L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+ PortCommonModeRestoreTime=70us PortTPowerOnTime=10us Kernel driver in use: mwifiex_pcie Kernel modules: mwifiex_pcie Non-working: 02:00.0 Ethernet controller [0200]: Marvell Technology Group Ltd. 88W8897 [AVASTAR] 802.11ac Wireless [11ab:2b38] Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Capabilities: [160 v1] Latency Tolerance Reporting Max snoop latency: 71680ns Max no snoop latency: 71680ns Capabilities: [168 v1] L1 PM Substates L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+ PortCommonModeRestoreTime=70us PortTPowerOnTime=10us Kernel driver in use: mwifiex_pcie Kernel modules: mwifiex_pcie I also added some extra code to print registers that are used to identify other PCIE_DEVICE_ID_MARVELL_88W8997 device: diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index 3c3c4f1..84434ab 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -2921,6 +2921,9 @@ static void mwifiex_pcie_get_fw_name(struct mwifiex_adapter *adapter) case PCIE_DEVICE_ID_MARVELL_88W8897: mwifiex_write_reg(adapter, 0x0c58, 0x80c00000); mwifiex_read_reg(adapter, 0x0c58, &revision_id); + mwifiex_read_reg(adapter, 0x0cd0, &version); + mwifiex_read_reg(adapter, 0x0cd4, &magic); + printk("%s revision_id 0x%08x version 0x%08x magic 0x%08x\n", __func__, revision_id, version, magic); revision_id &= 0xff00; switch (revision_id) { case PCIE8897_A0: but prints are the same for non-working and working system: mwifiex_pcie_get_fw_name revision_id 0x00001430 version 0x00000000 magic 0x00000000 So I'm not sure if device in working and non-working system is different. Maybe difference is in how device is connected with the rest of the system or in other hardware parts. Cc Charles, perhaps he can elaborate more about that. > > https://launchpad.net/~snappy-dev/+archive/ubuntu/snappy- > > devices/+sourcepub/5936055/+listing-archive-extra > > > > Device initialize like this then: > > > > [ 15.374630] mwifiex_pcie 0000:02:00.0: info: FW download over, size > > 689624 bytes > > [ 16.101214] mwifiex_pcie 0000:02:00.0: WLAN FW is active > > [ 16.242825] mwifiex_pcie 0000:02:00.0: info: MWIFIEX VERSION: > > mwifiex 1.0 (15.150.13.p21) > > [ 16.251231] mwifiex_pcie 0000:02:00.0: driver_version = mwifiex 1.0 > > (15.150.13.p21) > > > > I'm not sure where ubuntu get this 15.150.13.p21 version of firmware as > > it seems it's not present nor in upstream linux-firmware repo not in > > http://git.marvell.com/?p=mwifiex-firmware.git;a=summary > > > > Anyway could you modify firmware to support this device or modify > > driver to load 15.150.13.p21 if required and push this F/W image > > upstream ? > > > > Last released firmware is 15.68.7.p77 > http://git.marvell.com/?p=mwifiex-firmware.git;a=commit;h=05e2f3a4acf4174ec507a3464a374ecb1b4ec011 > Could you try with it? I does not make device on non-workig system work. > If it doesn't work, we need to investigate what is missing in this compared to 15.150.13.p21 and create new 15.68.7.pXX. Thanks Stanislaw