Skip to contentSkip to conversation

bcma usage in isr context

DISCUSSION Arend van Spriel 2 participants 7 messages Dec 1, 2011 – Dec 9, 2011

lore
Share & tools
lore
#0 lore raw

Hi Rafał,

I am doing some final testing on our brcmsmac driver, which I tinkered to become a bcma device driver. During testing an issue popped up in the ISR code.

Looking into the bcma read/write functions in host_pci.c I conclude that bcma itself does not provide protection for concurrency. Am I correct in that? How is this solved in b43?

Gr. AvS

#1 lore raw

Hi,

Sorry for late reply, I was a little busy recently...

W dniu 1 grudnia 2011 14:09 u?ytkownik Arend van Spriel <[email protected]> napisa?:

Quoted 3 lines

I am doing some final testing on our brcmsmac driver, which I tinkered to become a bcma device driver. During testing an issue popped up in the ISR code.

Do you mean interrupts code?

Quoted 3 lines

Looking into the bcma read/write functions in host_pci.c I conclude that bcma itself does not provide protection for concurrency. Am I correct in that? How is this solved in b43?

I think I mean the fact that core driver can switch BCMA to ChipCommon, while interrupt handler will try to access 80211 core?

You're right, we don't handle this properly. I'll try to send patch today to make use of fixed windows. I've it here for some time already, just didn't clean it enough.

Signature · 1 line
Rafa?
#2 lore raw
Quoted 11 lines · Rafał Miłecki

Hi,

Sorry for late reply, I was a little busy recently...

W dniu 1 grudnia 2011 14:09 użytkownik Arend van Spriel

Quoted 3 lines · <[email protected]> napisał:

I am doing some final testing on our brcmsmac driver, which I tinkered to become a bcma device driver. During testing an issue popped up in the ISR code.

Do you mean interrupts code?

Yep. ISR stands for 'interrupt service routine'.

Quoted 6 lines
Quoted 3 lines

Looking into the bcma read/write functions in host_pci.c I conclude that bcma itself does not provide protection for concurrency. Am I correct in that? How is this solved in b43?

I think I mean the fact that core driver can switch BCMA to ChipCommon, while interrupt handler will try to access 80211 core?

That is indeed what I mean.

Quoted 4 lines

You're right, we don't handle this properly. I'll try to send patch today to make use of fixed windows. I've it here for some time already, just didn't clean it enough.

Ok. For now I have a patch in the bcma read/write host_pci functions that solves it, but fixed bar windows are preferable.

Gr. AvS

#3 lore raw

W dniu 5 grudnia 2011 16:27 u?ytkownik Arend van Spriel <[email protected]> napisa?:

Quoted 7 lines
Quoted 4 lines

You're right, we don't handle this properly. I'll try to send patch today to make use of fixed windows. I've it here for some time already, just didn't clean it enough.

Ok. For now I have a patch in the bcma read/write host_pci functions that solves it, but fixed bar windows are preferable.

Have you tested my patch? Does it solver your issue? I can't wait to see bcma patches for brcmsmac :)

Signature · 1 line
Rafa?
#4 lore raw
Quoted 7 lines · Rafał Miłecki

W dniu 5 grudnia 2011 16:27 użytkownik Arend van Spriel

Quoted 5 lines · <[email protected]> napisał:
Quoted 4 lines

You're right, we don't handle this properly. I'll try to send patch today to make use of fixed windows. I've it here for some time already, just didn't clean it enough.

Quoted 6 lines
Quoted 2 lines

Ok. For now I have a patch in the bcma read/write host_pci functions that solves it, but fixed bar windows are preferable.

Have you tested my patch? Does it solver your issue? I can't wait to see bcma patches for brcmsmac :)

Not yet. I had a patch in which each read/write used a spin_lock_irqsave/spin_unlock_irqrestore. Did not cause to much latency. I intend to rebase my changes using your patch later today.

Your patch only works if all cores fit in the window. This is the case for the current pci-based broadcom chipsets so the patch is fine. I will let you know the results. I also intend to do some suspend/resume testing. I believe there was some issue mentioned on wireless mailing list with bcma/b43.

Gr. AvS

#5 lore raw

W dniu 7 grudnia 2011 15:01 u?ytkownik Arend van Spriel <[email protected]> napisa?:

Quoted 3 lines

I also intend to do some suspend/resume
testing. I believe there was some issue mentioned on wireless mailing list with bcma/b43.

That would be great. I don't have any notebook to use with Broadcom card, that's why suspend&resume isn't implemented. I do all development with my PC. In the notebook wireless card is integrated with the motherboard.

Signature · 1 line
Rafa?
#6 lore raw
Quoted 11 lines · Rafał Miłecki

W dniu 7 grudnia 2011 15:01 użytkownik Arend van Spriel

Quoted 3 lines · <[email protected]> napisał:

I also intend to do some suspend/resume
testing. I believe there was some issue mentioned on wireless mailing list with bcma/b43.

That would be great. I don't have any notebook to use with Broadcom card, that's why suspend&resume isn't implemented. I do all development with my PC. In the notebook wireless card is integrated with the motherboard.

Hi Rafał,

Your patch works so I dropped my temp solution using spinlock. Regarding suspend/resume it works for suspend-to-ram. The connection is not reestablished, but that is probably because I have it not configured in NetworkManager to automatically connect.

Gr. AvS