Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcm2708-vcio: Remove module #1087

Merged
merged 5 commits into from
Jul 27, 2015
Merged

bcm2708-vcio: Remove module #1087

merged 5 commits into from
Jul 27, 2015

Conversation

notro
Copy link
Contributor

@notro notro commented Jul 24, 2015

All drivers have been converted to the new firmware API, so this module is not needed anymore.

notro added 5 commits July 24, 2015 19:33
If forgot this when converting the drivers.

Signed-off-by: Noralf Trønnes <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
All drivers have been converted to the new firmware API, so this
module is not needed anymore.

Signed-off-by: Noralf Trønnes <[email protected]>
This reverts commit 40aa3c4.

The legacy mailbox API has been removed so this is not needed.

Signed-off-by: Noralf Trønnes <[email protected]>
popcornmix added a commit that referenced this pull request Jul 27, 2015
bcm2708-vcio: Remove module
@popcornmix popcornmix merged commit 9f1d5c7 into raspberrypi:rpi-4.1.y Jul 27, 2015
@popcornmix
Copy link
Collaborator

Thanks notro. Seems okay in testing and nice to drop downstream drivers.

@popcornmix
Copy link
Collaborator

BTW we have an early rpi-4.2.y tree that seems functional.
I attempted cherry-picking your firmware PRs to 4.2, but as a number of the commits are upstream (and not identical to the downstream commits) and I'm getting quite a few conflicts.

If you fancied porting these commits to 4.2 I'd be happy to accept a PR.

@notro notro deleted the vcio-rm branch July 27, 2015 13:36
@notro
Copy link
Contributor Author

notro commented Jul 27, 2015

I can make a PR.

@notro
Copy link
Contributor Author

notro commented Jul 27, 2015

I can't get 4.2 to boot on Pi1 B+ (no fw patches). It hangs with the ACT led constantly lit.
Latest firmware.
Raspian: 2015-05-05-raspbian-wheezy

[   11.057226] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ ok ] Cleaning up temporary files... /tmp.
[info] Loading kernel module snd-bcm2835.
[ ok ] Activating lvm and md swap...done.
[....] Checking file systems...fsck from util-linux 2.20.1
dosfsck 3.0.13, 30 Jun 2012, FAT32, LFN
/dev/mmcblk0p1: 67 files, 2523/7161 clusters
done.
[ ok ] Mounting local filesystems...done.
[ ok ] Activating swapfile swap...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables ...done.
[....] Configuring network interfaces...

Full log: https://gist.github.com/notro/45e5c7b5ea908d58f1ba

@popcornmix
Copy link
Collaborator

Have you tried with Pi2? I'm running it currently:
Linux raspberrypi 4.2.0-rc4-v7+ #1551 SMP PREEMPT Mon Jul 27 14:29:28 BST 2015 armv7l GNU/Linux
Now it does ring a bell that @pelwell mentioned it wasn't working on PI1, and I think he had a fix. Unfortunately he's off this week. I'll try and remember what it was...

@notro
Copy link
Contributor Author

notro commented Jul 27, 2015

I'm doing a build for Pi2 now.

@notro
Copy link
Contributor Author

notro commented Jul 27, 2015

I get the same behaviour on Pi2, hang with constantly lit ACT. I took out the SD card to see if I could force an error, but nothing happend.

[    0.000000] Linux version 4.2.0-rc4-v7+ (pi@raspi2) (gcc version 4.8.3 20140106 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11) ) #1 SMP PREEMPT Mon Jul 27 20:36:59 CEST 2015
...
[    5.935110] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ ok ] Cleaning up temporary files... /tmp.
[info] Loading kernel module snd-bcm2835.
[ ok ] Activating lvm and md swap...done.
[....] Checking file systems...fsck from util-linux 2.20.1
dosfsck 3.0.13, 30 Jun 2012, FAT32, LFN
/dev/mmcblk0p1: 76 files, 3961/7161 clusters
done.
[ ok ] Mounting local filesystems...done.
[ ok ] Activating swapfile swap...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables ...done.
[....] Configuring network interfaces...wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting up ALSA...done.
[info] Setting console screen modes.
setterm: cannot (un)set powersave mode: Inappropriate ioctl for device
[info] Skipping font and keymap setup (handled by console-setup).
[ ok ] Setting up console font and keymap...done.
[....] Setting sensors limitsNo sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
. ok
[ ok ] Setting up X socket directories... /tmp/.X11-unix /tmp/.ICE-unix.
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.

@popcornmix
Copy link
Collaborator

I'm running an nfs boot. But sdcard seems usable (e.g. md5sum /boot).
If firmware (start.elf) latest? Any different with dtoverlay=sdhost?

@notro
Copy link
Contributor Author

notro commented Jul 27, 2015

start.elf is latest: 24. july

This is with sdhost after 40-50 minutes, messages slowly drip in:

[    1.886655] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)

[    1.994983] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.997965] mmc0: new high speed SDHC card at address e624
[    1.998612] mmcblk0: mmc0:e624 SL08G 7.40 GiB
[    2.000004]  mmcblk0: p1 p2

[    5.324388] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[....] Checking root file system...fsck from util-linux 2.20.1
e2fsck 1.42.5 (29-Jul-2012)
/dev/mmcblk0p2: clean, 93045/482384 files, 725568/1925120 blocks
done.
[    5.557016] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ ok ] Cleaning up temporary files... /tmp.
[info] Loading kernel module snd-bcm2835.
[ ok ] Activating lvm and md swap...done.
[....] Checking file systems...fsck from util-linux 2.20.1
dosfsck 3.0.13, 30 Jun 2012, FAT32, LFN
/dev/mmcblk0p1: 67 files, 2525/7161 clusters
done.
[ ok ] Mounting local filesystems...done.
[ ok ] Activating swapfile swap...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables ...done.
[....] Configuring network interfaces...wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting up ALSA...done.
[info] Setting console screen modes.
setterm: cannot (un)set powersave mode: Inappropriate ioctl for device
[info] Skipping font and keymap setup (handled by console-setup).
[ ok ] Setting up console font and keymap...done.
[ ok ] Setting up X socket directories... /tmp/.X11-unix /tmp/.ICE-unix.
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
Error opening '/dev/input/event*': No such file or directory
[ ok ] Network Interface Plugging Daemon...skip eth0...done.
[info] Initializing cgroups.
[....] Starting enhanced syslogd: rsyslogddhcpcd[1902]: version 6.7.1 starting
[warn] Kernel lacks cgroups or memory controller not available, not starting cgroups. ... (warning).
[  354.697429] EXT4-fs error (device mmcblk0p2): ext4_journal_check_start:56: Detected aborted journal
[  354.710132] EXT4-fs (mmcblk0p2): Remounting filesystem read-only

gzip: /var/log//dmesg.0.gz: Read-only file system
mv: cannot move `/var/log//dmesg.0.gz' to `/var/log//dmesg.1.gz': Read-only file system
touch: cannot touch `/var/log/dmesg.new': Read-only file system
chown: cannot access `/var/log/dmesg.new': No such file or directory
chmod: cannot access `/var/log/dmesg.new': No such file or directory
ln: cannot remove `/var/log//dmesg.0': Read-only file system
Error hardlinking /var/log/dmesg to /var/log//dmesg.0
/etc/init.d/bootlogs: 23: /etc/init.d/bootlogs: cannot create /var/log/dmesg: Read-only file system
chgrp: changing group of `/var/log/dmesg': Read-only file system
dhcpcd[1902]: all: IPv6 kernel autoconf disabled
dhcpcd[1902]: eth0: adding address fe80::c65b:118d:81dc:b45
dhcpcd[1902]: if_addaddress6: Operation not supported
Starting dphys-swapfile swapfile setup ...
dhcpcd[1902]: DUID 00:01:00:01:1c:dd:60:5f:b8:27:eb:6e:52:28
dhcpcd[1902]: eth0: IAID eb:6e:52:28
dhcpcd[1902]: timed out
dhcpcd[1902]: forked to background, child pid 2013
[ ok ady started.
want /var/swap=100MByte, checking existing[....] Starting NTP server: ntpd
[....] Starting system message bus: dbus[....] Starting periodic command scheduler: cron: keeping it
swapon: /var/swap: swapon failed: Read-only file system
done.
. ok
. ok

Here's a log with sdhost debug turned on: https://gist.github.com/notro/f6a40280e5a47a566644

@popcornmix
Copy link
Collaborator

Are you using bcm2709_defconfig? Seem to be a few differences in kernel log. I have:

[    0.000000] On node 0 totalpages: 192512
[    0.000000] free_area_init_node: node 0, pgdat 8086b1c0, node_mem_map ae156000
[    0.000000]   Normal zone: 1692 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 192512 pages, LIFO batch:31

which you don't. And you have deadline scheduler (I have cfq).

http://paste.ubuntu.com/11950595/

@notro
Copy link
Contributor Author

notro commented Jul 27, 2015

I use bcm2709_defconfig.
The free_area_init_node message is a debug message, so when I turn on that, I also get the message.
elevator=deadline is set in Raspian cmdline.txt

Have you tried booting with rootfs on the SD card?

@notro
Copy link
Contributor Author

notro commented Jul 28, 2015

Booting from nfs worked: https://gist.github.com/notro/eccc2a7e1c970a6cb22c

@notro
Copy link
Contributor Author

notro commented Aug 6, 2015

Is 4.2 and rootfs on the sd card working now?

@popcornmix
Copy link
Collaborator

I don't think so. I did test and observed the same hang you reported.
We have since updated to -rc5 which I haven't retested with sdcard, but I don't imagine that will fix it.
@pelwell is back off holiday on Monday, so we'll have a think about what might be going wrong then.

@popcornmix
Copy link
Collaborator

@notro - @pelwell is back and we've had a look at booting from sdcard and it seems fine.
Not sure if one of -rc updates fixed it, or if I had finger trouble when testing (not updating the dtb files from the original raspbian image would have a similar failure mode).

Can you try again with latest rpi-4.2.y tree and make sure dtb files are from 4.2 kernel and report back if it's working?

@notro
Copy link
Contributor Author

notro commented Aug 11, 2015

It's working now. I did use the correct dtb files last time, my build script takes care of that for me. I'll get on with the PR now.

@notro
Copy link
Contributor Author

notro commented Aug 12, 2015

@pelwell When I realised that the bcm2835 DT patches hadn't been carried over from 4.1 to 4.2, I sat back and wondered if there could be an easier way to do this than to keep carrying those patches.

What do you think about this approach I just tried?

arch/arm/boot/dts/bcm2835-rpi-b-plus.dts

#include "bcm2708-rpi-b-plus.dts"

/ {
  compatible = "brcm,bcm2835";

  soc {
    ranges = <0x7e000000 0x20000000 0x02000000>;
    dma-ranges = <0x40000000 0x00000000 0x20000000>;

    timer@7e003000 {
      compatible = "brcm,bcm2835-system-timer";
      reg = <0x7e003000 0x1000>;
      interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
      clock-frequency = <1000000>;
    };
  };
};

&intc {
  compatible = "brcm,bcm2835-armctrl-ic";
};

The same would have to be done for bcm2835-rpi-b.dts also and they will be identical except for the include.
Not sure if there's any point in putting this in a common file that both would include?

The ranges property (length value) differs between bcm2835.dtsi and bcm2708.dtsi and looking it up I see it's because of a change you made: 8bbf5ee

This is a good illustration of how close we have come to mainline.

@notro
Copy link
Contributor Author

notro commented Aug 12, 2015

We could also add the timer node to bcm2708_common.dtsi to simplify it further.

And maybe we can build drivers/clocksource/bcm2835_timer.c on BCM270x and make this change (untested):

 static void __init bcm2708_timer_init(void)
 {
+   if (use_dt) {
+       of_clk_init(NULL);
+       clocksource_of_init();
+       return;
+   }
+
    /* init high res timer */
    bcm2708_clocksource_init();

Ref: http://lxr.free-electrons.com/source/arch/arm/kernel/time.c#L115

@notro
Copy link
Contributor Author

notro commented Aug 12, 2015

And I guess we should be able to use brcm,bcm2835-armctrl-ic on BCM270x also, now that it has fiq support: c1a5966

@notro
Copy link
Contributor Author

notro commented Aug 13, 2015

Ok, I see that bcm2709.dtsi already has a timer node, so the node would go in bcm2708.dtsi.

@pelwell
Copy link
Contributor

pelwell commented Aug 13, 2015

The bcm2835 ranges property is wrong - only the video codec block is in the 0x7fxxxxxx bank, and that is driven from the VPU. If you look at bcm2709.dtsi you'll see that we map the range to 0x3f000000, which doesn't leave room for the upper 16MB.

I think we can safely add the dma-ranges property to bcm2708.dtsi and bcm2709.dtsi (which uses 0xc0000000 0x00000000 0x3f000000 instead). I'm now trying to switch to the upstream interrupt controller.

@pelwell
Copy link
Contributor

pelwell commented Aug 13, 2015

I haven't managed to make it boot with the intc change - something is currently causing it to hang after:

bcm2835-mbox 3f00b880.mailbox: mailbox enabled

But I think the following patch (dma-ranges + your timer patches + one cosmetic change) is worth applying to narrow the gap still further:

diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi
index 0d47427..7cc5a6d 100644
--- a/arch/arm/boot/dts/bcm2708.dtsi
+++ b/arch/arm/boot/dts/bcm2708.dtsi
@@ -11,6 +11,14 @@

        soc {
                ranges = <0x7e000000 0x20000000 0x01000000>;
+               dma-ranges = <0x40000000 0x00000000 0x20000000>;
+
+               timer: timer@7e003000 {
+                       compatible = "brcm,bcm2835-system-timer";
+                       reg = <0x7e003000 0x1000>;
+                       interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
+                       clock-frequency = <1000000>;
+               };

                arm-pmu {
                        compatible = "arm,arm1176-pmu";
diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi
index d1c3bdf..4077eae 100644
--- a/arch/arm/boot/dts/bcm2708_common.dtsi
+++ b/arch/arm/boot/dts/bcm2708_common.dtsi
@@ -66,7 +66,7 @@
                        brcm,dma-channel-mask = <0x7f35>;
                };

-               intc: interrupt-controller {
+               intc: interrupt-controller@7e00b200 {
                        compatible = "brcm,bcm2708-armctrl-ic";
                        reg = <0x7e00b200 0x200>;
                        interrupt-controller;
diff --git a/arch/arm/boot/dts/bcm2709.dtsi b/arch/arm/boot/dts/bcm2709.dtsi
index 5e0b935..1b5efa1 100644
--- a/arch/arm/boot/dts/bcm2709.dtsi
+++ b/arch/arm/boot/dts/bcm2709.dtsi
@@ -11,6 +11,7 @@

        soc {
                ranges = <0x7e000000 0x3f000000 0x01000000>;
+               dma-ranges = <0xc0000000 0x00000000 0x3f000000>;

                arm-pmu {
                        compatible = "arm,cortex-a7-pmu";
diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
index 1b9c3be..f7f357c 100644
--- a/arch/arm/mach-bcm2708/bcm2708.c
+++ b/arch/arm/mach-bcm2708/bcm2708.c
@@ -1054,6 +1054,12 @@ static struct delay_timer bcm2708_delay_timer = {

 static void __init bcm2708_timer_init(void)
 {
+       if (use_dt) {
+           of_clk_init(NULL);
+           clocksource_of_init();
+           return;
+       }
+
        /* init high res timer */
        bcm2708_clocksource_init();

@notro
Copy link
Contributor Author

notro commented Aug 13, 2015

I have given up on irq-bcm2835 as well when I discovered that msleep() didn't return.

Boot log: https://gist.github.com/notro/ad87b68170f701d54c50
Diff: https://gist.github.com/notro/445656c7c0321a6f2c7c

Adding initcall_debug ignore_loglevel to the kernel command line gives initcall info which aids in detecting where it stops.

@notro
Copy link
Contributor Author

notro commented Aug 14, 2015

While watching TV it suddenly hit me that msleep uses timers/scheduling and I didn't have the timer patch applied. With that patch it did work.
But we can't have armctrl and irq-bcm2835 in the same build because MULTI_IRQ_HANDLER affects arch/arm/kernel/entry-armv.S. Which would mean a big change to make it work without Device Tree, so I don't think it's worth it.
Unless irq-bcm2835 can be made to work without MULTI_IRQ_HANDLER.

@notro
Copy link
Contributor Author

notro commented Aug 14, 2015

Using irq-bcm2835 without MULTI_IRQ_HANDLER would require a big rewrite of the driver which would defeat the purpose.

We could do it the other way around, and that is to make armctrl work with MULTI_IRQ_HANDLER (for booting without Device Tree).
This would require turning the macro get_irqnr_and_base from arch/arm/mach-bcm2708/include/mach/entry-macro.S into C code.
ARM assembly is out of my league I'm afraid.

Maybe something like this could work:

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5105175..eb4e7de 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -328,6 +330,8 @@ config ARCH_BCM2708
        select GENERIC_CLOCKEVENTS
        select ARM_ERRATA_411920
        select MACH_BCM2708
+       select MULTI_IRQ_HANDLER
        select VC4
        select FIQ
        help
diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c
index 0429225..82e3f38 100644
--- a/arch/arm/mach-bcm2708/armctrl.c
+++ b/arch/arm/mach-bcm2708/armctrl.c
@@ -285,6 +285,15 @@ static struct irq_chip armctrl_chip = {
        .irq_set_wake = armctrl_set_wake,
 };

+static void __exception_irq_entry armctrl_handle_irq(struct pt_regs *regs)
+{
+       u32 irq;
+
+       /* get irq the way get_irqnr_and_base does */
+
+       handle_IRQ(irq, regs);
+}
+
 /**
  * armctrl_init - initialise a vectored interrupt controller
  * @base: iomem base address
@@ -308,6 +317,7 @@ int __init armctrl_init(void __iomem * base, unsigned int irq_start,
                set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
        }

+       set_handle_irq(armctrl_handle_irq);
        armctrl_pm_register(base, irq_start, resume_sources);
        init_FIQ(FIQ_START);
        armctrl_dt_init();
diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
index 937c2d3..d02e5b7 100644
--- a/arch/arm/mach-bcm2708/bcm2708.c
+++ b/arch/arm/mach-bcm2708/bcm2708.c
@@ -43,6 +44,7 @@
 #include <linux/clkdev.h>
 #include <asm/system_info.h>
 #include <mach/hardware.h>
+#include <mach/irqs.h>
 #include <asm/irq.h>
 #include <linux/leds.h>
 #include <asm/mach-types.h>

For the curious reader, here's the assembler part of the interrupt code path (CONFIG_MULTI_IRQ_HANDLER is currently not defined):

arch/arm/kernel/entry-armv.S

/*
 * Interrupt handling.
 */
        .macro  irq_handler
#ifdef CONFIG_MULTI_IRQ_HANDLER
        ldr     r1, =handle_arch_irq
        mov     r0, sp
        adr     lr, BSYM(9997f)
        ldr     pc, [r1]
#else
        arch_irq_handler_default
#endif
9997:
        .endm

arch/arm/include/asm/entry-macro-multi.S (removed SMP part)

/*
 * Interrupt handling.  Preserves r7, r8, r9
 */
        .macro  arch_irq_handler_default
        get_irqnr_preamble r6, lr
1:      get_irqnr_and_base r0, r2, r6, lr
        movne   r1, sp
        @
        @ routine called with r0 = irq number, r1 = struct pt_regs *
        @
        adrne   lr, BSYM(1b)
        bne     asm_do_IRQ
9997:
        .endm

arch/arm/mach-bcm2708/include/mach/entry-macro.S

    .macro  get_irqnr_preamble, base, tmp
    ldr \base, =IO_ADDRESS(ARMCTRL_IC_BASE)
    .endm

    .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
    /* get masked status */
    ldr \irqstat, [\base, #(ARM_IRQ_PEND0 - ARMCTRL_IC_BASE)]
    mov \irqnr, #(ARM_IRQ0_BASE + 31)
    and \tmp, \irqstat, #0x300     @ save bits 8 and 9
    /* clear bits 8 and 9, and test */
    bics  \irqstat, \irqstat, #0x300
    bne 1010f

    tst \tmp, #0x100
    ldrne \irqstat, [\base, #(ARM_IRQ_PEND1 - ARMCTRL_IC_BASE)]
    movne \irqnr, #(ARM_IRQ1_BASE + 31)
    @ Mask out the interrupts also present in PEND0 - see SW-5809
    bicne \irqstat, #((1<<7) | (1<<9) | (1<<10))
    bicne \irqstat, #((1<<18) | (1<<19))
    bne 1010f

    tst \tmp, #0x200
    ldrne \irqstat, [\base, #(ARM_IRQ_PEND2 - ARMCTRL_IC_BASE)]
    movne \irqnr, #(ARM_IRQ2_BASE + 31)
    @ Mask out the interrupts also present in PEND0 - see SW-5809
    bicne \irqstat, #((1<<21) | (1<<22) | (1<<23) | (1<<24) | (1<<25))
    bicne \irqstat, #((1<<30))
    beq 1020f

1010:
    @ For non-zero x, LSB(x) = 31 - CLZ(x^(x-1))
    @ N.B. CLZ is an ARM5 instruction.
    sub \tmp, \irqstat, #1
    eor \irqstat, \irqstat, \tmp
    clz \tmp, \irqstat
    sub \irqnr, \tmp

1020: @ EQ will be set if no irqs pending

    .endm

arch/arm/kernel/irq.c

/*
 * asm_do_IRQ is the interface to be used from assembly code.
 */
asmlinkage void __exception_irq_entry
asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
{
        handle_IRQ(irq, regs);
}

@popcornmix
Copy link
Collaborator

We have said that non-device tree support can be dropped when there is a good reason to. I'm not against dropping it for 4.2 if we believe everything works with DT and it avoids creating extra work supporting non-DT. @pelwell ?

@pelwell
Copy link
Contributor

pelwell commented Aug 14, 2015

We are going to have to do it eventually, so let's try for 4.2. We should probably be prepared to maintain 4.1 as a refuge for the DT-refuseniks.

@pelwell
Copy link
Contributor

pelwell commented Aug 14, 2015

@notro I wrote that assembly language a very long time ago. It was tricky to get right because of some design decisions in the hardware, but it would be easy to translate should we need to.

@notro
Copy link
Contributor Author

notro commented Aug 14, 2015

If so, should we move straight to ARCH_BCM2835 instead of spending more time on ARCH_BCM2708?
Because when we move to the mainline irqchip driver, the only difference between them is the board/platform file being used.

@popcornmix
Copy link
Collaborator

I guess the question with each change is "what does it break?"
If we can use ARCH_BCM2835 and not break anything, then sure.

@pelwell
Copy link
Contributor

pelwell commented Aug 14, 2015

Aside from Pi 2, you mean?

@notro
Copy link
Contributor Author

notro commented Aug 14, 2015

ARCH_BCM2709 still have to use the armctrl driver. Eric Anholt is ARCH_BCM2835 maintainer now, so hopefully there will be Pi 2 support in mainline "soon". He has posted a Pi 2 irqchip driver.

There is one piece missing with ARCH_BCM2835 and that's the lirc_rpi driver which doesn't compile (bcm2708_gpio_setpull). An ifndef could take care of that.
Apart from that I don't know of anything missing (4.2 doesn't have all the patches from 4.1 yet).

I can make a PR to bring ARCH_BCM2835 up to speed on 4.2 and we can use that as a basis for further discussion and testing.

@popcornmix
Copy link
Collaborator

There is 2836 stuff from Eric (http://linux-rpi-kernel.infradead.narkive.com/wkGrwc08/bcm2836-raspberry-pi-2-port) that I assume will appear upstream at some point.

@pelwell
Copy link
Contributor

pelwell commented Aug 14, 2015

Here's my attempt at that function, but I'm not getting any kernel output yet:

diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c
index 0429225..480baaa 100644
--- a/arch/arm/mach-bcm2708/armctrl.c
+++ b/arch/arm/mach-bcm2708/armctrl.c
@@ -26,10 +26,19 @@
 #include <linux/irqdomain.h>
 #include <linux/of.h>

+#include <asm/exception.h>
 #include <asm/mach/irq.h>
 #include <mach/hardware.h>
 #include "armctrl.h"

+/* Mask out shortcut interrupts where they also appear in the regular bank */
+#define BANK0_HWIRQ    0x001ffcff
+#define BANK1_HWIRQ    BIT(8)
+#define BANK2_HWIRQ    BIT(9)
+#define BANK0_VALID_MASK       (BANK0_HWIRQ + BANK1_HWIRQ + BANK2_HWIRQ)
+#define BANK1_VALID_MASK       (~(BIT(7) | BIT(9) | BIT(10) | BIT(18) | BIT(19)))
+#define BANK2_VALID_MASK       (~(BIT(21) | BIT(22) | BIT(23) | BIT(24) | BIT(25) | BIT(30)))
+
 /* For support of kernels >= 3.0 assume only one VIC for now*/
 static unsigned int remap_irqs[(INTERRUPT_ARASANSDIO + 1) - INTERRUPT_JPEG] = {
        INTERRUPT_VC_JPEG,
@@ -285,6 +294,42 @@ static struct irq_chip armctrl_chip = {
        .irq_set_wake = armctrl_set_wake,
 };

+#ifdef CONFIG_MULTI_IRQ_HANDLER
+
+static void __exception_irq_entry armctrl_handle_irq(
+       struct pt_regs *regs)
+{
+       u32 stat;
+
+       while ((stat = readl_relaxed(__io_address(ARM_IRQ_PEND0)) &
+               BANK0_VALID_MASK)) {
+               u32 stat2;
+               u32 irq;
+               if (stat & BANK0_HWIRQ) {
+                       irq = ARM_IRQ0_BASE + ffs(stat & BANK0_HWIRQ);
+               } else if ((stat & BANK1_HWIRQ) &&
+                          ((stat2 = readl_relaxed(__io_address(ARM_IRQ_PEND1)) &
+                            BANK1_VALID_MASK))) {
+                       irq = ARM_IRQ1_BASE + ffs(stat2 & BANK1_VALID_MASK);
+               } else if ((stat & BANK2_HWIRQ) &&
+                          ((stat2 = readl_relaxed(__io_address(ARM_IRQ_PEND2)) &
+                            BANK2_VALID_MASK))) {
+                       irq = ARM_IRQ2_BASE + ffs(stat2 & BANK2_VALID_MASK);
+               } else {
+                       /* Arrival here indicates that a shortcut IRQ arrived
+                          after the initial BANK0 read. The best way to handle
+                          this very rare occurence is to go round the loop
+                          again so it is handled as normal.
+                       */
+                       continue;
+               }
+
+               handle_IRQ(irq, regs);
+       }
+}
+
+#endif
+
 /**
  * armctrl_init - initialise a vectored interrupt controller
  * @base: iomem base address
@@ -308,6 +353,9 @@ int __init armctrl_init(void __iomem * base, unsigned int irq_start,
                set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
        }

+#ifdef CONFIG_MULTI_IRQ_HANDLER
+       set_handle_irq(armctrl_handle_irq);
+#endif
        armctrl_pm_register(base, irq_start, resume_sources);
        init_FIQ(FIQ_START);
        armctrl_dt_init();

@pelwell
Copy link
Contributor

pelwell commented Aug 19, 2015

This discussion continues in #1099, where I link to a patch that switches to the upstream interrupt controller driver for Pi 1.

6by9 pushed a commit to 6by9/linux that referenced this pull request Sep 11, 2020
card->owner is a required property and since commit 81033c6 ("ALSA:
core: Warn on empty module") a warning is issued if it is empty. Fix lack
of it. This fixes following warning observed on RaspberryPi 3B board
with ARM 32bit kernel and multi_v7_defconfig:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 210 at sound/core/init.c:207 snd_card_new+0x378/0x398 [snd]
Modules linked in: vc4(+) snd_soc_core ac97_bus snd_pcm_dmaengine bluetooth snd_pcm snd_timer crc32_arm_ce raspberrypi_hwmon snd soundcore ecdh_generic ecc bcm2835_thermal phy_generic
CPU: 1 PID: 210 Comm: systemd-udevd Not tainted 5.8.0-rc1-00027-g81033c6b584b raspberrypi#1087
Hardware name: BCM2835
[<c03113c0>] (unwind_backtrace) from [<c030bcb4>] (show_stack+0x10/0x14)
[<c030bcb4>] (show_stack) from [<c071cef8>] (dump_stack+0xd4/0xe8)
[<c071cef8>] (dump_stack) from [<c0345bfc>] (__warn+0xdc/0xf4)
[<c0345bfc>] (__warn) from [<c0345cc4>] (warn_slowpath_fmt+0xb0/0xb8)
[<c0345cc4>] (warn_slowpath_fmt) from [<bf02ff74>] (snd_card_new+0x378/0x398 [snd])
[<bf02ff74>] (snd_card_new [snd]) from [<bf11f0b4>] (snd_soc_bind_card+0x280/0x99c [snd_soc_core])
[<bf11f0b4>] (snd_soc_bind_card [snd_soc_core]) from [<bf12f000>] (devm_snd_soc_register_card+0x34/0x6c [snd_soc_core])
[<bf12f000>] (devm_snd_soc_register_card [snd_soc_core]) from [<bf165654>] (vc4_hdmi_bind+0x43c/0x5f4 [vc4])
[<bf165654>] (vc4_hdmi_bind [vc4]) from [<c09d660c>] (component_bind_all+0xec/0x24c)
[<c09d660c>] (component_bind_all) from [<bf15c44c>] (vc4_drm_bind+0xd4/0x174 [vc4])
[<bf15c44c>] (vc4_drm_bind [vc4]) from [<c09d6ac0>] (try_to_bring_up_master+0x160/0x1b0)
[<c09d6ac0>] (try_to_bring_up_master) from [<c09d6f38>] (component_master_add_with_match+0xd0/0x104)
[<c09d6f38>] (component_master_add_with_match) from [<bf15c588>] (vc4_platform_drm_probe+0x9c/0xbc [vc4])
[<bf15c588>] (vc4_platform_drm_probe [vc4]) from [<c09df740>] (platform_drv_probe+0x6c/0xa4)
[<c09df740>] (platform_drv_probe) from [<c09dd6f0>] (really_probe+0x210/0x350)
[<c09dd6f0>] (really_probe) from [<c09dd940>] (driver_probe_device+0x5c/0xb4)
[<c09dd940>] (driver_probe_device) from [<c09ddb38>] (device_driver_attach+0x58/0x60)
[<c09ddb38>] (device_driver_attach) from [<c09ddbc0>] (__driver_attach+0x80/0xbc)
[<c09ddbc0>] (__driver_attach) from [<c09db820>] (bus_for_each_dev+0x68/0xb4)
[<c09db820>] (bus_for_each_dev) from [<c09dc9f8>] (bus_add_driver+0x130/0x1e8)
[<c09dc9f8>] (bus_add_driver) from [<c09de648>] (driver_register+0x78/0x110)
[<c09de648>] (driver_register) from [<c0302038>] (do_one_initcall+0x50/0x220)
[<c0302038>] (do_one_initcall) from [<c03db544>] (do_init_module+0x60/0x210)
[<c03db544>] (do_init_module) from [<c03da4f8>] (load_module+0x1e34/0x2338)
[<c03da4f8>] (load_module) from [<c03dac00>] (sys_finit_module+0xac/0xbc)
[<c03dac00>] (sys_finit_module) from [<c03000c0>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xeded9fa8 to 0xeded9ff0)
...
---[ end trace 6414689569c2bc08 ]---

Fixes: bb7d785 ("drm/vc4: Add HDMI audio support")
Suggested-by: Takashi Iwai <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
popcornmix pushed a commit that referenced this pull request Sep 13, 2020
card->owner is a required property and since commit 81033c6 ("ALSA:
core: Warn on empty module") a warning is issued if it is empty. Fix lack
of it. This fixes following warning observed on RaspberryPi 3B board
with ARM 32bit kernel and multi_v7_defconfig:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 210 at sound/core/init.c:207 snd_card_new+0x378/0x398 [snd]
Modules linked in: vc4(+) snd_soc_core ac97_bus snd_pcm_dmaengine bluetooth snd_pcm snd_timer crc32_arm_ce raspberrypi_hwmon snd soundcore ecdh_generic ecc bcm2835_thermal phy_generic
CPU: 1 PID: 210 Comm: systemd-udevd Not tainted 5.8.0-rc1-00027-g81033c6b584b #1087
Hardware name: BCM2835
[<c03113c0>] (unwind_backtrace) from [<c030bcb4>] (show_stack+0x10/0x14)
[<c030bcb4>] (show_stack) from [<c071cef8>] (dump_stack+0xd4/0xe8)
[<c071cef8>] (dump_stack) from [<c0345bfc>] (__warn+0xdc/0xf4)
[<c0345bfc>] (__warn) from [<c0345cc4>] (warn_slowpath_fmt+0xb0/0xb8)
[<c0345cc4>] (warn_slowpath_fmt) from [<bf02ff74>] (snd_card_new+0x378/0x398 [snd])
[<bf02ff74>] (snd_card_new [snd]) from [<bf11f0b4>] (snd_soc_bind_card+0x280/0x99c [snd_soc_core])
[<bf11f0b4>] (snd_soc_bind_card [snd_soc_core]) from [<bf12f000>] (devm_snd_soc_register_card+0x34/0x6c [snd_soc_core])
[<bf12f000>] (devm_snd_soc_register_card [snd_soc_core]) from [<bf165654>] (vc4_hdmi_bind+0x43c/0x5f4 [vc4])
[<bf165654>] (vc4_hdmi_bind [vc4]) from [<c09d660c>] (component_bind_all+0xec/0x24c)
[<c09d660c>] (component_bind_all) from [<bf15c44c>] (vc4_drm_bind+0xd4/0x174 [vc4])
[<bf15c44c>] (vc4_drm_bind [vc4]) from [<c09d6ac0>] (try_to_bring_up_master+0x160/0x1b0)
[<c09d6ac0>] (try_to_bring_up_master) from [<c09d6f38>] (component_master_add_with_match+0xd0/0x104)
[<c09d6f38>] (component_master_add_with_match) from [<bf15c588>] (vc4_platform_drm_probe+0x9c/0xbc [vc4])
[<bf15c588>] (vc4_platform_drm_probe [vc4]) from [<c09df740>] (platform_drv_probe+0x6c/0xa4)
[<c09df740>] (platform_drv_probe) from [<c09dd6f0>] (really_probe+0x210/0x350)
[<c09dd6f0>] (really_probe) from [<c09dd940>] (driver_probe_device+0x5c/0xb4)
[<c09dd940>] (driver_probe_device) from [<c09ddb38>] (device_driver_attach+0x58/0x60)
[<c09ddb38>] (device_driver_attach) from [<c09ddbc0>] (__driver_attach+0x80/0xbc)
[<c09ddbc0>] (__driver_attach) from [<c09db820>] (bus_for_each_dev+0x68/0xb4)
[<c09db820>] (bus_for_each_dev) from [<c09dc9f8>] (bus_add_driver+0x130/0x1e8)
[<c09dc9f8>] (bus_add_driver) from [<c09de648>] (driver_register+0x78/0x110)
[<c09de648>] (driver_register) from [<c0302038>] (do_one_initcall+0x50/0x220)
[<c0302038>] (do_one_initcall) from [<c03db544>] (do_init_module+0x60/0x210)
[<c03db544>] (do_init_module) from [<c03da4f8>] (load_module+0x1e34/0x2338)
[<c03da4f8>] (load_module) from [<c03dac00>] (sys_finit_module+0xac/0xbc)
[<c03dac00>] (sys_finit_module) from [<c03000c0>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xeded9fa8 to 0xeded9ff0)
...
---[ end trace 6414689569c2bc08 ]---

Fixes: bb7d785 ("drm/vc4: Add HDMI audio support")
Suggested-by: Takashi Iwai <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
popcornmix pushed a commit that referenced this pull request Sep 15, 2020
card->owner is a required property and since commit 81033c6 ("ALSA:
core: Warn on empty module") a warning is issued if it is empty. Fix lack
of it. This fixes following warning observed on RaspberryPi 3B board
with ARM 32bit kernel and multi_v7_defconfig:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 210 at sound/core/init.c:207 snd_card_new+0x378/0x398 [snd]
Modules linked in: vc4(+) snd_soc_core ac97_bus snd_pcm_dmaengine bluetooth snd_pcm snd_timer crc32_arm_ce raspberrypi_hwmon snd soundcore ecdh_generic ecc bcm2835_thermal phy_generic
CPU: 1 PID: 210 Comm: systemd-udevd Not tainted 5.8.0-rc1-00027-g81033c6b584b #1087
Hardware name: BCM2835
[<c03113c0>] (unwind_backtrace) from [<c030bcb4>] (show_stack+0x10/0x14)
[<c030bcb4>] (show_stack) from [<c071cef8>] (dump_stack+0xd4/0xe8)
[<c071cef8>] (dump_stack) from [<c0345bfc>] (__warn+0xdc/0xf4)
[<c0345bfc>] (__warn) from [<c0345cc4>] (warn_slowpath_fmt+0xb0/0xb8)
[<c0345cc4>] (warn_slowpath_fmt) from [<bf02ff74>] (snd_card_new+0x378/0x398 [snd])
[<bf02ff74>] (snd_card_new [snd]) from [<bf11f0b4>] (snd_soc_bind_card+0x280/0x99c [snd_soc_core])
[<bf11f0b4>] (snd_soc_bind_card [snd_soc_core]) from [<bf12f000>] (devm_snd_soc_register_card+0x34/0x6c [snd_soc_core])
[<bf12f000>] (devm_snd_soc_register_card [snd_soc_core]) from [<bf165654>] (vc4_hdmi_bind+0x43c/0x5f4 [vc4])
[<bf165654>] (vc4_hdmi_bind [vc4]) from [<c09d660c>] (component_bind_all+0xec/0x24c)
[<c09d660c>] (component_bind_all) from [<bf15c44c>] (vc4_drm_bind+0xd4/0x174 [vc4])
[<bf15c44c>] (vc4_drm_bind [vc4]) from [<c09d6ac0>] (try_to_bring_up_master+0x160/0x1b0)
[<c09d6ac0>] (try_to_bring_up_master) from [<c09d6f38>] (component_master_add_with_match+0xd0/0x104)
[<c09d6f38>] (component_master_add_with_match) from [<bf15c588>] (vc4_platform_drm_probe+0x9c/0xbc [vc4])
[<bf15c588>] (vc4_platform_drm_probe [vc4]) from [<c09df740>] (platform_drv_probe+0x6c/0xa4)
[<c09df740>] (platform_drv_probe) from [<c09dd6f0>] (really_probe+0x210/0x350)
[<c09dd6f0>] (really_probe) from [<c09dd940>] (driver_probe_device+0x5c/0xb4)
[<c09dd940>] (driver_probe_device) from [<c09ddb38>] (device_driver_attach+0x58/0x60)
[<c09ddb38>] (device_driver_attach) from [<c09ddbc0>] (__driver_attach+0x80/0xbc)
[<c09ddbc0>] (__driver_attach) from [<c09db820>] (bus_for_each_dev+0x68/0xb4)
[<c09db820>] (bus_for_each_dev) from [<c09dc9f8>] (bus_add_driver+0x130/0x1e8)
[<c09dc9f8>] (bus_add_driver) from [<c09de648>] (driver_register+0x78/0x110)
[<c09de648>] (driver_register) from [<c0302038>] (do_one_initcall+0x50/0x220)
[<c0302038>] (do_one_initcall) from [<c03db544>] (do_init_module+0x60/0x210)
[<c03db544>] (do_init_module) from [<c03da4f8>] (load_module+0x1e34/0x2338)
[<c03da4f8>] (load_module) from [<c03dac00>] (sys_finit_module+0xac/0xbc)
[<c03dac00>] (sys_finit_module) from [<c03000c0>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xeded9fa8 to 0xeded9ff0)
...
---[ end trace 6414689569c2bc08 ]---

Fixes: bb7d785 ("drm/vc4: Add HDMI audio support")
Suggested-by: Takashi Iwai <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
popcornmix pushed a commit that referenced this pull request Sep 15, 2020
card->owner is a required property and since commit 81033c6 ("ALSA:
core: Warn on empty module") a warning is issued if it is empty. Fix lack
of it. This fixes following warning observed on RaspberryPi 3B board
with ARM 32bit kernel and multi_v7_defconfig:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 210 at sound/core/init.c:207 snd_card_new+0x378/0x398 [snd]
Modules linked in: vc4(+) snd_soc_core ac97_bus snd_pcm_dmaengine bluetooth snd_pcm snd_timer crc32_arm_ce raspberrypi_hwmon snd soundcore ecdh_generic ecc bcm2835_thermal phy_generic
CPU: 1 PID: 210 Comm: systemd-udevd Not tainted 5.8.0-rc1-00027-g81033c6b584b #1087
Hardware name: BCM2835
[<c03113c0>] (unwind_backtrace) from [<c030bcb4>] (show_stack+0x10/0x14)
[<c030bcb4>] (show_stack) from [<c071cef8>] (dump_stack+0xd4/0xe8)
[<c071cef8>] (dump_stack) from [<c0345bfc>] (__warn+0xdc/0xf4)
[<c0345bfc>] (__warn) from [<c0345cc4>] (warn_slowpath_fmt+0xb0/0xb8)
[<c0345cc4>] (warn_slowpath_fmt) from [<bf02ff74>] (snd_card_new+0x378/0x398 [snd])
[<bf02ff74>] (snd_card_new [snd]) from [<bf11f0b4>] (snd_soc_bind_card+0x280/0x99c [snd_soc_core])
[<bf11f0b4>] (snd_soc_bind_card [snd_soc_core]) from [<bf12f000>] (devm_snd_soc_register_card+0x34/0x6c [snd_soc_core])
[<bf12f000>] (devm_snd_soc_register_card [snd_soc_core]) from [<bf165654>] (vc4_hdmi_bind+0x43c/0x5f4 [vc4])
[<bf165654>] (vc4_hdmi_bind [vc4]) from [<c09d660c>] (component_bind_all+0xec/0x24c)
[<c09d660c>] (component_bind_all) from [<bf15c44c>] (vc4_drm_bind+0xd4/0x174 [vc4])
[<bf15c44c>] (vc4_drm_bind [vc4]) from [<c09d6ac0>] (try_to_bring_up_master+0x160/0x1b0)
[<c09d6ac0>] (try_to_bring_up_master) from [<c09d6f38>] (component_master_add_with_match+0xd0/0x104)
[<c09d6f38>] (component_master_add_with_match) from [<bf15c588>] (vc4_platform_drm_probe+0x9c/0xbc [vc4])
[<bf15c588>] (vc4_platform_drm_probe [vc4]) from [<c09df740>] (platform_drv_probe+0x6c/0xa4)
[<c09df740>] (platform_drv_probe) from [<c09dd6f0>] (really_probe+0x210/0x350)
[<c09dd6f0>] (really_probe) from [<c09dd940>] (driver_probe_device+0x5c/0xb4)
[<c09dd940>] (driver_probe_device) from [<c09ddb38>] (device_driver_attach+0x58/0x60)
[<c09ddb38>] (device_driver_attach) from [<c09ddbc0>] (__driver_attach+0x80/0xbc)
[<c09ddbc0>] (__driver_attach) from [<c09db820>] (bus_for_each_dev+0x68/0xb4)
[<c09db820>] (bus_for_each_dev) from [<c09dc9f8>] (bus_add_driver+0x130/0x1e8)
[<c09dc9f8>] (bus_add_driver) from [<c09de648>] (driver_register+0x78/0x110)
[<c09de648>] (driver_register) from [<c0302038>] (do_one_initcall+0x50/0x220)
[<c0302038>] (do_one_initcall) from [<c03db544>] (do_init_module+0x60/0x210)
[<c03db544>] (do_init_module) from [<c03da4f8>] (load_module+0x1e34/0x2338)
[<c03da4f8>] (load_module) from [<c03dac00>] (sys_finit_module+0xac/0xbc)
[<c03dac00>] (sys_finit_module) from [<c03000c0>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xeded9fa8 to 0xeded9ff0)
...
---[ end trace 6414689569c2bc08 ]---

Fixes: bb7d785 ("drm/vc4: Add HDMI audio support")
Suggested-by: Takashi Iwai <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
popcornmix pushed a commit that referenced this pull request Sep 28, 2020
card->owner is a required property and since commit 81033c6 ("ALSA:
core: Warn on empty module") a warning is issued if it is empty. Fix lack
of it. This fixes following warning observed on RaspberryPi 3B board
with ARM 32bit kernel and multi_v7_defconfig:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 210 at sound/core/init.c:207 snd_card_new+0x378/0x398 [snd]
Modules linked in: vc4(+) snd_soc_core ac97_bus snd_pcm_dmaengine bluetooth snd_pcm snd_timer crc32_arm_ce raspberrypi_hwmon snd soundcore ecdh_generic ecc bcm2835_thermal phy_generic
CPU: 1 PID: 210 Comm: systemd-udevd Not tainted 5.8.0-rc1-00027-g81033c6b584b #1087
Hardware name: BCM2835
[<c03113c0>] (unwind_backtrace) from [<c030bcb4>] (show_stack+0x10/0x14)
[<c030bcb4>] (show_stack) from [<c071cef8>] (dump_stack+0xd4/0xe8)
[<c071cef8>] (dump_stack) from [<c0345bfc>] (__warn+0xdc/0xf4)
[<c0345bfc>] (__warn) from [<c0345cc4>] (warn_slowpath_fmt+0xb0/0xb8)
[<c0345cc4>] (warn_slowpath_fmt) from [<bf02ff74>] (snd_card_new+0x378/0x398 [snd])
[<bf02ff74>] (snd_card_new [snd]) from [<bf11f0b4>] (snd_soc_bind_card+0x280/0x99c [snd_soc_core])
[<bf11f0b4>] (snd_soc_bind_card [snd_soc_core]) from [<bf12f000>] (devm_snd_soc_register_card+0x34/0x6c [snd_soc_core])
[<bf12f000>] (devm_snd_soc_register_card [snd_soc_core]) from [<bf165654>] (vc4_hdmi_bind+0x43c/0x5f4 [vc4])
[<bf165654>] (vc4_hdmi_bind [vc4]) from [<c09d660c>] (component_bind_all+0xec/0x24c)
[<c09d660c>] (component_bind_all) from [<bf15c44c>] (vc4_drm_bind+0xd4/0x174 [vc4])
[<bf15c44c>] (vc4_drm_bind [vc4]) from [<c09d6ac0>] (try_to_bring_up_master+0x160/0x1b0)
[<c09d6ac0>] (try_to_bring_up_master) from [<c09d6f38>] (component_master_add_with_match+0xd0/0x104)
[<c09d6f38>] (component_master_add_with_match) from [<bf15c588>] (vc4_platform_drm_probe+0x9c/0xbc [vc4])
[<bf15c588>] (vc4_platform_drm_probe [vc4]) from [<c09df740>] (platform_drv_probe+0x6c/0xa4)
[<c09df740>] (platform_drv_probe) from [<c09dd6f0>] (really_probe+0x210/0x350)
[<c09dd6f0>] (really_probe) from [<c09dd940>] (driver_probe_device+0x5c/0xb4)
[<c09dd940>] (driver_probe_device) from [<c09ddb38>] (device_driver_attach+0x58/0x60)
[<c09ddb38>] (device_driver_attach) from [<c09ddbc0>] (__driver_attach+0x80/0xbc)
[<c09ddbc0>] (__driver_attach) from [<c09db820>] (bus_for_each_dev+0x68/0xb4)
[<c09db820>] (bus_for_each_dev) from [<c09dc9f8>] (bus_add_driver+0x130/0x1e8)
[<c09dc9f8>] (bus_add_driver) from [<c09de648>] (driver_register+0x78/0x110)
[<c09de648>] (driver_register) from [<c0302038>] (do_one_initcall+0x50/0x220)
[<c0302038>] (do_one_initcall) from [<c03db544>] (do_init_module+0x60/0x210)
[<c03db544>] (do_init_module) from [<c03da4f8>] (load_module+0x1e34/0x2338)
[<c03da4f8>] (load_module) from [<c03dac00>] (sys_finit_module+0xac/0xbc)
[<c03dac00>] (sys_finit_module) from [<c03000c0>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xeded9fa8 to 0xeded9ff0)
...
---[ end trace 6414689569c2bc08 ]---

Fixes: bb7d785 ("drm/vc4: Add HDMI audio support")
Suggested-by: Takashi Iwai <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
popcornmix pushed a commit that referenced this pull request Oct 2, 2020
[ Upstream commit ec653df ]

card->owner is a required property and since commit 81033c6 ("ALSA:
core: Warn on empty module") a warning is issued if it is empty. Fix lack
of it. This fixes following warning observed on RaspberryPi 3B board
with ARM 32bit kernel and multi_v7_defconfig:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 210 at sound/core/init.c:207 snd_card_new+0x378/0x398 [snd]
Modules linked in: vc4(+) snd_soc_core ac97_bus snd_pcm_dmaengine bluetooth snd_pcm snd_timer crc32_arm_ce raspberrypi_hwmon snd soundcore ecdh_generic ecc bcm2835_thermal phy_generic
CPU: 1 PID: 210 Comm: systemd-udevd Not tainted 5.8.0-rc1-00027-g81033c6b584b #1087
Hardware name: BCM2835
[<c03113c0>] (unwind_backtrace) from [<c030bcb4>] (show_stack+0x10/0x14)
[<c030bcb4>] (show_stack) from [<c071cef8>] (dump_stack+0xd4/0xe8)
[<c071cef8>] (dump_stack) from [<c0345bfc>] (__warn+0xdc/0xf4)
[<c0345bfc>] (__warn) from [<c0345cc4>] (warn_slowpath_fmt+0xb0/0xb8)
[<c0345cc4>] (warn_slowpath_fmt) from [<bf02ff74>] (snd_card_new+0x378/0x398 [snd])
[<bf02ff74>] (snd_card_new [snd]) from [<bf11f0b4>] (snd_soc_bind_card+0x280/0x99c [snd_soc_core])
[<bf11f0b4>] (snd_soc_bind_card [snd_soc_core]) from [<bf12f000>] (devm_snd_soc_register_card+0x34/0x6c [snd_soc_core])
[<bf12f000>] (devm_snd_soc_register_card [snd_soc_core]) from [<bf165654>] (vc4_hdmi_bind+0x43c/0x5f4 [vc4])
[<bf165654>] (vc4_hdmi_bind [vc4]) from [<c09d660c>] (component_bind_all+0xec/0x24c)
[<c09d660c>] (component_bind_all) from [<bf15c44c>] (vc4_drm_bind+0xd4/0x174 [vc4])
[<bf15c44c>] (vc4_drm_bind [vc4]) from [<c09d6ac0>] (try_to_bring_up_master+0x160/0x1b0)
[<c09d6ac0>] (try_to_bring_up_master) from [<c09d6f38>] (component_master_add_with_match+0xd0/0x104)
[<c09d6f38>] (component_master_add_with_match) from [<bf15c588>] (vc4_platform_drm_probe+0x9c/0xbc [vc4])
[<bf15c588>] (vc4_platform_drm_probe [vc4]) from [<c09df740>] (platform_drv_probe+0x6c/0xa4)
[<c09df740>] (platform_drv_probe) from [<c09dd6f0>] (really_probe+0x210/0x350)
[<c09dd6f0>] (really_probe) from [<c09dd940>] (driver_probe_device+0x5c/0xb4)
[<c09dd940>] (driver_probe_device) from [<c09ddb38>] (device_driver_attach+0x58/0x60)
[<c09ddb38>] (device_driver_attach) from [<c09ddbc0>] (__driver_attach+0x80/0xbc)
[<c09ddbc0>] (__driver_attach) from [<c09db820>] (bus_for_each_dev+0x68/0xb4)
[<c09db820>] (bus_for_each_dev) from [<c09dc9f8>] (bus_add_driver+0x130/0x1e8)
[<c09dc9f8>] (bus_add_driver) from [<c09de648>] (driver_register+0x78/0x110)
[<c09de648>] (driver_register) from [<c0302038>] (do_one_initcall+0x50/0x220)
[<c0302038>] (do_one_initcall) from [<c03db544>] (do_init_module+0x60/0x210)
[<c03db544>] (do_init_module) from [<c03da4f8>] (load_module+0x1e34/0x2338)
[<c03da4f8>] (load_module) from [<c03dac00>] (sys_finit_module+0xac/0xbc)
[<c03dac00>] (sys_finit_module) from [<c03000c0>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xeded9fa8 to 0xeded9ff0)
...
---[ end trace 6414689569c2bc08 ]---

Fixes: bb7d785 ("drm/vc4: Add HDMI audio support")
Suggested-by: Takashi Iwai <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
popcornmix pushed a commit that referenced this pull request Oct 2, 2020
[ Upstream commit ec653df ]

card->owner is a required property and since commit 81033c6 ("ALSA:
core: Warn on empty module") a warning is issued if it is empty. Fix lack
of it. This fixes following warning observed on RaspberryPi 3B board
with ARM 32bit kernel and multi_v7_defconfig:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 210 at sound/core/init.c:207 snd_card_new+0x378/0x398 [snd]
Modules linked in: vc4(+) snd_soc_core ac97_bus snd_pcm_dmaengine bluetooth snd_pcm snd_timer crc32_arm_ce raspberrypi_hwmon snd soundcore ecdh_generic ecc bcm2835_thermal phy_generic
CPU: 1 PID: 210 Comm: systemd-udevd Not tainted 5.8.0-rc1-00027-g81033c6b584b #1087
Hardware name: BCM2835
[<c03113c0>] (unwind_backtrace) from [<c030bcb4>] (show_stack+0x10/0x14)
[<c030bcb4>] (show_stack) from [<c071cef8>] (dump_stack+0xd4/0xe8)
[<c071cef8>] (dump_stack) from [<c0345bfc>] (__warn+0xdc/0xf4)
[<c0345bfc>] (__warn) from [<c0345cc4>] (warn_slowpath_fmt+0xb0/0xb8)
[<c0345cc4>] (warn_slowpath_fmt) from [<bf02ff74>] (snd_card_new+0x378/0x398 [snd])
[<bf02ff74>] (snd_card_new [snd]) from [<bf11f0b4>] (snd_soc_bind_card+0x280/0x99c [snd_soc_core])
[<bf11f0b4>] (snd_soc_bind_card [snd_soc_core]) from [<bf12f000>] (devm_snd_soc_register_card+0x34/0x6c [snd_soc_core])
[<bf12f000>] (devm_snd_soc_register_card [snd_soc_core]) from [<bf165654>] (vc4_hdmi_bind+0x43c/0x5f4 [vc4])
[<bf165654>] (vc4_hdmi_bind [vc4]) from [<c09d660c>] (component_bind_all+0xec/0x24c)
[<c09d660c>] (component_bind_all) from [<bf15c44c>] (vc4_drm_bind+0xd4/0x174 [vc4])
[<bf15c44c>] (vc4_drm_bind [vc4]) from [<c09d6ac0>] (try_to_bring_up_master+0x160/0x1b0)
[<c09d6ac0>] (try_to_bring_up_master) from [<c09d6f38>] (component_master_add_with_match+0xd0/0x104)
[<c09d6f38>] (component_master_add_with_match) from [<bf15c588>] (vc4_platform_drm_probe+0x9c/0xbc [vc4])
[<bf15c588>] (vc4_platform_drm_probe [vc4]) from [<c09df740>] (platform_drv_probe+0x6c/0xa4)
[<c09df740>] (platform_drv_probe) from [<c09dd6f0>] (really_probe+0x210/0x350)
[<c09dd6f0>] (really_probe) from [<c09dd940>] (driver_probe_device+0x5c/0xb4)
[<c09dd940>] (driver_probe_device) from [<c09ddb38>] (device_driver_attach+0x58/0x60)
[<c09ddb38>] (device_driver_attach) from [<c09ddbc0>] (__driver_attach+0x80/0xbc)
[<c09ddbc0>] (__driver_attach) from [<c09db820>] (bus_for_each_dev+0x68/0xb4)
[<c09db820>] (bus_for_each_dev) from [<c09dc9f8>] (bus_add_driver+0x130/0x1e8)
[<c09dc9f8>] (bus_add_driver) from [<c09de648>] (driver_register+0x78/0x110)
[<c09de648>] (driver_register) from [<c0302038>] (do_one_initcall+0x50/0x220)
[<c0302038>] (do_one_initcall) from [<c03db544>] (do_init_module+0x60/0x210)
[<c03db544>] (do_init_module) from [<c03da4f8>] (load_module+0x1e34/0x2338)
[<c03da4f8>] (load_module) from [<c03dac00>] (sys_finit_module+0xac/0xbc)
[<c03dac00>] (sys_finit_module) from [<c03000c0>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xeded9fa8 to 0xeded9ff0)
...
---[ end trace 6414689569c2bc08 ]---

Fixes: bb7d785 ("drm/vc4: Add HDMI audio support")
Suggested-by: Takashi Iwai <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants