* [PATCH] ssb: fix init regression with SoCs
@ 2011-12-05 22:19 Hauke Mehrtens
2011-12-05 23:44 ` Larry Finger
2011-12-06 19:56 ` John W. Linville
0 siblings, 2 replies; 4+ messages in thread
From: Hauke Mehrtens @ 2011-12-05 22:19 UTC (permalink / raw)
To: linville
Cc: linux-wireless, Hauke Mehrtens, Michael Buesch,
Rafał Miłecki
This fixes a Data bus error on some SoCs. The first fix for this
problem did not solve it on all devices.
commit 6ae8ec27868bfdbb815287bee8146acbefaee867
Author: Rafał Miłecki <zajec5@gmail.com>
Date: Tue Jul 5 17:25:32 2011 +0200
ssb: fix init regression of hostmode PCI core
In ssb_pcicore_fix_sprom_core_index() the sprom on the PCI core is
accessed, but the sprom only exists when the ssb bus is connected over
a PCI bus to the rest of the system and not when the SSB Bus is the
main system bus. SoCs sometimes have a PCI host controller and there
this code will not be executed, but there are some old SoCs with an PCI
controller in client mode around and ssb_pcicore_fix_sprom_core_index()
should not be called on these devices too. The PCI controller on these
devices are unused, but without this fix it results in an Data bus
error when it gets initialized.
CC: Michael Buesch <m@bues.ch>
CC: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/ssb/driver_pcicore.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
index 84c934c..520e828 100644
--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -517,10 +517,14 @@ static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)
static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
{
- ssb_pcicore_fix_sprom_core_index(pc);
+ struct ssb_device *pdev = pc->dev;
+ struct ssb_bus *bus = pdev->bus;
+
+ if (bus->bustype == SSB_BUSTYPE_PCI)
+ ssb_pcicore_fix_sprom_core_index(pc);
/* Disable PCI interrupts. */
- ssb_write32(pc->dev, SSB_INTVEC, 0);
+ ssb_write32(pdev, SSB_INTVEC, 0);
/* Additional PCIe always once-executed workarounds */
if (pc->dev->id.coreid == SSB_DEV_PCIE) {
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ssb: fix init regression with SoCs
2011-12-05 22:19 [PATCH] ssb: fix init regression with SoCs Hauke Mehrtens
@ 2011-12-05 23:44 ` Larry Finger
2011-12-08 22:37 ` Hauke Mehrtens
2011-12-06 19:56 ` John W. Linville
1 sibling, 1 reply; 4+ messages in thread
From: Larry Finger @ 2011-12-05 23:44 UTC (permalink / raw)
To: Hauke Mehrtens
Cc: linville, linux-wireless, Michael Buesch, Rafał Miłecki
On 12/05/2011 04:19 PM, Hauke Mehrtens wrote:
> This fixes a Data bus error on some SoCs. The first fix for this
> problem did not solve it on all devices.
> commit 6ae8ec27868bfdbb815287bee8146acbefaee867
> Author: Rafał Miłecki<zajec5@gmail.com>
> Date: Tue Jul 5 17:25:32 2011 +0200
> ssb: fix init regression of hostmode PCI core
>
> In ssb_pcicore_fix_sprom_core_index() the sprom on the PCI core is
> accessed, but the sprom only exists when the ssb bus is connected over
> a PCI bus to the rest of the system and not when the SSB Bus is the
> main system bus. SoCs sometimes have a PCI host controller and there
> this code will not be executed, but there are some old SoCs with an PCI
> controller in client mode around and ssb_pcicore_fix_sprom_core_index()
> should not be called on these devices too. The PCI controller on these
> devices are unused, but without this fix it results in an Data bus
> error when it gets initialized.
>
> CC: Michael Buesch<m@bues.ch>
> CC: Rafał Miłecki<zajec5@gmail.com>
> Signed-off-by: Hauke Mehrtens<hauke@hauke-m.de>
> ---
> drivers/ssb/driver_pcicore.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
> index 84c934c..520e828 100644
> --- a/drivers/ssb/driver_pcicore.c
> +++ b/drivers/ssb/driver_pcicore.c
> @@ -517,10 +517,14 @@ static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)
>
> static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
> {
> - ssb_pcicore_fix_sprom_core_index(pc);
> + struct ssb_device *pdev = pc->dev;
> + struct ssb_bus *bus = pdev->bus;
> +
> + if (bus->bustype == SSB_BUSTYPE_PCI)
> + ssb_pcicore_fix_sprom_core_index(pc);
>
> /* Disable PCI interrupts. */
> - ssb_write32(pc->dev, SSB_INTVEC, 0);
> + ssb_write32(pdev, SSB_INTVEC, 0);
As bus == pc->dev->bus is only used once, why bother to create it? If you were
to change that, then pdev == pc->dev is only used once. Any real reason to
change the lines above?
Larry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ssb: fix init regression with SoCs
2011-12-05 22:19 [PATCH] ssb: fix init regression with SoCs Hauke Mehrtens
2011-12-05 23:44 ` Larry Finger
@ 2011-12-06 19:56 ` John W. Linville
1 sibling, 0 replies; 4+ messages in thread
From: John W. Linville @ 2011-12-06 19:56 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-wireless, Michael Buesch, Rafał Miłecki
On Mon, Dec 05, 2011 at 11:19:51PM +0100, Hauke Mehrtens wrote:
> This fixes a Data bus error on some SoCs. The first fix for this
> problem did not solve it on all devices.
> commit 6ae8ec27868bfdbb815287bee8146acbefaee867
> Author: Rafał Miłecki <zajec5@gmail.com>
> Date: Tue Jul 5 17:25:32 2011 +0200
> ssb: fix init regression of hostmode PCI core
>
> In ssb_pcicore_fix_sprom_core_index() the sprom on the PCI core is
> accessed, but the sprom only exists when the ssb bus is connected over
> a PCI bus to the rest of the system and not when the SSB Bus is the
> main system bus. SoCs sometimes have a PCI host controller and there
> this code will not be executed, but there are some old SoCs with an PCI
> controller in client mode around and ssb_pcicore_fix_sprom_core_index()
> should not be called on these devices too. The PCI controller on these
> devices are unused, but without this fix it results in an Data bus
> error when it gets initialized.
>
> CC: Michael Buesch <m@bues.ch>
> CC: Rafał Miłecki <zajec5@gmail.com>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Should this go to the stable list?
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ssb: fix init regression with SoCs
2011-12-05 23:44 ` Larry Finger
@ 2011-12-08 22:37 ` Hauke Mehrtens
0 siblings, 0 replies; 4+ messages in thread
From: Hauke Mehrtens @ 2011-12-08 22:37 UTC (permalink / raw)
To: Larry Finger
Cc: linville, linux-wireless, Michael Buesch, Rafał Miłecki
Hi Larry,
On 12/06/2011 12:44 AM, Larry Finger wrote:
> On 12/05/2011 04:19 PM, Hauke Mehrtens wrote:
>> --- a/drivers/ssb/driver_pcicore.c
>> +++ b/drivers/ssb/driver_pcicore.c
>> @@ -517,10 +517,14 @@ static void
>> ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)
>>
>> static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore
>> *pc)
>> {
>> - ssb_pcicore_fix_sprom_core_index(pc);
>> + struct ssb_device *pdev = pc->dev;
>> + struct ssb_bus *bus = pdev->bus;
>> +
>> + if (bus->bustype == SSB_BUSTYPE_PCI)
>> + ssb_pcicore_fix_sprom_core_index(pc);
>>
>> /* Disable PCI interrupts. */
>> - ssb_write32(pc->dev, SSB_INTVEC, 0);
>> + ssb_write32(pdev, SSB_INTVEC, 0);
>
> As bus == pc->dev->bus is only used once, why bother to create it? If
> you were to change that, then pdev == pc->dev is only used once. Any
> real reason to change the lines above?
Not really, I will send a v2.
Hauke
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-08 22:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-05 22:19 [PATCH] ssb: fix init regression with SoCs Hauke Mehrtens
2011-12-05 23:44 ` Larry Finger
2011-12-08 22:37 ` Hauke Mehrtens
2011-12-06 19:56 ` John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).