kern_cpu.c (246e7a2b6494cd991b08ac669ed761ecea0cc98c) kern_cpu.c (fdce57a04219d7a36c6646950fde6c8bcd97c044)
1/*-
2 * Copyright (c) 2004-2007 Nate Lawson (SDG)
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 245 unchanged lines hidden (view full) ---

254 if (error != 0) {
255 EVENTHANDLER_INVOKE(cpufreq_post_change, level, error);
256 return (error);
257 }
258
259 CF_MTX_LOCK(&sc->lock);
260
261#ifdef SMP
1/*-
2 * Copyright (c) 2004-2007 Nate Lawson (SDG)
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 245 unchanged lines hidden (view full) ---

254 if (error != 0) {
255 EVENTHANDLER_INVOKE(cpufreq_post_change, level, error);
256 return (error);
257 }
258
259 CF_MTX_LOCK(&sc->lock);
260
261#ifdef SMP
262#ifdef EARLY_AP_STARTUP
263 MPASS(mp_ncpus == 1 || smp_started);
264#else
262 /*
263 * If still booting and secondary CPUs not started yet, don't allow
264 * changing the frequency until they're online. This is because we
265 * can't switch to them using sched_bind() and thus we'd only be
266 * switching the main CPU. XXXTODO: Need to think more about how to
267 * handle having different CPUs at different frequencies.
268 */
269 if (mp_ncpus > 1 && !smp_started) {
270 device_printf(dev, "rejecting change, SMP not started yet\n");
271 error = ENXIO;
272 goto out;
273 }
265 /*
266 * If still booting and secondary CPUs not started yet, don't allow
267 * changing the frequency until they're online. This is because we
268 * can't switch to them using sched_bind() and thus we'd only be
269 * switching the main CPU. XXXTODO: Need to think more about how to
270 * handle having different CPUs at different frequencies.
271 */
272 if (mp_ncpus > 1 && !smp_started) {
273 device_printf(dev, "rejecting change, SMP not started yet\n");
274 error = ENXIO;
275 goto out;
276 }
277#endif
274#endif /* SMP */
275
276 /*
277 * If the requested level has a lower priority, don't allow
278 * the new level right now.
279 */
280 if (priority < sc->curr_priority) {
281 CF_DEBUG("ignoring, curr prio %d less than %d\n", priority,

--- 782 unchanged lines hidden ---
278#endif /* SMP */
279
280 /*
281 * If the requested level has a lower priority, don't allow
282 * the new level right now.
283 */
284 if (priority < sc->curr_priority) {
285 CF_DEBUG("ignoring, curr prio %d less than %d\n", priority,

--- 782 unchanged lines hidden ---