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


Groups > linux.kernel > #1221771

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

From Francois Romieu <romieu@fr.zoreil.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] r8169: Fix sleeping function called during get_stats64
Date 2015-09-10 00:30 +0200
Message-ID <q6W2m-7YC-3@gated-at.bofh.it> (permalink)
References <q6UWD-6st-33@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..ffffc12 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -833,7 +833,8 @@ struct rtl8169_private {
>  	unsigned features;
>  
>  	struct mii_if_info mii;
> -	struct rtl8169_counters counters;
> +	dma_addr_t CntPhysAddr;
> +	struct rtl8169_counters *CntArray;

I'd rather see less camel case than more.

[...]
> @@ -2245,32 +2230,13 @@ static bool rtl8169_reset_counters(struct net_device *dev)
>  	if (tp->mac_version < RTL_GIGA_MAC_VER_19)
>  		return true;
>  
> -	counters = rtl8169_map_counters(dev, &paddr, CounterReset);
> -	if (!counters)
> -		return false;
> -
> -	if (!rtl_udelay_loop_wait_low(tp, &rtl_reset_counters_cond, 10, 1000))
> -		ret = false;
> -
> -	rtl8169_unmap_counters(dev, paddr, counters);
> -
> -	return ret;
> -}
> -
> -DECLARE_RTL_COND(rtl_counters_cond)
> -{
> -	void __iomem *ioaddr = tp->mmio_addr;
> -
> -	return RTL_R32(CounterAddrLow) & CounterDump;
> +        return rtl8169_do_counters(dev, CounterReset);

spaces instead of tab.

[...]
> @@ -8483,7 +8451,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  out:
>  	return rc;
>  
> -err_out_msi_4:
> +err_out_msi_5:
> +	dma_free_coherent(&pdev->dev, sizeof(*tp->CntArray), tp->CntArray,
> +			  tp->CntPhysAddr);
> +err_out_cnt_4:
>  	netif_napi_del(&tp->napi);

These labels are supposed to suggest what should be done.

Acked-by: Francois Romieu <romieu@fr.zoreil.com>

Tested on 8168b (RTL_GIGA_MAC_VER_17).

-- 
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 v2] r8169: Fix sleeping function called during get_stats64 Corinna Vinschen <vinschen@redhat.com> - 2015-09-09 23:20 +0200
  Re: [PATCH v2] r8169: Fix sleeping function called during get_stats64 Francois Romieu <romieu@fr.zoreil.com> - 2015-09-10 00:30 +0200
  Re: [PATCH v2] r8169: Fix sleeping function called during  get_stats64 David Miller <davem@davemloft.net> - 2015-09-10 05:40 +0200
    Re: [PATCH v2] r8169: Fix sleeping function called during get_stats64 Corinna Vinschen <vinschen@redhat.com> - 2015-09-10 10:40 +0200

csiph-web