<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8122</bug_id>
          
          <creation_ts>2015-08-07 05:43:37 +0000</creation_ts>
          <short_desc>do_patch fails in linux-yocto-rt_4.1 if MACHINE is set qemuarm</short_desc>
          <delta_ts>2015-10-08 07:14:57 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Kernel</product>
          <component>kernel-configuration</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.9 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kotaro Hashimoto">hasimoto.kotaro</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>alejandro.franco</cc>
    
    <cc>bogdanx.a.voiculescu</cc>
    
    <cc>yp.kernel.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          <qa_contact name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>52891</commentid>
    <comment_count>0</comment_count>
    <who name="Kotaro Hashimoto">hasimoto.kotaro</who>
    <bug_when>2015-08-07 05:43:37 +0000</bug_when>
    <thetext>Overview: 
do_patch() task fails if linux-yocto-rt_4.1 is selected and MACHINE is set qemuarm


Steps to Reproduce: 
(1) Get the latest poky
$ git clone git://git.yoctoproject.org/poky
$ source poky/oe-init-build-env

(2) Add the following lines in the local.conf
MACHINE = &quot;qemuarm&quot;
PREFERRED_PROVIDER_virtual/kernel = &quot;linux-yocto-rt&quot;
PREFERRED_VERSION_virtual/kernel = &quot;4.1&quot;     

(3) Build the image
$ bitbake core-image-minimal


Actual Results: 
do_patch process fails with the following error messages.
------------------------
ERROR: Function failed: do_patch (log file is located at /home/kotaro/rt/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-rt/4.1.2+gitAUTOINC+45393dd54f_fe1ee44348-r0/temp/log.do_patch.10586)
ERROR: Logfile of failure stored in: /home/kotaro/rt/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-rt/4.1.2+gitAUTOINC+45393dd54f_fe1ee44348-r0/temp/log.do_patch.10586
Log data follows:
| DEBUG: Executing shell function do_patch
| [INFO] validating against known patches  (qemuarm-preempt-rt-meta)
error: patch failed: arch/arm/mach-versatile/core.c:22 (\)(43 %))
| error: arch/arm/mach-versatile/core.c: patch does not apply
| ERROR. could not update git tree
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_patch (log file is located at /home/kotaro/rt/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-rt/4.1.2+gitAUTOINC+45393dd54f_fe1ee44348-r0/temp/log.do_patch.10586)
ERROR: Task 44 (/home/kotaro/rt/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb, do_patch) failed with exit code &apos;1&apos;
------------------------


Expected Results: 
The whole build process should work successfully.


Build Date &amp; Platform: 
Build 2015-08-04 on Ubuntu 14.10 x86_64


Additional Builds and Platforms: 
Not checked.


Additional Information: 
The symptom doesn&apos;t occur if MACHINE is set qemux86.
It turned out that the patch that produce the error is this.
http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-cache/tree/bsp/arm-versatile-926ejs?h=yocto-4.1

In kgit-s2q, line 526, &quot;git am&quot; command returns error with the patch above, where all the PREEMPT_RT patches have been already applied. 
git am --keep-non-patch $DIR/$i &gt; /dev/null 2&gt;&amp;1


It seems that the 2 patches(arm_versatile_926ejs-add-default-nor-flash-mtd-parts.patch, arm_versatile_926ejs-kick-off-PrimeCell-RTC-PL031.patch) have been already merged into &quot;standard/preempt-rt&quot; branch of &quot;linux-yocto-4.1&quot; even though these changes are not exactly the same. 
So we suppose arm-versatile-926ejs patches are not needed in linux-yocto-rt 4.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52907</commentid>
    <comment_count>1</comment_count>
    <who name="Alex Franco">alejandro.franco</who>
    <bug_when>2015-08-07 14:46:20 +0000</bug_when>
    <thetext>I can confirm I reproduced this on Archlinux:

4.1.4-1-ARCH #1 SMP PREEMPT Mon Aug 3 21:30:37 UTC 2015 x86_64 GNU/Linux

------------------------
ERROR: Function failed: do_patch (log file is located at /bld/poky/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-rt/4.1.2+gitAUTOINC+45393dd54f_fe1ee44348-r0/temp/log.do_patch.21584)
ERROR: Logfile of failure stored in: /bld/poky/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-rt/4.1.2+gitAUTOINC+45393dd54f_fe1ee44348-r0/temp/log.do_patch.21584
Log data follows:
| DEBUG: Executing shell function do_patch
| [INFO] validating against known patches  (qemuarm-preempt-rt-meta)
error: patch failed: arch/arm/mach-versatile/core.c:22 (\)(43 %))
| error: arch/arm/mach-versatile/core.c: patch does not apply
| ERROR. could not update git tree
| WARNING: /bld/poky/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-rt/4.1.2+gitAUTOINC+45393dd54f_fe1ee44348-r0/temp/run.do_patch.21584:1 exit 1 from
|   patchme qemuarm
| ERROR: Function failed: do_patch (log file is located at /bld/poky/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-rt/4.1.2+gitAUTOINC+45393dd54f_fe1ee44348-r0/temp/log.do_patch.21584)
ERROR: Task 44 (/bld/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb, do_patch) failed with exit code &apos;1&apos;
------------------------</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52979</commentid>
    <comment_count>2</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2015-08-11 04:32:57 +0000</bug_when>
    <thetext>My mistake on this, I dropped branches in the 4.1 kernel on
