Message ID | 20240201180102.70395-7-afd@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-48637-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp338836dyb; Thu, 1 Feb 2024 10:03:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/FovNf1a9onftGRe+aVMi834Mf+b3am1TwzZKchbv6P9F8I5zADBT17wVUhiAsJjp26UE X-Received: by 2002:a17:906:78f:b0:a36:877a:edde with SMTP id l15-20020a170906078f00b00a36877aeddemr4492020ejc.11.1706810599630; Thu, 01 Feb 2024 10:03:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706810599; cv=pass; d=google.com; s=arc-20160816; b=aLNkYrGBAK4x3GQBR34IYF5SnCmlqXdUnjWw2MrXsITZcnrd3ewbWquCRCLj81iTsH gZDYg4/og6eSApKSy7qGBv7L/ZzJxceqpDpt25rtBS8q+DdAsIg3NerQn7PbTNqw4JvQ WBnQJkSItGGmN/BysA6YbKYi9HxRzeH7kvm/QjAI1FoRxQjpctsXsrXCKTWFyBcNTMnf /8dBdyiYgXou9id+v0pFQf67OFUfdWmnMQylGKJd3Br3Fzah0NZ0BX5tX6Nd7SCDVzLe lxrO6Nn+CyqmVAZQ4HrtbcHhu3q+5LJtFRtY/p2r/eb9Z2EwsGt/KVRsx6CB0C0mTz4X uLag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=b1ggeAlqOeW6cDM2I0g1Lrz7ya2O6mo0S8OfUg915BU=; fh=jnwBU/BwFKkgpm7cCeX3fMfYXtNU0b/Z9V+CmfzQnPY=; b=vFgbruQ8/LavGewhZWudnw2Vf7JaUk/XMz6sdo7xur950mG5scE1nhipnDhZigGCIH ygGj7M20RX96Aukw40fkJnoIxACP6CkA/NZCrhS3uvS5Mjey1PuLdUtiD4IioZxmtdwn +thflXIvYPQZfff/iJtKxb7Pf4RcD0E19+u63iZ9/3+mDn0XLZ00UJn+UyjRVEJQ0U8c AEA0m1iwEN3uHuDvJT+nqm9WUfHrj7ik99GX5T1x+lEbYvaH9mRqUli7Vi5w+v7JCqUj N4kTLP1f3vfMdpzkAIcYJbp3wXP+R0rzMwMNFJSv9tQzCRqk6d3YJ9nIPao/Omc8kRpO ua8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BhjY8BID; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-48637-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48637-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=1; AJvYcCXO1+wYHjBNCxv/uP8dkpSl4cXmvWVjNLR0/ZjI/DZ72Tampz2Mwz9sEPKTJriwP27HzTYjrBH8ZmaoQccf3b1PlITHEA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gu20-20020a170906f29400b00a3162551e88si24263ejb.349.2024.02.01.10.03.19 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 10:03:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48637-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BhjY8BID; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-48637-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48637-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 36DD91F22AD3 for <ouuuleilei@gmail.com>; Thu, 1 Feb 2024 18:03:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3911B127B5E; Thu, 1 Feb 2024 18:01:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="BhjY8BID" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (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 D3A8084FA8; Thu, 1 Feb 2024 18:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706810488; cv=none; b=urEAeRyAz3hBhsYcdbjutL0vErzbzxOnl7TTD5b2hBvu2AYgzgpADRo4CEOFWuTLLKXaiIlO0cNIdkgsTmO4wG/fN7H4HUxQFmdW9eOWl8FiJytILRlbkpHgoxWgQ265gRVCRsw8gC7wCpsds3+Xx1oOjEs/HEDcdcJh0ITv8YU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706810488; c=relaxed/simple; bh=bDDsP6FtSJ5wVZ0CYHdodnlun3i/+w7VsSjbcJGnQeI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q26H5LTxg+JrFHDkcXX6+q3U6aGj/66sdzsK0cEV4FPUdoJYj0HyriSG3rBNTDqm5SzoaWnUaiOFRdEraaV7QJ75xs0Y0uLSujd08tahqHBgBAm8L5KTyn6ZufQFOR78FCuPSi7La3+Lhptx+7H5tWr+5efbRt3ko4K22rszqtU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=BhjY8BID; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 411I17wO049584; Thu, 1 Feb 2024 12:01:07 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1706810467; bh=b1ggeAlqOeW6cDM2I0g1Lrz7ya2O6mo0S8OfUg915BU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BhjY8BIDCh34TqTsuxsNCp59BD1rh4Iiu3NvrhnJGpkouoZ0xzRgSAoNY4vAPZdPZ gs+ymMss+pkmQL/x6MLDYhVTdPO2FLT5r0jJqXPVt4NO3l0ep76M+kHielPchllER4 fMTgVca4uiNbwX7Om2ggWGKxfTBw0mKtGGw4C28g= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 411I17n2029189 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Feb 2024 12:01:07 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 1 Feb 2024 12:01:07 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 1 Feb 2024 12:01:07 -0600 Received: from lelvsmtp6.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 411I12Gk117221; Thu, 1 Feb 2024 12:01:06 -0600 From: Andrew Davis <afd@ti.com> To: Sebastian Reichel <sre@kernel.org>, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, Cristian Ciocaltea <cristian.ciocaltea@gmail.com>, Florian Fainelli <florian.fainelli@broadcom.com>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Sean Wang <sean.wang@mediatek.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> CC: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-actions@lists.infradead.org>, <linux-arm-msm@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, Andrew Davis <afd@ti.com> Subject: [PATCH 06/18] power: reset: brcm-kona-reset: Use devm_register_sys_off_handler(RESTART) Date: Thu, 1 Feb 2024 12:00:50 -0600 Message-ID: <20240201180102.70395-7-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240201180102.70395-1-afd@ti.com> References: <20240201180102.70395-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789720631567275096 X-GMAIL-MSGID: 1789720631567275096 |
Series |
Remove pm_power_off use in drivers/power/reset
|
|
Commit Message
Andrew Davis
Feb. 1, 2024, 6 p.m. UTC
Use device life-cycle managed register function to simplify probe.
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/power/reset/brcm-kona-reset.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
Comments
Hi Andrew, kernel test robot noticed the following build warnings: [auto build test WARNING on sre-power-supply/for-next] [also build test WARNING on mani-mhi/mhi-next soc/for-next linus/master v6.8-rc2 next-20240202] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Andrew-Davis/power-reset-atc260x-poweroff-Use-devm_register_sys_off_handler-RESTART/20240202-020809 base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next patch link: https://lore.kernel.org/r/20240201180102.70395-7-afd%40ti.com patch subject: [PATCH 06/18] power: reset: brcm-kona-reset: Use devm_register_sys_off_handler(RESTART) config: arm-randconfig-r121-20240202 (https://download.01.org/0day-ci/archive/20240202/202402022349.daHRuWLB-lkp@intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20240202/202402022349.daHRuWLB-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202402022349.daHRuWLB-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/power/reset/brcm-kona-reset.c:18:45: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *kona_reset_base @@ got void *cb_data @@ drivers/power/reset/brcm-kona-reset.c:18:45: sparse: expected void [noderef] __iomem *kona_reset_base drivers/power/reset/brcm-kona-reset.c:18:45: sparse: got void *cb_data >> drivers/power/reset/brcm-kona-reset.c:43:46: sparse: sparse: incorrect type in argument 5 (different address spaces) @@ expected void *cb_data @@ got void [noderef] __iomem *[assigned] kona_reset_base @@ drivers/power/reset/brcm-kona-reset.c:43:46: sparse: expected void *cb_data drivers/power/reset/brcm-kona-reset.c:43:46: sparse: got void [noderef] __iomem *[assigned] kona_reset_base vim +18 drivers/power/reset/brcm-kona-reset.c 15 16 static int kona_reset_handler(struct sys_off_data *data) 17 { > 18 void __iomem *kona_reset_base = data->cb_data; 19 20 /* 21 * A soft reset is triggered by writing a 0 to bit 0 of the soft reset 22 * register. To write to that register we must first write the password 23 * and the enable bit in the write access enable register. 24 */ 25 writel((RSTMGR_WR_PASSWORD << RSTMGR_WR_PASSWORD_SHIFT) | 26 RSTMGR_WR_ACCESS_ENABLE, 27 kona_reset_base + RSTMGR_REG_WR_ACCESS_OFFSET); 28 writel(0, kona_reset_base + RSTMGR_REG_CHIP_SOFT_RST_OFFSET); 29 30 return NOTIFY_DONE; 31 } 32 33 static int kona_reset_probe(struct platform_device *pdev) 34 { 35 void __iomem *kona_reset_base; 36 37 kona_reset_base = devm_platform_ioremap_resource(pdev, 0); 38 if (IS_ERR(kona_reset_base)) 39 return PTR_ERR(kona_reset_base); 40 41 return devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART, 42 128, kona_reset_handler, > 43 kona_reset_base); 44 } 45
diff --git a/drivers/power/reset/brcm-kona-reset.c b/drivers/power/reset/brcm-kona-reset.c index d05728b1db097..4bb956c8f24f8 100644 --- a/drivers/power/reset/brcm-kona-reset.c +++ b/drivers/power/reset/brcm-kona-reset.c @@ -13,11 +13,10 @@ #define RSTMGR_WR_PASSWORD_SHIFT 8 #define RSTMGR_WR_ACCESS_ENABLE 1 -static void __iomem *kona_reset_base; - -static int kona_reset_handler(struct notifier_block *this, - unsigned long mode, void *cmd) +static int kona_reset_handler(struct sys_off_data *data) { + void __iomem *kona_reset_base = data->cb_data; + /* * A soft reset is triggered by writing a 0 to bit 0 of the soft reset * register. To write to that register we must first write the password @@ -31,18 +30,17 @@ static int kona_reset_handler(struct notifier_block *this, return NOTIFY_DONE; } -static struct notifier_block kona_reset_nb = { - .notifier_call = kona_reset_handler, - .priority = 128, -}; - static int kona_reset_probe(struct platform_device *pdev) { + void __iomem *kona_reset_base; + kona_reset_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(kona_reset_base)) return PTR_ERR(kona_reset_base); - return register_restart_handler(&kona_reset_nb); + return devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART, + 128, kona_reset_handler, + kona_reset_base); } static const struct of_device_id of_match[] = {