Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5885
b: refs/heads/master
c: 852ea22
h: refs/heads/master
i:
  5883: ae4a6d1
v: v3
  • Loading branch information
Ralf Baechle authored and Jeff Garzik committed Aug 18, 2005
1 parent b6c9714 commit cc0f76f
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 78 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: f3ed8b444781158c9c10f48a8eba6795ecec7023
refs/heads/master: 852ea22ab24df4c64c0211c3b6d6358eb0e759f9
36 changes: 9 additions & 27 deletions trunk/arch/sparc64/kernel/us2e_cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ static void frob_mem_refresh(int cpu_slowing_down,
{
unsigned long old_refr_count, refr_count, mctrl;


refr_count = (clock_tick * MCTRL0_REFR_INTERVAL);
refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL);

Expand Down Expand Up @@ -229,25 +230,6 @@ static unsigned long estar_to_divisor(unsigned long estar)
return ret;
}

static unsigned int us2e_freq_get(unsigned int cpu)
{
cpumask_t cpus_allowed;
unsigned long clock_tick, estar;

if (!cpu_online(cpu))
return 0;

cpus_allowed = current->cpus_allowed;
set_cpus_allowed(current, cpumask_of_cpu(cpu));

clock_tick = sparc64_get_clock_tick(cpu) / 1000;
estar = read_hbreg(HBIRD_ESTAR_MODE_ADDR);

set_cpus_allowed(current, cpus_allowed);

return clock_tick / estar_to_divisor(estar);
}

static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
{
unsigned long new_bits, new_freq;
Expand All @@ -261,7 +243,7 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
cpus_allowed = current->cpus_allowed;
set_cpus_allowed(current, cpumask_of_cpu(cpu));

new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000;
new_freq = clock_tick = sparc64_get_clock_tick(cpu);
new_bits = index_to_estar_mode(index);
divisor = index_to_divisor(index);
new_freq /= divisor;
Expand All @@ -276,8 +258,7 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);

if (old_divisor != divisor)
us2e_transition(estar, new_bits, clock_tick * 1000,
old_divisor, divisor);
us2e_transition(estar, new_bits, clock_tick, old_divisor, divisor);

cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);

Expand All @@ -291,8 +272,10 @@ static int us2e_freq_target(struct cpufreq_policy *policy,
unsigned int new_index = 0;

if (cpufreq_frequency_table_target(policy,
&us2e_freq_table[policy->cpu].table[0],
target_freq, relation, &new_index))
&us2e_freq_table[policy->cpu].table[0],
target_freq,
relation,
&new_index))
return -EINVAL;

us2e_set_cpu_divider_index(policy->cpu, new_index);
Expand All @@ -309,7 +292,7 @@ static int us2e_freq_verify(struct cpufreq_policy *policy)
static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
{
unsigned int cpu = policy->cpu;
unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
unsigned long clock_tick = sparc64_get_clock_tick(cpu);
struct cpufreq_frequency_table *table =
&us2e_freq_table[cpu].table[0];

Expand Down Expand Up @@ -368,10 +351,9 @@ static int __init us2e_freq_init(void)
memset(us2e_freq_table, 0,
(NR_CPUS * sizeof(struct us2e_freq_percpu_info)));

driver->init = us2e_freq_cpu_init;
driver->verify = us2e_freq_verify;
driver->target = us2e_freq_target;
driver->get = us2e_freq_get;
driver->init = us2e_freq_cpu_init;
driver->exit = us2e_freq_cpu_exit;
driver->owner = THIS_MODULE,
strcpy(driver->name, "UltraSPARC-IIe");
Expand Down
29 changes: 4 additions & 25 deletions trunk/arch/sparc64/kernel/us3_cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static void write_safari_cfg(unsigned long val)

static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg)
{
unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
unsigned long clock_tick = sparc64_get_clock_tick(cpu);
unsigned long ret;

switch (safari_cfg & SAFARI_CFG_DIV_MASK) {
Expand All @@ -76,26 +76,6 @@ static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg
return ret;
}

static unsigned int us3_freq_get(unsigned int cpu)
{
cpumask_t cpus_allowed;
unsigned long reg;
unsigned int ret;

if (!cpu_online(cpu))
return 0;

cpus_allowed = current->cpus_allowed;
set_cpus_allowed(current, cpumask_of_cpu(cpu));

reg = read_safari_cfg();
ret = get_current_freq(cpu, reg);

set_cpus_allowed(current, cpus_allowed);

return ret;
}

static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index)
{
unsigned long new_bits, new_freq, reg;
Expand All @@ -108,7 +88,7 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index)
cpus_allowed = current->cpus_allowed;
set_cpus_allowed(current, cpumask_of_cpu(cpu));

