Re: [cip-dev] [RFC PATCH 4.19.y-cip 41/50] PCI: rcar: Add endpoint mode support

Pavel Machek
2020-10-15T18:01:24Z

[-- Attachment #1.1: Type: text/plain, Size: 1133 bytes --]

Hi!

> > Plain 0 would be enough
> >
> Agreed.
>
> Ill post patches upstream to fix this and then backport or do you
>want me to do the changes in place ?

Yes, thank you.

> > > +val |= ASTINTX;
> > > +rcar_pci_write_reg(pcie, val, PCIEINTXR);
> > > +usleep_range(1000, 1001);
> > > +val = rcar_pci_read_reg(pcie, PCIEINTXR);
> >
> > This is crazy. Either you need exact timing or you don't, but I don't
> > believe usleep can guarantee microsecond accuracy.
> >
> > (And you probably don't need it, right?)
> >
> Indeed a sleep is needed but checkpatch complains about it so usleep_range() was added.

checkpatch should not be an excuse for crazy code... and this one is
crazy.

Sleep has nowhere near microsecond accuracy. If you can tolerate
bigger delay, feel free to specify reasonable range. But in this case
you probably want "as close as possible to 1msec", and no,
usleep_range is not right primitive for that.

Best regards,
Pavel

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 420 bytes --]

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5583): https://lists.cip-project.org/g/cip-dev/message/5583
Mute This Topic: https://lists.cip-project.org/mt/77461723/4520388