i.MX28 Application UART driver mxs-auart module cannot be removed

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MX28 Application UART driver mxs-auart module cannot be removed

跳至解决方案
2,847 次查看
CraigMcQueen
Contributor III

I am adding some hardware handshaking via GPIO lines to the mxs-auart driver. So I am compiling it as a module. I can insert the module fine:

# modprobe mxs_auart

mxs-auart.0: ttySP0 at MMIO 0x8006a000 (irq = 112) is a mxs-auart.0

Found APPUART 3.1.0

mxs-auart.1: ttySP1 at MMIO 0x8006c000 (irq = 113) is a mxs-auart.1

Found APPUART 3.1.0

mxs-auart.2: ttySP2 at MMIO 0x8006e000 (irq = 114) is a mxs-auart.2

Found APPUART 3.1.0

But if I try to remove the module, it gives an error, and also locks up the debug serial port.

# modprobe -r mxs_auart

Trying to free nonexistent resource <000000008006e000-000000008006efff>

Trying to free nonexistent resource <000000008006c000-000000008006cfff>

Any pointers on this? I'm guessing those messages are something to do with the following code:

static void mxs_auart_release_port(struct uart_port *u)

{

    release_mem_region(u->mapbase, SZ_4K);

}

But I don't know if that's the root cause of the lock-up. I'm fairly new to Linux kernel device driver programming, and I haven't tried debugging this.

标签 (2)
标记 (2)
0 项奖励
回复
1 解答
1,927 次查看
fabio_estevam
NXP Employee
NXP Employee

Ok, I have just tried it on 3.16.1 and the removal of mxs_auart works as expected:

root@freescale /$ modprobe mxs_auart

[  224.383850] 8006a000.serial: ttyAPP0 at MMIO 0x8006a000 (irq = 234, base_baud = 1500000) is a 8006a000.serial

[  224.422657] mxs-auart 8006a000.serial: Found APPUART 3.1.0

[  224.449611] 80070000.serial: ttyAPP3 at MMIO 0x80070000 (irq = 235, base_baud = 1500000) is a 80070000.serial

[  224.471767] mxs-auart 80070000.serial: Found APPUART 3.1.0

root@freescale /$ rmmod mxs_auart

root@freescale /$

在原帖中查看解决方案

0 项奖励
回复
10 回复数
1,927 次查看
YixingKong
Senior Contributor IV

Craig, please click Correct Answer if your question hasbeen answered.

Thanks,

Yixing

0 项奖励
回复
1,927 次查看
CraigMcQueen
Contributor III

That answer provides some useful information, but I would like to see a decent resolution (i.e. a fix).

0 项奖励
回复
1,927 次查看
YixingKong
Senior Contributor IV

Craig

We have not got your response yet and will close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.

Thanks,

Yixing

0 项奖励
回复
1,927 次查看
YixingKong
Senior Contributor IV

Craig, please keep exchange your questions with Grace if your need further answers.

Regards,

Yixing

0 项奖励
回复
1,927 次查看
CraigMcQueen
Contributor III

I don't want to "keep up an exchange", or mark some non-solution from Freescale as an "answer".

Here is what I hope to see: Freescale assigns an engineer to improve the driver so it can be removed. Then includes the improved driver in a new kernel release.

0 项奖励
回复
1,927 次查看
fabio_estevam
NXP Employee
NXP Employee

Craig,

Please try it with kernel 3.16.1.

0 项奖励
回复
1,928 次查看
fabio_estevam
NXP Employee
NXP Employee

Ok, I have just tried it on 3.16.1 and the removal of mxs_auart works as expected:

root@freescale /$ modprobe mxs_auart

[  224.383850] 8006a000.serial: ttyAPP0 at MMIO 0x8006a000 (irq = 234, base_baud = 1500000) is a 8006a000.serial

[  224.422657] mxs-auart 8006a000.serial: Found APPUART 3.1.0

[  224.449611] 80070000.serial: ttyAPP3 at MMIO 0x80070000 (irq = 235, base_baud = 1500000) is a 80070000.serial

[  224.471767] mxs-auart 80070000.serial: Found APPUART 3.1.0

root@freescale /$ rmmod mxs_auart

root@freescale /$

0 项奖励
回复
1,927 次查看
CraigMcQueen
Contributor III

I have tested with kernel 3.14 and also found that mxs-auart can be removed. It seems that moving away from 2.6.35 and towards a more recent kernel is the way to go.

0 项奖励
回复
1,927 次查看
fabio_estevam
NXP Employee
NXP Employee

Yes, I agree.

0 项奖励
回复
1,927 次查看
GraceH
Senior Contributor II

I tried to build mxs_auart as loadable module and saw the error message

"Trying to free nonexistent resource <000000008006e000-000000008006efff>" when unload module, and then the system hangs.   But the hang-up is not caused by this error message. The mxs_auart_request_port is not called in probe function, but mxs_auart_release_port is called in remove function. I think mxs_auart is not tested as loadable module. There may be  still other errors which causes the hang-up.