lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140226091153.GY5018@intel.com>
Date:	Wed, 26 Feb 2014 11:11:53 +0200
From:	Mika Westerberg <mika.westerberg@...ux.intel.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	Alexandre Courbot <gnurou@...il.com>,
	Lan Tianyu <tianyu.lan@...el.com>,
	Lv Zheng <lv.zheng@...el.com>, Alan Cox <alan.cox@...el.com>,
	Mathias Nyman <mathias.nyman@...ux.intel.com>,
	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/6] gpio / ACPI: Add support for ACPI GPIO operation
 regions

On Tue, Feb 25, 2014 at 03:55:02PM +0100, Rafael J. Wysocki wrote:
> On Monday, February 24, 2014 06:00:11 PM Mika Westerberg wrote:
> > GPIO operation regions is a new feature introduced in ACPI 5.0
> > specification. This feature adds a way for platform ASL code to call back
> > to OS GPIO driver and toggle GPIO pins.
> > 
> > An example ASL code from Lenovo Miix 2 tablet with only relevant part
> > listed:
> > 
> >  Device (\_SB.GPO0)
> >  {
> >      Name (AVBL, Zero)
> >      Method (_REG, 2, NotSerialized)
> >      {
> >          If (LEqual (Arg0, 0x08))
> >          {
> >              // Marks the region available
> >              Store (Arg1, AVBL)
> >          }
> >      }
> > 
> >      OperationRegion (GPOP, GeneralPurposeIo, Zero, 0x0C)
> >      Field (GPOP, ByteAcc, NoLock, Preserve)
> >      {
> >          Connection (
> >              GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
> >                      "\\_SB.GPO0", 0x00, ResourceConsumer,,)
> >              {
> >                  0x003B
> >              }
> >          ),
> >          SHD3,   1,
> >      }
> >  }
> > 
> >  Device (SHUB)
> >  {
> >      Method (_PS0, 0, Serialized)
> >      {
> >          If (LEqual (\_SB.GPO0.AVBL, One))
> >          {
> >              Store (One, \_SB.GPO0.SHD3)
> >              Sleep (0x32)
> >          }
> >      }
> >      Method (_PS3, 0, Serialized)
> >      {
> >          If (LEqual (\_SB.GPO0.AVBL, One))
> >          {
> >              Store (Zero, \_SB.GPO0.SHD3)
> >          }
> >      }
> >  }
> > 
> > The sensor hub (SHUB) device uses GPIO connection SHD3 to power the device
> > whenever the GPIO operation region is available.
> 
> I would add more explanation of the ASL above here.  Basically, how it is
> supposed to work and what's the handler's role in it.

OK, I will do that in the next revision.

> > Implement the support by registering GPIO operation region handlers for all
> > GPIO devices that have an ACPI handle. First time the GPIO is used by the
> > ASL code we make sure that the GPIO stays requested until the GPIO chip
> > driver itself is unloaded. If we find out that the GPIO is already
> > requested we just toggle it according to the value got from ASL code.
> 
> The patch itself looks good to me.

Thanks for reviewing this :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