diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 10:06:39 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 10:06:39 -0800 |
commit | 9cfc86249f32d984339c6d1f8a1fd1326989b3b8 (patch) | |
tree | 56428d319483f54949de8d9d0a5b3f715287ed91 /drivers | |
parent | f42647acc4eab1befa9e290691ed7a40f9a7d3cc (diff) | |
parent | 243797f59b748f679ab88d456fcc4f92236d724b (diff) |
Merge branch 'akpm'
* akpm: (173 commits)
genalloc: use bitmap_find_next_zero_area
ia64: use bitmap_find_next_zero_area
sparc: use bitmap_find_next_zero_area
mlx4: use bitmap_find_next_zero_area
isp1362-hcd: use bitmap_find_next_zero_area
iommu-helper: use bitmap library
bitmap: introduce bitmap_set, bitmap_clear, bitmap_find_next_zero_area
qnx4: use hweight8
qnx4fs: remove remains of the (defunct) write support
resource: constify arg to resource_size() and resource_type()
gru: send cross partition interrupts using the gru
gru: function to generate chipset IPI values
gru: update driver version number
gru: improve GRU TLB dropin statistics
gru: fix GRU interrupt race at deallocate
gru: add hugepage support
gru: fix bug in allocation of kernel contexts
gru: update GRU structures to match latest hardware spec
gru: check for correct GRU chiplet assignment
gru: remove stray local_irq_enable
...
Diffstat (limited to 'drivers')
90 files changed, 5247 insertions, 1306 deletions
diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c index 26a47dc88f6..53c524e7b82 100644 --- a/drivers/char/efirtc.c +++ b/drivers/char/efirtc.c @@ -285,6 +285,7 @@ static const struct file_operations efi_rtc_fops = { .unlocked_ioctl = efi_rtc_ioctl, .open = efi_rtc_open, .release = efi_rtc_close, + .llseek = no_llseek, }; static struct miscdevice efi_rtc_dev= { diff --git a/drivers/char/ipmi/ipmi_kcs_sm.c b/drivers/char/ipmi/ipmi_kcs_sm.c index 80704875794..cf82fedae09 100644 --- a/drivers/char/ipmi/ipmi_kcs_sm.c +++ b/drivers/char/ipmi/ipmi_kcs_sm.c @@ -370,7 +370,7 @@ static enum si_sm_result kcs_event(struct si_sm_data *kcs, long time) return SI_SM_IDLE; case KCS_START_OP: - if (state != KCS_IDLE) { + if (state != KCS_IDLE_STATE) { start_error_recovery(kcs, "State machine not idle at start"); break; diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 44203ff599d..1ae2de7d8b4 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -339,7 +339,7 @@ static struct sysrq_key_op sysrq_term_op = { static void moom_callback(struct work_struct *ignored) { - out_of_memory(node_zonelist(0, GFP_KERNEL), GFP_KERNEL, 0); + out_of_memory(node_zonelist(0, GFP_KERNEL), GFP_KERNEL, 0, NULL); } static DECLARE_WORK(moom_work, moom_callback); diff --git a/drivers/char/vt.c b/drivers/char/vt.c index e43fbc66aef..50faa1fb0f0 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -164,6 +164,9 @@ module_param(default_utf8, int, S_IRUGO | S_IWUSR); int global_cursor_default = -1; module_param(global_cursor_default, int, S_IRUGO | S_IWUSR); +static int cur_default = CUR_DEFAULT; +module_param(cur_default, int, S_IRUGO | S_IWUSR); + /* * ignore_poke: don't unblank the screen when things are typed. This is * mainly for the privacy of braille terminal users. @@ -1636,7 +1639,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear) /* do not do set_leds here because this causes an endless tasklet loop when the keyboard hasn't been initialized yet */ - vc->vc_cursor_type = CUR_DEFAULT; + vc->vc_cursor_type = cur_default; vc->vc_complement_mask = vc->vc_s_complement_mask; default_attr(vc); @@ -1838,7 +1841,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) if (vc->vc_par[0]) vc->vc_cursor_type = vc->vc_par[0] | (vc->vc_par[1] << 8) | (vc->vc_par[2] << 16); else - vc->vc_cursor_type = CUR_DEFAULT; + vc->vc_cursor_type = cur_default; return; } break; diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c index 22db05a67bf..7785d8ffa40 100644 --- a/drivers/edac/i5100_edac.c +++ b/drivers/edac/i5100_edac.c @@ -9,6 +9,11 @@ * Intel 5100X Chipset Memory Controller Hub (MCH) - Datasheet * http://download.intel.com/design/chipsets/datashts/318378.pdf * + * The intel 5100 has two independent channels. EDAC core currently + * can not reflect this configuration so instead the chip-select + * rows for each respective channel are layed out one after another, + * the first half belonging to channel 0, the second half belonging + * to channel 1. */ #include <linux/module.h> #include <linux/init.h> @@ -25,6 +30,8 @@ /* device 16, func 1 */ #define I5100_MC 0x40 /* Memory Control Register */ +#define I5100_MC_SCRBEN_MASK (1 << 7) +#define I5100_MC_SCRBDONE_MASK (1 << 4) #define I5100_MS 0x44 /* Memory Status Register */ #define I5100_SPDDATA 0x48 /* Serial Presence Detect Status Reg */ #define I5100_SPDCMD 0x4c /* Serial Presence Detect Command Reg */ @@ -72,11 +79,21 @@ /* bit field accessors */ +static inline u32 i5100_mc_scrben(u32 mc) +{ + return mc >> 7 & 1; +} + static inline u32 i5100_mc_errdeten(u32 mc) { return mc >> 5 & 1; } +static inline u32 i5100_mc_scrbdone(u32 mc) +{ + return mc >> 4 & 1; +} + static inline u16 i5100_spddata_rdo(u16 a) { return a >> 15 & 1; @@ -265,42 +282,43 @@ static inline u32 i5100_recmemb_ras(u32 a) } /* some generic limits */ -#define I5100_MAX_RANKS_PER_CTLR 6 -#define I5100_MAX_CTLRS 2 +#define I5100_MAX_RANKS_PER_CHAN 6 +#define I5100_CHANNELS 2 #define I5100_MAX_RANKS_PER_DIMM 4 #define I5100_DIMM_ADDR_LINES (6 - 3) /* 64 bits / 8 bits per byte */ -#define I5100_MAX_DIMM_SLOTS_PER_CTLR 4 +#define I5100_MAX_DIMM_SLOTS_PER_CHAN 4 #define I5100_MAX_RANK_INTERLEAVE 4 #define I5100_MAX_DMIRS 5 +#define I5100_SCRUB_REFRESH_RATE (5 * 60 * HZ) struct i5100_priv { /* ranks on each dimm -- 0 maps to not present -- obtained via SPD */ - int dimm_numrank[I5100_MAX_CTLRS][I5100_MAX_DIMM_SLOTS_PER_CTLR]; + int dimm_numrank[I5100_CHANNELS][I5100_MAX_DIMM_SLOTS_PER_CHAN]; /* * mainboard chip select map -- maps i5100 chip selects to * DIMM slot chip selects. In the case of only 4 ranks per - * controller, the mapping is fairly obvious but not unique. - * we map -1 -> NC and assume both controllers use the same + * channel, the mapping is fairly obvious but not unique. + * we map -1 -> NC and assume both channels use the same * map... * */ - int dimm_csmap[I5100_MAX_DIMM_SLOTS_PER_CTLR][I5100_MAX_RANKS_PER_DIMM]; + int dimm_csmap[I5100_MAX_DIMM_SLOTS_PER_CHAN][I5100_MAX_RANKS_PER_DIMM]; /* memory interleave range */ struct { u64 limit; unsigned way[2]; - } mir[I5100_MAX_CTLRS]; + } mir[I5100_CHANNELS]; /* adjusted memory interleave range register */ - unsigned amir[I5100_MAX_CTLRS]; + unsigned amir[I5100_CHANNELS]; /* dimm interleave range */ struct { unsigned rank[I5100_MAX_RANK_INTERLEAVE]; u64 limit; - } dmir[I5100_MAX_CTLRS][I5100_MAX_DMIRS]; + } dmir[I5100_CHANNELS][I5100_MAX_DMIRS]; /* memory technology registers... */ struct { @@ -310,30 +328,33 @@ struct i5100_priv { unsigned numbank; /* 2 or 3 lines */ unsigned numrow; /* 13 .. 16 lines */ unsigned numcol; /* 11 .. 12 lines */ - } mtr[I5100_MAX_CTLRS][I5100_MAX_RANKS_PER_CTLR]; + } mtr[I5100_CHANNELS][I5100_MAX_RANKS_PER_CHAN]; u64 tolm; /* top of low memory in bytes */ - unsigned ranksperctlr; /* number of ranks per controller */ + unsigned ranksperchan; /* number of ranks per channel */ struct pci_dev *mc; /* device 16 func 1 */ struct pci_dev *ch0mm; /* device 21 func 0 */ struct pci_dev *ch1mm; /* device 22 func 0 */ + + struct delayed_work i5100_scrubbing; + int scrub_enable; }; -/* map a rank/ctlr to a slot number on the mainboard */ +/* map a rank/chan to a slot number on the mainboard */ static int i5100_rank_to_slot(const struct mem_ctl_info *mci, - int ctlr, int rank) + int chan, int rank) { const struct i5100_priv *priv = mci->pvt_info; int i; - for (i = 0; i < I5100_MAX_DIMM_SLOTS_PER_CTLR; i++) { + for (i = 0; i < I5100_MAX_DIMM_SLOTS_PER_CHAN; i++) { int j; - const int numrank = priv->dimm_numrank[ctlr][i]; + const int numrank = priv->dimm_numrank[chan][i]; for (j = 0; j < numrank; j++) if (priv->dimm_csmap[i][j] == rank) - return i * 2 + ctlr; + return i * 2 + chan; } return -1; @@ -374,32 +395,32 @@ static const char *i5100_err_msg(unsigned err) return "none"; } -/* convert csrow index into a rank (per controller -- 0..5) */ +/* convert csrow index into a rank (per channel -- 0..5) */ static int i5100_csrow_to_rank(const struct mem_ctl_info *mci, int csrow) { const struct i5100_priv *priv = mci->pvt_info; - return csrow % priv->ranksperctlr; + return csrow % priv->ranksperchan; } -/* convert csrow index into a controller (0..1) */ -static int i5100_csrow_to_cntlr(const struct mem_ctl_info *mci, int csrow) +/* convert csrow index into a channel (0..1) */ +static int i5100_csrow_to_chan(const struct mem_ctl_info *mci, int csrow) { const struct i5100_priv *priv = mci->pvt_info; - return csrow / priv->ranksperctlr; + return csrow / priv->ranksperchan; } static unsigned i5100_rank_to_csrow(const struct mem_ctl_info *mci, - int ctlr, int rank) + int chan, int rank) { const struct i5100_priv *priv = mci->pvt_info; - return ctlr * priv->ranksperctlr + rank; + return chan * priv->ranksperchan + rank; } static void i5100_handle_ce(struct mem_ctl_info *mci, - int ctlr, + int chan, unsigned bank, unsigned rank, unsigned long syndrome, @@ -407,12 +428,12 @@ static void i5100_handle_ce(struct mem_ctl_info *mci, unsigned ras, const char *msg) { - const int csrow = i5100_rank_to_csrow(mci, ctlr, rank); + const int csrow = i5100_rank_to_csrow(mci, chan, rank); printk(KERN_ERR - "CE ctlr %d, bank %u, rank %u, syndrome 0x%lx, " + "CE chan %d, bank %u, rank %u, syndrome 0x%lx, " "cas %u, ras %u, csrow %u, label \"%s\": %s\n", - ctlr, bank, rank, syndrome, cas, ras, + chan, bank, rank, syndrome, cas, ras, csrow, mci->csrows[csrow].channels[0].label, msg); mci->ce_count++; @@ -421,7 +442,7 @@ static void i5100_handle_ce(struct mem_ctl_info *mci, } static void i5100_handle_ue(struct mem_ctl_info *mci, - int ctlr, + int chan, unsigned bank, unsigned rank, unsigned long syndrome, @@ -429,23 +450,23 @@ static void i5100_handle_ue(struct mem_ctl_info *mci, unsigned ras, const char *msg) { - const int csrow = i5100_rank_to_csrow(mci, ctlr, rank); + const int csrow = i5100_rank_to_csrow(mci, chan, rank); printk(KERN_ERR - "UE ctlr %d, bank %u, rank %u, syndrome 0x%lx, " + "UE chan %d, bank %u, rank %u, syndrome 0x%lx, " "cas %u, ras %u, csrow %u, label \"%s\": %s\n", - ctlr, bank, rank, syndrome, cas, ras, + chan, bank, rank, syndrome, cas, ras, csrow, mci->csrows[csrow].channels[0].label, msg); mci->ue_count++; mci->csrows[csrow].ue_count++; } -static void i5100_read_log(struct mem_ctl_info *mci, int ctlr, +static void i5100_read_log(struct mem_ctl_info *mci, int chan, u32 ferr, u32 nerr) { struct i5100_priv *priv = mci->pvt_info; - struct pci_dev *pdev = (ctlr) ? priv->ch1mm : priv->ch0mm; + struct pci_dev *pdev = (chan) ? priv->ch1mm : priv->ch0mm; u32 dw; u32 dw2; unsigned syndrome = 0; @@ -484,7 +505,7 @@ static void i5100_read_log(struct mem_ctl_info *mci, int ctlr, else msg = i5100_err_msg(nerr); - i5100_handle_ce(mci, ctlr, bank, rank, syndrome, cas, ras, msg); + i5100_handle_ce(mci, chan, bank, rank, syndrome, cas, ras, msg); } if (i5100_validlog_nrecmemvalid(dw)) { @@ -506,7 +527,7 @@ static void i5100_read_log(struct mem_ctl_info *mci, int ctlr, else msg = i5100_err_msg(nerr); - i5100_handle_ue(mci, ctlr, bank, rank, syndrome, cas, ras, msg); + i5100_handle_ue(mci, chan, bank, rank, syndrome, cas, ras, msg); } pci_write_config_dword(pdev, I5100_VALIDLOG, dw); @@ -534,6 +555,80 @@ static void i5100_check_error(struct mem_ctl_info *mci) } } +/* The i5100 chipset will scrub the entire memory once, then + * set a done bit. Continuous scrubbing is achieved by enqueing + * delayed work to a workqueue, checking every few minutes if + * the scrubbing has completed and if so reinitiating it. + */ + +static void i5100_refresh_scrubbing(struct work_struct *work) +{ + struct delayed_work *i5100_scrubbing = container_of(work, + struct delayed_work, + work); + struct i5100_priv *priv = container_of(i5100_scrubbing, + struct i5100_priv, + i5100_scrubbing); + u32 dw; + + pci_read_config_dword(priv->mc, I5100_MC, &dw); + + if (priv->scrub_enable) { + + pci_read_config_dword(priv->mc, I5100_MC, &dw); + + if (i5100_mc_scrbdone(dw)) { + dw |= I5100_MC_SCRBEN_MASK; + pci_write_config_dword(priv->mc, I5100_MC, dw); + pci_read_config_dword(priv->m |