Received: by 10.213.65.68 with SMTP id h4csp1764181imn; Mon, 19 Mar 2018 12:36:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELvQAOg+nTljIsevCjSlJDeWf42QtZl1fgfZOwk1xqBjnHi6wRXzsBCMumDAuIkd2DSUlzc0 X-Received: by 10.98.165.4 with SMTP id v4mr11260418pfm.51.1521488176355; Mon, 19 Mar 2018 12:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521488176; cv=none; d=google.com; s=arc-20160816; b=VDgT4hABrA/TEcAwdgXk6Lh6wKNE4JTC/hqZYHbBTFkV5ay6XT/nk9runxbZhHzDYG X+HZDBp2OResczpxzwB54EaQ4Y7vUFJL64T6owsFLdUmCFKfYcIT5b4hZF+twXY5tyzF ZXmGbIjO+1fAOFSwwjjhYQx1NCYU9oGPUC0Fm96kD+TIlSDO6wLHbtByF3d1EJtVAW5H 0ASHuH+VvxviWbb8exdd7lzBQyqXzM1KI03KjU4NgHI1sMkJ1Lr8vpzTze5UlYfOhFuP 8E86mrFwZWavi/zGMB00j/z6KQFXzPV1cFT2cpcMMIFDzDPFY6txB0fZ1zQdVONGt9Qp bFTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8hF/Tz1wg9Qo6fBrgcZkWhLwiXzEvaTr3Y2Fwwve43s=; b=tnkkXdswbH/an1bV90uUkq+YL4Bdup8shV+Jf9IAmV+BxefGNq3FNemtnblxrbci9O zKPpdEOtyhlm2T+4Ttfa3+Kx6qB8yky7QqGulOQ77/gofaze2cqmRoHi3tYSyT+6mXYc tfDyTmYXiE/pzfGWGk+HdzLzJZTN9zJ6dvG8SD7Oj+L2lKfqd0ZEGARRDUc9ed1x5Ziz WFWxZ6wFc/FgEjtMke+PMHdTCtIlMabbPYdER0Xs4cEpXNukcxgei1kHP6lHqEMt4fje fnxwhVu/pAFe2I3zAR1b7EpJrZNiGRzI3EzvO5lBQ+IecU/9nR/c+58G4kiyoesgLOVw m+XQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si451230pfj.306.2018.03.19.12.36.02; Mon, 19 Mar 2018 12:36:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936087AbeCSTe3 (ORCPT + 99 others); Mon, 19 Mar 2018 15:34:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48648 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031326AbeCSSWn (ORCPT ); Mon, 19 Mar 2018 14:22:43 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 32CAD12A2; Mon, 19 Mar 2018 18:22:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dennis Dalessandro , Easwar Hariharan , Doug Ledford , Sasha Levin Subject: [PATCH 4.9 109/241] IB/hfi1: Check for QSFP presence before attempting reads Date: Mon, 19 Mar 2018 19:06:14 +0100 Message-Id: <20180319180755.709719470@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Easwar Hariharan [ Upstream commit fb897ad315643e5dc1092a115b3cec914b66df9d ] Attempting to read the status of a QSFP cable creates noise in the logs and misses out on setting an appropriate Offline/Disabled Reason if the cable is not plugged in. Check for this prior to attempting the read and attendant retries. Fixes: 673b975f1fba ("IB/hfi1: Add QSFP sanity pre-check") Reviewed-by: Dennis Dalessandro Signed-off-by: Easwar Hariharan Signed-off-by: Dennis Dalessandro Signed-off-by: Doug Ledford Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/hfi1/chip.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c @@ -9489,8 +9489,11 @@ static int test_qsfp_read(struct hfi1_pp int ret; u8 status; - /* report success if not a QSFP */ - if (ppd->port_type != PORT_TYPE_QSFP) + /* + * Report success if not a QSFP or, if it is a QSFP, but the cable is + * not present + */ + if (ppd->port_type != PORT_TYPE_QSFP || !qsfp_mod_present(ppd)) return 0; /* read byte 2, the status byte */