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: sbp2: remove a workaround for Momobay FX-3A firewire: sbp2: remove a workaround for Momobay FX-3A firewire: sbp2: fix status reception firewire: core: fix topology map response handler firewire: core: fix race with parallel PCI device probe firewire: core: header file cleanup firewire: ohci: fix Self ID Count register mask (safeguard against buffer overflow) ieee1394: raw1394: Do not leak memory on failed trylock.
This commit is contained in:
commit
ff830b8e5f
8 changed files with 34 additions and 36 deletions
|
@ -444,16 +444,13 @@ int fw_card_add(struct fw_card *card,
|
||||||
card->guid = guid;
|
card->guid = guid;
|
||||||
|
|
||||||
mutex_lock(&card_mutex);
|
mutex_lock(&card_mutex);
|
||||||
config_rom = generate_config_rom(card, &length);
|
|
||||||
list_add_tail(&card->link, &card_list);
|
|
||||||
mutex_unlock(&card_mutex);
|
|
||||||
|
|
||||||
|
config_rom = generate_config_rom(card, &length);
|
||||||
ret = card->driver->enable(card, config_rom, length);
|
ret = card->driver->enable(card, config_rom, length);
|
||||||
if (ret < 0) {
|
if (ret == 0)
|
||||||
mutex_lock(&card_mutex);
|
list_add_tail(&card->link, &card_list);
|
||||||
list_del(&card->link);
|
|
||||||
mutex_unlock(&card_mutex);
|
mutex_unlock(&card_mutex);
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -834,7 +834,7 @@ static void handle_topology_map(struct fw_card *card, struct fw_request *request
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct fw_address_handler topology_map = {
|
static struct fw_address_handler topology_map = {
|
||||||
.length = 0x200,
|
.length = 0x400,
|
||||||
.address_callback = handle_topology_map,
|
.address_callback = handle_topology_map,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,20 @@ int fw_core_initiate_bus_reset(struct fw_card *card, int short_reset);
|
||||||
int fw_compute_block_crc(u32 *block);
|
int fw_compute_block_crc(u32 *block);
|
||||||
void fw_schedule_bm_work(struct fw_card *card, unsigned long delay);
|
void fw_schedule_bm_work(struct fw_card *card, unsigned long delay);
|
||||||
|
|
||||||
|
static inline struct fw_card *fw_card_get(struct fw_card *card)
|
||||||
|
{
|
||||||
|
kref_get(&card->kref);
|
||||||
|
|
||||||
|
return card;
|
||||||
|
}
|
||||||
|
|
||||||
|
void fw_card_release(struct kref *kref);
|
||||||
|
|
||||||
|
static inline void fw_card_put(struct fw_card *card)
|
||||||
|
{
|
||||||
|
kref_put(&card->kref, fw_card_release);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -cdev */
|
/* -cdev */
|
||||||
|
|
||||||
|
|
|
@ -1279,8 +1279,8 @@ static void bus_reset_tasklet(unsigned long data)
|
||||||
* the inverted quadlets and a header quadlet, we shift one
|
* the inverted quadlets and a header quadlet, we shift one
|
||||||
* bit extra to get the actual number of self IDs.
|
* bit extra to get the actual number of self IDs.
|
||||||
*/
|
*/
|
||||||
self_id_count = (reg >> 3) & 0x3ff;
|
self_id_count = (reg >> 3) & 0xff;
|
||||||
if (self_id_count == 0) {
|
if (self_id_count == 0 || self_id_count > 252) {
|
||||||
fw_notify("inconsistent self IDs\n");
|
fw_notify("inconsistent self IDs\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -354,8 +354,7 @@ static const struct {
|
||||||
/* DViCO Momobay FX-3A with TSB42AA9A bridge */ {
|
/* DViCO Momobay FX-3A with TSB42AA9A bridge */ {
|
||||||
.firmware_revision = 0x002800,
|
.firmware_revision = 0x002800,
|
||||||
.model = 0x000000,
|
.model = 0x000000,
|
||||||
.workarounds = SBP2_WORKAROUND_DELAY_INQUIRY |
|
.workarounds = SBP2_WORKAROUND_POWER_CONDITION,
|
||||||
SBP2_WORKAROUND_POWER_CONDITION,
|
|
||||||
},
|
},
|
||||||
/* Initio bridges, actually only needed for some older ones */ {
|
/* Initio bridges, actually only needed for some older ones */ {
|
||||||
.firmware_revision = 0x000200,
|
.firmware_revision = 0x000200,
|
||||||
|
@ -425,19 +424,20 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request,
|
||||||
struct sbp2_logical_unit *lu = callback_data;
|
struct sbp2_logical_unit *lu = callback_data;
|
||||||
struct sbp2_orb *orb;
|
struct sbp2_orb *orb;
|
||||||
struct sbp2_status status;
|
struct sbp2_status status;
|
||||||
size_t header_size;
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (tcode != TCODE_WRITE_BLOCK_REQUEST ||
|
if (tcode != TCODE_WRITE_BLOCK_REQUEST ||
|
||||||
length == 0 || length > sizeof(status)) {
|
length < 8 || length > sizeof(status)) {
|
||||||
fw_send_response(card, request, RCODE_TYPE_ERROR);
|
fw_send_response(card, request, RCODE_TYPE_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
header_size = min(length, 2 * sizeof(u32));
|
status.status = be32_to_cpup(payload);
|
||||||
fw_memcpy_from_be32(&status, payload, header_size);
|
status.orb_low = be32_to_cpup(payload + 4);
|
||||||
if (length > header_size)
|
memset(status.data, 0, sizeof(status.data));
|
||||||
memcpy(status.data, payload + 8, length - header_size);
|
if (length > 8)
|
||||||
|
memcpy(status.data, payload + 8, length - 8);
|
||||||
|
|
||||||
if (STATUS_GET_SOURCE(status) == 2 || STATUS_GET_SOURCE(status) == 3) {
|
if (STATUS_GET_SOURCE(status) == 2 || STATUS_GET_SOURCE(status) == 3) {
|
||||||
fw_notify("non-orb related status write, not handled\n");
|
fw_notify("non-orb related status write, not handled\n");
|
||||||
fw_send_response(card, request, RCODE_COMPLETE);
|
fw_send_response(card, request, RCODE_COMPLETE);
|
||||||
|
|
|
@ -2272,8 +2272,10 @@ static ssize_t raw1394_write(struct file *file, const char __user * buffer,
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mutex_trylock(&fi->state_mutex))
|
if (!mutex_trylock(&fi->state_mutex)) {
|
||||||
|
free_pending_request(req);
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
|
}
|
||||||
|
|
||||||
switch (fi->state) {
|
switch (fi->state) {
|
||||||
case opened:
|
case opened:
|
||||||
|
|
|
@ -372,8 +372,7 @@ static const struct {
|
||||||
/* DViCO Momobay FX-3A with TSB42AA9A bridge */ {
|
/* DViCO Momobay FX-3A with TSB42AA9A bridge */ {
|
||||||
.firmware_revision = 0x002800,
|
.firmware_revision = 0x002800,
|
||||||
.model = 0x000000,
|
.model = 0x000000,
|
||||||
.workarounds = SBP2_WORKAROUND_DELAY_INQUIRY |
|
.workarounds = SBP2_WORKAROUND_POWER_CONDITION,
|
||||||
SBP2_WORKAROUND_POWER_CONDITION,
|
|
||||||
},
|
},
|
||||||
/* Initio bridges, actually only needed for some older ones */ {
|
/* Initio bridges, actually only needed for some older ones */ {
|
||||||
.firmware_revision = 0x000200,
|
.firmware_revision = 0x000200,
|
||||||
|
|
|
@ -134,20 +134,6 @@ struct fw_card {
|
||||||
u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
|
u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline struct fw_card *fw_card_get(struct fw_card *card)
|
|
||||||
{
|
|
||||||
kref_get(&card->kref);
|
|
||||||
|
|
||||||
return card;
|
|
||||||
}
|
|
||||||
|
|
||||||
void fw_card_release(struct kref *kref);
|
|
||||||
|
|
||||||
static inline void fw_card_put(struct fw_card *card)
|
|
||||||
{
|
|
||||||
kref_put(&card->kref, fw_card_release);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct fw_attribute_group {
|
struct fw_attribute_group {
|
||||||
struct attribute_group *groups[2];
|
struct attribute_group *groups[2];
|
||||||
struct attribute_group group;
|
struct attribute_group group;
|
||||||
|
|
Loading…
Add table
Reference in a new issue