mirror of
https://github.com/torvalds/linux.git
synced 2024-10-24 14:10:59 +00:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: dv1394: fix possible deadlock in multithreaded clients ieee1394: raw1394: fix possible deadlock in multithreaded clients ieee1394: struct device - replace bus_id with dev_name(), dev_set_name() firewire: struct device - replace bus_id with dev_name(), dev_set_name()
This commit is contained in:
commit
6572a281cf
|
@ -587,8 +587,7 @@ static void create_units(struct fw_device *device)
|
||||||
unit->device.bus = &fw_bus_type;
|
unit->device.bus = &fw_bus_type;
|
||||||
unit->device.type = &fw_unit_type;
|
unit->device.type = &fw_unit_type;
|
||||||
unit->device.parent = &device->device;
|
unit->device.parent = &device->device;
|
||||||
snprintf(unit->device.bus_id, sizeof(unit->device.bus_id),
|
dev_set_name(&unit->device, "%s.%d", dev_name(&device->device), i++);
|
||||||
"%s.%d", device->device.bus_id, i++);
|
|
||||||
|
|
||||||
init_fw_attribute_group(&unit->device,
|
init_fw_attribute_group(&unit->device,
|
||||||
fw_unit_attributes,
|
fw_unit_attributes,
|
||||||
|
@ -711,8 +710,7 @@ static void fw_device_init(struct work_struct *work)
|
||||||
device->device.type = &fw_device_type;
|
device->device.type = &fw_device_type;
|
||||||
device->device.parent = device->card->device;
|
device->device.parent = device->card->device;
|
||||||
device->device.devt = MKDEV(fw_cdev_major, minor);
|
device->device.devt = MKDEV(fw_cdev_major, minor);
|
||||||
snprintf(device->device.bus_id, sizeof(device->device.bus_id),
|
dev_set_name(&device->device, "fw%d", minor);
|
||||||
"fw%d", minor);
|
|
||||||
|
|
||||||
init_fw_attribute_group(&device->device,
|
init_fw_attribute_group(&device->device,
|
||||||
fw_device_attributes,
|
fw_device_attributes,
|
||||||
|
@ -741,13 +739,13 @@ static void fw_device_init(struct work_struct *work)
|
||||||
if (device->config_rom_retries)
|
if (device->config_rom_retries)
|
||||||
fw_notify("created device %s: GUID %08x%08x, S%d00, "
|
fw_notify("created device %s: GUID %08x%08x, S%d00, "
|
||||||
"%d config ROM retries\n",
|
"%d config ROM retries\n",
|
||||||
device->device.bus_id,
|
dev_name(&device->device),
|
||||||
device->config_rom[3], device->config_rom[4],
|
device->config_rom[3], device->config_rom[4],
|
||||||
1 << device->max_speed,
|
1 << device->max_speed,
|
||||||
device->config_rom_retries);
|
device->config_rom_retries);
|
||||||
else
|
else
|
||||||
fw_notify("created device %s: GUID %08x%08x, S%d00\n",
|
fw_notify("created device %s: GUID %08x%08x, S%d00\n",
|
||||||
device->device.bus_id,
|
dev_name(&device->device),
|
||||||
device->config_rom[3], device->config_rom[4],
|
device->config_rom[3], device->config_rom[4],
|
||||||
1 << device->max_speed);
|
1 << device->max_speed);
|
||||||
device->config_rom_retries = 0;
|
device->config_rom_retries = 0;
|
||||||
|
@ -883,12 +881,12 @@ static void fw_device_refresh(struct work_struct *work)
|
||||||
FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
|
FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
|
||||||
goto gone;
|
goto gone;
|
||||||
|
|
||||||
fw_notify("refreshed device %s\n", device->device.bus_id);
|
fw_notify("refreshed device %s\n", dev_name(&device->device));
|
||||||
device->config_rom_retries = 0;
|
device->config_rom_retries = 0;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
give_up:
|
give_up:
|
||||||
fw_notify("giving up on refresh of device %s\n", device->device.bus_id);
|
fw_notify("giving up on refresh of device %s\n", dev_name(&device->device));
|
||||||
gone:
|
gone:
|
||||||
atomic_set(&device->state, FW_DEVICE_SHUTDOWN);
|
atomic_set(&device->state, FW_DEVICE_SHUTDOWN);
|
||||||
fw_device_shutdown(work);
|
fw_device_shutdown(work);
|
||||||
|
|
|
@ -2468,7 +2468,7 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
|
||||||
goto fail_self_id;
|
goto fail_self_id;
|
||||||
|
|
||||||
fw_notify("Added fw-ohci device %s, OHCI version %x.%x\n",
|
fw_notify("Added fw-ohci device %s, OHCI version %x.%x\n",
|
||||||
dev->dev.bus_id, version >> 16, version & 0xff);
|
dev_name(&dev->dev), version >> 16, version & 0xff);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_self_id:
|
fail_self_id:
|
||||||
|
|
|
@ -1135,7 +1135,7 @@ static int sbp2_probe(struct device *dev)
|
||||||
tgt->unit = unit;
|
tgt->unit = unit;
|
||||||
kref_init(&tgt->kref);
|
kref_init(&tgt->kref);
|
||||||
INIT_LIST_HEAD(&tgt->lu_list);
|
INIT_LIST_HEAD(&tgt->lu_list);
|
||||||
tgt->bus_id = unit->device.bus_id;
|
tgt->bus_id = dev_name(&unit->device);
|
||||||
tgt->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4];
|
tgt->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4];
|
||||||
|
|
||||||
if (fw_device_enable_phys_dma(device) < 0)
|
if (fw_device_enable_phys_dma(device) < 0)
|
||||||
|
|
|
@ -1270,8 +1270,14 @@ static int dv1394_mmap(struct file *file, struct vm_area_struct *vma)
|
||||||
struct video_card *video = file_to_video_card(file);
|
struct video_card *video = file_to_video_card(file);
|
||||||
int retval = -EINVAL;
|
int retval = -EINVAL;
|
||||||
|
|
||||||
/* serialize mmap */
|
/*
|
||||||
mutex_lock(&video->mtx);
|
* We cannot use the blocking variant mutex_lock here because .mmap
|
||||||
|
* is called with mmap_sem held, while .ioctl, .read, .write acquire
|
||||||
|
* video->mtx and subsequently call copy_to/from_user which will
|
||||||
|
* grab mmap_sem in case of a page fault.
|
||||||
|
*/
|
||||||
|
if (!mutex_trylock(&video->mtx))
|
||||||
|
return -EAGAIN;
|
||||||
|
|
||||||
if ( ! video_card_initialized(video) ) {
|
if ( ! video_card_initialized(video) ) {
|
||||||
retval = do_dv1394_init_default(video);
|
retval = do_dv1394_init_default(video);
|
||||||
|
|
|
@ -155,11 +155,11 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
|
||||||
memcpy(&h->device, &nodemgr_dev_template_host, sizeof(h->device));
|
memcpy(&h->device, &nodemgr_dev_template_host, sizeof(h->device));
|
||||||
h->device.parent = dev;
|
h->device.parent = dev;
|
||||||
set_dev_node(&h->device, dev_to_node(dev));
|
set_dev_node(&h->device, dev_to_node(dev));
|
||||||
snprintf(h->device.bus_id, BUS_ID_SIZE, "fw-host%d", h->id);
|
dev_set_name(&h->device, "fw-host%d", h->id);
|
||||||
|
|
||||||
h->host_dev.parent = &h->device;
|
h->host_dev.parent = &h->device;
|
||||||
h->host_dev.class = &hpsb_host_class;
|
h->host_dev.class = &hpsb_host_class;
|
||||||
snprintf(h->host_dev.bus_id, BUS_ID_SIZE, "fw-host%d", h->id);
|
dev_set_name(&h->host_dev, "fw-host%d", h->id);
|
||||||
|
|
||||||
if (device_register(&h->device))
|
if (device_register(&h->device))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -826,13 +826,11 @@ static struct node_entry *nodemgr_create_node(octlet_t guid,
|
||||||
memcpy(&ne->device, &nodemgr_dev_template_ne,
|
memcpy(&ne->device, &nodemgr_dev_template_ne,
|
||||||
sizeof(ne->device));
|
sizeof(ne->device));
|
||||||
ne->device.parent = &host->device;
|
ne->device.parent = &host->device;
|
||||||
snprintf(ne->device.bus_id, BUS_ID_SIZE, "%016Lx",
|
dev_set_name(&ne->device, "%016Lx", (unsigned long long)(ne->guid));
|
||||||
(unsigned long long)(ne->guid));
|
|
||||||
|
|
||||||
ne->node_dev.parent = &ne->device;
|
ne->node_dev.parent = &ne->device;
|
||||||
ne->node_dev.class = &nodemgr_ne_class;
|
ne->node_dev.class = &nodemgr_ne_class;
|
||||||
snprintf(ne->node_dev.bus_id, BUS_ID_SIZE, "%016Lx",
|
dev_set_name(&ne->node_dev, "%016Lx", (unsigned long long)(ne->guid));
|
||||||
(unsigned long long)(ne->guid));
|
|
||||||
|
|
||||||
if (device_register(&ne->device))
|
if (device_register(&ne->device))
|
||||||
goto fail_devreg;
|
goto fail_devreg;
|
||||||
|
@ -932,13 +930,11 @@ static void nodemgr_register_device(struct node_entry *ne,
|
||||||
|
|
||||||
ud->device.parent = parent;
|
ud->device.parent = parent;
|
||||||
|
|
||||||
snprintf(ud->device.bus_id, BUS_ID_SIZE, "%s-%u",
|
dev_set_name(&ud->device, "%s-%u", dev_name(&ne->device), ud->id);
|
||||||
ne->device.bus_id, ud->id);
|
|
||||||
|
|
||||||
ud->unit_dev.parent = &ud->device;
|
ud->unit_dev.parent = &ud->device;
|
||||||
ud->unit_dev.class = &nodemgr_ud_class;
|
ud->unit_dev.class = &nodemgr_ud_class;
|
||||||
snprintf(ud->unit_dev.bus_id, BUS_ID_SIZE, "%s-%u",
|
dev_set_name(&ud->unit_dev, "%s-%u", dev_name(&ne->device), ud->id);
|
||||||
ne->device.bus_id, ud->id);
|
|
||||||
|
|
||||||
if (device_register(&ud->device))
|
if (device_register(&ud->device))
|
||||||
goto fail_devreg;
|
goto fail_devreg;
|
||||||
|
@ -953,7 +949,7 @@ static void nodemgr_register_device(struct node_entry *ne,
|
||||||
fail_classdevreg:
|
fail_classdevreg:
|
||||||
device_unregister(&ud->device);
|
device_unregister(&ud->device);
|
||||||
fail_devreg:
|
fail_devreg:
|
||||||
HPSB_ERR("Failed to create unit %s", ud->device.bus_id);
|
HPSB_ERR("Failed to create unit %s", dev_name(&ud->device));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2268,7 +2268,8 @@ static ssize_t raw1394_write(struct file *file, const char __user * buffer,
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&fi->state_mutex);
|
if (!mutex_trylock(&fi->state_mutex))
|
||||||
|
return -EAGAIN;
|
||||||
|
|
||||||
switch (fi->state) {
|
switch (fi->state) {
|
||||||
case opened:
|
case opened:
|
||||||
|
@ -2548,7 +2549,8 @@ static int raw1394_mmap(struct file *file, struct vm_area_struct *vma)
|
||||||
struct file_info *fi = file->private_data;
|
struct file_info *fi = file->private_data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
mutex_lock(&fi->state_mutex);
|
if (!mutex_trylock(&fi->state_mutex))
|
||||||
|
return -EAGAIN;
|
||||||
|
|
||||||
if (fi->iso_state == RAW1394_ISO_INACTIVE)
|
if (fi->iso_state == RAW1394_ISO_INACTIVE)
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
|
@ -2669,7 +2671,8 @@ static long raw1394_ioctl(struct file *file, unsigned int cmd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&fi->state_mutex);
|
if (!mutex_trylock(&fi->state_mutex))
|
||||||
|
return -EAGAIN;
|
||||||
|
|
||||||
switch (fi->iso_state) {
|
switch (fi->iso_state) {
|
||||||
case RAW1394_ISO_INACTIVE:
|
case RAW1394_ISO_INACTIVE:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user