linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/11] MXS: Add imx-otg driver
Date: Mon, 30 Apr 2012 14:24:38 +0200	[thread overview]
Message-ID: <201204301424.38649.marex@denx.de> (raw)
In-Reply-To: <20382.11633.123788.260827@ipc1.ka-ro>

Dear Lothar Wa?mann,

> Hi,
> 
> Marek Vasut writes:
> > This driver handles claiming of clocks and memory areas. These are later
> > properly delegated to it's child devices, the USB Host (ehci-mxs) and
> > USB Gadget (ci13xxx-mxs).
> 
> [...]
> 
> There is a conceptual bug in the following code. Did you ever run it?

Of course, but let's see the problem.

> > +	INIT_WORK(&priv->work, imx_otg_work);
> > +
> 
> [...]
> 
> > +	if (pdata->gadget_mode) {
> > +		data->pdev_gadget = add_platform_device("ci13xxx-mxs", -1,
> > +							data, sizeof(*data),
> > +							DMA_BIT_MASK(32));
> 
> This will blow up due to 'BUG_ON(!list_empty(&work->entry));'
> in kernel/workqueue.c when schedule_work() is called in
> imx_otg_set_host() or imx_otg_set_peripheral().
> 
> platform_add_data() (called from add_platform_device()) will make a
> copy of the data structure which contains the initialized work queue.
> INIT_WORK() will have initialized a list_head embedded in the work
> queue (making 'next' and 'prev' member pointing to the list_head
> itself).
> The copied list_head will thus have its members pointing to the
> original data structure rather than the respective copies and thus
> fail the 'list_empty()' check.

Very nice, good catch, thanks! It never manifested to me, but I'll look into it 
and fix it in V7. How did you notice this please?

> 
> Lothar Wa?mann

Best regards,
Marek Vasut

  reply	other threads:[~2012-04-30 12:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-29 22:34 [RFC PATCH 00/11 V6] MXS: Add i.MX28 USB Host driver Marek Vasut
2012-04-29 22:34 ` [PATCH 01/11] MXS: Make clk_disable return integer Marek Vasut
2012-04-29 22:34 ` [PATCH 02/11] MXS: Add USB EHCI and USB PHY clock handling Marek Vasut
2012-04-29 22:34 ` [PATCH 03/11] MXS: Fixup i.MX233 USB base address name Marek Vasut
2012-04-29 22:34 ` [PATCH 04/11] MXS: Add data shared between imx-otg and EHCI driver Marek Vasut
2012-04-29 22:34 ` [PATCH 05/11] MXS: Modify the ci13xxx_udc to avoid adding UDC Marek Vasut
2012-04-29 22:34 ` [PATCH 06/11] MXS: Add small registration glue for ci13xxx_udc Marek Vasut
2012-04-29 22:34 ` [PATCH 07/11] MXS: Add separate MXS EHCI HCD driver Marek Vasut
2012-04-29 22:34 ` [PATCH 08/11] MXS: Add imx-otg driver Marek Vasut
2012-04-30  6:13   ` Lothar Waßmann
2012-04-30 12:24     ` Marek Vasut [this message]
2012-04-29 22:34 ` [PATCH 09/11] MXS: Add USB PHY driver Marek Vasut
2012-04-29 22:34 ` [PATCH 10/11] MXS: Add platform registration hooks for USB EHCI Marek Vasut
2012-04-29 22:34 ` [PATCH 11/11] MXS: Enable USB on M28EVK Marek Vasut
2012-04-29 23:00 ` [RFC PATCH 00/11 V6] MXS: Add i.MX28 USB Host driver Marek Vasut
  -- strict thread matches above, loose matches on Subject: below --
2012-05-01  1:55 [RFC PATCH 00/11 V7] " Marek Vasut
2012-05-01  1:56 ` [PATCH 08/11] MXS: Add imx-otg driver Marek Vasut
2012-04-18 17:46 [RFC PATCH 00/10 V3] MXS: Add i.MX28 USB Host driver Marek Vasut
2012-04-22 12:59 ` [RFC PATCH 00/11 V4] " Marek Vasut
2012-04-22 12:59   ` [PATCH 08/11] MXS: Add imx-otg driver Marek Vasut
2012-04-23  6:39     ` Sascha Hauer
2012-04-23  9:38       ` Marek Vasut
2012-04-24  3:18   ` [RFC PATCH 00/11 V5] MXS: Add i.MX28 USB Host driver Marek Vasut
2012-04-24  3:18     ` [PATCH 08/11] MXS: Add imx-otg driver Marek Vasut
2012-04-24 14:48       ` Lothar Waßmann
2012-04-24 14:50         ` Sascha Hauer
2012-04-24 16:13           ` Lothar Waßmann
2012-04-24 16:47             ` Sascha Hauer
2012-04-24 17:49               ` Marek Vasut
2012-04-24 20:49                 ` Sascha Hauer
2012-04-24 20:58                   ` Marek Vasut
2012-04-25  0:17                     ` Chen Peter-B29397

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=201204301424.38649.marex@denx.de \
    --to=marex@denx.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).