Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32861
b: refs/heads/master
c: ba4ba8a
h: refs/heads/master
i:
  32859: 53d9a44
v: v3
  • Loading branch information
Peter Oberparleiter authored and Martin Schwidefsky committed Jul 27, 2006
1 parent 7f8153b commit c18c283
Show file tree
Hide file tree
Showing 19 changed files with 75 additions and 107 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d22e6d7ad50472da399a500bf039e7718a6cdc9
refs/heads/master: ba4ba8a69dcb446450b5ddeca48a7bd15783f4c2
4 changes: 2 additions & 2 deletions trunk/arch/i386/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
/*
* Now maybe handle debug registers and/or IO bitmaps
*/
if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW)
|| test_tsk_thread_flag(prev_p, TIF_IO_BITMAP)))
if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW))
|| test_tsk_thread_flag(prev_p, TIF_IO_BITMAP))
__switch_to_xtra(next_p, tss);

disable_tsc(prev_p, next_p);
Expand Down
74 changes: 32 additions & 42 deletions trunk/arch/sparc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,32 +225,6 @@ static __inline__ int has_low_battery(void)
return (data1 == data2); /* Was the write blocked? */
}

static void __init mostek_set_system_time(void)
{
unsigned int year, mon, day, hour, min, sec;
struct mostek48t02 *mregs;

mregs = (struct mostek48t02 *)mstk48t02_regs;
if(!mregs) {
prom_printf("Something wrong, clock regs not mapped yet.\n");
prom_halt();
}
spin_lock_irq(&mostek_lock);
mregs->creg |= MSTK_CREG_READ;
sec = MSTK_REG_SEC(mregs);
min = MSTK_REG_MIN(mregs);
hour = MSTK_REG_HOUR(mregs);
day = MSTK_REG_DOM(mregs);
mon = MSTK_REG_MONTH(mregs);
year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
set_normalized_timespec(&wall_to_monotonic,
-xtime.tv_sec, -xtime.tv_nsec);
mregs->creg &= ~MSTK_CREG_READ;
spin_unlock_irq(&mostek_lock);
}

/* Probe for the real time clock chip on Sun4 */
static __inline__ void sun4_clock_probe(void)
{
Expand Down Expand Up @@ -299,7 +273,6 @@ static __inline__ void sun4_clock_probe(void)
#endif
}

#ifndef CONFIG_SUN4
static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match)
{
struct device_node *dp = op->node;
Expand Down Expand Up @@ -334,8 +307,6 @@ static int __devinit clock_probe(struct of_device *op, const struct of_device_id
if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP)
kick_start_clock();

mostek_set_system_time();

return 0;
}

Expand All @@ -354,37 +325,56 @@ static struct of_platform_driver clock_driver = {


/* Probe for the mostek real time clock chip. */
static int __init clock_init(void)
static void clock_init(void)
{
return of_register_driver(&clock_driver, &of_bus_type);
of_register_driver(&clock_driver, &of_bus_type);
}

/* Must be after subsys_initcall() so that busses are probed. Must
* be before device_initcall() because things like the RTC driver
* need to see the clock registers.
*/
fs_initcall(clock_init);
#endif /* !CONFIG_SUN4 */

void __init sbus_time_init(void)
{
unsigned int year, mon, day, hour, min, sec;
struct mostek48t02 *mregs;

#ifdef CONFIG_SUN4
int temp;
struct intersil *iregs;
#endif

BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM);
btfixup();

if (ARCH_SUN4)
sun4_clock_probe();
else
clock_init();

sparc_init_timers(timer_interrupt);

#ifdef CONFIG_SUN4
if(idprom->id_machtype == (SM_SUN4 | SM_4_330)) {
mostek_set_system_time();
#endif
mregs = (struct mostek48t02 *)mstk48t02_regs;
if(!mregs) {
prom_printf("Something wrong, clock regs not mapped yet.\n");
prom_halt();
}
spin_lock_irq(&mostek_lock);
mregs->creg |= MSTK_CREG_READ;
sec = MSTK_REG_SEC(mregs);
min = MSTK_REG_MIN(mregs);
hour = MSTK_REG_HOUR(mregs);
day = MSTK_REG_DOM(mregs);
mon = MSTK_REG_MONTH(mregs);
year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
set_normalized_timespec(&wall_to_monotonic,
-xtime.tv_sec, -xtime.tv_nsec);
mregs->creg &= ~MSTK_CREG_READ;
spin_unlock_irq(&mostek_lock);
#ifdef CONFIG_SUN4
} else if(idprom->id_machtype == (SM_SUN4 | SM_4_260) ) {
/* initialise the intersil on sun4 */
unsigned int year, mon, day, hour, min, sec;
int temp;
struct intersil *iregs;

iregs=intersil_clock;
if(!iregs) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ static void update_ordered(ide_drive_t *drive)
* not available so we don't need to recheck that.
*/
capacity = idedisk_capacity(drive);
barrier = ide_id_has_flush_cache(id) && !drive->noflush &&
barrier = ide_id_has_flush_cache(id) &&
(drive->addressing == 0 || capacity <= (1ULL << 28) ||
ide_id_has_flush_cache_ext(id));

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ void ide_dma_verbose(ide_drive_t *drive)
goto bug_dma_off;
printk(", DMA");
} else if (id->field_valid & 1) {
goto bug_dma_off;
printk(", BUG");
}
return;
bug_dma_off:
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@ static int __init ide_setup(char *s)
const char *hd_words[] = {
"none", "noprobe", "nowerr", "cdrom", "serialize",
"autotune", "noautotune", "minus8", "swapdata", "bswap",
"noflush", "remap", "remap63", "scsi", NULL };
"minus11", "remap", "remap63", "scsi", NULL };
unit = s[2] - 'a';
hw = unit / MAX_DRIVES;
unit = unit % MAX_DRIVES;
Expand Down Expand Up @@ -1578,9 +1578,6 @@ static int __init ide_setup(char *s)
case -10: /* "bswap" */
drive->bswap = 1;
goto done;
case -11: /* noflush */
drive->noflush = 1;
goto done;
case -12: /* "remap" */
drive->remap_0_to_1 = 1;
goto done;
Expand Down
11 changes: 3 additions & 8 deletions trunk/drivers/ide/pci/it821x.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,9 @@ static int config_chipset_for_dma (ide_drive_t *drive)
{
u8 speed = ide_dma_speed(drive, it821x_ratemask(drive));

if (speed) {
config_it821x_chipset_for_pio(drive, 0);
it821x_tune_chipset(drive, speed);

return ide_dma_enable(drive);
}

return 0;
config_it821x_chipset_for_pio(drive, !speed);
it821x_tune_chipset(drive, speed);
return ide_dma_enable(drive);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/sunlance.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ static int __init sparc_lance_init(void)
{
if ((idprom->id_machtype == (SM_SUN4|SM_4_330)) ||
(idprom->id_machtype == (SM_SUN4|SM_4_470))) {
memset(&sun4_sdev, 0, sizeof(struct sbus_dev));
memset(&sun4_sdev, 0, sizeof(sdev));
sun4_sdev.reg_addrs[0].phys_addr = sun4_eth_physaddr;
sun4_sdev.irqs[0] = 6;
return sparc_lance_probe_one(&sun4_sdev, NULL, NULL);
Expand All @@ -1547,16 +1547,16 @@ static int __init sparc_lance_init(void)

static int __exit sunlance_sun4_remove(void)
{
struct lance_private *lp = dev_get_drvdata(&sun4_sdev.ofdev.dev);
struct lance_private *lp = dev_get_drvdata(&sun4_sdev->dev);
struct net_device *net_dev = lp->dev;

unregister_netdevice(net_dev);

lance_free_hwresources(lp);
lance_free_hwresources(root_lance_dev);

free_netdev(net_dev);

dev_set_drvdata(&sun4_sdev.ofdev.dev, NULL);
dev_set_drvdata(&sun4_sdev->dev, NULL);

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/s390/cio/device_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ ccw_device_cancel_halt_clear(struct ccw_device *cdev)
if (cdev->private->iretry) {
cdev->private->iretry--;
ret = cio_halt(sch);
return (ret == 0) ? -EBUSY : ret;
if (ret != -EBUSY)
return (ret == 0) ? -EBUSY : ret;
}
/* halt io unsuccessful. */
cdev->private->iretry = 255; /* 255 clear retries. */
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/scsi/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
sshdr.asc, sshdr.ascq);
break;
case NOT_READY: /* This happens if there is no disc in drive */
if (sdev->removable)
if (sdev->removable && (cmd[0] != TEST_UNIT_READY)) {
printk(KERN_INFO "Device not ready. Make sure"
" there is a disc in the drive.\n");
break;
}
case UNIT_ATTENTION:
if (sdev->removable) {
sdev->changed = 1;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/xfs/linux-2.6/xfs_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
#define BUF_BUSY XBF_DONT_BLOCK

#define XFS_BUF_BFLAGS(bp) ((bp)->b_flags)
#define XFS_BUF_ZEROFLAGS(bp) ((bp)->b_flags &= \
~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI|XBF_ORDERED))
#define XFS_BUF_ZEROFLAGS(bp) \
((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI))

#define XFS_BUF_STALE(bp) ((bp)->b_flags |= XFS_B_STALE)
#define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XFS_B_STALE)
Expand Down
7 changes: 0 additions & 7 deletions trunk/fs/xfs/linux-2.6/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,6 @@ xfs_mountfs_check_barriers(xfs_mount_t *mp)
return;
}

if (xfs_readonly_buftarg(mp->m_ddev_targp)) {
xfs_fs_cmn_err(CE_NOTE, mp,
"Disabling barriers, underlying device is readonly");
mp->m_flags &= ~XFS_MOUNT_BARRIER;
return;
}

error = xfs_barrier_test(mp);
if (error) {
xfs_fs_cmn_err(CE_NOTE, mp,
Expand Down
19 changes: 6 additions & 13 deletions trunk/fs/xfs/quota/xfs_qm_bhv.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,24 +217,17 @@ xfs_qm_statvfs(
return 0;
dp = &dqp->q_core;

limit = dp->d_blk_softlimit ?
be64_to_cpu(dp->d_blk_softlimit) :
be64_to_cpu(dp->d_blk_hardlimit);
limit = dp->d_blk_softlimit ? dp->d_blk_softlimit : dp->d_blk_hardlimit;
if (limit && statp->f_blocks > limit) {
statp->f_blocks = limit;
statp->f_bfree =
(statp->f_blocks > be64_to_cpu(dp->d_bcount)) ?
(statp->f_blocks - be64_to_cpu(dp->d_bcount)) : 0;
statp->f_bfree = (statp->f_blocks > dp->d_bcount) ?
(statp->f_blocks - dp->d_bcount) : 0;
}

limit = dp->d_ino_softlimit ?
be64_to_cpu(dp->d_ino_softlimit) :
be64_to_cpu(dp->d_ino_hardlimit);
limit = dp->d_ino_softlimit ? dp->d_ino_softlimit : dp->d_ino_hardlimit;
if (limit && statp->f_files > limit) {
statp->f_files = limit;
statp->f_ffree =
(statp->f_files > be64_to_cpu(dp->d_icount)) ?
(statp->f_ffree - be64_to_cpu(dp->d_icount)) : 0;
statp->f_ffree = (statp->f_files > dp->d_icount) ?
(statp->f_ffree - dp->d_icount) : 0;
}

xfs_qm_dqput(dqp);
Expand Down
17 changes: 7 additions & 10 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,10 @@ xfs_itobp(
#if !defined(__KERNEL__)
ni = 0;
#elif defined(DEBUG)
ni = BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog;
ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 :
(BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog);
#else /* usual case */
ni = 1;
ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 : 1;
#endif

for (i = 0; i < ni; i++) {
Expand All @@ -347,15 +348,11 @@ xfs_itobp(
(i << mp->m_sb.sb_inodelog));
di_ok = INT_GET(dip->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC &&
XFS_DINODE_GOOD_VERSION(INT_GET(dip->di_core.di_version, ARCH_CONVERT));
if (unlikely(XFS_TEST_ERROR(!di_ok, mp,
XFS_ERRTAG_ITOBP_INOTOBP,
XFS_RANDOM_ITOBP_INOTOBP))) {
if (imap_flags & XFS_IMAP_BULKSTAT) {
xfs_trans_brelse(tp, bp);
return XFS_ERROR(EINVAL);
}
if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP,
XFS_RANDOM_ITOBP_INOTOBP))) {
#ifdef DEBUG
cmn_err(CE_ALERT,
if (!(imap_flags & XFS_IMAP_BULKSTAT))
cmn_err(CE_ALERT,
"Device %s - bad inode magic/vsn "
"daddr %lld #%d (magic=%x)",
XFS_BUFTARG_NAME(mp->m_ddev_targp),
Expand Down
12 changes: 6 additions & 6 deletions trunk/fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ xlog_sync(xlog_t *log,
ops = iclog->ic_header.h_num_logops;
INT_SET(iclog->ic_header.h_num_logops, ARCH_CONVERT, ops);

bp = iclog->ic_bp;
bp = iclog->ic_bp;
ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) == (unsigned long)1);
XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2);
XFS_BUF_SET_ADDR(bp, BLOCK_LSN(INT_GET(iclog->ic_header.h_lsn, ARCH_CONVERT)));
Expand All @@ -1430,14 +1430,15 @@ xlog_sync(xlog_t *log,
}
XFS_BUF_SET_PTR(bp, (xfs_caddr_t) &(iclog->ic_header), count);
XFS_BUF_SET_FSPRIVATE(bp, iclog); /* save for later */
XFS_BUF_ZEROFLAGS(bp);
XFS_BUF_BUSY(bp);
XFS_BUF_ASYNC(bp);
/*
* Do an ordered write for the log block.
* Its unnecessary to flush the first split block in the log wrap case.
*
* It may not be needed to flush the first split block in the log wrap
* case, but do it anyways to be safe -AK
*/
if (!split && (log->l_mp->m_flags & XFS_MOUNT_BARRIER))
if (log->l_mp->m_flags & XFS_MOUNT_BARRIER)
XFS_BUF_ORDERED(bp);

ASSERT(XFS_BUF_ADDR(bp) <= log->l_logBBsize-1);
Expand All @@ -1459,15 +1460,14 @@ xlog_sync(xlog_t *log,
return error;
}
if (split) {
bp = iclog->ic_log->l_xbuf;
bp = iclog->ic_log->l_xbuf;
ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) ==
(unsigned long)1);
XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2);
XFS_BUF_SET_ADDR(bp, 0); /* logical 0 */
XFS_BUF_SET_PTR(bp, (xfs_caddr_t)((__psint_t)&(iclog->ic_header)+
(__psint_t)count), split);
XFS_BUF_SET_FSPRIVATE(bp, iclog);
XFS_BUF_ZEROFLAGS(bp);
XFS_BUF_BUSY(bp);
XFS_BUF_ASYNC(bp);
if (log->l_mp->m_flags & XFS_MOUNT_BARRIER)
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ xfs_mount(
if (error)
goto error2;

if (mp->m_flags & XFS_MOUNT_BARRIER)
if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag & VFS_RDONLY))
xfs_mountfs_check_barriers(mp);

error = XFS_IOINIT(vfsp, args, flags);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-sparc64/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot)
" .section .sun4v_2insn_patch, \"ax\"\n"
" .word 661b\n"
" andn %0, %4, %0\n"
" or %0, %5, %0\n"
" or %0, %3, %0\n"
" .previous\n"
: "=r" (val)
: "0" (val), "i" (_PAGE_CP_4U | _PAGE_CV_4U), "i" (_PAGE_E_4U),
Expand Down
Loading

0 comments on commit c18c283

Please sign in to comment.