Skip to content

Commit

Permalink
Because sched_lock is now called in spin_lock_irqsave, there is no ne…
Browse files Browse the repository at this point in the history
…ed to call it explicitly.

Signed-off-by: wangzhi16 <[email protected]>
  • Loading branch information
wangzhi-art committed Jan 23, 2025
1 parent 801cd45 commit 61b93bb
Show file tree
Hide file tree
Showing 45 changed files with 0 additions and 356 deletions.
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

0 comments on commit 61b93bb

Please sign in to comment.