13 Sep, 2019

1 commit

  • Don't populate the array pwr_info_offset on the stack but instead make it
    static const. Makes the object code smaller by 207 bytes.

    Before:
    text data bss dec hex filename
    26066 3000 64 29130 71ca drivers/ssb/pci.o

    After:
    text data bss dec hex filename
    25763 3096 64 28923 70fb drivers/ssb/pci.o

    (gcc version 9.2.1, amd64)

    Signed-off-by: Colin Ian King
    Acked-by: Michael Büsch
    Signed-off-by: Kalle Valo

    Colin Ian King
     

08 Apr, 2019

1 commit

  • mmiowb() is now implied by spin_unlock() on architectures that require
    it, so there is no reason to call it from driver code. This patch was
    generated using coccinelle:

    @mmiowb@
    @@
    - mmiowb();

    and invoked as:

    $ for d in drivers include/linux/qed sound; do \
    spatch --include-headers --sp-file mmiowb.cocci --dir $d --in-place; done

    NOTE: mmiowb() has only ever guaranteed ordering in conjunction with
    spin_unlock(). However, pairing each mmiowb() removal in this patch with
    the corresponding call to spin_unlock() is not at all trivial, so there
    is a small chance that this change may regress any drivers incorrectly
    relying on mmiowb() to order MMIO writes between CPUs using lock-free
    synchronisation. If you've ended up bisecting to this commit, you can
    reintroduce the mmiowb() calls using wmb() instead, which should restore
    the old behaviour on all architectures other than some esoteric ia64
    systems.

    Acked-by: Linus Torvalds
    Signed-off-by: Will Deacon

    Will Deacon
     

09 Aug, 2018

2 commits

  • Use the standard WARN_ON instead.
    If a small kernel is desired, WARN_ON can be disabled globally.

    Also remove SSB_DEBUG. Besides WARN_ON it only adds a tiny debug check.
    Include this check unconditionally.

    Signed-off-by: Michael Buesch
    Signed-off-by: Kalle Valo

    Michael Büsch
     
  • Replace the ssb printk wrappers by standard print helpers.
    Also remove SSB_SILENT. Nobody should use it anyway.

    Originally submitted by Joe Perches .
    Modified to add dev_... based printks.

    Signed-off-by: Michael Buesch
    Tested-by: Michael Buesch
    Cc: Joe Perches
    Signed-off-by: Kalle Valo

    Michael Büsch
     

17 Nov, 2016

1 commit


19 Jul, 2014

1 commit


16 Jul, 2014

2 commits


26 Mar, 2013

2 commits


14 Mar, 2013

1 commit

  • Since commit e565275 entitled "ssb: pci: Standardize a function to get mac
    address", the SPROM readout of the MAC has had the values flipped so that
    00:11:22:33:44:55 became 11:00:33:22:55:44. The fix has been tested on both
    little- and big-endian architectures.

    Reported-by: Rafał Miłecki
    Signed-off-by: Larry Finger
    Signed-off-by: John W. Linville

    Larry Finger
     

07 Mar, 2013

2 commits


17 May, 2012

4 commits

  • These newly added attributes are used by brcmsmac. Now bcma should
    parse all attributes used by brcmsmac out of the sprom.

    Signed-off-by: Hauke Mehrtens
    Tested-by: Arend van Spriel
    Signed-off-by: John W. Linville

    Hauke Mehrtens
     
  • This attribute is now used in b43 driver and should be filled for all
    sprom versions.

    Signed-off-by: Hauke Mehrtens
    Signed-off-by: John W. Linville

    Hauke Mehrtens
     
  • The attribute country_code and alpha2 are two different attributes in
    the sprom. country_code contains some code in an 8 bit coding and
    alpha2 contains two chars with the country code. The attributes where
    read out wrongly in the past and country_code is only available on
    sprom version 1.

    Signed-off-by: Hauke Mehrtens
    Tested-by: Arend van Spriel
    Signed-off-by: John W. Linville

    Hauke Mehrtens
     
  • Previously the rev contained the revision read from the pci config
    space and was used as board_rev in the wireless drivers. This is wrong
    the board_rev is only fetched from the sprom accordingly to the open
    source part of the Broadcom SDK and brcmsmac. This patch removes the
    rev from the boardinfo structure and uses the board_rev attribute from
    sprom instead. This attribute is filled by PCI, PCMCIA, SDIO and SoC
    code.

    Signed-off-by: Hauke Mehrtens
    Tested-by: Arend van Spriel
    Signed-off-by: John W. Linville

    Hauke Mehrtens
     

06 Mar, 2012

1 commit

  • There is no 2.4 GHz or 5GHz antenna gain stored in sprom. The sprom
    just stores the gain values for antenna 1 and 2 or 1 to 4 for more
    recent sprom versions. On old devices antenna 2 was used for 5 GHz wifi.

    Signed-off-by: Hauke Mehrtens
    Signed-off-by: John W. Linville

    Hauke Mehrtens
     

25 Jan, 2012

1 commit

  • We already extract some basic info but it's incomplete, reads info
    about the first core only. Used data structure doesn't allow easy
    adding of more cores.
    This patch adds new struct and array for storing power info. The plan
    is to: switch all extractors (including the ones using NVRAM) to new
    struct, switch drivers, then deprecate and finally drop old SSB fields.

    Signed-off-by: Rafał Miłecki
    Signed-off-by: John W. Linville

    Rafał Miłecki
     

14 Dec, 2011

1 commit


