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

Problem with linux repo for 3.10.18+ commits #556

Closed
MrEngman opened this issue Apr 7, 2014 · 6 comments
Closed

Problem with linux repo for 3.10.18+ commits #556

MrEngman opened this issue Apr 7, 2014 · 6 comments

Comments

@MrEngman
Copy link

MrEngman commented Apr 7, 2014

I've been compiling modules with older versions of raspbian, downloading the kernel source from the git linux repository. I originally loaded the source using "git clone" and I select the particular kernel I need to compile for using "git checkout commmit-ID".

I have, however, found a problem. When attempting to load the source for any of the several kernel versions available for 3.10.18+ I am getting an error, for example:-

git checkout 49e62a27664ac2aaa3e85ba469e8b6857a242264
fatal: reference is not a tree: 49e62a27664ac2aaa3e85ba469e8b6857a242264

Opening https://github.com/raspberrypi/firmware/commits/master and browsing the code for commit ID 35d9905adcde341c82e899ae619882ffec836b6a for Nov 15 2013 ./extra/git_hash shows the linux source commit ID I tried to use to checkout the linux version I wanted but checking the linux commits it does not exist. This appears to be the same for all versions of the source for 3.10.18+.

Using sudo rpi-update commit_ID as listed below I can set my SD card image to use any of the 3.10.18+ versions of raspbian linux shown. If I then look at the Raspberry Pi firmware repo the commit-ID's coincide with those from https://github.com/Hexxeh/rpi-firmware/commits/master but the commit ID's for the kernel sources in ./extra/git_hash do not exist in the Linux source repo.

For the current rpi-3.10.y tree commits for other kernel revisions after 3.10.18+ appear
to be OK.

As an alternative to using git and git checkout I tried downloading the archived files for
the commits in question. They are all available in the archive and I've downloaded the zip files but I'm having difficulty extracting the files. I've tried both Windows, using winzip and winrar, and unzip on linux on the Pi but get wierd errors on both systems while unzipping them. I've tried downloading the archives several times and find no difference between them so I don't think there is a problem with the zip files as such. Do I need to do anything special to unzip them or is there an alternative approach to downloading the linux source.

The commit id's for https://github.com/Hexxeh/rpi-firmware and equivalent commits for
https://github.com/raspberrypi/firmware with the list of ./extra/git_hash values and thus
linux source commit id's is below.

Hexxeh rpi-firmware commit history - master
-------------------------------------------
rpi-update firmware Commit ID
https://github.com/Hexxeh/rpi-firmware/commits/master
-----------------------------------------------------
Nov 15, 2013 - 16d5a0c712e00256f96dff6c0d3caf1499dfe2bf - #596 3.10.18+
Nov 13, 2013 - 210a5c90340dd96c85fa3c9c11d6be032f553eba - #594 3.10.18+
Nov 12, 2013 - e40d8b4f5b06a19ebcb3dc1ab806339e01ee319f - #592 3.10.18+
Nov 11, 2013 - 4b1b61b328d1b8b1a0b7eaa48ca99a3f73677fac - #590 3.10.18+
Nov 10, 2013 - 8fd111f77895450323abc5b34efde19548ffc480 - #587 3.10.18+
Nov 07, 2013 - 964576cffdb8097ce65ce36ae07c25d951226cb7 - #585 3.10.18+
Nov 07, 2013 - 5f4e0ba5cf948a8f03c040602d17b57709a49c7d - #585 3.10.18+
Nov 06, 2013 - 4dd2c5de608ec1756dc6db5a423eaa076b32f618 - #579 3.10.18+
Nov 05, 2013 - dc709fae6f7fca6d1062dd49ef3527b27439ca73 - #577 3.10.18+



History for Raspberry Pi firmware / extra / git_hash
----------------------------------------------------
           Raspberrypi/firmware Commit ID
https://github.com/raspberrypi/firmware/commits/master
------------------------------------------------------
Nov 15, 2013 - 35d9905adcde341c82e899ae619882ffec836b6a - #596 3.10.18+
Nov 13, 2013 - 1100e2a7c36be9cab48f4f3a8b1dd340d8729ad1 - #594 3.10.18+
Nov 12, 2013 - 3e92add424c3c2617d5df65caa307c808017a9ea - #592 3.10.18+
Nov 11, 2013 - 1df86f8d19e7303e0c8bdd3936c3687c3d400a92 - #590 3.10.18+
Nov 10, 2013 - 18a163f9341755b00841312af2878afeb64c131c - #587 3.10.18+
Nov 07, 2013 - e85b566308a06952103fc3c70f46f3d13aac557b - #585 3.10.18+
Nov 07, 2013 - 452637c34ceb3f3323e09b56c705f34bbe3a4594 - #585 3.10.18+
Nov 06, 2013 - 5155bb371389439d828c39bb50eafa47ea5a1860 - #579 3.10.18+
Nov 05, 2013 - 5343d029a5f2f09bd9801914eac0d4bf95cadc1f - #577 3.10.18+

https://github.com/raspberrypi/firmware/blob/Commit-ID/extra/git_hash from
browsing commits above.
Points to Raspberrypi/linux source Commit ID
https://github.com/raspberrypi/linux/commits/
----------------------------------
Nov 15, 2013 - 49e62a27664ac2aaa3e85ba469e8b6857a242264 - #596 3.10.18+
Nov 13, 2013 - 2e9628b0324f34f3251f9c1858d403f4502bf84a - #594 3.10.18+
Nov 12, 2013 - ae937f99fee8a37f2ddd7270f6bcc0e497e8c903 - #592 3.10.18+
Nov 11, 2013 - f7c53d79dc2de683cf37ee36b1068c0ccff1e5c0 - #590 3.10.18+
Nov 10, 2013 - 7d307d7ecc23682a5c80f6487e665d56d0e40ae1 - #587 3.10.18+
Nov 07, 2013 - ce6ae7c6f9e323e646758473d98d2e12ec82607e - #585 3.10.18+
Nov 07, 2013 - ce6ae7c6f9e323e646758473d98d2e12ec82607e - #585 3.10.18+
Nov 06, 2013 - a987a783807aeed2232280248a49ed8fa5981858 - #579 3.10.18+
Nov 05, 2013 - 5836aff020cae396c577ff27d7a090d19f8e86b0 - #577 3.10.18+
@popcornmix
Copy link
Collaborator

My git tree seems to see the commit you referenced okay:

dc4@dc4-arm-01:~/raspberry/arm_linux/linux$ git show 49e62a27664ac2aaa3e85ba469e8b6857a242264
commit 49e62a27664ac2aaa3e85ba469e8b6857a242264
Author: popcornmix <[email protected]>
Date:   Fri Nov 15 12:38:16 2013 +0000

    config: Set CONFIG_SPI_SPIDEV=y

diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig
index 0b3177b..20c1c4f 100644
--- a/arch/arm/configs/bcmrpi_defconfig
+++ b/arch/arm/configs/bcmrpi_defconfig
@@ -531,7 +531,7 @@ CONFIG_I2C_CHARDEV=m
 CONFIG_I2C_BCM2708=m
 CONFIG_SPI=y
 CONFIG_SPI_BCM2708=m
-CONFIG_SPI_SPIDEV=m
+CONFIG_SPI_SPIDEV=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_W1=m
 CONFIG_W1_MASTER_DS2490=m
dc4@dc4-arm-01:~/raspberry/arm_linux/linux$ git checkout 49e62a27664ac2aaa3e85ba469e8b6857a242264
Checking out files: 100% (1214/1214), done.
Note: checking out '49e62a27664ac2aaa3e85ba469e8b6857a242264'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 49e62a2... config: Set CONFIG_SPI_SPIDEV=y

You don't want to download the zip file for the linux tree - there are long filenames and shortcuts it can't handle. Instead of downloading the zip file, replace zip with tar.gz in the URL and you'll have a lot more luck.

@MrEngman
Copy link
Author

MrEngman commented Apr 7, 2014

Hi popcornmix,

That's just what I'd expect to see regarding detached head etc., or at least very similar, however, if I look here https://github.com/raspberrypi/linux/commits/ and search back through the many pages to the approximate dates of the commits I cannot find the commits in question.

