All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
@ 2021-02-12  3:31 Guenter Roeck
  2021-02-12 14:16 ` Rob Herring
  0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2021-02-12  3:31 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-kernel, Frank Rowand, devicetree

Hi Rob,

On Wed, Feb 03, 2021 at 03:26:03PM -0600, Rob Herring wrote:
> This adds the following commits from upstream:
> 
> 183df9e9c2b9 gitignore: Ignore the swp files
> 0db6d09584e1 gitignore: Add cscope files
> 307afa1a7be8 Update Jon Loeliger's email
> ca16a723fa9d fdtdump: Fix gcc11 warning
> 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH
> 163f0469bf2e dtc: Allow overlays to have .dtbo extension
> 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
> f7e5737f26aa tests: Fix overlay_overlay_nosugar test case
> 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers
> a7c404099349 libfdt: Internally perform potentially unaligned loads
> bab85e48a6f4 meson: increase default timeout for tests
> f8b46098824d meson: do not assume python is installed, skip tests
> 30a56bce4f0b meson: fix -Wall warning
> 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
> 67849a327927 build-sys: add meson build
> 05874d08212d pylibfdt: allow build out of tree
> 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1)
> e1147b159e92 dtc: Fix signedness comparisons warnings: change types
> 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning
> b30013edb878 libfdt: Fix kernel-doc comments
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

This patch causes my little-endian microblaze qemu emulations to fail
silently (no console output) in next-20210211. Reverting this patch
together with "scripts: dtc: Build fdtoverlay tool" fixes the problem.

Big endian microblaze emulations are not affected. I can't say if other
emulations are affected because I see too many boot failures in -next
to be able to track down all individual problems.

Guenter

---
Bisect log:

# bad: [671176b0016c80b3943cb5387312c886aba3308d] Add linux-next specific files for 20210211
# good: [92bf22614b21a2706f4993b278017e437f7785b3] Linux 5.11-rc7
git bisect start 'HEAD' 'v5.11-rc7'
# good: [d69fe59127a072f06e51bf101b82413056859ddc] Merge remote-tracking branch 'crypto/master'
git bisect good d69fe59127a072f06e51bf101b82413056859ddc
# bad: [9cbf23a8700e40ce348e5dc83c95add50c8689d3] Merge remote-tracking branch 'spi/for-next'
git bisect bad 9cbf23a8700e40ce348e5dc83c95add50c8689d3
# good: [635a8e981a1f34802668307e0b7bb8834d850a66] Merge remote-tracking branch 'drm-misc/for-linux-next'
git bisect good 635a8e981a1f34802668307e0b7bb8834d850a66
# good: [dbb24458a99eed64fdcc88630e8ac38376720f96] Merge remote-tracking branch 'block/for-next'
git bisect good dbb24458a99eed64fdcc88630e8ac38376720f96
# good: [f82648f1c7dd4709ff34cae8a98978fbf8e47d33] Merge remote-tracking branch 'integrity/next-integrity'
git bisect good f82648f1c7dd4709ff34cae8a98978fbf8e47d33
# good: [b18e8865643e421fc3537d7eb446f1eb9edfdf1b] Merge remote-tracking branch 'iommu/next'
git bisect good b18e8865643e421fc3537d7eb446f1eb9edfdf1b
# good: [6589daf8bb98c75ad1065edad87c099ffb9f5d87] dt-bindings: spi: sunxi: Add H616 compatible string
git bisect good 6589daf8bb98c75ad1065edad87c099ffb9f5d87
# bad: [322322d15b9b912bc8710c367a95a7de62220a72] dt-bindings: ethernet-controller: fix fixed-link specification
git bisect bad 322322d15b9b912bc8710c367a95a7de62220a72
# good: [6e09d75513d2670b7ab91ab3584fc5bcf2675a75] hwmon: (lm70) Use device_get_match_data()
git bisect good 6e09d75513d2670b7ab91ab3584fc5bcf2675a75
# good: [9183908e70e913d2db052588172968da55d82af5] dt-bindings: Fix errors in 'if' schemas
git bisect good 9183908e70e913d2db052588172968da55d82af5
# bad: [59b48a715107d5719b75250059864fa775837425] scripts: dtc: Remove the unused fdtdump.c file
git bisect bad 59b48a715107d5719b75250059864fa775837425
# bad: [79edff12060fe7772af08607eff50c0e2486c5ba] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
git bisect bad 79edff12060fe7772af08607eff50c0e2486c5ba
# good: [b775f49fbc8b07b0c3a4079e6f09f192eaf6e92f] scripts: dtc: Fetch fdtoverlay.c from external DTC project
git bisect good b775f49fbc8b07b0c3a4079e6f09f192eaf6e92f
# first bad commit: [79edff12060fe7772af08607eff50c0e2486c5ba] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9

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

* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  2021-02-12  3:31 [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9 Guenter Roeck
@ 2021-02-12 14:16 ` Rob Herring
  2021-02-12 15:17   ` Guenter Roeck
  2021-02-12 22:44   ` Guenter Roeck
  0 siblings, 2 replies; 10+ messages in thread
