kernel: add support for kernel 5.4
[openwrt/openwrt.git] / target / linux / generic / backport-5.4 / 724-v5.5-net-sfp-rename-T_PROBE_WAIT-to-T_SERIAL.patch
1 From 615090acb3c0b41691f3a03522ea38350387c0e4 Mon Sep 17 00:00:00 2001
2 From: Russell King <rmk+kernel@armlinux.org.uk>
3 Date: Tue, 15 Oct 2019 10:54:15 +0100
4 Subject: [PATCH 622/660] net: sfp: rename T_PROBE_WAIT to T_SERIAL
5
6 SFF-8472 rev 12.2 defines the time for the serial bus to become ready
7 using t_serial. Use this as our identifier for this timeout to make
8 it clear what we are referring to.
9
10 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
11 ---
12 drivers/net/phy/sfp.c | 13 ++++++-------
13 1 file changed, 6 insertions(+), 7 deletions(-)
14
15 --- a/drivers/net/phy/sfp.c
16 +++ b/drivers/net/phy/sfp.c
17 @@ -149,11 +149,10 @@ static const enum gpiod_flags gpio_flags
18 * the same length on the PCB, which means it's possible for MOD DEF 0 to
19 * connect before the I2C bus on MOD DEF 1/2.
20 *
21 - * The SFP MSA specifies 300ms as t_init (the time taken for TX_FAULT to
22 - * be deasserted) but makes no mention of the earliest time before we can
23 - * access the I2C EEPROM. However, Avago modules require 300ms.
24 + * The SFF-8472 specifies t_serial ("Time from power on until module is
25 + * ready for data transmission over the two wire serial bus.") as 300ms.
26 */
27 -#define T_PROBE_INIT msecs_to_jiffies(300)
28 +#define T_SERIAL msecs_to_jiffies(300)
29 #define T_HPOWER_LEVEL msecs_to_jiffies(300)
30 #define T_PROBE_RETRY msecs_to_jiffies(100)
31
32 @@ -1560,8 +1559,8 @@ static void sfp_sm_device(struct sfp *sf
33 }
34 }
35
36 -/* This state machine tracks the insert/remove state of
37 - * the module, and handles probing the on-board EEPROM.
38 +/* This state machine tracks the insert/remove state of the module, probes
39 + * the on-board EEPROM, and sets up the power level.
40 */
41 static void sfp_sm_module(struct sfp *sfp, unsigned int event)
42 {
43 @@ -1577,7 +1576,7 @@ static void sfp_sm_module(struct sfp *sf
44 default:
45 if (event == SFP_E_INSERT && sfp->attached) {
46 sfp_module_tx_disable(sfp);
47 - sfp_sm_mod_next(sfp, SFP_MOD_PROBE, T_PROBE_INIT);
48 + sfp_sm_mod_next(sfp, SFP_MOD_PROBE, T_SERIAL);
49 }
50 break;
51