• Julian Wiedmann's avatar
    s390/qeth: fix IPA command submission race · f3b580d3
    Julian Wiedmann authored
    
    [ Upstream commit d22ffb5a ]
    
    If multiple IPA commands are build & sent out concurrently,
    fill_ipacmd_header() may assign a seqno value to a command that's
    different from what send_control_data() later assigns to this command's
    reply.
    This is due to other commands passing through send_control_data(),
    and incrementing card->seqno.ipa along the way.
    
    So one IPA command has no reply that's waiting for its seqno, while some
    other IPA command has multiple reply objects waiting for it.
    Only one of those waiting replies wins, and the other(s) times out and
    triggers a recovery via send_ipa_cmd().
    
    Fix this by making sure that the same seqno value is assigned to
    a command and its reply object.
    Do so immediately before submitting the command & while holding the
    irq_pending "lock", to produce nicely ascending seqnos.
    
    As a side effect, *all* IPA commands now use a reply object that's
    waiting for its actual seqno. Previously, early IPA commands that were
    submitted while the card was still DOWN used the "catch-all" IDX seqno.
    Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f3b580d3
qeth_core_main.c 168 KB