diff mbox series

[v1,4/7] device property: fwnode_get_phy_mode: Change API to solve int/unit warnings

Message ID 20200131153440.20870-5-calvin.johnson@nxp.com
State Deferred
Delegated to: David Miller
Headers show
Series ACPI support for xgmac_mdio and dpaa2-mac drivers. | expand

Commit Message

Calvin Johnson Jan. 31, 2020, 3:34 p.m. UTC
From: Calvin Johnson <calvin.johnson@oss.nxp.com>

API fwnode_get_phy_mode is modified to follow the changes made by
Commit 0c65b2b90d13c1 ("net: of_get_phy_mode: Change API to solve
int/unit warnings").

Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
---

 drivers/base/property.c                       | 22 ++++++++++++++-----
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  7 +++---
 include/linux/property.h                      |  4 +++-
 3 files changed, 23 insertions(+), 10 deletions(-)

Comments

Andy Shevchenko Jan. 31, 2020, 3:55 p.m. UTC | #1
On Fri, Jan 31, 2020 at 5:38 PM Calvin Johnson <calvin.johnson@nxp.com> wrote:
>
> From: Calvin Johnson <calvin.johnson@oss.nxp.com>
>
> API fwnode_get_phy_mode is modified to follow the changes made by
> Commit 0c65b2b90d13c1 ("net: of_get_phy_mode: Change API to solve
> int/unit warnings").

I think it would be good to base your series on Dan's fix patch.

--
With Best Regards,
Andy Shevchenko
kernel test robot Feb. 3, 2020, 2:32 a.m. UTC | #2
Hi Calvin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v5.5]
[cannot apply to driver-core/driver-core-testing net-next/master net/master linus/master sparc-next/master next-20200131]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Calvin-Johnson/ACPI-support-for-xgmac_mdio-and-dpaa2-mac-drivers/20200203-070754
base:    d5226fa6dbae0569ee43ecfc08bdcd6770fc4755
config: x86_64-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

Note: the linux-review/Calvin-Johnson/ACPI-support-for-xgmac_mdio-and-dpaa2-mac-drivers/20200203-070754 HEAD 90ffe7e2e45e6e2671084e1169a7bd16c6b3cc8d builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

          ^~~~~~
          PORT_E
   drivers/gpu/drm/i915/display/intel_display.h:226:7: error: 'PORT_G' undeclared (first use in this function); did you mean 'PORT_F'?
     case PORT_G:
          ^~~~~~
          PORT_F
   drivers/gpu/drm/i915/display/intel_display.h:228:7: error: 'PORT_H' undeclared (first use in this function); did you mean 'PORT_G'?
     case PORT_H:
          ^~~~~~
          PORT_G
   drivers/gpu/drm/i915/display/intel_display.h:230:7: error: 'PORT_I' undeclared (first use in this function); did you mean 'PORT_H'?
     case PORT_I:
          ^~~~~~
          PORT_H
   In file included from drivers/gpu/drm/i915/display/intel_bios.c:34:0:
   drivers/gpu/drm/i915/i915_drv.h: At top level:
   drivers/gpu/drm/i915/i915_drv.h:730:41: error: 'I915_MAX_PORTS' undeclared here (not in a function); did you mean 'I915_MAX_PHYS'?
     struct ddi_vbt_port_info ddi_port_info[I915_MAX_PORTS];
                                            ^~~~~~~~~~~~~~
                                            I915_MAX_PHYS
   In file included from include/linux/bitops.h:5:0,
                    from include/linux/kernel.h:12,
                    from include/linux/delay.h:22,
                    from include/drm/drm_dp_helper.h:26,
                    from drivers/gpu/drm/i915/display/intel_bios.c:28:
   drivers/gpu/drm/i915/display/intel_bios.c: In function 'parse_dsi_backlight_ports':
   drivers/gpu/drm/i915/display/intel_bios.c:807:36: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
      dev_priv->vbt.dsi.bl_ports = BIT(PORT_A);
                                       ^
   include/linux/bits.h:8:30: note: in definition of macro 'BIT'
    #define BIT(nr)   (UL(1) << (nr))
                                 ^~
   drivers/gpu/drm/i915/display/intel_bios.c:810:36: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_A'?
      dev_priv->vbt.dsi.bl_ports = BIT(PORT_C);
                                       ^
   include/linux/bits.h:8:30: note: in definition of macro 'BIT'
    #define BIT(nr)   (UL(1) << (nr))
                                 ^~
   drivers/gpu/drm/i915/display/intel_bios.c: In function 'get_port_by_ddc_pin':
   drivers/gpu/drm/i915/display/intel_bios.c:1249:14: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
     for (port = PORT_A; port < I915_MAX_PORTS; port++) {
                 ^~~~~~
                 PORT_DA
   drivers/gpu/drm/i915/display/intel_bios.c: In function 'get_port_by_aux_ch':
   drivers/gpu/drm/i915/display/intel_bios.c:1300:14: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
     for (port = PORT_A; port < I915_MAX_PORTS; port++) {
                 ^~~~~~
                 PORT_DA
   drivers/gpu/drm/i915/display/intel_bios.c: In function 'dvo_port_to_port':
   drivers/gpu/drm/i915/display/intel_bios.c:1396:4: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
      [PORT_A] = { DVO_PORT_HDMIA, DVO_PORT_DPA, -1},
       ^~~~~~
       PORT_DA
   drivers/gpu/drm/i915/display/intel_bios.c:1396:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:1396:4: note: (near initialization for 'dvo_ports')
   drivers/gpu/drm/i915/display/intel_bios.c:1397:4: error: 'PORT_B' undeclared (first use in this function); did you mean 'PORT_A'?
      [PORT_B] = { DVO_PORT_HDMIB, DVO_PORT_DPB, -1},
       ^~~~~~
       PORT_A
   drivers/gpu/drm/i915/display/intel_bios.c:1397:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:1397:4: note: (near initialization for 'dvo_ports')
   drivers/gpu/drm/i915/display/intel_bios.c:1398:4: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_B'?
      [PORT_C] = { DVO_PORT_HDMIC, DVO_PORT_DPC, -1},
       ^~~~~~
       PORT_B
   drivers/gpu/drm/i915/display/intel_bios.c:1398:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:1398:4: note: (near initialization for 'dvo_ports')
   drivers/gpu/drm/i915/display/intel_bios.c:1399:4: error: 'PORT_D' undeclared (first use in this function); did you mean 'PORT_C'?
      [PORT_D] = { DVO_PORT_HDMID, DVO_PORT_DPD, -1},
       ^~~~~~
       PORT_C
   drivers/gpu/drm/i915/display/intel_bios.c:1399:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:1399:4: note: (near initialization for 'dvo_ports')
   drivers/gpu/drm/i915/display/intel_bios.c:1400:4: error: 'PORT_E' undeclared (first use in this function); did you mean 'PORT_D'?
      [PORT_E] = { DVO_PORT_CRT, DVO_PORT_HDMIE, DVO_PORT_DPE},
       ^~~~~~
       PORT_D
   drivers/gpu/drm/i915/display/intel_bios.c:1400:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:1400:4: note: (near initialization for 'dvo_ports')
   drivers/gpu/drm/i915/display/intel_bios.c:1401:4: error: 'PORT_F' undeclared (first use in this function); did you mean 'PORT_E'?
      [PORT_F] = { DVO_PORT_HDMIF, DVO_PORT_DPF, -1},
       ^~~~~~
       PORT_E
   drivers/gpu/drm/i915/display/intel_bios.c:1401:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:1401:4: note: (near initialization for 'dvo_ports')
   drivers/gpu/drm/i915/display/intel_bios.c:1402:4: error: 'PORT_G' undeclared (first use in this function); did you mean 'PORT_F'?
      [PORT_G] = { DVO_PORT_HDMIG, DVO_PORT_DPG, -1},
       ^~~~~~
       PORT_F
   drivers/gpu/drm/i915/display/intel_bios.c:1402:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:1402:4: note: (near initialization for 'dvo_ports')
   drivers/gpu/drm/i915/display/intel_bios.c: In function 'parse_ddi_port':
   drivers/gpu/drm/i915/display/intel_bios.c:1446:14: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
     if (port == PORT_A && is_dvi) {
                 ^~~~~~
                 PORT_DA
   drivers/gpu/drm/i915/display/intel_bios.c:1472:24: error: 'PORT_E' undeclared (first use in this function); did you mean 'PORT_A'?
     if (is_crt && port != PORT_E)
                           ^~~~~~
                           PORT_A
>> drivers/gpu/drm/i915/display/intel_bios.c:1482:25: error: 'PORT_B' undeclared (first use in this function); did you mean 'PORT_E'?
     if (is_edp && (port == PORT_B || port == PORT_C || port == PORT_E))
                            ^~~~~~
                            PORT_E
   drivers/gpu/drm/i915/display/intel_bios.c:1482:43: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_B'?
     if (is_edp && (port == PORT_B || port == PORT_C || port == PORT_E))
                                              ^~~~~~
                                              PORT_B
   drivers/gpu/drm/i915/display/intel_bios.c: In function 'init_vbt_defaults':
   drivers/gpu/drm/i915/display/intel_bios.c:1725:14: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
     for (port = PORT_A; port < I915_MAX_PORTS; port++) {
                 ^~~~~~
                 PORT_DA
   drivers/gpu/drm/i915/display/intel_bios.c: In function 'init_vbt_missing_defaults':
   drivers/gpu/drm/i915/display/intel_bios.c:1739:14: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
     for (port = PORT_A; port < I915_MAX_PORTS; port++) {
                 ^~~~~~
                 PORT_DA
   drivers/gpu/drm/i915/display/intel_bios.c:1751:51: error: 'PORT_E' undeclared (first use in this function); did you mean 'PORT_A'?
      info->supports_dvi = (port != PORT_A && port != PORT_E);
                                                      ^~~~~~
                                                      PORT_A
   drivers/gpu/drm/i915/display/intel_bios.c: In function 'intel_bios_is_port_present':
   drivers/gpu/drm/i915/display/intel_bios.c:2027:4: error: 'PORT_B' undeclared (first use in this function); did you mean 'PORT_BNC'?
      [PORT_B] = { DVO_PORT_DPB, DVO_PORT_HDMIB, },
       ^~~~~~
       PORT_BNC
   drivers/gpu/drm/i915/display/intel_bios.c:2027:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:2027:4: note: (near initialization for 'port_mapping')
   drivers/gpu/drm/i915/display/intel_bios.c:2028:4: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_B'?
      [PORT_C] = { DVO_PORT_DPC, DVO_PORT_HDMIC, },
       ^~~~~~
       PORT_B
   drivers/gpu/drm/i915/display/intel_bios.c:2028:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:2028:4: note: (near initialization for 'port_mapping')
   drivers/gpu/drm/i915/display/intel_bios.c:2029:4: error: 'PORT_D' undeclared (first use in this function); did you mean 'PORT_C'?
      [PORT_D] = { DVO_PORT_DPD, DVO_PORT_HDMID, },
       ^~~~~~
       PORT_C
   drivers/gpu/drm/i915/display/intel_bios.c:2029:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:2029:4: note: (near initialization for 'port_mapping')
   drivers/gpu/drm/i915/display/intel_bios.c:2030:4: error: 'PORT_E' undeclared (first use in this function); did you mean 'PORT_D'?
      [PORT_E] = { DVO_PORT_DPE, DVO_PORT_HDMIE, },
       ^~~~~~
       PORT_D
   drivers/gpu/drm/i915/display/intel_bios.c:2030:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:2030:4: note: (near initialization for 'port_mapping')
   drivers/gpu/drm/i915/display/intel_bios.c:2031:4: error: 'PORT_F' undeclared (first use in this function); did you mean 'PORT_E'?
      [PORT_F] = { DVO_PORT_DPF, DVO_PORT_HDMIF, },
       ^~~~~~
       PORT_E
   drivers/gpu/drm/i915/display/intel_bios.c:2031:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:2031:4: note: (near initialization for 'port_mapping')
   In file included from arch/x86/include/asm/bug.h:83:0,
                    from include/linux/bug.h:5,
                    from include/linux/cpumask.h:14,
                    from arch/x86/include/asm/cpumask.h:5,
                    from arch/x86/include/asm/msr.h:11,
                    from arch/x86/include/asm/processor.h:22,
                    from include/linux/mutex.h:19,
                    from include/linux/kernfs.h:12,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/of.h:17,
                    from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from include/linux/i2c.h:13,
                    from include/drm/drm_dp_helper.h:27,
                    from drivers/gpu/drm/i915/display/intel_bios.c:28:
   drivers/gpu/drm/i915/display/intel_bios.c:2045:22: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_F'?
     if (WARN_ON(port == PORT_A) || port >= ARRAY_SIZE(port_mapping))
                         ^
   include/asm-generic/bug.h:122:25: note: in definition of macro 'WARN'
     int __ret_warn_on = !!(condition);    \
                            ^~~~~~~~~
   drivers/gpu/drm/i915/display/intel_bios.c:2045:6: note: in expansion of macro 'WARN_ON'
     if (WARN_ON(port == PORT_A) || port >= ARRAY_SIZE(port_mapping))
         ^~~~~~~
   drivers/gpu/drm/i915/display/intel_bios.c: In function 'intel_bios_is_port_edp':
   drivers/gpu/drm/i915/display/intel_bios.c:2075:4: error: 'PORT_B' undeclared (first use in this function); did you mean 'PORT_BNC'?
      [PORT_B] = DVO_PORT_DPB,
       ^~~~~~
       PORT_BNC
   drivers/gpu/drm/i915/display/intel_bios.c:2075:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:2075:4: note: (near initialization for 'port_mapping')
   drivers/gpu/drm/i915/display/intel_bios.c:2076:4: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_B'?
      [PORT_C] = DVO_PORT_DPC,
       ^~~~~~
       PORT_B
   drivers/gpu/drm/i915/display/intel_bios.c:2076:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:2076:4: note: (near initialization for 'port_mapping')
   drivers/gpu/drm/i915/display/intel_bios.c:2077:4: error: 'PORT_D' undeclared (first use in this function); did you mean 'PORT_C'?
      [PORT_D] = DVO_PORT_DPD,
       ^~~~~~
       PORT_C
   drivers/gpu/drm/i915/display/intel_bios.c:2077:4: error: array index in initializer not of integer type
   drivers/gpu/drm/i915/display/intel_bios.c:2077:4: note: (near initialization for 'port_mapping')
   drivers/gpu/drm/i915/display/intel_bios.c:2078:4: error: 'PORT_E' undeclared (first use in this function); did you mean 'PORT_D'?
      [PORT_E] = DVO_PORT_DPE,
       ^~~~~~
       PORT_D
--
   drivers/gpu/drm/i915/display/intel_display.c: In function 'intel_port_to_phy':
   drivers/gpu/drm/i915/display/intel_display.c:6803:38: error: 'PORT_D' undeclared (first use in this function); did you mean 'PORT_DA'?
     if (IS_ELKHARTLAKE(i915) && port == PORT_D)
                                         ^~~~~~
                                         PORT_DA
   drivers/gpu/drm/i915/display/intel_display.c: In function 'intel_port_to_tc':
   drivers/gpu/drm/i915/display/intel_display.c:6815:17: error: 'PORT_D' undeclared (first use in this function); did you mean 'PORT_DA'?
      return port - PORT_D;
                    ^~~~~~
                    PORT_DA
   drivers/gpu/drm/i915/display/intel_display.c:6817:16: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_D'?
     return port - PORT_C;
                   ^~~~~~
                   PORT_D
   drivers/gpu/drm/i915/display/intel_display.c: In function 'intel_port_to_power_domain':
   drivers/gpu/drm/i915/display/intel_display.c:6823:7: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
     case PORT_A:
          ^~~~~~
          PORT_DA
   drivers/gpu/drm/i915/display/intel_display.c:6825:7: error: 'PORT_B' undeclared (first use in this function); did you mean 'PORT_A'?
     case PORT_B:
          ^~~~~~
          PORT_A
   drivers/gpu/drm/i915/display/intel_display.c:6827:7: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_B'?
     case PORT_C:
          ^~~~~~
          PORT_B
   drivers/gpu/drm/i915/display/intel_display.c:6829:7: error: 'PORT_D' undeclared (first use in this function); did you mean 'PORT_C'?
     case PORT_D:
          ^~~~~~
          PORT_C
   drivers/gpu/drm/i915/display/intel_display.c:6831:7: error: 'PORT_E' undeclared (first use in this function); did you mean 'PORT_D'?
     case PORT_E:
          ^~~~~~
          PORT_D
   drivers/gpu/drm/i915/display/intel_display.c:6833:7: error: 'PORT_F' undeclared (first use in this function); did you mean 'PORT_E'?
     case PORT_F:
          ^~~~~~
          PORT_E
   drivers/gpu/drm/i915/display/intel_display.c:6835:7: error: 'PORT_G' undeclared (first use in this function); did you mean 'PORT_F'?
     case PORT_G:
          ^~~~~~
          PORT_F
   drivers/gpu/drm/i915/display/intel_display.c: In function 'ironlake_init_pch_refclk':
   drivers/gpu/drm/i915/display/intel_display.c:9020:25: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
       if (encoder->port == PORT_A)
                            ^~~~~~
                            PORT_DA
   In file included from drivers/gpu/drm/i915/display/intel_crt.h:9:0,
                    from drivers/gpu/drm/i915/display/intel_display.c:46:
   drivers/gpu/drm/i915/display/intel_display.c: In function 'cannonlake_get_ddi_pll':
   drivers/gpu/drm/i915/i915_reg.h:10005:59: error: 'PORT_F' undeclared (first use in this function); did you mean 'PORT_DA'?
    #define  DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port) ((port) == PORT_F ? 21 : \
                                                              ^
   drivers/gpu/drm/i915/i915_reg.h:10007:53: note: in expansion of macro 'DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT'
    #define  DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port) (3 << DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port))
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/display/intel_display.c:10217:36: note: in expansion of macro 'DPCLKA_CFGCR0_DDI_CLK_SEL_MASK'
     temp = I915_READ(DPCLKA_CFGCR0) & DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/display/intel_display.c: In function 'bxt_get_ddi_pll':
   drivers/gpu/drm/i915/display/intel_display.c:10270:7: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
     case PORT_A:
          ^~~~~~
          PORT_DA
   drivers/gpu/drm/i915/display/intel_display.c:10273:7: error: 'PORT_B' undeclared (first use in this function); did you mean 'PORT_A'?
     case PORT_B:
          ^~~~~~
          PORT_A
   drivers/gpu/drm/i915/display/intel_display.c:10276:7: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_B'?
     case PORT_C:
          ^~~~~~
          PORT_B
   In file included from drivers/gpu/drm/i915/display/intel_ddi.h:11:0,
                    from drivers/gpu/drm/i915/display/intel_display.c:47:
   drivers/gpu/drm/i915/display/intel_display.c: In function 'bxt_get_dsi_transcoder_state':
   drivers/gpu/drm/i915/display/intel_display.h:336:18: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
     for ((__port) = PORT_A; (__port) < I915_MAX_PORTS; (__port)++) \
                     ^
   drivers/gpu/drm/i915/display/intel_display.c:10448:2: note: in expansion of macro 'for_each_port_masked'
     for_each_port_masked(port, BIT(PORT_A) | BIT(PORT_C)) {
     ^~~~~~~~~~~~~~~~~~~~
   In file included from include/drm/drm_connector.h:31:0,
                    from include/drm/drm_modes.h:33,
                    from include/drm/drm_crtc.h:40,
                    from include/drm/drm_atomic.h:31,
                    from drivers/gpu/drm/i915/display/intel_display.c:35:
   drivers/gpu/drm/i915/display/intel_display.c:10448:47: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_A'?
     for_each_port_masked(port, BIT(PORT_A) | BIT(PORT_C)) {
                                                  ^
   include/drm/drm_util.h:63:38: note: in definition of macro 'for_each_if'
    #define for_each_if(condition) if (!(condition)) {} else
                                         ^~~~~~~~~
   drivers/gpu/drm/i915/display/intel_display.c:10448:2: note: in expansion of macro 'for_each_port_masked'
     for_each_port_masked(port, BIT(PORT_A) | BIT(PORT_C)) {
     ^~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/display/intel_display.c:10448:43: note: in expansion of macro 'BIT'
     for_each_port_masked(port, BIT(PORT_A) | BIT(PORT_C)) {
                                              ^~~
   drivers/gpu/drm/i915/display/intel_display.c: In function 'haswell_get_ddi_port_state':
>> drivers/gpu/drm/i915/display/intel_display.c:10528:15: error: 'PORT_E' undeclared (first use in this function); did you mean 'PORT_DA'?
         (port == PORT_E) && I915_READ(LPT_TRANSCONF) & TRANS_ENABLE) {
                  ^~~~~~
                  PORT_DA
   In file included from drivers/gpu/drm/i915/display/intel_display_types.h:46:0,
                    from drivers/gpu/drm/i915/display/intel_dsi.h:30,
                    from drivers/gpu/drm/i915/display/intel_display.c:49:
   drivers/gpu/drm/i915/display/intel_display.c: In function 'intel_ddi_crt_present':
   drivers/gpu/drm/i915/display/intel_display.c:15884:28: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
     if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
                               ^
   drivers/gpu/drm/i915/i915_drv.h:1981:45: note: in definition of macro '__I915_REG_OP'
     intel_uncore_##op__(&(dev_priv__)->uncore, __VA_ARGS__)
                                                ^~~~~~~~~~~
   drivers/gpu/drm/i915/display/intel_display.c:15884:6: note: in expansion of macro 'I915_READ'
     if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
         ^~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:237:33: note: in expansion of macro '_MMIO'
    #define _MMIO_PORT(port, a, b)  _MMIO(_PORT(port, a, b))
                                    ^~~~~
   drivers/gpu/drm/i915/i915_reg.h:231:28: note: in expansion of macro '_PICK_EVEN'
    #define _PORT(port, a, b)  _PICK_EVEN(port, a, b)
                               ^~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:237:39: note: in expansion of macro '_PORT'
    #define _MMIO_PORT(port, a, b)  _MMIO(_PORT(port, a, b))
                                          ^~~~~
   drivers/gpu/drm/i915/i915_reg.h:9745:27: note: in expansion of macro '_MMIO_PORT'
    #define DDI_BUF_CTL(port) _MMIO_PORT(port, _DDI_BUF_CTL_A, _DDI_BUF_CTL_B)
                              ^~~~~~~~~~
   drivers/gpu/drm/i915/display/intel_display.c:15884:16: note: in expansion of macro 'DDI_BUF_CTL'
     if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
                   ^~~~~~~~~~~
   drivers/gpu/drm/i915/display/intel_display.c: In function 'intel_setup_outputs':
   drivers/gpu/drm/i915/display/intel_display.c:15940:28: error: 'PORT_A' undeclared (first use in this function); did you mean 'PORT_DA'?
      intel_ddi_init(dev_priv, PORT_A);
                               ^~~~~~
                               PORT_DA
   drivers/gpu/drm/i915/display/intel_display.c:15941:28: error: 'PORT_B' undeclared (first use in this function); did you mean 'PORT_A'?
      intel_ddi_init(dev_priv, PORT_B);
                               ^~~~~~
                               PORT_A
   drivers/gpu/drm/i915/display/intel_display.c:15942:28: error: 'PORT_D' undeclared (first use in this function); did you mean 'PORT_B'?
      intel_ddi_init(dev_priv, PORT_D);
                               ^~~~~~
                               PORT_B
   drivers/gpu/drm/i915/display/intel_display.c:15943:28: error: 'PORT_E' undeclared (first use in this function); did you mean 'PORT_D'?
      intel_ddi_init(dev_priv, PORT_E);
                               ^~~~~~
                               PORT_D
   drivers/gpu/drm/i915/display/intel_display.c:15944:28: error: 'PORT_F' undeclared (first use in this function); did you mean 'PORT_E'?
      intel_ddi_init(dev_priv, PORT_F);
                               ^~~~~~
                               PORT_E
   drivers/gpu/drm/i915/display/intel_display.c:15945:28: error: 'PORT_G' undeclared (first use in this function); did you mean 'PORT_F'?
      intel_ddi_init(dev_priv, PORT_G);
                               ^~~~~~
                               PORT_F
   drivers/gpu/drm/i915/display/intel_display.c:15946:28: error: 'PORT_H' undeclared (first use in this function); did you mean 'PORT_G'?
      intel_ddi_init(dev_priv, PORT_H);
                               ^~~~~~
                               PORT_G
   drivers/gpu/drm/i915/display/intel_display.c:15947:28: error: 'PORT_I' undeclared (first use in this function); did you mean 'PORT_H'?
      intel_ddi_init(dev_priv, PORT_I);
                               ^~~~~~
                               PORT_H
   drivers/gpu/drm/i915/display/intel_display.c:15952:28: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_I'?
      intel_ddi_init(dev_priv, PORT_C);
                               ^~~~~~
                               PORT_I
   drivers/gpu/drm/i915/display/intel_display.c: In function 'ibx_sanitize_pch_ports':
   drivers/gpu/drm/i915/display/intel_display.c:17557:37: error: 'PORT_B' undeclared (first use in this function); did you mean 'PORT_BNC'?
     ibx_sanitize_pch_dp_port(dev_priv, PORT_B, PCH_DP_B);
                                        ^~~~~~
                                        PORT_BNC
   drivers/gpu/drm/i915/display/intel_display.c:17558:37: error: 'PORT_C' undeclared (first use in this function); did you mean 'PORT_B'?
     ibx_sanitize_pch_dp_port(dev_priv, PORT_C, PCH_DP_C);
                                        ^~~~~~
                                        PORT_B
   drivers/gpu/drm/i915/display/intel_display.c:17559:37: error: 'PORT_D' undeclared (first use in this function); did you mean 'PORT_C'?
     ibx_sanitize_pch_dp_port(dev_priv, PORT_D, PCH_DP_D);
                                        ^~~~~~
                                        PORT_C
   drivers/gpu/drm/i915/display/intel_display.c: In function 'intel_port_to_tc':
   drivers/gpu/drm/i915/display/intel_display.c:6818:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
..

vim +1482 drivers/gpu/drm/i915/display/intel_bios.c

b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1419  
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1420  static void parse_ddi_port(struct drm_i915_private *dev_priv,
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1421  			   const struct child_device_config *child,
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1422  			   u8 bdb_version)
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1423  {
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1424  	struct ddi_vbt_port_info *info;
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1425  	bool is_dvi, is_hdmi, is_dp, is_edp, is_crt;
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1426  	enum port port;
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1427  
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1428  	port = dvo_port_to_port(child->dvo_port);
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1429  	if (port == PORT_NONE)
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1430  		return;
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1431  
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1432  	info = &dev_priv->vbt.ddi_port_info[port];
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1433  
7679f9b8f6ee39 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-05-31  1434  	if (info->child) {
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1435  		DRM_DEBUG_KMS("More than one child device for port %c in VBT, using the first.\n",
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1436  			      port_name(port));
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1437  		return;
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1438  	}
b024ab9b2d3aa1 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-03-22  1439  
cc9985893aacc3 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-08-24  1440  	is_dvi = child->device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING;
cc9985893aacc3 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-08-24  1441  	is_dp = child->device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT;
cc9985893aacc3 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-08-24  1442  	is_crt = child->device_type & DEVICE_TYPE_ANALOG_OUTPUT;
cc9985893aacc3 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-08-24  1443  	is_hdmi = is_dvi && (child->device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT) == 0;
cc9985893aacc3 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-08-24  1444  	is_edp = is_dp && (child->device_type & DEVICE_TYPE_INTERNAL_CONNECTOR);
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1445  
2ba7d7e0437127 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-09-21 @1446  	if (port == PORT_A && is_dvi) {
2ba7d7e0437127 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-09-21  1447  		DRM_DEBUG_KMS("VBT claims port A supports DVI%s, ignoring\n",
2ba7d7e0437127 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-09-21  1448  			      is_hdmi ? "/HDMI" : "");
2ba7d7e0437127 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-09-21  1449  		is_dvi = false;
2ba7d7e0437127 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-09-21  1450  		is_hdmi = false;
2ba7d7e0437127 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-09-21  1451  	}
2ba7d7e0437127 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-09-21  1452  
311a20949f047a drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1453  	info->supports_dvi = is_dvi;
311a20949f047a drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1454  	info->supports_hdmi = is_hdmi;
311a20949f047a drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1455  	info->supports_dp = is_dp;
a98d9c1d7e9bb0 drivers/gpu/drm/i915/intel_bios.c Imre Deak      2016-12-21  1456  	info->supports_edp = is_edp;
311a20949f047a drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1457  
38b3416f3c2f1d drivers/gpu/drm/i915/intel_bios.c Imre Deak      2018-12-14  1458  	if (bdb_version >= 195)
38b3416f3c2f1d drivers/gpu/drm/i915/intel_bios.c Imre Deak      2018-12-14  1459  		info->supports_typec_usb = child->dp_usb_type_c;
38b3416f3c2f1d drivers/gpu/drm/i915/intel_bios.c Imre Deak      2018-12-14  1460  
38b3416f3c2f1d drivers/gpu/drm/i915/intel_bios.c Imre Deak      2018-12-14  1461  	if (bdb_version >= 209)
38b3416f3c2f1d drivers/gpu/drm/i915/intel_bios.c Imre Deak      2018-12-14  1462  		info->supports_tbt = child->tbt;
38b3416f3c2f1d drivers/gpu/drm/i915/intel_bios.c Imre Deak      2018-12-14  1463  
932cd15431567c drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-05-31  1464  	DRM_DEBUG_KMS("Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d LSPCON:%d USB-Type-C:%d TBT:%d\n",
932cd15431567c drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-05-31  1465  		      port_name(port), is_crt, is_dvi, is_hdmi, is_dp, is_edp,
932cd15431567c drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-05-31  1466  		      HAS_LSPCON(dev_priv) && child->lspcon,
38b3416f3c2f1d drivers/gpu/drm/i915/intel_bios.c Imre Deak      2018-12-14  1467  		      info->supports_typec_usb, info->supports_tbt);
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1468  
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1469  	if (is_edp && is_dvi)
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1470  		DRM_DEBUG_KMS("Internal DP port %c is TMDS compatible\n",
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1471  			      port_name(port));
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1472  	if (is_crt && port != PORT_E)
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1473  		DRM_DEBUG_KMS("Port %c is analog\n", port_name(port));
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1474  	if (is_crt && (is_dvi || is_dp))
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1475  		DRM_DEBUG_KMS("Analog port %c is also DP or TMDS compatible\n",
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1476  			      port_name(port));
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1477  	if (is_dvi && (port == PORT_A || port == PORT_E))
9b13494c916dc0 drivers/gpu/drm/i915/intel_bios.c Masanari Iida  2014-08-06  1478  		DRM_DEBUG_KMS("Port %c is TMDS compatible\n", port_name(port));
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1479  	if (!is_dvi && !is_dp && !is_crt)
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1480  		DRM_DEBUG_KMS("Port %c is not DP/TMDS/CRT compatible\n",
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1481  			      port_name(port));
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12 @1482  	if (is_edp && (port == PORT_B || port == PORT_C || port == PORT_E))
554d6af50a4012 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1483  		DRM_DEBUG_KMS("Port %c is internal DP\n", port_name(port));
6bf19e7c548d46 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1484  
6bf19e7c548d46 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1485  	if (is_dvi) {
e53a1058395435 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1486  		u8 ddc_pin;
e53a1058395435 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1487  
f212bf9abe5de9 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1488  		ddc_pin = map_ddc_pin(dev_priv, child->ddc_pin);
f212bf9abe5de9 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1489  		if (intel_gmbus_is_valid_pin(dev_priv, ddc_pin)) {
f212bf9abe5de9 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1490  			info->alternate_ddc_pin = ddc_pin;
9454fa871edf15 drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2016-10-11  1491  			sanitize_ddc_pin(dev_priv, port);
f212bf9abe5de9 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1492  		} else {
f212bf9abe5de9 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1493  			DRM_DEBUG_KMS("Port %c has invalid DDC pin %d, "
f212bf9abe5de9 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1494  				      "sticking to defaults\n",
f212bf9abe5de9 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1495  				      port_name(port), ddc_pin);
f212bf9abe5de9 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1496  		}
6bf19e7c548d46 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1497  	}
6bf19e7c548d46 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1498  
6bf19e7c548d46 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1499  	if (is_dp) {
e53a1058395435 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1500  		info->alternate_aux_channel = child->aux_channel;
9454fa871edf15 drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2016-10-11  1501  
9454fa871edf15 drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2016-10-11  1502  		sanitize_aux_ch(dev_priv, port);
6bf19e7c548d46 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1503  	}
6bf19e7c548d46 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1504  
0ead5f81d4200b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-09-28  1505  	if (bdb_version >= 158) {
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1506  		/* The VBT HDMI level shift values match the table we have. */
e53a1058395435 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-04-11  1507  		u8 hdmi_level_shift = child->hdmi_level_shifter_value;
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1508  		DRM_DEBUG_KMS("VBT HDMI level shift for port %c: %d\n",
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1509  			      port_name(port),
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1510  			      hdmi_level_shift);
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1511  		info->hdmi_level_shift = hdmi_level_shift;
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1512  	}
75067ddecf2127 drivers/gpu/drm/i915/intel_bios.c Antti Koskipaa 2015-07-10  1513  
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1514  	if (bdb_version >= 204) {
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1515  		int max_tmds_clock;
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1516  
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1517  		switch (child->hdmi_max_data_rate) {
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1518  		default:
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1519  			MISSING_CASE(child->hdmi_max_data_rate);
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1520  			/* fall through */
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1521  		case HDMI_MAX_DATA_RATE_PLATFORM:
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1522  			max_tmds_clock = 0;
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1523  			break;
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1524  		case HDMI_MAX_DATA_RATE_297:
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1525  			max_tmds_clock = 297000;
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1526  			break;
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1527  		case HDMI_MAX_DATA_RATE_165:
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1528  			max_tmds_clock = 165000;
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1529  			break;
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1530  		}
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1531  
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1532  		if (max_tmds_clock)
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1533  			DRM_DEBUG_KMS("VBT HDMI max TMDS clock for port %c: %d kHz\n",
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1534  				      port_name(port), max_tmds_clock);
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1535  		info->max_tmds_clock = max_tmds_clock;
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1536  	}
d6038611aa3d7d drivers/gpu/drm/i915/intel_bios.c Ville Syrjälä  2017-10-30  1537  
75067ddecf2127 drivers/gpu/drm/i915/intel_bios.c Antti Koskipaa 2015-07-10  1538  	/* Parse the I_boost config for SKL and above */
0ead5f81d4200b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-09-28  1539  	if (bdb_version >= 196 && child->iboost) {
f22bb35856ba1e drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-08-25  1540  		info->dp_boost_level = translate_iboost(child->dp_iboost_level);
75067ddecf2127 drivers/gpu/drm/i915/intel_bios.c Antti Koskipaa 2015-07-10  1541  		DRM_DEBUG_KMS("VBT (e)DP boost level for port %c: %d\n",
75067ddecf2127 drivers/gpu/drm/i915/intel_bios.c Antti Koskipaa 2015-07-10  1542  			      port_name(port), info->dp_boost_level);
f22bb35856ba1e drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2017-08-25  1543  		info->hdmi_boost_level = translate_iboost(child->hdmi_iboost_level);
75067ddecf2127 drivers/gpu/drm/i915/intel_bios.c Antti Koskipaa 2015-07-10  1544  		DRM_DEBUG_KMS("VBT HDMI boost level for port %c: %d\n",
75067ddecf2127 drivers/gpu/drm/i915/intel_bios.c Antti Koskipaa 2015-07-10  1545  			      port_name(port), info->hdmi_boost_level);
75067ddecf2127 drivers/gpu/drm/i915/intel_bios.c Antti Koskipaa 2015-07-10  1546  	}
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1547  
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1548  	/* DP max link rate for CNL+ */
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1549  	if (bdb_version >= 216) {
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1550  		switch (child->dp_max_link_rate) {
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1551  		default:
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1552  		case VBT_DP_MAX_LINK_RATE_HBR3:
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1553  			info->dp_max_link_rate = 810000;
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1554  			break;
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1555  		case VBT_DP_MAX_LINK_RATE_HBR2:
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1556  			info->dp_max_link_rate = 540000;
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1557  			break;
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1558  		case VBT_DP_MAX_LINK_RATE_HBR:
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1559  			info->dp_max_link_rate = 270000;
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1560  			break;
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1561  		case VBT_DP_MAX_LINK_RATE_LBR:
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1562  			info->dp_max_link_rate = 162000;
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1563  			break;
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1564  		}
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1565  		DRM_DEBUG_KMS("VBT DP max link rate for port %c: %d\n",
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1566  			      port_name(port), info->dp_max_link_rate);
99b91bda84060b drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2018-02-01  1567  	}
7679f9b8f6ee39 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-05-31  1568  
7679f9b8f6ee39 drivers/gpu/drm/i915/intel_bios.c Jani Nikula    2019-05-31  1569  	info->child = child;
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1570  }
6acab15a7b0d27 drivers/gpu/drm/i915/intel_bios.c Paulo Zanoni   2013-09-12  1571  

:::::: The code at line 1482 was first introduced by commit
:::::: 554d6af50a40125c28e4e1035527a684d2607266 drm/i915: add some assertions about VBT DDI port types

:::::: TO: Paulo Zanoni <paulo.r.zanoni@intel.com>
:::::: CC: Daniel Vetter <daniel.vetter@ffwll.ch>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
kernel test robot Feb. 3, 2020, 8:41 a.m. UTC | #3
Hi Calvin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v5.5]
[cannot apply to driver-core/driver-core-testing net-next/master net/master linus/master sparc-next/master next-20200203]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Calvin-Johnson/ACPI-support-for-xgmac_mdio-and-dpaa2-mac-drivers/20200203-070754
base:    d5226fa6dbae0569ee43ecfc08bdcd6770fc4755
config: sparc64-randconfig-a001-20200203 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   include/linux/phy.h: In function 'phy_ethtool_get_stats':
   include/linux/phy.h:1260:22: error: 'struct phy_device' has no member named 'lock'; did you mean 'link'?
     mutex_lock(&phydev->lock);
                         ^
   include/linux/mutex.h:153:44: note: in definition of macro 'mutex_lock'
    #define mutex_lock(lock) mutex_lock_nested(lock, 0)
                                               ^~~~
   In file included from include/linux/property.h:16:0,
                    from include/linux/of.h:22,
                    from arch/sparc/include/asm/openprom.h:15,
                    from arch/sparc/include/asm/device.h:8,
                    from include/linux/device.h:29,
                    from include/linux/dma-mapping.h:7,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from net/core/ethtool.c:14:
   include/linux/phy.h:1261:33: error: passing argument 2 of 'phydev->drv->get_stats' from incompatible pointer type [-Werror=incompatible-pointer-types]
     phydev->drv->get_stats(phydev, stats, data);
                                    ^~~~~
   include/linux/phy.h:1261:33: note: expected 'struct ethtool_stats *' but argument is of type 'struct ethtool_stats *'
   include/linux/phy.h:1262:24: error: 'struct phy_device' has no member named 'lock'; did you mean 'link'?
     mutex_unlock(&phydev->lock);
                           ^~~~
                           link
   In file included from include/linux/dma-mapping.h:7:0,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from net/core/ethtool.c:14:
   include/linux/device.h: At top level:
   include/linux/device.h:1370:27: error: conflicting types for 'dev_name'
    static inline const char *dev_name(const struct device *dev)
                              ^~~~~~~~
   In file included from include/linux/property.h:16:0,
                    from include/linux/of.h:22,
                    from arch/sparc/include/asm/openprom.h:15,
                    from arch/sparc/include/asm/device.h:8,
                    from include/linux/device.h:29,
                    from include/linux/dma-mapping.h:7,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from net/core/ethtool.c:14:
   include/linux/phy.h:1076:9: note: previous implicit declaration of 'dev_name' was here
     return dev_name(&phydev->mdio.dev);
            ^~~~~~~~
   In file included from include/linux/dma-mapping.h:7:0,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from net/core/ethtool.c:14:
   include/linux/device.h:1417:21: error: conflicting types for 'dev_get_drvdata'
    static inline void *dev_get_drvdata(const struct device *dev)
                        ^~~~~~~~~~~~~~~
   In file included from include/linux/phy.h:18:0,
                    from include/linux/property.h:16,
                    from include/linux/of.h:22,
                    from arch/sparc/include/asm/openprom.h:15,
                    from arch/sparc/include/asm/device.h:8,
                    from include/linux/device.h:29,
                    from include/linux/dma-mapping.h:7,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from net/core/ethtool.c:14:
   include/linux/mdio.h:79:9: note: previous implicit declaration of 'dev_get_drvdata' was here
     return dev_get_drvdata(&mdio->dev);
            ^~~~~~~~~~~~~~~
   In file included from include/linux/dma-mapping.h:7:0,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from net/core/ethtool.c:14:
   include/linux/device.h:1422:20: warning: conflicting types for 'dev_set_drvdata'
    static inline void dev_set_drvdata(struct device *dev, void *data)
                       ^~~~~~~~~~~~~~~
   include/linux/device.h:1422:20: error: static declaration of 'dev_set_drvdata' follows non-static declaration
   In file included from include/linux/phy.h:18:0,
                    from include/linux/property.h:16,
                    from include/linux/of.h:22,
                    from arch/sparc/include/asm/openprom.h:15,
                    from arch/sparc/include/asm/device.h:8,
                    from include/linux/device.h:29,
                    from include/linux/dma-mapping.h:7,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from net/core/ethtool.c:14:
   include/linux/mdio.h:74:2: note: previous implicit declaration of 'dev_set_drvdata' was here
     dev_set_drvdata(&mdio->dev, data);
     ^~~~~~~~~~~~~~~
   net/core/ethtool.c: In function 'ethtool_get_phy_stats':
>> net/core/ethtool.c:1963:45: error: passing argument 2 of 'phy_ethtool_get_stats' from incompatible pointer type [-Werror=incompatible-pointer-types]
       ret = phy_ethtool_get_stats(dev->phydev, &stats, data);
                                                ^
   In file included from include/linux/property.h:16:0,
                    from include/linux/of.h:22,
                    from arch/sparc/include/asm/openprom.h:15,
                    from arch/sparc/include/asm/device.h:8,
                    from include/linux/device.h:29,
                    from include/linux/dma-mapping.h:7,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from net/core/ethtool.c:14:
   include/linux/phy.h:1254:19: note: expected 'struct ethtool_stats *' but argument is of type 'struct ethtool_stats *'
    static inline int phy_ethtool_get_stats(struct phy_device *phydev,
                      ^~~~~~~~~~~~~~~~~~~~~
   net/core/ethtool.c: In function 'ethtool_get_ts_info':
>> net/core/ethtool.c:2174:38: error: passing argument 2 of 'phydev->drv->ts_info' from incompatible pointer type [-Werror=incompatible-pointer-types]
      err = phydev->drv->ts_info(phydev, &info);
                                         ^
   net/core/ethtool.c:2174:38: note: expected 'struct ethtool_ts_info *' but argument is of type 'struct ethtool_ts_info *'
   net/core/ethtool.c: In function '__ethtool_get_module_info':
>> net/core/ethtool.c:2203:43: error: passing argument 2 of 'phydev->drv->module_info' from incompatible pointer type [-Werror=incompatible-pointer-types]
      return phydev->drv->module_info(phydev, modinfo);
                                              ^~~~~~~
   net/core/ethtool.c:2203:43: note: expected 'struct ethtool_modinfo *' but argument is of type 'struct ethtool_modinfo *'
   net/core/ethtool.c: In function '__ethtool_get_module_eeprom':
>> net/core/ethtool.c:2240:45: error: passing argument 2 of 'phydev->drv->module_eeprom' from incompatible pointer type [-Werror=incompatible-pointer-types]
      return phydev->drv->module_eeprom(phydev, ee, data);
                                                ^~
   net/core/ethtool.c:2240:45: note: expected 'struct ethtool_eeprom *' but argument is of type 'struct ethtool_eeprom *'
   In file included from include/linux/notifier.h:14:0,
                    from include/linux/memory_hotplug.h:7,
                    from include/linux/mmzone.h:823,
                    from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:16,
                    from net/core/ethtool.c:10:
   net/core/ethtool.c: In function 'get_phy_tunable':
>> net/core/ethtool.c:2487:22: error: 'struct phy_device' has no member named 'lock'; did you mean 'link'?
     mutex_lock(&phydev->lock);
                         ^
   include/linux/mutex.h:153:44: note: in definition of macro 'mutex_lock'
    #define mutex_lock(lock) mutex_lock_nested(lock, 0)
                                               ^~~~
>> net/core/ethtool.c:2488:41: error: passing argument 2 of 'phydev->drv->get_tunable' from incompatible pointer type [-Werror=incompatible-pointer-types]
     ret = phydev->drv->get_tunable(phydev, &tuna, data);
                                            ^
   net/core/ethtool.c:2488:41: note: expected 'struct ethtool_tunable *' but argument is of type 'struct ethtool_tunable *'
   net/core/ethtool.c:2489:24: error: 'struct phy_device' has no member named 'lock'; did you mean 'link'?
     mutex_unlock(&phydev->lock);
                           ^~~~
                           link
   In file included from include/linux/notifier.h:14:0,
                    from include/linux/memory_hotplug.h:7,
                    from include/linux/mmzone.h:823,
                    from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:16,
                    from net/core/ethtool.c:10:
   net/core/ethtool.c: In function 'set_phy_tunable':
   net/core/ethtool.c:2521:22: error: 'struct phy_device' has no member named 'lock'; did you mean 'link'?
     mutex_lock(&phydev->lock);
                         ^
   include/linux/mutex.h:153:44: note: in definition of macro 'mutex_lock'
    #define mutex_lock(lock) mutex_lock_nested(lock, 0)
                                               ^~~~
>> net/core/ethtool.c:2522:41: error: passing argument 2 of 'phydev->drv->set_tunable' from incompatible pointer type [-Werror=incompatible-pointer-types]
     ret = phydev->drv->set_tunable(phydev, &tuna, data);
                                            ^
   net/core/ethtool.c:2522:41: note: expected 'struct ethtool_tunable *' but argument is of type 'struct ethtool_tunable *'
   net/core/ethtool.c:2523:24: error: 'struct phy_device' has no member named 'lock'; did you mean 'link'?
     mutex_unlock(&phydev->lock);
                           ^~~~
                           link
   cc1: some warnings being treated as errors

vim +/phy_ethtool_get_stats +1963 net/core/ethtool.c

^1da177e4c3f41 Linus Torvalds     2005-04-16  1930  
f3a4094558ddf8 Andrew Lunn        2015-12-30  1931  static int ethtool_get_phy_stats(struct net_device *dev, void __user *useraddr)
f3a4094558ddf8 Andrew Lunn        2015-12-30  1932  {
9994338227179e Florian Fainelli   2018-04-25  1933  	const struct ethtool_ops *ops = dev->ethtool_ops;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1934  	struct phy_device *phydev = dev->phydev;
9994338227179e Florian Fainelli   2018-04-25  1935  	struct ethtool_stats stats;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1936  	u64 *data;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1937  	int ret, n_stats;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1938  
9994338227179e Florian Fainelli   2018-04-25  1939  	if (!phydev && (!ops->get_ethtool_phy_stats || !ops->get_sset_count))
f3a4094558ddf8 Andrew Lunn        2015-12-30  1940  		return -EOPNOTSUPP;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1941  
9994338227179e Florian Fainelli   2018-04-25  1942  	if (dev->phydev && !ops->get_ethtool_phy_stats)
c59530d0d5dccc Florian Fainelli   2018-04-25  1943  		n_stats = phy_ethtool_get_sset_count(dev->phydev);
9994338227179e Florian Fainelli   2018-04-25  1944  	else
9994338227179e Florian Fainelli   2018-04-25  1945  		n_stats = ops->get_sset_count(dev, ETH_SS_PHY_STATS);
f3a4094558ddf8 Andrew Lunn        2015-12-30  1946  	if (n_stats < 0)
f3a4094558ddf8 Andrew Lunn        2015-12-30  1947  		return n_stats;
4d1ceea8516cd6 Alexei Starovoitov 2017-01-30  1948  	if (n_stats > S32_MAX / sizeof(u64))
4d1ceea8516cd6 Alexei Starovoitov 2017-01-30  1949  		return -ENOMEM;
4d1ceea8516cd6 Alexei Starovoitov 2017-01-30  1950  	WARN_ON_ONCE(!n_stats);
f3a4094558ddf8 Andrew Lunn        2015-12-30  1951  
f3a4094558ddf8 Andrew Lunn        2015-12-30  1952  	if (copy_from_user(&stats, useraddr, sizeof(stats)))
f3a4094558ddf8 Andrew Lunn        2015-12-30  1953  		return -EFAULT;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1954  
f3a4094558ddf8 Andrew Lunn        2015-12-30  1955  	stats.n_stats = n_stats;
3d8830266ffc28 Li RongQing        2019-03-29  1956  
3d8830266ffc28 Li RongQing        2019-03-29  1957  	if (n_stats) {
fad953ce0b22cf Kees Cook          2018-06-12  1958  		data = vzalloc(array_size(n_stats, sizeof(u64)));
3d8830266ffc28 Li RongQing        2019-03-29  1959  		if (!data)
f3a4094558ddf8 Andrew Lunn        2015-12-30  1960  			return -ENOMEM;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1961  
9994338227179e Florian Fainelli   2018-04-25  1962  		if (dev->phydev && !ops->get_ethtool_phy_stats) {
c59530d0d5dccc Florian Fainelli   2018-04-25 @1963  			ret = phy_ethtool_get_stats(dev->phydev, &stats, data);
c59530d0d5dccc Florian Fainelli   2018-04-25  1964  			if (ret < 0)
3d8830266ffc28 Li RongQing        2019-03-29  1965  				goto out;
9994338227179e Florian Fainelli   2018-04-25  1966  		} else {
9994338227179e Florian Fainelli   2018-04-25  1967  			ops->get_ethtool_phy_stats(dev, &stats, data);
9994338227179e Florian Fainelli   2018-04-25  1968  		}
3d8830266ffc28 Li RongQing        2019-03-29  1969  	} else {
3d8830266ffc28 Li RongQing        2019-03-29  1970  		data = NULL;
3d8830266ffc28 Li RongQing        2019-03-29  1971  	}
f3a4094558ddf8 Andrew Lunn        2015-12-30  1972  
f3a4094558ddf8 Andrew Lunn        2015-12-30  1973  	ret = -EFAULT;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1974  	if (copy_to_user(useraddr, &stats, sizeof(stats)))
f3a4094558ddf8 Andrew Lunn        2015-12-30  1975  		goto out;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1976  	useraddr += sizeof(stats);
4d1ceea8516cd6 Alexei Starovoitov 2017-01-30  1977  	if (n_stats && copy_to_user(useraddr, data, n_stats * sizeof(u64)))
f3a4094558ddf8 Andrew Lunn        2015-12-30  1978  		goto out;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1979  	ret = 0;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1980  
f3a4094558ddf8 Andrew Lunn        2015-12-30  1981   out:
4d1ceea8516cd6 Alexei Starovoitov 2017-01-30  1982  	vfree(data);
f3a4094558ddf8 Andrew Lunn        2015-12-30  1983  	return ret;
f3a4094558ddf8 Andrew Lunn        2015-12-30  1984  }
f3a4094558ddf8 Andrew Lunn        2015-12-30  1985  

:::::: The code at line 1963 was first introduced by commit
:::::: c59530d0d5dccc96795af12c139f618182cf98db net: Move PHY statistics code into PHY library helpers

:::::: TO: Florian Fainelli <f.fainelli@gmail.com>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
Calvin Johnson Feb. 3, 2020, 9:13 a.m. UTC | #4
Hi Andy,

> -----Original Message-----
> From: Andy Shevchenko <andy.shevchenko@gmail.com>
> Subject: Re: [PATCH v1 4/7] device property: fwnode_get_phy_mode:
> Change API to solve int/unit warnings
> 
> On Fri, Jan 31, 2020 at 5:38 PM Calvin Johnson <calvin.johnson@nxp.com>
> wrote:
> >
> > From: Calvin Johnson <calvin.johnson@oss.nxp.com>
> >
> > API fwnode_get_phy_mode is modified to follow the changes made by
> > Commit 0c65b2b90d13c1 ("net: of_get_phy_mode: Change API to solve
> > int/unit warnings").
> 
> I think it would be good to base your series on Dan's fix patch.

This patch is based on Dan's fix patch https://www.spinics.net/lists/netdev/msg606487.html .
Commit 0c65b2b90d13c1 ("net: of_get_phy_mode: Change API to solve int/unit warnings").
Can you please give more clarity on what you meant? Please point to me, if there is some 
specific patch that you are referring to.

Thanks
Calvin
Andy Shevchenko Feb. 3, 2020, 9:22 a.m. UTC | #5
On Mon, Feb 03, 2020 at 09:13:42AM +0000, Calvin Johnson (OSS) wrote:
> > -----Original Message-----
> > From: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Subject: Re: [PATCH v1 4/7] device property: fwnode_get_phy_mode:
> > Change API to solve int/unit warnings
> > 
> > On Fri, Jan 31, 2020 at 5:38 PM Calvin Johnson <calvin.johnson@nxp.com>
> > wrote:
> > >
> > > From: Calvin Johnson <calvin.johnson@oss.nxp.com>
> > >
> > > API fwnode_get_phy_mode is modified to follow the changes made by
> > > Commit 0c65b2b90d13c1 ("net: of_get_phy_mode: Change API to solve
> > > int/unit warnings").
> > 
> > I think it would be good to base your series on Dan's fix patch.
> 
> This patch is based on Dan's fix patch https://www.spinics.net/lists/netdev/msg606487.html .
> Commit 0c65b2b90d13c1 ("net: of_get_phy_mode: Change API to solve int/unit warnings").
> Can you please give more clarity on what you meant? Please point to me, if there is some 
> specific patch that you are referring to.

Ah, sorry, I meant the "device property: change device_get_phy_mode() to
prevent signedess bugs" [1]. It fixes some PHY initialization issues with the
existing code (thus, should be backported).

[1]: https://lkml.org/lkml/2020/1/31/1
diff mbox series

Patch

diff --git a/drivers/base/property.c b/drivers/base/property.c
index 511f6d7acdfe..fdb79033d58f 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -830,16 +830,20 @@  EXPORT_SYMBOL_GPL(device_get_dma_attr);
 /**
  * fwnode_get_phy_mode - Get phy mode for given firmware node
  * @fwnode:	Pointer to the given node
+ * @interface: Pointer to the result
  *
  * The function gets phy interface string from property 'phy-mode' or
- * 'phy-connection-type', and return its index in phy_modes table, or errno in
- * error case.
+ * 'phy-connection-type'. The index in phy_modes table is set in
+ * interface and 0 returned. In case of error interface is set to
+ * PHY_INTERFACE_MODE_NA and an errno is returned, e.g. -ENODEV.
  */
-int fwnode_get_phy_mode(struct fwnode_handle *fwnode)
+int fwnode_get_phy_mode(struct fwnode_handle *fwnode, phy_interface_t *interface)
 {
 	const char *pm;
 	int err, i;
 
+	*interface = PHY_INTERFACE_MODE_NA;
+
 	err = fwnode_property_read_string(fwnode, "phy-mode", &pm);
 	if (err < 0)
 		err = fwnode_property_read_string(fwnode,
@@ -848,8 +852,10 @@  int fwnode_get_phy_mode(struct fwnode_handle *fwnode)
 		return err;
 
 	for (i = 0; i < PHY_INTERFACE_MODE_MAX; i++)
-		if (!strcasecmp(pm, phy_modes(i)))
+		if (!strcasecmp(pm, phy_modes(i))) {
+			*interface = i;
 			return i;
+		}
 
 	return -ENODEV;
 }
@@ -865,7 +871,13 @@  EXPORT_SYMBOL_GPL(fwnode_get_phy_mode);
  */
 int device_get_phy_mode(struct device *dev)
 {
-	return fwnode_get_phy_mode(dev_fwnode(dev));
+	int ret;
+	phy_interface_t phy_mode;
+
+	ret = fwnode_get_phy_mode(dev_fwnode(dev), &phy_mode);
+	if (!ret)
+		ret = phy_mode;
+	return ret;
 }
 EXPORT_SYMBOL_GPL(device_get_phy_mode);
 
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 14e372cda7f4..00a0350f4da7 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -5209,7 +5209,7 @@  static int mvpp2_port_probe(struct platform_device *pdev,
 	unsigned long flags = 0;
 	bool has_tx_irqs;
 	u32 id;
-	int phy_mode;
+	phy_interface_t phy_mode;
 	int err, i;
 
 	has_tx_irqs = mvpp2_port_has_irqs(priv, port_node, &flags);
@@ -5226,10 +5226,9 @@  static int mvpp2_port_probe(struct platform_device *pdev,
 	if (!dev)
 		return -ENOMEM;
 
-	phy_mode = fwnode_get_phy_mode(port_fwnode);
-	if (phy_mode < 0) {
+	err = fwnode_get_phy_mode(port_fwnode, &phy_mode);
+	if (err < 0) {
 		dev_err(&pdev->dev, "incorrect phy mode\n");
-		err = phy_mode;
 		goto err_free_netdev;
 	}
 
diff --git a/include/linux/property.h b/include/linux/property.h
index 48335288c2a9..1998f502d2ed 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -13,6 +13,7 @@ 
 #include <linux/bits.h>
 #include <linux/fwnode.h>
 #include <linux/types.h>
+#include <linux/phy.h>
 
 struct device;
 
@@ -332,7 +333,8 @@  int device_get_phy_mode(struct device *dev);
 
 void *device_get_mac_address(struct device *dev, char *addr, int alen);
 
-int fwnode_get_phy_mode(struct fwnode_handle *fwnode);
+int fwnode_get_phy_mode(struct fwnode_handle *fwnode,
+			phy_interface_t *interface);
 void *fwnode_get_mac_address(struct fwnode_handle *fwnode,
 			     char *addr, int alen);
 struct fwnode_handle *fwnode_graph_get_next_endpoint(