new_freq = sparc64_get_clock_tick(cpu) / 1000;
new_freq = sparc64_get_clock_tick(cpu);
switch (index) {
case 0:
new_bits = SAFARI_CFG_DIV_1;
Expand Down Expand Up @@ -170,7 +150,7 @@ static int us3_freq_verify(struct cpufreq_policy *policy)
static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
{
unsigned int cpu = policy->cpu;
unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
unsigned long clock_tick = sparc64_get_clock_tick(cpu);
struct cpufreq_frequency_table *table =
&us3_freq_table[cpu].table[0];

Expand Down Expand Up @@ -226,10 +206,9 @@ static int __init us3_freq_init(void)
memset(us3_freq_table, 0,
(NR_CPUS * sizeof(struct us3_freq_percpu_info)));

driver->init = us3_freq_cpu_init;
driver->verify = us3_freq_verify;
driver->target = us3_freq_target;
driver->get = us3_freq_get;
driver->init = us3_freq_cpu_init;
driver->exit = us3_freq_cpu_exit;
driver->owner = THIS_MODULE,
strcpy(driver->name, "UltraSPARC-III");
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/ioc3-eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ static int ioc3_mdio_read(struct net_device *dev, int phy, int reg)
ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG);
while (ioc3_r_micr() & MICR_BUSY);

return ioc3_r_micr() & MIDR_DATA_MASK;
return ioc3_r_midr_r() & MIDR_DATA_MASK;
}

static void ioc3_mdio_write(struct net_device *dev, int phy, int reg, int data)
Expand Down Expand Up @@ -1291,7 +1291,6 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->features = NETIF_F_IP_CSUM;
#endif

ioc3_setup_duplex(ip);
sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1);
sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2);

Expand All @@ -1300,6 +1299,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_stop;

mii_check_media(&ip->mii, 1, 1);
ioc3_setup_duplex(ip);

