Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp348988iob; Thu, 28 Apr 2022 04:01:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5shqnnyWH7zMAX0lyNVh+MhKlPQtHr2r8pwAdz+Zuk15hrKSEIFqm0Fwq6IXO72aBbwJu X-Received: by 2002:a17:906:57c1:b0:6d6:da73:e9c0 with SMTP id u1-20020a17090657c100b006d6da73e9c0mr31861550ejr.45.1651143707154; Thu, 28 Apr 2022 04:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651143707; cv=none; d=google.com; s=arc-20160816; b=lxn6v8PhWseyCDVeQ5xao2GL+rWFYUuW5EoiYATJChm/6KTN+NweMmPZayf0hohTOw oAApuF96WgJkUOJpw3NAOznKUN/Hb1oLyXnToNyMh0VUnxhgWMnALDpthPEuimDPVetH bYCUNd3espP7n64YBlmKj4EkTbKN1U0KfUkOKK0z8n2jivMGkGNV0OGjmmmS2DZZKrRu mtRtFTJnwnJ65Zzh6ODdrItkaJcpRZZK25JD9a57/pRGTA+6wWVifX8I4BXKuWUp560D reRNDKcHm4GblAgL4TRq39mD1X36t6p2Ncxf89Rfw2ELR7Z1OTYelD1fQOn1UhVNFs/A oKnQ== 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:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=s0aUg2HE9PFZadcLahl2VUbpekkIPi6XLmEP0rOe9L8=; b=LzsrHpCBQ4ZDec1L4HbwFGk/8u/Lztk7lpk++JNS9kYGl7J0XMajlYHMOaGti4dISB PsR1u7gS40Ci6nvA9mXQ8whPEv+B//DU3AWhC2dACqqpKT1lsWeD7sgRd/luoV3/oFJo Kgdj4+FL0i2Nz4LRc/PnzikEaTltooOiaNMHrJA4smi1wql1zaclaR1Ylbv+1+Se365R jZCByjUY5FA6HDydw+NDAUeBareerQZtkf24j3K04aFxVX2cBVTMDrrXFMAUZmXG+eZl chnH/eN77aqTwzheDBq97SGngNi+6V2gQjJP3bIpAbTSmyC3Xn1nWOrP5ivdt8eNp3V7 lJ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=V+uY8ZCH; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qc2-20020a170906d8a200b006e89dab2309si3555021ejb.187.2022.04.28.04.01.22; Thu, 28 Apr 2022 04:01:47 -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=@quicinc.com header.s=qcdkim header.b=V+uY8ZCH; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237250AbiD1Hcj (ORCPT + 99 others); Thu, 28 Apr 2022 03:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231146AbiD1Hcg (ORCPT ); Thu, 28 Apr 2022 03:32:36 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F7BC9AE72; Thu, 28 Apr 2022 00:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651130962; x=1682666962; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=s0aUg2HE9PFZadcLahl2VUbpekkIPi6XLmEP0rOe9L8=; b=V+uY8ZCHcTN9aVj6Tz0lQLpWb6meb5KyNPCsqx4SbWf3CIvN9f5tETVn SLg7WRKFNu+Jg1IkRAFY+8wTsDRybx5Sip7fvxkfemUvviPmEvPWBJh8M eQzMIG4ulV6oYdyp+3vcMruMaojlStVt09mDVq7hk+VQft7xyMINLfnMY A=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 28 Apr 2022 00:29:21 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 00:29:19 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 28 Apr 2022 00:29:20 -0700 Received: from [10.50.42.7] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 28 Apr 2022 00:29:17 -0700 Message-ID: <96dc5e2e-5d88-52ce-c295-779603e668f2@quicinc.com> Date: Thu, 28 Apr 2022 12:59:13 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCHv11 6/6] asm-generic/io: Add logging support for MMIO accessors Content-Language: en-US To: Greg KH CC: , , , , , , , , , References: <3de35c9f4a3a070d197bab499acefc709a6f5336.1645772606.git.quic_saipraka@quicinc.com> From: Sai Prakash Ranjan In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On 4/28/2022 11:21 AM, Greg KH wrote: > On Thu, Apr 28, 2022 at 09:00:13AM +0530, Sai Prakash Ranjan wrote: >> Add logging support for MMIO high level accessors such as read{b,w,l,q} >> and their relaxed versions to aid in debugging unexpected crashes/hangs >> caused by the corresponding MMIO operation. Also add a generic flag >> (__DISABLE_TRACE_MMIO__) which is used to disable MMIO tracing in nVHE KVM >> and if required can be used to disable MMIO tracing for specific drivers. > This "add a build flag to a Makefile to change how a driver operates" > feels very wrong to me given that this is now a totally new way to > control how a driver works at build time. That's not anything we have > done before for drivers and if added, is only going to create much added > complexity. Not exactly, there are already many such build flags being used currently across kernel. Example: "-D__KVM_NVHE_HYPERVISOR__, D__KVM_VHE_HYPERVISOR__, -D__NO_FORTIFY, -D__DISABLE_EXPORTS, -DDISABLE_BRANCH_PROFILING". It gives us even more flexibility to disable feature for multiple files under a directory rather than individually cluttering each file, look at "-D__KVM_NVHE_HYPERVISOR__" for files under "arch/arm64/kvm/hyp/nvhe/". > How about requiring that the #define be in the .c files, and not in the > Makefile, as Makefile changes are much much harder to notice and review > over time. How is this cleaner, lets say we have many such drivers like all drivers under drivers/serial, so we go and add #define for each of them? That looks more spread out than having all such information under one file (Makefile). And I didn't understand how is it harder to track changes to makefile? Makefile isĀ  part of the driver directory and any changes to makefile is visible to the corresponding maintainers. Do you mean something else? > > Also, I see that this "disable the trace" feature has already been asked > for for 2 other drivers in the Android kernel tree, why not include > those changes here as well? That kind of shows that this new feature is > limited in that driver authors are already wanting it disabled, even > before it is accepted. That can be done later on top of this series right? This series mainly deals with adding initial support for such tracing, there could be numerous drivers who might or might not want the feature which can be added onto later. We can't actually identify all the driver requirements upfront. As an example, we have already used the flag to disable tracing for nVHE KVM, so we know how to use the flag. > Because of that, who _will_ be using this feature? > Every driver except those two or few more, and it is not a bug or anything, they just want to disable it to limit the logs in case of example UART driver since the reads/writes are very frequent in those cases and the logs are not necessarily useful for them. Thanks, Sai