public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian McMenamin <adrian@newgolddream.dyndns.info>
To: Greg KH <greg@kroah.com>
Cc: Paul Mundt <lethal@linux-sh.org>,
	linux-sh <linux-sh@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] SH/Dreamcast - fix regressions, whitespace and memory
Date: Mon, 04 Feb 2008 22:37:37 +0000	[thread overview]
Message-ID: <1202164657.7046.5.camel@localhost.localdomain> (raw)
In-Reply-To: <20080204161437.GA20739@kroah.com>


On Mon, 2008-02-04 at 08:14 -0800, Greg KH wrote:
> On Mon, Feb 04, 2008 at 08:27:55AM +0000, Adrian McMenamin wrote:
> > 
> > On Sun, 2008-02-03 at 21:29 -0800, Greg KH wrote:
> > > On Sun, Feb 03, 2008 at 08:00:47PM +0000, Adrian McMenamin wrote:
> > > > From: Adrian McMenamin
> > > > 
> > > > This patch fixes the regression noted here:
> > > > http://lkml.org/lkml/2008/1/26/189 as well as whitespace issues in the
> > > > previous commit of this driver and the memory leaks noted here:
> > > > http://lkml.org/lkml/2008/2/2/143 (as well as one or two other minor
> > > > cleanups).
> > > 
> > > Which portion of the patch fixes the kobject WARN_ON()?
> > 
> > 
> > 
> > +	if (mdev->registered = 0) {
> > +		retval = device_register(&mdev->dev);
> > +		if (retval) {
> > +			printk(KERN_INFO
> > +			"Maple bus: Attempt to register device"
> > +			" (%x, %x) failed.\n",
> > +			mdev->port, mdev->unit);
> > +			maple_free_dev(mdev);
> > +			mdev = NULL;
> > +			return;
> > +		}
> > +		mdev->registered = 1;
> > +	}
> >  }
> > 
> > 
> > Specifically the check on mdev->registered
> 
> So the code path could cause devices to be registered more than once?
> That seems broken, as no other bus that I know of needs such a check :(
> 
> Is there a way to fix the root problem here, instead of this type of
> change?
> 

The hardware is very flaky. If I add in delays to the bus start, it will
detect the devices, but it's not brilliant. Registering an empty device
got round that problem, at the price of testing for the earlier
registration.


  reply	other threads:[~2008-02-04 22:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-03 20:00 [PATCH] SH/Dreamcast - fix regressions, whitespace and memory Adrian McMenamin
2008-02-04  1:10 ` [PATCH] SH/Dreamcast - fix regressions, whitespace and memory leaks in Maple Bus driver Paul Mundt
2008-02-04  8:23   ` [PATCH] SH/Dreamcast - fix regressions, whitespace and memory Adrian McMenamin
2008-02-04  9:02     ` [PATCH] SH/Dreamcast - fix regressions, whitespace and memory leaks in Maple Bus driver Paul Mundt
2008-02-04  9:35       ` [PATCH] SH/Dreamcast - fix regressions, Adrian McMenamin
2008-02-04  9:59         ` [PATCH] SH/Dreamcast - fix regressions, whitespace and memory leaks in Maple Bus driver Paul Mundt
2008-02-04 10:18           ` [PATCH] SH/Dreamcast - fix regressions, Adrian McMenamin
2008-02-04  5:29 ` [PATCH] SH/Dreamcast - fix regressions, whitespace and memory Greg KH
2008-02-04  8:27   ` Adrian McMenamin
2008-02-04 16:14     ` Greg KH
2008-02-04 22:37       ` Adrian McMenamin [this message]
2008-02-04 23:09         ` Adrian McMenamin
2008-02-05  4:57         ` Greg KH

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=1202164657.7046.5.camel@localhost.localdomain \
    --to=adrian@newgolddream.dyndns.info \
    --cc=greg@kroah.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@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