diff mbox series

hid:intel-ish-hid: add MSI interrupt support

Message ID 1544493503-11271-1-git-send-email-hongyan.song@intel.com (mailing list archive)
State Mainlined
Commit 74fbc7d371d9a438b8e39d926d9d5012d2f762c4
Delegated to: Jiri Kosina
Headers show
Series hid:intel-ish-hid: add MSI interrupt support | expand

Commit Message

Song, Hongyan Dec. 11, 2018, 1:58 a.m. UTC
From: Song Hongyan <hongyan.song@intel.com>

Now ish hid ipc only support sideband interrupt but on some platforms
they use MSI interrupt.
In order to make the interrupt type coverage all the scenario add
single MSI interrupt support, it can match all interrupt types.

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
---
v2: update the comments, add more description about this patch.

 drivers/hid/intel-ish-hid/ipc/pci-ish.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Jiri Kosina Dec. 17, 2018, 3:48 p.m. UTC | #1
On Tue, 11 Dec 2018, hongyan.song@intel.com wrote:

> From: Song Hongyan <hongyan.song@intel.com>
> 
> Now ish hid ipc only support sideband interrupt but on some platforms
> they use MSI interrupt.
> In order to make the interrupt type coverage all the scenario add
> single MSI interrupt support, it can match all interrupt types.

Let's add Srinivas to CC as well.

> 
> Signed-off-by: Song Hongyan <hongyan.song@intel.com>
> ---
> v2: update the comments, add more description about this patch.
> 
>  drivers/hid/intel-ish-hid/ipc/pci-ish.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> index 8793cc4..a6e1ee7 100644
> --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> @@ -117,6 +117,7 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  {
>  	int ret;
>  	struct ish_hw *hw;
> +	unsigned long irq_flag = 0;
>  	struct ishtp_device *ishtp;
>  	struct device *dev = &pdev->dev;
>  
> @@ -156,8 +157,12 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3;
>  
>  	/* request and enable interrupt */
> +	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> +	if (!pdev->msi_enabled && !pdev->msix_enabled)
> +		irq_flag = IRQF_SHARED;
> +
>  	ret = devm_request_irq(dev, pdev->irq, ish_irq_handler,
> -			       IRQF_SHARED, KBUILD_MODNAME, ishtp);
> +			       irq_flag, KBUILD_MODNAME, ishtp);
>  	if (ret) {
>  		dev_err(dev, "ISH: request IRQ %d failed\n", pdev->irq);
>  		return ret;
> -- 
> 2.7.4
>
Srinivas Pandruvada Dec. 19, 2018, 5:36 p.m. UTC | #2
On Mon, 2018-12-17 at 16:48 +0100, Jiri Kosina wrote:
> On Tue, 11 Dec 2018, hongyan.song@intel.com wrote:
> 
> > From: Song Hongyan <hongyan.song@intel.com>
> > 
> > Now ish hid ipc only support sideband interrupt but on some
> > platforms
> > they use MSI interrupt.
> > In order to make the interrupt type coverage all the scenario add
> > single MSI interrupt support, it can match all interrupt types.
> 
> Let's add Srinivas to CC as well.
> 
> > 
> > Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> > ---
> > v2: update the comments, add more description about this patch.
> > 
> >  drivers/hid/intel-ish-hid/ipc/pci-ish.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> > b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> > index 8793cc4..a6e1ee7 100644
> > --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> > +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> > @@ -117,6 +117,7 @@ static int ish_probe(struct pci_dev *pdev,
> > const struct pci_device_id *ent)
> >  {
> >  	int ret;
> >  	struct ish_hw *hw;
> > +	unsigned long irq_flag = 0;
> >  	struct ishtp_device *ishtp;
> >  	struct device *dev = &pdev->dev;
> >  
> > @@ -156,8 +157,12 @@ static int ish_probe(struct pci_dev *pdev,
> > const struct pci_device_id *ent)
> >  	pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3;
> >  
> >  	/* request and enable interrupt */
> > +	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> > +	if (!pdev->msi_enabled && !pdev->msix_enabled)
> > +		irq_flag = IRQF_SHARED;
> > +
> >  	ret = devm_request_irq(dev, pdev->irq, ish_irq_handler,
> > -			       IRQF_SHARED, KBUILD_MODNAME, ishtp);
> > +			       irq_flag, KBUILD_MODNAME, ishtp);
> >  	if (ret) {
> >  		dev_err(dev, "ISH: request IRQ %d failed\n", pdev-
> > >irq);
> >  		return ret;
> > -- 
> > 2.7.4
> > 
> 
>
Jiri Kosina Dec. 19, 2018, 7 p.m. UTC | #3
On Tue, 11 Dec 2018, hongyan.song@intel.com wrote:

> From: Song Hongyan <hongyan.song@intel.com>
> 
> Now ish hid ipc only support sideband interrupt but on some platforms
> they use MSI interrupt.
> In order to make the interrupt type coverage all the scenario add
> single MSI interrupt support, it can match all interrupt types.
> 
> Signed-off-by: Song Hongyan <hongyan.song@intel.com>
> ---
> v2: update the comments, add more description about this patch.

Applied to for-4.21/ish.
diff mbox series

Patch

diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
index 8793cc4..a6e1ee7 100644
--- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
+++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
@@ -117,6 +117,7 @@  static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	int ret;
 	struct ish_hw *hw;
+	unsigned long irq_flag = 0;
 	struct ishtp_device *ishtp;
 	struct device *dev = &pdev->dev;
 
@@ -156,8 +157,12 @@  static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3;
 
 	/* request and enable interrupt */
+	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
+	if (!pdev->msi_enabled && !pdev->msix_enabled)
+		irq_flag = IRQF_SHARED;
+
 	ret = devm_request_irq(dev, pdev->irq, ish_irq_handler,
-			       IRQF_SHARED, KBUILD_MODNAME, ishtp);
+			       irq_flag, KBUILD_MODNAME, ishtp);
 	if (ret) {
 		dev_err(dev, "ISH: request IRQ %d failed\n", pdev->irq);
 		return ret;