Strange issue while applaying the patch to imx6ull-colibri-eval-v3.dts for i.mx6ull

hey… there
Hope you all are doing well

I’m dealing with the i.mx6ull colibri (512 MB NAND version)/
I’m facing the very strange issue, while applying the patch to “imx6ull-colibri-eval-v3.dts” file

the intention is very simple, i need to disable the lcd node

here is what i did …

  1. created the patch by git diff command

git diff --no-index imx6ull-colibri-eval-v3.dts.orig imx6ull-colibri-eval-v3.dts > 0001-imx6ull-colibri-eval-v3-dts-custom.patch

  1. added the patch in to recipes-kernel recipes file. the file hierarchy as follows

recipes-kernel$ tree
.
└── linux
├── colibri-imx6ull
│ └── 0001-imx6ull-colibri-eval-v3-dts-custom.patch
└── linux-toradex-mainline_%.bbappend

  1. the contents of the patch as follows
diff --git a/imx6ull-colibri-eval-v3.dts.orig b/imx6ull-colibri-eval-v3.dts
index b038534..d6da984 100644
--- a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts
+++ b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts
@@ -26,7 +26,7 @@
 };

 &lcdif {
-       status = "disabled";
+       status = "okay";
 };

 &panel_dpi {

  1. The contents of the .bbappend recipe as follows
FILESEXTRAPATHS:prepend := "${THISDIR}:"

SRC_URI += "file://0001-imx6ull-colibri-eval-v3-dts-custom.patch"

Problem statement

Every time, the image building is failing while applying the patch!!!
The strange things is, it’s happening with this .dts file only while other.dtsi file are getting patched!

here are the error logs

pl. suggest me the possible solutions

Thanks

Sstate summary: Wanted 0 Local 0 Mirrors 0 Missed 0 Current 100 (0% match, 100% complete)
NOTE: Executing Tasks
ERROR: linux-toradex-mainline-6.1.112+gitAUTOINC+aa4cd140bb-r0 do_patch: Could not apply patches for colibri-imx6ull.
ERROR: linux-toradex-mainline-6.1.112+gitAUTOINC+aa4cd140bb-r0 do_patch: Patch failures can be resolved in the linux source directory /home/mahendra/oe-core/build-aebox/tmp/work-shared/colibri-imx6ull/kernel-source)
ERROR: linux-toradex-mainline-6.1.112+gitAUTOINC+aa4cd140bb-r0 do_patch: ExecutionError('/home/mahendra/oe-core/build-aebox/tmp/work/colibri_imx6ull-poky-linux-gnueabi/linux-toradex-mainline/6.1.112+gitAUTOINC+aa4cd140bb-r0/temp/run.do_patch.493150', 1, None, None)
ERROR: Logfile of failure stored in: /home/mahendra/oe-core/build-aebox/tmp/work/colibri_imx6ull-poky-linux-gnueabi/linux-toradex-mainline/6.1.112+gitAUTOINC+aa4cd140bb-r0/temp/log.do_patch.493150
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/home/mahendra/oe-core/layers/poky/meta/recipes-devtools/quilt/quilt-native_0.67.bb:do_populate_sysroot', '/home/mahendra/oe-core/layers/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', 'virtual:native:/home/mahendra/oe-core/layers/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: ['quilt-native', 'patch-native']
| NOTE: Skipping as already exists in sysroot: ['kern-tools-native', 'libtool-native', 'attr-native', 'texinfo-dummy-native', 'gettext-minimal-native']
| DEBUG: sed -e 's:^[^/]*/:/home/mahendra/oe-core/build-aebox/tmp/work/colibri_imx6ull-poky-linux-gnueabi/linux-toradex-mainline/6.1.112+gitAUTOINC+aa4cd140bb-r0/recipe-sysroot-native/:g' /home/mahendra/oe-core/build-aebox/tmp/sysroots-components/x86_64/quilt-native/fixmepath | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:/home/mahendra/oe-core/build-aebox/tmp/work/colibri_imx6ull-poky-linux-gnueabi/linux-toradex-mainline/6.1.112+gitAUTOINC+aa4cd140bb-r0/recipe-sysroot:g; s:FIXMESTAGINGDIRHOST:/home/mahendra/oe-core/build-aebox/tmp/work/colibri_imx6ull-poky-linux-gnueabi/linux-toradex-mainline/6.1.112+gitAUTOINC+aa4cd140bb-r0/recipe-sysroot-native:g' -e 's:FIXME_PSEUDO_SYSROOT:/home/mahendra/oe-core/build-aebox/tmp/sysroots-components/x86_64/pseudo-native:g' -e 's:FIXME_HOSTTOOLS_DIR:/home/mahendra/oe-core/build-aebox/tmp/hosttools:g' -e 's:FIXME_PKGDATA_DIR:/home/mahendra/oe-core/build-aebox/tmp/pkgdata/colibri-imx6ull:g' -e 's:FIXME_PSEUDO_LOCALSTATEDIR:/home/mahendra/oe-core/build-aebox/tmp/work/colibri_imx6ull-poky-linux-gnueabi/linux-toradex-mainline/6.1.112+gitAUTOINC+aa4cd140bb-r0/pseudo/:g' -e 's:FIXME_LOGFIFO:/home/mahendra/oe-core/build-aebox/tmp/work/colibri_imx6ull-poky-linux-gnueabi/linux-toradex-mainline/6.1.112+gitAUTOINC+aa4cd140bb-r0/temp/fifo.493150:g'
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_patch
| (1/28) 0001-imx6ull-colibri-eval-v3-dts-custom.patch
| [INFO]: check of .kernel-meta//patches//./0001-imx6ull-colibri-eval-v3-dts-custom.patch with "git am" did not pass, trying reduced context.
| [INFO]: Context reduced git-am of .kernel-meta//patches//./0001-imx6ull-colibri-eval-v3-dts-custom.patch with "git am" did not work, trying "apply".
| error: patch failed: arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts:26
| error: arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts: patch does not apply
| [ERROR]: Application of .kernel-meta//patches//./0001-imx6ull-colibri-eval-v3-dts-custom.patch failed.
|          Patch needs to be refreshed. Sample resolution script:
|              .git/rebase-apply/resolve_rejects
| ERROR: Could not apply patches for colibri-imx6ull.
| ERROR: Patch failures can be resolved in the linux source directory /home/mahendra/oe-core/build-aebox/tmp/work-shared/colibri-imx6ull/kernel-source)
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/mahendra/oe-core/layers/meta-toradex-bsp-common/recipes-kernel/linux/linux-toradex-mainline_git.bb:do_patch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 453 tasks of which 446 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/mahendra/oe-core/layers/meta-toradex-bsp-common/recipes-kernel/linux/linux-toradex-mainline_git.bb:do_patch
Summary: There was 1 WARNING message.
Summary: There were 3 ERROR messages, returning a non-zero exit code.

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Based on the context provided, it seems that the patch you created is not applying cleanly to the imx6ull-colibri-eval-v3.dts file. Here are some steps you can take to resolve this issue:

  1. Verify the Original File: Ensure that the imx6ull-colibri-eval-v3.dts.orig file you used to create the patch is identical to the version in the source tree you are trying to patch. Any differences will cause the patch to fail.

  2. Refresh the Patch: If the source file has changed since you created the patch, you will need to regenerate the patch. Make sure to use the latest version of the imx6ull-colibri-eval-v3.dts file as your base.

  3. Check Line Numbers and Context: The error indicates a failure at line 26. Ensure that the line numbers and context in your patch match the current state of the file. Even small changes in the file can cause the patch to fail.

  4. Manual Application: Try applying the patch manually to see if there are any conflicts or issues that need to be resolved. This can help identify specific problems with the patch.

  5. Consult Logs: Review the error logs for any additional information that might indicate why the patch is failing. Look for any specific error messages or hints.

  6. Use Quilt for Patch Management: Consider using a tool like Quilt to manage and apply patches. It can provide more detailed feedback and help with resolving conflicts.

