Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3558654rwb; Tue, 20 Sep 2022 01:08:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6UL7I4BFkJsaaiKBJ2v5NVhieeMhpfQs/VVWfyCwSWVhCoZzX12k/txih7SLkBYFQf/zav X-Received: by 2002:a17:902:ec82:b0:178:6b70:7eca with SMTP id x2-20020a170902ec8200b001786b707ecamr3752295plg.164.1663661305720; Tue, 20 Sep 2022 01:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663661305; cv=none; d=google.com; s=arc-20160816; b=gL2f4q9DHxULnY8h6RH50cQu2rpNoNrJG3p5xxVqfv1Bvsf49UAkN1E9R0O77YXfBi S/SjCfhyWB1nZIauwT8SMYrbnAMIbH1OfHUZNxhHlqYOJ50XoM73RGXP8SoaqNgNEhh9 So8WTTHWAUgHIox2yZ5cwJzt9vzBYdr2Ly6yK6WvhDI8JNx0kKM2Ms7NNhEiQmnsTWzP FoW5bSxfHJ1yiEIQbnhRhbZi8Xrvh4A4J9KHBL6IDNxBN4mJpb8jf6QlAJkDw9UQO4XE BjT2u8rDRLVf4FneO62Muh8nkjNQYPGOdm2KdBySQbj3FCzZbdH3YBpdA7TB9UAaeBkA MCRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:subject:user-agent:mime-version:date:message-id; bh=mppP8Zqou4MdWKKu/RHWVKT2KSJdfkVOCtd4H7PKbuY=; b=Mr8ugIUjbCSqGiXKuBqTpriYtDOt3n3D4sQuLwg0X5Jv+1MG9HpjC7CQ8FDtF8l9OP iBjZiRe35Obb3zbp5Cz3FUkz2tSMZWZGfS0S+godB6WQmBa2oh2i/4Mz6U0BTSvyjyQU /hEMJDHJLP73GmVJ3a6/CfNUyqXHvJ8l5A7gtaTdsR1UdMwmaQHy7suBtlNeJYUbnxEk hZvSKcfh0SetLXTdqwxCOYwJYcK+5E8NeZEvu/CDShCrpxUPLGWEuvpgvOagmM4l9w2o r8RnSYcY9qMkyzya51msbrMYKxjsxHydbuw0sEDRshZLH7SFIGe4Mffg1rBaBHTWEdlu dqzA== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q38-20020a635066000000b004392e2677d1si1006744pgl.639.2022.09.20.01.08.13; Tue, 20 Sep 2022 01:08:25 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230182AbiITHgH (ORCPT + 99 others); Tue, 20 Sep 2022 03:36:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbiITHf6 (ORCPT ); Tue, 20 Sep 2022 03:35:58 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D025460685; Tue, 20 Sep 2022 00:35:54 -0700 (PDT) Received: from dggpeml500021.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MWtXM26ncz14Qj6; Tue, 20 Sep 2022 15:31:47 +0800 (CST) Received: from [10.159.220.206] (10.159.220.206) by dggpeml500021.china.huawei.com (7.185.36.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 20 Sep 2022 15:35:52 +0800 Message-ID: <26a62e8c-b3cd-bf61-2113-1e8375f2cc9c@huawei.com> Date: Tue, 20 Sep 2022 15:35:51 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] i2c: hix5hd2: Add some debug enhancement for register access To: Wolfram Sang , , References: <20220913124820.48715-1-taolan@huawei.com> From: taolan In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.159.220.206] X-ClientProxiedBy: dggpeml100013.china.huawei.com (7.185.36.238) To dggpeml500021.china.huawei.com (7.185.36.21) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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   -------- Original Message -------- Title: Re: [PATCH] i2c: hix5hd2: Add some debug enhancement for register access From: wsa@kernel.org To: taolan@huawei.com; Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Date: 2022/9/18 04:29 > On Tue, Sep 13, 2022 at 12:48:20PM +0000, Tao Lan wrote: >> From: taolan >> >> Sometimes, to locate a fault, we need to know how the register is >> configured and whether the configuration is incorrect. Currently, no >> better method is available for analysis. >> >> This patch tries to solve the problem by naming the registers and >> printing the accessed values. >> >> Signed-off-by: taolan > > Such debug helpers are not suitable for upstream because they need quite > some resources for rare cases... Yeah, how about writing to proc as an event, or any suggestions? > >> + pr_notice("write 0x%04x to %s\n", val, g_i2c_reg_name[idx >> 0x2].name); > > ... and using this loglevel you will flood logs of users. The loglevel can be adjusted to DEBUG level,and this debug can be off by default. is this ok? > >