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 292996 Details for
Bug 429951
[firewire] unable to use disk (fw_sbp2: failed to login to ...)
[?]
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]
RHEL5 backport of sbp2 login failure fixes
rhel5-firewire-sbp2-login-fixes.patch (text/plain), 8.78 KB, created by
Jarod Wilson
on 2008-01-25 21:00:42 UTC
(
hide
)
Description:
RHEL5 backport of sbp2 login failure fixes
Filename:
MIME Type:
Creator:
Jarod Wilson
Created:
2008-01-25 21:00:42 UTC
Size:
8.78 KB
patch
obsolete
>--- linux-2.6.18.noarch/drivers/firewire/fw-sbp2.c 2008-01-25 14:32:18.000000000 -0500 >+++ linux-2.6.18.noarch.fw/drivers/firewire/fw-sbp2.c 2008-01-25 15:46:03.000000000 -0500 >@@ -146,18 +146,27 @@ struct sbp2_target { > int address_high; > unsigned workarounds; > struct list_head lu_list; >+ >+ unsigned int mgt_orb_timeout; >+ unsigned int orb_size; > }; > >+/* >+ * Per section 7.4.8 of the SBP-2 spec, a mgt_ORB_timeout value can be >+ * provided in the config rom. Most devices do provide a value, which >+ * we'll use for login management orbs, but with some sane limits. >+ */ >+#define SBP2_MIN_LOGIN_ORB_TIMEOUT 5000 /* Timeout in ms */ >+#define SBP2_MAX_LOGIN_ORB_TIMEOUT 40000 /* Timeout in ms */ >+#define SBP2_ORB_TIMEOUT 2000 /* Timeout in ms */ > #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000 >-#define SBP2_MAX_SECTORS 255 /* Max sectors supported */ >-#define SBP2_ORB_TIMEOUT 200000 /* Timeout in ms */ >- > #define SBP2_ORB_NULL 0x80000000 > > #define SBP2_DIRECTION_TO_MEDIA 0x0 > #define SBP2_DIRECTION_FROM_MEDIA 0x1 > > /* Unit directory keys */ >+#define SBP2_CSR_UNIT_CHARACTERISTICS 0x3a > #define SBP2_CSR_FIRMWARE_REVISION 0x3c > #define SBP2_CSR_LOGICAL_UNIT_NUMBER 0x14 > #define SBP2_CSR_LOGICAL_UNIT_DIRECTORY 0xd4 >@@ -219,7 +228,7 @@ struct sbp2_orb { > #define MANAGEMENT_ORB_LUN(v) ((v)) > #define MANAGEMENT_ORB_FUNCTION(v) ((v) << 16) > #define MANAGEMENT_ORB_RECONNECT(v) ((v) << 20) >-#define MANAGEMENT_ORB_EXCLUSIVE(v) ((v) ? 1 << 28 : 0) >+#define MANAGEMENT_ORB_EXCLUSIVE(v) ((v) ? 1 << 28 : 0) > #define MANAGEMENT_ORB_REQUEST_FORMAT(v) ((v) << 29) > #define MANAGEMENT_ORB_NOTIFY ((1) << 31) > >@@ -305,6 +314,7 @@ static const struct { > .model = ~0, > .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, > }, >+ > /* > * There are iPods (2nd gen, 3rd gen) with model_id == 0, but > * these iPods do not feature the read_capacity bug according >@@ -404,7 +414,7 @@ complete_transaction(struct fw_card *car > * been set and only does the cleanup if the transaction > * failed and we didn't already get a status write. > */ >- spin_lock_irqsave(&card->lock, flags); >+ spin_lock_irqsave(&card->lock, flags); > if (orb->rcode == -1) > orb->rcode = rcode; > if (orb->rcode != RCODE_COMPLETE) { >@@ -472,7 +482,7 @@ static void > complete_management_orb(struct sbp2_orb *base_orb, struct sbp2_status *status) > { > struct sbp2_management_orb *orb = >- container_of(base_orb, struct sbp2_management_orb, base); >+ container_of(base_orb, struct sbp2_management_orb, base); > > if (status) > memcpy(&orb->status, status, sizeof(*status)); >@@ -486,6 +496,7 @@ sbp2_send_management_orb(struct sbp2_log > { > struct fw_device *device = fw_device(lu->tgt->unit->device.parent); > struct sbp2_management_orb *orb; >+ unsigned int rom_timeout, timeout; > int retval = -ENOMEM; > > orb = kzalloc(sizeof(*orb), GFP_ATOMIC); >@@ -516,6 +527,16 @@ sbp2_send_management_orb(struct sbp2_log > orb->request.misc |= > MANAGEMENT_ORB_EXCLUSIVE(sbp2_param_exclusive_login) | > MANAGEMENT_ORB_RECONNECT(0); >+ rom_timeout = lu->tgt->mgt_orb_timeout * 500; /* in ms */ >+ timeout = min((unsigned int) SBP2_MAX_LOGIN_ORB_TIMEOUT, >+ max(rom_timeout, >+ (unsigned int) SBP2_MIN_LOGIN_ORB_TIMEOUT)); >+ if (rom_timeout != timeout) >+ fw_notify("Device config rom gave us a %ds management " >+ "ORB timeout, overriding to %ds\n", >+ rom_timeout / 1000, timeout / 1000); >+ } else { >+ timeout = SBP2_ORB_TIMEOUT; > } > > fw_memcpy_to_be32(&orb->request, &orb->request, sizeof(orb->request)); >@@ -528,12 +549,11 @@ sbp2_send_management_orb(struct sbp2_log > sizeof(orb->request), DMA_TO_DEVICE); > if (dma_mapping_error(orb->base.request_bus)) > goto fail_mapping_request; >- >+ > sbp2_send_orb(&orb->base, lu, node_id, generation, > lu->tgt->management_agent_address); > >- wait_for_completion_timeout(&orb->done, >- msecs_to_jiffies(SBP2_ORB_TIMEOUT)); >+ wait_for_completion_timeout(&orb->done, msecs_to_jiffies(timeout)); > > retval = -EIO; > if (sbp2_cancel_orbs(lu) == 0) { >@@ -681,9 +701,10 @@ static void sbp2_login(void *w) > struct sbp2_login_response response; > int generation, node_id, local_node_id; > >- generation = device->card->generation; >- node_id = device->node->node_id; >- local_node_id = device->card->local_node->node_id; >+ generation = device->generation; >+ smp_rmb(); /* node_id must not be older than generation */ >+ node_id = device->node_id; >+ local_node_id = device->card->node_id; > > if (sbp2_send_management_orb(lu, node_id, generation, > SBP2_LOGIN_REQUEST, lu->lun, &response) < 0) { >@@ -694,7 +715,7 @@ static void sbp2_login(void *w) > unit->device.bus_id, lu->lun); > goto out; > } >- lu->generation = generation; >+ lu->generation = generation; > lu->tgt->node_id = node_id; > lu->tgt->address_high = local_node_id << 16; > >@@ -806,6 +827,11 @@ static int sbp2_scan_unit_dir(struct sbp > *firmware_revision = value; > break; > >+ case SBP2_CSR_UNIT_CHARACTERISTICS: >+ tgt->mgt_orb_timeout = value >> 8 & 0xff; >+ tgt->orb_size = value & 0xff; >+ break; >+ > case SBP2_CSR_LOGICAL_UNIT_NUMBER: > if (sbp2_add_logical_unit(tgt, value) < 0) > return -ENOMEM; >@@ -843,10 +869,10 @@ static void sbp2_init_workarounds(struct > if (sbp2_workarounds_table[i].model != model && > sbp2_workarounds_table[i].model != ~0) > continue; >+ > w |= sbp2_workarounds_table[i].workarounds; > break; > } >- > out: > if (w) > fw_notify("Workarounds for %s: 0x%x " >@@ -926,14 +952,15 @@ static void sbp2_reconnect(void *w) > { > struct work_struct *work = w; > struct sbp2_logical_unit *lu = >- container_of(work, struct sbp2_logical_unit, work); >+ container_of(work, struct sbp2_logical_unit, work); > struct fw_unit *unit = lu->tgt->unit; > struct fw_device *device = fw_device(unit->device.parent); > int generation, node_id, local_node_id; > >- generation = device->card->generation; >- node_id = device->node->node_id; >- local_node_id = device->card->local_node->node_id; >+ generation = device->generation; >+ smp_rmb(); /* node_id must not be older than generation */ >+ node_id = device->node_id; >+ local_node_id = device->card->node_id; > > if (sbp2_send_management_orb(lu, node_id, generation, > SBP2_RECONNECT_REQUEST, >@@ -949,12 +976,13 @@ static void sbp2_reconnect(void *w) > goto out; > } > >- lu->generation = generation; >+ lu->generation = generation; > lu->tgt->node_id = node_id; > lu->tgt->address_high = local_node_id << 16; > > fw_notify("reconnected to %s LUN %04x (%d retries)\n", > unit->device.bus_id, lu->lun, lu->retries); >+ > sbp2_agent_reset(lu); > sbp2_cancel_orbs(lu); > out: >@@ -1156,6 +1184,7 @@ sbp2_map_scatterlist(struct sbp2_command > sizeof(orb->page_table), DMA_TO_DEVICE); > if (dma_mapping_error(orb->page_table_bus)) > goto fail_page_table; >+ > /* > * The data_descriptor pointer is the one case where we need > * to fill in the node ID part of the address. All other >@@ -1163,7 +1192,6 @@ sbp2_map_scatterlist(struct sbp2_command > * initiator (i.e. us), but data_descriptor can refer to data > * on other nodes so we need to put our ID in descriptor.high. > */ >- > orb->request.data_descriptor.high = lu->tgt->address_high; > orb->request.data_descriptor.low = orb->page_table_bus; > orb->request.misc |= >@@ -1208,9 +1236,9 @@ static int sbp2_scsi_queuecommand(struct > > /* Initialize rcode to something not RCODE_COMPLETE. */ > orb->base.rcode = -1; >- > kref_init(&orb->base.kref); >- orb->lu = lu; >+ >+ orb->lu = lu; > orb->done = done; > orb->cmd = cmd; > >@@ -1249,7 +1277,7 @@ static int sbp2_scsi_queuecommand(struct > > orb->base.request_bus = > dma_map_single(device->card->device, &orb->request, >- sizeof(orb->request), DMA_TO_DEVICE); >+ sizeof(orb->request), DMA_TO_DEVICE); > if (dma_mapping_error(orb->base.request_bus)) > goto out; > >@@ -1285,8 +1313,10 @@ static int sbp2_scsi_slave_configure(str > if (sdev->type == TYPE_DISK && > lu->tgt->workarounds & SBP2_WORKAROUND_MODE_SENSE_8) > sdev->skip_ms_page_8 = 1; >+ > if (lu->tgt->workarounds & SBP2_WORKAROUND_FIX_CAPACITY) > sdev->fix_capacity = 1; >+ > if (lu->tgt->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS) > blk_queue_max_sectors(sdev->request_queue, 128 * 1024 / 512); > >@@ -1304,6 +1334,7 @@ static int sbp2_scsi_abort(struct scsi_c > fw_notify("sbp2_scsi_abort\n"); > sbp2_agent_reset(lu); > sbp2_cancel_orbs(lu); >+ > return SUCCESS; > } > >@@ -1324,8 +1355,10 @@ sbp2_sysfs_ieee1394_id_show(struct devic > > if (!sdev) > return 0; >+ > lu = sdev->hostdata; > device = fw_device(lu->tgt->unit->device.parent); >+ > return sprintf(buf, "%08x%08x:%06x:%04x\n", > device->config_rom[3], device->config_rom[4], > lu->tgt->directory_id, lu->lun); >@@ -1369,7 +1402,7 @@ static int __init sbp2_init(void) > sbp2_wq = create_singlethread_workqueue(KBUILD_MODNAME); > if (!sbp2_wq) > return -ENOMEM; >- >+ > return driver_register(&sbp2_driver.driver); > } >
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 429951
: 292996