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

Update kernel ABI to latest FW version #260

Merged
merged 1 commit into from
Nov 11, 2018
Merged

Conversation

lgirdwood
Copy link
Member

Mostly copies and changes for license header/include guards. Will test all tomorrow.

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to remove the SSP mode which no one seems to use? Or mark it as reserved (which would be cool if we change the layout with a future version)

@lgirdwood
Copy link
Member Author

@plbossart lets reserve it - Will update both PRs

@lgirdwood lgirdwood changed the title [WIP] Update kernel ABI to latest FW version Update kernel ABI to latest FW version Nov 9, 2018
@lgirdwood lgirdwood force-pushed the topic/abi branch 2 times, most recently from 1161f78 to be1ff26 Compare November 9, 2018 16:20
@plbossart
Copy link
Member

plbossart commented Nov 9, 2018

even when I ignore the type issues reported by checkpatch, you still have a few (only took one per occurrence):

WARNING: please, no space before tabs
#168: FILE: include/sound/sof/control.h:77:
+^ISOF_CTRL_CMD_ENUM, ^I/**< maps to ALSA enum style controls */$

WARNING: Block comments should align the * on each line
#2838: FILE: include/uapi/sound/sof/trace.h:3:
+/*
+* This file is provided under a dual BSD/GPLv2 license.  When using or

WARNING: please, no space before tabs
#168: FILE: include/sound/sof/control.h:77:
+^ISOF_CTRL_CMD_ENUM, ^I/**< maps to ALSA enum style controls */$

CHECK: Please don't use multiple blank lines
#271: FILE: include/sound/sof/dai-intel.h:49:
+
+

And this one is new to me.

WARNING: __packed is preferred over __attribute__((packed))
#382: FILE: include/sound/sof/dai-intel.h:160:
+} __attribute__((packed));

@lgirdwood lgirdwood force-pushed the topic/abi branch 2 times, most recently from c746500 to 62cb293 Compare November 9, 2018 21:00
@lgirdwood
Copy link
Member Author

@plbossart I think these are all historical from before checkpatch. I've taken this opportunity to fix all the important ones for this update in both kernel and FW.
Please feel free to apply both FW and kernel ABI PR's if you have time tonight otherwise I can merge tomorrow if there are no new issues.

@plbossart
Copy link
Member

@lgirdwood I'll do a smoke test with both kernel and firmware and merge both if things look fine.

@plbossart
Copy link
Member

No issues with this PR and the matching SOF one, except for

[    5.403033] sof-audio sof-audio: ipc tx succeeded: 0x30130000: GLB_TPLG_MSG: PIPE_COMPLETE
[    5.403050] sof-audio sof-audio: error: failed to enter PM idle -11

Still no luck with the PM...