Anyway I'll try your suggestion to use tar.gz with the archives and see what happens.

Thanks
MrEngman

@popcornmix
Copy link
Collaborator

You can view a commit on github - no need to search:
https://github.com/raspberrypi/linux/commits/49e62a27664ac2aaa3e85ba469e8b6857a242264

@MrEngman
Copy link
Author

MrEngman commented Apr 8, 2014

That's what I want but trying to download it is a problem.

Thanks for that pointer. Looks like I can view the other commits I was looking at as well using the same format link. Strange they're not visible in branch: rpi-3.10.y. I'm certain they were when they first appeared last November, although I do seem to remember the commits list changed a short time later as I check for updates frequently, at least daily, to make sure the wifi driver module I compile and make available for other users to download is available for the latest raspbian update whenever needed.

I tried your suggestion for using tar.gz instead of zip and I get an error " ERROR 406: Not Acceptable." on both the Pi and my Windows laptop. Not sure why that is happening.

OK, think I might be getting somewhere. I checked the zip download link when downloading a zip file and it was https://codeload.github.com/raspberrypi/linux/zip/49e62a27664ac2aaa3e85ba469e8b6857a242264 so I tried changing zip in the link ..ux/zip/49.. and replacing it with .../tar.gz/.. I ended up managing to download a tar.gz file.

Just need to see what happens when I extract it. Ok, extracted it to my Pi and I've been able to configure it to enable me to compile my modules - make mrproper, make bcmrpi_defconfig, make modules_prepare, download Module.symvers. And now its in the process of compiling the module so all is looking great, :)

Thanks very much for your help. Really appreciated.

MrEngman

@MrEngman
Copy link
Author

MrEngman commented Apr 8, 2014

Seems like I'm learning quite a few useful things trying to solve this problem of mine.

The module compile failed and I found the Module.symvers file I downloaded ended up as a html file. I viewed the raw image for Module.symvers in my web browser and did a copy and paste to get a valid version. Took a while to figure out the right form of URL to download it with and then I ended up with the TLS issue when trying to download with wget like with rpi-update recently. Figured out how to download using curl by looking at the rpi-update code.

I have now been able to compile my module and it is working with a 3.10.18+ image on a Pi A.

Just one final issue. The vermagic format of the new module is rather odd and I had expected it not load and to give me a error saying vermagic had a problem. I've seen errors with vermagic before stopping modules loading but it didn't error and loaded OK so that's a little confusing.

Previous modules I've compiled show vermagic with a plus sign after the kernel version number. eg 3.10.18+, however with this new module there is just the kernel version number 3.10.18 and no plus sign. Any idea why it's like this? Would be interesting to know.

Anyway, Thanks very much for your help. I've learned a lot which is useful and appear to have got round the problem I was having so probably time to close the issue.

@popcornmix
Copy link
Collaborator

I believe the + means it was built from a git tree that wasn't clean:
http://stackoverflow.com/questions/19333918/dont-add-to-linux-kernel-version

I guess that is due to the build scripts on the build machine used.

It would probably be preferable to add "LOCALVERSION=" (or commit/move the build scripts) on our build machine so the "plus" disappears.
I'll try and do that when we move to 3.12 kernel tree (should be soon).

I don't believe this will cause an incompatibility with modules.

jhautbois pushed a commit to jhautbois/linux-rpi that referenced this issue Feb 3, 2022
To pick the changes in this cset:

  980fe2f ("x86/fpu: Extend fpu_xstate_prctl() with guest permissions")

This picks these new prctls:

  $ tools/perf/trace/beauty/x86_arch_prctl.sh > /tmp/before
  $ cp arch/x86/include/uapi/asm/prctl.h tools/arch/x86/include/uapi/asm/prctl.h
  $ tools/perf/trace/beauty/x86_arch_prctl.sh > /tmp/after
  $ diff -u /tmp/before /tmp/after
  --- /tmp/before	2022-01-19 14:40:05.049394977 -0300
  +++ /tmp/after	2022-01-19 14:40:35.628154565 -0300
  @@ -9,6 +9,8 @@
   	[0x1021 - 0x1001]= "GET_XCOMP_SUPP",
   	[0x1022 - 0x1001]= "GET_XCOMP_PERM",
   	[0x1023 - 0x1001]= "REQ_XCOMP_PERM",
  +	[0x1024 - 0x1001]= "GET_XCOMP_GUEST_PERM",
  +	[0x1025 - 0x1001]= "REQ_XCOMP_GUEST_PERM",
   };

   #define x86_arch_prctl_codes_2_offset 0x2001
  $

