Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp4225781rba; Tue, 2 Apr 2024 10:40:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjcyPIF/CtWPXz3JUd+o1V7HsP5sC0uUIjWoB7doAfLMjeAYvq+72FQLsPf7ucrx8D9XNXtGqQVC3vjR6JPCbZiio/LqV5bIfac32YTg== X-Google-Smtp-Source: AGHT+IHAujfb0QzljfS8VsWSDqBcJ6kVL11CicQWTjiB7ligAkL5CIRn3cb1DIJj/+F6yoHKxPD4 X-Received: by 2002:a17:902:ce12:b0:1e2:82f8:c6af with SMTP id k18-20020a170902ce1200b001e282f8c6afmr1703057plg.18.1712079612747; Tue, 02 Apr 2024 10:40:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712079612; cv=pass; d=google.com; s=arc-20160816; b=yIJDIz1v7ySx0HUcro0LEr69jt+D7RxMXinLilDEK8Jq+MPq+M8gSM9cOuKqfFHwYH 5INH6gPV26ReoIAr5DwDtk4sIgPNWQSCYhlwyiviUDxyUJCjFdov7Mm7AJTO959qB5Y4 jFYjezFlyhlHzX4dwOGk5xJ9NO67xLzAbef/SP0n2gFgkT17F1yXI8YDmdSB0qALcE3v 8cg+dut+avMejcaPJK/VTK6VDVsWvx6EoHTrQBMnQ3fMW329vhfEOE/6kWMVlrnTe39G G03GKQik0Um6dnBu4ujecA5KV7KoXUChRPzkoam34P3+lwZs26OqRsUxlm+g9OQufiUY ywaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=aqJOpvbyBmvtqRsTmffyDJDkg5th9P0RJAbEDy92BsU=; fh=H9Jjb79OHh4zUXkX0CE8aU5X+EYBGXHMpd6s0yYUcJw=; b=KV+ymnWBzFryqkIb/md822HQx//UHvPky58wkCSHMhKDc9wRBadyqTJTm36B5PmV4c CFgTGYkPEQnGOlyjDM+AjjMP5L4Ae2/z1QfGsiCIu0fOuv2tit2uZbtL4q0teYQCeuDQ 8qeQYQUGkJsyr5xxoaQMm4H+KNMAr8nSFX5Cka1buH3yhkk8tqMA20tJIu6wa7lcG+YH lYgA9fVw2xYkBmAwLFfz3f4dqkG2dauRrPuvITFtMj+CA90bFfKS/XlXzQs3nUgr8jqR cUKtE+fLsBWCuOmEsKYI4QhO014Tehp2tESW4p6/YM5xgQRxfdOHBsvazOIlMOkp6FrE 6VQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wLYxvwIJ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-128403-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128403-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k1-20020a170902694100b001dd693cc79csi11110875plt.620.2024.04.02.10.40.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 10:40:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128403-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wLYxvwIJ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-128403-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128403-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 24800B2B3BB for ; Tue, 2 Apr 2024 17:07:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6517D15A4B4; Tue, 2 Apr 2024 17:07:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wLYxvwIJ" Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D09A415990C for ; Tue, 2 Apr 2024 17:07:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712077637; cv=none; b=EEGtjLtXEOzInIxh4rUfxcu/fhOz7YTzzT1hr3yeCh+f5fJ9Vw3CWpv4aXGKJMrrqASZt8YGxprvUkEnpjOHccnZClmWiPK7txFhSHYUKcpkQf6xwBlmFdrcQgKt2In1i5SWBbQDl1LqDNmKnDONRmX0HmwOOtLtjbLN/2GI1lY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712077637; c=relaxed/simple; bh=T6Qd+L04mZkzAyR5GBc7ooVeXexQ2iHz4W9MFLmMCFM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I2mDduEgqnypbAs/waMnqprpcbU3/vRbWGXdO9nVng+AxkzN9GYB189C0vKfoc0FHo1Ot4BqV0txanpl3d3JRDFQcrTpXGUIFe+xWOK4LXeh1zHXBUt1Wey72JyWOWf/o4kjc9c9so1D8CqWU2U1EhXU9WEcWKTIoUlkNhHmNhM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=wLYxvwIJ; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-516a0b7f864so2346052e87.1 for ; Tue, 02 Apr 2024 10:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712077634; x=1712682434; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=aqJOpvbyBmvtqRsTmffyDJDkg5th9P0RJAbEDy92BsU=; b=wLYxvwIJkFK3S3KAe8zRVy9A8MwzbHZhc7V2RFuTJDzmqPtyzhdXbCC+7MGyssKE8I xVFPj6KjlCo/dgO8Wi1ScF4X5sKavfwyKanxeoZ35/5BRnY56avLPXp7IXa7+E2X73vC 611I5wBRb5RDhsjUgt6ARR2IAWMBqs2X7XaGOq/dOA2XjznSSFk5zxeA9x0fCK3+tgOX r/OOtkZrGKbTJXlMVqsHK+Bs7GeBDOpYMhJsM/n2eHTtxUG0J+2rfqFSxiYC5PWYOjbd uLnVvKEKcpBF6MmUjO/2vRb1lFRzBK1BtQ6GG14YF4vh41TbXPdG8oGAhWWaZVeIzMyI 7F4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712077634; x=1712682434; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aqJOpvbyBmvtqRsTmffyDJDkg5th9P0RJAbEDy92BsU=; b=EkHA9L4Bgg7g86czwkh/ghg0/MlK/PxveyyPNP+ojDlWoLg6Vr8m0RrGsqeIx2ZD50 u4esciQfViOrG1nErl0CJcHx2OGWmMdW/8lgm2Feeq/UpJKJ5c/NiivDA5pV6xVgTIHC Ej8wcviZxsc6e0d/R/cciNTamoZXz5t7HN6jSrVp9AkD3zeR1auwKjVm6BCRGWhP194I fas/Bt5xPsFBgkMAfuDUV/nEcs3BctGc12zRqsiGRIK5keJgtndw2qrLMUhO2k1PD7Qm m42hcXS8jmsECmCF9bGZ1KisD4OQs/lyRdwaDtpjAZY3JUSkj6u2bC6K6e4E0O2ahAxH IC7Q== X-Forwarded-Encrypted: i=1; AJvYcCVgy//JpNOfj1ZzruonGJPPDbMJEM+/A3y+2RrPOlpz9oLMfnUMNUPUllXhLHOD+XffJd1BC3k0sCpBQOg+tFWfxqsrzd33qCLj03Ik X-Gm-Message-State: AOJu0YywuSZZQq0LXv/KEWpST/RnfClprbcnLFgFs4rY//DA0G0RPFMT Cq9frA/qmy+WJNSoX/yyTGSodaUSBzLpCfrYhNVcGF6/GQox9Vc/ioFUDkUQqZ4= X-Received: by 2002:ac2:4841:0:b0:515:7686:2609 with SMTP id 1-20020ac24841000000b0051576862609mr7622350lfy.18.1712077634152; Tue, 02 Apr 2024 10:07:14 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id e12-20020ac2546c000000b00515cc53c5b3sm1603486lfn.125.2024.04.02.10.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 10:07:12 -0700 (PDT) From: Dmitry Baryshkov Date: Tue, 02 Apr 2024 20:07:07 +0300 Subject: [PATCH 2/2] soc: qcom: pmic_glink: notify clients about the current state Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240402-pmic-glink-fix-clients-v1-2-885440b81c65@linaro.org> References: <20240402-pmic-glink-fix-clients-v1-0-885440b81c65@linaro.org> In-Reply-To: <20240402-pmic-glink-fix-clients-v1-0-885440b81c65@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Neil Armstrong Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1084; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=T6Qd+L04mZkzAyR5GBc7ooVeXexQ2iHz4W9MFLmMCFM=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQxqPtZ0/d3ny957716MSL3ZOe7PGkulvxy1FV66vddI31 i5SMP3RyWjMwsDIxSArpsjiU9AyNWZTctiHHVPrYQaxMoFMYeDiFICJ8E3iYNjo8L03a9VJU+6N G9IP800Ru67Var4t7txN8wq1aeFTNk2W3Tn7/qOlVi53X8fZskYpH78jFO3656ywVmSZmIxaeZr uGp+lHbc8ivPPXjnyRdeH89V5DcfLeV/8FG/r7txrL6ZX4fpS+9+U+AevYxUXMuuf2JCyI/2Dlk jQwZZbZ5efMfCcX/ji+P1NqiVZWjdVSnlvN389mWfccDuwVFBlwl/+RrbKg3piJzfcKU9dwTmvP pylSOh9WUNB1C3xDvtTWUK3qiM/1ru+rdtU/0c6+Wq3rWKrktSqpzOn1QR1R1he6LyRdrHlzfM2 dta4EInEvSyN5WWPHEJafxfnMX/l3GV+Ws5eWyYp8PwxAA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A In case the client is registered after the pmic-glink recived a response from the Protection Domain mapper, it is going to miss the notification about the state. Notify clients about the current state upon registration. Fixes: 58ef4ece1e41 ("soc: qcom: pmic_glink: Introduce base PMIC GLINK driver") Signed-off-by: Dmitry Baryshkov --- drivers/soc/qcom/pmic_glink.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c index c999358771b3..089cdfb1c9d1 100644 --- a/drivers/soc/qcom/pmic_glink.c +++ b/drivers/soc/qcom/pmic_glink.c @@ -83,9 +83,14 @@ struct pmic_glink_client *devm_pmic_glink_register_client(struct device *dev, client->pdr_notify = pdr; client->priv = priv; + mutex_lock(&pg->state_lock); mutex_lock(&pg->client_lock); + list_add(&client->node, &pg->clients); + client->pdr_notify(client->priv, pg->client_state); + mutex_unlock(&pg->client_lock); + mutex_unlock(&pg->state_lock); devres_add(dev, client); -- 2.39.2