Linux-rt-users Archive on lore.kernel.org
 help / color / Atom feed
* Application of standard kernel patch and then RT patch with Petalinux
@ 2021-03-25 10:04 jack
  2021-03-25 12:54 ` Ahmed S. Darwish
  0 siblings, 1 reply; 2+ messages in thread
From: jack @ 2021-03-25 10:04 UTC (permalink / raw)
  To: linux-rt-users

Hi,

I am having problems applying kernel patches in the context of a Xilinx
Petalinux project (Yocto-based).

Xilinx provides a 5.4.0 kernel, according to make kernelconfig, though
how this corresponds to the upstream 5.4.0 kernel, I'm not sure.

My understanding is that, in order to apply the latest 5.4 rt patch
(106-rt54), I have to apply the upstream 106 patch first. Is this
correct?

When applying the patches using petalinux-config -c kernel, the
upstream patch appears to be accepted, but the rt patch is not. I get
the sequence of errors below, picked out in red.

I am not familiar enough with the kernel, or the Petalinux tools, to
get a handle on the problem. The log file mentioned at the bottom does
not exist following the completion of the command.

Is anyone able to help with this?

Many thanks,

Jack White

----------------------------------------------------------------------
ERROR: Could not apply patches for zynqmp-generic.
ERROR: Patch failures can be resolved in the linux source directory
/home/jack/ws_zcu102/petalinux/2021_03_25_Ubuntu_Petalinux/build/tmp/wo
rk/zynqmp_generic-xilinx-linux/linux-xlnx/5.4+gitAUTOINC+62ea514294-
r0/devtooltmp-rh17ls9u/workdir/source)
ERROR: Execution of
'/home/jack/ws_zcu102/petalinux/2021_03_25_Ubuntu_Petalinux/build/tmp/w
ork/zynqmp_generic-xilinx-linux/linux-xlnx/5.4+gitAUTOINC+62ea514294-
r0/devtooltmp-rh17ls9u/temp/run.do_patch.1045876' failed with exit code
1:
(1/1) patch-5.4.106-rt54.patch
[INFO]: check of .kernel-meta//patches//./patch-5.4.106-rt54.patch with
"git am" did not pass, trying reduced context.
[INFO]: Context reduced git-am of .kernel-meta//patches//./patch-
5.4.106-rt54.patch with "git am" did not work, trying "apply".
error: patch failed: arch/arm/kernel/smp.c:682
error: arch/arm/kernel/smp.c: patch does not apply
error: patch failed: arch/powerpc/Kconfig:222
error: arch/powerpc/Kconfig: patch does not apply
error: patch failed: arch/powerpc/kernel/traps.c:261
error: arch/powerpc/kernel/traps.c: patch does not apply
error: patch failed: arch/powerpc/platforms/pseries/iommu.c:209
error: arch/powerpc/platforms/pseries/iommu.c: patch does not apply
Context reduced to (1/1) to apply fragment at 25
Context reduced to (1/1) to apply fragment at 1727
error: patch failed: drivers/char/tpm/tpm_tis.c:50
error: drivers/char/tpm/tpm_tis.c: patch does not apply
error: patch failed: drivers/pci/switch/switchtec.c:175
error: drivers/pci/switch/switchtec.c: patch does not apply
Context reduced to (2/2) to apply fragment at 1975
Context reduced to (2/2) to apply fragment at 2082
error: patch failed: fs/jbd2/transaction.c:2331
error: fs/jbd2/transaction.c: patch does not apply
error: patch failed: fs/nfs/nfs4proc.c:2969
error: fs/nfs/nfs4proc.c: patch does not apply
error: patch failed: include/linux/genhd.h:755
error: include/linux/genhd.h: patch does not apply
error: patch failed: include/linux/printk.h:202
error: include/linux/printk.h: patch does not apply
error: patch failed: include/linux/sched/mm.h:49
error: include/linux/sched/mm.h: patch does not apply
error: patch failed: kernel/bpf/stackmap.c:290
error: kernel/bpf/stackmap.c: patch does not apply
error: patch failed: kernel/futex.c:1639
error: kernel/futex.c: patch does not apply
error: patch failed: kernel/locking/rtmutex_common.h:130
error: kernel/locking/rtmutex_common.h: patch does not apply
error: patch failed: kernel/printk/internal.h:1
error: kernel/printk/internal.h: patch does not apply
error: patch failed: kernel/printk/printk.c:452
error: kernel/printk/printk.c: patch does not apply
error: patch failed: kernel/printk/printk_safe.c:1
error: kernel/printk/printk_safe.c: patch does not apply
Context reduced to (2/2) to apply fragment at 767
Context reduced to (2/2) to apply fragment at 405
error: patch failed: kernel/signal.c:432
error: kernel/signal.c: patch does not apply
error: patch failed: kernel/trace/trace.c:3592
error: kernel/trace/trace.c: patch does not apply
error: patch failed: kernel/workqueue.c:2533
error: kernel/workqueue.c: patch does not apply
Context reduced to (1/1) to apply fragment at 1268
Context reduced to (2/2) to apply fragment at 1382
[ERROR]: Application of .kernel-meta//patches//./patch-5.4.106-
rt54.patch failed.
         Patch needs to be refreshed. Sample resolution script:
             .git/rebase-apply/resolve_rejects
WARNING:
/home/jack/ws_zcu102/petalinux/2021_03_25_Ubuntu_Petalinux/build/tmp/wo
rk/zynqmp_generic-xilinx-linux/linux-xlnx/5.4+gitAUTOINC+62ea514294-
r0/devtooltmp-rh17ls9u/temp/run.do_patch.1045876:1 exit 1 from 'exit 1'

ERROR: Logfile of failure stored in:
/home/jack/ws_zcu102/petalinux/2021_03_25_Ubuntu_Petalinux/build/tmp/wo
rk/zynqmp_generic-xilinx-linux/linux-xlnx/5.4+gitAUTOINC+62ea514294-
r0/devtooltmp-rh17ls9u/temp/log.do_patch.1045876
----------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Application of standard kernel patch and then RT patch with Petalinux
  2021-03-25 10:04 Application of standard kernel patch and then RT patch with Petalinux jack
@ 2021-03-25 12:54 ` Ahmed S. Darwish
  0 siblings, 0 replies; 2+ messages in thread
