From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58A88296BAF for ; Mon, 19 Jan 2026 06:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768805753; cv=none; b=iKotcznBiU7qSzapqPwQxmiYBtBDQaZTtosstJQcRpScOQpdCwS8uzb8w79XakxIrkAKSZRPoJu+UFegXrbF/U2JkQeHmh+FKpk8YA3WGKOkb8Jae2DHhrZVQTd4UCOPOsQPEErybb15x+WERg7TWsNcNkuTj4TLH+c1B76E72Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768805753; c=relaxed/simple; bh=oTvJzQzo9d6CzmWfDLo2qGJmON2aULDRqlUmMkM9LQ0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=S1ABSnZwF4o3dT+8S68QyCpznth3tF6PxmuGqVY37y5wS4/21moHKWpATu1ZAKR841EJETKacqYrGALwwvgptQCj2xKq/yrEj260WBPUY7X5LzTEhhjeCnFuv9Yua0I0PPyYfEJdlGP6MjCN25/yQCfoNvsahMpYil6tf/DNXpA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=U7QzmZGF; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=E9HiW3E/; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="U7QzmZGF"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="E9HiW3E/" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60INPx2P4002263 for ; Mon, 19 Jan 2026 06:55:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= OvU8AC21XN0dD41lLJnIZY7raczKQSxJs95MwKmjxO4=; b=U7QzmZGFTePNf4NZ 46JzPtTB7EOhfoMHv8MNsIxQRSAgdRWk1XDzGzCrIj5PYA3IX5URmkuKNFe83yJJ m2fNdxtqrC2QSK5AGRmOyzuja0Vkw35p5sczGBSKMSb0p/Vpilz0Vt6Bvmw4cZDZ 8PipbOtc272RAbKqDLOuT5+6ve9vS1+1FwE5bxUpQTR3Yhrjgu2CGGjfzdT44jua aAt30Q72fCB3a6oPtzUvK93Wp87UT60wfCFEvUkEOmLnHgi4mxhumsjasDA5m2LY N8RbafgH9fIafZi3AjbMZX8FiuutJXFk5a0qn9QTkefBwz99q4EegqEOSWqu3+v8 jTBXEA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bs79eh0vx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 19 Jan 2026 06:55:50 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2a0f0c7a06eso37550025ad.2 for ; Sun, 18 Jan 2026 22:55:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768805750; x=1769410550; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OvU8AC21XN0dD41lLJnIZY7raczKQSxJs95MwKmjxO4=; b=E9HiW3E/aN5x7TFjtk3KIFgbvfgvGOXqOLO//DH9xQHvXk/4TauMKotKGbcppkcDpe ZQWDDnawSNcWg6jgcZUeUA61eUjT7coEXfS7OuUDITUvh8p1DxLoPIYU+bM/MrNL4Ozj vEXEAsE5fxSfEyaNijAnlvnKVcaYXYb5/gDxEadCnSRHq54jowvsDCCFB5qOy4zpn8Ys lcJ3okH2QArF01uARa25fsOi47G+ybkgHfO8hLbBCRARCJf5fmhjRWZCCKsu3vnvyCak xenF+KZ08zbnES7JKiOWRhTQ0oY51HQjnecAJVaObwieP8aA4cb9HYBEsVwqs92l97lb xsmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768805750; x=1769410550; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OvU8AC21XN0dD41lLJnIZY7raczKQSxJs95MwKmjxO4=; b=iNm1xwEcz4Ty5l8IKegbXVs8t5nOIGgKxLb62wz9u8SOTwlYRqcZUxnRzCyo4JvSxW oYg87FwA+b6tTK4r7fLC1Lxn6JnPJRSIHp9YV1oGxDnbNCXl3j4noL3qzu3AFl6VMaOT KsM+GZrtds2iLU3nD+2IUH/pZSV+eMLS4WdofPwR1JCo/q+A5OLgKhxyVH5QJ8tL0ZN3 XKT2mF/Bse07h0+6e1EYdfDfYIGiF4PAWexwLc2RjFFXjwpf6GObPcWVMmds+UW7clLL cq86F5GAhRIb9N8LoSSTgF47yP2iuLatbjID2LSBl9nrKvojxlQOvM8WUnTBBbrHj0lB IFPA== X-Forwarded-Encrypted: i=1; AJvYcCWB2ldnd9My58NFcr7xkknzPZAIxNnF+yuC0LDw+BjOUwKMFotipmHM+fXRnFPEMoeHLN11lkeHDsjWhY8=@vger.kernel.org X-Gm-Message-State: AOJu0YyPsj28Yrti6BNTkgTCgbJWtSnZS9JKybXm1FxI1+6nsqn2XiGB 9R8ZW2Z3T3O5e8ilvjHgAaVuEQt0RmHs8srSpvv5zv6XMzhqB+BXOhvKIi96N3ougFFvqhY1sq5 U+4rFrS6qmSHsQaI1ECjSsEM3JRFoygtEaMaHtKZBal0oHTgYIE76QFmbbU0mvweuu+c= X-Gm-Gg: AZuq6aIejCLtoztibjQ8sjtiiqU5yZiJoWQT5jIhT8IwDjJUR99Oy43r/SRvyrM1I73 tZMi0TC1FTfICnnlJLkhOBelf5iflzHNtG4y9WbPdsQ36SojJR69KS6TmuaQdL/KSUXtqsr/E7+ lSfrldcsBBrvpyLCi/jej0Hj1XN1nXkjABgncqc05anJTw+uuZib4eQBjialVnlwWuDgCOHLsfY G12tLyrwkrZWzOyaYP1TlgeKJrIUyQimPfN4lGX/BjhZAykwekySXTs6fg/9FPA9dgz+DkMamTc gBN5tRl5tyi4wheL/x1EGXVtpl7UpN6Ly0PAYZypK52gS0StGsz4b97oEs4ESyRG6o54y9pOSgk NQvsapsv+F4IlBh/d72e0OimnGGO5MAX///sCBQ== X-Received: by 2002:a17:903:124d:b0:29e:76b8:41e5 with SMTP id d9443c01a7336-2a7175be718mr107141785ad.30.1768805749693; Sun, 18 Jan 2026 22:55:49 -0800 (PST) X-Received: by 2002:a17:903:124d:b0:29e:76b8:41e5 with SMTP id d9443c01a7336-2a7175be718mr107141605ad.30.1768805749135; Sun, 18 Jan 2026 22:55:49 -0800 (PST) Received: from [10.218.10.142] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a71942248asm84786645ad.98.2026.01.18.22.55.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Jan 2026 22:55:48 -0800 (PST) Message-ID: Date: Mon, 19 Jan 2026 12:25:45 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 3/3] usb: dwc3: Log dwc3 address in traces To: Thinh Nguyen Cc: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20260114100748.2950103-1-prashanth.k@oss.qualcomm.com> <20260114100748.2950103-4-prashanth.k@oss.qualcomm.com> <2026011400-monthly-commend-f89b@gregkh> <20260114225441.rn3affmwuhfl2z7x@synopsys.com> <20260114235357.zueeylekf4lfdq4g@synopsys.com> <2026011500-safehouse-alphabet-3056@gregkh> <20260115162234.ehm7l22ahh52d4y3@synopsys.com> <26f7cb41-5fa0-4aca-a119-2a7510b027a0@oss.qualcomm.com> <20260116175133.m7jbgh2s3ofzj2jb@synopsys.com> Content-Language: en-US From: Prashanth K In-Reply-To: <20260116175133.m7jbgh2s3ofzj2jb@synopsys.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE5MDA1NiBTYWx0ZWRfX76omQoMXtqJQ /ORx7HykKRE77AQ8x0aSGLVnqwsyUaJEfabMtwVrVorEocPL3RJeCEvs50qrqFe+Yj1tje1OCyy WwT58RmEvcTs3Ij2htdmr7T3vYwN6PzR6yn+2lPnVJoOZ0PNRYxgQW8+jorZS5YK9+n+t+KkUoG a8osUZWikmsZt9pX9ioOO+D/gVxK1t8bCHvdiEV+1oRT+SK9jsj+WTjuTP1O6l8zz1z09wVFXyS zZoX0P/jHvuVIuqI0tlDlF0vot2db3GveODQXS2Ls2autuJqMhAPy8h9VrZMwJzcUGW3eZRHlCK IlPc+XRBS3v6YVZe8+KYalsNLt8Ro7el02F1Hs8wBYKSa1zJuNBUhPK7GYv/9h58LluEyxI6kqj 7VV719rtelTjRgwryLFX1U6hn2kpU0nakHvi8VCVyQLFw7EiRMIVu9CYEcmD202VqCk5PC0T73I SUINfYAAm5we0pgY1HA== X-Authority-Analysis: v=2.4 cv=NY3rFmD4 c=1 sm=1 tr=0 ts=696dd576 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=3S5gDLOTvNsQPPPUPYkA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: YZc41j8_Ple9SAVFWOWeOeWflf1Eu4e1 X-Proofpoint-GUID: YZc41j8_Ple9SAVFWOWeOeWflf1Eu4e1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-19_01,2026-01-19_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 bulkscore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601190056 On 1/16/2026 11:21 PM, Thinh Nguyen wrote: > On Fri, Jan 16, 2026, Prashanth K wrote: >> >> >> On 1/15/2026 9:52 PM, Thinh Nguyen wrote: >>> On Thu, Jan 15, 2026, Greg Kroah-Hartman wrote: >>>> On Wed, Jan 14, 2026 at 11:54:03PM +0000, Thinh Nguyen wrote: >>>>> On Wed, Jan 14, 2026, Thinh Nguyen wrote: >>>>>> On Wed, Jan 14, 2026, Greg Kroah-Hartman wrote: >>>>>>> On Wed, Jan 14, 2026 at 03:37:48PM +0530, Prashanth K wrote: >>>>>>>> + * @address: Cached lower 32-bit base address to be used for logging. >>>>>>> >>>>>>> Why are 32bits enough / ok? Why not use the full 64 that you really >>>>>>> have? What happens if you have 2 devices with just the upper 32 bits >>>>>>> different? >>>>>>> >>>>>>> This is a resource value, so why not use the proper type for it? >>>>>>> >>>>>> >>>>>> This is only intented to be used for logging, so I suggested to use u32. >>>>>> I want to avoid treating this struct member as a phys_addr_t where it >>>>>> may be misused. >>>>>> >>>>>> As for the reason to capture only the lower 32-bit, it's just base on >>>>>> what I've seen so far. That I have not seen designs where the 2 or more >>>>>> instances are placed that far apart and share the same lower 32-bit. >>>>>> It's a bit nicer to shorten the address print at the start of a >>>>>> tracepoint. But if it's insufficient, there's no problem with using >>>>>> 64-bit. >>>>>> >>>>> >>>>> Or we can just remove this and print the address from >>>>> dwc->xhci_resources[0].start. >>>> >>>> I thought I asked for that a few revisions ago :) >>> >>> Ah, I missed that. >>> >>>> >>>> I'd prefer that, instead of saving off a value that you can look up if >>>> you need it. >>>> >>> >>> Yes, this is better. >>> >>> Hi Prashanth, can we just use dwc->xhci_resources[0].start instead? >>> >> >> While its true that we can avoid adding new variable into dwc3 struct, >> using 'xhci_resources[0].start' in DWC3 core traces can be confusing for >> someones reading code, since all of the traces are related to dwc3 core >> and gadget. >> > > We can name the fast assign field in tracing to base_address. For those > who do not have access to the databook to know that that's where base > address is, if needed, we can also add a comment there. > > Would something like this work for you? > Yea I'll make the change and send next version. > diff --git a/drivers/usb/dwc3/trace.h b/drivers/usb/dwc3/trace.h > index b6ba984bafcd..8e5d474fd54a 100644 > --- a/drivers/usb/dwc3/trace.h > +++ b/drivers/usb/dwc3/trace.h > @@ -37,19 +37,22 @@ DEFINE_EVENT(dwc3_log_set_prtcap, dwc3_set_prtcap, > ); > > DECLARE_EVENT_CLASS(dwc3_log_io, > - TP_PROTO(void *base, u32 offset, u32 value), > - TP_ARGS(base, offset, value), > + TP_PROTO(struct dwc3 *dwc, void *base, u31 offset, u32 value), > + TP_ARGS(dwc, base, offset, value), > TP_STRUCT__entry( > + __field(phy_addr_t, base_address) Shouldn't we be using 'resource_size_t' instead ? Anyways its just typedef of 'phys_addr_t'. > __field(void *, base) > __field(u32, offset) > __field(u32, value) > ), > TP_fast_assign( > + __entry->base_address = dwc->xhci_resources[0].start; > __entry->base = base; > __entry->offset = offset; > __entry->value = value; > ), > - TP_printk("addr %p offset %04x value %08x", > + TP_printk("%pa: addr %p offset %04x value %08x", > + dwc->base_address, > __entry->base + __entry->offset, > __entry->offset, > __entry->value) > > Thanks, > Thinh