vendor = (sw_physid1 << 12) | (sw_physid2 >> 4);
model = (sw_physid2 >> 4) & 0x3f;
Expand Down Expand Up @@ -1524,7 +1524,7 @@ static void ioc3_get_drvinfo (struct net_device *dev,
struct ethtool_drvinfo *info)
{
struct ioc3_private *ip = netdev_priv(dev);

strcpy (info->driver, IOC3_NAME);
strcpy (info->version, IOC3_VERSION);
strcpy (info->bus_info, pci_name(ip->pdev));
Expand All @@ -1550,7 +1550,7 @@ static int ioc3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
spin_lock_irq(&ip->ioc3_lock);
rc = mii_ethtool_sset(&ip->mii, cmd);
spin_unlock_irq(&ip->ioc3_lock);

return rc;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ struct net_device loopback_dev = {
.ethtool_ops = &loopback_ethtool_ops,
};

/* Setup and register the loopback device. */
/* Setup and register the of the LOOPBACK device. */
int __init loopback_init(void)
{
struct net_device_stats *stats;
Expand Down
22 changes: 10 additions & 12 deletions trunk/net/802/tr.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,10 @@ void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device *
unsigned int hash;
struct rif_cache *entry;
unsigned char *olddata;
unsigned long flags;
static const unsigned char mcast_func_addr[]
= {0xC0,0x00,0x00,0x04,0x00,0x00};

spin_lock_irqsave(&rif_lock, flags);
spin_lock_bh(&rif_lock);

/*
* Broadcasts are single route as stated in RFC 1042
Expand Down Expand Up @@ -324,7 +323,7 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0],
else
slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8);
olddata = skb->data;
spin_unlock_irqrestore(&rif_lock, flags);
spin_unlock_bh(&rif_lock);

skb_pull(skb, slack);
memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack);
Expand All @@ -338,11 +337,10 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0],
static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
{
unsigned int hash, rii_p = 0;
unsigned long flags;
struct rif_cache *entry;


spin_lock_irqsave(&rif_lock, flags);
spin_lock_bh(&rif_lock);

/*
* Firstly see if the entry exists
Expand Down Expand Up @@ -380,7 +378,7 @@ printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
if(!entry)
{
printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n");
spin_unlock_irqrestore(&rif_lock, flags);
spin_unlock_bh(&rif_lock);
return;
}

Expand Down Expand Up @@ -422,7 +420,7 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
}
entry->last_used=jiffies;
}
spin_unlock_irqrestore(&rif_lock, flags);
spin_unlock_bh(&rif_lock);
}

/*
Expand All @@ -432,9 +430,9 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
static void rif_check_expire(unsigned long dummy)
{
int i;
unsigned long flags, next_interval = jiffies + sysctl_tr_rif_timeout/2;
unsigned long next_interval = jiffies + sysctl_tr_rif_timeout/2;

spin_lock_irqsave(&rif_lock, flags);
spin_lock_bh(&rif_lock);

for(i =0; i < RIF_TABLE_SIZE; i++) {
struct rif_cache *entry, **pentry;
Expand All @@ -456,7 +454,7 @@ static void rif_check_expire(unsigned long dummy)
}
}

spin_unlock_irqrestore(&rif_lock, flags);
spin_unlock_bh(&rif_lock);

mod_timer(&rif_timer, next_interval);

Expand Down Expand Up @@ -487,7 +485,7 @@ static struct rif_cache *rif_get_idx(loff_t pos)

static void *rif_seq_start(struct seq_file *seq, loff_t *pos)
{
spin_lock_irq(&rif_lock);
spin_lock_bh(&rif_lock);

return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN;
}
Expand Down Expand Up @@ -518,7 +516,7 @@ static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos)

static void rif_seq_stop(struct seq_file *seq, void *v)
{
spin_unlock_irq(&rif_lock);
spin_unlock_bh(&rif_lock);
}

static int rif_seq_show(struct seq_file *seq, void *v)
Expand Down
12 changes: 6 additions & 6 deletions trunk/net/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,12 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
{
struct sk_buff *skb;

if (ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param,
icmp_param->data_len+icmp_param->head_len,
icmp_param->head_len,
ipc, rt, MSG_DONTWAIT) < 0)
ip_flush_pending_frames(icmp_socket->sk);
else if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) {
ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param,
icmp_param->data_len+icmp_param->head_len,
icmp_param->head_len,
ipc, rt, MSG_DONTWAIT);

if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) {
struct icmphdr *icmph = skb->h.icmph;
unsigned int csum = 0;
struct sk_buff *skb1;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/ipcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ static struct crypto_tfm **ipcomp_alloc_tfms(const char *alg_name)
int cpu;

/* This can be any valid CPU ID so we don't need locking. */
cpu = raw_smp_processor_id();
cpu = smp_processor_id();

list_for_each_entry(pos, &ipcomp_tfms_list, list) {
struct crypto_tfm *tfm;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/ipcomp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ static struct crypto_tfm **ipcomp6_alloc_tfms(const char *alg_name)
int cpu;

/* This can be any valid CPU ID so we don't need locking. */
cpu = raw_smp_processor_id();
cpu = smp_processor_id();

list_for_each_entry(pos, &ipcomp6_tfms_list, list) {
struct crypto_tfm *tfm;
Expand Down

0 comments on commit cc0f76f

Please sign in to comment.