Closed jharvell closed 4 years ago
Kernel details:
https://github.com/beagleboard/linux.git
commit 17ceea78d1fc0c6883297ba3d261b5d6f3c976b3 (tag: 4.14.37-ti-r46, bb/4.14)
Author: Robert Nelson <robertcnelson@gmail.com>
Date: Thu Apr 26 15:37:56 2018 -0500
4.14.37-ti-r46 bb.org_defconfig (plus debugging changes)
4.14 TI Delta: https://github.com/RobertCNelson/ti-linux-kernel/compare/19d05d51d321cf13295e8a75c2ab3a62ec91220f...ed7732d6de03523b123073dedf6aaf89733d8d96
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
debugging changes:
jharvell@wolfhound of$ git --no-pager diff 4.14.37-ti-r46
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 7f8cc5c1f426..2a111ea24f8a 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -454,7 +454,10 @@ static int of_fill_overlay_info(struct of_overlay *ov,
{
ovinfo->overlay = of_get_child_by_name(info_node, "__overlay__");
if (ovinfo->overlay == NULL)
+ {
+ pr_debug("Failed to find child with name __overlay__ for node %s\n", info_node->name);
goto err_fail;
+ }
ovinfo->target = find_target_node(ov, info_node, ov->target_index);
if (ovinfo->target == NULL)
@@ -565,7 +568,10 @@ static int of_build_overlay_info(struct of_overlay *ov,
ovinfo->attrs[1] = NULL;
/* NOTE: direct reference to the full_name */
- ovinfo->attr_group.name = kbasename(ovinfo->info->full_name);
+ if(ovinfo->info == NULL)
+ pr_debug("No info found for child node %d of %d for node %s\n", i, cnt, tree->name);
+ else
+ ovinfo->attr_group.name = kbasename(ovinfo->info->full_name);
ovinfo->attr_group.attrs = ovinfo->attrs;
}
Overlay sources below.
I built them by putting the source file in the src/arm directory of bb.org-overlays (git@github.com:beagleboard/bb.org-overlays.git) and running make in the top level directory of the repository.
bb.org-overlays version:
commit 604c0926a4f7505dfc3d501301413c821e59febe (origin/master, origin/HEAD, master)
Author: Robert Nelson <robertcnelson@gmail.com>
Date: Tue Apr 24 08:41:58 2018 -0500
universal rewrite: spi0-xyz and spidev1x
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
New overlay that I was loading to elicit the crash
joey@akita arm$ cat am33xx-bandgap-00A0.dts
/*
* Enumerate the coarse builtin bandgap sensor on the AM33xx.
* This sensor can measure temperatures between -50 and 150 deg Celsius.
* But due to the 8-bit ADC, the resolution is 10.5 deg Celsius.
* Refer to the section "Measuring Case Temperature" at
* http://processors.wiki.ti.com/index.php/AM335x_Thermal_Considerations#Measuring_Board_Temperature
* and also https://e2e.ti.com/support/arm/sitara_arm/f/791/t/393235?tisearch=e2e-quicksearch&keymatch=ti,am335x-bandgap
*
* It looks like this sensor was removed from the official device trees due
* to the low resolution.
*/
/dts-v1/;
/plugin/;
/{
compatible = "ti,am33xx", "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green", "ti,am335x-bone-black", "ti,am335x-bone", "ti,am335x-bone-green-wireless", "ti,am335x-bone-green";
fragment@0
{
target = <&ocp>;
__overlay__
{
#address-cells = <1>;
#size-cells = <1>;
bandgap@44e10448
{
compatible = "ti,am335x-bandgap";
reg = <0x44e10448 0x8>;
};
};
};
};
When I triggered the bug, I had enabled dynamic debugging for the overlay.c file as follows:
pip /sys/kernel/debug/dynamic_debug # echo "file overlay.c +plf" > control
pip /sys/kernel/debug/dynamic_debug # echo am33xx-bandgap > /sys/devices/platform/bone_capemgr/slots
Segmentation fault
This is the commit that introduced the call to sysfs_create_groups:
commit 6ac054d71b6fd5af7e51a90b9a910f2205604d4d
Author: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Date: Thu Apr 23 19:02:16 2015 +0300
of: overlay: add per overlay sysfs attributes
* A per overlay can_remove sysfs attribute that reports whether
the overlay can be removed or not due to another overlapping overlay.
* A target sysfs attribute listing the target of each fragment,
in a group named after the name of the fragment.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
confirmed issue still exists after rebasing to 4.14.39-ti-r47
Yeah, i missed your patch when working thru my sick backlog from last week.
btw, does it work as a u-boot overlay?
v4.14.x is the end of our "/sys/devices/platform/bone_capemgr/slots" technique, to many kernel bugs no maintainers to assist.. So everything is done in u-boot going forward.
Regards,
Yeah, I had a feeling I was the only one trying to make this work :) I'll start investigating the u-boot method instead. Thanks.
@jharvell @RobertCNelson any feedback on if this works with u-boot overlay?
If not, I can try it with our current Debian image.
Please re-open if this is still an issue with u-boot overlay: https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
You may also be interested in the Debian images and kernel builds that we are currently testing for the next release: https://elinux.org/Beagleboard:Latest-images-testing
Kernel Oops triggered on a Beaglebone Black by the following action:
Kernel oops below is from 4.14.37-ti-r46 (https://github.com/beagleboard/linux.git) plus minor unrelated debugging changes that I will detail in a separate comment. The bug is caused by calling sysfs_create_groups with a kobject that has a NULL sysfs directory entry (kobj-sd). I looked at the commit that introduced the call to sysfs_create_groups in April, 2015, and it looks like it would hit this bug every time.
The overlay I am adding is very simple, and I will provide details on that in another comment also.