Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 292995 Details for
Bug 429950
[firewire] unable to use disk (giving up on config rom)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Initial backport of upstream 'giving up on config rom' fixes
rhel5-firewire-config-rom-fixup.patch (text/plain), 5.66 KB, created by
Jarod Wilson
on 2008-01-25 20:56:23 UTC
(
hide
)
Description:
Initial backport of upstream 'giving up on config rom' fixes
Filename:
MIME Type:
Creator:
Jarod Wilson
Created:
2008-01-25 20:56:23 UTC
Size:
5.66 KB
patch
obsolete
>diff -Naurp linux-2.6.18.noarch/drivers/firewire/fw-cdev.c linux-2.6.18.noarch.fw/drivers/firewire/fw-cdev.c >--- linux-2.6.18.noarch/drivers/firewire/fw-cdev.c 2008-01-25 14:32:18.000000000 -0500 >+++ linux-2.6.18.noarch.fw/drivers/firewire/fw-cdev.c 2008-01-25 15:00:39.000000000 -0500 >@@ -205,12 +205,13 @@ fill_bus_reset_event(struct fw_cdev_even > > event->closure = client->bus_reset_closure; > event->type = FW_CDEV_EVENT_BUS_RESET; >+ event->generation = client->device->generation; >+ smp_rmb(); /* node_id must not be older than generation */ > event->node_id = client->device->node_id; > event->local_node_id = card->local_node->node_id; > event->bm_node_id = 0; /* FIXME: We don't track the BM. */ > event->irm_node_id = card->irm_node->node_id; > event->root_node_id = card->root_node->node_id; >- event->generation = card->generation; > } > > static void >diff -Naurp linux-2.6.18.noarch/drivers/firewire/fw-device.c linux-2.6.18.noarch.fw/drivers/firewire/fw-device.c >--- linux-2.6.18.noarch/drivers/firewire/fw-device.c 2008-01-25 14:32:18.000000000 -0500 >+++ linux-2.6.18.noarch.fw/drivers/firewire/fw-device.c 2008-01-25 15:07:16.000000000 -0500 >@@ -189,9 +189,13 @@ static void fw_device_release(struct dev > > int fw_device_enable_phys_dma(struct fw_device *device) > { >+ int generation = device->generation; >+ >+ /* device->node_id, accessed below, must not be older than generation */ >+ smp_rmb(); > return device->card->driver->enable_phys_dma(device->card, > device->node_id, >- device->generation); >+ generation); > } > EXPORT_SYMBOL(fw_device_enable_phys_dma); > >@@ -390,17 +394,20 @@ complete_transaction(struct fw_card *car > complete(&callback_data->done); > } > >-static int read_rom(struct fw_device *device, int index, u32 * data) >+static int >+read_rom(struct fw_device *device, int generation, int index, u32 * data) > { > struct read_quadlet_callback_data callback_data; > struct fw_transaction t; > u64 offset; > >+ /* device->node_id, accessed below, must not be older than generation */ >+ smp_rmb(); > init_completion(&callback_data.done); > > offset = 0xfffff0000400ULL + index * 4; > fw_send_request(device->card, &t, TCODE_READ_QUADLET_REQUEST, >- device->node_id, device->generation, device->max_speed, >+ device->node_id, generation, device->max_speed, > offset, NULL, 4, complete_transaction, &callback_data); > > wait_for_completion(&callback_data.done); >@@ -410,7 +417,14 @@ static int read_rom(struct fw_device *de > return callback_data.rcode; > } > >-static int read_bus_info_block(struct fw_device *device) >+/* >+ * Read the bus info block, perform a speed probe, and read all of the rest of >+ * the config ROM. We do all this with a cached bus generation. If the bus >+ * generation changes under us, read_bus_info_block will fail and get retried. >+ * It's better to start all over in this case because the node from which we >+ * are reading the ROM may have changed the ROM during the reset. >+ */ >+static int read_bus_info_block(struct fw_device *device, int generation) > { > static u32 rom[256]; > u32 stack[16], sp, key; >@@ -420,7 +434,7 @@ static int read_bus_info_block(struct fw > > /* First read the bus info block. */ > for (i = 0; i < 5; i++) { >- if (read_rom(device, i, &rom[i]) != RCODE_COMPLETE) >+ if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE) > return -1; > /* > * As per IEEE1212 7.2, during power-up, devices can >@@ -455,7 +469,8 @@ static int read_bus_info_block(struct fw > device->max_speed = device->card->link_speed; > > while (device->max_speed > SCODE_100) { >- if (read_rom(device, 0, &dummy) == RCODE_COMPLETE) >+ if (read_rom(device, generation, 0, &dummy) == >+ RCODE_COMPLETE) > break; > device->max_speed--; > } >@@ -488,7 +503,7 @@ static int read_bus_info_block(struct fw > return -1; > > /* Read header quadlet for the block to get the length. */ >- if (read_rom(device, i, &rom[i]) != RCODE_COMPLETE) >+ if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE) > return -1; > end = i + (rom[i] >> 16) + 1; > i++; >@@ -507,7 +522,8 @@ static int read_bus_info_block(struct fw > * it references another block, and push it in that case. > */ > while (i < end) { >- if (read_rom(device, i, &rom[i]) != RCODE_COMPLETE) >+ if (read_rom(device, generation, i, &rom[i]) != >+ RCODE_COMPLETE) > return -1; > if ((key >> 30) == 3 && (rom[i] >> 30) > 1 && > sp < ARRAY_SIZE(stack)) >@@ -647,7 +663,7 @@ static void fw_device_init(void *w) > * device. > */ > >- if (read_bus_info_block(device) < 0) { >+ if (read_bus_info_block(device, device->generation) < 0) { > if (device->config_rom_retries < MAX_RETRIES) { > device->config_rom_retries++; > schedule_delayed_work(&device->work, RETRY_DELAY); >@@ -801,6 +817,7 @@ void fw_node_event(struct fw_card *card, > > device = node->data; > device->node_id = node->node_id; >+ smp_wmb(); /* update node_id before generation */ > device->generation = card->generation; > if (atomic_read(&device->state) == FW_DEVICE_RUNNING) { > PREPARE_WORK(&device->work, fw_device_update, >diff -Naurp linux-2.6.18.noarch/drivers/firewire/fw-topology.c linux-2.6.18.noarch.fw/drivers/firewire/fw-topology.c >--- linux-2.6.18.noarch/drivers/firewire/fw-topology.c 2008-01-25 14:32:18.000000000 -0500 >+++ linux-2.6.18.noarch.fw/drivers/firewire/fw-topology.c 2008-01-25 15:09:22.000000000 -0500 >@@ -518,6 +518,11 @@ fw_core_handle_bus_reset(struct fw_card > card->bm_retries = 0; > > card->node_id = node_id; >+ /* >+ * Update node_id before generation to prevent anybody from using >+ * a stale node_id together with a current generation. >+ */ >+ smp_wmb(); > card->generation = generation; > card->reset_jiffies = jiffies; > schedule_delayed_work(&card->work, 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 429950
: 292995