With this 'perf trace' can translate those numbers into strings and use
the strings in filter expressions:

  # perf trace -e prctl
       0.000 ( 0.011 ms): DOM Worker/3722622 prctl(option: SET_NAME, arg2: 0x7f9c014b7df5)     = 0
       0.032 ( 0.002 ms): DOM Worker/3722622 prctl(option: SET_NAME, arg2: 0x7f9bb6b51580)     = 0
       5.452 ( 0.003 ms): StreamT~ns raspberrypi#30/3722623 prctl(option: SET_NAME, arg2: 0x7f9bdbdfeb70) = 0
       5.468 ( 0.002 ms): StreamT~ns raspberrypi#30/3722623 prctl(option: SET_NAME, arg2: 0x7f9bdbdfea70) = 0
      24.494 ( 0.009 ms): IndexedDB raspberrypi#556/3722624 prctl(option: SET_NAME, arg2: 0x7f562a32ae28) = 0
      24.540 ( 0.002 ms): IndexedDB raspberrypi#556/3722624 prctl(option: SET_NAME, arg2: 0x7f563c6d4b30) = 0
     670.281 ( 0.008 ms): systemd-userwo/3722339 prctl(option: SET_NAME, arg2: 0x564be30805c8) = 0
     670.293 ( 0.002 ms): systemd-userwo/3722339 prctl(option: SET_NAME, arg2: 0x564be30800f0) = 0
  ^C#

This addresses these perf build warnings:

  Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/prctl.h' differs from latest version at 'arch/x86/include/uapi/asm/prctl.h'
  diff -u tools/arch/x86/include/uapi/asm/prctl.h arch/x86/include/uapi/asm/prctl.h

Cc: Paolo Bonzini <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
popcornmix pushed a commit that referenced this issue May 11, 2023
…ed()

[ Upstream commit 52d8cac ]

The vsp1 driver uses the vb2_is_streaming() function in its .buf_queue()
handler to check if the .start_streaming() operation has been called,
and decide whether to just add the buffer to an internal queue, or also
trigger a hardware run. vb2_is_streaming() relies on the vb2_queue
structure's streaming field, which used to be set only after calling the
.start_streaming() operation.

Commit a10b215 ("media: vb2: add (un)prepare_streaming queue ops")
changed this, setting the .streaming field in vb2_core_streamon() before
enqueuing buffers to the driver and calling .start_streaming(). This
broke the vsp1 driver which now believes that .start_streaming() has
been called when it hasn't, leading to a crash:

[  881.058705] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020
[  881.067495] Mem abort info:
[  881.070290]   ESR = 0x0000000096000006
[  881.074042]   EC = 0x25: DABT (current EL), IL = 32 bits
[  881.079358]   SET = 0, FnV = 0
[  881.082414]   EA = 0, S1PTW = 0
[  881.085558]   FSC = 0x06: level 2 translation fault
[  881.090439] Data abort info:
[  881.093320]   ISV = 0, ISS = 0x00000006
[  881.097157]   CM = 0, WnR = 0
[  881.100126] user pgtable: 4k pages, 48-bit VAs, pgdp=000000004fa51000
[  881.106573] [0000000000000020] pgd=080000004f36e003, p4d=080000004f36e003, pud=080000004f7ec003, pmd=0000000000000000
[  881.117217] Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
[  881.123494] Modules linked in: rcar_fdp1 v4l2_mem2mem
[  881.128572] CPU: 0 PID: 1271 Comm: yavta Tainted: G    B              6.2.0-rc1-00023-g6c94e2e99343 #556
[  881.138061] Hardware name: Renesas Salvator-X 2nd version board based on r8a77965 (DT)
[  881.145981] pstate: 400000c5 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  881.152951] pc : vsp1_dl_list_add_body+0xa8/0xe0
[  881.157580] lr : vsp1_dl_list_add_body+0x34/0xe0
[  881.162206] sp : ffff80000c267710
[  881.165522] x29: ffff80000c267710 x28: ffff000010938ae8 x27: ffff000013a8dd98
[  881.172683] x26: ffff000010938098 x25: ffff000013a8dc00 x24: ffff000010ed6ba8
[  881.179841] x23: ffff00000faa4000 x22: 0000000000000000 x21: 0000000000000020
[  881.186998] x20: ffff00000faa4000 x19: 0000000000000000 x18: 0000000000000000
[  881.194154] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[  881.201309] x14: 0000000000000000 x13: 746e696174206c65 x12: ffff70000157043d
[  881.208465] x11: 1ffff0000157043c x10: ffff70000157043c x9 : dfff800000000000
[  881.215622] x8 : ffff80000ab821e7 x7 : 00008ffffea8fbc4 x6 : 0000000000000001
[  881.222779] x5 : ffff80000ab821e0 x4 : ffff70000157043d x3 : 0000000000000020
[  881.229936] x2 : 0000000000000020 x1 : ffff00000e4f6400 x0 : 0000000000000000
[  881.237092] Call trace:
[  881.239542]  vsp1_dl_list_add_body+0xa8/0xe0
[  881.243822]  vsp1_video_pipeline_run+0x270/0x2a0
[  881.248449]  vsp1_video_buffer_queue+0x1c0/0x1d0
[  881.253076]  __enqueue_in_driver+0xbc/0x260
[  881.257269]  vb2_start_streaming+0x48/0x200
[  881.261461]  vb2_core_streamon+0x13c/0x280
[  881.265565]  vb2_streamon+0x3c/0x90
[  881.269064]  vsp1_video_streamon+0x2fc/0x3e0
[  881.273344]  v4l_streamon+0x50/0x70
[  881.276844]  __video_do_ioctl+0x2bc/0x5d0
[  881.280861]  video_usercopy+0x2a8/0xc80
[  881.284704]  video_ioctl2+0x20/0x40
[  881.288201]  v4l2_ioctl+0xa4/0xc0
[  881.291525]  __arm64_sys_ioctl+0xe8/0x110
[  881.295543]  invoke_syscall+0x68/0x190
[  881.299303]  el0_svc_common.constprop.0+0x88/0x170
[  881.304105]  do_el0_svc+0x4c/0xf0
[  881.307430]  el0_svc+0x4c/0xa0
[  881.310494]  el0t_64_sync_handler+0xbc/0x140
[  881.314773]  el0t_64_sync+0x190/0x194
[  881.318450] Code: d50323bf d65f03c0 91008263 f9800071 (885f7c60)
[  881.324551] ---[ end trace 0000000000000000 ]---
[  881.329173] note: yavta[1271] exited with preempt_count 1

A different regression report sent to the linux-media mailing list ([1])
was answered with a claim that the vb2_is_streaming() function has never
been meant for this purpose. The document of the function, as well as of
the struct vb2_queue streaming field, is sparse, so this claim may be
hard to verify.

The information needed by the vsp1 driver to decide how to process
queued buffers is also available from the vb2_start_streaming_called()
function. Use it instead of vb2_is_streaming() to fix the problem.

[1] https://lore.kernel.org/linux-media/[email protected]/

Fixes: a10b215 ("media: vb2: add (un)prepare_streaming queue ops")
Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Hans Verkuil <[email protected]>
Tested-by: Duy Nguyen <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
popcornmix pushed a commit that referenced this issue May 11, 2023
…ed()

[ Upstream commit 52d8cac ]

The vsp1 driver uses the vb2_is_streaming() function in its .buf_queue()
handler to check if the .start_streaming() operation has been called,
and decide whether to just add the buffer to an internal queue, or also
trigger a hardware run. vb2_is_streaming() relies on the vb2_queue
structure's streaming field, which used to be set only after calling the
.start_streaming() operation.

