netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
	pomidorabelisima@gmail.com,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	linux-kernel@vger.kernel.org, nic_swsd@realtek.com
Subject: Re: [PATCH net] r8169: Fix sleeping function called during get_stats64
Date: Wed, 9 Sep 2015 23:13:06 +0200	[thread overview]
Message-ID: <20150909211306.GA1693@calimero.vinschen.de> (raw)
In-Reply-To: <20150909202334.GA18625@electric-eye.fr.zoreil.com>

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

On Sep  9 22:23, Francois Romieu wrote:
> 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.

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

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-09-09 21:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 12:20 [PATCH net] r8169: Fix sleeping function called during get_stats64 Corinna Vinschen
2015-09-09 20:23 ` Francois Romieu
2015-09-09 21:13   ` Corinna Vinschen [this message]

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=20150909211306.GA1693@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=davem@davemloft.net \
    --cc=konrad@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=pomidorabelisima@gmail.com \
    --cc=romieu@fr.zoreil.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;
as well as URLs for NNTP newsgroup(s).