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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Nov 2006 14:15:45 -0500
From:	Jeff Garzik <jeff@...zik.org>
To:	Takashi Iwai <tiwai@...e.de>
CC:	David Miller <davem@...emloft.net>, torvalds@...l.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ALSA: hda-intel - Disable MSI support by default

Takashi Iwai wrote:
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index e35cfd3..bdb92b3 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -544,6 +544,7 @@ static unsigned int azx_rirb_get_respons
>  		free_irq(chip->irq, chip);
>  		chip->irq = -1;
>  		pci_disable_msi(chip->pci);
> +		pci_intx(chip->pci, 1);
>  		chip->msi = 0;
>  		if (azx_acquire_irq(chip, 1) < 0)
>  			return -1;
> @@ -830,14 +831,15 @@ static irqreturn_t azx_interrupt(int irq
>  {
>  	struct azx *chip = dev_id;
>  	struct azx_dev *azx_dev;
> +	unsigned long flags;
>  	u32 status;
>  	int i;
>  
> -	spin_lock(&chip->reg_lock);
> +	spin_lock_irqsave(&chip->reg_lock, flags);
>  
>  	status = azx_readl(chip, INTSTS);
>  	if (status == 0) {
> -		spin_unlock(&chip->reg_lock);
> +		spin_unlock_irqrestore(&chip->reg_lock, flags);
>  		return IRQ_NONE;
>  	}
>  	
> @@ -867,7 +869,7 @@ static irqreturn_t azx_interrupt(int irq
>  	if (azx_readb(chip, STATESTS) & 0x04)
>  		azx_writeb(chip, STATESTS, 0x04);
>  #endif
> -	spin_unlock(&chip->reg_lock);
> +	spin_unlock_irqrestore(&chip->reg_lock, flags);

ACK the pci_intx() calls, NAK the obviously overweight spinlock changes. 
  The spinlock changes are completely unnecessary.  Just look at any 
other (non-ALSA) PCI driver.  Existing "spin_lock()" is fine for both 
PCI shared irq handlers and MSI irq handlers.

It sounds like you are trying to work around a reentrancy problem that 
does not exist.

Only weird drivers like ps2kbd/mouse or IDE need spin_lock_irqsave(), 
where separate interrupt sources call the same function.

	Jeff



-
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