diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-20 00:47:49 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-20 00:47:49 -0700 |
| commit | 8f421acbbdc3daba1682bdf7b99083f4725ce5d3 (patch) | |
| tree | 28d8e5910bd466ed487654d5e62269b8446a80bd /drivers | |
| parent | 2d0ed1066cf5dd005c518be917649ca3f3b5c961 (diff) | |
| parent | b009a1c6a6c0273f60d96eca2561bc79da3b6614 (diff) | |
Merge home.transmeta.com:/home/torvalds/v2.5/akpm
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/block/DAC960.c | 3 | ||||
| -rw-r--r-- | drivers/block/DAC960.h | 6 | ||||
| -rw-r--r-- | drivers/block/cciss.c | 9 | ||||
| -rw-r--r-- | drivers/block/genhd.c | 105 | ||||
| -rw-r--r-- | drivers/block/ioctl.c | 11 | ||||
| -rw-r--r-- | drivers/block/ll_rw_blk.c | 2 | ||||
| -rw-r--r-- | drivers/char/keyboard.c | 2 | ||||
| -rw-r--r-- | drivers/md/dm.c | 2 | ||||
| -rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 6 | ||||
| -rw-r--r-- | drivers/net/tulip/dmfe.c | 6 | ||||
| -rw-r--r-- | drivers/pci/bus.c | 9 | ||||
| -rw-r--r-- | drivers/serial/core.c | 6 | ||||
| -rw-r--r-- | drivers/video/aty/mach64_gx.c | 10 | ||||
| -rw-r--r-- | drivers/video/fbmem.c | 3 | ||||
| -rw-r--r-- | drivers/video/logo/logo.c | 2 |
15 files changed, 144 insertions, 38 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 9362b6cb01eb..8ffb84e6db80 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -1069,6 +1069,7 @@ static boolean DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V1_PciDmaMask)) return DAC960_Failure(Controller, "DMA mask out of range"); + Controller->BounceBufferLimit = DAC690_V1_PciDmaMask; if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { CommandMailboxesSize = 0; @@ -1271,6 +1272,7 @@ static boolean DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V2_PciDmaMask)) return DAC960_Failure(Controller, "DMA mask out of range"); + Controller->BounceBufferLimit = DAC690_V2_PciDmaMask; /* This is a temporary dma mapping, used only in the scope of this function */ CommandMailbox = @@ -2386,6 +2388,7 @@ static boolean DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller) */ RequestQueue = &Controller->RequestQueue; blk_init_queue(RequestQueue, DAC960_RequestFunction, &Controller->queue_lock); + blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit); RequestQueue->queuedata = Controller; blk_queue_max_hw_segments(RequestQueue, Controller->DriverScatterGatherLimit); diff --git a/drivers/block/DAC960.h b/drivers/block/DAC960.h index f38145a54a67..01b543211870 100644 --- a/drivers/block/DAC960.h +++ b/drivers/block/DAC960.h @@ -62,11 +62,6 @@ /* Define the pci dma mask supported by DAC960 V1 and V2 Firmware Controlers - - For now set the V2 mask to only 32 bits. The controller IS capable - of doing 64 bit dma. But I have yet to find out whether this needs to - be explicitely enabled in the controller, or of the controller adapts - automatically. */ #define DAC690_V1_PciDmaMask 0xffffffff @@ -2370,6 +2365,7 @@ typedef struct DAC960_Controller unsigned short ControllerScatterGatherLimit; unsigned short DriverScatterGatherLimit; unsigned int ControllerUsageCount; + u64 BounceBufferLimit; unsigned int CombinedStatusBufferLength; unsigned int InitialStatusLength; unsigned int CurrentStatusLength; diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 8987b67272cd..f566e20e2094 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -599,9 +599,12 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, luninfo.num_opens = drv->usage_count; luninfo.num_parts = 0; /* count partitions 1 to 15 with sizes > 0 */ - for(i=1; i <MAX_PART; i++) - if (disk->part[i].nr_sects != 0) - luninfo.num_parts++; + for(i=1; i <MAX_PART; i++) { + if (!disk->part[i]) + continue; + if (disk->part[i]->nr_sects != 0) + luninfo.num_parts++; + } if (copy_to_user((void *) arg, &luninfo, sizeof(LogvolInfo_struct))) return -EFAULT; diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c index 032739646da9..b2eeafc81195 100644 --- a/drivers/block/genhd.c +++ b/drivers/block/genhd.c @@ -365,11 +365,13 @@ static int show_partition(struct seq_file *part, void *v) (unsigned long long)get_capacity(sgp) >> 1, disk_name(sgp, 0, buf)); for (n = 0; n < sgp->minors - 1; n++) { - if (sgp->part[n].nr_sects == 0) + if (!sgp->part[n]) + continue; + if (sgp->part[n]->nr_sects == 0) continue; seq_printf(part, "%4d %4d %10llu %s\n", sgp->major, n + 1 + sgp->first_minor, - (unsigned long long)sgp->part[n].nr_sects >> 1 , + (unsigned long long)sgp->part[n]->nr_sects >> 1 , disk_name(sgp, n + 1, buf)); } @@ -542,6 +544,92 @@ static struct kset_hotplug_ops block_hotplug_ops = { static decl_subsys(block, &ktype_block, &block_hotplug_ops); +/* + * aggregate disk stat collector. Uses the same stats that the sysfs + * entries do, above, but makes them available through one seq_file. + * Watching a few disks may be efficient through sysfs, but watching + * all of them will be more efficient through this interface. + * + * The output looks suspiciously like /proc/partitions with a bunch of + * extra fields. + */ + +/* iterator */ +static void *diskstats_start(struct seq_file *part, loff_t *pos) +{ + loff_t k = *pos; + struct list_head *p; + + down_read(&block_subsys.rwsem); + list_for_each(p, &block_subsys.kset.list) + if (!k--) + return list_entry(p, struct gendisk, kobj.entry); + return NULL; +} + +static void *diskstats_next(struct seq_file *part, void *v, loff_t *pos) +{ + struct list_head *p = ((struct gendisk *)v)->kobj.entry.next; + ++*pos; + return p==&block_subsys.kset.list ? NULL : + list_entry(p, struct gendisk, kobj.entry); +} + +static void diskstats_stop(struct seq_file *part, void *v) +{ + up_read(&block_subsys.rwsem); +} + +static int diskstats_show(struct seq_file *s, void *v) +{ + struct gendisk *gp = v; + char buf[64]; + int n = 0; + + /* + if (&sgp->kobj.entry == block_subsys.kset.list.next) + seq_puts(s, "major minor name" + " rio rmerge rsect ruse wio wmerge " + "wsect wuse running use aveq" + "\n\n"); + */ + + disk_round_stats(gp); + seq_printf(s, "%4d %4d %s %u %u %llu %u %u %u %llu %u %u %u %u\n", + gp->major, n + gp->first_minor, disk_name(gp, n, buf), + disk_stat_read(gp, reads), disk_stat_read(gp, read_merges), + (unsigned long long)disk_stat_read(gp, read_sectors), + jiffies_to_msec(disk_stat_read(gp, read_ticks)), + disk_stat_read(gp, writes), disk_stat_read(gp, write_merges), + (unsigned long long)disk_stat_read(gp, write_sectors), + jiffies_to_msec(disk_stat_read(gp, write_ticks)), + disk_stat_read(gp, in_flight), + jiffies_to_msec(disk_stat_read(gp, io_ticks)), + jiffies_to_msec(disk_stat_read(gp, time_in_queue))); + + /* now show all non-0 size partitions of it */ + for (n = 0; n < gp->minors - 1; n++) { + struct hd_struct *hd = gp->part[n]; + + if (hd && hd->nr_sects) + seq_printf(s, "%4d %4d %s %u %u %u %u\n", + gp->major, n + gp->first_minor + 1, + disk_name(gp, n + 1, buf), + hd->reads, hd->read_sectors, + hd->writes, hd->write_sectors); + } + + return 0; +} + +struct seq_operations diskstats_op = { + start: diskstats_start, + next: diskstats_next, + stop: diskstats_stop, + show: diskstats_show +}; + + struct gendisk *alloc_disk(int minors) { struct gendisk *disk = kmalloc(sizeof(struct gendisk), GFP_KERNEL); @@ -552,7 +640,7 @@ struct gendisk *alloc_disk(int minors) return NULL; } if (minors > 1) { - int size = (minors - 1) * sizeof(struct hd_struct); + int size = (minors - 1) * sizeof(struct hd_struct *); disk->part = kmalloc(size, GFP_KERNEL); if (!disk->part) { kfree(disk); @@ -604,8 +692,8 @@ void set_device_ro(struct block_device *bdev, int flag) struct gendisk *disk = bdev->bd_disk; if (bdev->bd_contains != bdev) { int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor); - struct hd_struct *p = &disk->part[part-1]; - p->policy = flag; + struct hd_struct *p = disk->part[part-1]; + if (p) p->policy = flag; } else disk->policy = flag; } @@ -615,7 +703,7 @@ void set_disk_ro(struct gendisk *disk, int flag) int i; disk->policy = flag; for (i = 0; i < disk->minors - 1; i++) - disk->part[i].policy = flag; + if (disk->part[i]) disk->part[i]->policy = flag; } int bdev_read_only(struct block_device *bdev) @@ -626,8 +714,9 @@ int bdev_read_only(struct block_device *bdev) disk = bdev->bd_disk; if (bdev->bd_contains != bdev) { int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor); - struct hd_struct *p = &disk->part[part-1]; - return p->policy; + struct hd_struct *p = disk->part[part-1]; + if (p) return p->policy; + return 0; } else return disk->policy; } diff --git a/drivers/block/ioctl.c b/drivers/block/ioctl.c index 538c8a04a2d3..3dbd0824319b 100644 --- a/drivers/block/ioctl.c +++ b/drivers/block/ioctl.c @@ -41,11 +41,14 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg *arg) return -EINVAL; } /* partition number in use? */ - if (disk->part[part - 1].nr_sects != 0) + if (disk->part[part - 1]) return -EBUSY; /* overlap? */ for (i = 0; i < disk->minors - 1; i++) { - struct hd_struct *s = &disk->part[i]; + struct hd_struct *s = disk->part[i]; + + if (!s) + continue; if (!(start+length <= s->start_sect || start >= s->start_sect + s->nr_sects)) return -EBUSY; @@ -54,7 +57,9 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg *arg) add_partition(disk, part, start, length); return 0; case BLKPG_DEL_PARTITION: - if (disk->part[part - 1].nr_sects == 0) + if (!disk->part[part-1]) + return -ENXIO; + if (disk->part[part - 1]->nr_sects == 0) return -ENXIO; /* partition in use? Incomplete check for now. */ bdevp = bdget(MKDEV(disk->major, disk->first_minor) + part); diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index e14210308577..9e2fd26ce0ed 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -1841,7 +1841,7 @@ static inline void blk_partition_remap(struct bio *bio) if (bdev == bdev->bd_contains) return; - p = &disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1]; + p = disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1]; switch (bio->bi_rw) { case READ: p->read_sectors += bio_sectors(bio); diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index ed453a23e4de..ef1fd1b6b0df 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -601,7 +601,7 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag, struct return; if ((kbd->kbdmode == VC_RAW || kbd->kbdmode == VC_MEDIUMRAW) && - value != K_SAK) + value != KVAL(K_SAK)) return; /* SAK is allowed even in raw mode */ fn_handler[value](vc, regs); } diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 60bd488baece..18ead55a549a 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -15,7 +15,7 @@ #include <linux/slab.h> static const char *_name = DM_NAME; -#define MAX_DEVICES (1 << KDEV_MINOR_BITS) +#define MAX_DEVICES 1024 static int major = 0; static int _major = 0; diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 9a0727a4b120..ae13b70c367a 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c @@ -940,11 +940,9 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) outw(SetTxThreshold + (1536>>2), ioaddr + EL3_CMD); } - dev_kfree_skb (skb); pop_tx_status(dev); - - spin_unlock(&lp->window_lock); - + spin_unlock_irqrestore(&lp->window_lock, flags); + dev_kfree_skb(skb); return 0; } diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index ee017a02ecbe..b2d33c9ac274 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c @@ -668,13 +668,13 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev) if ( db->tx_queue_cnt < TX_FREE_DESC_CNT ) netif_wake_queue(dev); - /* free this SKB */ - dev_kfree_skb(skb); - /* Restore CR7 to enable interrupt */ spin_unlock_irqrestore(&db->lock, flags); outl(db->cr7_data, dev->base_addr + DCR7); + /* free this SKB */ + dev_kfree_skb(skb); + return 0; } diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index b37429ad5e65..bee04f53a84b 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -75,7 +75,8 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, * Add newly discovered PCI devices (which are on the bus->devices * list) to the global PCI device list, add the sysfs and procfs * entries. Where a bridge is found, add the discovered bus to - * the parents list of child buses, and recurse. + * the parents list of child buses, and recurse (breadth-first + * to be compatible with 2.4) * * Call hotplug for each new devices. */ @@ -98,6 +99,12 @@ void __devinit pci_bus_add_devices(struct pci_bus *bus) #endif pci_create_sysfs_dev_files(dev); + } + + list_for_each_entry(dev, &bus->devices, bus_list) { + + BUG_ON(list_empty(&dev->global_list)); + /* * If there is an unattached subordinate bus, attach * it and then scan for unattached PCI devices. diff --git a/drivers/serial/core.c b/drivers/serial/core.c index b461093a13cc..c6207f0737b7 100644 --- a/drivers/serial/core.c +++ b/drivers/serial/core.c @@ -782,8 +782,12 @@ uart_set_info(struct uart_state *state, struct serial_struct *newinfo) /* * Claim and map the new regions */ - if (port->type != PORT_UNKNOWN) + if (port->type != PORT_UNKNOWN) { retval = port->ops->request_port(port); + } else { + /* Always success - Jean II */ + retval = 0; + } /* * If we fail to request resources for the diff --git a/drivers/video/aty/mach64_gx.c b/drivers/video/aty/mach64_gx.c index a27b9bcd8859..85168a32eea8 100644 --- a/drivers/video/aty/mach64_gx.c +++ b/drivers/video/aty/mach64_gx.c @@ -119,7 +119,7 @@ static int aty_set_dac_514(const struct fb_info *info, } static int aty_var_to_pll_514(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u8 bpp, union aty_pll *pll) { /* * FIXME: use real calculations instead of using fixed values from the old @@ -338,7 +338,7 @@ const struct aty_dac_ops aty_dac_att21c498 = { */ static int aty_var_to_pll_18818(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u8 bpp, union aty_pll *pll) { u32 MHz100; /* in 0.01 MHz */ u32 program_bits; @@ -494,7 +494,7 @@ const struct aty_pll_ops aty_pll_ati18818_1 = { */ static int aty_var_to_pll_1703(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u32 vclk_per, u8 bpp, union aty_pll *pll) { u32 mhz100; /* in 0.01 MHz */ u32 program_bits; @@ -610,7 +610,7 @@ const struct aty_pll_ops aty_pll_stg1703 = { */ static int aty_var_to_pll_8398(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u32 vclk_per, u8 bpp, union aty_pll *pll) { u32 tempA, tempB, fOut, longMHz100, diff, preDiff; @@ -734,7 +734,7 @@ const struct aty_pll_ops aty_pll_ch8398 = { */ static int aty_var_to_pll_408(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u8 bpp, union aty_pll *pll) { u32 mhz100; /* in 0.01 MHz */ u32 program_bits; diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 0f3182b1783a..75b47be36f22 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -25,6 +25,7 @@ #include <linux/mman.h> #include <linux/tty.h> #include <linux/init.h> +#include <linux/linux_logo.h> #include <linux/proc_fs.h> #ifdef CONFIG_KMOD #include <linux/kmod.h> @@ -655,7 +656,7 @@ int fb_prepare_logo(struct fb_info *info) } /* Return if no suitable logo was found */ - fb_logo.logo = find_logo(info->var.bits_per_pixel); + fb_logo.logo = fb_find_logo(info->var.bits_per_pixel); if (!fb_logo.logo || fb_logo.logo->height > info->var.yres) { fb_logo.logo = NULL; diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c index daf9c360a2aa..3039664df313 100644 --- a/drivers/video/logo/logo.c +++ b/drivers/video/logo/logo.c @@ -33,7 +33,7 @@ extern const struct linux_logo logo_superh_vga16; extern const struct linux_logo logo_superh_clut224; -const struct linux_logo * __init find_logo(int depth) +const struct linux_logo *fb_find_logo(int depth) { const struct linux_logo *logo = 0; |
