Commit e5a3c4ec authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.39pre2

parent c2ab47b4
......@@ -59,7 +59,6 @@ CONFIG_PCI_NAMES=y
#
CONFIG_PCMCIA=y
CONFIG_CARDBUS=y
CONFIG_YENTA=y
# CONFIG_I82365 is not set
CONFIG_TCIC=y
CONFIG_SYSVIPC=y
......@@ -314,6 +313,7 @@ CONFIG_PCMCIA_PCNET=y
# CONFIG_PCMCIA_SMC91C92 is not set
# CONFIG_PCMCIA_XIRC2PS is not set
# CONFIG_AIRONET4500_CS is not set
# CONFIG_ARCNET_COM20020_CS is not set
# CONFIG_PCMCIA_3C575 is not set
# CONFIG_PCMCIA_TULIP is not set
# CONFIG_PCMCIA_EPIC100 is not set
......@@ -401,6 +401,7 @@ CONFIG_DRM_TDFX=y
#
# PCMCIA character device support
#
CONFIG_PCMCIA_SERIAL=y
# CONFIG_PCMCIA_SERIAL_CS is not set
# CONFIG_PCMCIA_SERIAL_CB is not set
......
......@@ -1556,11 +1556,7 @@ static int floppy_open(struct inode *inode, struct file *filp)
static void floppy_release(struct inode *inode, struct file *filp)
{
int drive;
drive = MINOR(inode->i_rdev) & 3;
block_fsync(inode, filp);
int drive = MINOR(inode->i_rdev) & 3;
if (fd_ref[drive] < 0)
fd_ref[drive] = 0;
......
......@@ -1276,7 +1276,6 @@ static int mfm_open(struct inode *inode, struct file *file)
*/
static int mfm_release(struct inode *inode, struct file *file)
{
fsync_dev(inode->i_rdev);
mfm_info[DEVICE_NR(MINOR(inode->i_rdev))].access_count--;
MOD_DEC_USE_COUNT;
return 0;
......
......@@ -166,7 +166,6 @@ static void ddv_release(struct inode * inode, struct file * filp)
#if DEBUG
printk("ddv_release started\n");
#endif
sync_dev(inode->i_rdev);
#if DEBUG
printk("ddv_release done\n");
#endif
......
......@@ -2466,10 +2466,6 @@ static int DAC960_Release(Inode_T *Inode, File_T *File)
if (ControllerNumber == 0 && LogicalDriveNumber == 0 &&
File != NULL && (File->f_flags & O_NONBLOCK))
goto ModuleOnly;
/*
Force any buffered data to be written.
*/
fsync_dev(Inode->i_rdev);
/*
Decrement the Logical Drive and Controller Usage Counts.
*/
......
......@@ -1216,11 +1216,7 @@ static int acsi_open( struct inode * inode, struct file * filp )
static int acsi_release( struct inode * inode, struct file * file )
{
int device;
sync_dev(inode->i_rdev);
device = DEVICE_NR(MINOR(inode->i_rdev));
int device = DEVICE_NR(MINOR(inode->i_rdev));
if (--access_count[device] == 0 && acsi_info[device].removable)
acsi_prevent_removal(device, 0);
MOD_DEC_USE_COUNT;
......
......@@ -1686,16 +1686,6 @@ static int floppy_release(struct inode * inode, struct file * filp)
#endif
int drive = MINOR(inode->i_rdev) & 3;
fsync_dev(inode->i_rdev);
#ifdef DEBUG
/* This is now handled in floppy_change, but still useful for debugging */
sb = get_super(inode->i_rdev);
if (sb)
invalidate_inodes(sb);
invalidate_buffers(inode->i_rdev);
#endif
if (unit[drive].dirty == 1) {
del_timer (flush_track_timer + drive);
non_int_flush_track (drive);
......
......@@ -1941,11 +1941,7 @@ static int floppy_open( struct inode *inode, struct file *filp )
static int floppy_release( struct inode * inode, struct file * filp )
{
int drive;
drive = MINOR(inode->i_rdev) & 3;
block_fsync (filp, filp->f_dentry);
int drive = MINOR(inode->i_rdev) & 3;
if (fd_ref[drive] < 0)
fd_ref[drive] = 0;
......
......@@ -837,7 +837,6 @@ static int ida_release(struct inode *inode, struct file *filep)
int dsk = MINOR(inode->i_rdev) >> NWD_SHIFT;
DBGINFO(printk("ida_release %x (%x:%x)\n", inode->i_rdev, ctlr, dsk) );
fsync_dev(inode->i_rdev);
hba[ctlr]->drv[dsk].usage_count--;
hba[ctlr]->usage_count--;
......
......@@ -3627,11 +3627,7 @@ static void config_types(void)
static int floppy_release(struct inode * inode, struct file * filp)
{
int drive;
drive = DRIVE(inode->i_rdev);
block_fsync(filp, filp->f_dentry);
int drive = DRIVE(inode->i_rdev);
if (UDRS->fd_ref < 0)
UDRS->fd_ref=0;
......
......@@ -657,10 +657,7 @@ static int hd_open(struct inode * inode, struct file * filp)
*/
static int hd_release(struct inode * inode, struct file * file)
{
int target;
sync_dev(inode->i_rdev);
target = DEVICE_NR(inode->i_rdev);
int target = DEVICE_NR(inode->i_rdev);
access_count[target]--;
return 0;
}
......
......@@ -1846,7 +1846,6 @@ static int ide_release (struct inode * inode, struct file * file)
ide_drive_t *drive;
if ((drive = get_info_ptr(inode->i_rdev)) != NULL) {
fsync_dev(inode->i_rdev);
drive->usage--;
if (drive->driver != NULL)
DRIVER(drive)->release(inode, file, drive);
......
......@@ -654,7 +654,6 @@ static int lo_release(struct inode *inode, struct file *file)
dev = MINOR(inode->i_rdev);
if (dev >= max_loop)
return 0;
err = fsync_dev(inode->i_rdev);
lo = &loop_dev[dev];
if (lo->lo_refcnt <= 0)
printk(KERN_ERR "lo_release: refcount(%d) <= 0\n", lo->lo_refcnt);
......
......@@ -675,8 +675,6 @@ static int md_open (struct inode *inode, struct file *file)
static int md_release (struct inode *inode, struct file *file)
{
int minor=MINOR(inode->i_rdev);
sync_dev (inode->i_rdev);
md_dev[minor].busy--;
return 0;
}
......
......@@ -435,8 +435,6 @@ static int nbd_release(struct inode *inode, struct file *file)
dev = MINOR(inode->i_rdev);
if (dev >= MAX_NBD)
return -ENODEV;
fsync_dev(inode->i_rdev);
invalidate_buffers(inode->i_rdev);
lo = &nbd_dev[dev];
if (lo->refcnt <= 0)
printk(KERN_ALERT "nbd_release: refcount(%d) <= 0\n", lo->refcnt);
......
......@@ -512,15 +512,8 @@ static int pd_release (struct inode *inode, struct file *file)
PD.access--;
if (!PD.access) {
fsync_dev(devp);
sb = get_super(devp);
if (sb) invalidate_inodes(sb);
invalidate_buffers(devp);
if (PD.removable) pd_doorlock(unit,IDE_DOORUNLOCK);
}
if (!PD.access && PD.removable)
pd_doorlock(unit,IDE_DOORUNLOCK);
MOD_DEC_USE_COUNT;
......
......@@ -447,8 +447,6 @@ static int pf_release (struct inode *inode, struct file *file)
{ kdev_t devp;
int unit;
struct super_block *sb;
devp = inode->i_rdev;
unit = DEVICE_NR(devp);
......@@ -457,15 +455,8 @@ static int pf_release (struct inode *inode, struct file *file)
PF.access--;
if (!PF.access) {
fsync_dev(devp);
sb = get_super(devp);
if (sb) invalidate_inodes(sb);
invalidate_buffers(devp);
if (PF.removable) pf_lock(unit,0);
}
if (!PF.access && PF.removable)
pf_lock(unit,0);
MOD_DEC_USE_COUNT;
......
......@@ -1105,7 +1105,6 @@ static int ps2esdi_release(struct inode *inode, struct file *file)
int dev = DEVICE_NR(inode->i_rdev);
if (dev < ps2esdi_drives) {
sync_dev(inode->i_rdev);
access_count[dev]--;
}
return 0;
......
......@@ -924,8 +924,6 @@ static int floppy_release(struct inode *inode, struct file *filp)
if (devnum >= floppy_count)
return -ENODEV;
block_fsync (filp, filp->f_dentry);
fs = &floppy_states[devnum];
sw = fs->swim3;
if (fs->ref_count > 0 && --fs->ref_count == 0) {
......
......@@ -449,8 +449,6 @@ static int floppy_release(struct inode *inode, struct file *filp)
if (devnum >= floppy_count)
return -ENODEV;
block_fsync (filp, filp->f_dentry);
fs = &floppy_states[devnum];
if (fs->ref_count > 0) fs->ref_count--;
return 0;
......
......@@ -367,17 +367,12 @@ static int xd_ioctl (struct inode *inode,struct file *file,u_int cmd,u_long arg)
/* xd_release: release the device */
static int xd_release (struct inode *inode, struct file *file)
{
int target;
target= DEVICE_NR(inode->i_rdev);
int target = DEVICE_NR(inode->i_rdev);
if (target < xd_drives) {
sync_dev(inode->i_rdev);
xd_access[target]--;
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif /* MODULE */
}
return 0;
}
......
......@@ -320,8 +320,6 @@ z2_release( struct inode *inode, struct file *filp )
if ( current_device == -1 )
return 0;
sync_dev( inode->i_rdev );
/*
* FIXME: unmap memory
*/
......
......@@ -1593,8 +1593,6 @@ static int aztcd_release(struct inode * inode, struct file * file)
MOD_DEC_USE_COUNT;
if (!--azt_open_count) {
azt_invalidate_buffers();
sync_dev(inode->i_rdev); /*??? isn't it a read only dev?*/
invalidate_buffers(inode -> i_rdev);
aztUnlockDoor();
if (azt_auto_eject)
aztSendCmd(ACMD_EJECT);
......
......@@ -640,11 +640,6 @@ int cdrom_release(struct inode *ip, struct file *fp)
!(fp && fp->f_flags & O_NONBLOCK);
cdo->release(cdi);
if (cdi->use_count == 0) { /* last process that closes dev*/
struct super_block *sb;
sync_dev(dev);
sb = get_super(dev);
if (sb) invalidate_inodes(sb);
invalidate_buffers(dev);
if (opened_for_data &&
cdi->options & CDO_AUTO_EJECT && CDROM_CAN(CDC_OPEN_TRAY))
cdo->tray_move(cdi, 1);
......
......@@ -418,8 +418,6 @@ printk ( "GSCD: release\n" );
#endif
gscd_bn = -1;
sync_dev(inode->i_rdev);
invalidate_buffers(inode -> i_rdev);
MOD_DEC_USE_COUNT;
return 0;
......
......@@ -1935,8 +1935,6 @@ static int opt_release(struct inode *ip, struct file *fp)
if (!--open_count) {
toc_uptodate = 0;
opt_invalidate_buffers();
sync_dev(ip -> i_rdev);
invalidate_buffers(ip -> i_rdev);
status = exec_cmd(COMUNLOCK); /* Unlock door */
if (status < 0) {
DEBUG((DEBUG_VFS, "exec_cmd COMUNLOCK: %02x", -status));
......
......@@ -1413,8 +1413,6 @@ static int sjcd_release( struct inode *inode, struct file *file ){
#endif
if( --sjcd_open_count == 0 ){
sjcd_invalidate_buffers();
sync_dev( inode->i_rdev );
invalidate_buffers( inode->i_rdev );
s = sjcd_tray_unlock();
if( s < 0 || !sjcd_status_valid || sjcd_command_failed ){
#if defined( SJCD_DIAGNOSTIC )
......
......@@ -1451,7 +1451,6 @@ cdu_release(struct inode *inode,
sony_usage--;
}
if (sony_usage == 0) {
sync_dev(inode->i_rdev);
check_drive_status();
if (sony_audio_status != CDROM_AUDIO_PLAY) {
......
......@@ -685,7 +685,6 @@ static int i2ob_release(struct inode *inode, struct file *file)
minor = MINOR(inode->i_rdev);
if (minor >= (MAX_I2OB<<4))
return -ENODEV;
sync_dev(inode->i_rdev);
dev = &i2ob_dev[(minor&0xF0)];
if (dev->refcnt <= 0)
printk(KERN_ALERT "i2ob_release: refcount(%d) <= 0\n", dev->refcnt);
......
......@@ -238,7 +238,7 @@ pci_insert_device(struct pci_dev *dev, struct pci_bus *bus)
#ifdef CONFIG_PROC_FS
pci_proc_attach_device(dev);
#endif
for(ln=pci_drivers.next; ln != &pci_devices; ln=ln->next) {
for(ln=pci_drivers.next; ln != &pci_drivers; ln=ln->next) {
struct pci_driver *drv = list_entry(ln, struct pci_driver, node);
if (drv->probe(dev)) {
dev->driver = drv;
......@@ -247,6 +247,17 @@ pci_insert_device(struct pci_dev *dev, struct pci_bus *bus)
}
}
static void pci_free_resources(struct pci_dev *dev)
{
int i;
for (i = 0; i < PCI_NUM_RESOURCES; i++) {
struct resource *res = dev->resource + i;
if (res->parent)
release_resource(res);
}
}
void
pci_remove_device(struct pci_dev *dev)
{
......@@ -255,6 +266,7 @@ pci_remove_device(struct pci_dev *dev)
dev->driver = NULL;
list_del(&dev->bus_list);
list_del(&dev->global_list);
pci_free_resources(dev);
#ifdef CONFIG_PROC_FS
pci_proc_detach_device(dev);
#endif
......
......@@ -256,6 +256,21 @@ void read_cb_mem(socket_info_t * s, u_char fn, int space,
=====================================================================*/
static int cb_assign_irq(u32 mask)
{
int irq, try;
for (try = 0; try < 2; try++) {
for (irq = 1; irq < 32; irq++) {
if ((mask >> irq) & 1) {
if (try_irq(IRQ_TYPE_EXCLUSIVE, irq, try) == 0)
return irq;
}
}
}
return 0;
}
int cb_alloc(socket_info_t * s)
{
struct pci_bus *bus;
......@@ -263,6 +278,7 @@ int cb_alloc(socket_info_t * s)
u_short vend, v, dev;
u_char i, hdr, fn;
cb_config_t *c;
int irq;
bus = s->cap.cb_dev->subordinate;
memset(&tmp, 0, sizeof(tmp));
......@@ -292,8 +308,10 @@ int cb_alloc(socket_info_t * s)
return CS_OUT_OF_RESOURCE;
memset(c, 0, fn * sizeof(struct cb_config_t));
irq = s->cap.pci_irq;
for (i = 0; i < fn; i++) {
struct pci_dev *dev = &c[i].dev;
u8 irq_pin;
int r;
dev->bus = bus;
......@@ -314,26 +332,25 @@ int cb_alloc(socket_info_t * s)
pci_assign_resource(dev, r);
}
}
pci_enable_device(dev);
/* Does this function have an interrupt at all? */
pci_readb(dev, PCI_INTERRUPT_PIN, &irq_pin);
if (irq_pin) {
if (!irq)
irq = cb_assign_irq(s->cap.irq_mask);
dev->irq = irq;
pci_writeb(dev, PCI_INTERRUPT_LINE, irq);
}
pci_insert_device(dev, bus);
pci_enable_device(dev);
}
s->cb_config = c;
s->irq.AssignedIRQ = irq;
return CS_SUCCESS;
}
static void free_resources(struct pci_dev *dev)
{
int i;
for (i = 0; i < 7; i++) {
struct resource *res = dev->resource + i;
if (res->parent)
release_resource(res);
}
}
void cb_free(socket_info_t * s)
{
cb_config_t *c = s->cb_config;
......@@ -342,12 +359,9 @@ void cb_free(socket_info_t * s)
int i;
s->cb_config = NULL;
for(i=0; i<s->functions; i++) {
struct pci_dev *dev = &c[i].dev;
for (i = 0 ; i < s->functions ; i++)
pci_remove_device(&c[i].dev);
free_resources(dev);
pci_remove_device(dev);
}
kfree(c);
printk(KERN_INFO "cs: cb_free(bus %d)\n", s->cap.cb_dev->subordinate->number);
}
......@@ -365,54 +379,8 @@ void cb_free(socket_info_t * s)
======================================================================*/
static int cb_assign_irq(u32 mask)
{
int irq, try;
for (try = 0; try < 2; try++) {
for (irq = 1; irq < 32; irq++) {
if ((mask >> irq) & 1) {
if (try_irq(IRQ_TYPE_EXCLUSIVE, irq, try) == 0)
return irq;
}
}
}
return 0;
}
int cb_config(socket_info_t * s)
{
cb_config_t *c = s->cb_config;
u_char fn = s->functions;
int i, irq;
printk(KERN_INFO "cs: cb_config(bus %d)\n", s->cap.cb_dev->subordinate->number);
/*
* If we have a PCI interrupt for the bridge,
* then use that..
*/
irq = s->cap.pci_irq;
for (i = 0; i < fn; i++) {
struct pci_dev *dev = &c[i].dev;
u8 irq_pin;
/* Does this function have an interrupt at all? */
pci_readb(dev, PCI_INTERRUPT_PIN, &irq_pin);
if (!irq_pin)
continue;
if (!irq) {
irq = cb_assign_irq(s->cap.irq_mask);
if (!irq)
return CS_OUT_OF_RESOURCE;
}
dev->irq = irq;
pci_writeb(dev, PCI_INTERRUPT_LINE, irq);
}
s->irq.AssignedIRQ = irq;
return CS_SUCCESS;
}
......
......@@ -452,7 +452,6 @@ static int sd_open(struct inode *inode, struct file *filp)
static int sd_release(struct inode *inode, struct file *file)
{
int target;
fsync_dev(inode->i_rdev);
target = DEVICE_NR(inode->i_rdev);
......
......@@ -298,7 +298,7 @@ ssize_t block_read(struct file * filp, char * buf, size_t count, loff_t *ppos)
* since the vma has no handle.
*/
int block_fsync(struct file *filp, struct dentry *dentry)
static int block_fsync(struct file *filp, struct dentry *dentry)
{
return fsync_dev(dentry->d_inode->i_rdev);
}
......@@ -604,8 +604,11 @@ int blkdev_put(struct block_device *bdev, int kind)
kdev_t rdev = to_kdev_t(bdev->bd_dev); /* this should become bdev */
down(&bdev->bd_sem);
/* syncing will go here */
if (kind == BDEV_FILE || kind == BDEV_FS)
sync_dev(rdev);
if (atomic_dec_and_test(&bdev->bd_openers)) {
/* invalidating buffers will go here */
invalidate_buffers(rdev);
}
if (bdev->bd_op->release) {
struct inode * fake_inode = get_empty_inode();
......
......@@ -1011,7 +1011,6 @@ extern int read_ahead[];
extern ssize_t char_write(struct file *, const char *, size_t, loff_t *);
extern ssize_t block_write(struct file *, const char *, size_t, loff_t *);
extern int block_fsync(struct file *, struct dentry *);
extern int file_fsync(struct file *, struct dentry *);
extern int generic_buffer_fdatasync(struct inode *inode, unsigned long start_idx, unsigned long end_idx);
......
......@@ -247,7 +247,6 @@ EXPORT_SYMBOL(tty_std_termios);
/* block device driver support */
EXPORT_SYMBOL(block_read);
EXPORT_SYMBOL(block_write);
EXPORT_SYMBOL(block_fsync);
EXPORT_SYMBOL(wait_for_request);
EXPORT_SYMBOL(blksize_size);
EXPORT_SYMBOL(hardsect_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment