use strnstr paths in amdgpu
authorjsg <jsg@openbsd.org>
Thu, 21 Dec 2023 03:09:08 +0000 (03:09 +0000)
committerjsg <jsg@openbsd.org>
Thu, 21 Dec 2023 03:09:08 +0000 (03:09 +0000)
sys/dev/pci/drm/amd/amdgpu/amdgpu_fru_eeprom.c
sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c
sys/dev/pci/drm/amd/amdgpu/amdgpu_ras_eeprom.c

index 5192ac4..e325150 100644 (file)
@@ -53,7 +53,6 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)
         */
        switch (adev->asic_type) {
        case CHIP_VEGA20:
-#ifdef notyet
                /* D161 and D163 are the VG20 server SKUs */
                if (strnstr(atom_ctx->vbios_version, "D161",
                            sizeof(atom_ctx->vbios_version)) ||
@@ -61,13 +60,11 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)
                            sizeof(atom_ctx->vbios_version)))
                        return true;
                else
-#endif
                        return false;
        case CHIP_ALDEBARAN:
                /* All Aldebaran SKUs have the FRU */
                return true;
        case CHIP_SIENNA_CICHLID:
-#ifdef notyet
                if (strnstr(atom_ctx->vbios_version, "D603",
                    sizeof(atom_ctx->vbios_version))) {
                        if (strnstr(atom_ctx->vbios_version, "D603GLXE",
@@ -78,9 +75,6 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)
                } else {
                        return false;
                }
-#else
-               return false;
-#endif
        default:
                return false;
        }
index fe48628..7a301dd 100644 (file)
@@ -2327,13 +2327,11 @@ static void amdgpu_ras_get_quirks(struct amdgpu_device *adev)
        if (!ctx)
                return;
 
-#ifdef notyet
        if (strnstr(ctx->vbios_version, "D16406",
                    sizeof(ctx->vbios_version)) ||
                strnstr(ctx->vbios_version, "D36002",
                        sizeof(ctx->vbios_version)))
                adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__GFX);
-#endif
 }
 
 /*
index 4447995..e967135 100644 (file)
@@ -149,44 +149,29 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev,
                /* VEGA20 and ARCTURUS */
                if (adev->asic_type == CHIP_VEGA20)
                        control->i2c_address = EEPROM_I2C_MADDR_0;
-#ifdef notyet
                else if (strnstr(atom_ctx->vbios_version,
                                 "D342",
                                 sizeof(atom_ctx->vbios_version)))
                        control->i2c_address = EEPROM_I2C_MADDR_0;
                else
                        control->i2c_address = EEPROM_I2C_MADDR_4;
-#else
-               STUB();
-               control->i2c_address = EEPROM_I2C_MADDR_4;
-#endif
                return true;
        case IP_VERSION(11, 0, 7):
                control->i2c_address = EEPROM_I2C_MADDR_0;
                return true;
        case IP_VERSION(13, 0, 2):
-#ifdef notyet
                if (strnstr(atom_ctx->vbios_version, "D673",
                            sizeof(atom_ctx->vbios_version)))
                        control->i2c_address = EEPROM_I2C_MADDR_4;
                else
                        control->i2c_address = EEPROM_I2C_MADDR_0;
-#else
-               STUB();
-               control->i2c_address = EEPROM_I2C_MADDR_0;
-#endif
                return true;
        case IP_VERSION(13, 0, 0):
-#ifdef notyet
                if (strnstr(atom_ctx->vbios_pn, "D707",
                            sizeof(atom_ctx->vbios_pn)))
                        control->i2c_address = EEPROM_I2C_MADDR_0;
                else
                        control->i2c_address = EEPROM_I2C_MADDR_4;
-#else
-               STUB();
-               control->i2c_address = EEPROM_I2C_MADDR_4;
-#endif
                return true;
        case IP_VERSION(13, 0, 6):
        case IP_VERSION(13, 0, 10):