Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watchdog: dw: limit wdt to instances supported by HW #64762

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions drivers/watchdog/wdt_intel_adsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static int intel_adsp_wdt_setup(const struct device *dev, uint8_t options)
return ret;
}

for (i = 0; i < CONFIG_MP_MAX_NUM_CPUS; i++) {
for (i = 0; i < arch_num_cpus(); i++) {
ret = dw_wdt_configure(dev_data->core_wdt[i], dev_data->period_cfg);
if (ret) {
return ret;
Expand Down Expand Up @@ -120,7 +120,7 @@ static int intel_adsp_wdt_feed(const struct device *dev, int channel_id)
{
struct intel_adsp_wdt_dev_data *const dev_data = dev->data;

if (channel_id >= CONFIG_MP_MAX_NUM_CPUS) {
if (channel_id >= arch_num_cpus()) {
return -EINVAL;
}

Expand Down Expand Up @@ -154,7 +154,7 @@ static int intel_adsp_wdt_init(const struct device *dev)
unsigned int i;
int ret;

for (i = 0; i < CONFIG_MP_MAX_NUM_CPUS; i++) {
for (i = 0; i < arch_num_cpus(); i++) {
dev_data->core_wdt[i] = intel_adsp_wdt_pointer_get(dev_config->base, i);
ret = dw_wdt_probe(dev_data->core_wdt[i], reset_pulse_length);
if (ret) {
Expand Down Expand Up @@ -183,7 +183,7 @@ int intel_adsp_watchdog_pause(const struct device *dev, const int channel_id)
{
const struct intel_adsp_wdt_dev_cfg *const dev_config = dev->config;

if (channel_id >= CONFIG_MP_MAX_NUM_CPUS) {
if (channel_id >= arch_num_cpus()) {
return -EINVAL;
}

Expand All @@ -203,7 +203,7 @@ int intel_adsp_watchdog_resume(const struct device *dev, const int channel_id)
{
const struct intel_adsp_wdt_dev_cfg *const dev_config = dev->config;

if (channel_id >= CONFIG_MP_MAX_NUM_CPUS) {
if (channel_id >= arch_num_cpus()) {
return -EINVAL;
}

Expand Down
Loading