Skip to content

watchdog: th1520-wdt should not register on non-TH1520 machines #376

Description

@ifnfn

Problem

When CONFIG_TH1520_PMIC_WATCHDOG=y, the TH1520 PMIC watchdog driver registers a virtual th1520-wdt platform device unconditionally from its initcall.

On non-TH1520 systems such as ZhiHe A210, this creates an unused th1520-wdt device. The probe then tries to get the TH1520 AON global channel and remains deferred because TH1520 AON is not present.

Observed on A210:

platform th1520-wdt: deferred probe pending

/sys/kernel/debug/devices_deferred also shows:

th1520-wdt

Expected behavior

The TH1520 PMIC watchdog virtual device should only be registered on TH1520 machines. Non-TH1520 platforms should not get a stale th1520-wdt deferred-probe entry.

Suggested fix

Gate the virtual platform device registration with the root compatible, for example only allowing it when of_machine_is_compatible("thead,th1520") is true.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions