Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1486271ybl; Thu, 22 Aug 2019 15:38:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeMcwO5M8nR0ZIYRniwcgzIJ1o0tMETssn6OXo7R9sfSkhNjWtRwvbS/j8JXsWQVArIViL X-Received: by 2002:aa7:8585:: with SMTP id w5mr1631652pfn.1.1566513527167; Thu, 22 Aug 2019 15:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566513527; cv=none; d=google.com; s=arc-20160816; b=M0H+lkgqHCP65ZCxbj1yrd6NLEh7BgqB3SKetrvlIYr6xY04o6410uBtfDU9pkLzXa G3FXZaGA2ZbUh39DQkDpn6mmErWzc5Jan84Z4sSsf4EaBMIb/U/WjiPDINufJDN5WDe2 QSNCsZ5gLNQicrs3XPJDPgcKT9nhI8roZxFIwhvD00kpNxVLi02+pzGCLxmjTC+Ks8X7 w9H2L3uyPxZMC7Eb7yUE5EOHl293rEhH4iPPTAt/Ij/u12EY2FN/MYF7o1u24MbhzDPu 12Be8LaeBlkJleEX9bnRm5vd7NUhwWaUYfsy+zambF6RuIgehQ76cqRvIvZsS++g+rb7 /YdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jisv1i1fuYCeoPDcTfp4hcVZZE8VR00CVOMW0TsaZKI=; b=hpob7Frj8rqEcZyFWX+hrAflYTfHHpULpvS543l24ZEfVbfVnNmXrr4ydjbBvgsXR6 anTQy32zEHab8UPTZQfB6LQYfL6ecaW6doNVBq0wq6AbYnJkw7nBUyA1duwjXFjB/wC2 ZyamNew6gqnsHHMa/LbhkbYImW7YB2RL1PMjewBaMOJFEre9xmxWYHTcEelAJK3DyFkL 9EtLobm5WfwL8oM00TOoaIn6HQayhqxs+7PLoMTXhPoC7p+0HUV8xgfRIH1iX7FF2Vf9 hp+tDHd0KFZXc47Dg95YbRDbOX01vuxnfnprM9+/QIAli7ouEnJcqriRorZ9Wbluict0 I1gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vSdQaFVx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h19si771116pjt.94.2019.08.22.15.38.32; Thu, 22 Aug 2019 15:38:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b=vSdQaFVx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387691AbfHVRP3 (ORCPT + 99 others); Thu, 22 Aug 2019 13:15:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:58464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390473AbfHVRIn (ORCPT ); Thu, 22 Aug 2019 13:08:43 -0400 Received: from sasha-vm.mshome.net (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C7EB523429; Thu, 22 Aug 2019 17:08:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566493723; bh=9ci3Ug3FGCxgxpgteG3x+RIRrG59YRYacjNFOQOS1IQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vSdQaFVxsfbROkn9cGx31uMAuu75FEAJELMUKgAl9yZL6CkVZ3MyzCHnqO4G5QhYt ECJa6vvcJKDfxtxf0Rkd9g6XBmY6HBxXQWraiSxOZ9MqnCKQouZkO5g8T8YQQVsRcZ ETmzKAZEklOZcJB1exIXVOCFDRqqWUZBmtSrhl30= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Michal Kalderon , Doug Ledford , Sasha Levin Subject: [PATCH 5.2 053/135] RDMA/qedr: Fix the hca_type and hca_rev returned in device attributes Date: Thu, 22 Aug 2019 13:06:49 -0400 Message-Id: <20190822170811.13303-54-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822170811.13303-1-sashal@kernel.org> References: <20190822170811.13303-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.2.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.2.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.2.10-rc1 X-KernelTest-Deadline: 2019-08-24T17:07+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Kalderon [ Upstream commit 15fe6a8dcc3b48358c28e17b485fc837f9605ec4 ] There was a place holder for hca_type and vendor was returned in hca_rev. Fix the hca_rev to return the hw revision and fix the hca_type to return an informative string representing the hca. Signed-off-by: Michal Kalderon Link: https://lore.kernel.org/r/20190728111338.21930-1-michal.kalderon@marvell.com Signed-off-by: Doug Ledford Signed-off-by: Sasha Levin --- drivers/infiniband/hw/qedr/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c index 083c2c00a8e91..dfdd1e16de7f5 100644 --- a/drivers/infiniband/hw/qedr/main.c +++ b/drivers/infiniband/hw/qedr/main.c @@ -125,14 +125,20 @@ static ssize_t hw_rev_show(struct device *device, struct device_attribute *attr, struct qedr_dev *dev = rdma_device_to_drv_device(device, struct qedr_dev, ibdev); - return scnprintf(buf, PAGE_SIZE, "0x%x\n", dev->pdev->vendor); + return scnprintf(buf, PAGE_SIZE, "0x%x\n", dev->attr.hw_ver); } static DEVICE_ATTR_RO(hw_rev); static ssize_t hca_type_show(struct device *device, struct device_attribute *attr, char *buf) { - return scnprintf(buf, PAGE_SIZE, "%s\n", "HCA_TYPE_TO_SET"); + struct qedr_dev *dev = + rdma_device_to_drv_device(device, struct qedr_dev, ibdev); + + return scnprintf(buf, PAGE_SIZE, "FastLinQ QL%x %s\n", + dev->pdev->device, + rdma_protocol_iwarp(&dev->ibdev, 1) ? + "iWARP" : "RoCE"); } static DEVICE_ATTR_RO(hca_type); -- 2.20.1