aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-03 17:47:07 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-03 17:47:07 -0400
commit3ff42e4f13095f5351fe651b8a591e67aabbb1a6 (patch)
treef79324e46352fcd5de2634b188fc3fc0a71dbf27 /drivers
parent7a883eaf62f4b943ebec738ce3b0796c67ef5d32 (diff)
parentae57988f68acdc9fbee649765148f15eb7a1b991 (diff)
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: firewire: fw-core: make two variables static firewire: fw-ohci: dma_free_coherent needs IRQs enabled firewire: fw-sbp2: set correct maximum payload (fixes CardBus adapters) ieee1394: sbp2: more correct Kconfig dependencies ieee1394: revert "sbp2: enforce 32bit DMA mapping"
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/fw-ohci.c20
-rw-r--r--drivers/firewire/fw-sbp2.c5
-rw-r--r--drivers/firewire/fw-transaction.c4
-rw-r--r--drivers/firewire/fw-transaction.h2
-rw-r--r--drivers/ieee1394/Kconfig2
-rw-r--r--drivers/ieee1394/sbp2.c5
6 files changed, 21 insertions, 17 deletions
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index db703758db98..7e427b4c74b5 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -907,6 +907,8 @@ static void bus_reset_tasklet(unsigned long data)
907 int self_id_count, i, j, reg; 907 int self_id_count, i, j, reg;
908 int generation, new_generation; 908 int generation, new_generation;
909 unsigned long flags; 909 unsigned long flags;
910 void *free_rom = NULL;
911 dma_addr_t free_rom_bus = 0;
910 912
911 reg = reg_read(ohci, OHCI1394_NodeID); 913 reg = reg_read(ohci, OHCI1394_NodeID);
912 if (!(reg & OHCI1394_NodeID_idValid)) { 914 if (!(reg & OHCI1394_NodeID_idValid)) {
@@ -970,8 +972,8 @@ static void bus_reset_tasklet(unsigned long data)
970 */ 972 */
971 973
972 if (ohci->next_config_rom != NULL) { 974 if (ohci->next_config_rom != NULL) {
973 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, 975 free_rom = ohci->config_rom;
974 ohci->config_rom, ohci->config_rom_bus); 976 free_rom_bus = ohci->config_rom_bus;
975 ohci->config_rom = ohci->next_config_rom; 977 ohci->config_rom = ohci->next_config_rom;
976 ohci->config_rom_bus = ohci->next_config_rom_bus; 978 ohci->config_rom_bus = ohci->next_config_rom_bus;
977 ohci->next_config_rom = NULL; 979 ohci->next_config_rom = NULL;
@@ -990,6 +992,10 @@ static void bus_reset_tasklet(unsigned long data)
990 992
991 spin_unlock_irqrestore(&ohci->lock, flags); 993 spin_unlock_irqrestore(&ohci->lock, flags);
992 994
995 if (free_rom)
996 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
997 free_rom, free_rom_bus);
998
993 fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation, 999 fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation,
994 self_id_count, ohci->self_id_buffer); 1000 self_id_count, ohci->self_id_buffer);
995} 1001}
@@ -1186,7 +1192,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
1186{ 1192{
1187 struct fw_ohci *ohci; 1193 struct fw_ohci *ohci;
1188 unsigned long flags; 1194 unsigned long flags;
1189 int retval = 0; 1195 int retval = -EBUSY;
1190 __be32 *next_config_rom; 1196 __be32 *next_config_rom;
1191 dma_addr_t next_config_rom_bus; 1197 dma_addr_t next_config_rom_bus;
1192 1198
@@ -1240,10 +1246,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
1240 1246
1241 reg_write(ohci, OHCI1394_ConfigROMmap, 1247 reg_write(ohci, OHCI1394_ConfigROMmap,
1242 ohci->next_config_rom_bus); 1248 ohci->next_config_rom_bus);
1243 } else { 1249 retval = 0;
1244 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
1245 next_config_rom, next_config_rom_bus);
1246 retval = -EBUSY;
1247 } 1250 }
1248 1251
1249 spin_unlock_irqrestore(&ohci->lock, flags); 1252 spin_unlock_irqrestore(&ohci->lock, flags);
@@ -1257,6 +1260,9 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
1257 */ 1260 */
1258 if (retval == 0) 1261 if (retval == 0)
1259 fw_core_initiate_bus_reset(&ohci->card, 1); 1262 fw_core_initiate_bus_reset(&ohci->card, 1);
1263 else
1264 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
1265 next_config_rom, next_config_rom_bus);
1260 1266
1261 return retval; 1267 return retval;
1262} 1268}
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 3e4a369d0057..ba816ef6def1 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -984,6 +984,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
984 struct fw_unit *unit = sd->unit; 984 struct fw_unit *unit = sd->unit;
985 struct fw_device *device = fw_device(unit->device.parent); 985 struct fw_device *device = fw_device(unit->device.parent);
986 struct sbp2_command_orb *orb; 986 struct sbp2_command_orb *orb;
987 unsigned max_payload;
987 988
988 /* 989 /*
989 * Bidirectional commands are not yet implemented, and unknown 990 * Bidirectional commands are not yet implemented, and unknown
@@ -1017,8 +1018,10 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
1017 * specifies the max payload size as 2 ^ (max_payload + 2), so 1018 * specifies the max payload size as 2 ^ (max_payload + 2), so
1018 * if we set this to max_speed + 7, we get the right value. 1019 * if we set this to max_speed + 7, we get the right value.
1019 */ 1020 */
1021 max_payload = min(device->max_speed + 7,
1022 device->card->max_receive - 1);
1020 orb->request.misc = 1023 orb->request.misc =
1021 COMMAND_ORB_MAX_PAYLOAD(device->max_speed + 7) | 1024 COMMAND_ORB_MAX_PAYLOAD(max_payload) |
1022 COMMAND_ORB_SPEED(device->max_speed) | 1025 COMMAND_ORB_SPEED(device->max_speed) |
1023 COMMAND_ORB_NOTIFY; 1026 COMMAND_ORB_NOTIFY;
1024 1027
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index 3ce8e2fbe15f..3e1cb12e43cd 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -734,7 +734,7 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
734} 734}
735EXPORT_SYMBOL(fw_core_handle_response); 735EXPORT_SYMBOL(fw_core_handle_response);
736 736
737const struct fw_address_region topology_map_region = 737static const struct fw_address_region topology_map_region =
738 { .start = 0xfffff0001000ull, .end = 0xfffff0001400ull, }; 738 { .start = 0xfffff0001000ull, .end = 0xfffff0001400ull, };
739 739
740static void 740static void
@@ -772,7 +772,7 @@ static struct fw_address_handler topology_map = {
772 .address_callback = handle_topology_map, 772 .address_callback = handle_topology_map,
773}; 773};
774 774
775const struct fw_address_region registers_region = 775static const struct fw_address_region registers_region =
776 { .start = 0xfffff0000000ull, .end = 0xfffff0000400ull, }; 776 { .start = 0xfffff0000000ull, .end = 0xfffff0000400ull, };
777 777
778static void 778static void
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index 5ceaccd10564..fa7967b57408 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -231,7 +231,7 @@ struct fw_card {
231 unsigned long reset_jiffies; 231 unsigned long reset_jiffies;
232 232
233 unsigned long long guid; 233 unsigned long long guid;
234 int max_receive; 234 unsigned max_receive;
235 int link_speed; 235 int link_speed;
236 int config_rom_generation; 236 int config_rom_generation;
237 237
diff --git a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig
index 8012b3b0ce75..545663ef820b 100644
--- a/drivers/ieee1394/Kconfig
+++ b/drivers/ieee1394/Kconfig
@@ -97,7 +97,7 @@ config IEEE1394_SBP2
97 97
98config IEEE1394_SBP2_PHYS_DMA 98config IEEE1394_SBP2_PHYS_DMA
99 bool "Enable replacement for physical DMA in SBP2" 99 bool "Enable replacement for physical DMA in SBP2"
100 depends on IEEE1394 && IEEE1394_SBP2 && EXPERIMENTAL && (X86_32 || PPC_32) 100 depends on IEEE1394_SBP2 && VIRT_TO_BUS && EXPERIMENTAL
101 help 101 help
102 This builds sbp2 for use with non-OHCI host adapters which do not 102 This builds sbp2 for use with non-OHCI host adapters which do not
103 support physical DMA or for when ohci1394 is run with phys_dma=0. 103 support physical DMA or for when ohci1394 is run with phys_dma=0.
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index e882cb951b47..47dbe8f17e82 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -773,11 +773,6 @@ static struct sbp2_lu *sbp2_alloc_device(struct unit_directory *ud)
773 SBP2_ERR("failed to register lower 4GB address range"); 773 SBP2_ERR("failed to register lower 4GB address range");
774 goto failed_alloc; 774 goto failed_alloc;
775 } 775 }
776#else
777 if (dma_set_mask(hi->host->device.parent, DMA_32BIT_MASK)) {
778 SBP2_ERR("failed to set 4GB DMA mask");
779 goto failed_alloc;
780 }
781#endif 776#endif
782 } 777 }
783 778