public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arend van Spriel <arend@broadcom.com>
To: Jeremiah Mahler <jmmahler@gmail.com>,
	<linux-kernel@vger.kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Subject: Re: linux-next: manual merge of the driver-core tree with the net-next tree
Date: Thu, 4 Dec 2014 12:41:21 +0100	[thread overview]
Message-ID: <54804861.2060407@broadcom.com> (raw)
In-Reply-To: <20141204101915.GA9689@hudson.localdomain>

On 04-12-14 11:19, Jeremiah Mahler wrote:
> Arend,
> 
> I haven't heard if you have looked at this bug at all yet.  I was
> curious so I looked at it some more and I have some more information
> that might be helpful.
> 
> On Wed, Dec 03, 2014 at 01:41:28PM -0800, Jeremiah Mahler wrote:
>> On Wed, Dec 03, 2014 at 01:06:59PM -0800, Jeremiah Mahler wrote:
>>> Arend,
>>>
> [...]
>>>>>
>>>>> I took a look at the patch that is causing this problem (d32394fae95).
>>>>> My config negates everything in the patch except for a one line change
>>>>> to ath9k/pci.c.  If I remove this change (shown below) the problem goes
>>>>> away.
>>>>
>>>> Ok. But then it will likely crash when you cat one of the changed debugfs
>>>> files. Guess this commit needs to be reverted entirely.
>>>>
> [...]
> 
> Referring to the code snippet below, notice that both pci_set_drvdata()
> and dev_set_drvdata() are called.  If the call to dev_set_drvdata() is
> removed the bug goes away.
> 
>   drivers/net/wireless/ath/ath9k/pci.c
> 
>   861     SET_IEEE80211_DEV(hw, &pdev->dev);
>   862     pci_set_drvdata(pdev, hw);
>   863
>   864     sc = hw->priv;
>   865     sc->hw = hw;
>   866     sc->dev = &pdev->dev;
>   867     dev_set_drvdata(sc->dev, sc);
>   868     sc->mem = pcim_iomap_table(pdev)[0];
>   869     sc->driver_data = id->driver_data;
> 
> Translating the call to pci_set_drvdata() produces the following.
> 
>   pci_set_drvdata(pdev, hw);
>     (translating from include/linux/pci.h)
>     dev_set_drvdata(&pdev->dev, hw)
>       (translating from include/linux/device.h)
>       &pdev->dev->driver = hw;
> 
> And doing the same for dev_set_drvdata().
> 
>   dev_set_drvdata(sc->dev, sc)
>     (sc->dev = &pdev->dev)
>     dev_set_drvdata(&pdev->dev, sc)
>       (translating from include/linux/device.h)
>       &pdev->dev->driver = sc;
> 
> The same destination is being set with two different values.  Then calls
> to pci_get_drvdata(), which expect hw, are getting sc, and it breaks.

Yes, that was my suspicion as well. This is why I asked to revert the
patch entirely. I see that sc equals hw->priv so I know how to correct
it. However, with merge window around the corner it may be easier to do
a revert.

Regards,
Arend

  reply	other threads:[~2014-12-04 11:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01  7:19 linux-next: manual merge of the driver-core tree with the net-next tree Stephen Rothwell
2014-12-01  7:34 ` Arend van Spriel
2014-12-03  8:36   ` Jeremiah Mahler
2014-12-03 10:51     ` Jeremiah Mahler
2014-12-03 12:49       ` Arend van Spriel
2014-12-03 16:21         ` Greg KH
2014-12-03 20:07           ` Arend van Spriel
2014-12-03 21:06         ` Jeremiah Mahler
2014-12-03 21:41           ` Jeremiah Mahler
2014-12-04 10:19             ` Jeremiah Mahler
2014-12-04 11:41               ` Arend van Spriel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-01-30  4:32 Stephen Rothwell
2023-01-30 12:31 ` Andy Shevchenko
2023-01-30 16:00   ` Greg KH
2018-07-23  5:12 Stephen Rothwell
2018-07-23  6:20 ` Greg KH
2018-08-15 23:42   ` Stephen Rothwell
2018-08-16  0:05     ` Rajat Jain
2013-08-01  5:21 Stephen Rothwell
2013-08-02  0:28 ` Greg KH
2013-02-04  4:38 Stephen Rothwell
2013-02-04  4:59 ` Greg KH
2013-02-04  4:34 Stephen Rothwell
2011-10-25  8:07 Stephen Rothwell

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=54804861.2060407@broadcom.com \
    --to=arend@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jmmahler@gmail.com \
    --cc=linux-kernel@vger.kernel.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