From: Rob Herring @ 2021-02-12 14:16 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-kernel, Frank Rowand, devicetree

On Thu, Feb 11, 2021 at 9:31 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> Hi Rob,
>
> On Wed, Feb 03, 2021 at 03:26:03PM -0600, Rob Herring wrote:
> > This adds the following commits from upstream:
> >
> > 183df9e9c2b9 gitignore: Ignore the swp files
> > 0db6d09584e1 gitignore: Add cscope files
> > 307afa1a7be8 Update Jon Loeliger's email
> > ca16a723fa9d fdtdump: Fix gcc11 warning
> > 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH
> > 163f0469bf2e dtc: Allow overlays to have .dtbo extension
> > 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
> > f7e5737f26aa tests: Fix overlay_overlay_nosugar test case
> > 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers
> > a7c404099349 libfdt: Internally perform potentially unaligned loads
> > bab85e48a6f4 meson: increase default timeout for tests
> > f8b46098824d meson: do not assume python is installed, skip tests
> > 30a56bce4f0b meson: fix -Wall warning
> > 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
> > 67849a327927 build-sys: add meson build
> > 05874d08212d pylibfdt: allow build out of tree
> > 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1)
> > e1147b159e92 dtc: Fix signedness comparisons warnings: change types
> > 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning
> > b30013edb878 libfdt: Fix kernel-doc comments
> >
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> This patch causes my little-endian microblaze qemu emulations to fail
> silently (no console output) in next-20210211. Reverting this patch
> together with "scripts: dtc: Build fdtoverlay tool" fixes the problem.

My guess would be something in libfdt. Maybe 7cd5d5fe43d5 or
a7c404099349, though that should return to historical behavior.

Can you give me the qemu command line and kernel cfg?

Rob

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

* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  2021-02-12 14:16 ` Rob Herring
@ 2021-02-12 15:17   ` Guenter Roeck
  2021-02-12 21:01     ` Rob Herring
  2021-02-12 22:44   ` Guenter Roeck
  1 sibling, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2021-02-12 15:17 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-kernel, Frank Rowand, devicetree

On Fri, Feb 12, 2021 at 08:16:04AM -0600, Rob Herring wrote:
> On Thu, Feb 11, 2021 at 9:31 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > Hi Rob,
> >
> > On Wed, Feb 03, 2021 at 03:26:03PM -0600, Rob Herring wrote:
> > > This adds the following commits from upstream:
> > >
> > > 183df9e9c2b9 gitignore: Ignore the swp files
> > > 0db6d09584e1 gitignore: Add cscope files
> > > 307afa1a7be8 Update Jon Loeliger's email
> > > ca16a723fa9d fdtdump: Fix gcc11 warning
> > > 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH
> > > 163f0469bf2e dtc: Allow overlays to have .dtbo extension
> > > 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
> > > f7e5737f26aa tests: Fix overlay_overlay_nosugar test case
> > > 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers
> > > a7c404099349 libfdt: Internally perform potentially unaligned loads
> > > bab85e48a6f4 meson: increase default timeout for tests
> > > f8b46098824d meson: do not assume python is installed, skip tests
> > > 30a56bce4f0b meson: fix -Wall warning
> > > 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
> > > 67849a327927 build-sys: add meson build
> > > 05874d08212d pylibfdt: allow build out of tree
> > > 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1)
> > > e1147b159e92 dtc: Fix signedness comparisons warnings: change types
> > > 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning
> > > b30013edb878 libfdt: Fix kernel-doc comments
> > >
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> >
> > This patch causes my little-endian microblaze qemu emulations to fail
> > silently (no console output) in next-20210211. Reverting this patch
> > together with "scripts: dtc: Build fdtoverlay tool" fixes the problem.
> 
> My guess would be something in libfdt. Maybe 7cd5d5fe43d5 or
> a7c404099349, though that should return to historical behavior.
> 
> Can you give me the qemu command line and kernel cfg?
> 
I copied everything you should need to build a kernel (including toolchain)
to http://server.roeck-us.net/qemu/microblazeel/

[ wow, I really need to update that compiler ]

Guenter

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

* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  2021-02-12 15:17   ` Guenter Roeck
@ 2021-02-12 21:01     ` Rob Herring
  2021-02-12 21:51       ` Guenter Roeck
  2021-02-12 22:34       ` Rob Herring
  0 siblings, 2 replies; 10+ messages in thread
From: Rob Herring @ 2021-02-12 21:01 UTC (permalink / raw)
  To: Guenter Roeck, Michal Simek; +Cc: linux-kernel, Frank Rowand, devicetree

On Fri, Feb 12, 2021 at 9:17 AM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Fri, Feb 12, 2021 at 08:16:04AM -0600, Rob Herring wrote:
> > On Thu, Feb 11, 2021 at 9:31 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > >
> > > Hi Rob,
> > >
> > > On Wed, Feb 03, 2021 at 03:26:03PM -0600, Rob Herring wrote:
> > > > This adds the following commits from upstream:
> > > >
> > > > 183df9e9c2b9 gitignore: Ignore the swp files
> > > > 0db6d09584e1 gitignore: Add cscope files
> > > > 307afa1a7be8 Update Jon Loeliger's email
> > > > ca16a723fa9d fdtdump: Fix gcc11 warning
> > > > 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH
> > > > 163f0469bf2e dtc: Allow overlays to have .dtbo extension
> > > > 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
> > > > f7e5737f26aa tests: Fix overlay_overlay_nosugar test case
> > > > 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers
> > > > a7c404099349 libfdt: Internally perform potentially unaligned loads
> > > > bab85e48a6f4 meson: increase default timeout for tests
> > > > f8b46098824d meson: do not assume python is installed, skip tests
> > > > 30a56bce4f0b meson: fix -Wall warning
> > > > 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
> > > > 67849a327927 build-sys: add meson build
> > > > 05874d08212d pylibfdt: allow build out of tree
> > > > 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1)
> > > > e1147b159e92 dtc: Fix signedness comparisons warnings: change types
> > > > 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning
> > > > b30013edb878 libfdt: Fix kernel-doc comments
> > > >
> > > > Signed-off-by: Rob Herring <robh@kernel.org>
> > >
> > > This patch causes my little-endian microblaze qemu emulations to fail
> > > silently (no console output) in next-20210211. Reverting this patch
> > > together with "scripts: dtc: Build fdtoverlay tool" fixes the problem.
> >
> > My guess would be something in libfdt. Maybe 7cd5d5fe43d5 or
> > a7c404099349, though that should return to historical behavior.
> >
> > Can you give me the qemu command line and kernel cfg?
> >
> I copied everything you should need to build a kernel (including toolchain)
> to http://server.roeck-us.net/qemu/microblazeel/
>
> [ wow, I really need to update that compiler ]

I can't seem to get BE/LE nor reverted or not working. It's always
dying in microblaze_cache_init() based on the last print. It's your
config, but gcc 10.1.0 off of kernel.org.

There is at least one possible problem here that the FDT may only be 4
byte aligned. The assumption is 8 bytes to not have misaligned
accesses (and only for 64-bit accesses if 4 byte aligned). That's an
issue with the qemu image loading depending on the sizes and
combination of images loaded. That doesn't explain your failure
though. As the initrd is a multiple of 8 bytes, you should be fine.

Rob

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

* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  2021-02-12 21:01     ` Rob Herring
@ 2021-02-12 21:51       ` Guenter Roeck
  2021-02-12 22:34       ` Rob Herring
  1 sibling, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2021-02-12 21:51 UTC (permalink / raw)
  To: Rob Herring; +Cc: Michal Simek, linux-kernel, Frank Rowand, devicetree

On Fri, Feb 12, 2021 at 03:01:08PM -0600, Rob Herring wrote:
> On Fri, Feb 12, 2021 at 9:17 AM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On Fri, Feb 12, 2021 at 08:16:04AM -0600, Rob Herring wrote:
> > > On Thu, Feb 11, 2021 at 9:31 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > >
> > > > Hi Rob,
> > > >
> > > > On Wed, Feb 03, 2021 at 03:26:03PM -0600, Rob Herring wrote:
> > > > > This adds the following commits from upstream:
> > > > >
> > > > > 183df9e9c2b9 gitignore: Ignore the swp files
> > > > > 0db6d09584e1 gitignore: Add cscope files
> > > > > 307afa1a7be8 Update Jon Loeliger's email
> > > > > ca16a723fa9d fdtdump: Fix gcc11 warning
> > > > > 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH
> > > > > 163f0469bf2e dtc: Allow overlays to have .dtbo extension
> > > > > 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
> > > > > f7e5737f26aa tests: Fix overlay_overlay_nosugar test case
> > > > > 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers
> > > > > a7c404099349 libfdt: Internally perform potentially unaligned loads
> > > > > bab85e48a6f4 meson: increase default timeout for tests
> > > > > f8b46098824d meson: do not assume python is installed, skip tests
> > > > > 30a56bce4f0b meson: fix -Wall warning
> > > > > 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
> > > > > 67849a327927 build-sys: add meson build
> > > > > 05874d08212d pylibfdt: allow build out of tree
> > > > > 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1)
> > > > > e1147b159e92 dtc: Fix signedness comparisons warnings: change types
> > > > > 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning
> > > > > b30013edb878 libfdt: Fix kernel-doc comments
> > > > >
> > > > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > >
> > > > This patch causes my little-endian microblaze qemu emulations to fail
> > > > silently (no console output) in next-20210211. Reverting this patch
> > > > together with "scripts: dtc: Build fdtoverlay tool" fixes the problem.
> > >
> > > My guess would be something in libfdt. Maybe 7cd5d5fe43d5 or
> > > a7c404099349, though that should return to historical behavior.
> > >
> > > Can you give me the qemu command line and kernel cfg?
> > >
> > I copied everything you should need to build a kernel (including toolchain)
> > to http://server.roeck-us.net/qemu/microblazeel/
> >
> > [ wow, I really need to update that compiler ]
> 
> I can't seem to get BE/LE nor reverted or not working. It's always
> dying in microblaze_cache_init() based on the last print. It's your
> config, but gcc 10.1.0 off of kernel.org.
> 
My memory may defeat me, but if I remember correctly microblaze needs
a hand-built compiler. That is why I didn't update mine.

> There is at least one possible problem here that the FDT may only be 4
> byte aligned. The assumption is 8 bytes to not have misaligned
> accesses (and only for 64-bit accesses if 4 byte aligned). That's an
> issue with the qemu image loading depending on the sizes and
> combination of images loaded. That doesn't explain your failure
> though. As the initrd is a multiple of 8 bytes, you should be fine.
> 
Also, it worked all along up to your patch. If that was a problem,
I should have seen a problem on and off.

Guenter

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

* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  2021-02-12 21:01     ` Rob Herring
  2021-02-12 21:51       ` Guenter Roeck
@ 2021-02-12 22:34       ` Rob Herring
  2021-02-12 22:50         ` Guenter Roeck
  1 sibling, 1 reply; 10+ messages in thread
From: Rob Herring @ 2021-02-12 22:34 UTC (permalink / raw)
  To: Guenter Roeck, Michal Simek; +Cc: linux-kernel, Frank Rowand, devicetree

On Fri, Feb 12, 2021 at 3:01 PM Rob Herring <robh@kernel.org> wrote:
>
> On Fri, Feb 12, 2021 at 9:17 AM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On Fri, Feb 12, 2021 at 08:16:04AM -0600, Rob Herring wrote:
> > > On Thu, Feb 11, 2021 at 9:31 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > >
> > > > Hi Rob,
> > > >
> > > > On Wed, Feb 03, 2021 at 03:26:03PM -0600, Rob Herring wrote:
> > > > > This adds the following commits from upstream:
> > > > >
> > > > > 183df9e9c2b9 gitignore: Ignore the swp files
> > > > > 0db6d09584e1 gitignore: Add cscope files
> > > > > 307afa1a7be8 Update Jon Loeliger's email
> > > > > ca16a723fa9d fdtdump: Fix gcc11 warning
> > > > > 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH
> > > > > 163f0469bf2e dtc: Allow overlays to have .dtbo extension
> > > > > 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
> > > > > f7e5737f26aa tests: Fix overlay_overlay_nosugar test case
> > > > > 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers
> > > > > a7c404099349 libfdt: Internally perform potentially unaligned loads
> > > > > bab85e48a6f4 meson: increase default timeout for tests
> > > > > f8b46098824d meson: do not assume python is installed, skip tests
> > > > > 30a56bce4f0b meson: fix -Wall warning
> > > > > 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
> > > > > 67849a327927 build-sys: add meson build
> > > > > 05874d08212d pylibfdt: allow build out of tree
> > > > > 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1)
> > > > > e1147b159e92 dtc: Fix signedness comparisons warnings: change types
> > > > > 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning
> > > > > b30013edb878 libfdt: Fix kernel-doc comments
> > > > >
> > > > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > >
> > > > This patch causes my little-endian microblaze qemu emulations to fail
> > > > silently (no console output) in next-20210211. Reverting this patch
> > > > together with "scripts: dtc: Build fdtoverlay tool" fixes the problem.
> > >
> > > My guess would be something in libfdt. Maybe 7cd5d5fe43d5 or
> > > a7c404099349, though that should return to historical behavior.
> > >
> > > Can you give me the qemu command line and kernel cfg?
> > >
> > I copied everything you should need to build a kernel (including toolchain)
> > to http://server.roeck-us.net/qemu/microblazeel/
> >
> > [ wow, I really need to update that compiler ]
>
> I can't seem to get BE/LE nor reverted or not working. It's always
> dying in microblaze_cache_init() based on the last print. It's your
> config, but gcc 10.1.0 off of kernel.org.

It seems gcc 10.1 does not work. Seems to die before here:

pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768

> There is at least one possible problem here that the FDT may only be 4
> byte aligned. The assumption is 8 bytes to not have misaligned
> accesses (and only for 64-bit accesses if 4 byte aligned). That's an
> issue with the qemu image loading depending on the sizes and
> combination of images loaded. That doesn't explain your failure
> though. As the initrd is a multiple of 8 bytes, you should be fine.

It's the built-in dtb alignment that is the problem. I had noticed
this earlier, then discovered I had no built-in DTB and QEMU provides
a default. And changing didn't help because on broken gcc-10 it was 8
byte aligned. None of that should matter because we're not using the
built-in either, right? Wrong! The assembly entry code copies the
bootloader dtb into the built-in dtb space. I remember this now from
the last time I cleaned up the early DT code. I suppose the reason is
the bootloader dtb is not or may not be at an address mapped early.
I'd really like to get rid of that copy. Anyway, the oneliner below
fixes it. We need it either way, but I'd like some comments on the
copy.

Rob

diff --git a/arch/microblaze/kernel/vmlinux.lds.S
b/arch/microblaze/kernel/vmlinux.lds.S
index df07b3d06cd6..fb31747ec092 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -45,7 +45,7 @@ SECTIONS {
                _etext = . ;
        }

-       . = ALIGN (4) ;
+       . = ALIGN (8) ;
        __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) {
                _fdt_start = . ;                /* place for fdt blob */
                *(__fdt_blob) ;                 /* Any link-placed DTB */

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

* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  2021-02-12 14:16 ` Rob Herring
  2021-02-12 15:17   ` Guenter Roeck
@ 2021-02-12 22:44   ` Guenter Roeck
  1 sibling, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2021-02-12 22:44 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-kernel, Frank Rowand, devicetree

