All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zheng, Lv" <lv.zheng@intel.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: "Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Brown, Len" <len.brown@intel.com>, Lv Zheng <zetalog@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>,
	Peter Hutterer <peter.hutterer@who-t.net>
Subject: RE: [RFC PATCH v3 5/5] ACPI: button: Always notify kernel space using _LID returning value
Date: Wed, 31 May 2017 08:59:56 +0000	[thread overview]
Message-ID: <1AE640813FDE7649BE1B193DEA596E886CEC0827@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <20170529160809.GB28287@mail.corp.redhat.com>

Hi,

> From: Benjamin Tissoires [mailto:benjamin.tissoires@redhat.com]
> Subject: Re: [RFC PATCH v3 5/5] ACPI: button: Always notify kernel space using _LID returning value
> 
> Hi Lv,
> 
> On May 27 2017 or thereabouts, Lv Zheng wrote:
> > Both nouveau and i915, the only 2 kernel space lid notification listeners,
> > invoke acpi_lid_open() API to obtain _LID returning value instead of using
> > the notified value.
> >
> > So this patch moves this logic from listeners to lid driver, always notify
> > kernel space listeners using _LID returning value.
> >
> > This is a no-op cleanup, but facilitates administrators to configure to
> > notify kernel drivers with faked lid init states via command line
> > "button.lid_notify_init_state=Y".
> >
> > Cc: <intel-gfx@lists.freedesktop.org>
> > Cc: <nouveau@lists.freedesktop.org>
> > Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> > Cc: Peter Hutterer <peter.hutterer@who-t.net>
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > ---
> >  drivers/acpi/button.c             | 16 ++++++++++++++--
> >  drivers/gpu/drm/i915/intel_lvds.c |  2 +-
> >  2 files changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
> > index 4abf8ae..e047d34 100644
> > --- a/drivers/acpi/button.c
> > +++ b/drivers/acpi/button.c
> > @@ -119,6 +119,9 @@ static u8 lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
> >  static unsigned long lid_report_interval __read_mostly = 500;
> >  module_param(lid_report_interval, ulong, 0644);
> >  MODULE_PARM_DESC(lid_report_interval, "Interval (ms) between lid key events");
> > +static bool lid_notify_init_state __read_mostly = false;
> > +module_param(lid_notify_init_state, bool, 0644);
> > +MODULE_PARM_DESC(lid_notify_init_state, "Notify init lid state to kernel drivers after
> boot/resume");
> >
> >  /* --------------------------------------------------------------------------
> >                                FS Interface (/proc)
> > @@ -224,6 +227,15 @@ static void acpi_lid_notify_state(struct acpi_device *device,
> >  	if (state)
> >  		pm_wakeup_event(&device->dev, 0);
> >
> > +	if (!lid_notify_init_state) {
> > +		/*
> > +		 * There are cases "state" is not a _LID return value, so
> > +		 * correct it before notification.
> > +		 */
> > +		if (!bios_notify &&
> > +		    lid_init_state != ACPI_BUTTON_LID_INIT_METHOD)
> > +			state = acpi_lid_evaluate_state(device);
> > +	}
> >  	acpi_lid_notifier_call(device, state);
> >  }
> >
> > @@ -572,10 +584,10 @@ static int param_set_lid_init_state(const char *val, struct kernel_param *kp)
> >
> >  	if (!strncmp(val, "open", sizeof("open") - 1)) {
> >  		lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
> > -		pr_info("Notify initial lid state as open\n");
> > +		pr_info("Notify initial lid state to users space as open and kernel drivers with _LID
> return value\n");
> >  	} else if (!strncmp(val, "method", sizeof("method") - 1)) {
> >  		lid_init_state = ACPI_BUTTON_LID_INIT_METHOD;
> > -		pr_info("Notify initial lid state with _LID return value\n");
> > +		pr_info("Notify initial lid state to user/kernel space with _LID return value\n");
> >  	} else if (!strncmp(val, "ignore", sizeof("ignore") - 1)) {
> >  		lid_init_state = ACPI_BUTTON_LID_INIT_IGNORE;
> >  		pr_info("Do not notify initial lid state\n");
> > diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> > index 9ca4dc4..8ca9080 100644
> > --- a/drivers/gpu/drm/i915/intel_lvds.c
> > +++ b/drivers/gpu/drm/i915/intel_lvds.c
> > @@ -548,7 +548,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
> >  	/* Don't force modeset on machines where it causes a GPU lockup */
> >  	if (dmi_check_system(intel_no_modeset_on_lid))
> >  		goto exit;
> > -	if (!acpi_lid_open()) {
> > +	if (!val) {
> >  		/* do modeset on next lid open event */
> >  		dev_priv->modeset_restore = MODESET_ON_LID_OPEN;
> >  		goto exit;
> 
> This last hunk should really be in its own patch because the intel GPU
> folks would need to apply the rest of the series for their CI suite, and
> also because there is no reason for this change to be alongside any
> other acpi/button.c change.

OK, I'll drop i915 related changes.
However I can see cleanup chances in button.c.
I feel I should at least do minimal tunings in button driver to allow future improvements.

Cheers,
Lv

> Cheers,
> Benjamin

  reply	other threads:[~2017-05-31  9:00 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05  2:39 [PATCH 1/5] Revert "ACPI / button: Remove lid_init_state=method mode" Lv Zheng
2017-05-05  2:39 ` [PATCH 2/5] ACPI: button: Add button.lid_init_state=close Lv Zheng
2017-05-05  2:39 ` [PATCH 3/5] ACPI: button: Fix lid notification Lv Zheng
2017-05-05  2:39 ` [PATCH 4/5] ACPI: button: Always notify kernel space using _LID returning value Lv Zheng
2017-05-05  2:40 ` [PATCH 5/5] ACPI: button: Obselete acpi_lid_open() invocations Lv Zheng
2017-05-09  1:21   ` Julian Wiedmann
2017-05-09  6:19     ` Zheng, Lv
2017-05-09  1:22 ` [PATCH 1/5] Revert "ACPI / button: Remove lid_init_state=method mode" Julian Wiedmann
2017-05-09  6:17   ` Zheng, Lv
2017-05-09  7:02 ` [PATCH v2 " Lv Zheng
2017-05-09  7:02 ` [PATCH v2 2/5] ACPI: button: Add button.lid_init_state=close Lv Zheng
2017-05-11 10:20   ` Benjamin Tissoires
2017-05-12  1:31     ` Zheng, Lv
2017-05-12  9:55       ` Benjamin Tissoires
2017-05-15  1:44         ` Zheng, Lv
2017-05-09  7:02 ` [PATCH v2 3/5] ACPI: button: Fix lid notification Lv Zheng
2017-05-11 10:21   ` Benjamin Tissoires
2017-05-09  7:02 ` [PATCH v2 4/5] ACPI: button: Always notify kernel space using _LID returning value Lv Zheng
2017-05-11 10:28   ` Benjamin Tissoires
2017-05-12  1:22     ` Zheng, Lv
2017-05-12 10:06       ` Benjamin Tissoires
2017-05-15  2:11         ` Zheng, Lv
2017-05-09  7:02 ` [PATCH v2 5/5] ACPI: button: Obselete acpi_lid_open() invocations Lv Zheng
2017-05-10 10:30   ` [Intel-gfx] " Jani Nikula
2017-05-11 10:33   ` Benjamin Tissoires
2017-05-12  1:25     ` Zheng, Lv
2017-05-12  6:08       ` Zheng, Lv
2017-05-12 10:20         ` Benjamin Tissoires
2017-05-15  3:55           ` Zheng, Lv
2017-05-15  7:12             ` Benjamin Tissoires
2017-05-15  8:42               ` Jani Nikula
2017-05-15  9:21                 ` [Intel-gfx] " Benjamin Tissoires
2017-05-15  9:41                   ` Jani Nikula
2017-05-26 23:42 ` [RFC PATCH v3 1/5] ACPI: button: Add indication of BIOS notification and faked events Lv Zheng
2017-05-26 23:42   ` Lv Zheng
2017-05-29 16:04   ` Benjamin Tissoires
2017-05-31  8:57     ` Zheng, Lv
2017-05-31  8:57       ` Zheng, Lv
2017-05-26 23:42 ` [RFC PATCH v3 2/5] ACPI: button: Extends complement switch event support for all modes Lv Zheng
2017-05-26 23:42   ` Lv Zheng
2017-05-26 23:42 ` [RFC PATCH v3 3/5] ACPI: button: Add lid event type debugging messages Lv Zheng
2017-05-26 23:42   ` Lv Zheng
2017-05-26 23:42 ` [RFC PATCH v3 4/5] ACPI: button: Fix lid notification Lv Zheng
2017-05-26 23:42   ` Lv Zheng
     [not found] ` <2a779ae8c280c968b3237ac4a3d9580df7262a46.1493951798.git.lv.zheng-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-05-26 23:42   ` [RFC PATCH v3 5/5] ACPI: button: Always notify kernel space using _LID returning value Lv Zheng
2017-05-26 23:42     ` Lv Zheng
2017-05-29 16:08     ` Benjamin Tissoires
2017-05-31  8:59       ` Zheng, Lv [this message]
2017-05-31  9:41 ` [RFC PATCH v4 1/5] ACPI: button: Add indication of BIOS notification and faked events Lv Zheng
2017-05-31  9:41 ` [RFC PATCH v4 2/5] ACPI: button: Extends complement switch event support for all modes Lv Zheng
2017-05-31  9:41   ` Lv Zheng
2017-05-31  9:42 ` [RFC PATCH v4 3/5] ACPI: button: Add lid event type debugging messages Lv Zheng
2017-05-31  9:42 ` [RFC PATCH v4 4/5] ACPI: button: Fix lid notification locks Lv Zheng
2017-05-31  9:42 ` [RFC PATCH v4 5/5] ACPI: button: Cleanup lid notification logics Lv Zheng
2017-06-07  9:43 ` [RFC PATCH 0/2] ACPI: button: Fix button.lid_init_state=method mode Lv Zheng
2017-06-07  9:43   ` [RFC PATCH v5 1/2] ACPI: button: Fix issue that button notify cannot report stateful SW_LID state Lv Zheng
2017-06-07  9:43     ` Lv Zheng
2017-06-13  6:17     ` [lkp-robot] [ACPI] 4d0c35c1af: BUG:scheduling_while_atomic kernel test robot
2017-06-13  6:17       ` kernel test robot
2017-06-13  6:17       ` kernel test robot
2017-06-07  9:43   ` [RFC PATCH v5 2/2] ACPI: button: Add a quirk mode for Surface Pro 1 like laptop Lv Zheng
2017-06-07  9:43     ` Lv Zheng
2017-06-21  8:54 ` [RFC PATCH v6 0/5] ACPI: button: Fix button.lid_init_state=method mode Lv Zheng
2017-06-21  8:55   ` [RFC PATCH v6 1/5] ACPI: button: Add a workaround to fix an order issue for old userspace Lv Zheng
2017-06-21  8:55     ` Lv Zheng
2017-06-23 14:02     ` Benjamin Tissoires
2017-06-23 14:02       ` Benjamin Tissoires
2017-06-30  1:34     ` [lkp-robot] [ACPI] c4a9ff748c: BUG:scheduling_while_atomic kernel test robot
2017-06-30  1:34       ` kernel test robot
2017-06-30  1:34       ` kernel test robot
2017-06-21  8:55   ` [RFC PATCH v6 2/5] ACPI: button: Add an optional workaround to fix an event missing issue for old userspace Lv Zheng
2017-06-21  8:55     ` Lv Zheng
2017-06-23 14:03     ` Benjamin Tissoires
2017-06-23 14:03       ` Benjamin Tissoires
2017-06-21  8:55   ` [RFC PATCH v6 3/5] ACPI: button: Rework lid_init_state=ignore mode Lv Zheng
2017-06-21  8:55     ` Lv Zheng
2017-06-23 14:03     ` Benjamin Tissoires
2017-06-23 14:03       ` Benjamin Tissoires
2017-06-21  8:55   ` [RFC PATCH v6 4/5] ACPI: button: extract input creation/destruction helpers Lv Zheng
2017-06-21  8:55   ` [RFC PATCH v6 5/5] ACPI: button: Add an optional workaround to fix a persistent close issue for old userspace Lv Zheng
2017-06-23 14:03     ` Benjamin Tissoires

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=1AE640813FDE7649BE1B193DEA596E886CEC0827@SHSMSX101.ccr.corp.intel.com \
    --to=lv.zheng@intel.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=peter.hutterer@who-t.net \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=zetalog@gmail.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 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.