Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211260
b: refs/heads/master
c: ad7725c
h: refs/heads/master
v: v3
  • Loading branch information
Vasiliy Kulikov authored and Liam Girdwood committed Oct 2, 2010
1 parent 7e195f7 commit 015713d
Show file tree
Hide file tree
Showing 28 changed files with 154 additions and 205 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: 3c06806e690885ce978ef180c8f8b6f8c17fb4b4
refs/heads/master: ad7725cb43b8badb2fec2c2bfca07c067f2e19a7
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/512x/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
int id_match = 0;

if (dev == NULL || id == NULL)
return clk;
return NULL;

mutex_lock(&clocks_mutex);
list_for_each_entry(p, &clocks, node) {
Expand Down
9 changes: 3 additions & 6 deletions trunk/arch/powerpc/platforms/52xx/efika.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static void __init efika_pcisetup(void)
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING EFIKA_PLATFORM_NAME
": Can't get bus-range for %s\n", pcictrl->full_name);
goto out_put;
return;
}

if (bus_range[1] == bus_range[0])
Expand All @@ -111,22 +111,19 @@ static void __init efika_pcisetup(void)
printk(" controlled by %s\n", pcictrl->full_name);
printk("\n");

hose = pcibios_alloc_controller(pcictrl);
hose = pcibios_alloc_controller(of_node_get(pcictrl));
if (!hose) {
printk(KERN_WARNING EFIKA_PLATFORM_NAME
": Can't allocate PCI controller structure for %s\n",
pcictrl->full_name);
goto out_put;
return;
}

hose->first_busno = bus_range[0];
hose->last_busno = bus_range[1];
hose->ops = &rtas_pci_ops;

pci_process_bridge_OF_ranges(hose, pcictrl, 0);
return;
out_put:
of_node_put(pcictrl);
}

#else
Expand Down
8 changes: 2 additions & 6 deletions trunk/arch/powerpc/platforms/52xx/mpc52xx_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,12 @@ int mpc5200_psc_ac97_gpio_reset(int psc_number)
clrbits32(&simple_gpio->simple_dvo, sync | out);
clrbits8(&wkup_gpio->wkup_dvo, reset);

/* wait for 1 us */
udelay(1);
/* wait at lease 1 us */
udelay(2);

/* Deassert reset */
setbits8(&wkup_gpio->wkup_dvo, reset);

/* wait at least 200ns */
/* 7 ~= (200ns * timebase) / ns2sec */
__delay(7);

/* Restore pin-muxing */
out_be32(&simple_gpio->port_config, mux);

Expand Down
17 changes: 14 additions & 3 deletions trunk/arch/um/drivers/net_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,18 @@ static void uml_net_tx_timeout(struct net_device *dev)
netif_wake_queue(dev);
}

static int uml_net_set_mac(struct net_device *dev, void *addr)
{
struct uml_net_private *lp = netdev_priv(dev);
struct sockaddr *hwaddr = addr;

spin_lock_irq(&lp->lock);
eth_mac_addr(dev, hwaddr->sa_data);
spin_unlock_irq(&lp->lock);

return 0;
}

static int uml_net_change_mtu(struct net_device *dev, int new_mtu)
{
dev->mtu = new_mtu;
Expand Down Expand Up @@ -361,7 +373,7 @@ static const struct net_device_ops uml_netdev_ops = {
.ndo_start_xmit = uml_net_start_xmit,
.ndo_set_multicast_list = uml_net_set_multicast_list,
.ndo_tx_timeout = uml_net_tx_timeout,
.ndo_set_mac_address = eth_mac_addr,
.ndo_set_mac_address = uml_net_set_mac,
.ndo_change_mtu = uml_net_change_mtu,
.ndo_validate_addr = eth_validate_addr,
};
Expand Down Expand Up @@ -460,8 +472,7 @@ static void eth_configure(int n, void *init, char *mac,
((*transport->user->init)(&lp->user, dev) != 0))
goto out_unregister;

/* don't use eth_mac_addr, it will not work here */
memcpy(dev->dev_addr, device->mac, ETH_ALEN);
eth_mac_addr(dev, device->mac);
dev->mtu = transport->user->mtu;
dev->netdev_ops = &uml_netdev_ops;
dev->ethtool_ops = &uml_net_ethtool_ops;
Expand Down
18 changes: 6 additions & 12 deletions trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle)
return -ENODEV;

out_obj = output.pointer;
if (out_obj->type != ACPI_TYPE_BUFFER) {
ret = -ENODEV;
goto out_free;
}
if (out_obj->type != ACPI_TYPE_BUFFER)
return -ENODEV;

errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
if (errors) {
ret = -ENODEV;
goto out_free;
}
if (errors)
return -ENODEV;

supported = *((u32 *)(out_obj->buffer.pointer + 4));
if (!(supported & 0x1)) {
ret = -ENODEV;
goto out_free;
}
if (!(supported & 0x1))
return -ENODEV;

out_free:
kfree(output.pointer);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,9 +1787,9 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv)
}
}

diff = div_u64(diff, diff1);
div_u64(diff, diff1);
ret = ((m * diff) + c);
ret = div_u64(ret, 10);
div_u64(ret, 10);

dev_priv->last_count1 = total_count;
dev_priv->last_time1 = now;
Expand Down Expand Up @@ -1858,7 +1858,7 @@ void i915_update_gfx_val(struct drm_i915_private *dev_priv)

