Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167892336
D14712.id40364.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D14712.id40364.diff
View Options
Index: sys/arm/at91/at91_rst.c
===================================================================
--- sys/arm/at91/at91_rst.c
+++ sys/arm/at91/at91_rst.c
@@ -124,7 +124,7 @@
at91_rst_sc = sc = device_get_softc(dev);
sc->sc_dev = dev;
- callout_init(&sc->tick_ch, 0);
+ callout_init(&sc->tick_ch, 1);
rid = 0;
sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
Index: sys/dev/syscons/syscons.c
===================================================================
--- sys/dev/syscons/syscons.c
+++ sys/dev/syscons/syscons.c
@@ -3858,22 +3858,28 @@
case RBT:
#ifndef SC_DISABLE_REBOOT
- if (enable_reboot && !(flags & SCGETC_CN))
+ if (enable_reboot && !(flags & SCGETC_CN)) {
+ mtx_unlock(&Giant);
shutdown_nice(0);
+ }
#endif
break;
case HALT:
#ifndef SC_DISABLE_REBOOT
- if (enable_reboot && !(flags & SCGETC_CN))
+ if (enable_reboot && !(flags & SCGETC_CN)) {
+ mtx_unlock(&Giant);
shutdown_nice(RB_HALT);
+ }
#endif
break;
case PDWN:
#ifndef SC_DISABLE_REBOOT
- if (enable_reboot && !(flags & SCGETC_CN))
+ if (enable_reboot && !(flags & SCGETC_CN)) {
+ mtx_unlock(&Giant);
shutdown_nice(RB_HALT|RB_POWEROFF);
+ }
#endif
break;
Index: sys/dev/vt/vt_core.c
===================================================================
--- sys/dev/vt/vt_core.c
+++ sys/dev/vt/vt_core.c
@@ -695,8 +695,11 @@
kdb_enter(KDB_WHY_BREAK, "manual escape to debugger");
return (1);
case SPCLKEY | HALT: /* kbdmap(5) keyword `halt`. */
- if (vt_kbd_halt)
+ if (vt_kbd_halt) {
+ DROP_GIANT();
shutdown_nice(RB_HALT);
+ PICKUP_GIANT();
+ }
return (1);
case SPCLKEY | PASTE: /* kbdmap(5) keyword `paste`. */
#ifndef SC_NO_CUTPASTE
@@ -705,8 +708,11 @@
#endif
break;
case SPCLKEY | PDWN: /* kbdmap(5) keyword `pdwn`. */
- if (vt_kbd_poweroff)
+ if (vt_kbd_poweroff) {
+ DROP_GIANT();
shutdown_nice(RB_HALT|RB_POWEROFF);
+ PICKUP_GIANT();
+ }
return (1);
case SPCLKEY | PNC: /* kbdmap(5) keyword `panic`. */
/*
@@ -717,8 +723,11 @@
panic("Forced by the panic key");
return (1);
case SPCLKEY | RBT: /* kbdmap(5) keyword `boot`. */
- if (vt_kbd_reboot)
+ if (vt_kbd_reboot) {
+ DROP_GIANT();
shutdown_nice(RB_AUTOBOOT);
+ PICKUP_GIANT();
+ }
return (1);
case SPCLKEY | SPSC: /* kbdmap(5) keyword `spsc`. */
/* Force activatation/deactivation of the screen saver. */
Index: sys/kern/init_main.c
===================================================================
--- sys/kern/init_main.c
+++ sys/kern/init_main.c
@@ -703,10 +703,6 @@
struct thread *td;
struct proc *p;
- mtx_lock(&Giant);
-
- GIANT_REQUIRED;
-
TSENTER(); /* Here so we don't overlap with mi_startup. */
td = curthread;
@@ -801,7 +797,6 @@
* to user mode as init!
*/
if ((error = sys_execve(td, &args)) == EJUSTRETURN) {
- mtx_unlock(&Giant);
TSEXIT();
return;
}
Index: sys/kern/kern_shutdown.c
===================================================================
--- sys/kern/kern_shutdown.c
+++ sys/kern/kern_shutdown.c
@@ -268,13 +268,10 @@
if (error == 0)
error = priv_check(td, PRIV_REBOOT);
if (error == 0) {
- if (uap->opt & RB_REROOT) {
+ if (uap->opt & RB_REROOT)
error = kern_reroot();
- } else {
- mtx_lock(&Giant);
+ else
kern_reboot(uap->opt);
- mtx_unlock(&Giant);
- }
}
return (error);
}
Index: sys/kern/subr_kdb.c
===================================================================
--- sys/kern/subr_kdb.c
+++ sys/kern/subr_kdb.c
@@ -273,7 +273,9 @@
{
printf("KDB: reboot requested\n");
+ DROP_GIANT();
shutdown_nice(0);
+ PICKUP_GIANT();
}
/*
Index: sys/kern/vfs_mountroot.c
===================================================================
--- sys/kern/vfs_mountroot.c
+++ sys/kern/vfs_mountroot.c
@@ -579,9 +579,7 @@
if (root_mount_mddev != -1) {
mdio->md_unit = root_mount_mddev;
- DROP_GIANT();
error = kern_ioctl(td, fd, MDIOCDETACH, (void *)mdio);
- PICKUP_GIANT();
/* Ignore errors. We don't care. */
root_mount_mddev = -1;
}
@@ -590,9 +588,7 @@
mdio->md_options = MD_AUTOUNIT | MD_READONLY;
mdio->md_mediasize = sb.st_size;
mdio->md_unit = 0;
- DROP_GIANT();
error = kern_ioctl(td, fd, MDIOCATTACH, (void *)mdio);
- PICKUP_GIANT();
if (error)
goto out;
@@ -601,9 +597,7 @@
mdio->md_file = NULL;
mdio->md_options = 0;
mdio->md_mediasize = 0;
- DROP_GIANT();
error = kern_ioctl(td, fd, MDIOCDETACH, (void *)mdio);
- PICKUP_GIANT();
/* Ignore errors. We don't care. */
error = ERANGE;
goto out;
@@ -960,9 +954,7 @@
curfail = 0;
while (1) {
- DROP_GIANT();
g_waitidle();
- PICKUP_GIANT();
mtx_lock(&root_holds_mtx);
if (LIST_EMPTY(&root_holds)) {
mtx_unlock(&root_holds_mtx);
@@ -1004,9 +996,7 @@
* Note that we must wait for GEOM to finish reconfiguring itself,
* eg for geom_part(4) to finish tasting.
*/
- DROP_GIANT();
g_waitidle();
- PICKUP_GIANT();
if (parse_mount_dev_present(dev))
return (0);
@@ -1038,6 +1028,8 @@
time_t timebase;
int error;
+ mtx_assert(&Giant, MA_NOTOWNED);
+
TSENTER();
td = curthread;
Index: sys/sparc64/pci/psycho.c
===================================================================
--- sys/sparc64/pci/psycho.c
+++ sys/sparc64/pci/psycho.c
@@ -664,7 +664,7 @@
INTVEC(PSYCHO_READ8(sc, intrmap)) != vec ||
intr_vectors[vec].iv_ic != &psycho_ic ||
bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index],
- INTR_TYPE_MISC | INTR_BRIDGE, filt, intr, sc,
+ INTR_TYPE_MISC | INTR_BRIDGE | INTR_MPSAFE, filt, intr, sc,
&sc->sc_ihand[index]) != 0)
panic("%s: failed to set up interrupt %d", __func__, index);
}
Index: sys/sparc64/sbus/sbus.c
===================================================================
--- sys/sparc64/sbus/sbus.c
+++ sys/sparc64/sbus/sbus.c
@@ -411,7 +411,7 @@
INTIGN(vec = rman_get_start(sc->sc_ot_ires)) != sc->sc_ign ||
INTVEC(SYSIO_READ8(sc, SBR_THERM_INT_MAP)) != vec ||
intr_vectors[vec].iv_ic != &sbus_ic ||
- bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_BRIDGE,
+ bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_BRIDGE | INTR_MPSAFE,
NULL, sbus_overtemp, sc, &sc->sc_ot_ihand) != 0)
panic("%s: failed to set up temperature interrupt", __func__);
i = 3;
@@ -421,7 +421,7 @@
INTIGN(vec = rman_get_start(sc->sc_pf_ires)) != sc->sc_ign ||
INTVEC(SYSIO_READ8(sc, SBR_POWER_INT_MAP)) != vec ||
intr_vectors[vec].iv_ic != &sbus_ic ||
- bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_BRIDGE,
+ bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_BRIDGE | INTR_MPSAFE,
NULL, sbus_pwrfail, sc, &sc->sc_pf_ihand) != 0)
panic("%s: failed to set up power fail interrupt", __func__);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 26, 7:18 AM (11 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37275129
Default Alt Text
D14712.id40364.diff (6 KB)
Attached To
Mode
D14712: Remove Giant from init creation and vfs_mountroot.
Attached
Detach File
Event Timeline
Log In to Comment