lkml.org 
[lkml]   [2012]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[14/49] IB/qib: Fix a possible data corruption when receiving packets
    3.2-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Ram Vepa <ram.vepa@qlogic.com>

    commit eddfb675256f49d14e8c5763098afe3eb2c93701 upstream.

    Prevent a receive data corruption by ensuring that the write to update
    the rcvhdrheadn register to generate an interrupt is at the very end
    of the receive processing.

    Signed-off-by: Ramkrishna Vepa <ram.vepa@qlogic.com>
    Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/infiniband/hw/qib/qib_iba6120.c | 4 +++-
    drivers/infiniband/hw/qib/qib_iba7220.c | 4 +++-
    drivers/infiniband/hw/qib/qib_iba7322.c | 6 ++++--
    3 files changed, 10 insertions(+), 4 deletions(-)

    --- a/drivers/infiniband/hw/qib/qib_iba6120.c
    +++ b/drivers/infiniband/hw/qib/qib_iba6120.c
    @@ -2076,9 +2076,11 @@ static void qib_6120_config_ctxts(struct
    static void qib_update_6120_usrhead(struct qib_ctxtdata *rcd, u64 hd,
    u32 updegr, u32 egrhd, u32 npkts)
    {
    - qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
    if (updegr)
    qib_write_ureg(rcd->dd, ur_rcvegrindexhead, egrhd, rcd->ctxt);
    + mmiowb();
    + qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
    + mmiowb();
    }

    static u32 qib_6120_hdrqempty(struct qib_ctxtdata *rcd)
    --- a/drivers/infiniband/hw/qib/qib_iba7220.c
    +++ b/drivers/infiniband/hw/qib/qib_iba7220.c
    @@ -2725,9 +2725,11 @@ static int qib_7220_set_loopback(struct
    static void qib_update_7220_usrhead(struct qib_ctxtdata *rcd, u64 hd,
    u32 updegr, u32 egrhd, u32 npkts)
    {
    - qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
    if (updegr)
    qib_write_ureg(rcd->dd, ur_rcvegrindexhead, egrhd, rcd->ctxt);
    + mmiowb();
    + qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
    + mmiowb();
    }

    static u32 qib_7220_hdrqempty(struct qib_ctxtdata *rcd)
    --- a/drivers/infiniband/hw/qib/qib_iba7322.c
    +++ b/drivers/infiniband/hw/qib/qib_iba7322.c
    @@ -4082,10 +4082,12 @@ static void qib_update_7322_usrhead(stru
    */
    if (hd >> IBA7322_HDRHEAD_PKTINT_SHIFT)
    adjust_rcv_timeout(rcd, npkts);
    - qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
    - qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
    if (updegr)
    qib_write_ureg(rcd->dd, ur_rcvegrindexhead, egrhd, rcd->ctxt);
    + mmiowb();
    + qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
    + qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
    + mmiowb();
    }

    static u32 qib_7322_hdrqempty(struct qib_ctxtdata *rcd)



    \
     
     \ /
      Last update: 2012-01-11 00:11    [W:0.035 / U:30.844 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site