linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Tejun Heo <tj@kernel.org>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jeff Wu <jeff.wu@amd.com>, Shane Huang <shane.huang@amd.com>,
	Matthew Garrett <mjg@redhat.com>, Holger Macht <holger@homac.de>,
	Aaron Lu <aaron.lu@intel.com>, Zhang Rui <rui.zhang@intel.com>,
	linux-ide@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: [RFC PATCH 0/2] Rework ATA ACPI binding code
Date: Thu, 25 Jul 2013 13:47:01 +0800	[thread overview]
Message-ID: <1374731223-28685-1-git-send-email-aaron.lu@intel.com> (raw)

Binding ACPI handle to SCSI device has several drawbacks, namely:
1 During ATA device initialization time, ACPI handle will be needed
  while SCSI devices are not created yet. So each time ACPI handle is
  needed, instead of retrieving the handle by ACPI_HANDLE macro,
  a namespace scan is performed to find the handle for the corresponding
  ATA device. This is inefficient, and also expose a restriction on
  calling path not holding any lock.
2 The binding to SCSI device tree makes code complex, while in the
  meantime doesn't buy us anything. All ACPI handlings are still done
  in ATA module, not in SCSI.

This patchset does ACPI binding to ATA transport port/devices when the
devices are created, so that all later operations that require ACPI
handle will simply be a pointer access by the ACPI_HANDLE macro.
This simplies code a lot and also removes the restriction of calling
thread has to be sleep-able.

With the new binding, when ACPI handle will be needed in a function, ATA
transport device should be used like in acpi_pm_device_run_wake etc. When
runtime PM API is used, the SCSI device object should be used. In a word,
runtime PM is still triggered from SCSI device tree, but all ACPI handling
are done in ATA with ATA transport devices.

Tested on an Intel platform, ZPODD and runtime power off of a SATA disk
works OK. More testing by other people is needed/appreciated.

Aaron Lu (2):
  ata: acpi: remove dead code for ata_acpi_(un)bind
  ata: acpi: rework the ata acpi bind support

 drivers/ata/libata-acpi.c      | 278 ++++++++++++-----------------------------
 drivers/ata/libata-core.c      |   5 -
 drivers/ata/libata-scsi.c      |  13 +-
 drivers/ata/libata-transport.c |   2 +
 drivers/ata/libata-zpodd.c     |  12 +-
 drivers/ata/libata.h           |  20 +--
 drivers/ata/pata_acpi.c        |   4 +-
 drivers/scsi/scsi_lib.c        |  22 ----
 include/linux/libata.h         |   2 -
 9 files changed, 106 insertions(+), 252 deletions(-)

-- 
1.8.3.2.10.g43d11f4


             reply	other threads:[~2013-07-25  5:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25  5:47 Aaron Lu [this message]
2013-07-25  5:47 ` [RFC PATCH 1/2] ata: acpi: remove dead code for ata_acpi_(un)bind Aaron Lu
2013-07-25 14:50   ` Tejun Heo
2013-07-25  5:47 ` [RFC PATCH 2/2] ata: acpi: rework the ata acpi bind support Aaron Lu
2013-07-25 14:52   ` Tejun Heo
2013-07-26  1:37     ` Aaron Lu
2013-07-26 12:48       ` Rafael J. Wysocki
2013-07-27  6:34     ` Matthew Garrett
2013-08-15  1:33     ` Aaron Lu
2013-08-15  3:19       ` Tejun Heo
2013-08-22  7:15         ` Aaron Lu
2013-08-22 18:36           ` Tejun Heo
2013-08-23  2:17             ` [PATCH " Aaron Lu
2013-08-23 16:11               ` Tejun Heo
2013-08-23  7:02           ` [RFC PATCH " Dirk Griesbach
2013-08-23  7:08             ` Aaron Lu

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=1374731223-28685-1-git-send-email-aaron.lu@intel.com \
    --to=aaron.lu@intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=holger@homac.de \
    --cc=jeff.wu@amd.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=rui.zhang@intel.com \
    --cc=shane.huang@amd.com \
    --cc=tj@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;
as well as URLs for NNTP newsgroup(s).