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

Because sched_lock is now called in spin_lock_irqsave, there is no ne… #15665

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions arch/arm/src/am335x/am335x_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <nuttx/config.h>

#include <assert.h>
#include <sched.h>

#include <arch/board/board.h>
#include <nuttx/irq.h>
Expand Down Expand Up @@ -1084,7 +1083,6 @@ struct can_dev_s *am335x_can_initialize(int port)
syslog(LOG_DEBUG, "CAN%d\n", port);

flags = spin_lock_irqsave(&g_can_lock);
sched_lock();

#ifdef CONFIG_AM335X_CAN0
if (port == 0)
Expand Down Expand Up @@ -1115,12 +1113,10 @@ struct can_dev_s *am335x_can_initialize(int port)
canerr("Unsupported port: %d\n", port);

spin_unlock_irqrestore(&g_can_lock, flags);
sched_unlock();
return NULL;
}

spin_unlock_irqrestore(&g_can_lock, flags);
sched_unlock();

return candev;
}
Expand All @@ -1132,7 +1128,6 @@ void am335x_can_uninitialize(struct can_dev_s *dev)
DEBUGASSERT(dev);

flags = spin_lock_irqsave(&g_can_lock);
sched_lock();

#ifdef CONFIG_AM335X_CAN0
if (dev == &g_can0dev)
Expand Down Expand Up @@ -1160,7 +1155,6 @@ void am335x_can_uninitialize(struct can_dev_s *dev)
}

spin_unlock_irqrestore(&g_can_lock, flags);
sched_unlock();
}

#endif
3 changes: 0 additions & 3 deletions arch/arm/src/cxd56xx/cxd56_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <assert.h>
#include <errno.h>
#include <debug.h>
#include <sched.h>

#include <nuttx/irq.h>
#include <nuttx/spinlock.h>
Expand Down Expand Up @@ -434,7 +433,6 @@ static void cxd56_setcallback(struct timer_lowerhalf_s *lower,
irqstate_t flags;

flags = spin_lock_irqsave(&priv->lock);
sched_lock();

DEBUGASSERT(priv);
tmrinfo("Entry: callback=%p\n", callback);
Expand All @@ -445,7 +443,6 @@ static void cxd56_setcallback(struct timer_lowerhalf_s *lower,
priv->arg = arg;

spin_unlock_irqrestore(&priv->lock, flags);
sched_unlock();
}

/****************************************************************************
Expand Down
13 changes: 0 additions & 13 deletions arch/arm/src/cxd56xx/cxd56_usbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <debug.h>
#include <fcntl.h>
#include <stdio.h>
#include <sched.h>

#include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
Expand Down Expand Up @@ -1137,12 +1136,10 @@ static void cxd56_cancelrequests_nolock(struct cxd56_ep_s *privep)
static void cxd56_cancelrequests(struct cxd56_ep_s *privep)
{
irqstate_t flags = spin_lock_irqsave(&privep->dev->lock);
sched_lock();

cxd56_cancelrequests_nolock(privep);

spin_unlock_irqrestore(&privep->dev->lock, flags);
sched_unlock();
}

/****************************************************************************
Expand Down Expand Up @@ -2296,11 +2293,9 @@ static int cxd56_epdisable(struct usbdev_ep_s *ep)
/* Cancel any ongoing activity and reset the endpoint */

flags = spin_lock_irqsave(&privep->dev->lock);
sched_lock();
cxd56_epstall(&privep->ep, false);
cxd56_cancelrequests_nolock(privep);
spin_unlock_irqrestore(&privep->dev->lock, flags);
sched_unlock();
return OK;
}

