From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 307144218BE for ; Tue, 31 Mar 2026 17:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774979061; cv=none; b=l4I5lD3+Y6tPr7DF7Hqf3UZlsk0zeBHgY8KjQoOkecXKgIkMxMJTstZAVfizPPfDjVODa/5X7uJJtvsFIIEYQSL2mVxyGppAyVJHVQI0qOJmrAaF2hYWWR857rwxvmAXkonrD6Od64T6hyGGBA+yuuWI2o3DXZhusaTBuLfsxHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774979061; c=relaxed/simple; bh=+fqFlcR40sZtN708uUz7P1xaxS5MzwDcqyUwaRkawuw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XfwjG2Tf8Mb0rcHpknlN+0sKo/fruJKB1CczmI72cxzAxsT1Ge0jqM48NsBy7q/YlZ6niCOU+AwlTEyRGM2imasDtNgPI93Kk3C9epsvCyrDFS8UegUKocX4Em2tZfLQnK9j0Jo8CkQMPlC3WQeU7YcAVO5lqxbNI4dzKctoH+4= 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=S1JXZVqi; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BtZcaw0C; arc=none smtp.client-ip=205.220.180.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="S1JXZVqi"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BtZcaw0C" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62VGdaX63883346 for ; Tue, 31 Mar 2026 17:44: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= D+yGuI/cnn9s0aXH93O9cB1RiK/gxeg7flRhGmZ3lRE=; b=S1JXZVqirPIsnDKO eNlI8hu0j1OVYc+QTtfzhIir27jFgYQehRjJjQA0ZwyZKkD8XBhtiZH707YlaNQ6 CZwDOScICExmkufo6Rek9e5Y/XZQvbyy9+xvVQvIqXSPcmb3TUn9UvfZVRl8Ey4G 63jWwFpzI7iTMpMB0+vEbPjl218yvzBwzJ+RbrhRPlx1cf2pDfiJ30G2DjtT+Y3i pafCLu5tNErS9Tlhj6LhO2O4RL195lZP959c+knhEG9QdEy7oCZ/KDQe7RI/PHCZ O9jI7S4xcvNxAOlukEyWFzT1I0IylPI6pgQbrwlmn+np7OjySI2B3t5lNyGatc9A t0RReQ== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d89utar4n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 31 Mar 2026 17:44:16 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2adef9d486bso106950115ad.2 for ; Tue, 31 Mar 2026 10:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1774979056; x=1775583856; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=D+yGuI/cnn9s0aXH93O9cB1RiK/gxeg7flRhGmZ3lRE=; b=BtZcaw0CPB+vZACuPu92NNQRxfo9bbYYWfDH8khfP8tAR69fBRpZJC7IiN/rtGPwxK bJt1gqEkduJ1zLTP5VsR62+pnIt99XXgKof6lsvVhEHDuA/I09lBxSBmaqNQ016jGaCE /OAwKQsHYBxXulPDpdcDD6dKTMQ4rFMXBsITHT8KX+Oe+Occk0H/V+WSePh8qzrxPxVF L0VLGaNa0VO95nhAlKfkUIg1G/DuvinTgRComysQMftoWcfWEOoK1ZEGvEj6OJFLp5EY yNYMFnvXTfxlD+GoXqAalSIWfSxVhw0paCPkT82b9yFYIIOCofLIaQCdeiH3MlwlSBdH 5DwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774979056; x=1775583856; h=content-transfer-encoding:in-reply-to:content-language:from :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=D+yGuI/cnn9s0aXH93O9cB1RiK/gxeg7flRhGmZ3lRE=; b=JBuQLvf+yhFu2T44BzoLx9VnvhspvgnSjfM5YnFQ4/DKUq4z8aRJbOlnqk1/+tQ5zv gfd+OAE3y8vHEPF4NifduocuN0Xb1vEfbNob/prYohEjhqrvA8W3ihoJg5WoaVY7WJm5 8ygtorvkxEXekgXoG+x2zN1gXVnXh69VL32arURt7qKvq5flnE3KmgZFA4H3yeFl20e9 k2iwosYNkPVj1mEcosXf55sPzPNdBLZLXxRR+3XogUscrpIGTENzpyhdYwdHY7z4xXRp gsOZYF7eIU19ezmdoab2GDONziAn1G65V68EVSSDap/P3LsQS2s1mtEH+sW2rFJJHbcm NQsw== X-Forwarded-Encrypted: i=1; AJvYcCXiLyzkdMdtIgr4P6goINp7Evs9R5bB/0ddsm5qpBMFakqEtwH6o+WFe6NMl3LDZHGQO+8y2RtmxRBp0fA=@vger.kernel.org X-Gm-Message-State: AOJu0YwX+ttBBvc3gluk+UOHvbf+tx7ck9TUF0BjYWlrsZgrV1CKG8Es HqdymLuReKpFmg7FipvY9as8O9TQqOnrKc/b//Zp0684U0VI5Z2cZItkQgAdx1jc82cdoriRLi2 U9KY6WBzHAdsokQK0DSivyxpFnABO95bRa0v2Rz924RLAAM0YdYXpK7LBSGuWXbOBfvU= X-Gm-Gg: ATEYQzx+YSFoQHUbbQBIiX81LlCO8G2hHXM4uztsClBiKkg3jkE6bfXikGGxhaooiEj zlMrRFKPMAoq2COsyHHzS6lqHRJfM5xZxkExSzxx/mhm730iPWPwN344wX4BdDqgy24iBj3JRp+ SPhLSv5VXy+8X8+1TEspRKvAwjhGnOfqyRNioXAhMI7Xmel5eAUDGFo0ewAx3VuqKpXnjWDRoyQ ZcTyqLSv4fQNZ0Awn1lO4ZAIGVDYUf9k9ZILIsUrAU4cNIAPQQWQNI9YCk9hQWEtOmeFqNyGnyO fFyL9Vo82JbjjdvbLfu4wtW2jPxmGkn+2hd6W85O6bsYsWzu/KWRZ+IGNu/BKh565aziGLVyXof LyZLAk/OUIPsGNobA2OwvIEjox8TaBbV/TjFf0MlwkT6r X-Received: by 2002:a17:903:2acc:b0:2b2:5515:661c with SMTP id d9443c01a7336-2b269c9c7f9mr922265ad.31.1774979055680; Tue, 31 Mar 2026 10:44:15 -0700 (PDT) X-Received: by 2002:a17:903:2acc:b0:2b2:5515:661c with SMTP id d9443c01a7336-2b269c9c7f9mr921875ad.31.1774979055071; Tue, 31 Mar 2026 10:44:15 -0700 (PDT) Received: from [192.168.1.11] ([106.222.233.0]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b242765be9sm159057465ad.39.2026.03.31.10.44.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Mar 2026 10:44:14 -0700 (PDT) Message-ID: <43a76705-bad2-4b17-9dd8-86721b80ea76@oss.qualcomm.com> Date: Tue, 31 Mar 2026 23:14:07 +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 10/17] drm/msm/a6xx: Update HFI definitions To: Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Clark , Sean Paul , Konrad Dybcio , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Marijn Suijten , David Airlie , Simona Vetter , Antonino Maniscalco , Connor Abbott , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann References: <20260327-a8xx-gpu-batch2-v2-0-2b53c38d2101@oss.qualcomm.com> <20260327-a8xx-gpu-batch2-v2-10-2b53c38d2101@oss.qualcomm.com> <3465929e-262f-407e-bc3d-7564787bce3d@oss.qualcomm.com> <67cca0c6-669c-4dcf-be3f-76fc46d1e59f@oss.qualcomm.com> <2108dfe4-bbe9-48b8-b77f-e7d2904f18b4@oss.qualcomm.com> From: Akhil P Oommen Content-Language: en-US In-Reply-To: <2108dfe4-bbe9-48b8-b77f-e7d2904f18b4@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: xMwtsa4e7JDALdZ0NAmnORFAJ2TuRbov X-Authority-Analysis: v=2.4 cv=C5LkCAP+ c=1 sm=1 tr=0 ts=69cc07f0 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=LIJ1G+IszuYCLGPi0MaIKw==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=FyolfZIV0nzXbpKuJ4EA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-GUID: xMwtsa4e7JDALdZ0NAmnORFAJ2TuRbov X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzMxMDE2OSBTYWx0ZWRfXxx7Z+I84ZtPe NTURHQ9HchTXTBvkbFAsDCQlBwp+tkWvT6XZJMCY3KIELLYQxEA5k1z5dMraRycMwmXvnA52yim IrwAU6fQCWfUkVKgS8OcmgsX75Pf/Hcl4u42RM/WFoxmVwuLwR5vdBo7o/UppZHpu0SiX4IwNL0 6RaK0PYiViuh0gKjLEs+mjUgEL8y6Bz5JiumLJJEU8momeTA/QnVrdfEDO9nESJWSa6O+wGPxpK 3Uxo4DE15gva35SdhHe1GsYsgF4Am26UF3+E2vyvuo+BbND3qlJdts2QsLkFxL+p2bxi7ALtSRE gg490xRK76TxziqpJfN+Jt/cz/WCeEE+C7FUiSyCoG1EnrWPJt27w6czImoca6nmC01jIMTNw7c qC3gkj0AUHYMAp+FbfW8gMIGI3XlM/rM1APr4S/FrCR10IplXDLgBJ4BVNcHZ9cHn2X+ZPPP0cY 3KOowvC0Dahe2Z9SNew== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-31_04,2026-03-31_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 clxscore=1015 malwarescore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603310169 On 3/31/2026 1:52 PM, Konrad Dybcio wrote: > On 3/30/26 10:27 PM, Akhil P Oommen wrote: >> On 3/30/2026 4:45 PM, Konrad Dybcio wrote: >>> On 3/27/26 1:13 AM, Akhil P Oommen wrote: >>>> Update the HFI definitions to support additional GMU based power >>>> features. >>>> >>>> Signed-off-by: Akhil P Oommen >>>> --- >>> >>> Whether you want to proceed with bitfields or not: >>> >>> Reviewed-by: Konrad Dybcio >> >> Thanks. I still feel it is bitfield layout is a 'bit' complicated. >> >> I did an experiment: >> >> #include >> #include >> #include >> >> struct packed_u8 { >> uint16_t mitigation_time; >> uint8_t current_rating : 6; >> uint8_t num_phases : 6; >> uint8_t path_notification : 1; >> uint8_t extra_features : 3; >> } __packed; >> >> >> void main() { >> >> struct packed_u8 data = { >> .mitigation_time = 0xffff, >> .current_rating = 0x3f, /* all 6 bits set */ >> .num_phases = 0x3f, >> .path_notification = 1, >> .extra_features = 0x7, >> }; >> >> printf("Akhil 0x%x\n", *((uint32_t *) &data)); >> } >> >> The output I got in Kaanapali is: Akhil 0x7f3fffff >> >> This means that the compiler inserted a padding between current_rating >> and num_phases. > > That's because __packed doesn't work outside the kernel - you're just > creating a variable named __packed, so this is effectively the same as: > > struct foo { > int a; > int b; > unsigned char c : 2; > } __hotdog; > > int main () { > printf("Akhil 0x%x\n", *((uint32_t *) &__hotdog)); > } > > Outside the kernel tree, you need to use the full annoying __attribute__((foo)) > syntax: > > include/linux/compiler_attributes.h:#define __packed __attribute__((__packed__)) > > with that changed, we get: > > Akhil 0xffffffff > > which is the expected behavior Yeah, I can confirm this. The AAPCS doc which describes this is a bit difficult to decipher for the case where a bitfield straddles between 2 storage units. Anyway the experiment confirms that your assumption is correct. Will address this separately when I post the CLX patches. -Akhil. > > Konrad