Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jiri Slaby <jslaby@suse.cz>
Cc: tiwai@suse.de, stable@vger.kernel.org, stable-commits@vger.kernel.org
Subject: Re: Patch "ALSA: ctxfi: Fallback DMA mask to 32bit" has been added to the 4.4-stable tree
Date: Sun, 12 Mar 2017 06:20:48 +0100	[thread overview]
Message-ID: <20170312052048.GA22384@kroah.com> (raw)
In-Reply-To: <64decc2d-e459-476a-f344-a191f09ebec0@suse.cz>

On Sat, Mar 11, 2017 at 04:28:53PM +0100, Jiri Slaby wrote:
> On 03/08/2017, 11:27 AM, gregkh@linuxfoundation.org wrote:
> > From 15c75b09f8d190f89ab4db463b87d411ca349dfe Mon Sep 17 00:00:00 2001
> > From: Takashi Iwai <tiwai@suse.de>
> > Date: Tue, 28 Feb 2017 17:16:48 +0100
> > Subject: ALSA: ctxfi: Fallback DMA mask to 32bit
> > 
> > From: Takashi Iwai <tiwai@suse.de>
> > 
> > commit 15c75b09f8d190f89ab4db463b87d411ca349dfe upstream.
> > 
> > Currently ctxfi driver tries to set only the 64bit DMA mask on 64bit
> > architectures, and bails out if it fails.  This causes a problem on
> > some platforms since the 64bit DMA isn't always guaranteed.  We should
> > fall back to the default 32bit DMA when 64bit DMA fails.
> > 
> > Fixes: 6d74b86d3c0f ("ALSA: ctxfi - Allow 64bit DMA")
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ...
> > @@ -1904,19 +1898,18 @@ static int hw_card_start(struct hw *hw)
> >  {
> >  	int err;
> >  	struct pci_dev *pci = hw->pci;
> > +	const unsigned int dma_bits = BITS_PER_LONG;
> >  
> >  	err = pci_enable_device(pci);
> >  	if (err < 0)
> >  		return err;
> >  
> >  	/* Set DMA transfer mask */
> > -	if (dma_set_mask(&pci->dev, CT_XFI_DMA_MASK) < 0 ||
> > -	    dma_set_coherent_mask(&pci->dev, CT_XFI_DMA_MASK) < 0) {
> > -		dev_err(hw->card->dev,
> > -			"architecture does not support PCI busmaster DMA with mask 0x%llx\n",
> > -			CT_XFI_DMA_MASK);
> > -		err = -ENXIO;
> > -		goto error1;
> > +	if (dma_set_mask(&pci->dev, DMA_BIT_MASK(dma_bits))) {
> 
> I believe the condition is inverted here.
> 
> > +		dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(dma_bits));
> > +	} else {
> > +		dma_set_mask(&pci->dev, DMA_BIT_MASK(32));
> > +		dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(32));

As this matches what is in Linus's tree, that means I didn't mess up the
backport :)

But I don't understand the issue, what is wrong here?  Should it try 32
first?

Takashi, any thoughts?

thanks,

greg k-h

  reply	other threads:[~2017-03-12  5:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 10:27 Patch "ALSA: ctxfi: Fallback DMA mask to 32bit" has been added to the 4.4-stable tree gregkh
2017-03-11 15:28 ` Jiri Slaby
2017-03-12  5:20   ` Greg KH [this message]
2017-03-12  8:30     ` Jiri Slaby
2017-03-20  6:36       ` Takashi Iwai

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=20170312052048.GA22384@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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