Commit a10b215 ("media: vb2: add (un)prepare_streaming queue ops")
changed this, setting the .streaming field in vb2_core_streamon() before
enqueuing buffers to the driver and calling .start_streaming(). This
broke the vsp1 driver which now believes that .start_streaming() has
been called when it hasn't, leading to a crash:

[  881.058705] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020
[  881.067495] Mem abort info:
[  881.070290]   ESR = 0x0000000096000006
[  881.074042]   EC = 0x25: DABT (current EL), IL = 32 bits
[  881.079358]   SET = 0, FnV = 0
[  881.082414]   EA = 0, S1PTW = 0
[  881.085558]   FSC = 0x06: level 2 translation fault
[  881.090439] Data abort info:
[  881.093320]   ISV = 0, ISS = 0x00000006
[  881.097157]   CM = 0, WnR = 0
[  881.100126] user pgtable: 4k pages, 48-bit VAs, pgdp=000000004fa51000
[  881.106573] [0000000000000020] pgd=080000004f36e003, p4d=080000004f36e003, pud=080000004f7ec003, pmd=0000000000000000
[  881.117217] Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
[  881.123494] Modules linked in: rcar_fdp1 v4l2_mem2mem
[  881.128572] CPU: 0 PID: 1271 Comm: yavta Tainted: G    B              6.2.0-rc1-00023-g6c94e2e99343 #556
[  881.138061] Hardware name: Renesas Salvator-X 2nd version board based on r8a77965 (DT)
[  881.145981] pstate: 400000c5 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  881.152951] pc : vsp1_dl_list_add_body+0xa8/0xe0
[  881.157580] lr : vsp1_dl_list_add_body+0x34/0xe0
[  881.162206] sp : ffff80000c267710
[  881.165522] x29: ffff80000c267710 x28: ffff000010938ae8 x27: ffff000013a8dd98
[  881.172683] x26: ffff000010938098 x25: ffff000013a8dc00 x24: ffff000010ed6ba8
[  881.179841] x23: ffff00000faa4000 x22: 0000000000000000 x21: 0000000000000020
[  881.186998] x20: ffff00000faa4000 x19: 0000000000000000 x18: 0000000000000000
[  881.194154] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[  881.201309] x14: 0000000000000000 x13: 746e696174206c65 x12: ffff70000157043d
[  881.208465] x11: 1ffff0000157043c x10: ffff70000157043c x9 : dfff800000000000
[  881.215622] x8 : ffff80000ab821e7 x7 : 00008ffffea8fbc4 x6 : 0000000000000001
[  881.222779] x5 : ffff80000ab821e0 x4 : ffff70000157043d x3 : 0000000000000020
[  881.229936] x2 : 0000000000000020 x1 : ffff00000e4f6400 x0 : 0000000000000000
[  881.237092] Call trace:
[  881.239542]  vsp1_dl_list_add_body+0xa8/0xe0
[  881.243822]  vsp1_video_pipeline_run+0x270/0x2a0
[  881.248449]  vsp1_video_buffer_queue+0x1c0/0x1d0
[  881.253076]  __enqueue_in_driver+0xbc/0x260
[  881.257269]  vb2_start_streaming+0x48/0x200
[  881.261461]  vb2_core_streamon+0x13c/0x280
[  881.265565]  vb2_streamon+0x3c/0x90
[  881.269064]  vsp1_video_streamon+0x2fc/0x3e0
[  881.273344]  v4l_streamon+0x50/0x70
[  881.276844]  __video_do_ioctl+0x2bc/0x5d0
[  881.280861]  video_usercopy+0x2a8/0xc80
[  881.284704]  video_ioctl2+0x20/0x40
[  881.288201]  v4l2_ioctl+0xa4/0xc0
[  881.291525]  __arm64_sys_ioctl+0xe8/0x110
[  881.295543]  invoke_syscall+0x68/0x190
[  881.299303]  el0_svc_common.constprop.0+0x88/0x170
[  881.304105]  do_el0_svc+0x4c/0xf0
[  881.307430]  el0_svc+0x4c/0xa0
[  881.310494]  el0t_64_sync_handler+0xbc/0x140
[  881.314773]  el0t_64_sync+0x190/0x194
[  881.318450] Code: d50323bf d65f03c0 91008263 f9800071 (885f7c60)
[  881.324551] ---[ end trace 0000000000000000 ]---
[  881.329173] note: yavta[1271] exited with preempt_count 1