verified all files. The only things I noticed are

  • missing packed in eq.h
  • whitespace differences in header.h
  • missing lines in manifest.h
  • trace.h (packed vs packed, whitespaces in comments, different definition for long_entry_address uint32_t vs. uintptr_t, spurious ifndef at the end). As usual the trace is the worst :-(

In other words you work tomorrow... (If you merge the kernel use rebase-and-merge please, not git merge)

@ranj063
Copy link
Collaborator

ranj063 commented Nov 11, 2018

No issues with this PR and the matching SOF one, except for

[    5.403033] sof-audio sof-audio: ipc tx succeeded: 0x30130000: GLB_TPLG_MSG: PIPE_COMPLETE
[    5.403050] sof-audio sof-audio: error: failed to enter PM idle -11

@plbossart do you see it even after you merged the latest PM PR #249

Still no luck with the PM...

verified all files. The only things I noticed are

* missing **packed** in eq.h
* whitespace differences in header.h
* missing lines in manifest.h
* trace.h (packed vs **packed**, whitespaces in comments, different definition for long_entry_address uint32_t vs. uintptr_t, spurious  ifndef at the end). As usual the trace is the worst :-(

In other words you work tomorrow... (If you merge the kernel use rebase-and-merge please, not git merge)

@lgirdwood
Copy link
Member Author

lgirdwood commented Nov 11, 2018

@plbossart I've just double checked everything and I cant see any missing packed in eq.h or problematic differences in trace.h . These were differences in an older version so I wonder if github loading was high on Friday. I've also done a git diff against my local branches and remote branches so it should all be in sync today.

@lgirdwood
Copy link
Member Author

lgirdwood commented Nov 11, 2018

@ranj063 I had a quick check on the PM idle and we should see a dev_err() on all the suspend failures in pm.c. Error -11 is -EAGAIN and means "try again" so its the PM core here, please look at drivers/base/power/runtime.c and rpm_suspend() as it does return -EAGAIN in two places !

Copy FW IPC headers to include/sound/sof/.
Copy FW userspace ABI headers to include/uapi/sound/sof/.
Fix various include guards and comments for kernel.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@plbossart
Copy link
Member

plbossart commented Nov 11, 2018

Try comparing your kernel and sof files, and you'll have the differences I reported, e.g.

diff eq.h /data/pbossart/SOF-public/sof-sdk/sof.git/src/include/uapi/user/eq.h 
1d0
...
62c86
< };
---
> } __attribute__((packed));
72c96
< };
---
> } __attribute__((packed));
131c155
< };
---
> } __attribute__((packed));
141c165
< };
---
> } __attribute__((packed));
151c175
< };
---
> } __attribute__((packed));
164c188
< #endif
---
> #endif /* __INCLUDE_UAPI_USER_EQ_H__ */
diff header.h /data/pbossart/SOF-public/sof-sdk/sof.git/src/include/uapi/user/header.h
1d0
....
25c55
< }  __attribute__((packed));
---
> } __attribute__((packed));
diff manifest.h /data/pbossart/SOF-public/sof-sdk/sof.git/src/include/uapi/user/manifest.h
> #include <stdint.h>
102d131
< 
diff trace.h /data/pbossart/SOF-public/sof-sdk/sof.git/src/include/uapi/user/trace.h 
25c50
< } __attribute__((__packed__));
---
> } __attribute__((packed));
67c92
< } __attribute__((__packed__));
---
> } __attribute__((packed));
74c99
< } __attribute__((__packed__));
---
> } __attribute__((packed));
79,83c104,108
< *  Log entry header.
< *
< * The header is followed by an array of arguments (uint32_t[]).
< * Number of arguments is specified by the params_num field of log_entry
< */
---
>  *  Log entry header.
>  *
>  * The header is followed by an array of arguments (uint32_t[]).
>  * Number of arguments is specified by the params_num field of log_entry
>  */
90,91c115,116
< 	uintptr_t log_entry_address;	/* Address of log entry in ELF */
< } __attribute__((__packed__));
---
> 	uint32_t log_entry_address;	/* Address of log entry in ELF */
> } __attribute__((packed));
93c118
< #endif
---
> #endif //#ifndef __INCLUDE_LOGGING__

@plbossart
Copy link
Member

Never mind, if I fetch the latest branches again I only see differences in __packed and __attribute((packed)) which is ok. I'll merge both kernel and firmware.

@plbossart plbossart merged commit b068508 into topic/sof-dev Nov 11, 2018
plbossart pushed a commit that referenced this pull request Nov 11, 2019
Since commit a211b8c ("ARM: dts: imx6qdl-sabreauto: Add sensors")
a storm of accelerometer interrupts is seen:

