OK I think almost there,
I have the TX1 on J120 booting from SSD, I can access the IMU on J120 via SPI but I am still suffering from Buffer I/O error on device nvme0n1, logical block xxxxxx. It will work ok for a while and then after n’th restart it will come with those errors. I can usually boot into extlinux configuration where nvme is mounted and not booted from and run e2fsck. Usually there are orphans nodes found and fixed but some times it is so bad there will be core dumps and it will end-up in “emergency shell”. I have impression that it is more likely to happen when I work via serial port system console and GUI session at the same time.
Here are the details of the build I am using:
config_override:
# CONFIG_NET_EMATCH_CANID is not set
CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_BCM=y
CONFIG_CAN_GW=y
#
# CAN Device Drivers
#
# CONFIG_CAN_VCAN is not set
# CONFIG_CAN_SLCAN is not set
CONFIG_CAN_DEV=y
CONFIG_CAN_CALC_BITTIMING=y
# CONFIG_CAN_LEDS is not set
CONFIG_CAN_MCP251X=m
# CONFIG_PCH_CAN is not set
# CONFIG_CAN_GRCAN is not set
# CONFIG_CAN_SJA1000 is not set
# CONFIG_CAN_C_CAN is not set
# CONFIG_CAN_CC770 is not set
#
# CAN USB interfaces
#
# CONFIG_CAN_EMS_USB is not set
# CONFIG_CAN_ESD_USB2 is not set
# CONFIG_CAN_KVASER_USB is not set
# CONFIG_CAN_PEAK_USB is not set
# CONFIG_CAN_8DEV_USB is not set
# CONFIG_CAN_SOFTING is not set
# CONFIG_CAN_DEBUG_DEVICES is not set
#
#enable support for NVME drives like M2
CONFIG_BLK_DEV_NVME=y
#Why the eeprom support??
CONFIG_EEPROM_93CX6=m
CONFIG_RTL8187=m
CONFIG_RTL8187_LEDS=y
CONFIG_ATH_COMMON=m
CONFIG_ATH_CARDS=m
# CONFIG_ATH_DEBUG is not set
# CONFIG_ATH5K is not set
# CONFIG_ATH5K_PCI is not set
# CONFIG_ATH9K is not set
# CONFIG_ATH9K_HTC is not set
CONFIG_CARL9170=m
CONFIG_CARL9170_LEDS=y
CONFIG_CARL9170_WPC=y
# CONFIG_ATH6KL is not set
# CONFIG_AR5523 is not set
# CONFIG_WIL6210 is not set
CONFIG_RT2X00=m
# CONFIG_RT2400PCI is not set
# CONFIG_RT2500PCI is not set
# CONFIG_RT61PCI is not set
# CONFIG_RT2800PCI is not set
CONFIG_RT2500USB=m
CONFIG_RT73USB=m
CONFIG_RT2800USB=m
CONFIG_RT2800USB_RT33XX=y
CONFIG_RT2800USB_RT35XX=y
CONFIG_RT2800USB_RT53XX=y
CONFIG_RT2800USB_RT55XX=y
CONFIG_RT2800USB_UNKNOWN=y
CONFIG_RT2800_LIB=m
CONFIG_RT2X00_LIB_USB=m
CONFIG_RT2X00_LIB=m
CONFIG_RT2X00_LIB_FIRMWARE=y
CONFIG_RT2X00_LIB_CRYPTO=y
CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_DEBUG is not set
CONFIG_RTLWIFI=m
CONFIG_RTLWIFI_DEBUG=y
# CONFIG_RTL8192CE is not set
# CONFIG_RTL8192SE is not set
# CONFIG_RTL8192DE is not set
# CONFIG_RTL8723AE is not set
# CONFIG_RTL8188EE is not set
CONFIG_RTL8192CU=m
CONFIG_RTL8192C_COMMON=m
CONFIG_SPI_SPIDEV=m
# CONFIG_SOC_CAMERA_PLATFORM is not set
CONFIG_MEDIA_ATTACH=y
CONFIG_CRC_ITU_T=m
I use the merge_config script to merge with config generated by tegra21_default target:
./scripts/kconfig/merge_config.sh -n -r -O $AUV_KERNEL_OUT $AUV_KERNEL_OUT/.config ./auvidea/config_override
modified dts, only added the section after AUVIDEA J120 overrides.
arch/arm64/boot/dts/tegra210-jetson-tx1-p2597-2180-a01-devkit.dts:
/*
* arch/arm64/boot/dts/tegra210-jetson-tx1-p2597-2180-a01-devkit.dts
*
* Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
#include "tegra210-jetson-cv-base-p2597-2180-a00.dts"
/ {
model = "jetson_tx1";
compatible = "nvidia,jetson-cv", "nvidia,tegra210";
nvidia,dtsfilename = __FILE__;
#address-cells = <2>;
#size-cells = <2>;
chosen {
bootloader {
nvidia,skip-display-init;
};
};
host1x {
dc@54200000 {
status = "disabled";
};
dc@54240000 {
nvidia,dc-or-node = "/host1x/sor1";
};
dsi {
status = "disabled";
panel-a-wuxga-8-0 {
status = "disabled";
};
panel-s-wqxga-10-1 {
status = "disabled";
};
};
};
i2c@7000c400 {
lp8557-backlight-a-wuxga-8-0@2c {
status = "disabled";
};
};
backlight {
status = "disabled";
};
/****************************
* AUVIDEA J120 overrides
****************************/
camera-pcl {
/delete-property/compatible;
/delete-property/configuration;
/delete-node/modules;
/delete-node/profiles;
};
gpio@6000d000 {
camera-control {
/* reset and powerdown gpios for ov5693_c */
gpio-output-low = <0x94 0x97>;
};
default {
gpio-to-sfio = <0x10 0x11 0x12 0x13 0x14>;
};
};
/*
* Omnivision camera
*/
ov5693_c@36 {
avdd-reg = "vana";
compatible = "nvidia,ov5693";
iovdd-reg = "vif";
mclk = "cam_mclk1";
physical_h = "2.738";
physical_w = "3.674";
pwdn-gpios = <&gpio 0x97 0x0>;
reset-gpios = <&gpio 0x94 0x0>;
vana-supply = <&en_vdd_cam_hv_2v8>;
vif-supply = <&en_vdd_cam>;
mode0 {
active_h = "1944";
active_w = "2592";
cil_settletime = [30 00];
discontinuous_clk = "no";
dpcm_enable = "false";
inherent_gain = [31 00];
line_length = "2688";
max_exp_time = "550385";
max_framerate = "30";
max_gain_val = "16";
max_hdr_ratio = "64";
mclk_khz = "24000";
mclk_multiplier = "6.67";
min_exp_time = "34";
min_framerate = "1.816577";
min_gain_val = "1.0";
min_hdr_ratio = [31 00];
num_lanes = [32 00];
pix_clk_hz = "160000000";
pixel_t = "bayer_bggr";
readout_orientation = "90";
tegra_sinterface = "serial_c";
};
mode1 {
active_h = "1458";
active_w = "2592";
cil_settletime = [30 00];
discontinuous_clk = "no";
dpcm_enable = "false";
inherent_gain = [31 00];
line_length = "2688";
max_exp_time = "550385";
max_framerate = "30";
max_gain_val = "16";
max_hdr_ratio = "64";
mclk_khz = "24000";
mclk_multiplier = "6.67";
min_exp_time = "34";
min_framerate = "1.816577";
min_gain_val = "1.0";
min_hdr_ratio = [31 00];
num_lanes = [32 00];
pix_clk_hz = "160000000";
pixel_t = "bayer_bggr";
readout_orientation = "90";
tegra_sinterface = "serial_c";
};
mode2 {
active_h = "720";
active_w = "1280";
cil_settletime = [30 00];
discontinuous_clk = "no";
dpcm_enable = "false";
inherent_gain = [31 00];
line_length = "1752";
max_exp_time = "358733";
max_framerate = "120";
max_gain_val = "16";
max_hdr_ratio = "64";
mclk_khz = "24000";
mclk_multiplier = "6.67";
min_exp_time = "22";
min_framerate = "2.787078";
min_gain_val = "1.0";
min_hdr_ratio = [31 00];
num_lanes = [32 00];
pix_clk_hz = "160000000";
pixel_t = "bayer_bggr";
readout_orientation = "90";
tegra_sinterface = "serial_c";
};
mode3 {
active_h = "1944";
active_w = "2592";
cil_settletime = [30 00];
discontinuous_clk = "no";
dpcm_enable = "false";
inherent_gain = [31 00];
line_length = "3696";
max_exp_time = "687981";
max_framerate = "24";
max_gain_val = "16";
max_hdr_ratio = "64";
mclk_khz = "24000";
mclk_multiplier = "7.33";
min_exp_time = "42";
min_framerate = "1.453262";
min_gain_val = "1.0";
min_hdr_ratio = [31 00];
num_lanes = [32 00];
pix_clk_hz = "176000000";
pixel_t = "hdr_bggr";
readout_orientation = "90";
tegra_sinterface = "serial_c";
};
};
tegra-camera-platform {
modules {
module0 {
badge = "e3326_front_P5V27C";
orientation = [31 00];
position = "rear";
drivernode0 {
pcl_id = "v4l2_soc_sensor";
proc-device-tree = "/proc/device-tree/ov5693_c@36";
};
drivernode1 {
pcl_id = "v4l2_focuser_stub";
};
};
};
};
sound {
/delete-property/compatible;
/delete-property/nvidia,audio-routing;
/delete-property/nvidia,dummy-codec-dai;
/delete-property/nvidia,dummy-codec-dai-name;
/delete-property/nvidia,hp-det-gpios;
/delete-property/nvidia,model;
/delete-property/nvidia,num-codec-link;
/delete-property/nvidia,xbar;
/delete-node/nvidia,dai-link-1;
/delete-node/nvidia,dai-link-2;
/delete-node/nvidia,dai-link-3;
/delete-node/nvidia,dai-link-4;
};
/*****************
* SPIs
*****************/
clocks {
/** clocks for can0 can1 */
mcp2515_clk: mcp2515 {
#clock-cells = <0x0>;
clock-frequency = <16000000>;
compatible = "fixed-clock";
};
};
spi0: spi@7000d400 {
spi-max-frequency = <25000000>;
status = "okay";
can0@0 {
clocks = <&mcp2515_clk>;
compatible = "microchip,mcp2515";
gpio-controller;
interrupt-parent = <&gpio>;
interrupts = <0x41 0x0>;
mcp251x,enable-clkout = <0x1>;
mcp251x,oscillator-frequency = <16000000>;
mcp251x,stay-awake = <0x1>;
reg = <0x1>;
spi-max-frequency = <10000000>;
status = "okay";
};
can1@0 {
clocks = <&mcp2515_clk>;
compatible = "microchip,mcp2515";
gpio-controller;
interrupt-parent = <&gpio>;
interrupts = <0x26 0x0>;
mcp251x,enable-clkout = <0x1>;
mcp251x,oscillator-frequency = <16000000>;
mcp251x,stay-awake = <0x1>;
reg = <0x1>;
spi-max-frequency = <10000000>;
status = "okay";
};
};
spi1: spi@7000d600 {
spi-max-frequency = <25000000>;
status = "okay";
spi1_0 {
#address-cells = <0x1>;
#size-cells = <0x0>;
compatible = "linux,spidev", "spidev";
nvidia,chipselect-gpio = <&gpio 0x10 0x0>;
nvidia,cs-hold-clk-count = <0x1e>;
nvidia,cs-setup-clk-count = <0x1e>;
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x1f>;
nvidia,tx-clk-tap-delay = <0x0>;
reg = <0x0>;
spi-max-frequency = <25000000>;
};
spi1_1 {
#address-cells = <0x1>;
#size-cells = <0x0>;
compatible = "linux,spidev", "spidev";
nvidia,chipselect-gpio = <&gpio 0x11 0x0>;
nvidia,cs-hold-clk-count = <0x1e>;
nvidia,cs-setup-clk-count = <0x1e>;
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x1f>;
nvidia,tx-clk-tap-delay = <0x0>;
reg = <0x1>;
spi-max-frequency = <25000000>;
};
};
spi2: spi@7000d800 {
status = "okay";
};
spi3: spi@7000da00 {
spi-max-frequency = <25000000>;
status = "okay";
spi3_0 {
#address-cells = <0x1>;
#size-cells = <0x0>;
compatible = "linux,spidev", "spidev";
nvidia,cs-hold-clk-count = <0x1e>;
nvidia,cs-setup-clk-count = <0x1e>;
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x1f>;
nvidia,tx-clk-tap-delay = <0x0>;
reg = <0x0>;
spi-max-frequency = <25000000>;
};
};
};
and custom initrd init script:
#!/bin/bash
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of NVIDIA CORPORATION nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
DATE="`date +\"%T\"`"
build_date=`date`;
initrd_dir=/mnt/initrd;
dhclient_flag="true";
count=0;
echo "[ $DATE ] L4T initrd starts from here.....";
#Mount procfs, devfs and sysfs
mount -t proc proc /proc
if [ $? -ne 0 ]; then
echo "ERROR: mounting proc fail...";
exec /bin/bash;
fi;
mount -t devtmpfs none /dev
if [ $? -ne 0 ]; then
echo "ERROR: mounting dev fail...";
exec /bin/bash;
fi;
mount -t sysfs sysfs /sys
if [ $? -ne 0 ]; then
echo "ERROR: mounting sys fail...";
exec /bin/bash;
fi;
echo "[ $DATE ] L4T-INITRD Build DATE: $build_date";
rootdev=`cat /proc/cmdline | sed -e 's/.*root=\/dev\/\([abcdefklmnps<b>v</b>012]*\).*/\1/'`;
echo "[ $DATE ] L4T-INITRD Root device found in /proc/cmdline: $rootdev";
if [[ "${rootdev}" == mmcblk0p* || "${rootdev}" == mmcblk1p*<b> || "${rootdev}" == nvme* </b>]]; then
if [ ! -e "/dev/${rootdev}" ]; then
count=0;
while [ ${count} -lt 50 ]
do
sleep 0.2;
count=`expr $count + 1`;
if [ -e "/dev/${rootdev}" ]; then
break;
fi
done
fi
if [ -e "/dev/${rootdev}" ]; then
echo "[ $DATE ] L4T-INITRD Rootdevice found: /dev/${rootdev}";
else
echo "[ $DATE ] L4T-INITRD ERROR: ${rootdev} not found";
exec /bin/bash;
fi
mount /dev/${rootdev} /mnt/;
if [ $? -ne 0 ]; then
echo "[ $DATE ] L4T-INITRD ERROR: ${rootdev} mount fail...";
exec /bin/bash;
fi;
elif [[ "${rootdev}" == sd* ]]; then
if [ ! -e "/dev/${rootdev}" ]; then
while [ ${count} -lt 50 ]
do
sleep 0.2;
count=`expr $count + 1`;
if [ -e "/dev/${rootdev}" ]; then
break;
fi
done
fi
if [ -e "/dev/${rootdev}" ]; then
echo "Rootdevice found: /dev/${rootdev}";
else
echo "ERROR: ${rootdev} not found";
exec /bin/bash;
fi
mount /dev/${rootdev} /mnt/;
if [ $? -ne 0 ]; then
echo "ERROR: ${rootdev} mount fail...";
exec /bin/bash;
fi;
elif [[ "${rootdev}" == "nfs" ]]; then
eth_interface=`ifconfig -a | grep eth | awk '{print $1}'`;
echo "[ $DATE ] Ethernet interfaces: $eth_interface";
for eth in ${eth_interface}
do
ipaddr=`ifconfig "$eth" | grep -A1 "$eth" | grep "inet addr" | sed 's/.*addr:\([0-9\.]*\) .*/\1/'`;
echo "[ $DATE ] eth_interface is pointing to $eth and ipaddr: $ipaddr"
if [[ "$ipaddr" =~ [0-9]*.[0-9]*.[0-9]*.[0-9]* ]]; then
echo "[ $DATE ]: static ipaddr found: $ipaddr";
dhclient_flag="false";
break;
fi
while [ ${count} -lt 50 ]
do
sleep 0.2;
ipaddr=`ifconfig "$eth" | grep -A1 "$eth" | grep "inet addr" | sed 's/.*addr:\([0-9\.]*\) .*/\1/'`;
echo "[ $DATE ] eth_interface is pointing to $eth and ipaddr: $ipaddr"
if [[ "$ipaddr" =~ [0-9]*.[0-9]*.[0-9]*.[0-9]* ]]; then
echo "[ $DATE ]: static ipaddr found: $ipaddr";
dhclient_flag="false";
break;
fi
count=`expr $count + 1`;
done
if [ "$dhclient_flag" == "false" ]; then
break;
fi
done
if [ "$dhclient_flag" == "true" ]; then
for eth in ${eth_interface}
do
echo "[ $DATE ] eth_interface is pointing to $eth";
timeout 8s /sbin/dhclient $eth;
if [ $? -eq 0 ]; then
break;
fi;
done
if [ $? -ne 0 ]; then
echo "[ $DATE ] ERROR: dhclient fail...";
exec /bin/bash;
fi;
fi;
nfsroot_path=`cat /proc/cmdline | sed -e 's/.*nfsroot=\([^ ]*\) .*/\1 /'`;
# JCK: mount -t nfs -o nolock $nfsroot_path /mnt/;
mount -t nfs -v -o nolock $nfsroot_path /mnt/;
if [ $? -ne 0 ]; then
echo "ERROR: NFS mount fail...";
exec /bin/bash;
fi;
else
echo "[ $DATE ] No root-device: Mount failed"
exec /bin/bash;
fi
echo "[ $DATE ] L4T-INITRD Rootfs mounted over ${rootdev}";
mount -o bind /proc /mnt/proc;
mount -o bind /sys /mnt/sys;
mount -o bind /dev/ /mnt/dev;
cd /mnt;
cp /etc/resolv.conf etc/resolv.conf
echo "[ $DATE ] L4T-INITRD Switching from initrd to actual rootfs";
exec chroot . /sbin/init 2;
The above is full change set I was able to figureout, but the problem with Buffer IO errors show up with just “CONFIG_BLK_DEV_NVME=y” added to config.
I am looking for ideas how to narrow/isolate the errors, stress tests on SSD?
Check for hardware issues?
I think it only appears after reboot, it it works then all is ok until next reboot.
Maciej