On Fri, Feb 12, 2021 at 08:16:04AM -0600, Rob Herring wrote:
> On Thu, Feb 11, 2021 at 9:31 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > Hi Rob,
> >
> > On Wed, Feb 03, 2021 at 03:26:03PM -0600, Rob Herring wrote:
> > > This adds the following commits from upstream:
> > >
> > > 183df9e9c2b9 gitignore: Ignore the swp files
> > > 0db6d09584e1 gitignore: Add cscope files
> > > 307afa1a7be8 Update Jon Loeliger's email
> > > ca16a723fa9d fdtdump: Fix gcc11 warning
> > > 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH
> > > 163f0469bf2e dtc: Allow overlays to have .dtbo extension
> > > 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
> > > f7e5737f26aa tests: Fix overlay_overlay_nosugar test case
> > > 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers
> > > a7c404099349 libfdt: Internally perform potentially unaligned loads
> > > bab85e48a6f4 meson: increase default timeout for tests
> > > f8b46098824d meson: do not assume python is installed, skip tests
> > > 30a56bce4f0b meson: fix -Wall warning
> > > 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
> > > 67849a327927 build-sys: add meson build
> > > 05874d08212d pylibfdt: allow build out of tree
> > > 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1)
> > > e1147b159e92 dtc: Fix signedness comparisons warnings: change types
> > > 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning
> > > b30013edb878 libfdt: Fix kernel-doc comments
> > >
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> >
> > This patch causes my little-endian microblaze qemu emulations to fail
> > silently (no console output) in next-20210211. Reverting this patch
> > together with "scripts: dtc: Build fdtoverlay tool" fixes the problem.
> 
> My guess would be something in libfdt. Maybe 7cd5d5fe43d5 or
> a7c404099349, though that should return to historical behavior.
> 

7cd5d5fe43d5 is just a comment change, so that won't be it.
Reverting a7c404099349 didn't help, but reverting 5e735860c478 did the trick.
This does the trick as well:

index 3e893073da05..6ab627e52a21 100644
--- a/scripts/dtc/libfdt/fdt.c
+++ b/scripts/dtc/libfdt/fdt.c
@@ -23,8 +23,9 @@ int32_t fdt_ro_probe_(const void *fdt)
                return totalsize;

        /* The device tree must be at an 8-byte aligned address */
