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

drivers/modem/alt1250: Fix bug that lte_finalize() got stuck #22

Merged
merged 1 commit into from
Feb 6, 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
33 changes: 4 additions & 29 deletions drivers/modem/alt1250/altmdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ static void process_before_poweroff(void)

/* clear event without EVENT_POWERON */

altmdm_event_clear(&g_altmdm_dev.event, (allevt & ~(EVENT_POWERON)));
altmdm_event_clear(&g_altmdm_dev.event,
(allevt & ~(EVENT_POWERON | EVENT_DESTROY)));
g_altmdm_dev.lower->irqenable(false);
g_altmdm_dev.lower->set_wakeup(false);
g_altmdm_dev.lower->set_mready(false);
Expand Down Expand Up @@ -1530,35 +1531,9 @@ int altmdm_init(FAR struct spi_dev_s *spidev,

int altmdm_fin(void)
{
int ret = OK;
uint32_t evt;

nxsem_wait_uninterruptible(&g_altmdm_dev.lock_evt);

evt = altmdm_event_refer(&g_altmdm_dev.event);

/* Is already accepted DESTROY request? */

if (evt & EVENT_DESTROY)
{
ret = -EALREADY;
}
altmdm_event_set(&g_altmdm_dev.event, EVENT_DESTROY);

/* Is in DESTROY state? */

if (g_altmdm_dev.current_state == ALTMDM_STATE_DESTORY)
{
ret = -EALREADY;
}

if (ret == OK)
{
altmdm_event_set(&g_altmdm_dev.event, EVENT_DESTROY);
}

nxsem_post(&g_altmdm_dev.lock_evt);

return ret;
return OK;
}

int altmdm_poweron(void)
Expand Down