Re: [PATCH v4 6/7] serial: exar: add CTI specific setup code

From: kernel test robot
Date: Thu Apr 18 2024 - 01:30:25 EST


Hi Parker,

kernel test robot noticed the following build warnings:

[auto build test WARNING on b86ae40ffcf5a16b9569b1016da4a08c4f352ca2]

url: https://github.com/intel-lab-lkp/linux/commits/Parker-Newman/serial-exar-remove-old-Connect-Tech-setup/20240418-043457
base: b86ae40ffcf5a16b9569b1016da4a08c4f352ca2
patch link: https://lore.kernel.org/r/ae4a66e7342b686cb8d4b15317585dfb37222cf4.1713382717.git.pnewman%40connecttech.com
patch subject: [PATCH v4 6/7] serial: exar: add CTI specific setup code
config: alpha-defconfig (https://download.01.org/0day-ci/archive/20240418/202404181353.1VIC4cz9-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240418/202404181353.1VIC4cz9-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404181353.1VIC4cz9-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/tty/serial/8250/8250_exar.c:727: warning: Function parameter or struct member 'pcidev' not described in 'cti_get_port_type_xr17c15x_xr17v25x'
>> drivers/tty/serial/8250/8250_exar.c:819: warning: Function parameter or struct member 'pcidev' not described in 'cti_get_port_type_fpga'
>> drivers/tty/serial/8250/8250_exar.c:849: warning: Function parameter or struct member 'pcidev' not described in 'cti_get_port_type_xr17v35x'


vim +727 drivers/tty/serial/8250/8250_exar.c

714
715 /**
716 * cti_get_port_type_xr17c15x_xr17v25x() - Get port type of xr17c15x/xr17v25x
717 * @priv: Device's private structure
718 * @port_num: Port to get type of
719 *
720 * CTI xr17c15x and xr17v25x based cards port types are based on PCI IDs.
721 *
722 * Return: port type on success, CTI_PORT_TYPE_NONE on failure
723 */
724 static enum cti_port_type cti_get_port_type_xr17c15x_xr17v25x(struct exar8250 *priv,
725 struct pci_dev *pcidev,
726 unsigned int port_num)
> 727 {
728 enum cti_port_type port_type;
729
730 switch (pcidev->subsystem_device) {
731 // RS232 only cards
732 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_232:
733 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_232:
734 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_232:
735 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP_232:
736 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP_232_NS:
737 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP_232:
738 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP_232_NS:
739 port_type = CTI_PORT_TYPE_RS232;
740 break;
741 // 1x RS232, 1x RS422/RS485
742 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_1_1:
743 port_type = (port_num == 0) ?
744 CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485;
745 break;
746 // 2x RS232, 2x RS422/RS485
747 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_2:
748 port_type = (port_num < 2) ?
749 CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485;
750 break;
751 // 4x RS232, 4x RS422/RS485
752 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4:
753 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4_SP:
754 port_type = (port_num < 4) ?
755 CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485;
756 break;
757 // RS232/RS422/RS485 HW (jumper) selectable
758 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2:
759 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4:
760 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8:
761 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_SP_OPTO:
762 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_SP_OPTO_A:
763 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_SP_OPTO_B:
764 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XPRS:
765 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_A:
766 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_B:
767 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS:
768 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_16_XPRS_A:
769 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_16_XPRS_B:
770 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XPRS_OPTO:
771 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_OPTO_A:
772 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_OPTO_B:
773 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP:
774 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XP_OPTO_LEFT:
775 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XP_OPTO_RIGHT:
776 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XP_OPTO:
777 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4_XPRS_OPTO:
778 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP:
779 port_type = CTI_PORT_TYPE_RS232_422_485_HW;
780 break;
781 // RS422/RS485 HW (jumper) selectable
782 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_485:
783 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485:
784 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485:
785 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP_485:
786 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP_485:
787 port_type = CTI_PORT_TYPE_RS422_485;
788 break;
789 // 6x RS232, 2x RS422/RS485
790 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_6_2_SP:
791 port_type = (port_num < 6) ?
792 CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485;
793 break;
794 // 2x RS232, 6x RS422/RS485
795 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_6_SP:
796 port_type = (port_num < 2) ?
797 CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485;
798 break;
799 default:
800 dev_err(&pcidev->dev, "unknown/unsupported device\n");
801 port_type = CTI_PORT_TYPE_NONE;
802 }
803
804 return port_type;
805 }
806
807 /**
808 * cti_get_port_type_fpga() - Get the port type of a CTI FPGA card
809 * @priv: Device's private structure
810 * @port_num: Port to get type of
811 *
812 * FPGA based cards port types are based on PCI IDs.
813 *
814 * Return: port type on success, CTI_PORT_TYPE_NONE on failure
815 */
816 static enum cti_port_type cti_get_port_type_fpga(struct exar8250 *priv,
817 struct pci_dev *pcidev,
818 unsigned int port_num)
> 819 {
820 enum cti_port_type port_type;
821
822 switch (pcidev->device) {
823 case PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_12_XIG00X:
824 case PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_12_XIG01X:
825 case PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_16:
826 port_type = CTI_PORT_TYPE_RS232_422_485_HW;
827 break;
828 default:
829 dev_err(&pcidev->dev, "unknown/unsupported device\n");
830 return CTI_PORT_TYPE_NONE;
831 }
832
833 return port_type;
834 }
835
836 /**
837 * cti_get_port_type_xr17v35x() - Read port type from the EEPROM
838 * @priv: Device's private structure
839 * @port_num: port offset
840 *
841 * CTI XR17V35X based cards have the port types stored in the EEPROM.
842 * This function reads the port type for a single port.
843 *
844 * Return: port type on success, CTI_PORT_TYPE_NONE on failure
845 */
846 static enum cti_port_type cti_get_port_type_xr17v35x(struct exar8250 *priv,
847 struct pci_dev *pcidev,
848 unsigned int port_num)
> 849 {
850 enum cti_port_type port_type;
851 u16 port_flags;
852 u8 offset;
853
854 offset = CTI_EE_OFF_XR17V35X_PORT_FLAGS + port_num;
855 port_flags = exar_ee_read(priv, offset);
856
857 port_type = FIELD_GET(CTI_EE_MASK_PORT_FLAGS_TYPE, port_flags);
858 if (!CTI_PORT_TYPE_VALID(port_type)) {
859 /*
860 * If the port type is missing the card assume it is a
861 * RS232/RS422/RS485 card to be safe.
862 *
863 * There is one known board (BEG013) that only has
864 * 3 of 4 port types written to the EEPROM so this
865 * acts as a work around.
866 */
867 dev_warn(&pcidev->dev,
868 "failed to get port %d type from EEPROM\n", port_num);
869 port_type = CTI_PORT_TYPE_RS232_422_485_HW;
870 }
871
872 return port_type;
873 }
874

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki