Message ID | 20240126061153.2883199-1-vamshigajjela@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-39647-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp477523dyb; Thu, 25 Jan 2024 22:32:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4ZnJQxkH+moCS0KIOPDR2MYKpkpzwuR/xKXTRvdBu3q7OLlbs1pdd5IxQBh9TM53vAAFV X-Received: by 2002:aa7:d14b:0:b0:55d:2e25:4c16 with SMTP id r11-20020aa7d14b000000b0055d2e254c16mr496068edo.5.1706250737813; Thu, 25 Jan 2024 22:32:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706250737; cv=pass; d=google.com; s=arc-20160816; b=Doaci//BJumeSmd/5evfAD2+GnFywoOQg9RprvkACklnWXkGRiB8LYBkk1R7GLeLIM cP3cIOjfacFUmdxS6BHHrbkryaHjWF857/clj1rghRBbzUh49P9Wn9lNfkcF8qcasDQe ez0h4uMvsrWCRJKLrmw5/PLLFEBhgz12vE0+PmFU5xp/bGFZsJJyOe4mG8RlsEg1EnCg EBtoJDeHzpxsM7iBI1ZBJ5pxxZ34vP8OEg+EylxyeoPRRoR3ZrLL1UVL99CRMv4BDKt0 bJ34xDkoHn0oz8hqOIc0WvKqK5EI/vcSSbvu1DXDzablBMHnGownv1DL/4SUsk6I8ehd WZOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=ZKVNWMZBR2eYWT59dTj/uyfqypo9Ohb4eJLIAFi1GR8=; fh=jNmUvCwDVbVUam19/UaJBnIG5T55XWWt7/si6vLkaw8=; b=GBceOeSuCDpeC3zPXEten7dMsZBYRo1NzbTC0zRva4XQt7VEU0YduuCWkujAntyp3o 1SA9egiIaSrSkKVHf6OusMGyQxjUrwAEWon8frS5J+pjOlp+7h+HoCNMgPOFHGgByjaK GN4hNDUUzGIbLWMJRdIIX0ZqvO9Nc356xRHjnt1ofZJprVo0Mzt7nf5h4HaAbhUf8F2w AR54jn5ZTu/SXXkk2P38eHC6ym7+7zyPbo9if2Pa/DeV0GgwPTCGVFrdxBx54tfTXmia Rg5WmBCWUAjS0yg3+ko7JRreLJcICAgwnESOvVUiJUB3Ch3QeAz2tE4OSI4DIfGfPY5V 0HMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="miEr/8f2"; arc=pass (i=1 spf=pass spfdomain=flex--vamshigajjela.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-39647-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39647-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bx20-20020a0564020b5400b0055c992a9beesi300199edb.189.2024.01.25.22.32.17 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 22:32:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39647-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="miEr/8f2"; arc=pass (i=1 spf=pass spfdomain=flex--vamshigajjela.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-39647-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39647-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 83F481F21B22 for <ouuuleilei@gmail.com>; Fri, 26 Jan 2024 06:32:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32D6914AAE; Fri, 26 Jan 2024 06:12:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="miEr/8f2" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 1C3AEC13C for <linux-kernel@vger.kernel.org>; Fri, 26 Jan 2024 06:11:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706249521; cv=none; b=dU5Jj7NCjTNN180Mxc6ACdyHxNOWuKszsqHH0V2LbFHq0KWOoZTSxlidcuvG+2JTVgmfhxu7NhU/1ZYwBxX+W7GmTqiz6OL+YayNTJi06TR/9LDMoR0ZJTAxGJfU9G6fQsD/iwA6Cn9xoM09+BK77NjtvK2LYFSYsoWJnLcEPQU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706249521; c=relaxed/simple; bh=7UZnrODZ/MY++iMvwo41MGHM2nNlZwIfqePHWJK1BZc=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=iWELx6FzDgEQss8CxpmR/c5eFE79G0lPtMv1nlek8TZgTqVpWvr6Vx6QHNgwHKtc1qb5me4Nl1cVJFBuzJjDGDO6tt/kLKGHlbt73DOa65HqSQJy/J2OFhVyEfk9xbDIVbY42LDmFRhbIHxS9S9uHd9KssD4IBlW8QoVufaOA9A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--vamshigajjela.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=miEr/8f2; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--vamshigajjela.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6029c85922dso1002017b3.3 for <linux-kernel@vger.kernel.org>; Thu, 25 Jan 2024 22:11:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706249519; x=1706854319; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=ZKVNWMZBR2eYWT59dTj/uyfqypo9Ohb4eJLIAFi1GR8=; b=miEr/8f2cGy2fP/QWzj89Uh134Z2dWFVsvKQiqF8v5RKrmIyuRac1YvJq3AcaTNYOn HCfA2lVlA/+QgiWoCh3KPg6apTHWdyLWFi4IPl/EIK+V6EmnPZXLQzq2HfAAFzbM8NNM 2rwhj4CJFyfLvsSx3xykmyfnnLG/ooUmIP3SVvRffRz9Ilhv5y4lSN5KNhkfDYQKwe0/ 7CsgbLjLg7EWT4aAEm7u6ns3ydqOzmwdDs6Wuq270drNos/McjitV2pEyjlVJpScUU+K ulOHOnbQ4c4xaqip8YpfPg90ZdmxjEQx23o7TJzpZezvJ3uOjLzKSlz4At3A7mb6ly8T rvig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706249519; x=1706854319; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZKVNWMZBR2eYWT59dTj/uyfqypo9Ohb4eJLIAFi1GR8=; b=CRoOmosi+nTS7N8v/7TKSb81jWwdOxTraVf6vUiX1BQ//NN74H2nrSsIEDIx2XFUhw RnL01/c1S8UL3rF7+sHN2WsxqGGO3RwOrEdKJMDhQqxCN3hIgeSWuh7Q5q6y89DQh3dx EwEMYeTIw95vxeoENhRZ22onYEjN7pQY1q7nAmnu45RGfaeBBT0GNf+xkts79SJwgwB4 61oDt2JggCMuR80Mw6B1Vo+48YbwEbECB7zoPNk6BCsWBkghVY8+g4DrCjGJDjsw75B2 rQjKA87zhsrBx6sMM7C2hRbS4jwK3qrCHAbcCOzegFJPHlAjTHRYFrnVmuNV1un10efV +gow== X-Gm-Message-State: AOJu0YwenQq38ko6x3sDaEnmEvZE+rTNNufX8mPk9T/ndQsq/qVfBFkJ aK+7jpcMyrhxjbqIhEq42iTt/2ysgemzlWbZxs/MafYEG5WdJcCNSlQk3NWZmUBOFeNmXwxRgab /rMOmUuVFGvVGYNkGrmpmsEEjjjwj4w== X-Received: from vamshig51.c.googlers.com ([fda3:e722:ac3:cc00:3:22c1:c0a8:70c]) (user=vamshigajjela job=sendgmr) by 2002:a05:690c:fc2:b0:5ff:9315:7579 with SMTP id dg2-20020a05690c0fc200b005ff93157579mr478886ywb.6.1706249519070; Thu, 25 Jan 2024 22:11:59 -0800 (PST) Date: Fri, 26 Jan 2024 11:41:53 +0530 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 X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Message-ID: <20240126061153.2883199-1-vamshigajjela@google.com> Subject: [PATCH v1 RESEND] spmi: hisi-spmi-controller: Fix kernel panic on rmmod From: Vamshi Gajjela <vamshigajjela@google.com> To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Stephen Boyd <sboyd@kernel.org>, Johan Hovold <johan+linaro@kernel.org> Cc: Caleb Connolly <caleb.connolly@linaro.org>, linux-kernel@vger.kernel.org, manugautam@google.com, Vamshi Gajjela <vamshigajjela@google.com> Content-Type: text/plain; charset="UTF-8" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789133573561503714 X-GMAIL-MSGID: 1789133573561503714 |
Series |
[v1,RESEND] spmi: hisi-spmi-controller: Fix kernel panic on rmmod
|
|
Commit Message
Vamshi Gajjela
Jan. 26, 2024, 6:11 a.m. UTC
Ensure consistency in spmi_controller pointers between
spmi_controller_remove/put and driver spmi_del_controller functions.
The former requires a pointer to struct spmi_controller, while the
latter passes a pointer of struct spmi_controller_dev, leading to a
"Null pointer exception".
'nr' member of struct spmi_controller, which serves as an identifier
for the controller/bus. This value is assigned a dynamic ID in
spmi_controller_alloc, and overriding it from the driver results in an
ida_free error "ida_free called for id=xx which is not allocated".
Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com>
---
drivers/spmi/hisi-spmi-controller.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Fri, Jan 26, 2024 at 11:41:53AM +0530, Vamshi Gajjela wrote: > Ensure consistency in spmi_controller pointers between > spmi_controller_remove/put and driver spmi_del_controller functions. > The former requires a pointer to struct spmi_controller, while the > latter passes a pointer of struct spmi_controller_dev, leading to a > "Null pointer exception". > > 'nr' member of struct spmi_controller, which serves as an identifier > for the controller/bus. This value is assigned a dynamic ID in > spmi_controller_alloc, and overriding it from the driver results in an > ida_free error "ida_free called for id=xx which is not allocated". No Fixes tag? > Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com> > --- > drivers/spmi/hisi-spmi-controller.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c > index 9cbd473487cb..af51ffe24072 100644 > --- a/drivers/spmi/hisi-spmi-controller.c > +++ b/drivers/spmi/hisi-spmi-controller.c > @@ -303,7 +303,6 @@ static int spmi_controller_probe(struct platform_device *pdev) > > spin_lock_init(&spmi_controller->lock); > > - ctrl->nr = spmi_controller->channel; > ctrl->dev.parent = pdev->dev.parent; > ctrl->dev.of_node = of_node_get(pdev->dev.of_node); > > @@ -326,7 +325,8 @@ static int spmi_controller_probe(struct platform_device *pdev) > > static void spmi_del_controller(struct platform_device *pdev) This function does not exist in mainline so presumably this is some bug you've introduced in your downstream driver that you're trying to fix. So this patch looks all bogus. > { > - struct spmi_controller *ctrl = platform_get_drvdata(pdev); > + struct spmi_controller_dev *spmi_controller = platform_get_drvdata(pdev); > + struct spmi_controller *ctrl = spmi_controller->controller; > > spmi_controller_remove(ctrl); > spmi_controller_put(ctrl); Johan
On Fri, Jan 26, 2024 at 1:48 PM Johan Hovold <johan@kernel.org> wrote: > > On Fri, Jan 26, 2024 at 11:41:53AM +0530, Vamshi Gajjela wrote: > > Ensure consistency in spmi_controller pointers between > > spmi_controller_remove/put and driver spmi_del_controller functions. > > The former requires a pointer to struct spmi_controller, while the > > latter passes a pointer of struct spmi_controller_dev, leading to a > > "Null pointer exception". > > > > 'nr' member of struct spmi_controller, which serves as an identifier > > for the controller/bus. This value is assigned a dynamic ID in > > spmi_controller_alloc, and overriding it from the driver results in an > > ida_free error "ida_free called for id=xx which is not allocated". > > No Fixes tag? There isn't a bug, I will remove word "Fix" > > > Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com> > > --- > > drivers/spmi/hisi-spmi-controller.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c > > index 9cbd473487cb..af51ffe24072 100644 > > --- a/drivers/spmi/hisi-spmi-controller.c > > +++ b/drivers/spmi/hisi-spmi-controller.c > > @@ -303,7 +303,6 @@ static int spmi_controller_probe(struct platform_device *pdev) > > > > spin_lock_init(&spmi_controller->lock); > > > > - ctrl->nr = spmi_controller->channel; This remains applicable, however, it could lead to a failure in the spmi_ctrl_release, I will refactor the patch to address this. also "spmi_del_controller" is removed from 6.7.2 > > ctrl->dev.parent = pdev->dev.parent; > > ctrl->dev.of_node = of_node_get(pdev->dev.of_node); > > > > @@ -326,7 +325,8 @@ static int spmi_controller_probe(struct platform_device *pdev) > > > > static void spmi_del_controller(struct platform_device *pdev) > > This function does not exist in mainline so presumably this is some bug > you've introduced in your downstream driver that you're trying to fix. > > So this patch looks all bogus. spmi_del_controller is present until in 6.7.2, I have made this patch in last week of Dec, I should have checked before resending, apologies. > > > { > > - struct spmi_controller *ctrl = platform_get_drvdata(pdev); > > + struct spmi_controller_dev *spmi_controller = platform_get_drvdata(pdev); > > + struct spmi_controller *ctrl = spmi_controller->controller; > > > > spmi_controller_remove(ctrl); > > spmi_controller_put(ctrl); > > Johan
On Mon, Jan 29, 2024 at 10:13:22AM +0530, VAMSHI GAJJELA wrote: > On Fri, Jan 26, 2024 at 1:48 PM Johan Hovold <johan@kernel.org> wrote: > > > > On Fri, Jan 26, 2024 at 11:41:53AM +0530, Vamshi Gajjela wrote: > > > Ensure consistency in spmi_controller pointers between > > > spmi_controller_remove/put and driver spmi_del_controller functions. > > > The former requires a pointer to struct spmi_controller, while the > > > latter passes a pointer of struct spmi_controller_dev, leading to a > > > "Null pointer exception". > > > > > > 'nr' member of struct spmi_controller, which serves as an identifier > > > for the controller/bus. This value is assigned a dynamic ID in > > > spmi_controller_alloc, and overriding it from the driver results in an > > > ida_free error "ida_free called for id=xx which is not allocated". > > > > No Fixes tag? > There isn't a bug, I will remove word "Fix" Both of the issues you point out above sounds like bugs that deserve a Fixes tag. > > > Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com> > > > --- > > > drivers/spmi/hisi-spmi-controller.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c > > > index 9cbd473487cb..af51ffe24072 100644 > > > --- a/drivers/spmi/hisi-spmi-controller.c > > > +++ b/drivers/spmi/hisi-spmi-controller.c > > > @@ -303,7 +303,6 @@ static int spmi_controller_probe(struct platform_device *pdev) > > > > > > spin_lock_init(&spmi_controller->lock); > > > > > > - ctrl->nr = spmi_controller->channel; > This remains applicable, however, it could lead to a failure in the > spmi_ctrl_release, I > will refactor the patch to address this. > also "spmi_del_controller" is removed from 6.7.2 No, this has not changed in 6.7.2, it has been removed from 6.8-rc1. > > > ctrl->dev.parent = pdev->dev.parent; > > > ctrl->dev.of_node = of_node_get(pdev->dev.of_node); > > > > > > @@ -326,7 +325,8 @@ static int spmi_controller_probe(struct platform_device *pdev) > > > > > > static void spmi_del_controller(struct platform_device *pdev) > > > > This function does not exist in mainline so presumably this is some bug > > you've introduced in your downstream driver that you're trying to fix. > > > > So this patch looks all bogus. > spmi_del_controller is present until in 6.7.2, I have made this patch > in last week of Dec, > I should have checked before resending, apologies. The bug you found was apparently accidentally fixed by commit 490d88ef548d ("spmi: hisi-spmi-controller: Use devm_spmi_controller_add()") in 6.8-rc1 but I don't see any record of it having been backported yet. As it depends on new helper function that will likely not happen either. Perhaps you can split your patch in two separate fixes and ask the stable team to backport the driver-data one. > > > { > > > - struct spmi_controller *ctrl = platform_get_drvdata(pdev); > > > + struct spmi_controller_dev *spmi_controller = platform_get_drvdata(pdev); > > > + struct spmi_controller *ctrl = spmi_controller->controller; > > > > > > spmi_controller_remove(ctrl); > > > spmi_controller_put(ctrl); Johan
On Mon, Jan 29, 2024 at 1:01 PM Johan Hovold <johan@kernel.org> wrote: > > On Mon, Jan 29, 2024 at 10:13:22AM +0530, VAMSHI GAJJELA wrote: > > On Fri, Jan 26, 2024 at 1:48 PM Johan Hovold <johan@kernel.org> wrote: > > > > > > On Fri, Jan 26, 2024 at 11:41:53AM +0530, Vamshi Gajjela wrote: > > > > Ensure consistency in spmi_controller pointers between > > > > spmi_controller_remove/put and driver spmi_del_controller functions. > > > > The former requires a pointer to struct spmi_controller, while the > > > > latter passes a pointer of struct spmi_controller_dev, leading to a > > > > "Null pointer exception". > > > > > > > > 'nr' member of struct spmi_controller, which serves as an identifier > > > > for the controller/bus. This value is assigned a dynamic ID in > > > > spmi_controller_alloc, and overriding it from the driver results in an > > > > ida_free error "ida_free called for id=xx which is not allocated". > > > > > > No Fixes tag? > > > There isn't a bug, I will remove word "Fix" > > Both of the issues you point out above sounds like bugs that deserve a > Fixes tag. ACK > > > > > Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com> > > > > --- > > > > drivers/spmi/hisi-spmi-controller.c | 4 ++-- > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c > > > > index 9cbd473487cb..af51ffe24072 100644 > > > > --- a/drivers/spmi/hisi-spmi-controller.c > > > > +++ b/drivers/spmi/hisi-spmi-controller.c > > > > @@ -303,7 +303,6 @@ static int spmi_controller_probe(struct platform_device *pdev) > > > > > > > > spin_lock_init(&spmi_controller->lock); > > > > > > > > - ctrl->nr = spmi_controller->channel; > > > This remains applicable, however, it could lead to a failure in the > > spmi_ctrl_release, I > > will refactor the patch to address this. > > also "spmi_del_controller" is removed from 6.7.2 > > No, this has not changed in 6.7.2, it has been removed from 6.8-rc1. ACK > > > > > ctrl->dev.parent = pdev->dev.parent; > > > > ctrl->dev.of_node = of_node_get(pdev->dev.of_node); > > > > > > > > @@ -326,7 +325,8 @@ static int spmi_controller_probe(struct platform_device *pdev) > > > > > > > > static void spmi_del_controller(struct platform_device *pdev) > > > > > > This function does not exist in mainline so presumably this is some bug > > > you've introduced in your downstream driver that you're trying to fix. > > > > > > So this patch looks all bogus. > > > spmi_del_controller is present until in 6.7.2, I have made this patch > > in last week of Dec, > > I should have checked before resending, apologies. > > The bug you found was apparently accidentally fixed by commit > 490d88ef548d ("spmi: hisi-spmi-controller: Use > devm_spmi_controller_add()") in 6.8-rc1 but I don't see any record of it > having been backported yet. > > As it depends on new helper function that will likely not happen either. > > Perhaps you can split your patch in two separate fixes and ask the stable > team to backport the driver-data one. Sure, I will split this into two as suggested, Thanks. > > > > > { > > > > - struct spmi_controller *ctrl = platform_get_drvdata(pdev); > > > > + struct spmi_controller_dev *spmi_controller = platform_get_drvdata(pdev); > > > > + struct spmi_controller *ctrl = spmi_controller->controller; > > > > > > > > spmi_controller_remove(ctrl); > > > > spmi_controller_put(ctrl); > > Johan
diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c index 9cbd473487cb..af51ffe24072 100644 --- a/drivers/spmi/hisi-spmi-controller.c +++ b/drivers/spmi/hisi-spmi-controller.c @@ -303,7 +303,6 @@ static int spmi_controller_probe(struct platform_device *pdev) spin_lock_init(&spmi_controller->lock); - ctrl->nr = spmi_controller->channel; ctrl->dev.parent = pdev->dev.parent; ctrl->dev.of_node = of_node_get(pdev->dev.of_node); @@ -326,7 +325,8 @@ static int spmi_controller_probe(struct platform_device *pdev) static void spmi_del_controller(struct platform_device *pdev) { - struct spmi_controller *ctrl = platform_get_drvdata(pdev); + struct spmi_controller_dev *spmi_controller = platform_get_drvdata(pdev); + struct spmi_controller *ctrl = spmi_controller->controller; spmi_controller_remove(ctrl); spmi_controller_put(ctrl);