If these steps do not resolve the issue, you may need to consult the documentation for the build system or seek assistance from the community for further insights.

Please, also check if these links can help you solve your problem:

imx6ull processor based board's console freezes in kernel 6.1.22 when LCD node is disabled in dts - NXP Community.

Hi @mahi,

had this issue too when I tried to do modifications for our iMX6ULL NAND-based system in Yocto.

Problem: If the base recipe you append to already contains patches, the order in which they are applied is not correct if “SRC_URI +=” is used.
Using “SRC_URI:append =” solved it for me.
The difference is that “append” is applied at variable expansion time in contrast to “+=” which is applied immediately.

I did not apply patches to the the linux device tree, though, but added new dts / dtsi files because massive modifications had to be done.

The patch problem occurred when I modified the u-boot source code using bitbake / Yocto devtool.

hi… @sb.cato
Thanks for the feedback

Yes, i have also tried with the same

FILESEXTRAPATHS:prepend := "${THISDIR}:"

SRC_URI:append = "file://0001-imx6ull-colibri-eval-v3-dts-custom.patch"


still, no luck
here is the error lists for the same

ERROR: linux-toradex-mainline-6.1.112+gitAUTOINC+aa4cd140bb-r0 do_patch: Could not apply patches for colibri-imx6ull.
ERROR: linux-toradex-mainline-6.1.112+gitAUTOINC+aa4cd140bb-r0 do_patch: Patch failures can be resolved in the linux source directory /home/mahendra/oe-core/build-aebox/tmp/work-shared/colibri-imx6ull/kernel-source)
ERROR: linux-toradex-mainline-6.1.112+gitAUTOINC+aa4cd140bb-r0 do_patch: ExecutionError('/home/mahendra/oe-core/build-aebox/tmp/work/colibri_imx6ull-poky-linux-gnueabi/linux-toradex-mainline/6.1.112+gitAUTOINC+aa4cd140bb-r0/temp/run.do_patch.123392', 1, None, None)
ERROR: Logfile of failure stored in: /home/mahendra/oe-core/build-aebox/tmp/work/colibri_imx6ull-poky-linux-gnueabi/linux-toradex-mainline/6.1.112+gitAUTOINC+aa4cd140bb-r0/temp/log.do_patch.123392
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/home/mahendra/oe-core/layers/poky/meta/recipes-devtools/quilt/quilt-native_0.67.bb:do_populate_sysroot', '/home/mahendra/oe-core/layers/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', 'virtual:native:/home/mahendra/oe-core/layers/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['quilt-native', 'kern-tools-native', 'patch-native', 'attr-native', 'libtool-native', 'gettext-minimal-native', 'texinfo-dummy-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_patch
| (1/28) 0001-thermal-imx-Update-critical-temp-threshold.patch
| (2/28) 0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch
| (3/28) 0001-arm-dts-colibri-imx6-usb-dual-role-switching.patch
| (4/28) 0002-arm-dts-colibri-imx6-move-vbus-supply-to-module-leve.patch
| (5/28) 0003-arm-dts-colibri-imx6-specify-usbh_pen-gpio-being-act.patch
| (6/28) 0001-arm-dts-colibri-imx6ull-keep-peripherals-disabled.patch
| (7/28) 0002-arm-dts-colibri-imx6ull-enable-default-peripherals.patch
| (8/28) 0001-ARM-dts-colibri-imx6ull-Enable-dual-role-switching.patch
| (9/28) 0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch
| (10/28) 0001-ARM-dts-apalis-imx6-Disable-usb-over-current.patch
| (11/28) 0002-ARM-dts-colibri-imx6-Disable-usb-over-current.patch
| (12/28) 0003-ARM-dts-colibri-imx6ull-Disable-usb-over-current.patch
| (13/28) 0004-ARM-dts-colibri-imx7-Disable-usb-over-current.patch
| (14/28) 0001-arm64-dts-imx8mm-verdin-Add-yavia-carrier-board.patch
| (15/28) 0002-arm64-dts-imx8mp-verdin-Add-yavia-carrier-board.patch
| (16/28) 0001-media-v4l2-async-fix-binding-async-subdevs-with-mult.patch
| (17/28) 0002-media-i2c-ov5640-Implement-get_mbus_config.patch
| (18/28) 0001-Revert-media-v4l2-async-Use-endpoints-in-__v4l2_asyn.patch
| (19/28) 0001-power-reset-gpio-poweroff-use-a-struct-to-store-the-.patch
| (20/28) 0002-power-reset-gpio-poweroff-use-sys-off-handler-API.patch
| (21/28) 0003-dt-bindings-power-reset-gpio-poweroff-Add-priority-p.patch
| (22/28) 0004-power-reset-gpio-poweroff-make-sys-handler-priority-.patch
| (23/28) 0003-arm64-dts-freescale-verdin-imx8mp-add-support-to-mal.patch
| (24/28) 0003-arm64-dts-freescale-verdin-imx8mm-add-support-to-mal.patch
| (25/28) 0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch
| (26/28) 0001-dt-bindings-arm-fsl-Add-toradex-apalis_imx6q-eval-v1.patch
| (27/28) 0002-arm-dts-nxp-imx-Add-support-for-Apalis-Evaluation-Bo.patch
| (28/28) 0001-imx6ull-colibri-eval-v3-dts-custom.patch
| [INFO]: check of .kernel-meta//patches//./0001-imx6ull-colibri-eval-v3-dts-custom.patch with "git am" did not pass, trying reduced context.
| [INFO]: Context reduced git-am of .kernel-meta//patches//./0001-imx6ull-colibri-eval-v3-dts-custom.patch with "git am" did not work, trying "apply".
| error: patch failed: arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts:26
| error: arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts: patch does not apply
| [ERROR]: Application of .kernel-meta//patches//./0001-imx6ull-colibri-eval-v3-dts-custom.patch failed.
|          Patch needs to be refreshed. Sample resolution script:
|              .git/rebase-apply/resolve_rejects
| ERROR: Could not apply patches for colibri-imx6ull.
| ERROR: Patch failures can be resolved in the linux source directory /home/mahendra/oe-core/build-aebox/tmp/work-shared/colibri-imx6ull/kernel-source)
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/mahendra/oe-core/layers/meta-toradex-bsp-common/recipes-kernel/linux/linux-toradex-mainline_git.bb:do_patch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 806 tasks of which 797 didn't need to be rerun and 1 failed.

Any further suggestions ?

Hi @mahi,

maybe the patch you are using is not created from the correct base file.

You could create a complete copy of the dts file, apply your change there and use that file in your recipe simply replacing the original one.

If you still prefer to use a patch, you have to create the patch from the final output of your Yocto kernel workspace where alle previous patches already have been applied.

To do this you could use the “devtool” workflow:

  • “devtool modify virtual/kernel”: this creates a temporary workspace in your build folder with a local git branch; note that the workspace folder is also added to your “bblayers.conf” file; you can remove that line later, if you do not want to use the workspace anymore
  • apply your changes (edit the dts file)
  • optionally, you can build the kernel or even the complete image using the temporary workspace
  • if you are finished, commit your changes to the local branch in the workspace git
  • using “devtool update-recipe linux-toradex-mainline -a meta-whatever” you can create patches and a recipe framework based on the workspace changes; note, that the generated recipe my need tweaking, e.g. regarding SRC_URI as mentioned before. Maybe create a dummy meta layer and merge it with your own layer.
  • to remove the temporary workspace and switch back to using the original recipes, call “devtool reset linux-toradex-mainline” and rebuild the kernel / image

Note: I would recommend to read the Yocto reference manual part about “devtool” before you start.