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] [day] [month] [year] [list]
Message-Id: <201106300953.16654.alexander.stein@systec-electronic.com>
Date:	Thu, 30 Jun 2011 09:53:15 +0200
From:	Alexander Stein <alexander.stein@...tec-electronic.com>
To:	Tomoya MORINAGA <tomoya-linux@....okisemi.com>
Cc:	Grant Likely <grant.likely@...retlab.ca>,
	linux-kernel@...r.kernel.org, qi.wang@...el.com,
	yong.y.wang@...el.com, joel.clark@...el.com,
	kok.howg.ewe@...el.com, toshiharu-linux@....okisemi.com
Subject: Re: [PATCH v3] pch_gpio: Support interrupt function

On Thursday 30 June 2011 04:07:16 Tomoya MORINAGA wrote:
> Hi Grant,
> 
> If you don't have any concern, would you accept this patch ?
> 
> Thanks,
> 
> (2011/06/21 13:44), Tomoya MORINAGA wrote:
> > Support interrupt function using irq_chip_generic
> > 
> > Signed-off-by: Tomoya MORINAGA<tomoya-linux@....okisemi.com>
> > ---
> > @@ -202,8 +345,36 @@ static int __devinit pch_gpio_probe(struct pci_dev
> > *pdev,
> > 
> >   		goto err_gpiochip_add;
> >   	
> >   	}
> > 
> > +	irq_base = irq_alloc_descs(-1, PCH_IRQ_BASE, GPIO_NUM_PINS,
> > GFP_KERNEL); +	if (irq_base<  0) {
> > +		dev_err(&pdev->dev, "PCH gpio: Failed to get IRQ base num\n");
> > +		goto err_irq_alloc_descs;
> > +	}
> > +	chip->irq_base = irq_base;
> > +
> > +	ret = request_irq(pdev->irq, pch_gpio_handler,
> > +			     IRQF_SHARED, KBUILD_MODNAME, chip);
> > +	if (ret != 0) {
> > +		dev_err(&pdev->dev,
> > +			"%s request_irq failed\n", __func__);
> > +		goto err_request_irq;
> > +	}
> > +
> > +	pch_gpio_alloc_generic_chip(chip, irq_base, GPIO_NUM_PINS);
> > +
> > +	/* Initialize interrupt ien register */
> > +	iowrite32(0,&chip->reg->ien);
> > +
> > 
> >   	return 0;
> > 
> > +err_request_irq:
> > +	irq_free_descs(irq_base, GPIO_NUM_PINS);
> > +
> > +err_irq_alloc_descs:
> > +	ret = gpiochip_remove(&chip->gpio);
> > +	if (ret)
> > +		dev_err(&pdev->dev, "%s gpiochip_remove failed\n", __func__);
> > +
> > 
> >   err_gpiochip_add:
> >   	pci_iounmap(pdev, chip->base);
> > 
> > @@ -224,6 +395,8 @@ static void __devexit pch_gpio_remove(struct pci_dev
> > *pdev)
> > 
> >   	int err;
> >   	struct pch_gpio *chip = pci_get_drvdata(pdev);
> > 
> > +	irq_free_descs(chip->irq_base, GPIO_NUM_PINS);
> > +

Is a free_irq missing here?

> > 
> >   	err = gpiochip_remove(&chip->gpio);
> >   	if (err)
> >   	
> >   		dev_err(&pdev->dev, "Failed gpiochip_remove\n");

Regards,
Alexander
--
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