ssb: Remove SSB_WARN_ON, SSB_BUG_ON and SSB_DEBUG

2018-07-31 Thread Michael Büsch
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 
---

CC-ing Mips and PPC maintainers due to changes in defconfig



 arch/mips/configs/bcm47xx_defconfig |  1 -
 arch/powerpc/configs/wii_defconfig  |  1 -
 drivers/ssb/Kconfig |  9 ---
 drivers/ssb/driver_chipcommon.c |  8 +++---
 drivers/ssb/driver_chipcommon_pmu.c | 10 
 drivers/ssb/driver_gpio.c   |  4 +--
 drivers/ssb/driver_pcicore.c|  6 ++---
 drivers/ssb/embedded.c  | 10 
 drivers/ssb/host_soc.c  | 12 -
 drivers/ssb/main.c  | 38 +
 drivers/ssb/pci.c   | 19 +--
 drivers/ssb/pcmcia.c| 14 +--
 drivers/ssb/scan.c  |  4 +--
 drivers/ssb/sdio.c  | 12 -
 drivers/ssb/ssb_private.h   |  9 ---
 include/linux/ssb/ssb.h |  2 --
 16 files changed, 63 insertions(+), 96 deletions(-)

diff --git a/arch/mips/configs/bcm47xx_defconfig 
b/arch/mips/configs/bcm47xx_defconfig
index fad8e964f14c..ba800a892384 100644
--- a/arch/mips/configs/bcm47xx_defconfig
+++ b/arch/mips/configs/bcm47xx_defconfig
@@ -66,7 +66,6 @@ CONFIG_HW_RANDOM=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_WATCHDOG=y
 CONFIG_BCM47XX_WDT=y
-CONFIG_SSB_DEBUG=y
 CONFIG_SSB_DRIVER_GIGE=y
 CONFIG_BCMA_DRIVER_GMAC_CMN=y
 CONFIG_USB=y
diff --git a/arch/powerpc/configs/wii_defconfig 
b/arch/powerpc/configs/wii_defconfig
index 10940533da71..f5c366b02828 100644
--- a/arch/powerpc/configs/wii_defconfig
+++ b/arch/powerpc/configs/wii_defconfig
@@ -78,7 +78,6 @@ CONFIG_GPIO_HLWD=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_GPIO=y
 # CONFIG_HWMON is not set
-CONFIG_SSB_DEBUG=y
 CONFIG_FB=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
index 6c438c819eb9..df30e1323252 100644
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -89,15 +89,6 @@ config SSB_HOST_SOC
 
  If unsure, say N
 
-config SSB_DEBUG
-   bool "SSB debugging"
-   depends on SSB
-   help
- This turns on additional runtime checks and debugging
- messages. Turn this on for SSB troubleshooting.
-
- If unsure, say N
-
 config SSB_SERIAL
bool
depends on SSB
diff --git a/drivers/ssb/driver_chipcommon.c b/drivers/ssb/driver_chipcommon.c
index 48050c6fd847..99a4656d113d 100644
--- a/drivers/ssb/driver_chipcommon.c
+++ b/drivers/ssb/driver_chipcommon.c
@@ -56,7 +56,7 @@ void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,
 
if (cc->capabilities & SSB_CHIPCO_CAP_PMU)
return; /* PMU controls clockmode, separated function needed */
-   SSB_WARN_ON(ccdev->id.revision >= 20);
+   WARN_ON(ccdev->id.revision >= 20);
 
/* chipcommon cores prior to rev6 don't support dynamic clock control */
if (ccdev->id.revision < 6)
@@ -111,7 +111,7 @@ void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,
}
break;
default:
-   SSB_WARN_ON(1);
+   WARN_ON(1);
}
 }
 
