lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20151208111008.GA18728@al>
Date:	Tue, 8 Dec 2015 12:10:08 +0100
From:	Peter Wu <peter@...ensteyn.nl>
To:	Hayes Wang <hayeswang@...ltek.com>
Cc:	"David S . Miller" <davem@...emloft.net>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Lu Baolu <baolu.lu@...ux.intel.com>
Subject: Re: [PATCH] r8152: fix lockup when runtime PM is enabled

On Tue, Dec 08, 2015 at 03:18:59AM +0000, Hayes Wang wrote:
> Peter Wu
> > Sent: Tuesday, December 08, 2015 12:59 AM
> [...]
> > +			if (tp->netdev->flags & IFF_UP) {
> 
> Maybe you could just replace the checking of netif_running(tp->netdev)
> with this.

Simply replacing netif_running by IFF_UP does not work, it hangs during
close when the device is suspended. This patch is correct, but I have a
v2 patch that moves rtl_runtime_suspend_enable from close to suspend.

This is the evaluated scenario (run = netif_running, up = IFF_UP set):

    # suspended before open
    suspend (run=0, up=0)
    open    (run=1)
    resume  (run=1, up=0)   <-- fixed by patch
    (open ends)

    # while up
    suspend (run=1, up=1)
    resume  (run=1, up=1)   <-- no issue, values match
    suspend (run=1, up=1)

    # close while suspended
    close   (run=0, up=1)
    resume  (run=0, up=1)   <-- fixed in patch v2
    (close cont and ends)   <-- rtl_runtime_suspend_enable removed in v2
    suspend (run=0, up=0)

    # while down
    resume  (run=0, up=0)
    suspend (run=0, up=0)

    # open while suspended, open fails
    open    (run=1)
    resume  (run=1, up=0)   <-- fixed by patch
    (open fails)
    suspend (run=0, up=0)

> Excuse me. I have a question. Before the open() is finished, the
> netif_running() would be true, but the IFF_UP wouldn't be set. Is it
> right?

That is right, this happens behind the scenes:

    # open
    netif_running = true
    open()
    if open succeeded
        set IFF_UP
    else
        netif_running = false

    # close
    netif_running = false
    close()
    clear IFF_UP
-- 
Kind regards,
Peter Wu
https://lekensteyn.nl
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