[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200220195202.GV37466@atomide.com>
Date: Thu, 20 Feb 2020 11:52:02 -0800
From: Tony Lindgren <tony@...mide.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Lee Jones <lee.jones@...aro.org>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] mfd: motmdm: Add Motorola TS 27.010 serdev modem
driver for droid4
* Tony Lindgren <tony@...mide.com> [700101 00:00]:
> +static int motmdm_register_dlci(struct device *dev,
> + struct motmdm_dlci *mot_dlci)
> +{
> + struct motmdm *ddata;
> + struct gsm_serdev *gsd;
> + struct gsm_serdev_dlci *gsm_dlci;
> + int err;
> +
> + if (!dev || !mot_dlci || !mot_dlci->line)
> + return -EINVAL;
> +
> + err = pm_runtime_get_sync(dev);
> + if ((err != -EINPROGRESS) && err < 0) {
> + pm_runtime_put_noidle(dev);
> +
> + return err;
> + }
> +
> + ddata = gsm_serdev_get_drvdata(dev);
> + gsd = &ddata->gsd;
> + gsm_dlci = &mot_dlci->gsm_dlci;
> + INIT_LIST_HEAD(&mot_dlci->list);
> + init_waitqueue_head(&mot_dlci->read_queue);
> + gsm_dlci->line = mot_dlci->line;
> + gsm_dlci->receive_buf = motmdm_dlci_receive_buf;
> +
> + err = gsm_serdev_register_dlci(gsd, gsm_dlci);
> + if (err) {
> + dev_warn(dev, "error registering dlci%i: %i\n",
> + mot_dlci->line, err);
> + kfifo_free(&mot_dlci->read_fifo);
> + memset(gsm_dlci, 0, sizeof(*gsm_dlci));
> + } else {
> + mot_dlci->privdata = ddata;
> + }
Here we want mot_dlci->privdata initialized before
gsm_serdev_register_dlci, otherwise we may get an interrupt
between gsm_serdev_register_dlci and setting mot_dlci->privdata.
So I'll be sending out v4 series.
Regards,
Tony
Powered by blists - more mailing lists