* [PATCH] ACPI / scan: set status to 0 if _STA failed
@ 2015-11-19 3:05 Aaron Lu
2015-11-19 10:11 ` Mika Westerberg
2015-12-09 15:40 ` Bastien Nocera
0 siblings, 2 replies; 4+ messages in thread
From: Aaron Lu @ 2015-11-19 3:05 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: ACPI Devel Mailing List, Mika Westerberg, Bastien Nocera,
Stephen Just, Chen, Yu C, linux-spi-u79uwXL29TY76Z2rM5mHXA
Some ACPI node's _STA will touch operation region field, since the
evaluation of _STA in acpi_bus_type_and_status is very early, the
operation region handler is not ready yet. Instead of fail that function
and not creating the acpi_device node consequently, set status to 0 so
that later when the driver for that device is probing, it can find
the acpi_device node and proceed normally. And at that time, the
handler for the operation region is ready and its _STA evaluation will
succeed, its present status can be checked there.
Even there will be no driver using this node later, it doesn't seem
hurt to have one more acpi_device node created with status set to 0.
This happens on Microsoft Surface 3, where the SPI device node NTRG's
_STA touches GPIO fields and the SPI core driver will only enumerate SPI
devices from ACPI if the acpi_device node is 1: created; 2: _STA
indicates it's present.
Note that due to another problem in SPI driver, for NTRG to be actually
enumerated, some changes have to be made in the SPI layer, which is
addressed by Mika(not send out yet):
https://bugzilla.kernel.org/show_bug.cgi?id=104291#c23
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=104291
Reported-by: Bastien Nocera <bugzilla-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
Signed-off-by: Aaron Lu <aaron.lu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/acpi/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 78d5f02a073b..ddfed0d407e5 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1461,7 +1461,7 @@ static int acpi_bus_type_and_status(acpi_handle handle, int *type,
*type = ACPI_BUS_TYPE_DEVICE;
status = acpi_bus_get_status_handle(handle, sta);
if (ACPI_FAILURE(status))
- return -ENODEV;
+ *sta = 0;
break;
case ACPI_TYPE_PROCESSOR:
*type = ACPI_BUS_TYPE_PROCESSOR;
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI / scan: set status to 0 if _STA failed
2015-11-19 3:05 [PATCH] ACPI / scan: set status to 0 if _STA failed Aaron Lu
@ 2015-11-19 10:11 ` Mika Westerberg
[not found] ` <20151119101149.GZ1604-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2015-12-09 15:40 ` Bastien Nocera
1 sibling, 1 reply; 4+ messages in thread
From: Mika Westerberg @ 2015-11-19 10:11 UTC (permalink / raw)
To: Aaron Lu
Cc: Rafael J. Wysocki, ACPI Devel Mailing List, Bastien Nocera,
Stephen Just, Chen, Yu C, linux-spi
On Thu, Nov 19, 2015 at 11:05:25AM +0800, Aaron Lu wrote:
> Some ACPI node's _STA will touch operation region field, since the
> evaluation of _STA in acpi_bus_type_and_status is very early, the
> operation region handler is not ready yet. Instead of fail that function
> and not creating the acpi_device node consequently, set status to 0 so
> that later when the driver for that device is probing, it can find
> the acpi_device node and proceed normally. And at that time, the
> handler for the operation region is ready and its _STA evaluation will
> succeed, its present status can be checked there.
>
> Even there will be no driver using this node later, it doesn't seem
> hurt to have one more acpi_device node created with status set to 0.
>
> This happens on Microsoft Surface 3, where the SPI device node NTRG's
> _STA touches GPIO fields and the SPI core driver will only enumerate SPI
> devices from ACPI if the acpi_device node is 1: created; 2: _STA
> indicates it's present.
>
> Note that due to another problem in SPI driver, for NTRG to be actually
> enumerated, some changes have to be made in the SPI layer, which is
> addressed by Mika(not send out yet):
> https://bugzilla.kernel.org/show_bug.cgi?id=104291#c23
>
> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=104291
> Reported-by: Bastien Nocera <bugzilla@hadess.net>
> Signed-off-by: Aaron Lu <aaron.lu@intel.com>
I don't know any better solution to this,
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI / scan: set status to 0 if _STA failed
2015-11-19 3:05 [PATCH] ACPI / scan: set status to 0 if _STA failed Aaron Lu
2015-11-19 10:11 ` Mika Westerberg
@ 2015-12-09 15:40 ` Bastien Nocera
1 sibling, 0 replies; 4+ messages in thread
From: Bastien Nocera @ 2015-12-09 15:40 UTC (permalink / raw)
To: Aaron Lu, Rafael J. Wysocki
Cc: ACPI Devel Mailing List, Mika Westerberg, Stephen Just,
Chen, Yu C, linux-spi
On Thu, 2015-11-19 at 11:05 +0800, Aaron Lu wrote:
> Some ACPI node's _STA will touch operation region field, since the
> evaluation of _STA in acpi_bus_type_and_status is very early, the
> operation region handler is not ready yet. Instead of fail that
> function
> and not creating the acpi_device node consequently, set status to 0
> so
> that later when the driver for that device is probing, it can find
> the acpi_device node and proceed normally. And at that time, the
> handler for the operation region is ready and its _STA evaluation
> will
> succeed, its present status can be checked there.
>
> Even there will be no driver using this node later, it doesn't seem
> hurt to have one more acpi_device node created with status set to 0.
>
> This happens on Microsoft Surface 3, where the SPI device node NTRG's
> _STA touches GPIO fields and the SPI core driver will only enumerate
> SPI
> devices from ACPI if the acpi_device node is 1: created; 2: _STA
> indicates it's present.
>
> Note that due to another problem in SPI driver, for NTRG to be
> actually
> enumerated, some changes have to be made in the SPI layer, which is
> addressed by Mika(not send out yet):
> https://bugzilla.kernel.org/show_bug.cgi?id=104291#c23
>
> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=104291
> Reported-by: Bastien Nocera <bugzilla@hadess.net>
> Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Worked for me with the additional SPI patch on a Surface 3.
Tested-by: Bastien Nocera <hadess@hadess.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI / scan: set status to 0 if _STA failed
[not found] ` <20151119101149.GZ1604-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
@ 2015-12-14 23:42 ` Rafael J. Wysocki
0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2015-12-14 23:42 UTC (permalink / raw)
To: Mika Westerberg, Aaron Lu
Cc: ACPI Devel Mailing List, Bastien Nocera, Stephen Just, Chen, Yu C,
linux-spi-u79uwXL29TY76Z2rM5mHXA
On Thursday, November 19, 2015 12:11:49 PM Mika Westerberg wrote:
> On Thu, Nov 19, 2015 at 11:05:25AM +0800, Aaron Lu wrote:
> > Some ACPI node's _STA will touch operation region field, since the
> > evaluation of _STA in acpi_bus_type_and_status is very early, the
> > operation region handler is not ready yet. Instead of fail that function
> > and not creating the acpi_device node consequently, set status to 0 so
> > that later when the driver for that device is probing, it can find
> > the acpi_device node and proceed normally. And at that time, the
> > handler for the operation region is ready and its _STA evaluation will
> > succeed, its present status can be checked there.
> >
> > Even there will be no driver using this node later, it doesn't seem
> > hurt to have one more acpi_device node created with status set to 0.
> >
> > This happens on Microsoft Surface 3, where the SPI device node NTRG's
> > _STA touches GPIO fields and the SPI core driver will only enumerate SPI
> > devices from ACPI if the acpi_device node is 1: created; 2: _STA
> > indicates it's present.
> >
> > Note that due to another problem in SPI driver, for NTRG to be actually
> > enumerated, some changes have to be made in the SPI layer, which is
> > addressed by Mika(not send out yet):
> > https://bugzilla.kernel.org/show_bug.cgi?id=104291#c23
> >
> > Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=104291
> > Reported-by: Bastien Nocera <bugzilla-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
> > Signed-off-by: Aaron Lu <aaron.lu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> I don't know any better solution to this,
>
> Reviewed-by: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Applied, thanks!
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-12-14 23:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19 3:05 [PATCH] ACPI / scan: set status to 0 if _STA failed Aaron Lu
2015-11-19 10:11 ` Mika Westerberg
[not found] ` <20151119101149.GZ1604-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2015-12-14 23:42 ` Rafael J. Wysocki
2015-12-09 15:40 ` Bastien Nocera
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).