linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hp.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
	rafael.j.wysocki@intel.com, vasilis.liaskovitis@profitbricks.com,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	tangchen@cn.fujitsu.com, wency@cn.fujitsu.com
Subject: Re: Cannot hot remove a memory device
Date: Thu, 08 Aug 2013 17:35:59 -0600	[thread overview]
Message-ID: <1376004959.10300.239.camel@misato.fc.hp.com> (raw)
In-Reply-To: <2966692.KbMK5bTkda@vostro.rjw.lan>

On Fri, 2013-08-09 at 01:14 +0200, Rafael J. Wysocki wrote:
> On Thursday, August 08, 2013 04:50:42 PM Toshi Kani wrote:
> > On Fri, 2013-08-09 at 00:12 +0200, Rafael J. Wysocki wrote:
> > > On Thursday, August 08, 2013 11:15:20 AM Toshi Kani wrote:
> > > > On Fri, 2013-08-02 at 18:04 -0600, Toshi Kani wrote:
> > > > > On Sat, 2013-08-03 at 01:43 +0200, Rafael J. Wysocki wrote:
> > > > > > On Friday, August 02, 2013 03:46:15 PM Toshi Kani wrote:
> > > > > > > On Thu, 2013-08-01 at 23:43 +0200, Rafael J. Wysocki wrote:
> > > >  :
> > > > > > > I think it fails with -EINVAL at the place with dev_warn(dev, "ACPI
> > > > > > > handle is already set\n").  When two ACPI memory objects associate with
> > > > > > > a same memory block, the bind procedure of the 2nd ACPI memory object
> > > > > > > sees that ACPI_HANDLE(dev) is already set to the 1st ACPI memory object.
> > > > > > 
> > > > > > That sound's plausible, but I wonder how we can fix that?
> > > > > > 
> > > > > > There's no way for a single physical device to have two different ACPI
> > > > > > "companions".  It looks like the memory blocks should be 64 M each in that
> > > > > > case.  Or we need to create two child devices for each memory block and
> > > > > > associate each of them with an ACPI object.  That would lead to complications
> > > > > > in the user space interface, though.
> > > > > 
> > > > > Right.  Even bigger issue is that I do not think __add_pages() and
> > > > > __remove_pages() can add / delete a memory chunk that is less than
> > > > > 128MB.  128MB is the granularity of them.  So, we may just have to fail
> > > > > this case gracefully.
> > > > 
> > > > FYI: I have submitted the patch blow to close this part of the issue...
> > > > 
> > > > https://lkml.org/lkml/2013/8/8/396
> > > 
> > > That looks good to me, but we'd still need to make it possible to have
> > > memory blocks smaller than 128 MB ...
> > 
> > Do you mean acpi_bind_one() needs to be able to handle such case?  If
> > so, it should not be a problem since a memory block device won't be
> > created when add_memory() fails with the change above.  So, there is no
> > binding to be done.  If you mean add_memory() needs to be able to handle
> > a smaller range, that's quite a tough one unless we make the section
> > size smaller.
> > 
> > BTW, when add_memory() fails, the memory hot-add request still succeeds
> > with no driver attached.  This seems logical, but the added device is
> > useless when no handler is attached.  And it does not allow ejecting the
> > device with no handler.  I am not too worry about this since this is a
> > rare case, but it reminded me that the framework won't handle rollback.
> 
> That is a valid observation.
> 
> Perhaps we should add a flag that will cause acpi_bus_offline_companions()
> to fail immediately if that flag is set for the given device?
> 
> Then, acpi_memory_enable_device() could set that flag for mem_device->device
> when either add_memory() or acpi_bind_memory_blocks() fails?

I am not sure if we need a new flag, but I agree that we could allow
ejecting a device with no handler attached.  We can probably skip any
device specific part (such as offlining) when no handler is attached.

Thanks,
-Toshi


  reply	other threads:[~2013-08-08 23:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01  8:37 Cannot hot remove a memory device Yasuaki Ishimatsu
2013-08-01 21:43 ` Rafael J. Wysocki
2013-08-02 21:46   ` Toshi Kani
2013-08-02 23:43     ` Rafael J. Wysocki
2013-08-03  0:04       ` Toshi Kani
2013-08-03  1:01         ` Rafael J. Wysocki
2013-08-04  0:37           ` Toshi Kani
2013-08-04 14:12             ` Rafael J. Wysocki
2013-08-05  4:00             ` Yasuaki Ishimatsu
2013-08-05  7:59               ` Yasuaki Ishimatsu
2013-08-05 13:14                 ` Cannot hot remove a memory device (patch) Rafael J. Wysocki
2013-08-05 23:19                   ` Toshi Kani
2013-08-06  0:15                     ` Cannot hot remove a memory device (patch, updated) Rafael J. Wysocki
2013-08-06  2:12                       ` Yasuaki Ishimatsu
2013-08-06 14:17                         ` Rafael J. Wysocki
2013-08-06 15:28                       ` Toshi Kani
2013-08-08 17:15         ` Cannot hot remove a memory device Toshi Kani
2013-08-08 22:12           ` Rafael J. Wysocki
2013-08-08 22:50             ` Toshi Kani
2013-08-08 23:14               ` Rafael J. Wysocki
2013-08-08 23:35                 ` Toshi Kani [this message]
2013-08-11 21:13               ` Rafael J. Wysocki
2013-08-12 20:40                 ` Toshi Kani
2013-08-13  0:45                   ` Rafael J. Wysocki
2013-08-13  1:02                     ` Toshi Kani
2013-08-13 12:02                       ` Rafael J. Wysocki
2013-08-13 17:14                         ` Toshi Kani

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=1376004959.10300.239.camel@misato.fc.hp.com \
    --to=toshi.kani@hp.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@sisk.pl \
    --cc=tangchen@cn.fujitsu.com \
    --cc=vasilis.liaskovitis@profitbricks.com \
    --cc=wency@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).