purpose and missed updating this BSP.

Will fix shortly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53554</commentid>
    <comment_count>3</comment_count>
    <who name="Kotaro Hashimoto">hasimoto.kotaro</who>
    <bug_when>2015-08-31 02:54:11 +0000</bug_when>
    <thetext>As of 31th Aug, the do_patch() problem seems to have been resolved, but still having do_compile() error because the necessary patch below is not yet integrated.

https://kernel.googlesource.com/pub/scm/linux/kernel/git/rt/linux-rt-devel/+/linux-4.1.y-rt-patches/patches/pid.h-include-atomic.h.patch


The current recipe linux-yocto-rt_4.1.bb below points not the latest kernel &quot;Merge tag &apos;v4.1.6&apos; into standard/base 59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e&quot;.
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb?id=b0db6c2a7fb98287fa112d23399aad8831397209

Should be &quot;Merge branch &apos;standard/base&apos; into standard/preempt-rt c7415097d6cadffe1f6935204fd593d0d028c057&quot;



--- linux-yocto-rt_4.1.bb	2015-08-31 11:42:05.176124411 +0900
+++ linux-yocto-rt_4.1.bb	2015-08-31 11:42:31.664123883 +0900
@@ -2,7 +2,7 @@
 
 require recipes-kernel/linux/linux-yocto.inc
 
-SRCREV_machine ?= &quot;59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e&quot;
+SRCREV_machine ?= &quot;c7415097d6cadffe1f6935204fd593d0d028c057&quot;
 SRCREV_meta ?= &quot;429f9e2ff0649b8c9341345622545d874d5e303a&quot;
 
 SRC_URI = &quot;git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};name=machine \</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53555</commentid>
    <comment_count>4</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2015-08-31 02:55:13 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; As of 31th Aug, the do_patch() problem seems to have been resolved, but
&gt; still having do_compile() error because the necessary patch below is not yet
&gt; integrated.
&gt; 
&gt; https://kernel.googlesource.com/pub/scm/linux/kernel/git/rt/linux-rt-devel/+/
&gt; linux-4.1.y-rt-patches/patches/pid.h-include-atomic.h.patch
&gt; 
&gt; 
&gt; The current recipe linux-yocto-rt_4.1.bb below points not the latest kernel
&gt; &quot;Merge tag &apos;v4.1.6&apos; into standard/base
&gt; 59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e&quot;.
&gt; http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/
&gt; linux/linux-yocto-rt_4.1.bb?id=b0db6c2a7fb98287fa112d23399aad8831397209
&gt; 
&gt; Should be &quot;Merge branch &apos;standard/base&apos; into standard/preempt-rt
&gt; c7415097d6cadffe1f6935204fd593d0d028c057&quot;
&gt; 
&gt; 
&gt; 
&gt; --- linux-yocto-rt_4.1.bb	2015-08-31 11:42:05.176124411 +0900
&gt; +++ linux-yocto-rt_4.1.bb	2015-08-31 11:42:31.664123883 +0900
&gt; @@ -2,7 +2,7 @@
&gt;  
&gt;  require recipes-kernel/linux/linux-yocto.inc
&gt;  
&gt; -SRCREV_machine ?= &quot;59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e&quot;
&gt; +SRCREV_machine ?= &quot;c7415097d6cadffe1f6935204fd593d0d028c057&quot;
&gt;  SRCREV_meta ?= &quot;429f9e2ff0649b8c9341345622545d874d5e303a&quot;
&gt;  
&gt;  SRC_URI =
&gt; &quot;git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};
&gt; name=machine \

That patch is integrated .. but my SRCREV updates are still pending.
There&apos;s nothing to do here but wait.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54711</commentid>
    <comment_count>5</comment_count>
    <who name="Kotaro Hashimoto">hasimoto.kotaro</who>
    <bug_when>2015-09-28 04:35:38 +0000</bug_when>
    <thetext>We&apos;ve confirmed that the build error has been resolved.

Poky: 28th Sep. master latest (5a51fb28dbdfcae8ceb503a5290532dd38aeb09f).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55051</commentid>
    <comment_count>6</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2015-10-08 07:14:57 +0000</bug_when>
    <thetext>set Verified per  Kotaro Hashimoto comment</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>