Expand Down Expand Up @@ -2440,7 +2435,6 @@ static int cxd56_epsubmit(struct usbdev_ep_s *ep,
req->result = -EINPROGRESS;
req->xfrd = 0;
flags = spin_lock_irqsave(&priv->lock);
sched_lock();

/* If we are stalled, then drop all requests on the floor, except OUT */

Expand Down Expand Up @@ -2545,7 +2539,6 @@ static int cxd56_epsubmit(struct usbdev_ep_s *ep,
}

spin_unlock_irqrestore(&priv->lock, flags);
sched_unlock();
return ret;
}

Expand Down Expand Up @@ -2574,10 +2567,8 @@ static int cxd56_epcancel(struct usbdev_ep_s *ep,
usbtrace(TRACE_EPCANCEL, privep->epphy);

flags = spin_lock_irqsave(&privep->dev->lock);
sched_lock();
cxd56_cancelrequests_nolock(privep);
spin_unlock_irqrestore(&privep->dev->lock, flags);
sched_unlock();
return OK;
}

Expand Down Expand Up @@ -3174,7 +3165,6 @@ void arm_usbuninitialize(void)
}

flags = spin_lock_irqsave(&priv->lock);
sched_lock();
cxd56_pullup(&priv->usbdev, false);
priv->usbdev.speed = USB_SPEED_UNKNOWN;

Expand All @@ -3192,7 +3182,6 @@ void arm_usbuninitialize(void)

cxd56_usb_clock_disable();
spin_unlock_irqrestore(&priv->lock, flags);
sched_unlock();

/* Clear signal */

Expand Down Expand Up @@ -3287,7 +3276,6 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver)
CLASS_UNBIND(driver, &g_usbdev.usbdev);

flags = spin_lock_irqsave(&priv->lock);
sched_lock();

/* Disable IRQs */

Expand All @@ -3308,7 +3296,6 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver)
cxd56_usbhwuninit();

spin_unlock_irqrestore(&priv->lock, flags);
sched_unlock();

up_pm_release_freqlock(&g_hv_lock);
up_pm_release_wakelock(&g_wake_lock);
Expand Down
9 changes: 0 additions & 9 deletions arch/arm/src/dm320/dm320_usbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <assert.h>
#include <errno.h>
#include <debug.h>
#include <sched.h>

#include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
Expand Down Expand Up @@ -1046,12 +1045,10 @@ static int dm320_wrrequest(struct dm320_ep_s *privep)
{
int ret;
irqstate_t flags = spin_lock_irqsave(&privep->dev->lock);
sched_lock();

ret = dm320_wrrequest_nolock(privep);

spin_unlock_irqrestore(&privep->dev->lock, flags);
sched_unlock();

return ret;
}
Expand Down Expand Up @@ -2028,12 +2025,10 @@ static int dm320_epdisable(struct usbdev_ep_s *ep)
/* Cancel any ongoing activity and reset the endpoint */

flags = spin_lock_irqsave(&privep->dev->lock);
sched_lock();
dm320_cancelrequests(privep);
dm320_epreset(privep->epphy);

spin_unlock_irqrestore(&privep->dev->lock, flags);
sched_unlock();
return OK;
}

Expand Down Expand Up @@ -2173,7 +2168,6 @@ static int dm320_epsubmit(struct usbdev_ep_s *ep,
req->result = -EINPROGRESS;
req->xfrd = 0;
flags = spin_lock_irqsave(&priv->lock);
sched_lock();

/* Check for NULL packet */

Expand Down Expand Up @@ -2234,7 +2228,6 @@ static int dm320_epsubmit(struct usbdev_ep_s *ep,
}

spin_unlock_irqrestore(&priv->lock, flags);
sched_unlock();
return ret;
}

Expand Down Expand Up @@ -2265,10 +2258,8 @@ static int dm320_epcancel(struct usbdev_ep_s *ep,
priv = privep->dev;

flags = spin_lock_irqsave(&priv->lock);
sched_lock();
dm320_cancelrequests(privep);
spin_unlock_irqrestore(&priv->lock, flags);
sched_unlock();
return OK;
}

Expand Down
Loading
Loading