Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1376382rwd; Thu, 1 Jun 2023 14:51:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6MpUmf6dM0Lor9H32p9feNHnZsWYYqmB+qC6gEWcUp3WS5EnvQSEk+RaaOgsGW3M8MwLO+ X-Received: by 2002:a17:90a:191e:b0:253:340d:77d8 with SMTP id 30-20020a17090a191e00b00253340d77d8mr505463pjg.33.1685656280568; Thu, 01 Jun 2023 14:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685656280; cv=none; d=google.com; s=arc-20160816; b=n92ChwZiW+xtU7Xe5OlSH37Q7756ITm8aifowp/C48a2+u21EaornHUwgF+JVjBlyL o5GnzdGNySdfGDgN6jQjix3wkmxwBuAk9QNVHefVkIws8x7W15tmSVyZeW14e0w0Tqc8 GcXS6BL+HC6sRP4LL7Mt1vmzbCFoFWpXVVW66MBH4Hbo17vS8yPZP/KTHME8w7illiqf OYqztrx0Tcc7lUFnr9hT8sMmJ+GqPzW8kUjpASmUPs8c9rqlZ944f240zJ4usz5qUVS3 8y4V28xL3Dn28SOeMSRBUqSrYlxlBRIvR4A2EG3zp6HJitbqvnMx1aGX0GHcErs4/wRW TOMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=T3TYjQ3xYfmcSJA+RIujfoihRcZoPZ4ak7W8CKwQzY4=; b=USnrRse5kIssn+iaAcji9C9QMgutJu2TeTjumD4nU7Fjm4rP80cpZn2VH66w0eJ3mC 6ljvZvmPlePcJrH6LbPdYvWSp7Il6Ln40BxbLj935EwCgxILMzjeJmD2FMTyydyjGWr4 J8OE5EzGKYn+Mb/9tP8f9NEs1eH8DluwGhU87d1iM5VTKk1HpW/i47NMtfnFQoxnVvPU DzC4ZjTxf9lcYyeiGtV6NKqggt0KVnlzpp+5v4R1yQt2/odEhHods9gN4T9va9sXZDop xg9Lq3kGWGHCOufdLqWpeYnWzPUIEIyr8N/3GMYYTCOy+REYgRPXMhPNqyhPzQL3jvBZ 3GZw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 29-20020a17090a1a5d00b002564870bcb6si1612399pjl.183.2023.06.01.14.51.09; Thu, 01 Jun 2023 14:51:20 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232746AbjFAVjz (ORCPT + 99 others); Thu, 1 Jun 2023 17:39:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232214AbjFAVjy (ORCPT ); Thu, 1 Jun 2023 17:39:54 -0400 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12B90E6B for ; Thu, 1 Jun 2023 14:39:27 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id c73ded7f-00c4-11ee-b972-005056bdfda7; Fri, 02 Jun 2023 00:39:25 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Fri, 2 Jun 2023 00:39:25 +0300 To: Wolfram Sang Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Andy Shevchenko Subject: Re: [PATCH v8 1/1] gpio: add sloppy logic analyzer using polling Message-ID: References: <20220329091126.4730-1-wsa+renesas@sang-engineering.com> <20220329091126.4730-2-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220329091126.4730-2-wsa+renesas@sang-engineering.com> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, Mar 29, 2022 at 11:11:26AM +0200, Wolfram Sang kirjoitti: > This is a sloppy logic analyzer using GPIOs. It comes with a script to > isolate a CPU for polling. While this is definitely not a production > level analyzer, it can be a helpful first view when remote debugging. > Read the documentation for details. One note since I have done recent review and realize one issue with debugfs. ... > + priv->debug_dir = debugfs_create_dir(devname, gpio_la_poll_debug_dir); If this fails with NULL... > + debugfs_create_blob("meta_data", 0400, priv->debug_dir, &priv->meta); > + debugfs_create_ulong("delay_ns", 0600, priv->debug_dir, &priv->delay_ns); > + debugfs_create_ulong("delay_ns_acquisition", 0400, priv->debug_dir, &priv->acq_delay); > + debugfs_create_file_unsafe("buf_size", 0600, priv->debug_dir, priv, &fops_buf_size); > + debugfs_create_file_unsafe("capture", 0200, priv->debug_dir, priv, &fops_capture); > + debugfs_create_file_unsafe("trigger", 0200, priv->debug_dir, priv, &fops_trigger); ...and any of these is not, we will end up with the file in a root folder of debugfs... > + dev_info(dev, "initialized"); ... > +static int gpio_la_poll_remove(struct platform_device *pdev) > +{ > + struct gpio_la_poll_priv *priv = platform_get_drvdata(pdev); > + > + mutex_lock(&priv->lock); > + debugfs_remove_recursive(priv->debug_dir); ...and this one won't remove it. > + mutex_unlock(&priv->lock); > + mutex_destroy(&priv->lock); > + > + return 0; > +} ... However, I haven't checked if it's pure theoretical issue with the current code base of debugfs or a potential problem. Easy fix is to check an error code and skip the files creation. Not sure if driver will be useful in that case. -- With Best Regards, Andy Shevchenko