~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to init/calibrate.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
                pre_start = 0;
67
67
                read_current_timer(&start);
68
68
                start_jiffies = jiffies;
69
 
                while (jiffies <= (start_jiffies + 1)) {
 
69
                while (time_before_eq(jiffies, start_jiffies + 1)) {
70
70
                        pre_start = start;
71
71
                        read_current_timer(&start);
72
72
                }
74
74
 
75
75
                pre_end = 0;
76
76
                end = post_start;
77
 
                while (jiffies <=
78
 
                       (start_jiffies + 1 + DELAY_CALIBRATION_TICKS)) {
 
77
                while (time_before_eq(jiffies, start_jiffies + 1 +
 
78
                                               DELAY_CALIBRATION_TICKS)) {
79
79
                        pre_end = end;
80
80
                        read_current_timer(&end);
81
81
                }
123
123
{
124
124
        unsigned long ticks, loopbit;
125
125
        int lps_precision = LPS_PREC;
 
126
        static bool printed;
126
127
 
127
128
        if (preset_lpj) {
128
129
                loops_per_jiffy = preset_lpj;
129
 
                printk(KERN_INFO
130
 
                        "Calibrating delay loop (skipped) preset value.. ");
131
 
        } else if ((smp_processor_id() == 0) && lpj_fine) {
 
130
                if (!printed)
 
131
                        pr_info("Calibrating delay loop (skipped) "
 
132
                                "preset value.. ");
 
133
        } else if ((!printed) && lpj_fine) {
132
134
                loops_per_jiffy = lpj_fine;
133
 
                printk(KERN_INFO
134
 
                        "Calibrating delay loop (skipped), "
 
135
                pr_info("Calibrating delay loop (skipped), "
135
136
                        "value calculated using timer frequency.. ");
136
137
        } else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
137
 
                printk(KERN_INFO
138
 
                        "Calibrating delay using timer specific routine.. ");
 
138
                if (!printed)
 
139
                        pr_info("Calibrating delay using timer "
 
140
                                "specific routine.. ");
139
141
        } else {
140
142
                loops_per_jiffy = (1<<12);
141
143
 
142
 
                printk(KERN_INFO "Calibrating delay loop... ");
 
144
                if (!printed)
 
145
                        pr_info("Calibrating delay loop... ");
143
146
                while ((loops_per_jiffy <<= 1) != 0) {
144
147
                        /* wait for "start of" clock tick */
145
148
                        ticks = jiffies;
170
173
                                loops_per_jiffy &= ~loopbit;
171
174
                }
172
175
        }
173
 
        printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
 
176
        if (!printed)
 
177
                pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
174
178
                        loops_per_jiffy/(500000/HZ),
175
179
                        (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
 
180
 
 
181
        printed = true;
176
182
}