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 8C95719D074 for ; Wed, 7 Jan 2026 06:03:16 +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=1767765798; cv=none; b=qhUAMgy7bghanhEfIitR97MhLmcGeQeVMLMqVR7NFflhAohG/ba5JDVP9hcWisbaHc/txXAKIu4z+3+MEQSXVBlr9vRKscrcB4aODzo8md3aX/2LYDScZi6RNTFcz984Ze20L3MGSBLJUAXRnRUbvl+dowFDK3LqxaRvWcOr1eU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767765798; c=relaxed/simple; bh=Gfm54GMHTsoaMjmjTrphaXnoGzK3DtlV8+KEj1qyslM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jU1FXQpitW8aXhHKEaxxw6a0d0P/4O4luyUAE4yU371joBfQHyobMIrDVNxaMWgIP36HbWVWkVgZn1gkVmWTH3pyEs7tCYiGE2eOzECLHazJsuqOPxJZ2eCxftLYrOxusuXdpYpBnJXZmyVgr0jzSxvpleKr9jx+41C90CMrd1g= 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=dIdUlUpg; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=X0nsplc2; 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="dIdUlUpg"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="X0nsplc2" 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 6072AGNY364946 for ; Wed, 7 Jan 2026 06:03:16 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= Wiq3SXQ/7luWcry7LKvThb2qVI8evQKnxXTpWHbnKl0=; b=dIdUlUpg6svcqOuD N9aj7uZXxMKJ4VDvHobK2m3m8rek7zydCfybPk9yDhd2bpigoP71n59MCYPqJbZ1 4ubP/bZyQfNpoIIPQhf3Qy7wDvs4tnRYbUb0h3WmGOCuNVaHzuRTdAbjJR1Eqral DNEeQLBq6cDnsOT4Re7G+8PdeckTI2VS6zACQooqVabnoNOEOIjtFwrafmvbdC5L 3th9UJbHB+wgaXSgz7wqmJLweas6oOHmf0XMd9hTgqnNXSZInF9zonRVd0GxIrLN tZD+l1FQBjXzqvLSgHG20P2Ej1TUm+aovYZe26HBGrkaell1TVIjXI5+tkt4qs8/ yZvtgg== 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 4bh660t1u8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 07 Jan 2026 06:03:15 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2a0a4b748a0so37076285ad.1 for ; Tue, 06 Jan 2026 22:03:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767765795; x=1768370595; 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=Wiq3SXQ/7luWcry7LKvThb2qVI8evQKnxXTpWHbnKl0=; b=X0nsplc2gfYSuzfs+iK0cxidmH5VG0NLKaSGUFmUZ8c3ch8bsg6bEerUT+tKUEKTpz h3eUe2UvH0zNO6DZgHbkdmi/cJ8jK1fZACzaJiBRdLhps4g8mlpZM4xRNpFQLSC5xXQn bzWmrlcKi3IISDaI57OnC9nmCx89N4zK8b3WftEjPhazWN3WGub6lrskKMM6n4zK7+Db YQBnLPEYAf6NXxzsRKNBTG1R8fPV+kcp0OgnV8P1CFp5cTtMZuw4SIF5azys1ERhQ6Dl ewLyD5tZXK34yooHn0vT5max9bHcm5Zns1onJFRyqGsyE4VjtgMAMDjrMjZzA3M43mxq FcGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767765795; x=1768370595; 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=Wiq3SXQ/7luWcry7LKvThb2qVI8evQKnxXTpWHbnKl0=; b=TuPkAbqrxB/Z5MwcFunQu4P7peTcbqyhNOymI04XQhL+DBak2MiEqJ2cCkk8l9lu+z /VfxpfP+Aj7qucs/any3cQxo/84FaaVMabN1net/q6lhfN97qAPFRiMnO7e/sFOG/sbC 50BHDhxqaJRy+2+7eoAJ9VDQZsDhOVY3+Yrm7L1zg5eH2DLqcTd0fMijatcL063tTHTN ZIdQgyNnyRpgs23thTN+GGWHt0nCOtkqk+hvPiWYi1ECTbqhlI06rDL8ZWfx/zujtEHy VofkS8BIBTNPVjdSjCNJnkKdRJKWYaQ/Q/KBTZViJTmcJzmW4LNtADhbrkWlWgOiSVZ1 Ae2Q== X-Forwarded-Encrypted: i=1; AJvYcCWQEGgBueByi1M2aIDDuBZQRmEUKMbIu01Wj8nAMikrSJmj+5nOjN4wP1x/rYOUa7w4S4p6TQbM6El2Aw4=@vger.kernel.org X-Gm-Message-State: AOJu0YwAKO5FJi1zuiuhMcTbDGfmeVIA+1cYXGA7XPSi3UN6qteJh3jW GZAS3Mjm/m/R5BZclYp0hEGW+YWzxXTAj1n3bWvIP1VMFe1n7+1IkHv2a1j6k84CvOJYUYD3SD5 s6tHs7XNsrYr2DSWpr01Crs63EEX3tRmIFYRio/kSY/JjfAGC70pfjWAJRaVQ3Cm0Gi4= X-Gm-Gg: AY/fxX5P4nclqaW6e/4Y/0anDydpPP2H+Q9ka517l0B+7nWqM68SuX2HbntWbTvOW+k vvVehd9Cze/ik1ZGwFPrVaH1Ril0q+4Fx5X5vT8N48B4czS9zacTtcwLacec52CtyirNp4ktxMP R+AcXhp4JauvlVYSTlOEm/fxPsBterL2O6ShRbgouIpG6j2gMD7eE2okGG/Blmb3+8uaX6VH1/q iYaBNCoPynAwoAY/oFH0QrvDgeotbtuEWo789ozUBBdmoJQ+jdhvPDNHZvXY6S2uCn4J3R8SgOF QpEy46XmDPVaoWv8MEDoAThlFGvoQKuZJgUV+vMEHdQ2BTQaa4LPEOi4f7b6Jly2VmhUsQxJO2G x3t9IEV1/JYHEC85p022I7AYpuNeN2421f/Eagw== X-Received: by 2002:a05:6a20:914b:b0:371:5a31:e487 with SMTP id adf61e73a8af0-3898f9e9596mr1188357637.70.1767765795153; Tue, 06 Jan 2026 22:03:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IEDzWTjFCaFLK1TKtTV5LvglGVmQbgnstbDthbJ6NCpTyOkmgQE0toj+Pm2pOyuoVr+U9rLbw== X-Received: by 2002:a05:6a20:914b:b0:371:5a31:e487 with SMTP id adf61e73a8af0-3898f9e9596mr1188339637.70.1767765794675; Tue, 06 Jan 2026 22:03:14 -0800 (PST) Received: from [10.218.10.142] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34f5f7c4118sm3829389a91.7.2026.01.06.22.03.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Jan 2026 22:03:14 -0800 (PST) Message-ID: Date: Wed, 7 Jan 2026 11:33:11 +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 v2 3/3] usb: dwc3: Log dwc3 instance name in traces To: Greg Kroah-Hartman Cc: Thinh Nguyen , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260105115325.1765176-1-prashanth.k@oss.qualcomm.com> <20260105115325.1765176-4-prashanth.k@oss.qualcomm.com> <2026010652-dissuade-reproduce-008d@gregkh> Content-Language: en-US From: Prashanth K In-Reply-To: <2026010652-dissuade-reproduce-008d@gregkh> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=MNptWcZl c=1 sm=1 tr=0 ts=695df723 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=EUspDBNiAAAA:8 a=MQqcKvBo1mwqSKGJkacA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: 09LtTt87RQmn-itB1hvtf81C3-8UH41t X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTA3MDA0NyBTYWx0ZWRfX1LmTbzZ7UWmB iB5ppwBAeszNkv22nWxJV3YwyqtcCyky+CHoDPY/RSxaJCL9xbcPge3L+DKeiLxl5gBgMm+E+jT uYPsCnlQ84+xqPY//CT4Ea8iQePQLvD0even2nKHk2/Qp9D3HUdFfRlIKiIRCwMNHTeQX8k2QLB 13PzEKX/Mf4vpu5RB58uhRAJTcvh/LL1oPAyT/LNiSOZxJDoTWiIunThzY9RKYqPljJB4T7iN26 apde1B6aSPPbtf15C/2MjpkOwWKZVADlJX5B/Ai/qNkXJqkdI+cnlL5n5dhKFzGTAEs0gO4bUgj 96BqRZmQ30TK+62asGAi+my9ek3hZWadG652cyk+TB7xQ8L6LLvUhkH8ddajHrFJGL+1YFihmfF dhsfJPvOKj6ZvrvXvuMvPPL8XfDNQ4KjvDvXnFR221A3pgKsdVkPZmBLXS4B1kxjg/XEUrLXeY1 vLWIFXWbKmrB1dbXbqg== X-Proofpoint-GUID: 09LtTt87RQmn-itB1hvtf81C3-8UH41t 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-06_03,2026-01-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 malwarescore=0 adultscore=0 clxscore=1015 bulkscore=0 phishscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601070047 On 1/6/2026 3:28 PM, Greg Kroah-Hartman wrote: > On Mon, Jan 05, 2026 at 05:23:25PM +0530, Prashanth K wrote: >> When multiple DWC3 controllers are being used, trace events from >> different instances get mixed up making debugging difficult as >> there's no way to distinguish which instance generated the trace. >> >> Append the base address of dwc3 controller to trace events, so that >> the source instance is clearly identifiable. >> >> Example trace output, >> before -> dwc3_event: event (00000101): Reset [U0] >> after -> dwc3_event: 0a600000: event (00000101): Reset [U0] >> >> Signed-off-by: Prashanth K >> --- >> drivers/usb/dwc3/core.c | 6 ++- >> drivers/usb/dwc3/core.h | 2 + >> drivers/usb/dwc3/ep0.c | 2 +- >> drivers/usb/dwc3/gadget.c | 2 +- >> drivers/usb/dwc3/io.h | 4 +- >> drivers/usb/dwc3/trace.h | 88 ++++++++++++++++++++++++--------------- >> 6 files changed, 66 insertions(+), 38 deletions(-) >> >> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c >> index 670a9d4bfff2..3aa85f5f1c47 100644 >> --- a/drivers/usb/dwc3/core.c >> +++ b/drivers/usb/dwc3/core.c >> @@ -158,7 +158,7 @@ void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode, bool ignore_susphy) >> dwc3_writel(dwc, DWC3_GCTL, reg); >> >> dwc->current_dr_role = mode; >> - trace_dwc3_set_prtcap(mode); >> + trace_dwc3_set_prtcap(dwc, mode); >> } >> EXPORT_SYMBOL_GPL(dwc3_set_prtcap); >> >> @@ -2193,6 +2193,10 @@ int dwc3_core_probe(const struct dwc3_probe_data *data) >> dwc_res = *res; >> dwc_res.start += DWC3_GLOBALS_REGS_START; >> >> + /* Store the physical base address for logging in trace */ >> + snprintf(dwc->base_addr, sizeof(dwc->base_addr), "%08llx", >> + (unsigned long long)res->start); > > I think start is defined as resource_size_t, which is really > phys_addr_t, which is then either a u64 or u32, so why not just use u64 > here? > Yes, we can substitute u64 instead of `unsigned long long` + snprintf(dwc->base_addr, sizeof(dwc->base_addr), "%08llx", + (u64)res->start); > And are you _sure_ it is ok to expose that to userspace? > yes, because it's already part of devname in most cases. > >> + >> if (dev->of_node) { >> struct device_node *parent = of_get_parent(dev->of_node); >> >> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h >> index 23188b910528..c16e47273ea0 100644 >> --- a/drivers/usb/dwc3/core.h >> +++ b/drivers/usb/dwc3/core.h >> @@ -1178,6 +1178,7 @@ struct dwc3_glue_ops { >> * @wakeup_pending_funcs: Indicates whether any interface has requested for >> * function wakeup in bitmap format where bit position >> * represents interface_id. >> + * @base_addr: The HW base address of DWC3 controller. > > You already have this pointer to the resource in dwc3 somewhere, so why > are you storing this as a char string and not just always using the > "real" resource instead? > No Greg, dwc3 struct doesn't have the resource pointer, but has res for xhci. > And also, document this as ONLY needed for debugging things, that's not > obvious here at all. > Sure Regards, Prashanth K