@@ -164,7 +164,7 @@ static int chipco_pctl_clockfreqlimit(struct ssb_chipcommon 
*cc, int get_max)
divisor = 32;
break;
default:
-   SSB_WARN_ON(1);
+   WARN_ON(1);
}
} else if (cc->dev->id.revision < 10) {
switch (clocksrc) {
@@ -277,7 +277,7 @@ static void calc_fast_powerup_delay(struct ssb_chipcommon 
*cc)
minfreq = chipco_pctl_clockfreqlimit(cc, 0);
pll_on_delay = chipco_read32(cc, SSB_CHIPCO_PLLONDELAY);
tmp = (((pll_on_delay + 2) * 100) + (minfreq - 1)) / minfreq;
-   SSB_WARN_ON(tmp & ~0x);
+   WARN_ON(tmp & ~0x);
 
cc->fast_pwrup_delay = tmp;
 }
diff --git a/drivers/ssb/driver_chipcommon_pmu.c 
b/drivers/ssb/driver_chipcommon_pmu.c
index e28682a53cdf..0f60e90ded26 100644
--- a/drivers/ssb/driver_chipcommon_pmu.c
+++ b/drivers/ssb/driver_chipcommon_pmu.c
@@ -128,7 +128,7 @@ static void ssb_pmu0_pllinit_r0(struct ssb_chipcommon *cc,
  ~(1 << SSB_PMURES_5354_BB_PLL_PU));
break;
default:
-   SSB_WARN_ON(1);
+   WARN_ON(1);
}
for (i = 1500; i; i--) {
tmp = chipco_read32(cc, SSB_CHIPCO_CLKCTLST);
@@ -265,7 +265,7 @@ static void ssb_pmu1_pllinit_r0(struct ssb_chipcommon *cc,
buffer_strength = 0x22;
break;
default:
-   SSB_WARN_ON(1);
+   WARN_ON(1);
}
for (i = 1500; i; i--) {
tmp = chipco_read32(cc, SSB_CHIPCO_CLKCTLST);
@@ -501,7 +501,7 @@ static 

Re: Linux 3.0 boot failure on the Powerbook G4

2011-07-25 Thread Michael Büsch
On Mon, 25 Jul 2011 09:23:38 +1000
Benjamin Herrenschmidt b...@kernel.crashing.org wrote:
 Hrm.. the faulting address is outside of the zImage. Odd.
 
 Can you try loading a plain vmlinux instead ? (feel free to strip it).

The plain unstripped vmlinux boots fine:

mb@maggie:~$ uname -a
Linux maggie 3.0.0 #3 PREEMPT Sun Jul 24 11:51:30 CEST 2011 ppc GNU/Linux

Is there something going wrong in the uncompress trampoline?

-- 
Greetings, Michael.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Linux 3.0 boot failure on the Powerbook G4

2011-07-24 Thread Michael Büsch
On Sun, 24 Jul 2011 10:06:03 +0200
Andreas Schwab sch...@linux-m68k.org wrote:

 Michael Büsch m...@bues.ch writes:
 
  Linux 3.0 fails to boot _very_ early on my Powerbook G4. See the
  yaboot/OF screenshot:
  http://bues.ch/misc/linux-3.0-pbook.jpg
 
  Linux 2.6.39.2 boots fine.
  Does somebody have an idea?
 
 Perhaps your image is getting too large?

I reduced the image size, so that it's way less than the
2.6.39 kernel size (old is 2.6.39. a is 3.0)
-rwxr-xr-x 1 root root 5.6M Jul 24 12:16 /boot/linux.a
-rwxr-xr-x 1 root root 6.3M Jul 23 20:50 /boot/linux.old

But that didn't help. :(

I'm currently trying to bisect it, but that turns out to be hard
due to various compile issues and stuff like that...

-- 
Greetings, Michael.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Linux 3.0 boot failure on the Powerbook G4

2011-07-24 Thread Michael Büsch
On Sun, 24 Jul 2011 22:07:30 +1000
Benjamin Herrenschmidt b...@kernel.crashing.org wrote:

 On Sat, 2011-07-23 at 22:20 +0200, Michael Büsch wrote:
  Linux 3.0 fails to boot _very_ early on my Powerbook G4. See the
  yaboot/OF screenshot:
  http://bues.ch/misc/linux-3.0-pbook.jpg
  
  Linux 2.6.39.2 boots fine.
  Does somebody have an idea?
 
 Interesting, that's before it even kills OF. Are you booting a zImage or
 a vmlinux ?

I'm booting zImage.pmac.

 It might be also useful to compile yaboot with debug output enabled to
 figure out where the kernel is loaded so we can try calculating where
 exactly it dies if it's a vmlinux...

Hm, I guess I could probably try that.

-- 
Greetings, Michael.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Linux 3.0 boot failure on the Powerbook G4

2011-07-24 Thread Michael Büsch
On Sun, 24 Jul 2011 22:13:34 +1000
Benjamin Herrenschmidt b...@kernel.crashing.org wrote:
  I'm booting zImage.pmac.
 
 Ah that might make it easier... I don't remember where it links, can you
 show me the program headers out of readelf -a of the zImage ?

As I recompiled stuff, here's the current failure log:
http://bues.ch/misc/linux-3.0-pbook-2.jpg

And this is the corresponding readelf output:

mb@maggie:~$ readelf -a /boot/linux.a
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
  Class: ELF32
  Data:  2's complement, big endian
  Version:   1 (current)
  OS/ABI:UNIX - System V
  ABI Version:   0
  Type:  EXEC (Executable file)
  Machine:   PowerPC
  Version:   0x1
  Entry point address:   0x400230
  Start of program headers:  52 (bytes into file)
  Start of section headers:  5769716 (bytes into file)
  Flags: 0x8000, relocatable-lib
  Size of this header:   52 (bytes)
  Size of program headers:   32 (bytes)
  Number of program headers: 2
  Size of section headers:   40 (bytes)
  Number of section headers: 12
  Section header string table index: 9

Section Headers:
  [Nr] Name  TypeAddr OffSize   ES Flg Lk Inf Al
  [ 0]   NULL 00 00 00  0   0  0
  [ 1] .text PROGBITS0040 01 0048b0 00  AX  0   0  4
  [ 2] .data PROGBITS00405000 015000 0012f8 00  WA  0   0  4
  [ 3] .got  PROGBITS004062f8 0162f8 0c 04  WA  0   0  4
  [ 4] __builtin_cmdline PROGBITS00406304 016304 000200 00  WA  0   0  4
  [ 5] .kernel:vmlinux.s PROGBITS00407000 017000 569952 00   A  0   0  1
  [ 6] .bss  NOBITS  00971000 580952 00bc70 00  WA  0   0  4
  [ 7] .comment  PROGBITS 580952 1c 01  MS  0   0  1
  [ 8] .gnu.attributes   LOOS+ff5 58096e 14 00  0   0  1
  [ 9] .shstrtab STRTAB   580982 72 00  0   0  1
  [10] .symtab   SYMTAB   580bd4 000780 10 11  55  4
  [11] .strtab   STRTAB   581354 0004f3 00  0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type   Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD   0x01 0x0040 0x0040 0x570952 0x57cc70 RWE 0x1
  GNU_STACK  0x00 0x 0x 0x0 0x0 RWE 0x4

 Section to Segment mapping:
  Segment Sections...
   00 .text .data .got __builtin_cmdline .kernel:vmlinux.strip .bss 
   01 

There is no dynamic section in this file.

There are no relocations in this file.

There are no unwind sections in this file.

Symbol table '.symtab' contains 120 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 0:  0 NOTYPE  LOCAL  DEFAULT  UND 
 1: 0040 0 SECTION LOCAL  DEFAULT1 
 2: 00405000 0 SECTION LOCAL  DEFAULT2 
 3: 004062f8 0 SECTION LOCAL  DEFAULT3 
 4: 00406304 0 SECTION LOCAL  DEFAULT4 
 5: 00407000 0 SECTION LOCAL  DEFAULT5 
 6: 00971000 0 SECTION LOCAL  DEFAULT6 
 7:  0 SECTION LOCAL  DEFAULT7 
 8:  0 SECTION LOCAL  DEFAULT8 
 9:  0 FILELOCAL  DEFAULT  ABS of.c
10: 004096 FUNCLOCAL  DEFAULT1 of_image_hdr
11: 00400130   220 FUNCLOCAL  DEFAULT1 of_try_claim
12: 00971000 4 OBJECT  LOCAL  DEFAULT6 claim_base
13:  0 FILELOCAL  DEFAULT  ABS empty.c
14: 0040021c 0 NOTYPE  LOCAL  DEFAULT1 p_start
15: 00400220 0 NOTYPE  LOCAL  DEFAULT1 p_etext
16: 00400224 0 NOTYPE  LOCAL  DEFAULT1 p_bss_start
17: 00400228 0 NOTYPE  LOCAL  DEFAULT1 p_end
18: 0040022c 0 NOTYPE  LOCAL  DEFAULT1 p_pstack
19: 00400234 0 NOTYPE  LOCAL  DEFAULT1 p_base
20: 0007 0 NOTYPE  LOCAL  DEFAULT  ABS RELA
21: 6ff9 0 NOTYPE  LOCAL  DEFAULT  ABS RELACOUNT
22:  0 FILELOCAL  DEFAULT  ABS main.c
23: 0040032c   536 FUNCLOCAL  DEFAULT1 prep_kernel
24: 00971004 46960 OBJECT  LOCAL  DEFAULT6 gzstate
25: 00406304   512 OBJECT  LOCAL  DEFAULT4 cmdline
26:  0 FILELOCAL  DEFAULT  ABS gunzip_util.c
27: 0097c774   128 OBJECT  LOCAL  DEFAULT6 discard_buf.1439
28:  0 FILELOCAL  DEFAULT  ABS elf_util.c
  

Linux 3.0 boot failure on the Powerbook G4

2011-07-23 Thread Michael Büsch
Linux 3.0 fails to boot _very_ early on my Powerbook G4. See the
yaboot/OF screenshot:
http://bues.ch/misc/linux-3.0-pbook.jpg

Linux 2.6.39.2 boots fine.
Does somebody have an idea?

The config can be found here:
http://bues.ch/misc/linux-3.0-ppc-config
It's mostly equivalent to the working 2.6.39 config. I enabled
early OF console, but that didn't help to show better error messages.

The machine is a:

cpu : 7447A, altivec supported
clock   : 1499.999000MHz
revision: 1.2 (pvr 8003 0102)
platform: PowerMac
motherboard : PowerBook5,6 MacRISC3 Power Macintosh 
detected as : 287 (PowerBook G4 15)
pmac-generation : NewWorld

-- 
Greetings, Michael.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev