All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] igb: don't unmap hw_addr if its NULL
Date: Thu, 10 Sep 2015 14:28:03 -0400	[thread overview]
Message-ID: <55F1CBB3.6060309@redhat.com> (raw)
In-Reply-To: <9AC147AD-6D52-4A7D-BE5B-3A40F8D22B1A@intel.com>

Rustad, Mark D wrote:
>> On Sep 9, 2015, at 9:07 PM, Jarod Wilson<jarod@redhat.com>  wrote:
>>
>> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
>> index e174fbb..a5e0022 100644
>> --- a/drivers/net/ethernet/intel/igb/igb_main.c
>> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
>> @@ -2823,7 +2823,8 @@ static void igb_remove(struct pci_dev *pdev)
>>
>> 	igb_clear_interrupt_scheme(adapter);
>>
>> -	pci_iounmap(pdev, hw->hw_addr);
>> +	if (hw->hw_addr)
>> +		pci_iounmap(pdev, hw->hw_addr);
>> 	if (hw->flash_address)
>> 		iounmap(hw->flash_address);
>> 	pci_release_selected_regions(pdev,
>
> I don't think that this is entirely the right solution. In ixgbe we
> have a separate pointer, io_addr, used to manage the resource, so that
> the space can be freed even after hw_addr is cleared. With the approach
> above, the pci_iounmap will not ever be called on the space. You can see
> how ixgbe is doing it.

Ah, you're right, that had crossed my mind briefly as well. I've got a 
revised version here now that adds an io_addr to igb_adapter and uses 
that for unmap. I'll post it after I double-check that it builds and 
functions as expected.

-- 
Jarod Wilson
jarod at redhat.com



WARNING: multiple messages have this Message-ID (diff)
From: Jarod Wilson <jarod@redhat.com>
To: "Rustad, Mark D" <mark.d.rustad@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] igb: don't unmap hw_addr if its NULL
Date: Thu, 10 Sep 2015 14:28:03 -0400	[thread overview]
Message-ID: <55F1CBB3.6060309@redhat.com> (raw)
In-Reply-To: <9AC147AD-6D52-4A7D-BE5B-3A40F8D22B1A@intel.com>

Rustad, Mark D wrote:
>> On Sep 9, 2015, at 9:07 PM, Jarod Wilson<jarod@redhat.com>  wrote:
>>
>> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
>> index e174fbb..a5e0022 100644
>> --- a/drivers/net/ethernet/intel/igb/igb_main.c
>> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
>> @@ -2823,7 +2823,8 @@ static void igb_remove(struct pci_dev *pdev)
>>
>> 	igb_clear_interrupt_scheme(adapter);
>>
>> -	pci_iounmap(pdev, hw->hw_addr);
>> +	if (hw->hw_addr)
>> +		pci_iounmap(pdev, hw->hw_addr);
>> 	if (hw->flash_address)
>> 		iounmap(hw->flash_address);
>> 	pci_release_selected_regions(pdev,
>
> I don't think that this is entirely the right solution. In ixgbe we
> have a separate pointer, io_addr, used to manage the resource, so that
> the space can be freed even after hw_addr is cleared. With the approach
> above, the pci_iounmap will not ever be called on the space. You can see
> how ixgbe is doing it.

Ah, you're right, that had crossed my mind briefly as well. I've got a 
revised version here now that adds an io_addr to igb_adapter and uses 
that for unmap. I'll post it after I double-check that it builds and 
functions as expected.

-- 
Jarod Wilson
jarod@redhat.com



  reply	other threads:[~2015-09-10 18:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10  4:07 [Intel-wired-lan] [PATCH] igb: don't unmap hw_addr if its NULL Jarod Wilson
2015-09-10  4:07 ` Jarod Wilson
2015-09-10 15:53 ` [Intel-wired-lan] " Fujinaka, Todd
2015-09-10 15:53   ` Fujinaka, Todd
2015-09-10 15:53   ` Fujinaka, Todd
2015-09-10 17:55 ` Rustad, Mark D
2015-09-10 17:55   ` Rustad, Mark D
2015-09-10 18:28   ` Jarod Wilson [this message]
2015-09-10 18:28     ` Jarod Wilson
2015-09-10 19:37   ` [Intel-wired-lan] [PATCH v2] igb: don't unmap NULL hw_addr Jarod Wilson
2015-09-10 19:37     ` Jarod Wilson

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=55F1CBB3.6060309@redhat.com \
    --to=jarod@redhat.com \
    --cc=intel-wired-lan@osuosl.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.