Magellan Linux

Contents of /trunk/kernel26-alx/patches-2.6.17-r7/0107-2.6.17.14-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 199 - (show annotations) (download)
Fri May 18 11:04:36 2007 UTC (17 years, 5 months ago) by niro
File size: 15031 byte(s)
-import

1 diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
2 index e55b5c6..2031eda 100644
3 --- a/arch/sparc64/kernel/time.c
4 +++ b/arch/sparc64/kernel/time.c
5 @@ -1105,7 +1105,7 @@ static struct time_interpolator sparc64_
6 };
7
8 /* The quotient formula is taken from the IA64 port. */
9 -#define SPARC64_NSEC_PER_CYC_SHIFT 30UL
10 +#define SPARC64_NSEC_PER_CYC_SHIFT 10UL
11 void __init time_init(void)
12 {
13 unsigned long clock = sparc64_init_timers();
14 diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
15 index 1539a83..562e10a 100644
16 --- a/arch/sparc64/mm/init.c
17 +++ b/arch/sparc64/mm/init.c
18 @@ -902,8 +902,7 @@ #ifdef CONFIG_BLK_DEV_INITRD
19 if (sparc_ramdisk_image || sparc_ramdisk_image64) {
20 unsigned long ramdisk_image = sparc_ramdisk_image ?
21 sparc_ramdisk_image : sparc_ramdisk_image64;
22 - if (ramdisk_image >= (unsigned long)_end - 2 * PAGE_SIZE)
23 - ramdisk_image -= KERNBASE;
24 + ramdisk_image -= KERNBASE;
25 initrd_start = ramdisk_image + phys_base;
26 initrd_end = initrd_start + sparc_ramdisk_size;
27 if (initrd_end > end_of_phys_memory) {
28 diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
29 index b72dde7..10467da 100644
30 --- a/drivers/ide/ide-iops.c
31 +++ b/drivers/ide/ide-iops.c
32 @@ -597,6 +597,10 @@ u8 eighty_ninty_three (ide_drive_t *driv
33 {
34 if(HWIF(drive)->udma_four == 0)
35 return 0;
36 +
37 + /* Check for SATA but only if we are ATA5 or higher */
38 + if (drive->id->hw_config == 0 && (drive->id->major_rev_num & 0x7FE0))
39 + return 1;
40 if (!(drive->id->hw_config & 0x6000))
41 return 0;
42 #ifndef CONFIG_IDEDMA_IVB
43 diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
44 index 2f0d288..54b696c 100644
45 --- a/drivers/input/mouse/logips2pp.c
46 +++ b/drivers/input/mouse/logips2pp.c
47 @@ -238,8 +238,7 @@ static struct ps2pp_info *get_model_info
48 { 100, PS2PP_KIND_MX, /* MX510 */
49 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
50 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
51 - { 111, PS2PP_KIND_MX, /* MX300 */
52 - PS2PP_WHEEL | PS2PP_EXTRA_BTN | PS2PP_TASK_BTN },
53 + { 111, PS2PP_KIND_MX, PS2PP_WHEEL | PS2PP_SIDE_BTN }, /* MX300 reports task button as side */
54 { 112, PS2PP_KIND_MX, /* MX500 */
55 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
56 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
57 diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
58 index 2f0f358..e8e21b9 100644
59 --- a/drivers/media/dvb/dvb-core/dvb_net.c
60 +++ b/drivers/media/dvb/dvb-core/dvb_net.c
61 @@ -492,7 +492,8 @@ #endif
62 } else
63 priv->ule_dbit = 0;
64
65 - if (priv->ule_sndu_len > 32763) {
66 + if (priv->ule_sndu_len > 32763 ||
67 + priv->ule_sndu_len < ((priv->ule_dbit) ? 4 : 4 + ETH_ALEN)) {
68 printk(KERN_WARNING "%lu: Invalid ULE SNDU length %u. "
69 "Resyncing.\n", priv->ts_count, priv->ule_sndu_len);
70 priv->ule_sndu_len = 0;
71 diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c
72 index 691dc84..afb08ff 100644
73 --- a/drivers/media/dvb/frontends/cx24123.c
74 +++ b/drivers/media/dvb/frontends/cx24123.c
75 @@ -579,8 +579,8 @@ static int cx24123_pll_calculate(struct
76 ndiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) / 32) & 0x1ff;
77 adiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) % 32) & 0x1f;
78
79 - if (adiv == 0)
80 - ndiv++;
81 + if (adiv == 0 && ndiv > 0)
82 + ndiv--;
83
84 /* control bits 11, refdiv 11, charge pump polarity 1, charge pump current, ndiv, adiv */
85 state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (pump << 14) | (ndiv << 5) | adiv;
86 diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
87 index b806999..dd23219 100644
88 --- a/drivers/media/video/msp3400-driver.c
89 +++ b/drivers/media/video/msp3400-driver.c
90 @@ -942,6 +942,8 @@ static int msp_attach(struct i2c_adapter
91 state->has_virtual_dolby_surround = msp_revision == 'G' && msp_prod_lo == 1;
92 /* Has Virtual Dolby Surround & Dolby Pro Logic: only in msp34x2 */
93 state->has_dolby_pro_logic = msp_revision == 'G' && msp_prod_lo == 2;
94 + /* The msp343xG supports BTSC only and cannot do Automatic Standard Detection. */
95 + state->force_btsc = msp_family == 3 && msp_revision == 'G' && msp_prod_hi == 3;
96
97 state->opmode = opmode;
98 if (state->opmode == OPMODE_AUTO) {
99 diff --git a/drivers/media/video/msp3400-driver.h b/drivers/media/video/msp3400-driver.h
100 index 4e45104..6359d74 100644
101 --- a/drivers/media/video/msp3400-driver.h
102 +++ b/drivers/media/video/msp3400-driver.h
103 @@ -64,6 +64,7 @@ struct msp_state {
104 u8 has_sound_processing;
105 u8 has_virtual_dolby_surround;
106 u8 has_dolby_pro_logic;
107 + u8 force_btsc;
108
109 int radio;
110 int opmode;
111 diff --git a/drivers/media/video/msp3400-kthreads.c b/drivers/media/video/msp3400-kthreads.c
112 index 633a102..a0ac592 100644
113 --- a/drivers/media/video/msp3400-kthreads.c
114 +++ b/drivers/media/video/msp3400-kthreads.c
115 @@ -949,11 +949,12 @@ int msp34xxg_thread(void *data)
116
117 /* setup the chip*/
118 msp34xxg_reset(client);
119 - state->std = state->radio ? 0x40 : msp_standard;
120 - if (state->std != 1)
121 - goto unmute;
122 + state->std = state->radio ? 0x40 :
123 + (state->force_btsc && msp_standard == 1) ? 32 : msp_standard;
124 /* start autodetect */
125 msp_write_dem(client, 0x20, state->std);
126 + if (state->std != 1)
127 + goto unmute;
128
129 /* watch autodetect */
130 v4l_dbg(1, msp_debug, client, "started autodetect, waiting for result\n");
131 diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c
132 index 587458b..96049e2 100644
133 --- a/drivers/mmc/mmc_block.c
134 +++ b/drivers/mmc/mmc_block.c
135 @@ -325,52 +325,11 @@ static struct mmc_blk_data *mmc_blk_allo
136 md->read_only = mmc_blk_readonly(card);
137
138 /*
139 - * Figure out a workable block size. MMC cards have:
140 - * - two block sizes, one for read and one for write.
141 - * - may support partial reads and/or writes
142 - * (allows block sizes smaller than specified)
143 + * Both SD and MMC specifications state (although a bit
144 + * unclearly in the MMC case) that a block size of 512
145 + * bytes must always be supported by the card.
146 */
147 - md->block_bits = card->csd.read_blkbits;
148 - if (card->csd.write_blkbits != card->csd.read_blkbits) {
149 - if (card->csd.write_blkbits < card->csd.read_blkbits &&
150 - card->csd.read_partial) {
151 - /*
152 - * write block size is smaller than read block
153 - * size, but we support partial reads, so choose
154 - * the smaller write block size.
155 - */
156 - md->block_bits = card->csd.write_blkbits;
157 - } else if (card->csd.write_blkbits > card->csd.read_blkbits &&
158 - card->csd.write_partial) {
159 - /*
160 - * read block size is smaller than write block
161 - * size, but we support partial writes. Use read
162 - * block size.
163 - */
164 - } else {
165 - /*
166 - * We don't support this configuration for writes.
167 - */
168 - printk(KERN_ERR "%s: unable to select block size for "
169 - "writing (rb%u wb%u rp%u wp%u)\n",
170 - mmc_card_id(card),
171 - 1 << card->csd.read_blkbits,
172 - 1 << card->csd.write_blkbits,
173 - card->csd.read_partial,
174 - card->csd.write_partial);
175 - md->read_only = 1;
176 - }
177 - }
178 -
179 - /*
180 - * Refuse to allow block sizes smaller than 512 bytes.
181 - */
182 - if (md->block_bits < 9) {
183 - printk(KERN_ERR "%s: unable to support block size %u\n",
184 - mmc_card_id(card), 1 << md->block_bits);
185 - ret = -EINVAL;
186 - goto err_kfree;
187 - }
188 + md->block_bits = 9;
189
190 md->disk = alloc_disk(1 << MMC_SHIFT);
191 if (md->disk == NULL) {
192 diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
193 index 71f4505..aeda7ad 100644
194 --- a/drivers/net/pcmcia/xirc2ps_cs.c
195 +++ b/drivers/net/pcmcia/xirc2ps_cs.c
196 @@ -345,6 +345,7 @@ typedef struct local_info_t {
197 void __iomem *dingo_ccr; /* only used for CEM56 cards */
198 unsigned last_ptr_value; /* last packets transmitted value */
199 const char *manf_str;
200 + struct work_struct tx_timeout_task;
201 } local_info_t;
202
203 /****************
204 @@ -352,6 +353,7 @@ typedef struct local_info_t {
205 */
206 static int do_start_xmit(struct sk_buff *skb, struct net_device *dev);
207 static void do_tx_timeout(struct net_device *dev);
208 +static void xirc2ps_tx_timeout_task(void *data);
209 static struct net_device_stats *do_get_stats(struct net_device *dev);
210 static void set_addresses(struct net_device *dev);
211 static void set_multicast_list(struct net_device *dev);
212 @@ -589,6 +591,7 @@ xirc2ps_probe(struct pcmcia_device *link
213 #ifdef HAVE_TX_TIMEOUT
214 dev->tx_timeout = do_tx_timeout;
215 dev->watchdog_timeo = TX_TIMEOUT;
216 + INIT_WORK(&local->tx_timeout_task, xirc2ps_tx_timeout_task, dev);
217 #endif
218
219 return xirc2ps_config(link);
220 @@ -1341,17 +1344,24 @@ xirc2ps_interrupt(int irq, void *dev_id,
221 /*====================================================================*/
222
223 static void
224 -do_tx_timeout(struct net_device *dev)
225 +xirc2ps_tx_timeout_task(void *data)
226 {
227 - local_info_t *lp = netdev_priv(dev);
228 - printk(KERN_NOTICE "%s: transmit timed out\n", dev->name);
229 - lp->stats.tx_errors++;
230 + struct net_device *dev = data;
231 /* reset the card */
232 do_reset(dev,1);
233 dev->trans_start = jiffies;
234 netif_wake_queue(dev);
235 }
236
237 +static void
238 +do_tx_timeout(struct net_device *dev)
239 +{
240 + local_info_t *lp = netdev_priv(dev);
241 + lp->stats.tx_errors++;
242 + printk(KERN_NOTICE "%s: transmit timed out\n", dev->name);
243 + schedule_work(&lp->tx_timeout_task);
244 +}
245 +
246 static int
247 do_start_xmit(struct sk_buff *skb, struct net_device *dev)
248 {
249 diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
250 index 6e3786f..c19ffa6 100644
251 --- a/drivers/pci/quirks.c
252 +++ b/drivers/pci/quirks.c
253 @@ -390,6 +390,7 @@ static void __devinit quirk_piix4_acpi(s
254 piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20);
255 }
256 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi );
257 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3, quirk_piix4_acpi );
258
259 /*
260 * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
261 diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
262 index b4f8fb1..2dcfc1b 100644
263 --- a/drivers/scsi/ahci.c
264 +++ b/drivers/scsi/ahci.c
265 @@ -548,6 +548,12 @@ static int ahci_softreset(struct ata_por
266
267 DPRINTK("ENTER\n");
268
269 + if (!sata_dev_present(ap)) {
270 + DPRINTK("PHY reports no device\n");
271 + *class = ATA_DEV_NONE;
272 + return 0;
273 + }
274 +
275 /* prepare for SRST (AHCI-1.1 10.4.1) */
276 rc = ahci_stop_engine(ap);
277 if (rc) {
278 diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
279 index 21b8bf4..f9be16e 100644
280 --- a/fs/ext3/inode.c
281 +++ b/fs/ext3/inode.c
282 @@ -926,7 +926,7 @@ int ext3_get_blocks_handle(handle_t *han
283 set_buffer_new(bh_result);
284 got_it:
285 map_bh(bh_result, inode->i_sb, le32_to_cpu(chain[depth-1].key));
286 - if (blocks_to_boundary == 0)
287 + if (count > blocks_to_boundary)
288 set_buffer_boundary(bh_result);
289 err = count;
290 /* Clean up and exit */
291 diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c
292 index a570e5c..ef9c953 100644
293 --- a/fs/lockd/svcsubs.c
294 +++ b/fs/lockd/svcsubs.c
295 @@ -238,19 +238,22 @@ static int
296 nlm_traverse_files(struct nlm_host *host, int action)
297 {
298 struct nlm_file *file, **fp;
299 - int i;
300 + int i, ret = 0;
301
302 mutex_lock(&nlm_file_mutex);
303 for (i = 0; i < FILE_NRHASH; i++) {
304 fp = nlm_files + i;
305 while ((file = *fp) != NULL) {
306 + file->f_count++;
307 + mutex_unlock(&nlm_file_mutex);
308 +
309 /* Traverse locks, blocks and shares of this file
310 * and update file->f_locks count */
311 - if (nlm_inspect_file(host, file, action)) {
312 - mutex_unlock(&nlm_file_mutex);
313 - return 1;
314 - }
315 + if (nlm_inspect_file(host, file, action))
316 + ret = 1;
317
318 + mutex_lock(&nlm_file_mutex);
319 + file->f_count--;
320 /* No more references to this file. Let go of it. */
321 if (!file->f_blocks && !file->f_locks
322 && !file->f_shares && !file->f_count) {
323 @@ -263,7 +266,7 @@ nlm_traverse_files(struct nlm_host *host
324 }
325 }
326 mutex_unlock(&nlm_file_mutex);
327 - return 0;
328 + return ret;
329 }
330
331 /*
332 diff --git a/fs/nfs/file.c b/fs/nfs/file.c
333 index fade02c..801cc0f 100644
334 --- a/fs/nfs/file.c
335 +++ b/fs/nfs/file.c
336 @@ -325,7 +325,13 @@ static void nfs_invalidate_page(struct p
337
338 static int nfs_release_page(struct page *page, gfp_t gfp)
339 {
340 - return !nfs_wb_page(page->mapping->host, page);
341 + if (gfp & __GFP_FS)
342 + return !nfs_wb_page(page->mapping->host, page);
343 + else
344 + /*
345 + * Avoid deadlock on nfs_wait_on_request().
346 + */
347 + return 0;
348 }
349
350 struct address_space_operations nfs_file_aops = {
351 diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
352 index d86c0db..e790ba5 100644
353 --- a/fs/nfs/nfs4proc.c
354 +++ b/fs/nfs/nfs4proc.c
355 @@ -185,15 +185,15 @@ static void renew_lease(const struct nfs
356 spin_unlock(&clp->cl_lock);
357 }
358
359 -static void update_changeattr(struct inode *inode, struct nfs4_change_info *cinfo)
360 +static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo)
361 {
362 - struct nfs_inode *nfsi = NFS_I(inode);
363 + struct nfs_inode *nfsi = NFS_I(dir);
364
365 - spin_lock(&inode->i_lock);
366 - nfsi->cache_validity |= NFS_INO_INVALID_ATTR;
367 + spin_lock(&dir->i_lock);
368 + nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA;
369 if (cinfo->before == nfsi->change_attr && cinfo->atomic)
370 nfsi->change_attr = cinfo->after;
371 - spin_unlock(&inode->i_lock);
372 + spin_unlock(&dir->i_lock);
373 }
374
375 struct nfs4_opendata {
376 diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
377 index cf37866..5bb3e17 100644
378 --- a/fs/sysfs/file.c
379 +++ b/fs/sysfs/file.c
380 @@ -483,11 +483,6 @@ int sysfs_update_file(struct kobject * k
381 (victim->d_parent->d_inode == dir->d_inode)) {
382 victim->d_inode->i_mtime = CURRENT_TIME;
383 fsnotify_modify(victim);
384 -
385 - /**
386 - * Drop reference from initial sysfs_get_dentry().
387 - */
388 - dput(victim);
389 res = 0;
390 } else
391 d_drop(victim);
392 diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
393 index c71227d..1d81e7d 100644
394 --- a/include/linux/nfs_fs.h
395 +++ b/include/linux/nfs_fs.h
396 @@ -234,8 +234,12 @@ static inline int nfs_caches_unstable(st
397
398 static inline void nfs_mark_for_revalidate(struct inode *inode)
399 {
400 + struct nfs_inode *nfsi = NFS_I(inode);
401 +
402 spin_lock(&inode->i_lock);
403 - NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS;
404 + nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS;
405 + if (S_ISDIR(inode->i_mode))
406 + nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA;
407 spin_unlock(&inode->i_lock);
408 }
409
410 diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
411 index e8bbe81..e615957 100644
412 --- a/include/linux/sunrpc/xprt.h
413 +++ b/include/linux/sunrpc/xprt.h
414 @@ -37,7 +37,7 @@ extern unsigned int xprt_max_resvport;
415
416 #define RPC_MIN_RESVPORT (1U)
417 #define RPC_MAX_RESVPORT (65535U)
418 -#define RPC_DEF_MIN_RESVPORT (650U)
419 +#define RPC_DEF_MIN_RESVPORT (665U)
420 #define RPC_DEF_MAX_RESVPORT (1023U)
421
422 /*
423 diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
424 index dfb300b..0f42544 100644
425 --- a/net/sched/cls_basic.c
426 +++ b/net/sched/cls_basic.c
427 @@ -197,7 +197,7 @@ static int basic_change(struct tcf_proto
428 if (handle)
429 f->handle = handle;
430 else {
431 - int i = 0x80000000;
432 + unsigned int i = 0x80000000;
433 do {
434 if (++head->hgenerator == 0x7FFFFFFF)
435 head->hgenerator = 1;