Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3861876rwl; Mon, 10 Apr 2023 02:11:06 -0700 (PDT) X-Google-Smtp-Source: AKy350Y+Fko0gqE1VGIiSXMTOAsS/DPCU6ugs5Ml1QyMACxucp0vq0ljhZJ6LEs9MQVpZNQQE49Z X-Received: by 2002:a05:6a20:b05d:b0:d7:47e8:59b9 with SMTP id dx29-20020a056a20b05d00b000d747e859b9mr10641746pzb.3.1681117866380; Mon, 10 Apr 2023 02:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681117866; cv=none; d=google.com; s=arc-20160816; b=oW2m6tqMHpo+4FRFMgZABmohhF3l+VwvGYzE2DubCuGBriMTW0VP2Xr2do8OM8U/X1 +odhQhKk3xAKsC7+0LnyswPSnW6bMPf1Zmi1+7G6Uwwokz6WYuEYA2GBH0IZOtP1GiOe TouaDk14CMgzpJf0vjnoBq+LQxDpP98lzcdAfHWJQALN/p+QIC0OOELReaM/4aWk9sue cXIrZiXeJWs9fEvkUQU7o7n5i6FxhhVyw+y3LdTyNh2gKJNGyk+2J72Rinh9MIpl267/ +T/YlY58ElUek530p6EFh1a91J+qJi2j+aGnEKNVQfPaILS5eP9D/46ZxLjvEzS/K8dp 0Zzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5Yf6i3dwVyGNHunqVy4wvMe4Mu5dQWI3DJrKMN6n03A=; b=YFA1GHKocdEHCUWhisEHHvpfIu6vrIyacocSJ6MoxuyF7rzQe6cXjmyVZ4C4c2vWXd pxfjuqgmFHB3f281sJ5IkIJxxjzAhCGCwjOLnCwC5l/n0MYM2TMRmq7ngKo+Gojtjpxa EPAKFiJZKox9uNwmrsluFAQSnF2mNwVA5HRG0aeNEPROo0lNH095mTZThx6FesPcKBje 2hmvP04f+jtMpRLYslhXSMRDbNhUK5rRaYo/fM8VzdnnN+f4JwvQVlsAASsx61MWKQhV wE88ATedrwtoexk0frOwzZvtGHkYHaGhg0LCNOFzpNpouDfTxJYwSuLiB32br8c/4sXd 89/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=go0HNhF8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a26-20020aa7971a000000b0063984bcddbbsi819030pfg.62.2023.04.10.02.10.55; Mon, 10 Apr 2023 02:11:06 -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=@google.com header.s=20210112 header.b=go0HNhF8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229874AbjDJJBS (ORCPT + 99 others); Mon, 10 Apr 2023 05:01:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbjDJJA7 (ORCPT ); Mon, 10 Apr 2023 05:00:59 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7FFC10CB for ; Mon, 10 Apr 2023 02:00:45 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id v9so8908367pjk.0 for ; Mon, 10 Apr 2023 02:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681117245; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5Yf6i3dwVyGNHunqVy4wvMe4Mu5dQWI3DJrKMN6n03A=; b=go0HNhF8sbV56879EF0jnigLtZjM/PEkln1DJD/l30BBdvyr5OggfhblddHaccOzea mN76tKnyPFHmnPCnAGFrtLUvsjXhvsGfoikqyVdDxSHCUXnJ8usNxsx0BE3uPIPkGkrD /vwOYI0p2uw7uiv3iE+LVOHnoggggfjCrFLCVbMI/aPSnAOeOX7k/IHyoV19DkHobRTP F1kyBIS/irVKTGzzaVTWuGrvpjpNKbau1ncL4K7Pps9U0iJLmrk99dT1uC0A7IxTQztz 6LLqe1KKHE4pLbI+33jFuD3L3bIFqLHBv/6c+jrHCDGI09ITIsg4UXYJIGE1YgfXwm7S LUoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681117245; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Yf6i3dwVyGNHunqVy4wvMe4Mu5dQWI3DJrKMN6n03A=; b=TGOhG+XJueLhiu1MSrkN81S9vjK7y/FX07748HMCVIT4FHIs9gzZYcbDWsI6TP0ag3 7c1GmlVnAL0ggD3YLSs3wGFI4wszcVwmZ7dqdOoXJit+L45ItwxYwI0LIGM04/R+dhif nVwxY6EjcKRy9OY5H2fYzAa7kWrxyWMV9XkCgz6JApvvg6aMP7a1LwHdAfTMQOPIP8b7 yIDtAQ0qKca9FQkI8raiIOndrxRPrBbndsONA6FyP9AHNKHal2rKolDmCiA1UhNWIsWZ SNgpvB5S3NW5JkD8som42IsRnpceqCulmYp+slIBS7CoTP6Mofl56DUK2/L9HHlw8M6y 5qnA== X-Gm-Message-State: AAQBX9cnC0Ssqku6OQO05lsaFy6As4aCyVk+7+qdTFna4ybvAOcfsdzQ sCBlf7oDyQEomQOP0mhmFnmU2Gmu8ceUPOphjUrOEHBO3Zu/2runDwBnTg== X-Received: by 2002:a17:90a:4290:b0:246:6a3a:6aec with SMTP id p16-20020a17090a429000b002466a3a6aecmr2059886pjg.4.1681117245070; Mon, 10 Apr 2023 02:00:45 -0700 (PDT) MIME-Version: 1.0 References: <20230410073134.488762-1-badhri@google.com> <2023041028-irritate-starless-a42f@gregkh> <2023041004-antarctic-hardiness-524e@gregkh> In-Reply-To: <2023041004-antarctic-hardiness-524e@gregkh> From: Badhri Jagan Sridharan Date: Mon, 10 Apr 2023 02:00:08 -0700 Message-ID: Subject: Re: [PATCH v1] usb: typec: tcpm: Add kernel config to wrap around tcpm logs To: Greg KH Cc: linux@roeck-us.net, heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 On Mon, Apr 10, 2023 at 1:27=E2=80=AFAM Greg KH wrote: > > On Mon, Apr 10, 2023 at 01:08:55AM -0700, Badhri Jagan Sridharan wrote: > > On Mon, Apr 10, 2023 at 12:45=E2=80=AFAM Greg KH wrote: > > > > > > On Mon, Apr 10, 2023 at 07:31:34AM +0000, Badhri Jagan Sridharan wrot= e: > > > > This change adds CONFIG_TCPM_LOG_WRAPAROUND which when set allows t= he > > > > logs to be wrapped around. Additionally, when set, does not clear > > > > the TCPM logs when dumped. > > > > > > > > Signed-off-by: Badhri Jagan Sridharan > > > > --- > > > > drivers/usb/typec/tcpm/Kconfig | 6 ++++++ > > > > drivers/usb/typec/tcpm/tcpm.c | 9 +++++++-- > > > > 2 files changed, 13 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcp= m/Kconfig > > > > index e6b88ca4a4b9..4dd2b594dfc9 100644 > > > > --- a/drivers/usb/typec/tcpm/Kconfig > > > > +++ b/drivers/usb/typec/tcpm/Kconfig > > > > @@ -18,6 +18,12 @@ config TYPEC_TCPCI > > > > help > > > > Type-C Port Controller driver for TCPCI-compliant controlle= r. > > > > > > > > +config TCPM_LOG_WRAPAROUND > > > > + bool "Enable TCPM log wraparound" > > > > + help > > > > + When set, wraps around TCPM logs and does not clear the log= s when dumped. TCPM logs by > > > > + default gets cleared when dumped and does not wraparound wh= en full. > > > > > > Kconfig help text needs to be wrapped at the properly width. > > > > I assumed that the width is 100 characters, but it looks like it is > > 80. Will fix it in the next version. > > > > > > And you do not provide any hint here as to why this is not the defaul= t > > > option, or why someone would want this. > > > > "TCPM logs by default gets cleared when dumped and does not wraparound > > when full." was intended > > to convey why someone would want to set this. Perhaps it's not effectiv= e. > > > > Does the below look better: > > "TCPM logs by default gets cleared when dumped and does not wraparound > > when full. This can be overridden by setting this config. > > When the config is set, TCPM wraps around logs and does not clear the > > logs when dumped." > > > > Also, I could make this default if that's OK with Guenter. > > > > > > > > So, why is this not just the default operation anyway? Why would you > > > ever want the logs cleared? > > > > I remember Guenter mentioning that he was finding it useful to not > > wrap around the logs to fix problems > > during tcpm_register_port (init sequence). IMHO wrapping around the > > logs helps to triage interoperability > > issues uncovered during testing. So both approaches have their own adva= ntages. > > But as this is a build-time option, what would cause someone to choose > one over the other, and then when the system is running, they can't > change them? During initial phases of bringup, it makes sense to not wrap around the logs, but, once bringup is done its most effective to wraparound so that interop issues reported by the end users can be triaged where TCPM logs are very effective. Also, without wrapping around, the logbuffer logs are completely stale after the user goes through a few USB connect and disconnect cycles till the system is rebooted. If we don't want to pursue the Kconfig option, we should atleast make TCPM default to wrapping the logs around when full so we could maximise the use of the logbuffer contents. > > That does not seem good at all. > > Why not just use tracing instead of this odd custom log buffer? That's > a better solution overall, right? Tracing is not enabled by default in most systems. End users don't want to retry and reproduce the failure to collect traces even if they could reproduce it consistently. So tracing was not proving handy here. Thanks, Badhri > > thanks, > > greg k-h