diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/intel-agp.h | 7 | ||||
-rw-r--r-- | drivers/char/apm-emulation.c | 2 | ||||
-rw-r--r-- | drivers/char/hpet.c | 25 | ||||
-rw-r--r-- | drivers/char/random.c | 15 |
4 files changed, 43 insertions, 6 deletions
diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h index 999803ce10dc..5da67f165afa 100644 --- a/drivers/char/agp/intel-agp.h +++ b/drivers/char/agp/intel-agp.h | |||
@@ -90,9 +90,10 @@ | |||
90 | #define G4x_GMCH_SIZE_MASK (0xf << 8) | 90 | #define G4x_GMCH_SIZE_MASK (0xf << 8) |
91 | #define G4x_GMCH_SIZE_1M (0x1 << 8) | 91 | #define G4x_GMCH_SIZE_1M (0x1 << 8) |
92 | #define G4x_GMCH_SIZE_2M (0x3 << 8) | 92 | #define G4x_GMCH_SIZE_2M (0x3 << 8) |
93 | #define G4x_GMCH_SIZE_VT_1M (0x9 << 8) | 93 | #define G4x_GMCH_SIZE_VT_EN (0x8 << 8) |
94 | #define G4x_GMCH_SIZE_VT_1_5M (0xa << 8) | 94 | #define G4x_GMCH_SIZE_VT_1M (G4x_GMCH_SIZE_1M | G4x_GMCH_SIZE_VT_EN) |
95 | #define G4x_GMCH_SIZE_VT_2M (0xc << 8) | 95 | #define G4x_GMCH_SIZE_VT_1_5M ((0x2 << 8) | G4x_GMCH_SIZE_VT_EN) |
96 | #define G4x_GMCH_SIZE_VT_2M (G4x_GMCH_SIZE_2M | G4x_GMCH_SIZE_VT_EN) | ||
96 | 97 | ||
97 | #define GFX_FLSH_CNTL 0x2170 /* 915+ */ | 98 | #define GFX_FLSH_CNTL 0x2170 /* 915+ */ |
98 | 99 | ||
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c index 548708c4b2b8..a7346ab97a3c 100644 --- a/drivers/char/apm-emulation.c +++ b/drivers/char/apm-emulation.c | |||
@@ -606,7 +606,7 @@ static int apm_suspend_notifier(struct notifier_block *nb, | |||
606 | return NOTIFY_OK; | 606 | return NOTIFY_OK; |
607 | 607 | ||
608 | /* interrupted by signal */ | 608 | /* interrupted by signal */ |
609 | return NOTIFY_BAD; | 609 | return notifier_from_errno(err); |
610 | 610 | ||
611 | case PM_POST_SUSPEND: | 611 | case PM_POST_SUSPEND: |
612 | /* | 612 | /* |
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 055765147dc2..0833896cf6f2 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -163,11 +163,32 @@ static irqreturn_t hpet_interrupt(int irq, void *data) | |||
163 | * This has the effect of treating non-periodic like periodic. | 163 | * This has the effect of treating non-periodic like periodic. |
164 | */ | 164 | */ |
165 | if ((devp->hd_flags & (HPET_IE | HPET_PERIODIC)) == HPET_IE) { | 165 | if ((devp->hd_flags & (HPET_IE | HPET_PERIODIC)) == HPET_IE) { |
166 | unsigned long m, t; | 166 | unsigned long m, t, mc, base, k; |
167 | struct hpet __iomem *hpet = devp->hd_hpet; | ||
168 | struct hpets *hpetp = devp->hd_hpets; | ||
167 | 169 | ||
168 | t = devp->hd_ireqfreq; | 170 | t = devp->hd_ireqfreq; |
169 | m = read_counter(&devp->hd_timer->hpet_compare); | 171 | m = read_counter(&devp->hd_timer->hpet_compare); |
170 | write_counter(t + m, &devp->hd_timer->hpet_compare); | 172 | mc = read_counter(&hpet->hpet_mc); |
173 | /* The time for the next interrupt would logically be t + m, | ||
174 | * however, if we are very unlucky and the interrupt is delayed | ||
175 | * for longer than t then we will completely miss the next | ||
176 | * interrupt if we set t + m and an application will hang. | ||
177 | * Therefore we need to make a more complex computation assuming | ||
178 | * that there exists a k for which the following is true: | ||
179 | * k * t + base < mc + delta | ||
180 | * (k + 1) * t + base > mc + delta | ||
181 | * where t is the interval in hpet ticks for the given freq, | ||
182 | * base is the theoretical start value 0 < base < t, | ||
183 | * mc is the main counter value at the time of the interrupt, | ||
184 | * delta is the time it takes to write the a value to the | ||
185 | * comparator. | ||
186 | * k may then be computed as (mc - base + delta) / t . | ||
187 | */ | ||
188 | base = mc % t; | ||
189 | k = (mc - base + hpetp->hp_delta) / t; | ||
190 | write_counter(t * (k + 1) + base, | ||
191 | &devp->hd_timer->hpet_compare); | ||
171 | } | 192 | } |
172 | 193 | ||
173 | if (devp->hd_flags & HPET_SHARED_IRQ) | 194 | if (devp->hd_flags & HPET_SHARED_IRQ) |
diff --git a/drivers/char/random.c b/drivers/char/random.c index d4ddeba56682..729281961f22 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1523,6 +1523,21 @@ __u32 secure_ip_id(__be32 daddr) | |||
1523 | return half_md4_transform(hash, keyptr->secret); | 1523 | return half_md4_transform(hash, keyptr->secret); |
1524 | } | 1524 | } |
1525 | 1525 | ||
1526 | __u32 secure_ipv6_id(const __be32 daddr[4]) | ||
1527 | { | ||
1528 | const struct keydata *keyptr; | ||
1529 | __u32 hash[4]; | ||
1530 | |||
1531 | keyptr = get_keyptr(); | ||
1532 | |||
1533 | hash[0] = (__force __u32)daddr[0]; | ||
1534 | hash[1] = (__force __u32)daddr[1]; | ||
1535 | hash[2] = (__force __u32)daddr[2]; | ||
1536 | hash[3] = (__force __u32)daddr[3]; | ||
1537 | |||
1538 | return half_md4_transform(hash, keyptr->secret); | ||
1539 | } | ||
1540 | |||
1526 | #ifdef CONFIG_INET | 1541 | #ifdef CONFIG_INET |
1527 | 1542 | ||
1528 | __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, | 1543 | __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, |