[  114.211283] irq 260: nobody cared (try booting with the "irqpoll" option)
[  114.218108] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.3.4 #1
[  114.223960] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[  114.230531] [<c0112858>] (unwind_backtrace) from [<c010cdc8>] (show_stack+0x10/0x14)
[  114.238301] [<c010cdc8>] (show_stack) from [<c0c1aa1c>] (dump_stack+0xd8/0x110)
[  114.245644] [<c0c1aa1c>] (dump_stack) from [<c0193594>] (__report_bad_irq+0x30/0xc0)
[  114.253417] [<c0193594>] (__report_bad_irq) from [<c01933ac>] (note_interrupt+0x108/0x298)
[  114.261707] [<c01933ac>] (note_interrupt) from [<c018ffe4>] (handle_irq_event_percpu+0x70/0x80)
[  114.270433] [<c018ffe4>] (handle_irq_event_percpu) from [<c019002c>] (handle_irq_event+0x38/0x5c)
[  114.279326] [<c019002c>] (handle_irq_event) from [<c019438c>] (handle_level_irq+0xc8/0x154)
[  114.287701] [<c019438c>] (handle_level_irq) from [<c018eda0>] (generic_handle_irq+0x20/0x34)
[  114.296166] [<c018eda0>] (generic_handle_irq) from [<c0534214>] (mxc_gpio_irq_handler+0x30/0xf0)
[  114.304975] [<c0534214>] (mxc_gpio_irq_handler) from [<c0534334>] (mx3_gpio_irq_handler+0x60/0xb0)
[  114.313955] [<c0534334>] (mx3_gpio_irq_handler) from [<c018eda0>] (generic_handle_irq+0x20/0x34)
[  114.322762] [<c018eda0>] (generic_handle_irq) from [<c018f3ac>] (__handle_domain_irq+0x64/0xe0)
[  114.331485] [<c018f3ac>] (__handle_domain_irq) from [<c05215a8>] (gic_handle_irq+0x4c/0xa8)
[  114.339862] [<c05215a8>] (gic_handle_irq) from [<c0101a70>] (__irq_svc+0x70/0x98)
[  114.347361] Exception stack(0xc1301ec0 to 0xc1301f08)
[  114.352435] 1ec0: 00000001 00000006 00000000 c130c340 00000001 c130f688 9785636d c13ea2e8
[  114.360635] 1ee0: 9784907d 0000001a eaf99d78 0000001a 00000000 c1301f10 c0182b00 c0878de4
[  114.368830] 1f00: 20000013 ffffffff
[  114.372349] [<c0101a70>] (__irq_svc) from [<c0878de4>] (cpuidle_enter_state+0x168/0x5f4)
[  114.380464] [<c0878de4>] (cpuidle_enter_state) from [<c08792ac>] (cpuidle_enter+0x28/0x38)
[  114.388751] [<c08792ac>] (cpuidle_enter) from [<c015ef9c>] (do_idle+0x224/0x2a8)
[  114.396168] [<c015ef9c>] (do_idle) from [<c015f3b8>] (cpu_startup_entry+0x18/0x20)
[  114.403765] [<c015f3b8>] (cpu_startup_entry) from [<c1200e54>] (start_kernel+0x43c/0x500)
[  114.411958] handlers:
[  114.414302] [<a01028b8>] irq_default_primary_handler threaded [<fd7a3b08>] mma8452_interrupt
[  114.422974] Disabling IRQ #260

           CPU0       CPU1
....
260:     100001          0  gpio-mxc  31 Level     mma8451

The MMA8451 interrupt triggers as low level, so the GPIO6_IO31 pin
needs to activate its pull up, otherwise it will stay always at low level
generating multiple interrupts.

The current device tree does not configure the IOMUX for this pin, so
it uses whathever comes configured from the bootloader.

The IOMUXC_SW_PAD_CTL_PAD_EIM_BCLK register value comes as 0x8000 from
the bootloader, which has PKE bit cleared, hence disabling the
pull-up.

Instead of relying on a previous configuration from the bootloader,
configure the GPIO6_IO31 pin with pull-up enabled in order to fix
this problem.

