From: Johan Hovold <johan@kernel.org>
To: Vamshi Gajjela <vamshigajjela@google.com>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
Johan Hovold <johan+linaro@kernel.org>,
Caleb Connolly <caleb.connolly@linaro.org>,
linux-kernel@vger.kernel.org, manugautam@google.com
Subject: Re: [PATCH v1 RESEND] spmi: hisi-spmi-controller: Fix kernel panic on rmmod
Date: Fri, 26 Jan 2024 09:19:02 +0100 [thread overview]
Message-ID: <ZbNq9q5mM6kRq7c3@hovoldconsulting.com> (raw)
In-Reply-To: <20240126061153.2883199-1-vamshigajjela@google.com>
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
next prev parent reply other threads:[~2024-01-26 8:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 6:11 Vamshi Gajjela
2024-01-26 8:19 ` Johan Hovold [this message]
2024-01-29 4:43 ` VAMSHI GAJJELA
2024-01-29 7:31 ` Johan Hovold
2024-02-02 11:59 ` VAMSHI GAJJELA
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZbNq9q5mM6kRq7c3@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=caleb.connolly@linaro.org \
--cc=johan+linaro@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manugautam@google.com \
--cc=mchehab+huawei@kernel.org \
--cc=sboyd@kernel.org \
--cc=vamshigajjela@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®