diff mbox

bcma: do not initialize deactivated PCIe cores

Message ID 1349043174-5371-1-git-send-email-hauke@hauke-m.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Hauke Mehrtens Sept. 30, 2012, 10:12 p.m. UTC
Before it was tried to initialize the deactivated PCIe core in client
mode, but this causes the SoC to hang. Just do not initialize it at all
and ignore the core it is not working and nothing is connected to it
when the specific bit is set in the boardflags.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/bcma/driver_pci_host.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Rafał Miłecki Oct. 7, 2012, 7:48 a.m. UTC | #1
2012/10/1 Hauke Mehrtens <hauke@hauke-m.de>:
> @@ -396,6 +391,11 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
>
>         bcma_info(bus, "PCIEcore in host mode found\n");
>
> +       if (bus->sprom.boardflags_lo & BCMA_CORE_PCI_BFL_NOPCI) {
> +               bcma_info(bus, "This PCIE core is disabled and not working\n");
> +               return;
> +       }
> +

I wonder if this bit is also valid for client mode PCIe core. Maybe
this check should be put directly in bcma_core_pci_init?
Hauke Mehrtens Oct. 7, 2012, 10:01 p.m. UTC | #2
On 10/07/2012 09:48 AM, Rafa? Mi?ecki wrote:
> 2012/10/1 Hauke Mehrtens <hauke@hauke-m.de>:
>> @@ -396,6 +391,11 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
>>
>>         bcma_info(bus, "PCIEcore in host mode found\n");
>>
>> +       if (bus->sprom.boardflags_lo & BCMA_CORE_PCI_BFL_NOPCI) {
>> +               bcma_info(bus, "This PCIE core is disabled and not working\n");
>> +               return;
>> +       }
>> +
> 
> I wonder if this bit is also valid for client mode PCIe core. Maybe
> this check should be put directly in bcma_core_pci_init?

I put it into the host mode code, because I do not want to interfere
with some wrongly programed client mode pcie devices. I have just seen a
SoC with a PCIe device in hostmode where this option was set. I would
have no problem with moving this into bcma_core_pci_init if someone with
some cards could test it before.

Hauke
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c
index 63172c9..e564495 100644
--- a/drivers/bcma/driver_pci_host.c
+++ b/drivers/bcma/driver_pci_host.c
@@ -35,11 +35,6 @@  bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc)
 	    chipid_top != 0x5300)
 		return false;
 
-	if (bus->sprom.boardflags_lo & BCMA_CORE_PCI_BFL_NOPCI) {
-		bcma_info(bus, "This PCI core is disabled and not working\n");
-		return false;
-	}
-
 	bcma_core_enable(pc->core, 0);
 
 	return !mips_busprobe32(tmp, pc->core->io_addr);
@@ -396,6 +391,11 @@  void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
 
 	bcma_info(bus, "PCIEcore in host mode found\n");
 
+	if (bus->sprom.boardflags_lo & BCMA_CORE_PCI_BFL_NOPCI) {
+		bcma_info(bus, "This PCIE core is disabled and not working\n");
+		return;
+	}
+
 	pc_host = kzalloc(sizeof(*pc_host), GFP_KERNEL);
 	if (!pc_host)  {
 		bcma_err(bus, "can not allocate memory");