[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH-L+nO=q_Fs50e2ib8PgzHj2xL_borPONEM-reqpOr9RtQSZA@mail.gmail.com>
Date: Wed, 8 Jan 2025 08:18:19 +0530
From: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@...adcom.com>
To: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, andrew+netdev@...n.ch, netdev@...r.kernel.org,
En-Wei Wu <en-wei.wu@...onical.com>, vitaly.lifshits@...el.com,
dima.ruinskiy@...el.com, "Chia-Lin Kao (AceLan)" <acelan.kao@...onical.com>,
Mor Bar-Gabay <morx.bar.gabay@...el.com>
Subject: Re: [PATCH net 3/3] igc: return early when failing to read EECD register
On Wed, Jan 8, 2025 at 12:32 AM Tony Nguyen <anthony.l.nguyen@...el.com> wrote:
>
> From: En-Wei Wu <en-wei.wu@...onical.com>
>
> When booting with a dock connected, the igc driver may get stuck for ~40
> seconds if PCIe link is lost during initialization.
>
> This happens because the driver access device after EECD register reads
> return all F's, indicating failed reads. Consequently, hw->hw_addr is set
> to NULL, which impacts subsequent rd32() reads. This leads to the driver
> hanging in igc_get_hw_semaphore_i225(), as the invalid hw->hw_addr
> prevents retrieving the expected value.
>
> To address this, a validation check and a corresponding return value
> catch is added for the EECD register read result. If all F's are
> returned, indicating PCIe link loss, the driver will return -ENXIO
> immediately. This avoids the 40-second hang and significantly improves
> boot time when using a dock with an igc NIC.
>
> Log before the patch:
> [ 0.911913] igc 0000:70:00.0: enabling device (0000 -> 0002)
> [ 0.912386] igc 0000:70:00.0: PTM enabled, 4ns granularity
> [ 1.571098] igc 0000:70:00.0 (unnamed net_device) (uninitialized): PCIe link lost, device now detached
> [ 43.449095] igc_get_hw_semaphore_i225: igc 0000:70:00.0 (unnamed net_device) (uninitialized): Driver can't access device - SMBI bit is set.
> [ 43.449186] igc 0000:70:00.0: probe with driver igc failed with error -13
> [ 46.345701] igc 0000:70:00.0: enabling device (0000 -> 0002)
> [ 46.345777] igc 0000:70:00.0: PTM enabled, 4ns granularity
>
> Log after the patch:
> [ 1.031000] igc 0000:70:00.0: enabling device (0000 -> 0002)
> [ 1.032097] igc 0000:70:00.0: PTM enabled, 4ns granularity
> [ 1.642291] igc 0000:70:00.0 (unnamed net_device) (uninitialized): PCIe link lost, device now detached
> [ 5.480490] igc 0000:70:00.0: enabling device (0000 -> 0002)
> [ 5.480516] igc 0000:70:00.0: PTM enabled, 4ns granularity
>
> Fixes: ab4056126813 ("igc: Add NVM support")
> Cc: Chia-Lin Kao (AceLan) <acelan.kao@...onical.com>
> Signed-off-by: En-Wei Wu <en-wei.wu@...onical.com>
> Reviewed-by: Vitaly Lifshits <vitaly.lifshits@...el.com>
> Tested-by: Mor Bar-Gabay <morx.bar.gabay@...el.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
LGTM,
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@...adcom.com>
--
Regards,
Kalesh AP
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4239 bytes)
Powered by blists - more mailing lists