read/write reg

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

read/write reg

1,336件の閲覧回数
rainho
Contributor II

I wrote the device driver code for the SPI slave device mounted under the spi device tree node, and it works normally. But now I have a requirement for fast communication. I do not use APIs such as kernel spi_sync during transmission, and choose to directly operate the SPI register. I found that it will cause the kernel to hang directly. When matching the device driver, I used ioremap again to obtain the starting virtual address of the hardware SPI, and then directly operated the offset (register) of the starting address in the device driver file, but the kernel hung. What is this? The reason? Is it because Ioremap uses the same SPI memory twice? Or is there a conflict with spi_imx.c when using functions such as readl?
Please answer it. Thank you!

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

1,313件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Recommend you use regmap framework to operate regs

0 件の賞賛
返信

1,310件の閲覧回数
rainho
Contributor II

thanks for the reply!
I probably know about the regmap operation, but I'm not sure whether it is a safe operation, or whether it can be used directly in interrupts?

0 件の賞賛
返信

1,293件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Avoid using ioremap,  regmap is more safety.

0 件の賞賛
返信