From: Ahmed S. Darwish @ 2021-03-25 12:54 UTC (permalink / raw)
  To: jack; +Cc: linux-rt-users

Hi Jack,

On Mar 25, 2021, Jack wrote:
>
> I am having problems applying kernel patches in the context of a Xilinx
> Petalinux project (Yocto-based).
>
> Xilinx provides a 5.4.0 kernel, according to make kernelconfig, though
> how this corresponds to the upstream 5.4.0 kernel, I'm not sure.
>

What Xilinx provides in its linux-xlnx tree is quite different from the
mainline v5.4 kernel. You can see all the differences by diffing against
219d54332a09 ("Linux 5.4").

> My understanding is that, in order to apply the latest 5.4 rt patch
> (106-rt54), I have to apply the upstream 106 patch first. Is this
> correct?
>

No, it doesn't work out that way, especially that the Xilinx kernel is
quite different at core kernel components.

The RT kernel releases are meant to be taken as a whole, by picking one
of the stable versions shown at:

  https://wiki.linuxfoundation.org/realtime/preempt_rt_versions

> When applying the patches using petalinux-config -c kernel, the
> upstream patch appears to be accepted, but the rt patch is not. I get
> the sequence of errors below, picked out in red.
>

FYI, in general, it's advised to separate kernel development from
"integration" development (e.g. yocto, peta linux, etc.)

> I am not familiar enough with the kernel, or the Petalinux tools, to
> get a handle on the problem. The log file mentioned at the bottom does
> not exist following the completion of the command.
>
> Is anyone able to help with this?

Unfortunately, if you're going to do RT things on top of an SoC kernel,
you're on your own — and some kernel development expertise will be
needed.

There are only two sane ways out:

1) Clone one of the stable RT kenrels trees (e.g., v5.4.106-rt45), then
*carefully* pull in what you need from the Xilinx kernel tree. Then do
proper stress and latency tests to make sure that everything is still in
line.

2) Ask a supplier with sufficient embedded/kernel/RT expertise to do it
for you.

Good luck,

--
Ahmed S. Darwish
Linutronix GmbH

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 10:04 Application of standard kernel patch and then RT patch with Petalinux jack
2021-03-25 12:54 ` Ahmed S. Darwish

Linux-rt-users Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rt-users/0 linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ https://lore.kernel.org/linux-rt-users \
		linux-rt-users@vger.kernel.org
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rt-users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git