[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160305052315.GE18327@sirena.org.uk>
Date: Sat, 5 Mar 2016 14:23:15 +0900
From: Mark Brown <broonie@...nel.org>
To: Sagar Dharia <sdharia@...eaurora.org>
Cc: gregkh@...uxfoundation.org, bp@...e.de, poeschel@...onage.de,
treding@...dia.com, gong.chen@...ux.intel.com,
andreas.noever@...il.com, alan@...ux.intel.com,
mathieu.poirier@...aro.org, daniel@...ll.ch, oded.gabbay@....com,
jkosina@...e.cz, sharon.dvir1@...l.huji.ac.il, joe@...ches.com,
davem@...emloft.net, james.hogan@...tec.com,
michael.opdenacker@...e-electrons.com, daniel.thompson@...aro.org,
robh+dt@...nel.org, pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
kheitke@...ience.com, mlocke@...eaurora.org, agross@...eaurora.org,
linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH V4 4/6] slim: qcom: Add Qualcomm Slimbus controller driver
On Sat, Feb 06, 2016 at 11:44:23AM -0700, Sagar Dharia wrote:
>
> +if SLIMBUS
> +config SLIM_QCOM_CTRL
> + tristate "Qualcomm Slimbus Manager Component"
> + depends on SLIMBUS
> + default n
> + help
n is the default.
> +static irqreturn_t msm_slim_interrupt(int irq, void *d)
> +{
> + struct msm_slim_ctrl *dev = d;
> + u32 stat = readl_relaxed(dev->base + MGR_INT_STAT);
> + int err = 0;
> + if (stat & MGR_INT_TX_MSG_SENT || stat & MGR_INT_TX_NACKED_2) {
> + if (stat & MGR_INT_RX_MSG_RCVD) {
> + }
> + /**
> + * All interrupts are handled: complex RX messages requiring more work
> + * are queued to work-queue, others are handled above
> + */
> + return IRQ_HANDLED;
This unconditionally returns IRQ_HANDLED even if no interrupts were
flagged. This will break if the interrupt gets shared in some hardware
design or if something goes wrong with the hardware.
> + ret = devm_request_irq(&pdev->dev, dev->irq, msm_slim_interrupt,
> + IRQF_TRIGGER_HIGH, "msm_slim_irq", dev);
> + if (ret) {
> + dev_err(&pdev->dev, "request IRQ failed\n");
> + goto err_request_irq_failed;
> + }
Are you sure this is safe and we don't deallocate things the interrupt
handler uses before we disable the interrupt?
> + ret = clk_prepare_enable(hclk);
> + if (ret)
> + goto err_hclk_enable_failed;
> +
> + ret = clk_prepare_enable(rclk);
> + if (ret)
> + goto err_rclk_enable_failed;
The remove path doesn't disable these.
> + /* Register with framework before enabling frame, clock */
> + ret = slim_register_controller(&dev->ctrl);
> + if (ret) {
> + dev_err(dev->dev, "error adding controller\n");
> + goto err_ctrl_failed;
> + }
Should we have a devm_ version of slim_register_controller()? I'd also
expect this to be the last thing we do in probe, things may start using
the device before we've finished initializing it.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists