Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1221699

Re: [PATCH net] r8169: Fix sleeping function called during get_stats64

From Francois Romieu <romieu@fr.zoreil.com>
Newsgroups linux.kernel
Subject Re: [PATCH net] r8169: Fix sleeping function called during get_stats64
Date 2015-09-09 22:30 +0200
Message-ID <q6Uae-5ii-11@gated-at.bofh.it> (permalink)
References <q6MFI-2Ym-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Corinna Vinschen <vinschen@redhat.com> :
[...]
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 24dcbe6..630811a 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
[...]
> +	if (!paddr)
> +		return false;

I guess this is the secret recipe.

What about replacing this part with an adequate barrier in rtl_init_one ?

[...]
> @@ -8447,9 +8411,14 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>  	tp->rtl_fw = RTL_FIRMWARE_UNKNOWN;
>  
> +	tp->CntArray = dma_alloc_coherent (&pdev->dev, sizeof(*tp->CntArray),
> +					   &tp->CntPhysAddr, GFP_KERNEL);
> +	if (!tp->CntArray)
> +		goto err_out_cnt_4;
> +

rc is still zero here so rtl_init_one will return success.

>  	rc = register_netdev(dev);
>  	if (rc < 0)
> -		goto err_out_msi_4;
> +		goto err_out_msi_5;
>  
>  	pci_set_drvdata(pdev, dev);

-- 
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net] r8169: Fix sleeping function called during get_stats64 Corinna Vinschen <vinschen@redhat.com> - 2015-09-09 14:30 +0200
  Re: [PATCH net] r8169: Fix sleeping function called during  get_stats64 Francois Romieu <romieu@fr.zoreil.com> - 2015-09-09 22:30 +0200
    Re: [PATCH net] r8169: Fix sleeping function called during  get_stats64 Corinna Vinschen <vinschen@redhat.com> - 2015-09-09 23:20 +0200

csiph-web