26 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    fs: Merge split strings
    treewide: fix potentially dangerous trailing ';' in #defined values/expressions
    uwb: Fix misspelling of neighbourhood in comment
    net, netfilter: Remove redundant goto in ebt_ulog_packet
    trivial: don't touch files that are removed in the staging tree
    lib/vsprintf: replace link to Draft by final RFC number
    doc: Kconfig: `to be' -> `be'
    doc: Kconfig: Typo: square -> squared
    doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
    drivers/net: static should be at beginning of declaration
    drivers/media: static should be at beginning of declaration
    drivers/i2c: static should be at beginning of declaration
    XTENSA: static should be at beginning of declaration
    SH: static should be at beginning of declaration
    MIPS: static should be at beginning of declaration
    ARM: static should be at beginning of declaration
    rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
    Update my e-mail address
    PCIe ASPM: forcedly -> forcibly
    gma500: push through device driver tree
    ...

    Fix up trivial conflicts:
    - arch/arm/mach-ep93xx/dma-m2p.c (deleted)
    - drivers/gpio/gpio-ep93xx.c (renamed and context nearby)
    - drivers/net/r8169.c (just context changes)

    Linus Torvalds
     

07 Jul, 2011

1 commit


06 Jul, 2011

3 commits

  • The SSB code reads PCI subsystem IDs from the PCI configuration registers while
    they are already stored by the PCI subsystem in the 'subsystem_{vendor|device}'
    fields of 'struct pci_dev'...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: John W. Linville

    Sergei Shtylyov
     
  • The SSB code reads PCI revision ID from the PCI configuration register while
    it's already stored by the PCI subsystem in the 'revision' field of 'struct
    pci_dev'...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: John W. Linville

    Sergei Shtylyov
     
  • The SSB code reads PCI revision ID register as 16-bit entity while the register
    is actually 8-bit only (the next 8 bits are the programming interface register).
    Fix the read and make the 'rev' field of 'struct ssb_boardinfo' 8-bit as well,
    to match the register size.

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: John W. Linville

    Sergei Shtylyov
     

19 May, 2011

1 commit

  • Some embedded devices like the Netgear WNDR3300 have two SSB based cards
    without an own sprom on the pci bus. We have to provide two different
    fallback sproms for these and this was not possible with the old solution.
    In the bcm47xx architecture the sprom data is stored in the nvram in the
    main flash storage. The architecture code will be able to fill the sprom
    with the stored data based on the bus where the device was found.

    The bcm63xx code should do the same thing as before, just using the new
    API.

    Acked-by: Michael Buesch
    Cc: netdev@vger.kernel.org
    Cc: linux-wireless@vger.kernel.org
    Cc: Florian Fainelli
    Signed-off-by: Hauke Mehrtens
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/2362/
    Signed-off-by: Ralf Baechle

    Hauke Mehrtens
     

31 Mar, 2011

1 commit


19 Feb, 2011

1 commit


10 Feb, 2011

1 commit


03 Dec, 2010

1 commit


19 Nov, 2010

1 commit


17 Nov, 2010

2 commits


05 Jun, 2010

1 commit

  • In kernel Bugzilla #15825 (2 users), in a wireless mailing list thread
    (http://lists.infradead.org/pipermail/b43-dev/2010-May/000124.html), and on a
    netbook owned by John Linville
    (http://marc.info/?l=linux-wireless&m=127230751408818&w=4), there are reports
    of ssb failing to detect an SPROM at the normal location. After studying the
    MMIO trace dump for the Broadcom wl driver, it was determined that the affected
    boxes had a relocated SPROM.

    This patch fixes all systems that have reported this problem.

    Signed-off-by: Larry Finger
    Cc: Stable
    Signed-off-by: John W. Linville

    Larry Finger
     

29 May, 2010

1 commit

  • Ethernet driver b44 does register ssb by it's pcihost_wrapper
    and doesn't set ssb_chipcommon. A check on this value
    introduced with commit d53cdbb94a52a920d5420ed64d986c3523a56743
    and ea2db495f92ad2cf3301623e60cb95b4062bc484 triggers:

    BUG: unable to handle kernel NULL pointer dereference at 00000010
    IP: [] ssb_is_sprom_available+0x16/0x30

    Signed-off-by: Christoph Fritz
    Signed-off-by: John W. Linville

    Christoph Fritz
     

06 May, 2010

1 commit


27 Apr, 2010

3 commits

  • Signed-off-by: Rafał Miłecki
    Signed-off-by: John W. Linville

    Rafał Miłecki
     
  • Our offset handling becomes even a little more hackish now. For some reason I
    do not understand all offsets as inrelative. It assumes base offset is 0x1000
    but it will work for now as we make offsets relative anyway by removing base
    0x1000. Should be cleaner however.

    Signed-off-by: Rafał Miłecki
    Signed-off-by: John W. Linville

    Rafał Miłecki
     
  • Attempting to read registers that don't exist on the SSB bus can cause
    hangs on some boxes. At least some b43 devices are 'in the wild' that
    don't have SPROMs at all. When the SSB bus support loads, it attempts
    to read these (non-existant) SPROMs and causes hard hangs on the box --
    no console output, etc.

    This patch adds some intelligence to determine whether or not the SPROM
    is present before attempting to read it. This avoids those hard hangs
    on those devices with no SPROM attached to their SSB bus. The
    SSB-attached devices (e.g. b43, et al.) won't work, but at least the box
    will survive to test further patches. :-)

    Signed-off-by: John W. Linville
    Signed-off-by: Rafał Miłecki
    Cc: Larry Finger
    Cc: Michael Buesch

    John W. Linville
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo