I2C to UART IS16SC750 "BUG: Scheduling while atomic"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C to UART IS16SC750 "BUG: Scheduling while atomic"

Jump to solution
1,992 Views
ystern
Contributor I

Hello,

I'm using NXP-SC16IS750 as i2c to uart bridge in Linux embedded board with i.MX6 cpu.

The uart side of the NXP bridge (/ttySC0) is connected to a GPS, and the other side connects to the cpu (i2c-1 port).

The GPS works fine, but when the program terminates, I keep gating the following error messages from the kernel: BUG: scheduling while atomic: <bin file name>/839/0x00000002     (The full error log is shown below).

The cause of these error messages is this line code:  fd_serial = open("/dev/ttySC0", O_RDWR);

I think the problem might be related to the definition of this bridge in the dts file, which was added as follows:

&i2c1 {

pinctrl-names = "default";

pinctrl-0 = <&i2c1_pins>;

status = "okay";

clock-frequency = <400000>;

sc16is750: sc16is750@48 { 

        compatible = "nxp,sc16is750";

        reg = <0x48>;

        clocks = <&sc16is750_clk>;     

        interrupt-parent = <&gpio3>;               /* The phandle for the interrupt controller that services interrupts for this IC */

        interrupts = <17 IRQ_TYPE_EDGE_FALLING>; 

        gpio-controller;             

        #gpio-cells = <2>;     

    };

};

The clock was added to the clocks dtsi file as follows:

sc16is750_clk: sc16is750_clk {

           compatible = "fixed-clock";

           #clock-cells = <0>;

           clock-frequency = <7372800>;

        };

Full error log:

[  359.504499] BUG: scheduling while atomic: GPS_receiver/839/0x00000002

[  359.510988] Modules linked in: ipv6 bc_example(O) usb_f_acm u_serial usb_f_ecm g_multi usb_f_mass_storage usb_f_rndis u_ether libcomposite cryptodev(O) rpmsg_pru virtio_rpmsg_bus musb_dsps musb_hdrc udc

[  359.546086] CPU: 0 PID: 839 Comm: GPS_receiver Tainted: G           O    4.1.18-gbbe8cfc #1

[  359.554486] Hardware name: CAU3 (Flattened Device Tree)

[  359.560614] Backtrace:

[  359.563149] [<c0012910>] (dump_backtrace) from [<c0012b24>] (show_stack+0x18/0x1c)

[  359.570763]  r6:c0635a40 r5:c08adb00 r4:00000000 r3:00000000

[  359.576542] [<c0012b0c>] (show_stack) from [<c0634080>] (dump_stack+0x20/0x28)

[  359.583827] [<c0634060>] (dump_stack) from [<c0631554>] (__schedule_bug+0x4c/0x64)

[  359.591463] [<c0631508>] (__schedule_bug) from [<c0635960>] (__schedule+0x40c/0x4a8)

[  359.599249]  r4:cc116d00 r3:00000002

[  359.602890] [<c0635554>] (__schedule) from [<c0635a40>] (schedule+0x44/0x9c)

[  359.609978]  r9:cf3a0404 r8:00000002 r7:cc116d00 r6:ffffffff r5:cf3a0400 r4:cf05e000

[  359.617844] [<c06359fc>] (schedule) from [<c0635d04>] (schedule_preempt_disabled+0x28/0x44)

[  359.626240]  r4:cf05e000 r3:cf05e000

[  359.629881] [<c0635cdc>] (schedule_preempt_disabled) from [<c0637568>] (__mutex_lock_slowpath+0xac/0x194)

[  359.639515] [<c06374bc>] (__mutex_lock_slowpath) from [<c0637680>] (mutex_lock+0x30/0x34)

[  359.647736]  r9:00000000 r8:00000008 r7:00000004 r6:00000001 r5:00000000 r4:cf3a0400

[  359.655606] [<c0637650>] (mutex_lock) from [<c04080c0>] (regmap_lock_mutex+0x10/0x14)

[  359.663501] [<c04080b0>] (regmap_lock_mutex) from [<c040a5a8>] (regmap_update_bits+0x2c/0x64)

[  359.672098] [<c040a57c>] (regmap_update_bits) from [<c03a5f0c>] (sc16is7xx_stop_rx+0x38/0x3c)

[  359.680669]  r7:a0070013 r6:cf3a990c r5:cf6c2000 r4:cf396180

[  359.686430] [<c03a5ed4>] (sc16is7xx_stop_rx) from [<c039947c>] (uart_close+0x2c8/0x320)

[  359.694504] [<c03991b4>] (uart_close) from [<c037c34c>] (tty_release+0x108/0x514)

[  359.702028]  r7:cf6366c0 r6:00000000 r5:cc826000 r4:cf6c2000

[  359.707798] [<c037c244>] (tty_release) from [<c0102bf0>] (__fput+0x88/0x200)

[  359.714886]  r10:cf6366c8 r9:00000000 r8:00000008 r7:cf253020 r6:cf3d73d0 r5:cc826000

[  359.722820]  r4:cf6366c0

[  359.725399] [<c0102b68>] (__fput) from [<c0102dc4>] (____fput+0x10/0x14)

[  359.732138]  r10:cc116d00 r9:00000020 r8:cf44bc74 r7:00000000 r6:c08e330c r5:cc116d00

[  359.740072]  r4:cc1170a8

[  359.742664] [<c0102db4>] (____fput) from [<c004dc1c>] (task_work_run+0x94/0xc4)

[  359.750036] [<c004db88>] (task_work_run) from [<c0037a40>] (do_exit+0x2c8/0x9f8)

[  359.757474]  r7:cf44bc40 r6:00418004 r5:cf4324c0 r4:00000000

[  359.763225] [<c0037778>] (do_exit) from [<c00381f0>] (do_group_exit+0x44/0xf8)

[  359.770488]  r7:cf05fec8

[  359.773077] [<c00381ac>] (do_group_exit) from [<c0041d18>] (get_signal+0x19c/0x74c)

[  359.780776]  r4:cf05fedc r3:cf05e000

[  359.784418] [<c0041b7c>] (get_signal) from [<c00120dc>] (do_signal+0x6c/0x39c)

[  359.791681]  r10:00000000 r9:cf05e000 r8:fffffe00 r7:cf05fec8 r6:b6f010b6 r5:b6f010b4

[  359.799615]  r4:cf05ffb0

[  359.802198] [<c0012070>] (do_signal) from [<c00125cc>] (do_work_pending+0xa0/0xb0)

[  359.809808]  r10:00000000 r9:cf05e000 r8:c000f864 r7:00000003 r6:cf05ffb0 r5:c000f864

[  359.817741]  r4:cf05e000

[  359.820321] [<c001252c>] (do_work_pending) from [<c000f70c>] (work_pending+0xc/0x20)

[  359.828106]  r6:00000000 r5:00000000 r4:bec44bd8 r3:00002244

[  359.834479] sc16is7xx 1-0048: Port 0: Possible RX FIFO overrun: 64

[  359.846567] BUG: scheduling while atomic: GPS_receiver/839/0x00000002

[  359.853119] Modules linked in: ipv6 bc_example(O) usb_f_acm u_serial usb_f_ecm g_multi usb_f_mass_storage usb_f_rndis u_ether libcomposite cryptodev(O) rpmsg_pru virtio_rpmsg_bus musb_dsps musb_hdrc udc

[  359.888097] CPU: 0 PID: 839 Comm: GPS_receiver Tainted: G        W  O    4.1.18-gbbe8cfc #1

[  359.896485] Hardware name: CAU3 (Flattened Device Tree)

[  359.902621] Backtrace:

[  359.905111] [<c0012910>] (dump_backtrace) from [<c0012b24>] (show_stack+0x18/0x1c)

[  359.912733]  r6:c0635a40 r5:c08adb00 r4:00000000 r3:00000000

[  359.918477] [<c0012b0c>] (show_stack) from [<c0634080>] (dump_stack+0x20/0x28)

[  359.925738] [<c0634060>] (dump_stack) from [<c0631554>] (__schedule_bug+0x4c/0x64)

[  359.933379] [<c0631508>] (__schedule_bug) from [<c0635960>] (__schedule+0x40c/0x4a8)

[  359.941172]  r4:cc116d00 r3:00000002

[  359.944781] [<c0635554>] (__schedule) from [<c0635a40>] (schedule+0x44/0x9c)

[  359.951873]  r9:00000000 r8:c08af2d0 r7:c08f4c40 r6:c08f4c40 r5:000017c3 r4:cf05e000

[  359.959711] [<c06359fc>] (schedule) from [<c0638550>] (schedule_timeout+0x124/0x1d4)

[  359.967501]  r4:cf05faac r3:cf05e000

[  359.971108] [<c063842c>] (schedule_timeout) from [<c0636468>] (wait_for_common+0xec/0x1b8)

[  359.979421]  r9:cc116d00 r8:cf3a9420 r7:00000000 r6:00000000 r5:00000002 r4:cf05e000

[  359.987251] [<c063637c>] (wait_for_common) from [<c0636564>] (wait_for_completion_timeout+0x14/0x18)

[  359.996421]  r9:cf05fc04 r8:00008603 r7:00000001 r6:00000000 r5:c08af2d0 r4:cf3a9410

[  360.004255] [<c0636550>] (wait_for_completion_timeout) from [<c04a08e0>] (omap_i2c_xfer+0xd4/0x640)

[  360.013380] [<c04a080c>] (omap_i2c_xfer) from [<c049ad64>] (__i2c_transfer+0x134/0x280)

[  360.021435]  r10:00000001 r9:cf3a9450 r8:cf05fc04 r7:cf3a9478 r6:0000175f r5:c08af2d0

[  360.029348]  r4:00000000

[  360.031902] [<c049ac30>] (__i2c_transfer) from [<c049af94>] (i2c_transfer+0xe4/0x140)

[  360.039779]  r10:00000001 r9:c07b5618 r8:c07ffc3c r7:cf3a9478 r6:00000001 r5:cf05fc04

[  360.047689]  r4:0000000c r3:cf05e000

[  360.051298] [<c049aeb0>] (i2c_transfer) from [<c049b034>] (i2c_master_send+0x44/0x54)

[  360.059174]  r10:cf39cf42 r9:00000001 r8:cf39cf41 r7:00000000 r6:cf39cf41 r5:00000001

[  360.067083]  r4:00000002

[  360.069650] [<c049aff0>] (i2c_master_send) from [<c040e550>] (regmap_i2c_write+0x18/0x34)

[  360.077876]  r4:00000002

[  360.080432] [<c040e538>] (regmap_i2c_write) from [<c040a388>] (_regmap_raw_write+0x658/0x694)

[  360.089007]  r4:cf3a0400 r3:c040e538

[  360.092616] [<c0409d30>] (_regmap_raw_write) from [<c040a438>] (_regmap_bus_raw_write+0x74/0x94)

[  360.101452]  r10:cf6366c8 r9:00000000 r8:cf3a0400 r7:cf3a0400 r6:00000082 r5:00000004

[  360.109363]  r4:cf3a0400

[  360.111918] [<c040a3c4>] (_regmap_bus_raw_write) from [<c0409638>] (_regmap_write+0x60/0x9c)

[  360.120405]  r6:00000082 r5:00000004 r4:cf3a0400 r3:c040a3c4

[  360.126121] [<c04095d8>] (_regmap_write) from [<c04096cc>] (_regmap_update_bits+0x58/0x7c)

[  360.134434]  r7:00000004 r6:00000000 r5:00000000 r4:00000082

[  360.140167] [<c0409674>] (_regmap_update_bits) from [<c040a5c4>] (regmap_update_bits+0x48/0x64)

[  360.148917]  r8:00000008 r7:00000004 r6:00000001 r5:00000000 r4:cf3a0400

[  360.155688] [<c040a57c>] (regmap_update_bits) from [<c03a5f0c>] (sc16is7xx_stop_rx+0x38/0x3c)

[  360.164265]  r7:a0070013 r6:cf3a990c r5:cf6c2000 r4:cf396180

[  360.170001] [<c03a5ed4>] (sc16is7xx_stop_rx) from [<c039947c>] (uart_close+0x2c8/0x320)

[  360.178067] [<c03991b4>] (uart_close) from [<c037c34c>] (tty_release+0x108/0x514)

[  360.185581]  r7:cf6366c0 r6:00000000 r5:cc826000 r4:cf6c2000

[  360.191321] [<c037c244>] (tty_release) from [<c0102bf0>] (__fput+0x88/0x200)

[  360.198413]  r10:cf6366c8 r9:00000000 r8:00000008 r7:cf253020 r6:cf3d73d0 r5:cc826000

[  360.206308]  r4:cf6366c0

[  360.208880] [<c0102b68>] (__fput) from [<c0102dc4>] (____fput+0x10/0x14)

[  360.215609]  r10:cc116d00 r9:00000020 r8:cf44bc74 r7:00000000 r6:c08e330c r5:cc116d00

[  360.223520]  r4:cc1170a8

[  360.226083] [<c0102db4>] (____fput) from [<c004dc1c>] (task_work_run+0x94/0xc4)

[  360.233447] [<c004db88>] (task_work_run) from [<c0037a40>] (do_exit+0x2c8/0x9f8)

[  360.240891]  r7:cf44bc40 r6:00418004 r5:cf4324c0 r4:00000000

[  360.246606] [<c0037778>] (do_exit) from [<c00381f0>] (do_group_exit+0x44/0xf8)

[  360.253872]  r7:cf05fec8

[  360.256434] [<c00381ac>] (do_group_exit) from [<c0041d18>] (get_signal+0x19c/0x74c)

[  360.264137]  r4:cf05fedc r3:cf05e000

[  360.267764] [<c0041b7c>] (get_signal) from [<c00120dc>] (do_signal+0x6c/0x39c)

[  360.275015]  r10:00000000 r9:cf05e000 r8:fffffe00 r7:cf05fec8 r6:b6f010b6 r5:b6f010b4

[  360.282927]  r4:cf05ffb0

[  360.285495] [<c0012070>] (do_signal) from [<c00125cc>] (do_work_pending+0xa0/0xb0)

[  360.293113]  r10:00000000 r9:cf05e000 r8:c000f864 r7:00000003 r6:cf05ffb0 r5:c000f864

[  360.301025]  r4:cf05e000

[  360.303580] [<c001252c>] (do_work_pending) from [<c000f70c>] (work_pending+0xc/0x20)

[  360.311369]  r6:00000000 r5:00000000 r4:bec44bd8 r3:00002244

0 Kudos
1 Solution
1,097 Views
igorpadykov
NXP Employee
NXP Employee

Hi Yehuda

similar issue, seems due to synchronization was reported on

Re: sc16is7xx: sometimes invalid chars read — Linux Serial

"BUG: scheduling while atomic" is kernel error so one can post issue on

Majordomo Lists at VGER.KERNEL.ORG

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
1,098 Views
igorpadykov
NXP Employee
NXP Employee

Hi Yehuda

similar issue, seems due to synchronization was reported on

Re: sc16is7xx: sometimes invalid chars read — Linux Serial

"BUG: scheduling while atomic" is kernel error so one can post issue on

Majordomo Lists at VGER.KERNEL.ORG

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,097 Views
ystern
Contributor I

FYI, I'm using Linux kernel V4.1.18, and I read in some forums that there were some issues around the way the original driver implemented synchronization, which were apparently solved in the new driver included in Linux kernel V4.2.

However, after I downloading the new driver from this link:  linux/sc16is7xx.c at v4.2-rc3 · torvalds/linux · GitHub ,

replacing the former driver and recompiling the kernel, the new image doesn't include the relevant uart port (/ttySC0).

0 Kudos