-       if ((uintptr_t)fdt & 7)
-               return -FDT_ERR_ALIGNMENT;
+       if ((uintptr_t)fdt & 7) {
+               // return -FDT_ERR_ALIGNMENT;
+       }

with some debugging ... aha:

Compiled-in FDT at c043f804

and in arch/microblaze/kernel/vmlinux.lds.S:

        . = ALIGN (4) ;
        __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) {
                _fdt_start = . ;                /* place for fdt blob */

So the fix is to either remove the 8-byte alignment check or:

diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index df07b3d06cd6..fb31747ec092 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -45,7 +45,7 @@ SECTIONS {
                _etext = . ;
        }
 
-       . = ALIGN (4) ;
+       . = ALIGN (8) ;
        __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) {
                _fdt_start = . ;                /* place for fdt blob */
                *(__fdt_blob) ;                 /* Any link-placed DTB */

Thanks,
Guenter

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

* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  2021-02-12 22:34       ` Rob Herring
@ 2021-02-12 22:50         ` Guenter Roeck
  2021-02-15 15:23           ` Michal Simek
  0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2021-02-12 22:50 UTC (permalink / raw)
  To: Rob Herring; +Cc: Michal Simek, linux-kernel, Frank Rowand, devicetree

On Fri, Feb 12, 2021 at 04:34:04PM -0600, Rob Herring wrote:
> On Fri, Feb 12, 2021 at 3:01 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Fri, Feb 12, 2021 at 9:17 AM Guenter Roeck <linux@roeck-us.net> wrote:
> > >
> > > On Fri, Feb 12, 2021 at 08:16:04AM -0600, Rob Herring wrote:
> > > > On Thu, Feb 11, 2021 at 9:31 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > > >
> > > > > Hi Rob,
> > > > >
> > > > > On Wed, Feb 03, 2021 at 03:26:03PM -0600, Rob Herring wrote:
> > > > > > This adds the following commits from upstream:
> > > > > >
> > > > > > 183df9e9c2b9 gitignore: Ignore the swp files
> > > > > > 0db6d09584e1 gitignore: Add cscope files
> > > > > > 307afa1a7be8 Update Jon Loeliger's email
> > > > > > ca16a723fa9d fdtdump: Fix gcc11 warning
> > > > > > 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH
> > > > > > 163f0469bf2e dtc: Allow overlays to have .dtbo extension
> > > > > > 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
> > > > > > f7e5737f26aa tests: Fix overlay_overlay_nosugar test case
> > > > > > 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers
> > > > > > a7c404099349 libfdt: Internally perform potentially unaligned loads
> > > > > > bab85e48a6f4 meson: increase default timeout for tests
> > > > > > f8b46098824d meson: do not assume python is installed, skip tests
> > > > > > 30a56bce4f0b meson: fix -Wall warning
> > > > > > 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
> > > > > > 67849a327927 build-sys: add meson build
> > > > > > 05874d08212d pylibfdt: allow build out of tree
> > > > > > 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1)
> > > > > > e1147b159e92 dtc: Fix signedness comparisons warnings: change types
> > > > > > 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning
> > > > > > b30013edb878 libfdt: Fix kernel-doc comments
> > > > > >
> > > > > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > > >
> > > > > This patch causes my little-endian microblaze qemu emulations to fail
> > > > > silently (no console output) in next-20210211. Reverting this patch
> > > > > together with "scripts: dtc: Build fdtoverlay tool" fixes the problem.
> > > >
> > > > My guess would be something in libfdt. Maybe 7cd5d5fe43d5 or
> > > > a7c404099349, though that should return to historical behavior.
> > > >
> > > > Can you give me the qemu command line and kernel cfg?
> > > >
> > > I copied everything you should need to build a kernel (including toolchain)
> > > to http://server.roeck-us.net/qemu/microblazeel/
> > >
> > > [ wow, I really need to update that compiler ]
> >
> > I can't seem to get BE/LE nor reverted or not working. It's always
> > dying in microblaze_cache_init() based on the last print. It's your
> > config, but gcc 10.1.0 off of kernel.org.
> 
> It seems gcc 10.1 does not work. Seems to die before here:
> 
> pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
> 
> > There is at least one possible problem here that the FDT may only be 4
> > byte aligned. The assumption is 8 bytes to not have misaligned
> > accesses (and only for 64-bit accesses if 4 byte aligned). That's an
> > issue with the qemu image loading depending on the sizes and
> > combination of images loaded. That doesn't explain your failure
> > though. As the initrd is a multiple of 8 bytes, you should be fine.
> 
> It's the built-in dtb alignment that is the problem. I had noticed
> this earlier, then discovered I had no built-in DTB and QEMU provides
> a default. And changing didn't help because on broken gcc-10 it was 8
> byte aligned. None of that should matter because we're not using the
> built-in either, right? Wrong! The assembly entry code copies the
> bootloader dtb into the built-in dtb space. I remember this now from
> the last time I cleaned up the early DT code. I suppose the reason is
> the bootloader dtb is not or may not be at an address mapped early.

I think the problem is here:

/* initialize device tree for usage in early_printk */
        early_init_devtree(_fdt_start);

That probably also explains why enabling earlycon doesn't help.

> I'd really like to get rid of that copy. Anyway, the oneliner below
> fixes it. We need it either way, but I'd like some comments on the
> copy.
> 

I can not comment on the copy, but the change below does indeed fix
the problem. Feel free to add

Tested-by: Guenter Roeck <linux@roeck-us.net>

to the patch if you send it out.

Thanks,
Guenter

> Rob
> 
> diff --git a/arch/microblaze/kernel/vmlinux.lds.S
> b/arch/microblaze/kernel/vmlinux.lds.S
> index df07b3d06cd6..fb31747ec092 100644
> --- a/arch/microblaze/kernel/vmlinux.lds.S
> +++ b/arch/microblaze/kernel/vmlinux.lds.S
> @@ -45,7 +45,7 @@ SECTIONS {
>                 _etext = . ;
>         }
> 
> -       . = ALIGN (4) ;
> +       . = ALIGN (8) ;
>         __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) {
>                 _fdt_start = . ;                /* place for fdt blob */
>                 *(__fdt_blob) ;                 /* Any link-placed DTB */

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

* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  2021-02-12 22:50         ` Guenter Roeck
@ 2021-02-15 15:23           ` Michal Simek
  2021-02-15 16:15             ` Guenter Roeck
  0 siblings, 1 reply; 10+ messages in thread
From: Michal Simek @ 2021-02-15 15:23 UTC (permalink / raw)
  To: Guenter Roeck, Rob Herring
  Cc: Michal Simek, linux-kernel, Frank Rowand, devicetree

Hi,

On 2/12/21 11:50 PM, Guenter Roeck wrote:
> On Fri, Feb 12, 2021 at 04:34:04PM -0600, Rob Herring wrote:
>> On Fri, Feb 12, 2021 at 3:01 PM Rob Herring <robh@kernel.org> wrote:
>>>
>>> On Fri, Feb 12, 2021 at 9:17 AM Guenter Roeck <linux@roeck-us.net> wrote:
>>>>
>>>> On Fri, Feb 12, 2021 at 08:16:04AM -0600, Rob Herring wrote:
>>>>> On Thu, Feb 11, 2021 at 9:31 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>>>>>
>>>>>> Hi Rob,
>>>>>>
>>>>>> On Wed, Feb 03, 2021 at 03:26:03PM -0600, Rob Herring wrote:
>>>>>>> This adds the following commits from upstream:
>>>>>>>
>>>>>>> 183df9e9c2b9 gitignore: Ignore the swp files
>>>>>>> 0db6d09584e1 gitignore: Add cscope files
>>>>>>> 307afa1a7be8 Update Jon Loeliger's email
>>>>>>> ca16a723fa9d fdtdump: Fix gcc11 warning
>>>>>>> 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH
>>>>>>> 163f0469bf2e dtc: Allow overlays to have .dtbo extension
>>>>>>> 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
>>>>>>> f7e5737f26aa tests: Fix overlay_overlay_nosugar test case
>>>>>>> 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers
>>>>>>> a7c404099349 libfdt: Internally perform potentially unaligned loads
>>>>>>> bab85e48a6f4 meson: increase default timeout for tests
>>>>>>> f8b46098824d meson: do not assume python is installed, skip tests
>>>>>>> 30a56bce4f0b meson: fix -Wall warning
>>>>>>> 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
>>>>>>> 67849a327927 build-sys: add meson build
>>>>>>> 05874d08212d pylibfdt: allow build out of tree
>>>>>>> 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1)
>>>>>>> e1147b159e92 dtc: Fix signedness comparisons warnings: change types
>>>>>>> 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning
>>>>>>> b30013edb878 libfdt: Fix kernel-doc comments
>>>>>>>
>>>>>>> Signed-off-by: Rob Herring <robh@kernel.org>
>>>>>>
>>>>>> This patch causes my little-endian microblaze qemu emulations to fail
>>>>>> silently (no console output) in next-20210211. Reverting this patch
>>>>>> together with "scripts: dtc: Build fdtoverlay tool" fixes the problem.
>>>>>
>>>>> My guess would be something in libfdt. Maybe 7cd5d5fe43d5 or
>>>>> a7c404099349, though that should return to historical behavior.
>>>>>
>>>>> Can you give me the qemu command line and kernel cfg?
>>>>>
>>>> I copied everything you should need to build a kernel (including toolchain)
>>>> to http://server.roeck-us.net/qemu/microblazeel/
>>>>
>>>> [ wow, I really need to update that compiler ]
>>>
>>> I can't seem to get BE/LE nor reverted or not working. It's always
>>> dying in microblaze_cache_init() based on the last print. It's your
>>> config, but gcc 10.1.0 off of kernel.org.
>>
>> It seems gcc 10.1 does not work. Seems to die before here:
>>
>> pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
>>
>>> There is at least one possible problem here that the FDT may only be 4
>>> byte aligned. The assumption is 8 bytes to not have misaligned
>>> accesses (and only for 64-bit accesses if 4 byte aligned). That's an
>>> issue with the qemu image loading depending on the sizes and
>>> combination of images loaded. That doesn't explain your failure
>>> though. As the initrd is a multiple of 8 bytes, you should be fine.
>>
>> It's the built-in dtb alignment that is the problem. I had noticed
>> this earlier, then discovered I had no built-in DTB and QEMU provides
>> a default. And changing didn't help because on broken gcc-10 it was 8
>> byte aligned. None of that should matter because we're not using the
>> built-in either, right? Wrong! The assembly entry code copies the
>> bootloader dtb into the built-in dtb space. I remember this now from
>> the last time I cleaned up the early DT code. I suppose the reason is
>> the bootloader dtb is not or may not be at an address mapped early.
> 

I have tried 9.3 and 10.0 from
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/
but none of them did boot on real HW.

Xilinx stayed on 9.2 and I have asked team to generate gcc 10/10.1 for
me to be able to try it myself.


> I think the problem is here:
> 
> /* initialize device tree for usage in early_printk */
>         early_init_devtree(_fdt_start);
> 
> That probably also explains why enabling earlycon doesn't help.

Can you please elaborate more on it?
I see earlycon to be enabled quite early.

[    0.000000] Ramdisk addr 0x00000000,
[    0.000000] Compiled-in FDT at (ptrval)
[    0.000000] earlycon: ns16550a0 at MMIO 0x44a01000 (options '115200n8')
[    0.000000] printk: bootconsole [ns16550a0] enabled
[    0.000000] cma: Reserved 16 MiB at 0xaec00000


> 
>> I'd really like to get rid of that copy. Anyway, the oneliner below
>> fixes it. We need it either way, but I'd like some comments on the
>> copy.
>>
> 
> I can not comment on the copy, but the change below does indeed fix
> the problem. Feel free to add
> 
> Tested-by: Guenter Roeck <linux@roeck-us.net>
> 
> to the patch if you send it out.

Please send the patch. Would be the best as early as possible and I will
queue it for 5.12.

Thanks,
Michal


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

