[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20241220.145712.1633600178791862342.fujita.tomonori@gmail.com>
Date: Fri, 20 Dec 2024 14:57:12 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: andrew@...n.ch
Cc: fujita.tomonori@...il.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, rust-for-linux@...r.kernel.org,
hkallweit1@...il.com, tmgross@...ch.edu, ojeda@...nel.org,
alex.gaynor@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me, a.hindborg@...sung.com, aliceryhl@...gle.com,
anna-maria@...utronix.de, frederic@...nel.org, tglx@...utronix.de,
arnd@...db.de, jstultz@...gle.com, sboyd@...nel.org, mingo@...hat.com,
peterz@...radead.org, juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com
Subject: Re: [PATCH v6 7/7] net: phy: qt2025: Wait until PHY becomes ready
On Thu, 14 Nov 2024 15:08:01 +0100
Andrew Lunn <andrew@...n.ch> wrote:
> On Thu, Nov 14, 2024 at 04:02:34PM +0900, FUJITA Tomonori wrote:
>> Wait until a PHY becomes ready in the probe callback by
>> using read_poll_timeout function.
>>
>> Signed-off-by: FUJITA Tomonori <fujita.tomonori@...il.com>
>> ---
>> drivers/net/phy/qt2025.rs | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/phy/qt2025.rs b/drivers/net/phy/qt2025.rs
>> index 28d8981f410b..c042f2f82bb9 100644
>> --- a/drivers/net/phy/qt2025.rs
>> +++ b/drivers/net/phy/qt2025.rs
>> @@ -12,6 +12,7 @@
>> use kernel::c_str;
>> use kernel::error::code;
>> use kernel::firmware::Firmware;
>> +use kernel::io::poll::read_poll_timeout;
>> use kernel::net::phy::{
>> self,
>> reg::{Mmd, C45},
>> @@ -19,6 +20,7 @@
>> };
>> use kernel::prelude::*;
>> use kernel::sizes::{SZ_16K, SZ_8K};
>> +use kernel::time::Delta;
>>
>> kernel::module_phy_driver! {
>> drivers: [PhyQT2025],
>> @@ -93,7 +95,13 @@ fn probe(dev: &mut phy::Device) -> Result<()> {
>> // The micro-controller will start running from SRAM.
>> dev.write(C45::new(Mmd::PCS, 0xe854), 0x0040)?;
>>
>> - // TODO: sleep here until the hw becomes ready.
>> + read_poll_timeout(
>> + || dev.read(C45::new(Mmd::PCS, 0xd7fd)),
>> + |val| val != 0x00 && val != 0x10,
>
> Do we have any idea what these magic numbers mean? Can we replace the
> numbers with names?
I can't find any hints.
> Apart from that, this patch looks O.K.
>
> Reviewed-by: Andrew Lunn <andrew@...n.ch>
Thanks!
Powered by blists - more mailing lists