Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7829309rwn; Wed, 14 Sep 2022 05:15:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR7jdkwiXGRvlNT68OdSnjTweXSkxnoPtG/D4JOz/Z4mewf5r8XisMgD8wGNi7QLtEzVSpBP X-Received: by 2002:a17:907:7610:b0:77c:b7a:9fb2 with SMTP id jx16-20020a170907761000b0077c0b7a9fb2mr12313351ejc.468.1663157722460; Wed, 14 Sep 2022 05:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663157722; cv=none; d=google.com; s=arc-20160816; b=xGQnH3AoJQY3UnN7ji65whVBPUDuUiJxVpdv7B7N/idFVtohyAdCQENi4zAMJZHfTr z4R8qN+iprm0VR1yNstWxQopBj3gg+qD8DS7piJNLVGccKAEMj8pcpOUBUYhs/TTqmDg 5lA/HSGX9t+dgzmhaXi7pTkBkky03ioHlNJxtAewJEmSNGIY2Gem9Ix5/E6nyhIq8RIa W2Ou49fePzPaRdLNWzBX6Rqbx+x/KfaPe1EntTTMhyMyR1LTZCxVs3IKH2mlBm4QUPsc HcOJs+y3ZPi/enXvC0pRFsTOl9lCQ1PI41bE5U+Zi4P5CTEoQeilKUxCesioDTCZfv8q n+vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=T6Z1sxrsS/iEyWK4j442NiGqIJjiqn+hpIPVo9lGQ+0=; b=mmP6AEb5MRJB7HlU27InlVzlilryjw71IT+bppZWGFXk4rY5Jeq/YA8fk+JqTd8e7s 2wV5bKunfY+vFGdKv51095nPxmvGEmLrgXh891ni77NKE6mWDntgjsgd7aUNNNrWLnmq /Y8pj8YWRY5NtL5m+08L5AZS4Cv3dqVc/YqjdEsEpQU5wrBd9CSuXuH2u4QVhGq9jQVr 11v7vGyDMXngWMjChWZCksEcQacUHWAJ7XSMK4ekknZo3phYvZDxEeFeELtzgNykjvb2 V971Asv/cj6rqrG6+isjzlR9Ln1mIR50485+1e3z2PVirW+GBP1wTj39G2HDlMFtTly/ D2Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EV9tuRTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s19-20020a056402521300b0044ef0fcfe59si10279832edd.95.2022.09.14.05.14.56; Wed, 14 Sep 2022 05:15:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EV9tuRTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbiINLTN (ORCPT + 99 others); Wed, 14 Sep 2022 07:19:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbiINLTL (ORCPT ); Wed, 14 Sep 2022 07:19:11 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BED7B4BD33 for ; Wed, 14 Sep 2022 04:19:09 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id bj14so25123479wrb.12 for ; Wed, 14 Sep 2022 04:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=T6Z1sxrsS/iEyWK4j442NiGqIJjiqn+hpIPVo9lGQ+0=; b=EV9tuRTXpn8Dt09HoeSuTrAMldTw1Jim0+TnkCZoTrTuQZljmfH4bnbDpMRZ0sM8/w huW2ANhWjq65n1bL6a2xixQGdmUrVHBvYfu6f1In6tjqW8zLYDSUjU0/p2siIduwpZji 6y48iiOUxomqn/0/bH2Z6M/f3dQgs9Rdasa5PFPT5QrFYMksvq9ph0boIPqHWKIaI2b7 a/0iU931cKjcDtU0MC7bZoduCBkoSMGxEK+0rSliHVOJj9HpiZgxAzfTQDdA9hx1bhu0 8QYvx4CqjDwYIHzMnsuRsShaBBumAApbESyxiBk43vaPlpBxva9kG41sg3x8mhA6RRKU /xLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=T6Z1sxrsS/iEyWK4j442NiGqIJjiqn+hpIPVo9lGQ+0=; b=201k2zszeUGpQ3790Fzcl3qumnbTRfPZbvf+aWeQ/6j0WYl5ShNfCdlYCBUzaa2U4y OADVdyzp3ALFF8HlNnzeDJ4uE0+T/LwC14nflWZVoN+SAm8BgGbR3ueqTypeQikqv+8R 3/JYm7gpj3S+uJ9cTDX39vtGEY7CYq0H8GkdMjk1jX/2YTUoPwrGVWjgdnvx5lrWur88 OLQOO/7EJAhc09opVV++dAMpwGvD6eOMTK1xWs9CyGL+bNoeckdUDolfg2fwC+s29hDi J9QummvAyfW5/hhhab1ok1B7it2ZjAyK80lX/zSftJXBTFD8JSZ6B/iV6/bh/NL9IQJF fxrg== X-Gm-Message-State: ACgBeo1GKt1xf4r9+FBrrZ4AxRmz5gC2LsiVE1hUPtL9+JdVTckPcNrC huAqcR1I+YxAXFX1ZqgARzsX X-Received: by 2002:a5d:564e:0:b0:228:d609:7ac3 with SMTP id j14-20020a5d564e000000b00228d6097ac3mr20736994wrw.27.1663154348174; Wed, 14 Sep 2022 04:19:08 -0700 (PDT) Received: from workstation ([117.202.184.122]) by smtp.gmail.com with ESMTPSA id r15-20020a5d694f000000b00228c792aaaasm13110142wrw.100.2022.09.14.04.19.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Sep 2022 04:19:07 -0700 (PDT) Date: Wed, 14 Sep 2022 16:48:57 +0530 From: Manivannan Sadhasivam To: Vidya Sagar Cc: Bjorn Helgaas , Jon Hunter , jingoohan1@gmail.com, gustavo.pimentel@synopsys.com, lpieralisi@kernel.org, robh@kernel.org, kw@linux.com, bhelgaas@google.com, treding@nvidia.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com Subject: Re: [PATCH V1] PCI: dwc: Use dev_info for PCIe link down event logging Message-ID: <20220914111857.GF16459@workstation> References: <20220913200746.GA619956@bhelgaas> <20220914062411.GD16459@workstation> <29b39edd-10ab-b679-f270-67b0b406ca2f@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <29b39edd-10ab-b679-f270-67b0b406ca2f@nvidia.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Wed, Sep 14, 2022 at 04:32:10PM +0530, Vidya Sagar wrote: > Agree with Mani. > Not all form factors support PRSNT pin (Ex:- M.2 Key-M form factor) and even > if the slot form factor supports PRSNT, it is not mandatory to have a GPIO > routed to the PRSNT pin of the slot. Right. > Also, since these are development platforms, we wouldn't want to keep > changing a controller's status in the DT, instead want to know the device's > presence/absence (by way of link up) looking at the log. > In my honest opinion, I don't think the absence of a device in the slot > should be treated as an error. > As I mentioned earlier, timeout can happen due to an issue with PHY layer also. In those cases, "dev_err()" is relevant. And I also agree that absence of the device should not be treated as an error. But my question is, if you know that the slot is going to be empty always, why cannot you just disable it in dts? Even if you make the log "dev_info()" there is the wait time for link up and I'm sure that you wouldn't want it either. Thanks, Mani > Thanks, > Vidya Sagar > > On 9/14/2022 11:54 AM, Manivannan Sadhasivam wrote: > > External email: Use caution opening links or attachments > > > > > > On Tue, Sep 13, 2022 at 03:07:46PM -0500, Bjorn Helgaas wrote: > > > On Tue, Sep 13, 2022 at 06:00:30PM +0100, Jon Hunter wrote: > > > > On 13/09/2022 17:51, Manivannan Sadhasivam wrote: > > > > > On Tue, Sep 13, 2022 at 03:42:37PM +0530, Vidya Sagar wrote: > > > > > > Some of the platforms (like Tegra194 and Tegra234) have open slots and > > > > > > not having an endpoint connected to the slot is not an error. > > > > > > So, changing the macro from dev_err to dev_info to log the event. > > > > > > > > > > But the link up not happening is an actual error and -ETIMEDOUT is being > > > > > returned. So I don't think the log severity should be changed. > > > > > > > > Yes it is an error in the sense it is a timeout, but reporting an error > > > > because nothing is attached to a PCI slot seems a bit noisy. Please note > > > > that a similar change was made by the following commit and it also seems > > > > appropriate here ... > > > > > > > > commit 4b16a8227907118e011fb396022da671a52b2272 > > > > Author: Manikanta Maddireddy > > > > Date: Tue Jun 18 23:32:06 2019 +0530 > > > > > > > > PCI: tegra: Change link retry log level to debug > > > > > > > > > > > > BTW, we check for error messages in the dmesg output and this is a new error > > > > seen as of Linux v6.0 and so this was flagged in a test. We can ignore the > > > > error, but in this case it seem more appropriate to make this a info or > > > > debug level print. > > > > > > Can you tell whether there's a device present, e.g., via Slot Status > > > Presence Detect? If there's nothing in the slot, I don't know why we > > > would print anything at all. If a card is present but there's no > > > link, that's probably worthy of dev_info() or even dev_err(). > > > > > > > I don't think all form factors allow for the PRSNT pin to be wired up, > > so we cannot know if the device is actually present in the slot or not all > > the time. Maybe we should do if the form factor supports it? > > > > > I guess if you can tell the slot is empty, there's no point in even > > > trying to start the link, so you could avoid both the message and the > > > timeout by not even calling dw_pcie_wait_for_link(). > > > > Right. There is an overhead of waiting for ~1ms during boot. > > > > We workaround this issue by disabling the PCIe instances in devicetree > > for which there would be no devices connected. > > > > Thanks, > > Mani > > > > > > > > Bjorn