All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Zong Li <zong.li@sifive.com>
Cc: Yixun Lan <yixun.lan@gmail.com>,
	Andreas Schwab <schwab@linux-m68k.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Pragnesh Patel <pragnesh.patel@openfive.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Michael Turquette <mturquette@baylibre.com>,
	"linux-kernel@vger.kernel.org List"
	<linux-kernel@vger.kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	linux-riscv <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v7 0/5] clk: add driver for the SiFive FU740
Date: Wed, 19 May 2021 20:17:16 +0200	[thread overview]
Message-ID: <CAMuHMdWGakAT1LKg_sje=ZYTbLX1_BjjOsqOYP9KrzhMmMi6Ag@mail.gmail.com> (raw)
In-Reply-To: <CANXhq0q-ou6h_Qxjtq52RQ_V2ERu8JLNa7Vq77Rpv_+SFX4LNA@mail.gmail.com>

Hi Zong,

On Wed, May 19, 2021 at 5:55 PM Zong Li <zong.li@sifive.com> wrote:
> On Tue, May 11, 2021 at 4:57 PM Yixun Lan <yixun.lan@gmail.com> wrote:
> > On Wed, Apr 14, 2021 at 2:25 PM Zong Li <zong.li@sifive.com> wrote:
> > > On Mon, Apr 12, 2021 at 7:31 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
> > > > On Mär 31 2021, Zong Li wrote:
> > > > > I found that the gemgxlpll was disabled immediately by power
> > > > > management after macb driver install. The mainline's defconfig doesn't
> > > > > enable CONFIG_PM, so the network is fine on it. The opensuse defconfig
> > > > > enables CONFIG_PM, and the patch
> > > > > 732374a0b440d9a79c8412f318a25cd37ba6f4e2 added the enable/disable
> > > > > callback functions, so the gemgxlpll PLL, I have no idea why power
> > > > > management disable it, I would keep trace it.
> > > >
> > > > Does that mean that CONFIG_PM also affects the FU740?
> > >
> > > Yes, we got the same problem on the FU740. We are checking the issue.
> > >
> > Just a mild ping, any progress regarding this issue?
>
> Currently, if runtime power management is enabled, macb driver would
> go to sleep at the end of macb_probe, then the gigabit ethernet PLL
> would be disabled.  During this period of time, the system would hang
> up if we try to access GEMGXL control registers, it means that we
> can't access GEMGXL control registers before the gigabit ethernet PLL
> is resumed again. There are some cases, for example, if we execute the

Sounds familiar.

> 'ifconfig' command, it would eventually go to the macb_get_status to

Do you mean mac_get_stats()? macb_get_status() does not exist.

> access GEMGXL control registers and cause the system to hang up. Give
> more example here, if we execute 'ip link set lo up & ip addr add
> 127.0.0.1/8 dev lo', it would cause the system to hang up, because
> these commands would try to query the interfaces and eventually go to
> macb_get_status as well. However, if we can resume the gigabit
> ethernet PLL first, such as 'ip link set eth0 up' or 'udhcpc', then
> everything goes well. I'm trying to figure out if there are some hooks
> that we can check the PLL status in the macb driver before it actually
> touches the control registers. If anyone has an idea about that,
> please feel free to point it out to me, thanks.

And you cannot call pm_runtime_get_sync(), as this is called from
atomic contect. Other drivers avoid accessing the registers while
the device is not up, cfr. e.g. commit 7fa2955ff70ce453 ("sh_eth:
Fix sleeping function called from invalid context").

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Zong Li <zong.li@sifive.com>
Cc: Yixun Lan <yixun.lan@gmail.com>,
	Andreas Schwab <schwab@linux-m68k.org>,
	 Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Stephen Boyd <sboyd@kernel.org>,
	Pragnesh Patel <pragnesh.patel@openfive.com>,
	 Albert Ou <aou@eecs.berkeley.edu>,
	Michael Turquette <mturquette@baylibre.com>,
	"linux-kernel@vger.kernel.org List"
	<linux-kernel@vger.kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	 linux-riscv <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v7 0/5] clk: add driver for the SiFive FU740
Date: Wed, 19 May 2021 20:17:16 +0200	[thread overview]
Message-ID: <CAMuHMdWGakAT1LKg_sje=ZYTbLX1_BjjOsqOYP9KrzhMmMi6Ag@mail.gmail.com> (raw)
In-Reply-To: <CANXhq0q-ou6h_Qxjtq52RQ_V2ERu8JLNa7Vq77Rpv_+SFX4LNA@mail.gmail.com>

Hi Zong,

On Wed, May 19, 2021 at 5:55 PM Zong Li <zong.li@sifive.com> wrote:
> On Tue, May 11, 2021 at 4:57 PM Yixun Lan <yixun.lan@gmail.com> wrote:
> > On Wed, Apr 14, 2021 at 2:25 PM Zong Li <zong.li@sifive.com> wrote:
> > > On Mon, Apr 12, 2021 at 7:31 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
> > > > On Mär 31 2021, Zong Li wrote:
> > > > > I found that the gemgxlpll was disabled immediately by power
> > > > > management after macb driver install. The mainline's defconfig doesn't
> > > > > enable CONFIG_PM, so the network is fine on it. The opensuse defconfig
> > > > > enables CONFIG_PM, and the patch
> > > > > 732374a0b440d9a79c8412f318a25cd37ba6f4e2 added the enable/disable
> > > > > callback functions, so the gemgxlpll PLL, I have no idea why power
> > > > > management disable it, I would keep trace it.
> > > >
> > > > Does that mean that CONFIG_PM also affects the FU740?
> > >
> > > Yes, we got the same problem on the FU740. We are checking the issue.
> > >
> > Just a mild ping, any progress regarding this issue?
>
> Currently, if runtime power management is enabled, macb driver would
> go to sleep at the end of macb_probe, then the gigabit ethernet PLL
> would be disabled.  During this period of time, the system would hang
> up if we try to access GEMGXL control registers, it means that we
> can't access GEMGXL control registers before the gigabit ethernet PLL
> is resumed again. There are some cases, for example, if we execute the

