Message ID | 20240123164443.394642-5-afd@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-35697-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp465746dyi; Tue, 23 Jan 2024 08:53:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgwQtrSsCBNm8GpSx9BPFlMEhZ0zjNXdnX+fUQDX44Cu5mVSO2bW14N/l7SPQVKTleWrvh X-Received: by 2002:a05:6a00:a10:b0:6db:cb:205d with SMTP id p16-20020a056a000a1000b006db00cb205dmr3576698pfh.45.1706028802783; Tue, 23 Jan 2024 08:53:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706028802; cv=pass; d=google.com; s=arc-20160816; b=VueByYehsyC/GTLelAdOIYNSXF3/i1JpxlP4D0YgeJiL2FgolCMbE+LcOEHYJJ+IlW ObsJ1YGuVMg+yqiDd1fwgfxaSKn4tgmq0ktT0c+zK+dOUWEg1cEOyLjL7t21Bc7uWeEj eaH9ZnUOqB9Zds3NwF9ebZW8qWRQS14ME0Eeux8KDQtHYP6jmMf/LwQJfGM/NIRQdjzx cyoYP0Y7uCo1nAACnIfVBZh6EROfLpBS7evdeqHAvoc3e7mKALXZgAxZVZzDSP9n6qh1 qVuf6YjaQGt1DjQndYgC4i9j0yGSkvjYMGZA+zqpdoe1kf3iSRdEWdp/JhJHWBQ7+WCQ iIWA== 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=6OrX3DPXnzALpnhReuLUjIJGvye7DyNGb/CoW91+Q9Y=; fh=ZNXiR1CgqXSElSE++n277vbYyA5ziWtgsjdBgmIqkL4=; b=Q8cW8g1y3Y6MkDL1maLQvPEM/2sRLjokSfwLkyWO2sFiL9J0V1SPwWtc94CTV5C1Wl EpY/iP4DDp/L8IFjAvviDsk+BUPXQ7bWAOwiyJW5gjnmABjiv0+eSPgtvHw1n0l72wnz a5AwWpZP19m+gqAT2Ltq2IWltDAk1FmcKFdZYMh3kGtoXza3BUicdPgID4H375IISR2t GSh3qQkO/mNEPanWBTr3jFYfqVLzlKGRWZnsWPXygfJ9L/N62UQsPVGynK5jkZRPd8Ry pvTXPyRggoKZDxPD9/KC0YhqKGlcQVpUhp8nTURstM8WDTfHH+PNiK7HFGV/l/COyHrf xnAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aRu2NBH+; 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-35697-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35697-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u20-20020a634714000000b005cecc4bd290si10031134pga.292.2024.01.23.08.53.22 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 08:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35697-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aRu2NBH+; 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-35697-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35697-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 231A6291836 for <ouuuleilei@gmail.com>; Tue, 23 Jan 2024 16:50:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A3A881213; Tue, 23 Jan 2024 16:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="aRu2NBH+" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 58F548003D; Tue, 23 Jan 2024 16:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706028336; cv=none; b=TawQK+V3hpAxeegbL2M3t9IE+oLDgUuzVx/y+d+XvzQ3tc0sg705bGPRoICz7mPrM8qmaZ+nV7hOtuLuzJXq2920nqx17q1a+qE5mToZnHRTO3+L+VoF81aFnijTIGgUEX40FdLsqZUpk2ux3iDM9Vun5ex94FNSoAKBNEuOaDs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706028336; c=relaxed/simple; bh=8LjL26PYrPwCrvs/xSN0nyOOCGfpd558CyvkBVEVt2M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mJKRLYUWmd+pJ+edJtnNMI4ifMfT11Eh9q4VdK+fYOhqROC/3rL6RRhhqzTROo7pW/hp/OfpN/4jkNOEbhvbAPMDme5WRNqNyys1f7xhdLlGw7kGOVwM2ZU5LJpXI63kmgCm0e3GlmTPy58lv9BiyQjHapUaNVi6qNkkIp1ETPA= 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=aRu2NBH+; arc=none smtp.client-ip=198.47.23.249 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 fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 40NGimmf101836; Tue, 23 Jan 2024 10:44:48 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1706028288; bh=6OrX3DPXnzALpnhReuLUjIJGvye7DyNGb/CoW91+Q9Y=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=aRu2NBH+Jl34untySgYsJ01x94ByIoIEXYUbivOB09rHgr91C1x3H10BrGV/WTgaN vjfxeS3UWpG+j6SPnK/fTdcYOgsuYivuoRPIM0QgP9VAbLKYoLj/kcFu0rTEg2BVEN /LXH3crLEaSPXs1UEN0suP5rAaFW876Mhopb5Xdw= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 40NGimBu011494 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Jan 2024 10:44:48 -0600 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 23 Jan 2024 10:44:48 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE106.ent.ti.com (157.170.170.36) 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; Tue, 23 Jan 2024 10:44:48 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 40NGiiKJ022038; Tue, 23 Jan 2024 10:44:47 -0600 From: Andrew Davis <afd@ti.com> To: Mark Rutland <mark.rutland@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Sebastian Reichel <sre@kernel.org>, Karol Gugala <kgugala@antmicro.com>, Mateusz Holenko <mholenko@antmicro.com>, Gabriel Somlo <gsomlo@gmail.com>, Joel Stanley <joel@jms.id.au>, Mark Brown <broonie@kernel.org>, Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, Lee Jones <lee@kernel.org>, Dmitry Osipenko <dmitry.osipenko@collabora.com> CC: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>, <linux-spi@vger.kernel.org>, Andrew Davis <afd@ti.com> Subject: [PATCH 4/4] firmware: ti_sci: Use devm_register_restart_handler() Date: Tue, 23 Jan 2024 10:44:43 -0600 Message-ID: <20240123164443.394642-5-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240123164443.394642-1-afd@ti.com> References: <20240123164443.394642-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: 1788900858156848708 X-GMAIL-MSGID: 1788900858156848708 |
Series |
Deprecate register_restart_handler()
|
|
Commit Message
Andrew Davis
Jan. 23, 2024, 4:44 p.m. UTC
Use device life-cycle managed register function to simplify probe.
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/firmware/ti_sci.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
Comments
On Tue, Jan 23, 2024 at 10:44:43AM -0600, Andrew Davis wrote: > Use device life-cycle managed register function to simplify probe. > > Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Gabriel Somlo <gsomlo@gmail.com> > --- > drivers/firmware/ti_sci.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > > diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c > index 8b9a2556de16d..16501aa0b84cf 100644 > --- a/drivers/firmware/ti_sci.c > +++ b/drivers/firmware/ti_sci.c > @@ -103,7 +103,6 @@ struct ti_sci_desc { > */ > struct ti_sci_info { > struct device *dev; > - struct notifier_block nb; > const struct ti_sci_desc *desc; > struct dentry *d; > void __iomem *debug_region; > @@ -122,7 +121,6 @@ struct ti_sci_info { > > #define cl_to_ti_sci_info(c) container_of(c, struct ti_sci_info, cl) > #define handle_to_ti_sci_info(h) container_of(h, struct ti_sci_info, handle) > -#define reboot_to_ti_sci_info(n) container_of(n, struct ti_sci_info, nb) > > #ifdef CONFIG_DEBUG_FS > > @@ -3254,10 +3252,9 @@ devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev, > } > EXPORT_SYMBOL_GPL(devm_ti_sci_get_resource); > > -static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode, > - void *cmd) > +static int tisci_reboot_handler(struct sys_off_data *data) > { > - struct ti_sci_info *info = reboot_to_ti_sci_info(nb); > + struct ti_sci_info *info = data->cb_data; > const struct ti_sci_handle *handle = &info->handle; > > ti_sci_cmd_core_reboot(handle); > @@ -3400,10 +3397,9 @@ static int ti_sci_probe(struct platform_device *pdev) > ti_sci_setup_ops(info); > > if (reboot) { > - info->nb.notifier_call = tisci_reboot_handler; > - info->nb.priority = 128; > - > - ret = register_restart_handler(&info->nb); > + ret = devm_register_restart_handler(dev, > + tisci_reboot_handler, > + info); > if (ret) { > dev_err(dev, "reboot registration fail(%d)\n", ret); > goto out; > -- > 2.39.2 >
Hi Andrew,
kernel test robot noticed the following build warnings:
[auto build test WARNING on lee-leds/for-leds-next]
[also build test WARNING on linus/master v6.8-rc1 next-20240125]
[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/kernel-reboot-Deprecate-register_restart_handler/20240124-005424
base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
patch link: https://lore.kernel.org/r/20240123164443.394642-5-afd%40ti.com
patch subject: [PATCH 4/4] firmware: ti_sci: Use devm_register_restart_handler()
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20240129/202401291053.Bc9G6QTc-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240129/202401291053.Bc9G6QTc-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/202401291053.Bc9G6QTc-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/firmware/ti_sci.c:120: warning: Excess struct member 'nb' description in 'ti_sci_info'
vim +120 drivers/firmware/ti_sci.c
aa276781a64a5f Nishanth Menon 2016-10-18 85
aa276781a64a5f Nishanth Menon 2016-10-18 86 /**
aa276781a64a5f Nishanth Menon 2016-10-18 87 * struct ti_sci_info - Structure representing a TI SCI instance
aa276781a64a5f Nishanth Menon 2016-10-18 88 * @dev: Device pointer
aa276781a64a5f Nishanth Menon 2016-10-18 89 * @desc: SoC description for this instance
912cffb4ed8612 Nishanth Menon 2016-10-18 90 * @nb: Reboot Notifier block
aa276781a64a5f Nishanth Menon 2016-10-18 91 * @d: Debugfs file entry
aa276781a64a5f Nishanth Menon 2016-10-18 92 * @debug_region: Memory region where the debug message are available
aa276781a64a5f Nishanth Menon 2016-10-18 93 * @debug_region_size: Debug region size
aa276781a64a5f Nishanth Menon 2016-10-18 94 * @debug_buffer: Buffer allocated to copy debug messages.
aa276781a64a5f Nishanth Menon 2016-10-18 95 * @handle: Instance of TI SCI handle to send to clients.
aa276781a64a5f Nishanth Menon 2016-10-18 96 * @cl: Mailbox Client
aa276781a64a5f Nishanth Menon 2016-10-18 97 * @chan_tx: Transmit mailbox channel
aa276781a64a5f Nishanth Menon 2016-10-18 98 * @chan_rx: Receive mailbox channel
aa276781a64a5f Nishanth Menon 2016-10-18 99 * @minfo: Message info
aa276781a64a5f Nishanth Menon 2016-10-18 100 * @node: list head
e69a35531589a2 Nishanth Menon 2018-08-28 101 * @host_id: Host ID
aa276781a64a5f Nishanth Menon 2016-10-18 102 * @users: Number of users of this instance
aa276781a64a5f Nishanth Menon 2016-10-18 103 */
aa276781a64a5f Nishanth Menon 2016-10-18 104 struct ti_sci_info {
aa276781a64a5f Nishanth Menon 2016-10-18 105 struct device *dev;
aa276781a64a5f Nishanth Menon 2016-10-18 106 const struct ti_sci_desc *desc;
aa276781a64a5f Nishanth Menon 2016-10-18 107 struct dentry *d;
aa276781a64a5f Nishanth Menon 2016-10-18 108 void __iomem *debug_region;
aa276781a64a5f Nishanth Menon 2016-10-18 109 char *debug_buffer;
aa276781a64a5f Nishanth Menon 2016-10-18 110 size_t debug_region_size;
aa276781a64a5f Nishanth Menon 2016-10-18 111 struct ti_sci_handle handle;
aa276781a64a5f Nishanth Menon 2016-10-18 112 struct mbox_client cl;
aa276781a64a5f Nishanth Menon 2016-10-18 113 struct mbox_chan *chan_tx;
aa276781a64a5f Nishanth Menon 2016-10-18 114 struct mbox_chan *chan_rx;
aa276781a64a5f Nishanth Menon 2016-10-18 115 struct ti_sci_xfers_info minfo;
aa276781a64a5f Nishanth Menon 2016-10-18 116 struct list_head node;
e69a35531589a2 Nishanth Menon 2018-08-28 117 u8 host_id;
aa276781a64a5f Nishanth Menon 2016-10-18 118 /* protected by ti_sci_list_mutex */
aa276781a64a5f Nishanth Menon 2016-10-18 119 int users;
aa276781a64a5f Nishanth Menon 2016-10-18 @120 };
aa276781a64a5f Nishanth Menon 2016-10-18 121
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 8b9a2556de16d..16501aa0b84cf 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -103,7 +103,6 @@ struct ti_sci_desc { */ struct ti_sci_info { struct device *dev; - struct notifier_block nb; const struct ti_sci_desc *desc; struct dentry *d; void __iomem *debug_region; @@ -122,7 +121,6 @@ struct ti_sci_info { #define cl_to_ti_sci_info(c) container_of(c, struct ti_sci_info, cl) #define handle_to_ti_sci_info(h) container_of(h, struct ti_sci_info, handle) -#define reboot_to_ti_sci_info(n) container_of(n, struct ti_sci_info, nb) #ifdef CONFIG_DEBUG_FS @@ -3254,10 +3252,9 @@ devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev, } EXPORT_SYMBOL_GPL(devm_ti_sci_get_resource); -static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode, - void *cmd) +static int tisci_reboot_handler(struct sys_off_data *data) { - struct ti_sci_info *info = reboot_to_ti_sci_info(nb); + struct ti_sci_info *info = data->cb_data; const struct ti_sci_handle *handle = &info->handle; ti_sci_cmd_core_reboot(handle); @@ -3400,10 +3397,9 @@ static int ti_sci_probe(struct platform_device *pdev) ti_sci_setup_ops(info); if (reboot) { - info->nb.notifier_call = tisci_reboot_handler; - info->nb.priority = 128; - - ret = register_restart_handler(&info->nb); + ret = devm_register_restart_handler(dev, + tisci_reboot_handler, + info); if (ret) { dev_err(dev, "reboot registration fail(%d)\n", ret); goto out;