A different regression report sent to the linux-media mailing list ([1])
was answered with a claim that the vb2_is_streaming() function has never
been meant for this purpose. The document of the function, as well as of
the struct vb2_queue streaming field, is sparse, so this claim may be
hard to verify.

The information needed by the vsp1 driver to decide how to process
queued buffers is also available from the vb2_start_streaming_called()
function. Use it instead of vb2_is_streaming() to fix the problem.

[1] https://lore.kernel.org/linux-media/[email protected]/

Fixes: a10b215 ("media: vb2: add (un)prepare_streaming queue ops")
Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Hans Verkuil <[email protected]>
Tested-by: Duy Nguyen <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
popcornmix pushed a commit that referenced this issue May 24, 2023
To pick the changes in this cset:

  a03c376 ("x86/arch_prctl: Add AMX feature numbers as ABI constants")
  23e5d9e ("x86/mm/iommu/sva: Make LAM and SVA mutually exclusive")
  2f8794b ("x86/mm: Provide arch_prctl() interface for LAM")

This picks these new prctls in a third range, that was also added to the
tools/perf/trace/beauty/arch_prctl.c beautifier.

  $ tools/perf/trace/beauty/x86_arch_prctl.sh > /tmp/before
  $ cp arch/x86/include/uapi/asm/prctl.h tools/arch/x86/include/uapi/asm/prctl.h
  $ tools/perf/trace/beauty/x86_arch_prctl.sh > /tmp/after
  $ diff -u /tmp/before /tmp/after
  @@ -20,3 +20,11 @@
   	[0x2003 - 0x2001]= "MAP_VDSO_64",
   };

  +#define x86_arch_prctl_codes_3_offset 0x4001
  +static const char *x86_arch_prctl_codes_3[] = {
  +	[0x4001 - 0x4001]= "GET_UNTAG_MASK",
  +	[0x4002 - 0x4001]= "ENABLE_TAGGED_ADDR",
  +	[0x4003 - 0x4001]= "GET_MAX_TAG_BITS",
  +	[0x4004 - 0x4001]= "FORCE_TAGGED_SVA",
  +};
  +
  $

With this 'perf trace' can translate those numbers into strings and use
the strings in filter expressions:

  # perf trace -e prctl
       0.000 ( 0.011 ms): DOM Worker/3722622 prctl(option: SET_NAME, arg2: 0x7f9c014b7df5)     = 0
       0.032 ( 0.002 ms): DOM Worker/3722622 prctl(option: SET_NAME, arg2: 0x7f9bb6b51580)     = 0
       5.452 ( 0.003 ms): StreamT~ns #30/3722623 prctl(option: SET_NAME, arg2: 0x7f9bdbdfeb70) = 0
       5.468 ( 0.002 ms): StreamT~ns #30/3722623 prctl(option: SET_NAME, arg2: 0x7f9bdbdfea70) = 0
      24.494 ( 0.009 ms): IndexedDB #556/3722624 prctl(option: SET_NAME, arg2: 0x7f562a32ae28) = 0
      24.540 ( 0.002 ms): IndexedDB #556/3722624 prctl(option: SET_NAME, arg2: 0x7f563c6d4b30) = 0
     670.281 ( 0.008 ms): systemd-userwo/3722339 prctl(option: SET_NAME, arg2: 0x564be30805c8) = 0
     670.293 ( 0.002 ms): systemd-userwo/3722339 prctl(option: SET_NAME, arg2: 0x564be30800f0) = 0
  ^C#

This addresses this perf build warning:

  Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/prctl.h' differs from latest version at 'arch/x86/include/uapi/asm/prctl.h'
  diff -u tools/arch/x86/include/uapi/asm/prctl.h arch/x86/include/uapi/asm/prctl.h

Cc: Adrian Hunter <[email protected]>
Cc: Chang S. Bae <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[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

No branches or pull requests

2 participants