/* More magic constants... */
diff = diff * 1181;
diff = div_u64(diff, diffms * 10);
div_u64(diff, diffms * 10);
dev_priv->gfx_power = diff;
}

Expand Down
46 changes: 20 additions & 26 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,17 +469,14 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
return -ENOENT;
obj_priv = to_intel_bo(obj);

/* Bounds check source. */
if (args->offset > obj->size || args->size > obj->size - args->offset) {
ret = -EINVAL;
goto err;
}

if (!access_ok(VERIFY_WRITE,
(char __user *)(uintptr_t)args->data_ptr,
args->size)) {
ret = -EFAULT;
goto err;
/* Bounds check source.
*
* XXX: This could use review for overflow issues...
*/
if (args->offset > obj->size || args->size > obj->size ||
args->offset + args->size > obj->size) {
drm_gem_object_unreference_unlocked(obj);
return -EINVAL;
}

if (i915_gem_object_needs_bit17_swizzle(obj)) {
Expand All @@ -491,8 +488,8 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
file_priv);
}

err:
drm_gem_object_unreference_unlocked(obj);

return ret;
}

Expand Down Expand Up @@ -581,6 +578,8 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev, struct drm_gem_object *obj,

user_data = (char __user *) (uintptr_t) args->data_ptr;
remain = args->size;
if (!access_ok(VERIFY_READ, user_data, remain))
return -EFAULT;


mutex_lock(&dev->struct_mutex);
Expand Down Expand Up @@ -933,17 +932,14 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
return -ENOENT;
obj_priv = to_intel_bo(obj);

/* Bounds check destination. */
if (args->offset > obj->size || args->size > obj->size - args->offset) {
ret = -EINVAL;
goto err;
}

if (!access_ok(VERIFY_READ,
(char __user *)(uintptr_t)args->data_ptr,
args->size)) {
ret = -EFAULT;
goto err;
/* Bounds check destination.
*
* XXX: This could use review for overflow issues...
*/
if (args->offset > obj->size || args->size > obj->size ||
args->offset + args->size > obj->size) {
drm_gem_object_unreference_unlocked(obj);
return -EINVAL;
}

/* We can only do the GTT pwrite on untiled buffers, as otherwise
Expand Down Expand Up @@ -977,8 +973,8 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
DRM_INFO("pwrite failed %d\n", ret);
#endif

err:
drm_gem_object_unreference_unlocked(obj);

return ret;
}

Expand Down Expand Up @@ -3260,8 +3256,6 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj,
(int) reloc->offset,
reloc->read_domains,
reloc->write_domain);
drm_gem_object_unreference(target_obj);
i915_gem_object_unpin(obj);
return -EINVAL;
}
if (reloc->write_domain & I915_GEM_DOMAIN_CPU ||
Expand Down
45 changes: 25 additions & 20 deletions trunk/drivers/gpu/drm/i915/i915_gem_evict.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct list_head eviction_list, unwind_list;
struct drm_i915_gem_object *obj_priv;
struct drm_i915_gem_object *obj_priv, *tmp_obj_priv;
struct list_head *render_iter, *bsd_iter;
int ret = 0;

Expand Down Expand Up @@ -175,34 +175,39 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen
return -ENOSPC;

found:
/* drm_mm doesn't allow any other other operations while
* scanning, therefore store to be evicted objects on a
* temporary list. */
INIT_LIST_HEAD(&eviction_list);
while (!list_empty(&unwind_list)) {
obj_priv = list_first_entry(&unwind_list,
struct drm_i915_gem_object,
evict_list);
list_for_each_entry_safe(obj_priv, tmp_obj_priv,
&unwind_list, evict_list) {
if (drm_mm_scan_remove_block(obj_priv->gtt_space)) {
/* drm_mm doesn't allow any other other operations while
* scanning, therefore store to be evicted objects on a
* temporary list. */
list_move(&obj_priv->evict_list, &eviction_list);
continue;
}
list_del(&obj_priv->evict_list);
drm_gem_object_unreference(&obj_priv->base);
} else
drm_gem_object_unreference(&obj_priv->base);
}

/* Unbinding will emit any required flushes */
while (!list_empty(&eviction_list)) {
obj_priv = list_first_entry(&eviction_list,
struct drm_i915_gem_object,
evict_list);
if (ret == 0)
ret = i915_gem_object_unbind(&obj_priv->base);
list_del(&obj_priv->evict_list);
list_for_each_entry_safe(obj_priv, tmp_obj_priv,
&eviction_list, evict_list) {
#if WATCH_LRU
DRM_INFO("%s: evicting %p\n", __func__, &obj_priv->base);
#endif
ret = i915_gem_object_unbind(&obj_priv->base);
if (ret)
return ret;

drm_gem_object_unreference(&obj_priv->base);
}

return ret;
/* The just created free hole should be on the top of the free stack
* maintained by drm_mm, so this BUG_ON actually executes in O(1).
* Furthermore all accessed data has just recently been used, so it
* should be really fast, too. */
BUG_ON(!drm_mm_search_free(&dev_priv->mm.gtt_space, min_size,
alignment, 0));

return 0;
}

int
Expand Down
Loading

0 comments on commit 015713d

Please sign in to comment.