mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hahnjo <hahnjo@hahnjo.de>
To: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: jcliburn@gmail.com, chris.snook@gmail.com, davem@davemloft.net,
	johannes@sipsolutions.net, jg1.han@samsung.com,
	wangyijing@huawei.com, sd@queasysnail.net,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH V2] ATHEROS-ALX: Use dma_set_mask_and_coherent and fix a bug
Date: Sun, 16 Mar 2014 09:39:34 +0100	[thread overview]
Message-ID: <1394959174.5764.4.camel@archlinux-laptop.fritz.box> (raw)
In-Reply-To: <1394926252-2269-1-git-send-email-peter.senna@gmail.com>

Am Sonntag, den 16.03.2014, 00:30 +0100 schrieb Peter Senna Tschudin:
>  1. For the 64 bits dma mask use dma_set_mask_and_coherent instead of
>  dma_set_mask and dma_set_coherent_mask.
> 
>  2. For the 32 bits dma mask dma_set_coherent_mask is only called if
>  dma_set_mask fails, which is unusual. Assuming this as a bug, fixes
>  it by replacing calls to dma_set_mask and dma_set_coherent_mask by a
>  call to dma_set_mask_and_coherent.
>  
Tested-by: Jonas Hahnfeld <hahnjo@hahnjo.de>
>  Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
> ---
> 
>  Tested by compilation only.
> 
>  Change from V1: Updated commit message.
> 
>  drivers/net/ethernet/atheros/alx/main.c | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
> index 2e45f6e..380d249 100644
> --- a/drivers/net/ethernet/atheros/alx/main.c
> +++ b/drivers/net/ethernet/atheros/alx/main.c
> @@ -1248,19 +1248,13 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	 * shared register for the high 32 bits, so only a single, aligned,
>  	 * 4 GB physical address range can be used for descriptors.
>  	 */
> -	if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
> -	    !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
> +	if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
>  		dev_dbg(&pdev->dev, "DMA to 64-BIT addresses\n");
>  	} else {
> -		err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
> +		err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
>  		if (err) {
> -			err = dma_set_coherent_mask(&pdev->dev,
> -						    DMA_BIT_MASK(32));
> -			if (err) {
> -				dev_err(&pdev->dev,
> -					"No usable DMA config, aborting\n");
> -				goto out_pci_disable;
> -			}
> +			dev_err(&pdev->dev, "No usable DMA config, aborting\n");
> +			goto out_pci_disable;
>  		}
>  	}
>  

No obvious problems noticed on my ASUS N56VZ.


  reply	other threads:[~2014-03-16  9:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15 23:30 Peter Senna Tschudin
2014-03-16  8:39 ` hahnjo [this message]
2014-03-17 21:20 ` David Miller

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=1394959174.5764.4.camel@archlinux-laptop.fritz.box \
    --to=hahnjo@hahnjo.de \
    --cc=chris.snook@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jcliburn@gmail.com \
    --cc=jg1.han@samsung.com \
    --cc=johannes@sipsolutions.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peter.senna@gmail.com \
    --cc=sd@queasysnail.net \
    --cc=wangyijing@huawei.com \
    /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

all inboxes | Powered by JetHome®