* Re: [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  2021-02-15 15:23           ` Michal Simek
@ 2021-02-15 16:15             ` Guenter Roeck
  0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2021-02-15 16:15 UTC (permalink / raw)
  To: Michal Simek, Rob Herring; +Cc: linux-kernel, Frank Rowand, devicetree

On 2/15/21 7:23 AM, Michal Simek wrote:
[ ... ]

> 
>> I think the problem is here:
>>
>> /* initialize device tree for usage in early_printk */
>>         early_init_devtree(_fdt_start);
>>
>> That probably also explains why enabling earlycon doesn't help.
> 
> Can you please elaborate more on it?
> I see earlycon to be enabled quite early.
> 
> [    0.000000] Ramdisk addr 0x00000000,
> [    0.000000] Compiled-in FDT at (ptrval)

Unless I was missing something, this is where it failed.

> [    0.000000] earlycon: ns16550a0 at MMIO 0x44a01000 (options '115200n8')
> [    0.000000] printk: bootconsole [ns16550a0] enabled
> [    0.000000] cma: Reserved 16 MiB at 0xaec00000
> 
[ ... ]

> 
> Please send the patch. Would be the best as early as possible and I will
> queue it for 5.12.
> 
https://lore.kernel.org/patchwork/patch/1380316/

Guenter

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

end of thread, other threads:[~2021-02-15 17:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12  3:31 [PATCH] scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9 Guenter Roeck
2021-02-12 14:16 ` Rob Herring
2021-02-12 15:17   ` Guenter Roeck
2021-02-12 21:01     ` Rob Herring
2021-02-12 21:51       ` Guenter Roeck
2021-02-12 22:34       ` Rob Herring
2021-02-12 22:50         ` Guenter Roeck
2021-02-15 15:23           ` Michal Simek
2021-02-15 16:15             ` Guenter Roeck
2021-02-12 22:44   ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.