Sounds familiar.

> 'ifconfig' command, it would eventually go to the macb_get_status to

Do you mean mac_get_stats()? macb_get_status() does not exist.

> access GEMGXL control registers and cause the system to hang up. Give
> more example here, if we execute 'ip link set lo up & ip addr add
> 127.0.0.1/8 dev lo', it would cause the system to hang up, because
> these commands would try to query the interfaces and eventually go to
> macb_get_status as well. However, if we can resume the gigabit
> ethernet PLL first, such as 'ip link set eth0 up' or 'udhcpc', then
> everything goes well. I'm trying to figure out if there are some hooks
> that we can check the PLL status in the macb driver before it actually
> touches the control registers. If anyone has an idea about that,
> please feel free to point it out to me, thanks.

And you cannot call pm_runtime_get_sync(), as this is called from
atomic contect. Other drivers avoid accessing the registers while
the device is not up, cfr. e.g. commit 7fa2955ff70ce453 ("sh_eth:
Fix sleeping function called from invalid context").

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2021-05-19 18:17 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09  9:49 [PATCH v7 0/5] clk: add driver for the SiFive FU740 Zong Li
2020-12-09  9:49 ` Zong Li
2020-12-09  9:49 ` [PATCH v7 1/5] clk: sifive: Extract prci core to common base Zong Li
2020-12-09  9:49   ` Zong Li
2020-12-16 20:21   ` Stephen Boyd
2020-12-16 20:21     ` Stephen Boyd
2020-12-09  9:49 ` [PATCH v7 2/5] clk: sifive: Use common name for prci configuration Zong Li
2020-12-09  9:49   ` Zong Li
2020-12-16 20:21   ` Stephen Boyd
2020-12-16 20:21     ` Stephen Boyd
2020-12-09  9:49 ` [PATCH v7 3/5] clk: sifive: Add a driver for the SiFive FU740 PRCI IP block Zong Li
2020-12-09  9:49   ` Zong Li
2020-12-16 20:21   ` Stephen Boyd
2020-12-16 20:21     ` Stephen Boyd
2020-12-09  9:49 ` [PATCH v7 4/5] clk: sifive: Fix the wrong bit field shift Zong Li
2020-12-09  9:49   ` Zong Li
2020-12-16 20:21   ` Stephen Boyd
2020-12-16 20:21     ` Stephen Boyd
2020-12-09  9:49 ` [PATCH v7 5/5] clk: sifive: Add clock enable and disable ops Zong Li
2020-12-09  9:49   ` Zong Li
2020-12-16 20:21   ` Stephen Boyd
2020-12-16 20:21     ` Stephen Boyd
2021-03-16 19:45 ` [PATCH v7 0/5] clk: add driver for the SiFive FU740 Andreas Schwab
2021-03-16 19:45   ` Andreas Schwab
2021-03-18  2:07   ` Zong Li
2021-03-18  2:07     ` Zong Li
2021-03-19  8:20     ` Zong Li
2021-03-19  8:20       ` Zong Li
2021-03-19  8:44       ` Yixun Lan
2021-03-19  8:44         ` Yixun Lan
2021-03-19  8:49       ` Andreas Schwab
2021-03-19  8:49         ` Andreas Schwab
2021-03-24 10:36         ` Andreas Schwab
2021-03-24 10:36           ` Andreas Schwab
2021-03-25  3:21           ` Zong Li
2021-03-25  3:21             ` Zong Li
2021-03-25  9:22             ` Andreas Schwab
2021-03-25  9:22               ` Andreas Schwab
2021-03-26  9:10               ` Zong Li
2021-03-26  9:10                 ` Zong Li
2021-03-26  9:23                 ` Andreas Schwab
2021-03-26  9:23                   ` Andreas Schwab
2021-03-29 10:18                   ` Zong Li
2021-03-29 10:18                     ` Zong Li
2021-03-29 10:37                     ` Andreas Schwab
2021-03-29 10:37                       ` Andreas Schwab
2021-03-31  8:11                       ` Zong Li
2021-03-31  8:11                         ` Zong Li
2021-04-12 11:31                         ` Andreas Schwab
2021-04-12 11:31                           ` Andreas Schwab
2021-04-14 14:13                           ` Zong Li
2021-04-14 14:13                             ` Zong Li
2021-05-11  8:53                             ` Yixun Lan
2021-05-11  8:53                               ` Yixun Lan
2021-05-19 15:53                               ` Zong Li
2021-05-19 15:53                                 ` Zong Li
2021-05-19 18:17                                 ` Geert Uytterhoeven [this message]
2021-05-19 18:17                                   ` Geert Uytterhoeven
2021-05-21 10:34                                   ` Zong Li
2021-05-21 10:34                                     ` Zong Li
2021-05-21 12:52                                     ` Zong Li
2021-05-21 12:52                                       ` Zong Li

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='CAMuHMdWGakAT1LKg_sje=ZYTbLX1_BjjOsqOYP9KrzhMmMi6Ag@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pragnesh.patel@openfive.com \
    --cc=sboyd@kernel.org \
    --cc=schwab@linux-m68k.org \
    --cc=yixun.lan@gmail.com \
    --cc=zong.li@sifive.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 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.