[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 9 Sep 2015 23:13:06 +0200
From: Corinna Vinschen <vinschen@...hat.com>
To: Francois Romieu <romieu@...zoreil.com>
Cc: netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
pomidorabelisima@...il.com,
Konrad Rzeszutek Wilk <konrad@...nel.org>,
linux-kernel@...r.kernel.org, nic_swsd@...ltek.com
Subject: Re: [PATCH net] r8169: Fix sleeping function called during
get_stats64
On Sep 9 22:23, Francois Romieu wrote:
> Corinna Vinschen <vinschen@...hat.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.
Actually, no. I started out stress testing this combined with a printk
to show if paddr can be NULL, but this never occurs. ndo_get_stats64 is
apparently only called after registering the device, and this occurs
after calling dma_alloc_coherent in rtl_init_one.
Rather than removing the entire test, I acidentally only removed the
printk. Sorry about that.
> [...]
> > @@ -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.
Thanks for catching! I'm sending a fixed patch in a minute, removing
the paddr test and setting rc to -ENOMEM if dma_alloc_coherent fails.
Corinna
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists