Bug 214235 - [bwi] loading if_bwi fails to create parent DMA tag, causes "kstack allocation failed" errors
Summary: [bwi] loading if_bwi fails to create parent DMA tag, causes "kstack allocatio...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 10.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Andriy Voskoboinyk
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-11-05 05:50 UTC by 0x5a80
Modified: 2018-12-18 22:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 0x5a80 2016-11-05 05:50:58 UTC
Description: 

    Overview: On a PowerBook G4 running FreeBSD 10.3-RELEASE, using kldload to load the bwi module fails with "could not create parent DMA tag" and running nearly any process produces "vm_thread_new: kstack allocation failed" errors. Loading the module at boot makes the computer lose power entirely and begin booting again. 

    Steps to Reproduce: 
    
    1. Build and install bwi-firmware-kmod from ports on a Powerbook G4 with a BCM4306v2 network card.
    2. To trigger the kstack allocation errors, kldload if_bwi.
    3. To trigger the repeated booting, add if_bwi_load="YES" to loader.conf and reboot the machine.


    Actual Results: After "kldload if_bwi", any application that uses a significant amount of resources will fail to work -- an easy example is to open a sizeable number of tmux windows. If if_bwi is loaded at boot time, the machine will repeatedly switch off and begin booting again midway through the boot process until the related modules are disabled in OFW.


    Expected Results: Loading if_bwi should create a bwi0 device that can be used to establish a network connection.

    Build Date & Hardware: Nov 05, 2016. BCM4306 rev2 on 15" Powerbook G4 (Motorola PowerPC 7457).
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-11-06 13:51:54 UTC
A commit references this bug:

Author: avos
Date: Sun Nov  6 13:50:54 UTC 2016
New revision: 308367
URL: https://svnweb.freebsd.org/changeset/base/308367

Log:
  MFC r283636:
  - Don't request BUS_DMA_ALLOCNOW for dma tags, that requires enormous
  amount of memory.
  - Don't request segsize of BUS_SPACE_MAXSIZE_32BIT, when maxsize is
  MCLBYTES.

  With this change bwi_attach() can succeed on i386.

  PR:		214235
  Submitted by:	scottl

Changes:
_U  stable/10/
  stable/10/sys/dev/bwi/if_bwi.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-11-06 14:25:59 UTC
A commit references this bug:

Author: avos
Date: Sun Nov  6 14:25:52 UTC 2016
New revision: 308372
URL: https://svnweb.freebsd.org/changeset/base/308372

Log:
  MFC r283636:
  - Don't request BUS_DMA_ALLOCNOW for dma tags, that requires enormous
  amount of memory.
  - Don't request segsize of BUS_SPACE_MAXSIZE_32BIT, when maxsize is
  MCLBYTES.

  With this change bwi_attach() can succeed on i386.

  PR:		214235
  Submitted by:	scottl

Changes:
_U  stable/9/sys/
  stable/9/sys/dev/bwi/if_bwi.c
Comment 3 Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-11-06 14:34:27 UTC
This was caused by r281826; can you update to the latest 10-STABLE (or 11.0-RELEASE) and check if everything works fine?
Comment 4 0x5a80 2016-11-06 23:12:24 UTC
(In reply to Andriy Voskoboinyk from comment #3)
Why was the version changed to 10.2-RELEASE? Both uname and freebsd-version returned 10.3-RELEASE when I wrote this PR.
I've done a fresh install of 11.0-RELEASE. "kldload if_bwi" now panics with "unknown phymode -213538600".

The output of freebsd-version is: FreeBSD gyaooon 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 05:26:23 UTC 2016     root@releng2.nyi.freebsd.org:/usr/obj/powerpc.powerpc/usr/src/sys/GENERIC  powerpc
Comment 5 Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-11-06 23:17:29 UTC
(In reply to 0x5a80 from comment #4)
Because it was broken (initially) in 10.2-RELEASE (and not fixed in 10.3-RELEASE)
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:45:36 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 7 Andriy Voskoboinyk freebsd_committer freebsd_triage 2018-12-18 22:26:08 UTC
"unknown phymode" error was fixed in base r337570 (included into 12.0-RELEASE); for 11-STABLE - in base r337951 (not included into 11.2-RELEASE).

I have not tested the driver, so if it still does not work - feel free to reopen this bug.