Message ID | 20231013-glink-altmode-ret-v1-1-77941537a35b@fairphone.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1909580vqb; Fri, 13 Oct 2023 06:57:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4zB9UJ3H/d885OoAa57fQgMgt0Lt+BIJZF7nPS6rofSUYYXkuQHoGJfZ0PW47ffeBCNYc X-Received: by 2002:a17:902:d512:b0:1bf:349f:b85c with SMTP id b18-20020a170902d51200b001bf349fb85cmr29760259plg.1.1697205435034; Fri, 13 Oct 2023 06:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697205435; cv=none; d=google.com; s=arc-20160816; b=Fu/XEze2A9Tw9EKoLWm8fiNXjt571Z+8BvGu0VRJ3J7UdyWs37Y9xcFydhHFh8dFGo jBnP6s2va+UMwpGM35tVJ0yI+fd97bc/p2v5oyGFOwrIi9kaW1CUvWL7uoxsv3on3CHV K2nSQloksliwQ3lraAYNVAM3FCAZEs6M8D+qk7x830Z+PPViFhoKbrtgjHGZ8LzPoLqH BeDxu+hLTHPKEFrnWRhMLkBOM3weUypqpamKLzz7Ze0HwDr9JmlqEuOTWKwwYRKuuCe2 aNzfTGrk58BdNGgn4qli3f52hME39KfMMh1ifbCr1k4zZ/D9JJDXVc+xIazC5N6FLmic 13NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=kFlDh2veCoYGtweA/suIrNJN5h1cgFkvvCUfEXmQbkY=; fh=zb7Jf0ADGeg9EQlRrFGFP9vYlcx/wKRq1pefmNbeWo0=; b=g6/xNsE8yBCZF/yKbNCd1YxzNHHj/sFW5ZjKdl3QYO0kT1hyeeXR93GwNuXaSCCt3X NLH7nAhjuoqVxGU3Gggm1/3GaWyZY05zpreztNY3Nb52WjsRd497agi11hIodt7+uQAQ VCME9jFoDEx2XrPsIsQxhF3ZRqNCjkvHBMeD6xcX2YkoEcMJsYhgm2Yth4TKbjadiFCc Xe+3RZpMSwzbg7PND4X1PjB486HbTaBD5+T1feP90DE/W2ZeytzgDScTUkkLmAw02S0t naEIqnyq64wX2Fh3k+WKGKZnkh47P3hezmXCpTbKxM14707QPKO806q6i0TUPrV0hSZG FfVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=g9h3R8o7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id r24-20020a170902be1800b001bbacfdad2fsi4375447pls.291.2023.10.13.06.57.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 06:57:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=g9h3R8o7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C6682805B2D9; Fri, 13 Oct 2023 06:57:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232008AbjJMN4r (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Fri, 13 Oct 2023 09:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbjJMN4p (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 13 Oct 2023 09:56:45 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDD85BD for <linux-kernel@vger.kernel.org>; Fri, 13 Oct 2023 06:56:42 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-99c3c8adb27so338420566b.1 for <linux-kernel@vger.kernel.org>; Fri, 13 Oct 2023 06:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1697205401; x=1697810201; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=kFlDh2veCoYGtweA/suIrNJN5h1cgFkvvCUfEXmQbkY=; b=g9h3R8o7mLledtHrOdZekoiuEsrRPCH8TKNZ2CeG1kJZglolMXQNS+bNaERVslNkSk 5+oWsBa9PeldBYZPkrsPRH+wXwUYj6RXygb+oi8PLZGpF1XXAdPSGZg7qr0jSCnw/fTi mlERjGSdXvhuqhCmShzbEfJcjd2Pkyjc5M9GOfcww/PD2q9h48X/gUDP0kBnRNYSFCJY qGTw4N9BddiJO5DIXkGay1HRM+R4B8B9leXdi+MWFjiRjSy18GYBMGWA5ptS1Yn//S24 ygua53JTwx+Ou1rGRXW6ojirLB/e5D1w+98YbYbjHHwjFvk1814c65yMHzIebLVSF9L9 A9Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697205401; x=1697810201; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kFlDh2veCoYGtweA/suIrNJN5h1cgFkvvCUfEXmQbkY=; b=maMnauRAKL4G0ZIcitAGETe9hrmse69WSnmq3Re2hxO/A2OdJqOjUcYOj2qSL0gKvJ /t8xmaDewvoc1p+OCFO9+sFS0Mb8vV+b/dhmxPgXng4OT66/mczs7SUVOA8nIbD+94VK B7yFz+g4iFq7f7li4OuHXws5t+vKxdFTUwDCojJ3hPcsREsOWRZtDJ68PN1OOVqa2AuS QR2hUGRA8s8+vGzeq+GeOSFy6xQGwh7Zwr3ufittCFPvt2vc4lTQ3AKLBg9rUFLMze0S C5frJxJWdaAJg3EK5bU8/zliL/3l9MwYXvpMffh7/qDnsIAZ8kSNns8TCQglRyl4SXoF 9iag== X-Gm-Message-State: AOJu0YySmqA3v8wU+0IxaMFvC+pnU+V3YQAmUJll2Q0O2TSw/IbAsRV+ S9BS7q5ZnUaI5s7x1n2ELeoXBQ== X-Received: by 2002:a17:907:a08a:b0:9bd:cab6:a34d with SMTP id hu10-20020a170907a08a00b009bdcab6a34dmr1171556ejc.31.1697205401106; Fri, 13 Oct 2023 06:56:41 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id j16-20020a170906051000b0099bcf1c07c6sm12462745eja.138.2023.10.13.06.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 06:56:40 -0700 (PDT) From: Luca Weiss <luca.weiss@fairphone.com> Date: Fri, 13 Oct 2023 15:56:40 +0200 Subject: [PATCH] soc: qcom: pmic_glink_altmode: Print error when retimer setup fails MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231013-glink-altmode-ret-v1-1-77941537a35b@fairphone.com> X-B4-Tracking: v=1; b=H4sIAJdMKWUC/x3MwQpAQBRG4VfRXbvlmiheRRaDHzcMzUhK3t1k+ S3OeSjAKwLVyUMelwbdXYSkCfWzdRNYh2jKs9xIJoanVd3Cdj23fQB7nGwqEZS9wHYFxe7wGPX +n037vh+1bt8fYwAAAA== To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org> Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss <luca.weiss@fairphone.com> X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 13 Oct 2023 06:57:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779648886424027446 X-GMAIL-MSGID: 1779648886424027446 |
Series |
soc: qcom: pmic_glink_altmode: Print error when retimer setup fails
|
|
Commit Message
Luca Weiss
Oct. 13, 2023, 1:56 p.m. UTC
It can be useful to know with which return value the retimer_set call
failed, so include this info in the dev_err print.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
drivers/soc/qcom/pmic_glink_altmode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
base-commit: e3b18f7200f45d66f7141136c25554ac1e82009b
change-id: 20231013-glink-altmode-ret-3911e6c1eab5
Best regards,
Comments
On 13.10.2023 15:56, Luca Weiss wrote: > It can be useful to know with which return value the retimer_set call > failed, so include this info in the dev_err print. > > Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > --- Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Konrad
On Fri, Oct 13, 2023 at 03:56:40PM +0200, Luca Weiss wrote: > It can be useful to know with which return value the retimer_set call > failed, so include this info in the dev_err print. > Is this useful during development, or during normal execution etc. How about using kretprobe or similar tools? If you insist, could you please make sure that the style matches across the various typec_*_set() calls in the driver? Regards, Bjorn > Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > --- > drivers/soc/qcom/pmic_glink_altmode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c > index 9569d999391d..136713e1155e 100644 > --- a/drivers/soc/qcom/pmic_glink_altmode.c > +++ b/drivers/soc/qcom/pmic_glink_altmode.c > @@ -168,7 +168,7 @@ static void pmic_glink_altmode_enable_dp(struct pmic_glink_altmode *altmode, > > ret = typec_retimer_set(port->typec_retimer, &port->retimer_state); > if (ret) > - dev_err(altmode->dev, "failed to setup retimer to DP\n"); > + dev_err(altmode->dev, "failed to setup retimer to DP: %d\n", ret); > } > > static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode, > > --- > base-commit: e3b18f7200f45d66f7141136c25554ac1e82009b > change-id: 20231013-glink-altmode-ret-3911e6c1eab5 > > Best regards, > -- > Luca Weiss <luca.weiss@fairphone.com> >
On Mon Oct 16, 2023 at 5:18 AM CEST, Bjorn Andersson wrote: > On Fri, Oct 13, 2023 at 03:56:40PM +0200, Luca Weiss wrote: > > It can be useful to know with which return value the retimer_set call > > failed, so include this info in the dev_err print. > > > > Is this useful during development, or during normal execution etc. How > about using kretprobe or similar tools? Hi Bjorn, IIRC I encountered this during development of my retimer driver, where the op in that driver failed for some reason and it was very useful to get the return value to debug that. And sure, I guess kretprobe might be also useful here but I think it's very common to include the return value in the error message when something fails, no? > If you insist, could you please make sure that the style matches across > the various typec_*_set() calls in the driver? Do you mean adding the return value to the other dev_err prints after typec_*_set() calls also? Regards Luca > > Regards, > Bjorn > > > Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > > --- > > drivers/soc/qcom/pmic_glink_altmode.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c > > index 9569d999391d..136713e1155e 100644 > > --- a/drivers/soc/qcom/pmic_glink_altmode.c > > +++ b/drivers/soc/qcom/pmic_glink_altmode.c > > @@ -168,7 +168,7 @@ static void pmic_glink_altmode_enable_dp(struct pmic_glink_altmode *altmode, > > > > ret = typec_retimer_set(port->typec_retimer, &port->retimer_state); > > if (ret) > > - dev_err(altmode->dev, "failed to setup retimer to DP\n"); > > + dev_err(altmode->dev, "failed to setup retimer to DP: %d\n", ret); > > } > > > > static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode, > > > > --- > > base-commit: e3b18f7200f45d66f7141136c25554ac1e82009b > > change-id: 20231013-glink-altmode-ret-3911e6c1eab5 > > > > Best regards, > > -- > > Luca Weiss <luca.weiss@fairphone.com> > >
On Mon, Oct 16, 2023 at 08:56:31AM +0200, Luca Weiss wrote: > On Mon Oct 16, 2023 at 5:18 AM CEST, Bjorn Andersson wrote: > > On Fri, Oct 13, 2023 at 03:56:40PM +0200, Luca Weiss wrote: > > > It can be useful to know with which return value the retimer_set call > > > failed, so include this info in the dev_err print. > > > > > > > Is this useful during development, or during normal execution etc. How > > about using kretprobe or similar tools? > > Hi Bjorn, > > IIRC I encountered this during development of my retimer driver, where > the op in that driver failed for some reason and it was very useful to > get the return value to debug that. > > And sure, I guess kretprobe might be also useful here but I think it's > very common to include the return value in the error message when > something fails, no? > The problem with the error message is that you often get some generic error code, but don't know where it came from anyway. So, I typically use function_graph and set_graph_function to capture the path through the called function(s)... But that said, it is fairly common to include the error value, so I am not against it. > > If you insist, could you please make sure that the style matches across > > the various typec_*_set() calls in the driver? > > Do you mean adding the return value to the other dev_err prints after > typec_*_set() calls also? > I mean that we should be consistent across the error prints, and either include the error value in all or none of the typec error prints. Regards, Bjorn
diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c index 9569d999391d..136713e1155e 100644 --- a/drivers/soc/qcom/pmic_glink_altmode.c +++ b/drivers/soc/qcom/pmic_glink_altmode.c @@ -168,7 +168,7 @@ static void pmic_glink_altmode_enable_dp(struct pmic_glink_altmode *altmode, ret = typec_retimer_set(port->typec_retimer, &port->retimer_state); if (ret) - dev_err(altmode->dev, "failed to setup retimer to DP\n"); + dev_err(altmode->dev, "failed to setup retimer to DP: %d\n", ret); } static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode,