All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Stefano Babic <sbabic@denx.de>
Cc: <linux-kernel@vger.kernel.org>,
	Martyn Welch <martyn.welch@collabora.co.uk>
Subject: Re: VME: devices not removed after commit 050c3d52cc7
Date: Fri, 13 Jan 2017 10:39:25 -0500	[thread overview]
Message-ID: <20170113153925.GU11537@windriver.com> (raw)
In-Reply-To: <54f7a6d6-f04d-b13a-04bf-b7e4405d2619@denx.de>

[Adding Martyn to Cc]

[VME: devices not removed after commit 050c3d52cc7] On 13/01/2017 (Fri 11:03) Stefano Babic wrote:

> Hi,
> 
> I have updated a custom VME device driver (mainly based on vme_user.c)
> to 4.9 (previously it was for 3.14-).
> 
> I see that VME device drivers cannot be loaded and unloaded due to this
> commit:
> 
> commit 050c3d52cc7810d9d17b8cd231708609af6876ae
> Author: Paul Gortmaker <paul.gortmaker@windriver.com>
> Date:   Sun Jul 3 14:05:56 2016 -0400
> 
>     vme: make core vme support explicitly non-modular

I've gone back and looked at this, and vme_user.c and I'm not yet 100%
convinced this is the right conclusion.  But perhaps, and I've put
Martyn on the Cc, in the hopes that he can clarify as well, if needed.

> 
> 
> In fact, this drops the remove function, that scans all devices attached
> to the bus and call their remove function.

So I guess my confusion here is between removal of a VME device, vs. the
removal of a complete VME bus.  The above commit you reference was based
on the premise that removal of a VME bus is not supported.  Which is not
to say that a VME device removal is not supported.

> 
> That means that "remove" entry points in VME device driver (let see in
> drivers/staging/vme/devices/vme_user.c) are now dead code and the
> required cleanup code is not called at all (devices and class are not
> removed). Reloading the same driver cause errors due to the missing
> cleanup by unloading.  This does not let build VME device drivers as
> module, as it is supposed to be done.

Again, I don't think this analysis is 100% right, but I can't be sure
because your driver is out of tree and I don't know what it does
precisely.  Looking at vme_user.c example, it has its own .remove
function that should be executed at module unload, and that would do all
the cleanup (see vme_user_remove).

> 
> Paul, what do you mind ?

For sure, we can restore the .remove and vme_bus_remove portions of that
commit if it is a real regression against a correct use of the
infrastructure, but I'm still not clear how you'd be triggering the
vme_bus_remove unless the vme device driver was going up into its
parent's bus struct directly.  Maybe Martyn can spot where I've
misunderstood the bus vs. device separation here.

Paul.
--

> 
> Best regards,
> Stefano Babic
> 
> 
> -- 
> =====================================================================
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
> =====================================================================

  reply	other threads:[~2017-01-13 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 10:03 VME: devices not removed after commit 050c3d52cc7 Stefano Babic
2017-01-13 15:39 ` Paul Gortmaker [this message]
2017-01-13 16:28   ` Stefano Babic
2017-01-18 21:32     ` Martyn Welch

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=20170113153925.GU11537@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martyn.welch@collabora.co.uk \
    --cc=sbabic@denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.