Fixes: a211b8c ("ARM: dts: imx6qdl-sabreauto: Add sensors")
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-By: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
wenliangwu pushed a commit that referenced this pull request Oct 30, 2023
Add various tests to check maximum number of supported programs
being attached:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  ./test_progs -t tc_opts
  [    1.185325] bpf_testmod: loading out-of-tree module taints kernel.
  [    1.186826] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  [    1.270123] tsc: Refined TSC clocksource calibration: 3407.988 MHz
  [    1.272428] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fc932722, max_idle_ns: 440795381586 ns
  [    1.276408] clocksource: Switched to clocksource tsc
  #252     tc_opts_after:OK
  #253     tc_opts_append:OK
  #254     tc_opts_basic:OK
  #255     tc_opts_before:OK
  #256     tc_opts_chain_classic:OK
  #257     tc_opts_chain_mixed:OK
  #258     tc_opts_delete_empty:OK
  #259     tc_opts_demixed:OK
  #260     tc_opts_detach:OK
  #261     tc_opts_detach_after:OK
  #262     tc_opts_detach_before:OK
  #263     tc_opts_dev_cleanup:OK
  #264     tc_opts_invalid:OK
  #265     tc_opts_max:OK              <--- (new test)
  #266     tc_opts_mixed:OK
  #267     tc_opts_prepend:OK
  #268     tc_opts_replace:OK
  #269     tc_opts_revision:OK
  Summary: 18/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230929204121.20305-2-daniel@iogearbox.net
wenliangwu pushed a commit that referenced this pull request Oct 30, 2023
Add a new test case which performs double query of the bpf_mprog through
libbpf API, but also via raw bpf(2) syscall. This is testing to gather
first the count and then in a subsequent probe the full information with
the program array without clearing passed structs in between.

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  ./test_progs -t tc_opts
  [    1.398818] tsc: Refined TSC clocksource calibration: 3407.999 MHz
  [    1.400263] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fd336761, max_idle_ns: 440795243819 ns
  [    1.402734] clocksource: Switched to clocksource tsc
  [    1.426639] bpf_testmod: loading out-of-tree module taints kernel.
  [    1.428112] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  #252     tc_opts_after:OK
  #253     tc_opts_append:OK
  #254     tc_opts_basic:OK
  #255     tc_opts_before:OK
  #256     tc_opts_chain_classic:OK
  #257     tc_opts_chain_mixed:OK
  #258     tc_opts_delete_empty:OK
  #259     tc_opts_demixed:OK
  #260     tc_opts_detach:OK
  #261     tc_opts_detach_after:OK
  #262     tc_opts_detach_before:OK
  #263     tc_opts_dev_cleanup:OK
  #264     tc_opts_invalid:OK
  #265     tc_opts_max:OK
  #266     tc_opts_mixed:OK
  #267     tc_opts_prepend:OK
  #268     tc_opts_query:OK            <--- (new test)
  #269     tc_opts_replace:OK
  #270     tc_opts_revision:OK
  Summary: 19/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20231006220655.1653-4-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
wenliangwu pushed a commit that referenced this pull request Oct 30, 2023
Add a new test case to query on an empty bpf_mprog and pass the revision
directly into expected_revision for attachment to assert that this does
succeed.

  ./test_progs -t tc_opts
  [    1.406778] tsc: Refined TSC clocksource calibration: 3407.990 MHz
  [    1.408863] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fcaf6eb0, max_idle_ns: 440795321766 ns
  [    1.412419] clocksource: Switched to clocksource tsc
  [    1.428671] bpf_testmod: loading out-of-tree module taints kernel.
  [    1.430260] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  #252     tc_opts_after:OK
  #253     tc_opts_append:OK
  #254     tc_opts_basic:OK
  #255     tc_opts_before:OK
  #256     tc_opts_chain_classic:OK
  #257     tc_opts_chain_mixed:OK
  #258     tc_opts_delete_empty:OK
  #259     tc_opts_demixed:OK
  #260     tc_opts_detach:OK
  #261     tc_opts_detach_after:OK
  #262     tc_opts_detach_before:OK
  #263     tc_opts_dev_cleanup:OK
  #264     tc_opts_invalid:OK
  #265     tc_opts_max:OK
  #266     tc_opts_mixed:OK
  #267     tc_opts_prepend:OK
  #268     tc_opts_query:OK
  #269     tc_opts_query_attach:OK     <--- (new test)
  #270     tc_opts_replace:OK
  #271     tc_opts_revision:OK
  Summary: 20/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20231006220655.1653-6-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
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.

4 participants