The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Manohar Vanga <manohar.vanga@cern.ch>
To: "Emilio G. Cota" <cota@braap.org>
Cc: <gregkh@suse.de>, <martyn.welch@ge.com>,
	<devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] staging: vme: make match() driver specific to improve non-VME64x support
Date: Thu, 1 Sep 2011 09:46:01 +0200	[thread overview]
Message-ID: <20110901074601.GA3820@becoht-mvanga> (raw)
In-Reply-To: <20110831212047.GB5339@flamenco.cs.columbia.edu>

Hey Emilio,

On Wed, Aug 31, 2011 at 05:20:47PM -0400, Emilio G. Cota wrote:
> This was hard to review. There are references to functions that
> are not committed in Greg's tree yet ("staging" tree @ git.kernel.org).
> 
> I assume this patch was applied before you wrote the v4 patchset:
> 
> 	https://lkml.org/lkml/2011/8/12/107
>

I believe Greg has acked this patch (I received a confirmation mail from him).

> On Wed, Aug 31, 2011 at 12:05:46 +0200, Manohar Vanga wrote:
> (snip)
> > Another change introduced in this patch is that devices are now created
> > within the VME driver structure rather than in the VME bridge structure.
> > This way, things don't go haywire if the bridge driver is removed while
> > a driver is using it (this is also additionally prevented by having
> > reference counting of used bridge modules).
> 
> The mention to refcounting seems outdated. As I stated in my reply
> to v0, we should just safely remove devices under the bus when
> vme_unregister_bus() is called.

Ah right need to reword that.

> > -void vme_unregister_bridge(struct vme_bridge *bridge)
> > {
> > -	int i;
> > -	struct vme_dev *vdev;
> > -
> > -
> > -	for (i = 0; i < VME_SLOTS_MAX; i++) {
> > -		vdev = bridge->dev[i];
> > -		device_unregister(&vdev->dev);
> > - 	}
> > 	vme_remove_bus(bridge);
> > }
> 
> So we're essentially leaving the devices there, even though the
> bridge they're under will be removed. This doesn't seem right.
> btw with the removal of the array of vme_dev's from struct vme_bridge,
> the bridge cannot know which devices are under it.
> 
> We have to bear in mind that the drv->devices list needs to be
> updated when devices come and go; possibly a bridge->devices list
> could also be kept.
> 
> Helpers around device_register and _unregister may simplify the lists'
> housekeeping.

I was going to add a separate patch for this but I'll just integrate into this
one (makes more sense anyway).

And yes, I also noticed that the bridge no longer has track of its devices and
bridges will need to keep a list of them.

> > -	return retval;
> > +		if (vdev->dev.platform_data) {
> > +			list_add_tail(&vdev->list, &drv->devices);
> > +			drv->ndev++;
> 
> Ok, so drv->ndev can only increase. In case a device is removed (when
> a bus driver is removed) this may need to be decreased, which isn't
> done in the corresponding list_del() calls (I've marked them).
> 
> In fact I wonder whether it is useful at all to have drv->ndev. What's
> its purpose?

I'm not sure why I added that now...
It can be removed.

-- 
/manohar

  reply	other threads:[~2011-09-01  7:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31 10:05 [PATCH 0/3] [RESEND v4] VME Framework Fixes Manohar Vanga
2011-08-31 10:05 ` [PATCH 1/3] staging: vme: change static device array to pointers Manohar Vanga
2011-08-31 10:05 ` [PATCH 2/3] staging: vme: add struct vme_dev for VME devices Manohar Vanga
2011-08-31 10:05 ` [PATCH 3/3] staging: vme: make match() driver specific to improve non-VME64x support Manohar Vanga
2011-08-31 21:20   ` Emilio G. Cota
2011-09-01  7:46     ` Manohar Vanga [this message]
2011-08-31 20:36 ` [PATCH 0/3] [RESEND v4] VME Framework Fixes Emilio G. Cota
  -- strict thread matches above, loose matches on Subject: below --
2011-09-01  9:15 [PATCH 0/3] [RESEND v5] " Manohar Vanga
2011-09-01  9:15 ` [PATCH 3/3] staging: vme: make match() driver specific to improve non-VME64x support Manohar Vanga
2011-09-01 22:26   ` Emilio G. Cota
2011-09-26 14:16     ` Manohar Vanga
2011-08-29  9:02 [PATCH 0/3] [RESEND v3] VME Driver Changes Manohar Vanga
2011-08-29  9:02 ` [PATCH 3/3] staging: vme: make match() driver specific to improve non-VME64x support Manohar Vanga
2011-08-29 14:55   ` Emilio G. Cota
2011-08-30 10:39     ` Manohar Vanga

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=20110901074601.GA3820@becoht-mvanga \
    --to=manohar.vanga@cern.ch \
    --cc=cota@braap.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martyn.welch@ge.com \
    /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