aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/fw-ohci.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 67588326ae56..c9b9081831da 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -984,8 +984,10 @@ static void bus_reset_tasklet(unsigned long data)
984 */ 984 */
985 985
986 if (ohci->next_config_rom != NULL) { 986 if (ohci->next_config_rom != NULL) {
987 free_rom = ohci->config_rom; 987 if (ohci->next_config_rom != ohci->config_rom) {
988 free_rom_bus = ohci->config_rom_bus; 988 free_rom = ohci->config_rom;
989 free_rom_bus = ohci->config_rom_bus;
990 }
989 ohci->config_rom = ohci->next_config_rom; 991 ohci->config_rom = ohci->next_config_rom;
990 ohci->config_rom_bus = ohci->next_config_rom_bus; 992 ohci->config_rom_bus = ohci->next_config_rom_bus;
991 ohci->next_config_rom = NULL; 993 ohci->next_config_rom = NULL;
@@ -1161,19 +1163,30 @@ static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
1161 * the right values in the bus reset tasklet. 1163 * the right values in the bus reset tasklet.
1162 */ 1164 */
1163 1165
1164 ohci->next_config_rom = 1166 if (config_rom) {
1165 dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE, 1167 ohci->next_config_rom =
1166 &ohci->next_config_rom_bus, GFP_KERNEL); 1168 dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,
1167 if (ohci->next_config_rom == NULL) 1169 &ohci->next_config_rom_bus,
1168 return -ENOMEM; 1170 GFP_KERNEL);
1171 if (ohci->next_config_rom == NULL)
1172 return -ENOMEM;
1169 1173
1170 memset(ohci->next_config_rom, 0, CONFIG_ROM_SIZE); 1174 memset(ohci->next_config_rom, 0, CONFIG_ROM_SIZE);
1171 fw_memcpy_to_be32(ohci->next_config_rom, config_rom, length * 4); 1175 fw_memcpy_to_be32(ohci->next_config_rom, config_rom, length * 4);
1176 } else {
1177 /*
1178 * In the suspend case, config_rom is NULL, which
1179 * means that we just reuse the old config rom.
1180 */
1181 ohci->next_config_rom = ohci->config_rom;
1182 ohci->next_config_rom_bus = ohci->config_rom_bus;
1183 }
1172 1184
1173 ohci->next_header = config_rom[0]; 1185 ohci->next_header = be32_to_cpu(ohci->next_config_rom[0]);
1174 ohci->next_config_rom[0] = 0; 1186 ohci->next_config_rom[0] = 0;
1175 reg_write(ohci, OHCI1394_ConfigROMhdr, 0); 1187 reg_write(ohci, OHCI1394_ConfigROMhdr, 0);
1176 reg_write(ohci, OHCI1394_BusOptions, config_rom[2]); 1188 reg_write(ohci, OHCI1394_BusOptions,
1189 be32_to_cpu(ohci->next_config_rom[2]));
1177 reg_write(ohci, OHCI1394_ConfigROMmap, ohci->next_config_rom_bus); 1190 reg_write(ohci, OHCI1394_ConfigROMmap, ohci->next_config_rom_bus);
1178 1191
1179 reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000); 1192 reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000);
@@ -1984,7 +1997,7 @@ static int pci_resume(struct pci_dev *pdev)
1984 return err; 1997 return err;
1985 } 1998 }
1986 1999
1987 return ohci_enable(&ohci->card, ohci->config_rom, CONFIG_ROM_SIZE); 2000 return ohci_enable(&ohci->card, NULL, 0);
1988} 2001}
1989#endif 2002#endif
1990 2003