[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA++WF2MFwtKs8-uy+e_77P0ySsN8y6W_8+Z8AdxBKsutcYK-ig@mail.gmail.com>
Date: Fri, 22 Apr 2022 22:25:40 +0300
From: Stanislav Yakovlev <stas.yakovlev@...il.com>
To: Zheyu Ma <zheyuma97@...il.com>
Cc: kvalo@...nel.org, "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, pabeni@...hat.com,
wireless <linux-wireless@...r.kernel.org>,
netdev@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] wireless: ipw2x00: Refine the error handling of ipw2100_pci_init_one()
Hi Zheyu,
On 18/04/2022, Zheyu Ma <zheyuma97@...il.com> wrote:
> On Thu, Apr 14, 2022 at 2:40 AM Stanislav Yakovlev
> <stas.yakovlev@...il.com> wrote:
>>
>> On Sat, 9 Apr 2022 at 02:25, Zheyu Ma <zheyuma97@...il.com> wrote:
>> >
>> > The driver should release resources in reverse order, i.e., the
>> > resources requested first should be released last, and the driver
>> > should adjust the order of error handling code by this rule.
>> >
>> > Signed-off-by: Zheyu Ma <zheyuma97@...il.com>
>> > ---
>> > drivers/net/wireless/intel/ipw2x00/ipw2100.c | 34 +++++++++-----------
>> > 1 file changed, 16 insertions(+), 18 deletions(-)
>> >
>> [Skipped]
>>
>> > @@ -6306,9 +6303,13 @@ static int ipw2100_pci_init_one(struct pci_dev
>> > *pci_dev,
>> > out:
>> > return err;
>> >
>> > - fail_unlock:
>> > +fail_unlock:
>> > mutex_unlock(&priv->action_mutex);
>> > - fail:
>> > +fail:
>> > + pci_release_regions(pci_dev);
>> > +fail_disable:
>> > + pci_disable_device(pci_dev);
>> We can't move these functions before the following block.
>>
>> > +fail_dev:
>> > if (dev) {
>> > if (registered >= 2)
>> > unregister_netdev(dev);
>> This block continues with a function call to ipw2100_hw_stop_adapter
>> which assumes that device is still accessible via pci bus.
>
> Thanks for your reminder, but the existing error handling does need to
> be revised, I got the following warning when the probing fails at
> pci_resource_flags():
>
> [ 20.712160] WARNING: CPU: 1 PID: 462 at lib/iomap.c:44
> pci_iounmap+0x40/0x50
> [ 20.716583] RIP: 0010:pci_iounmap+0x40/0x50
> [ 20.726342] <TASK>
> [ 20.726550] ipw2100_pci_init_one+0x101/0x1ee0 [ipw2100]
>
> Since I am not familiar with the ipw2100, could someone give me some
> advice to fix this.
Could you please rebuild the kernel with IPW2100_DEBUG config option
enabled, rerun the test and post your results here? Also, please post
the output of "lspci -v" here.
Stanislav.
Powered by blists - more mailing lists