linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: jikos@kernel.org, benjamin.tissoires@redhat.com,
	linux-pm@vger.kernel.org,  linux-pci@vger.kernel.org,
	Jian Hui Lee <jianhui.lee@canonical.com>,
	Even Xu <even.xu@intel.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] HID: intel-ish-hid: ipc: Rework EHL OOB wakeup
Date: Thu, 07 Dec 2023 08:48:30 -0500	[thread overview]
Message-ID: <925fd50bd609f99f0eabf93d1163106f6118f139.camel@linux.intel.com> (raw)
In-Reply-To: <CAAd53p7do2rrB=qbpWKbNCWB_qfZ2YZPtB_55VcfGjDYXgLfzA@mail.gmail.com>

On Thu, 2023-12-07 at 10:44 +0800, Kai-Heng Feng wrote:
> On Tue, Dec 5, 2023 at 1:50 AM srinivas pandruvada
> <srinivas.pandruvada@linux.intel.com> wrote:
> > 
> > Hi Kai,
> > 
> > Sorry for he delay in getting back on this. I have a question
> > below:
> > 
> > On Wed, 2023-11-08 at 14:19 +0200, Kai-Heng Feng wrote:
> > > Since PCI core and ACPI core already handles PCI PME wake and GPE
> > > wake
> > > when the device has wakeup capability, use device_init_wakeup()
> > > to
> > > let
> > > them do the wakeup setting work.
> > > 
> > > Also add a shutdown callback which uses pci_prepare_to_sleep() to
> > > let
> > > PCI and ACPI set OOB wakeup for S5.
> > > 
> > > Cc: Jian Hui Lee <jianhui.lee@canonical.com>
> > > Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> > > ---
> > > v2:
> > >  Rebase on ("HID: intel-ish-hid: ipc: Disable and reenable ACPI
> > > GPE
> > > bit")
> > > 
> > >  drivers/hid/intel-ish-hid/ipc/pci-ish.c | 67 ++++++-------------
> > > ----
> > > --
> > > 
...
...

> > > +               device_init_wakeup(dev, true);
> > 
> > For apple to apple comparison, which path will call
> > https://elixir.bootlin.com/linux/latest/C/ident/__pci_enable_wake
> > which will call pci_pme_active()?
> 
> Here's the flow:
> device_shutdown()
>   pci_device_shutdown()
>     ish_shutdown()
>       pci_prepare_to_sleep()
>         __pci_enable_wake()
>           pci_pme_active()
>             __pci_pme_active()

Thanks. I will send my ACK to the original patch.

Thanks,
Srinivas

> 
> Kai-Heng
> 
> > 
> > Thanks,
> > Srinivas
> > 
> > > 
> > >         ret = ish_init(ishtp);
> > >         if (ret)
> > > @@ -256,6 +212,19 @@ static void ish_remove(struct pci_dev *pdev)
> > >         ish_device_disable(ishtp_dev);
> > >  }
> > > 
> > > +
> > > +/**
> > > + * ish_shutdown() - PCI driver shutdown callback
> > > + * @pdev:      pci device
> > > + *
> > > + * This function sets up wakeup for S5
> > > + */
> > > +static void ish_shutdown(struct pci_dev *pdev)
> > > +{
> > > +       if (pdev->device == EHL_Ax_DEVICE_ID)
> > > +               pci_prepare_to_sleep(pdev);
> > > +}
> > > +
> > >  static struct device __maybe_unused *ish_resume_device;
> > > 
> > >  /* 50ms to get resume response */
> > > @@ -378,13 +347,6 @@ static int __maybe_unused ish_resume(struct
> > > device *device)
> > >         struct pci_dev *pdev = to_pci_dev(device);
> > >         struct ishtp_device *dev = pci_get_drvdata(pdev);
> > > 
> > > -       /* add this to finish power flow for EHL */
> > > -       if (dev->pdev->device == EHL_Ax_DEVICE_ID) {
> > > -               pci_set_power_state(pdev, PCI_D0);
> > > -               enable_pme_wake(pdev);
> > > -               dev_dbg(dev->devc, "set power state to D0 for
> > > ehl\n");
> > > -       }
> > > -
> > >         ish_resume_device = device;
> > >         dev->resume_flag = 1;
> > > 
> > > @@ -400,6 +362,7 @@ static struct pci_driver ish_driver = {
> > >         .id_table = ish_pci_tbl,
> > >         .probe = ish_probe,
> > >         .remove = ish_remove,
> > > +       .shutdown = ish_shutdown,
> > >         .driver.pm = &ish_pm_ops,
> > >  };
> > > 
> > 


  reply	other threads:[~2023-12-07 13:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 12:19 [PATCH v2] HID: intel-ish-hid: ipc: Rework EHL OOB wakeup Kai-Heng Feng
2023-12-04 12:31 ` Jiri Kosina
2023-12-04 13:31   ` srinivas pandruvada
2023-12-04 17:50 ` srinivas pandruvada
2023-12-07  2:44   ` Kai-Heng Feng
2023-12-07 13:48     ` srinivas pandruvada [this message]
2023-12-07 13:49 ` srinivas pandruvada
2023-12-07 13:53   ` Jiri Kosina

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=925fd50bd609f99f0eabf93d1163106f6118f139.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=even.xu@intel.com \
    --cc=jianhui.lee@canonical.com \
    --cc=jikos@kernel.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.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).