Re:Re: dw-spi driver bus number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Wed, Aug 10, 2016 at 08:50:08AM +0000, First Light wrote:
>
> Please don't top post, reply in line with needed context.  This allows readers
> to readily follow the flow of conversation and understand what you are talking
> about and also helps ensure that everything in the discussion is being
> addressed.

[First Light] Sorry, Mark, My email client is not quite open source style. I'm trying to use this way.
>
> > But I found the dynamically assigned bus number is always -1.?
>
> > I have two spi buses, both get the -1 bus number.
>
> That shouldn't happen, if it does it's a bug - users should never see a negative
> bus number, the core should dynamically assign one if it is given a negative bus
> number.  Can you check what happens in spi_register_master()?  That's
> where the dynamic bus number should be being assigned.
[First Light] I'm using linux-4.4 kernel, and In spi-dw-mmio.c,
I see that:
 LINE74: dws->bus_num = pdev-->id; (dws is struct dw_spi, not struct spi_master)
 LINE107: ret=dw_spi_add_host(&pdev->dev, dws);
spi_register_master is called in dw_spi_add_host.
So dws->bus_num is not dynamically assigned, but just one static value since pdev->id is not inited.
I think you are saying spi_master->bus_num is dynamically inited. Right?

I also see that spi_master->bus_num is inited with dws->bus_number first, and the it finds that this bus_num < 0,
then uses of_alias_get_id or atomic_dec_return(&dyn_bus_id) to get a dynamic one.

Question is: do we need to update dws->bus_num again? It is -1 always.
>From /proc/interrupts, I check irq of spi, and the last column is the device name,
unlike other devices, like i2c0, i2c1,..., spi's device name is dw_spi65535,
both of the spi devices I registered have this name. 65535 is -1.
There must be something unmatched.

Thanks
Xiaoguang






This email and any attachments thereto may contain private, confidential, and privileged material for the sole use of the intended recipient. Any review, copying, or distribution of this email (or any attachments thereto) by others is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.

此电子邮件及附件所包含内容具有机密性,且仅限于接收人使用。未经允 许,禁止第三人阅读、复制或传播该电子邮件中的任何信息。如果您不属于以上电子邮件的目标接收者,请您立即通知发送人并删除原电子邮件及其相关的附件。
��.n��������+%������w��{.n�����{����)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux