From: Chad Dupuis Date: Wed, 25 Apr 2018 13:08:55 +0000 (-0700) Subject: scsi: qedf: Check if link is already up when receiving a link up event from qed X-Git-Tag: v4.18-rc1~66^2~129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f9de7f0413df53efa47e1571433f0c951d26e46;p=thirdparty%2Flinux.git scsi: qedf: Check if link is already up when receiving a link up event from qed [mkp: typo] Signed-off-by: Chad Dupuis Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 28f37113bc9b8..c3fbab0595993 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -485,6 +485,11 @@ static void qedf_link_update(void *dev, struct qed_link_output *link) struct qedf_ctx *qedf = (struct qedf_ctx *)dev; if (link->link_up) { + if (atomic_read(&qedf->link_state) == QEDF_LINK_UP) { + QEDF_INFO((&qedf->dbg_ctx), QEDF_LOG_DISC, + "Ignoring link up event as link is already up.\n"); + return; + } QEDF_ERR(&(qedf->dbg_ctx), "LINK UP (%d GB/s).\n", link->speed / 1000);