Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64729
b: refs/heads/master
c: 53f7b9b
h: refs/heads/master
i:
  64727: 6177017
v: v3
  • Loading branch information
Linus Torvalds committed Sep 10, 2007
1 parent e2c1a4d commit b49634d
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 57 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: 1169783085adb9ac969d21103a6885e8435f7ed3
refs/heads/master: 53f7b9bccd332bba39be78f9085ac1a26fa387fc
6 changes: 5 additions & 1 deletion trunk/arch/i386/boot/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ static void setup_gdt(void)
/* DS: data, read/write, 4 GB, base 0 */
[GDT_ENTRY_BOOT_DS] = GDT_ENTRY(0xc093, 0, 0xfffff),
};
struct gdt_ptr gdt;
/* Xen HVM incorrectly stores a pointer to the gdt_ptr, instead
of the gdt_ptr contents. Thus, make it static so it will
stay in memory, at least long enough that we switch to the
proper kernel GDT. */
static struct gdt_ptr gdt;

gdt.len = sizeof(boot_gdt)-1;
gdt.ptr = (u32)&boot_gdt + (ds() << 4);
Expand Down
30 changes: 9 additions & 21 deletions trunk/arch/powerpc/kernel/ibmebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,33 +188,21 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_node(
struct device_node *dn)
{
struct ibmebus_dev *dev;
const char *loc_code;
int length;

loc_code = of_get_property(dn, "ibm,loc-code", NULL);
if (!loc_code) {
printk(KERN_WARNING "%s: node %s missing 'ibm,loc-code'\n",
__FUNCTION__, dn->name ? dn->name : "<unknown>");
return ERR_PTR(-EINVAL);
}

if (strlen(loc_code) == 0) {
printk(KERN_WARNING "%s: 'ibm,loc-code' is invalid\n",
__FUNCTION__);
return ERR_PTR(-EINVAL);
}
int i, len, bus_len;

dev = kzalloc(sizeof(struct ibmebus_dev), GFP_KERNEL);
if (!dev) {
if (!dev)
return ERR_PTR(-ENOMEM);
}

dev->ofdev.node = of_node_get(dn);

length = strlen(loc_code);
memcpy(dev->ofdev.dev.bus_id, loc_code
+ (length - min(length, BUS_ID_SIZE - 1)),
min(length, BUS_ID_SIZE - 1));
len = strlen(dn->full_name + 1);
bus_len = min(len, BUS_ID_SIZE - 1);
memcpy(dev->ofdev.dev.bus_id, dn->full_name + 1
+ (len - bus_len), bus_len);
for (i = 0; i < bus_len; i++)
if (dev->ofdev.dev.bus_id[i] == '/')
dev->ofdev.dev.bus_id[i] = '_';

/* Register with generic device framework. */
if (ibmebus_register_device_common(dev, dn->name) != 0) {
Expand Down
24 changes: 15 additions & 9 deletions trunk/arch/powerpc/platforms/cell/spu_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,27 +236,34 @@ static irqreturn_t
spu_irq_class_0(int irq, void *data)
{
struct spu *spu;
unsigned long stat, mask;

spu = data;
spu->class_0_pending = 1;

mask = spu_int_mask_get(spu, 0);
stat = spu_int_stat_get(spu, 0);
stat &= mask;

spin_lock(&spu->register_lock);
spu->class_0_pending |= stat;
spin_unlock(&spu->register_lock);

spu->stop_callback(spu);

spu_int_stat_clear(spu, 0, stat);

return IRQ_HANDLED;
}

int
spu_irq_class_0_bottom(struct spu *spu)
{
unsigned long stat, mask;
unsigned long flags;

spu->class_0_pending = 0;
unsigned long stat;

spin_lock_irqsave(&spu->register_lock, flags);
mask = spu_int_mask_get(spu, 0);
stat = spu_int_stat_get(spu, 0);

stat &= mask;
stat = spu->class_0_pending;
spu->class_0_pending = 0;

if (stat & 1) /* invalid DMA alignment */
__spu_trap_dma_align(spu);
Expand All @@ -267,7 +274,6 @@ spu_irq_class_0_bottom(struct spu *spu)
if (stat & 4) /* error on SPU */
__spu_trap_error(spu);

spu_int_stat_clear(spu, 0, stat);
spin_unlock_irqrestore(&spu->register_lock, flags);

return (stat & 0x7) ? -EIO : 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/ps3/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ enum ps3_dev_type {
PS3_DEV_TYPE_STOR_ROM = TYPE_ROM, /* 5 */
PS3_DEV_TYPE_SB_GPIO = 6,
PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC, /* 14 */
PS3_DEV_TYPE_STOR_DUMMY = 32,
PS3_DEV_TYPE_NOACCESS = 255,
};

Expand Down
29 changes: 29 additions & 0 deletions trunk/arch/powerpc/platforms/ps3/repository.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,35 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
return result;
}

if (tmp.bus_type == PS3_BUS_TYPE_STORAGE) {
/*
* A storage device may show up in the repository before the
* hypervisor has finished probing its type and regions
*/
unsigned int num_regions;

if (tmp.dev_type == PS3_DEV_TYPE_STOR_DUMMY) {
pr_debug("%s:%u storage device not ready\n", __func__,
__LINE__);
return -ENODEV;
}

result = ps3_repository_read_stor_dev_num_regions(tmp.bus_index,
tmp.dev_index,
&num_regions);
if (result) {
pr_debug("%s:%d read_stor_dev_num_regions failed\n",
__func__, __LINE__);
return result;
}

if (!num_regions) {
pr_debug("%s:%u storage device has no regions yet\n",
__func__, __LINE__);
return -ENODEV;
}
}

result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index,
&tmp.dev_id);

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/platforms/ps3/spu.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ static void mfc_sr1_set(struct spu *spu, u64 sr1)
static const u64 allowed = ~(MFC_STATE1_LOCAL_STORAGE_DECODE_MASK
| MFC_STATE1_PROBLEM_STATE_MASK);

sr1 |= MFC_STATE1_MASTER_RUN_CONTROL_MASK;

BUG_ON((sr1 & allowed) != (spu_pdata(spu)->cache.sr1 & allowed));

spu_pdata(spu)->cache.sr1 = sr1;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/linux-2.6/kmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ extern void *kmem_zone_zalloc(kmem_zone_t *, unsigned int __nocast);
static inline int
kmem_shake_allow(gfp_t gfp_mask)
{
return (gfp_mask & __GFP_WAIT);
return (gfp_mask & __GFP_WAIT) != 0;
}

#endif /* __XFS_SUPPORT_KMEM_H__ */
8 changes: 4 additions & 4 deletions trunk/fs/xfs/linux-2.6/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ xfs_probe_cluster(

for (i = 0; i < pagevec_count(&pvec); i++) {
struct page *page = pvec.pages[i];
size_t pg_offset, len = 0;
size_t pg_offset, pg_len = 0;

if (tindex == tlast) {
pg_offset =
Expand All @@ -665,16 +665,16 @@ xfs_probe_cluster(
pg_offset = PAGE_CACHE_SIZE;

if (page->index == tindex && !TestSetPageLocked(page)) {
len = xfs_probe_page(page, pg_offset, mapped);
pg_len = xfs_probe_page(page, pg_offset, mapped);
unlock_page(page);
}

if (!len) {
if (!pg_len) {
done = 1;
break;
}

total += len;
total += pg_len;
tindex++;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/linux-2.6/xfs_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ xfs_param_t xfs_params = {
.inherit_nosym = { 0, 0, 1 },
.rotorstep = { 1, 1, 255 },
.inherit_nodfrg = { 0, 1, 1 },
.fstrm_timer = { 1, 50, 3600*100},
.fstrm_timer = { 1, 30*100, 3600*100},
};

/*
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/xfs/quota/xfs_qm.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ xfs_Gqm_init(void)
* Initialize the dquot hash tables.
*/
udqhash = kmem_zalloc_greedy(&hsize,
XFS_QM_HASHSIZE_LOW, XFS_QM_HASHSIZE_HIGH,
XFS_QM_HASHSIZE_LOW * sizeof(xfs_dqhash_t),
XFS_QM_HASHSIZE_HIGH * sizeof(xfs_dqhash_t),
KM_SLEEP | KM_MAYFAIL | KM_LARGE);
gdqhash = kmem_zalloc(hsize, KM_SLEEP | KM_LARGE);
hsize /= sizeof(xfs_dqhash_t);
Expand Down
10 changes: 6 additions & 4 deletions trunk/fs/xfs/support/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ extern void cmn_err(int, char *, ...)
extern void assfail(char *expr, char *f, int l);

#define ASSERT_ALWAYS(expr) \
(unlikely((expr) != 0) ? (void)0 : assfail(#expr, __FILE__, __LINE__))
(unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))

#ifndef DEBUG
# define ASSERT(expr) ((void)0)
#define ASSERT(expr) ((void)0)

#ifndef STATIC
# define STATIC static noinline
Expand All @@ -49,8 +49,10 @@ extern void assfail(char *expr, char *f, int l);

#else /* DEBUG */

# define ASSERT(expr) ASSERT_ALWAYS(expr)
# include <linux/random.h>
#include <linux/random.h>

#define ASSERT(expr) \
(unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))

#ifndef STATIC
# define STATIC noinline
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/xfs/xfs_da_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,6 @@ xfs_da_do_buf(
error = mappedbno == -2 ? 0 : XFS_ERROR(EFSCORRUPTED);
if (unlikely(error == EFSCORRUPTED)) {
if (xfs_error_level >= XFS_ERRLEVEL_LOW) {
int i;
cmn_err(CE_ALERT, "xfs_da_do_buf: bno %lld\n",
(long long)bno);
cmn_err(CE_ALERT, "dir: inode %lld\n",
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 @@ -2185,13 +2185,13 @@ xlog_state_do_callback(
}
cb = iclog->ic_callback;

while (cb != 0) {
while (cb) {
iclog->ic_callback_tail = &(iclog->ic_callback);
iclog->ic_callback = NULL;
LOG_UNLOCK(log, s);

/* perform callbacks in the order given */
for (; cb != 0; cb = cb_next) {
for (; cb; cb = cb_next) {
cb_next = cb->cb_next;
cb->cb_func(cb->cb_arg, aborted);
}
Expand All @@ -2202,7 +2202,7 @@ xlog_state_do_callback(
loopdidcallbacks++;
funcdidcallbacks++;

ASSERT(iclog->ic_callback == 0);
ASSERT(iclog->ic_callback == NULL);
if (!(iclog->ic_state & XLOG_STATE_IOERROR))
iclog->ic_state = XLOG_STATE_DIRTY;

Expand Down Expand Up @@ -3242,10 +3242,10 @@ xlog_ticket_put(xlog_t *log,
#else
/* When we debug, it is easier if tickets are cycled */
ticket->t_next = NULL;
if (log->l_tail != 0) {
if (log->l_tail) {
log->l_tail->t_next = ticket;
} else {
ASSERT(log->l_freelist == 0);
ASSERT(log->l_freelist == NULL);
log->l_freelist = ticket;
}
log->l_tail = ticket;
Expand Down Expand Up @@ -3463,7 +3463,7 @@ xlog_verify_iclog(xlog_t *log,
s = LOG_LOCK(log);
icptr = log->l_iclog;
for (i=0; i < log->l_iclog_bufs; i++) {
if (icptr == 0)
if (icptr == NULL)
xlog_panic("xlog_verify_iclog: invalid ptr");
icptr = icptr->ic_next;
}
Expand Down
12 changes: 6 additions & 6 deletions trunk/fs/xfs/xfs_log_recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ xlog_recover_add_to_cont_trans(
int old_len;

item = trans->r_itemq;
if (item == 0) {
if (item == NULL) {
/* finish copying rest of trans header */
xlog_recover_add_item(&trans->r_itemq);
ptr = (xfs_caddr_t) &trans->r_theader +
Expand Down Expand Up @@ -1412,7 +1412,7 @@ xlog_recover_add_to_trans(
if (!len)
return 0;
item = trans->r_itemq;
if (item == 0) {
if (item == NULL) {
ASSERT(*(uint *)dp == XFS_TRANS_HEADER_MAGIC);
if (len == sizeof(xfs_trans_header_t))
xlog_recover_add_item(&trans->r_itemq);
Expand Down Expand Up @@ -1467,12 +1467,12 @@ xlog_recover_unlink_tid(
xlog_recover_t *tp;
int found = 0;

ASSERT(trans != 0);
ASSERT(trans != NULL);
if (trans == *q) {
*q = (*q)->r_next;
} else {
tp = *q;
while (tp != 0) {
while (tp) {
if (tp->r_next == trans) {
found = 1;
break;
Expand All @@ -1495,7 +1495,7 @@ xlog_recover_insert_item_backq(
xlog_recover_item_t **q,
xlog_recover_item_t *item)
{
if (*q == 0) {
if (*q == NULL) {
item->ri_prev = item->ri_next = item;
*q = item;
} else {
Expand Down Expand Up @@ -1899,7 +1899,7 @@ xlog_recover_do_reg_buffer(
break;
nbits = xfs_contig_bits(data_map, map_size, bit);
ASSERT(nbits > 0);
ASSERT(item->ri_buf[i].i_addr != 0);
ASSERT(item->ri_buf[i].i_addr != NULL);
ASSERT(item->ri_buf[i].i_len % XFS_BLI_CHUNK == 0);
ASSERT(XFS_BUF_COUNT(bp) >=
((uint)bit << XFS_BLI_SHIFT)+(nbits<<XFS_BLI_SHIFT));
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-powerpc/spu.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ struct spu {
u64 flags;
u64 dar;
u64 dsisr;
u64 class_0_pending;
size_t ls_size;
unsigned int slb_replace;
struct mm_struct *mm;
Expand All @@ -138,7 +139,6 @@ struct spu {
unsigned long long timestamp;
pid_t pid;
pid_t tgid;
int class_0_pending;
spinlock_t register_lock;

void (* wbox_callback)(struct spu *spu);
Expand Down

0 comments on commit b49634d

Please sign in to comment.