]> Git Repo - linux.git/commitdiff
Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee139...
authorLinus Torvalds <[email protected]>
Thu, 24 May 2012 19:57:47 +0000 (12:57 -0700)
committerLinus Torvalds <[email protected]>
Thu, 24 May 2012 19:57:47 +0000 (12:57 -0700)
Pull IEEE 1394 (FireWire) subsystem updates from Stefan Richter:

 - Fix mismatch between DMA mapping direction (was wrong) and DMA
   synchronization direction (was correct) of isochronous reception
   buffers of userspace drivers if vma-mapped for R/W access.  For
   example, libdc1394 was affected.

 - more consistent retry stategy in device discovery/ rediscovery, and
   improved failure diagnostics

 - various small cleanups, e.g. use SCSI layer's DMA mapping API in
   firewire-sbp2

* tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
  firewire: sbp2: document the absence of alignment requirements
  firewire: sbp2: remove superfluous blk_queue_max_segment_size() call
  firewire: sbp2: use scsi_dma_(un)map
  firewire: sbp2: give correct DMA device to scsi framework
  firewire: core: fw_device_refresh(): clean up error handling
  firewire: core: log config rom reading errors
  firewire: core: log error in case of failed bus manager lock
  firewire: move rcode_string() to core
  firewire: core: improve reread_config_rom() interface
  firewire: core: wait for inaccessible devices after bus reset
  firewire: ohci: omit spinlock IRQ flags where possible
  firewire: ohci: correct signedness of a local variable
  firewire: core: fix DMA mapping direction
  firewire: use module_pci_driver

1  2 
drivers/firewire/core-card.c
drivers/firewire/core-transaction.c
drivers/firewire/core.h
include/linux/firewire.h

index f5552b362efc1cc061dbca84373d15b2b15e280a,2a03bb92761632233e36dc9cd983dc6989b0bd10..57ea7f464178708576c5809886d50568e5c71dae
@@@ -421,8 -421,8 +421,8 @@@ static void bm_work(struct work_struct 
                         * root, and thus, IRM.
                         */
                        new_root_id = local_id;
-                       fw_notice(card, "%s, making local node (%02x) root\n",
-                                 "BM lock failed", new_root_id);
+                       fw_notice(card, "BM lock failed (%s), making local node (%02x) root\n",
+                                 fw_rcode_string(rcode), new_root_id);
                        goto pick_me;
                }
        } else if (card->bm_generation != generation) {
@@@ -676,7 -676,6 +676,7 @@@ void fw_card_release(struct kref *kref
  
        complete(&card->done);
  }
 +EXPORT_SYMBOL_GPL(fw_card_release);
  
  void fw_core_remove_card(struct fw_card *card)
  {
index db8a965cf712b456382256d7ebf7cb6a4b721cce,1c4980c32f907b363ffd914f1866a3b3ef1ee4bf..780708dc6e25f39a9cd181e3a1c0f075ad8f96ee
@@@ -820,15 -820,6 +820,15 @@@ void fw_send_response(struct fw_card *c
  }
  EXPORT_SYMBOL(fw_send_response);
  
 +/**
 + * fw_get_request_speed() - returns speed at which the @request was received
 + */
 +int fw_get_request_speed(struct fw_request *request)
 +{
 +      return request->response.speed;
 +}
 +EXPORT_SYMBOL(fw_get_request_speed);
 +
  static void handle_exclusive_region_request(struct fw_card *card,
                                            struct fw_packet *p,
                                            struct fw_request *request,
@@@ -1003,6 -994,32 +1003,32 @@@ void fw_core_handle_response(struct fw_
  }
  EXPORT_SYMBOL(fw_core_handle_response);
  
+ /**
+  * fw_rcode_string - convert a firewire result code to an error description
+  * @rcode: the result code
+  */
+ const char *fw_rcode_string(int rcode)
+ {
+       static const char *const names[] = {
+               [RCODE_COMPLETE]       = "no error",
+               [RCODE_CONFLICT_ERROR] = "conflict error",
+               [RCODE_DATA_ERROR]     = "data error",
+               [RCODE_TYPE_ERROR]     = "type error",
+               [RCODE_ADDRESS_ERROR]  = "address error",
+               [RCODE_SEND_ERROR]     = "send error",
+               [RCODE_CANCELLED]      = "timeout",
+               [RCODE_BUSY]           = "busy",
+               [RCODE_GENERATION]     = "bus reset",
+               [RCODE_NO_ACK]         = "no ack",
+       };
+       if ((unsigned int)rcode < ARRAY_SIZE(names) && names[rcode])
+               return names[rcode];
+       else
+               return "unknown";
+ }
+ EXPORT_SYMBOL(fw_rcode_string);
  static const struct fw_address_region topology_map_region =
        { .start = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP,
          .end   = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP_END, };
diff --combined drivers/firewire/core.h
index b5a2f619705375d582f92f1495cd136672c68a93,94257aecd0541bf9950f566ac935811a068b71c7..515a42c786d0250e580f63ecf12971428592a387
@@@ -3,6 -3,7 +3,7 @@@
  
  #include <linux/compiler.h>
  #include <linux/device.h>
+ #include <linux/dma-mapping.h>
  #include <linux/fs.h>
  #include <linux/list.h>
  #include <linux/idr.h>
@@@ -120,6 -121,21 +121,6 @@@ int fw_compute_block_crc(__be32 *block)
  void fw_schedule_bus_reset(struct fw_card *card, bool delayed, bool short_reset);
  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 */
  
  extern const struct file_operations fw_device_ops;
@@@ -154,7 -170,11 +155,11 @@@ void fw_node_event(struct fw_card *card
  
  /* -iso */
  
- int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma);
+ int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, int page_count);
+ int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *card,
+                         enum dma_data_direction direction);
+ int fw_iso_buffer_map_vma(struct fw_iso_buffer *buffer,
+                         struct vm_area_struct *vma);
  
  
  /* -topology */
diff --combined include/linux/firewire.h
index e83c24af358a11c980e1162db74c0ea8148002f2,584826ba2eb70be61ea91eff0d999a9f196915af..7edcf10317182a32c4ffeef84b5c6dd1d7ed091c
@@@ -135,20 -135,6 +135,20 @@@ struct fw_card 
        __be32 maint_utility_register;
  };
  
 +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 attribute_group *groups[2];
        struct attribute_group group;
@@@ -339,7 -325,6 +339,7 @@@ int fw_core_add_address_handler(struct 
  void fw_core_remove_address_handler(struct fw_address_handler *handler);
  void fw_send_response(struct fw_card *card,
                      struct fw_request *request, int rcode);
 +int fw_get_request_speed(struct fw_request *request);
  void fw_send_request(struct fw_card *card, struct fw_transaction *t,
                     int tcode, int destination_id, int generation, int speed,
                     unsigned long long offset, void *payload, size_t length,
@@@ -349,6 -334,7 +349,7 @@@ int fw_cancel_transaction(struct fw_car
  int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
                       int generation, int speed, unsigned long long offset,
                       void *payload, size_t length);
+ const char *fw_rcode_string(int rcode);
  
  static inline int fw_stream_packet_destination_id(int tag, int channel, int sy)
  {
@@@ -406,6 -392,7 +407,7 @@@ struct fw_iso_buffer 
        enum dma_data_direction direction;
        struct page **pages;
        int page_count;
+       int page_count_mapped;
  };
  
  int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
This page took 0.066895 seconds and 4 git commands to generate.