From: Trevor Gross <tmgross@umich.edu>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: netdev@vger.kernel.org, rust-for-linux@vger.kernel.org,
andrew@lunn.ch, miguel.ojeda.sandonis@gmail.com,
benno.lossin@proton.me, aliceryhl@google.com
Subject: Re: [PATCH net-next v6 6/6] net: phy: add Applied Micro QT2025 PHY driver
Date: Fri, 23 Aug 2024 14:13:25 -0500 [thread overview]
Message-ID: <CALNs47u6+EFYkvpyHZD5zLcjQeb2CuZNTOjPuZ4MKewoKZYPMg@mail.gmail.com> (raw)
In-Reply-To: <20240823.133656.1425422314833390920.fujita.tomonori@gmail.com>
On Fri, Aug 23, 2024 at 8:37 AM FUJITA Tomonori
<fujita.tomonori@gmail.com> wrote:
> > At this point the vendor driver looks like it does some verification:
> > it attempts to read 3.d7fd until it returns something other than 0x10
> > or 0, or times out. Could that be done here?
>
> Yeah, we better to wait here until the hw becomes ready (since the
> 8051 has just started) and check if it works correctly. A new Rust
> abstraction for msleep() is necessary.
>
> Even without the logic, the driver starts to work eventually (if the
> hw isn't broken) so I didn't include it in the patchset. I'll work on
> the abstraction and update the driver after this is merged.
It sounds okay to me to not block on this as long as it isn't glitchy
- It should probably be a FIXME?
> > Consistency nit: this file uses a mix of upper and lowercase hex
> > (mostly uppercase here) - we should probably be consistent. A quick
> > regex search looks like lowercase hex is about twice as common in the
> > kernel as uppercase so I think this may as well be updated.
>
> Ah, I'll use lowercase for all the hex in the driver.
>
> It will be a new coding rule for rust code in kernel? If so, can a
> checker tool warn this?
I don't know of any rule for this, I just noticed that the patch had
both and it made me take a look at what is used elsewhere. rustfmt has
an option to just commonize it for you, `hex_literal_case` [1], but it
is unstable. That would probably be nice at some point.
> > Overall this looks pretty good to me, checking against both the
> > datasheet and the vendor driver we have. Mostly small suggestions
> > here, I'm happy to add a RB with my verification question addressed
> > and some rewording of the 0xd001 (phy revision) comment.
>
> Thanks a lot! I'll send v7 soon.
Thanks!
- Trevor
[1]: https://rust-lang.github.io/rustfmt/?version=v1.6.0&search=#hex_literal_case
prev parent reply other threads:[~2024-08-23 19:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 22:57 [PATCH net-next v6 0/6] net: phy: add Applied Micro QT2025 PHY driver FUJITA Tomonori
2024-08-20 22:57 ` [PATCH net-next v6 1/6] rust: sizes: add commonly used constants FUJITA Tomonori
2024-08-20 23:41 ` Greg KH
2024-08-20 23:54 ` Danilo Krummrich
2024-08-21 0:22 ` Greg KH
2024-08-21 0:14 ` FUJITA Tomonori
2024-08-20 22:57 ` [PATCH net-next v6 2/6] rust: net::phy support probe callback FUJITA Tomonori
2024-08-20 22:57 ` [PATCH net-next v6 3/6] rust: net::phy implement AsRef<kernel::device::Device> trait FUJITA Tomonori
2024-08-20 22:57 ` [PATCH net-next v6 4/6] rust: net::phy unified read/write API for C22 and C45 registers FUJITA Tomonori
2024-08-20 22:57 ` [PATCH net-next v6 5/6] rust: net::phy unified genphy_read_status function " FUJITA Tomonori
2024-08-20 22:57 ` [PATCH net-next v6 6/6] net: phy: add Applied Micro QT2025 PHY driver FUJITA Tomonori
2024-08-23 5:25 ` Trevor Gross
2024-08-23 13:36 ` FUJITA Tomonori
2024-08-23 19:13 ` Trevor Gross [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALNs47u6+EFYkvpyHZD5zLcjQeb2CuZNTOjPuZ4MKewoKZYPMg@mail.gmail.com \
--to=tmgross@umich.edu \
--cc=aliceryhl@google.com \
--cc=andrew@lunn.ch \
--cc=benno.lossin@proton.me \
--cc=fujita.tomonori@gmail.com \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rust-for-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).