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 341471A9FA4 for ; Tue, 19 May 2026 04:10:56 +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=1779163857; cv=none; b=b+2XMI4sowm9Y1wDT+gUf+cDW2QmdTjsSX2gvWXChVFaG8aYpXkrJbQ0EN0QlmXG8DkD3H8ItxLcxIriAqjwhZiDwk71gAaMJ/4tt3i1fBiQzPUbT9TfhjSuiMDPtImNXe3TUV8+eCJ5tzaOptc4XpiLHW6/NwEWV2bwy/sCk9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779163857; c=relaxed/simple; bh=YD5pRqb32Rg6/ph47dYp8qW1E2jdfQ9SNzh5AXty/Bs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RAF7Q9mKwq5ePcLDyFZObwYIXZVa2c8jKLici0zX4uqE4rfrAVMoAQEGnu5SaUalDNwq90jy8MwBDDMAXvWlhs22HHIrgBjpurDynX2ANRoSxur6dUS5ST0MmUxzjs8Kg937cqxRd3Lv55D7yTZVj/s2IdnoeDfKd+Hoo6Siw60= 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=SX+keWtm; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=jjyhiN8T; 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="SX+keWtm"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="jjyhiN8T" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64J31IFx2083071 for ; Tue, 19 May 2026 04:10:55 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= F41BO6haCztjrV3WpmCmogDphocXyTbUMlCrviX1MQQ=; b=SX+keWtm/wEaYrJ3 dDX4B0kuyajaNJSdt/DcKCb3dNc80Ip1L2gJOHABUig/ew+3PFbvHMyzju68P4Lc yJHIRTH5Ho/v0HRnnnGQuSvOOAlJnzQIoozIg6l9lAEVJJWTJ4wselBR3giX9v9E xVwF5zBbErP2sZ6rMz/mpQd2G525H5MjjRwUiU5pEsIFOf+0LU06bZsnguVWNk+H wMLsTZp+KQTugkjWEZWEjdJNYDjZ5NSWI9NQ/RjTEAeQeheY/MI5UQuEKbARWDPS gW2Bet+Zk0dH2orNMLOC2c2mMTUloT18IMjZT6siQ4wWQeKEuvsMEqSfLVmFrDd9 aMKIEw== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e81chbdxr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 19 May 2026 04:10:54 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-365d4d2fa04so2841551a91.3 for ; Mon, 18 May 2026 21:10:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779163854; x=1779768654; 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=F41BO6haCztjrV3WpmCmogDphocXyTbUMlCrviX1MQQ=; b=jjyhiN8T2qd3tPovWup9RCTDXg59pAVJ62jdUnTOXqzCGKmJ39Y/YStdKQ+F4Fj8Lb 5itXis5Xqnc9zwKrMsYYyhHNbqKPO0c/xik+s1gDLVd8PFtAitIKsmH0Hn3X1qA9CNcI +zJ1t4oaUkZ2GZWD5VOm95y/rtHG2GvG1beky6Wwjwc300GdNLtw+/auPwD5GM9RwIfR IWHK2M97ptASFevZqPCGynmauMU+YrmTkl5pyBqzX+x3MK9PDXgkURf59Hqr/8i5fps+ IGgQnkAPI4BVq4GOyW6CdRbefxcqfmU5bdSHS/uPfg3zkknYOEIpKMH7WPW8foYgNaUP kSNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779163854; x=1779768654; 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=F41BO6haCztjrV3WpmCmogDphocXyTbUMlCrviX1MQQ=; b=AzBFMX+v5jFLvlR7hOnGX9XoyLOo6GLTsIax/teGOAUTEqhF9hjLDU/k4MF6Hw17cj 9aKX9Le0wCEQmUD1U5InAYVN91cB5h2C2IzgzbfjHd9+0QQgtB954i4lJLXX2bDZQ3yJ RQUUlhvOf2mvSikBcxOUBDATemk6WCcNxUj4XtC/ladsxbF+7Sptaf7lHVhFn4XUTPVU 9yqDMdN6us81Ms+174llsmamCuAZ2sSu/iNYTiaa81Zxe5Vzw3MEdc/VVyTmRXIGFi9P GfRAtjK4kPyRLM20D0nlX27v6Ri3H5aoJMhDmMqvLLx3vM8wodB4GPiWys/DSXzXEq2x IgvQ== X-Forwarded-Encrypted: i=1; AFNElJ9JoDRbAIg4dDgRh2Obi1PNdLz26gMSaBQiRbWnFItSRl5fqa2gfzu2kPUNIPtiUsLYVOPJMPh+PoziVpA=@vger.kernel.org X-Gm-Message-State: AOJu0YyPeEfibtwrxuHP35POQg636M5ChCwdMaBM5ZyI48sCoxUIojEY +lEXIfKj3BGA/iQ900eb5QQBjdQfYroZFZcYlebPpKnLHDkr58pRyFaiuA6aaQoH1q2x4e9uTOP pAqz86rgWtXfcMn4/tjRt5HgIe0+BgbuBiwAf4m59ZfW+Rg0QnCBbjOFDvLotTtjrUAw= X-Gm-Gg: Acq92OHPg5YejjjfJQvjCrfKzjfIvDy24y7g/QBFQ7rrCp74U6MXVdKngybAiJFlFt/ QIei0+ZE4DKTUHKwPFWOpxh1WM+c07jOdFgwLWOjtg1Xx4hP1cdhk12ghA29OzHucPuAg30aAPc hUH08zGFmM18cA1AAm78/48zSpn4RPgJO8JQQRaHO9PNDzT7GRI7vmF0CApebOPnoVRJD5gzIZT iespHeEtjUxHaoOpzf/Vad33PDluebKHKJOcX86Qzt0trVQ6CrM3Zsm7X2XRHQhKvyscaLbcYSP GYE2gvyRzq/dqtETMLhKBnzqmfekqJx9WOsl1TyWQbwTC8IhJZbPShTjLq+ARpaYQORQyMFDjT/ uO006sYxkyWeiX/KyD45g4zCCzzTMUou/THXInmxmE3OkLJOFMhI= X-Received: by 2002:a05:6a20:3d1d:b0:3b1:6649:e524 with SMTP id adf61e73a8af0-3b22ebdbb2fmr20201300637.33.1779163853982; Mon, 18 May 2026 21:10:53 -0700 (PDT) X-Received: by 2002:a05:6a20:3d1d:b0:3b1:6649:e524 with SMTP id adf61e73a8af0-3b22ebdbb2fmr20201274637.33.1779163853488; Mon, 18 May 2026 21:10:53 -0700 (PDT) Received: from [10.217.198.242] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c82bb0ff0edsm15579177a12.20.2026.05.18.21.10.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2026 21:10:53 -0700 (PDT) Message-ID: Date: Tue, 19 May 2026 09:40:50 +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] pinctrl: qcom: Replace open coded eoi call with irq_chip_eoi_parent() To: Bjorn Andersson Cc: Linus Walleij , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260514-pinctrl_msm_irq_eoi-v1-1-2d152f8695f8@oss.qualcomm.com> Content-Language: en-US From: "Maulik Shah (mkshah)" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=a4MAM0SF c=1 sm=1 tr=0 ts=6a0be2cf cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=ShOtjy6-wzECGNJG7jUA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE5MDAzNyBTYWx0ZWRfX0TQmzNn2QCOx xfMe56CY1631qSV96dMYsL3HfNcn+wL5yBFk+/YBaZ45HG7s/1+1Pykwy7Crc9H03VAmEBcDW6A UHHmbS/X/vK2XH7KiR03ipY2JUDIlIX3l9BJIQ9IIStBRtuR79j1nJooNEr8yyj8bx1undOT8WS b4hOz25OsSO750VT4b++DSDdgoDpVpayesDH7DPb00L/fW08r7Y8lTyKGmxGElqQMjrApVqZKG3 6YHMraKAwwG/j5WKniS5zXLRsBvSmJLrXVNSueMU7yp2lEgQSp2BYHETMRATM24I7YaYZH/PkxR jpwueMjb4L4is5inPTSUrK64rEuVPXTC5vDp3LnRcx2fyMELjJgwVJh49ZHJHUIhqNpq2j2xaTa 2VithxgQOH/CLtn8y98OwLzecuJGmA1ejS86+koygWw1fg+zG4Wdng2NUuNRODL8bpYGel9lp+t neG8S+GosxKuKFZOyww== X-Proofpoint-ORIG-GUID: V8K7SM2CCldfD7rGk2xCjhMk_WAECcR0 X-Proofpoint-GUID: V8K7SM2CCldfD7rGk2xCjhMk_WAECcR0 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-05-19_01,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 adultscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605190037 On 5/19/2026 9:03 AM, Bjorn Andersson wrote: > On Mon, May 18, 2026 at 10:20:55PM -0500, Bjorn Andersson wrote: >> On Thu, May 14, 2026 at 02:08:25PM +0530, Maulik Shah wrote: >>> Replace open coded eoi call to parent irqchip with irq_chip_eoi_parent(). >>> >>> No functional impact. >>> >> >> Reviewed-by: Bjorn Andersson >> > > On second though, I'm not sure I want to r-b this patch. > > The commit message explains the action of the patch, not the reasons for > the patch. From the description I inferred that irq_chip_eoi_parent() > does implement what is open coded here, and a quick glance confirms > that. > > I'm guessing that irq_chip_eoi_parent() didn't exist when > msm_gpio_irq_eoi() was written? Or was it not used for some reason? irq_chip_eoi_parent() did exist before msm_gpio_irq_eoi() and msmgpio irqchip was using same with a condition that pctrl->irq_chip.irq_eoi was only initialized to point irq_chip_eoi_parent() for the cases where the gpio had a parent pdc/mpm irq number. Later via [1] (as part to make irqchip immutable) pctrl->irq_chip.irq_eoi callback was updated to use for each gpio interrupt and hence requiring the check like below inside eoi call to invoke only if parent data (PDC/MPM) is valid. d = d->parent_data; if (d) d->chip->irq_eoi(d); [1] https://lore.kernel.org/all/20220419141846.598305-8-maz@kernel.org/ > >> Regards, >> Bjorn >> >>> Signed-off-by: Maulik Shah >>> --- >>> drivers/pinctrl/qcom/pinctrl-msm.c | 6 ++---- >>> 1 file changed, 2 insertions(+), 4 deletions(-) >>> >>> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c >>> index 45b3a2763eb8..6771f5eb29e4 100644 >>> --- a/drivers/pinctrl/qcom/pinctrl-msm.c >>> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c >>> @@ -1012,10 +1012,8 @@ static void msm_gpio_irq_ack(struct irq_data *d) >>> >>> static void msm_gpio_irq_eoi(struct irq_data *d) >>> { >>> - d = d->parent_data; >>> - >>> - if (d) >>> - d->chip->irq_eoi(d); >>> + if (d->parent_data) > > "I know that irq_chip_eoi_parent() will peak into d->parent_data, so > let's peek into the object first to avoid it dereferencing a NULL > pointer". > > I see one other caller to irq_chip_eoi_parent() doing this, most > everyone else just register irq_chip_eoi_parent directly in the ops > struct. > > Are we doing it right? Yes, because some gpios may not be wake up capable (they don't have their PDC / MPM interrupt) and for such cases irq_domain_trim_hierarchy() makes irqd->parent_data = NULL, so this has to be checked using if (d->parent_data) before invoking irq_chip_eoi_parent(), since internally irq_chip_eoi_parent() de-references without a valid pointer check. one can argue that the valid pointer check should be taken care inside irq_chip_eoi_parent() (and all other irq_chip_*_parent() APIs) but i guess not all irqchip have cases where irq_domain_trim_hierarchy() may be invoked and it would be overhead for them. Thanks, Maulik > > Regards, > Bjorn > >>> + irq_chip_eoi_parent(d); >>> } >>> >>> static bool msm_gpio_needs_dual_edge_parent_workaround(struct irq_data *d, >>> >>> --- >>> base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83 >>> change-id: 20260514-pinctrl_msm_irq_eoi-ab736e16d411 >>> >>> Best regards, >>> -- >>> Maulik Shah >>> >>