Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2196033iof; Tue, 7 Jun 2022 22:53:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6vvBez/2wK3dPQygOhI1gZQ+G6WUZVkPhrZdgiMX9GRqjRs8Y9D8bsCMLj/DhgJLm0AhZ X-Received: by 2002:aa7:92d2:0:b0:51b:4d60:6475 with SMTP id k18-20020aa792d2000000b0051b4d606475mr48215305pfa.73.1654667589250; Tue, 07 Jun 2022 22:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667589; cv=none; d=google.com; s=arc-20160816; b=WmHTZSXrghSNhtCM7nQzHnC22PUOiiLN9kQVdbRFxdL9Ee5n6bqrq4I0bLXezrioAE FmjaOwQf8y75LNmjpdiBm6vXxNMy8Qdz1g9QPYzq3ngEQWMPMP9HCG82zpXFKOci3/+d HFp+jbprR3SYaVyQ4Uhb29JJvcsKeBhuk18+qR0bHMh1Q9Gahe7L+mfw9pFlZDWe10w9 kQypVoZ2YFRC8QBMXJktlH+h/C0zetRK6ibpRjYEERTnJyHeI9sU2kVe1rR1AYnZl/oW b7haVenMV7mZFmkcGrnnjHCJNM/mvC9E3/6ZRGE9DxtfVKPMO1lAK14ChtuOSNZ83RcR i81A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tqrYbkl0fLm6ZkBsSftTILz0PIV98wow2gkz/NpW6MQ=; b=SWZEE4FdAKy5N6TZIy7b8HV5J+ntiP1k/1YTxtFL1Ex8NPEi8xTWLLI1dHVg0qhw1P /mrku8btWmPyiSv8yxDyj9vXdjrLZwF0fZmY9FxbyTeziZlfqUVik+9vwcaIqXekyKTc XbTWzSAR97TGvQe1l9yF149nDSOwcReh1TqFTtw0EJhe0EJDG0p3MAEM+tdCcUySltYl k+9IY+A8Cu21YewWRldWy1DQihE2AS+Ez5ajTl38NOqmYFPs/D9Ma16Lx8v/cODl4U4v XsmH4myXs3GlKpfejGwutcav2rU01EL8R+OuP2FlYqqhV5HhE6xrzUBMwzjsqb1GM2sY WS3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z6bzvGyP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b16-20020a056a00115000b0050de3100e2asi28803014pfm.97.2022.06.07.22.53.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:53:09 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z6bzvGyP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CAA524147A8; Tue, 7 Jun 2022 22:19:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442335AbiFHAyU (ORCPT + 99 others); Tue, 7 Jun 2022 20:54:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384223AbiFGVyV (ORCPT ); Tue, 7 Jun 2022 17:54:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D7D837BD3; Tue, 7 Jun 2022 12:13:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CD2E0617D0; Tue, 7 Jun 2022 19:12:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAAA0C385A2; Tue, 7 Jun 2022 19:12:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629158; bh=B/QuFEpq78xkrF1rplhhWqWNV0Fu2qI+glk260VWyvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z6bzvGyP0Zwy/Qa6IAci3NZ6Zz+bBiygf675ZyvdaWwU8VSF9ndiq7tWs+9wzHW7N GdZQoQt2/97LKjZNmUJXs+kz7zu6spWt5BUGHwzQGaR8t7e3Wq8NDX26YMp1cFvm5E x6efrM2Kg7+21h5hdLdPXJLnvEri4dPExrsbwp60= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Ben Widawsky , Davidlohr Bueso , Dan Williams , Sasha Levin Subject: [PATCH 5.18 550/879] cxl/pci: Add debug for DVSEC range init failures Date: Tue, 7 Jun 2022 19:01:08 +0200 Message-Id: <20220607165018.830980067@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Williams [ Upstream commit e39f9be08d9dfe685c8a325ac1755c04f383effc ] In preparation for not treating DVSEC range initialization failures as fatal to cxl_pci_probe() add individual dev_dbg() statements for each of the major failure reasons in cxl_dvsec_ranges(). The rationale for cxl_dvsec_ranges() failure not being fatal is that there is still value for cxl_pci to enable mailbox operations even if CXL.mem operation is disabled. Reviewed-by: Jonathan Cameron Reviewed-by: Ben Widawsky Reviewed-by: Davidlohr Bueso Link: https://lore.kernel.org/r/164730734812.3806189.2726330688692684104.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Signed-off-by: Sasha Levin --- drivers/cxl/pci.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 3f2182d66829..c4941a3ca6a8 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -466,12 +466,15 @@ static int cxl_dvsec_ranges(struct cxl_dev_state *cxlds) { struct cxl_endpoint_dvsec_info *info = &cxlds->info; struct pci_dev *pdev = to_pci_dev(cxlds->dev); + struct device *dev = &pdev->dev; int d = cxlds->cxl_dvsec; int hdm_count, rc, i; u16 cap, ctrl; - if (!d) + if (!d) { + dev_dbg(dev, "No DVSEC Capability\n"); return -ENXIO; + } rc = pci_read_config_word(pdev, d + CXL_DVSEC_CAP_OFFSET, &cap); if (rc) @@ -481,8 +484,10 @@ static int cxl_dvsec_ranges(struct cxl_dev_state *cxlds) if (rc) return rc; - if (!(cap & CXL_DVSEC_MEM_CAPABLE)) + if (!(cap & CXL_DVSEC_MEM_CAPABLE)) { + dev_dbg(dev, "Not MEM Capable\n"); return -ENXIO; + } /* * It is not allowed by spec for MEM.capable to be set and have 0 legacy @@ -495,8 +500,10 @@ static int cxl_dvsec_ranges(struct cxl_dev_state *cxlds) return -EINVAL; rc = wait_for_valid(cxlds); - if (rc) + if (rc) { + dev_dbg(dev, "Failure awaiting MEM_INFO_VALID (%d)\n", rc); return rc; + } info->mem_enabled = FIELD_GET(CXL_DVSEC_MEM_ENABLE, ctrl); -- 2.35.1