aboutsummaryrefslogtreecommitdiffstats
path: root/fs/mpage.c
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2008-11-11 04:17:45 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-11-19 17:12:29 -0500
commit1df8fb3d5f078f9cab901b6106ef2c9b74eef7df (patch)
tree48941e9ff7997acb1af25ff2a546a921b383f06f /fs/mpage.c
parent7f0f598a0069d1ab072375965a4b69137233169c (diff)
PCI: Fix disable IRQ 0 in pci_reset_function()
Before initialization, dev->irq may be zero. Make sure we don't disable it at reset time in that case. Reviewed-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'fs/mpage.c')
0 files changed, 0 insertions, 0 deletions
href='#n92'>92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
/*
 *  This file was based upon code in Powertweak Linux (http://powertweak.sf.net)
 *  (C) 2000-2003  Dave Jones, Arjan van de Ven, Janne Pänkälä,
 *                 Dominik Brodowski.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 *  BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous*
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/cpufreq.h>
#include <linux/ioport.h>
#include <linux/timex.h>
#include <linux/io.h>

#include <asm/cpu_device_id.h>
#include <asm/msr.h>

#define POWERNOW_IOPORT 0xfff0          /* it doesn't matter where, as long
					   as it is unused */

static unsigned int                     busfreq;   /* FSB, in 10 kHz */
static unsigned int                     max_multiplier;

static unsigned int			param_busfreq = 0;
static unsigned int			param_max_multiplier = 0;

module_param_named(max_multiplier, param_max_multiplier, uint, S_IRUGO);
MODULE_PARM_DESC(max_multiplier, "Maximum multiplier (allowed values: 20 30 35 40 45 50 55 60)");

module_param_named(bus_frequency, param_busfreq, uint, S_IRUGO);
MODULE_PARM_DESC(bus_frequency, "Bus frequency in kHz");

/* Clock ratio multiplied by 10 - see table 27 in AMD#23446 */
static struct cpufreq_frequency_table clock_ratio[] = {
	{0, 60,  /* 110 -> 6.0x */ 0},
	{0, 55,  /* 011 -> 5.5x */ 0},
	{0, 50,  /* 001 -> 5.0x */ 0},
	{0, 45,  /* 000 -> 4.5x */ 0},
	{0, 40,  /* 010 -> 4.0x */ 0},
	{0, 35,  /* 111 -> 3.5x */ 0},
	{0, 30,  /* 101 -> 3.0x */ 0},
	{0, 20,  /* 100 -> 2.0x */ 0},
	{0, 0, CPUFREQ_TABLE_END}
};

static const u8 index_to_register[8] = { 6, 3, 1, 0, 2, 7, 5, 4 };
static const u8 register_to_index[8] = { 3, 2, 4, 1, 7, 6, 0, 5 };

static const struct {
	unsigned freq;
	unsigned mult;
} usual_frequency_table[] = {