X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=drivers%2Fstaging%2Ffwserial%2Ffwserial.c;h=af0c3878358cb991ccb792d8d66fc51cc0227ad1;hb=9c079f7cdd87ca069ab157e7de95231b8b14baa8;hp=384758b11e3c15ca6b0c96e07c1c399b23d7d159;hpb=15b588303155b22edd559672905db8e59a44ef9a;p=cascardo%2Flinux.git diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 384758b11e3c..af0c3878358c 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -785,6 +785,7 @@ static int fwtty_tx(struct fwtty_port *port, bool drain) len = dma_fifo_out_level(&port->tx_fifo); if (len) { unsigned long delay = (n == -ENOMEM) ? HZ : 1; + schedule_delayed_work(&port->drain, delay); } len = dma_fifo_level(&port->tx_fifo); @@ -1995,6 +1996,7 @@ static struct fwtty_peer *__fwserial_peer_by_node_id(struct fw_card *card, list_for_each_entry_rcu(peer, &serial->peer_list, list) { int g = peer->generation; + smp_rmb(); if (generation == g && id == peer->node_id) return peer; @@ -2015,6 +2017,7 @@ static void __dump_peer_list(struct fw_card *card) list_for_each_entry_rcu(peer, &serial->peer_list, list) { int g = peer->generation; + smp_rmb(); fwtty_dbg(card, "peer(%d:%x) guid: %016llx\n", g, peer->node_id, (unsigned long long) peer->guid); @@ -2120,6 +2123,7 @@ static int fwserial_add_peer(struct fw_serial *serial, struct fw_unit *unit) serial->self = peer; if (create_loop_dev) { struct fwtty_port *port; + port = fwserial_claim_port(peer, num_ttys); if (!IS_ERR(port)) { struct virt_plug_params params; @@ -2611,7 +2615,6 @@ cleanup: if (port) fwserial_release_port(port, false); kfree(pkt); - return; } static void fwserial_handle_unplug_req(struct work_struct *work) @@ -2663,7 +2666,6 @@ cleanup: if (port) fwserial_release_port(port, true); kfree(pkt); - return; } static int fwserial_parse_mgmt_write(struct fwtty_peer *peer,