Comments (6)
You can add printk in code,but why do you want eth and switch driver as module? Device is useless when you have no real rootfs (initrd).
Else you should report this on kernel mailinglist...at least if 6.3-rc1 (without additional patches) is affected too
from bpi-router-linux.
I want to build debian-style all-modules kernel image for several different devices. I run debian installed to emmc so having drivers in modules is not a problem.
from bpi-router-linux.
I have found the root cause of the issue. Clock gates in ethsys can't be enabled, once they have been disabled and mtk_eth doesn't work. I've sent a mail describing problem to linux-mediatek. Not sure if it have reached the list yet, as I can't subscribe to it.
For now I use the following patch locally to prevent kernel from disabling the clocks:
diff --git a/drivers/clk/mediatek/clk-mt7986-eth.c b/drivers/clk/mediatek/clk-mt7986-eth.c
index 703872239ecc..a368426eddd7 100644
--- a/drivers/clk/mediatek/clk-mt7986-eth.c
+++ b/drivers/clk/mediatek/clk-mt7986-eth.c
@@ -62,19 +62,20 @@ static const struct mtk_gate_regs eth_cg_regs = {
.sta_ofs = 0x30,
};
-#define GATE_ETH(_id, _name, _parent, _shift) \
+#define GATE_ETH(_id, _name, _parent, _shift, _flags) \
{ \
.id = _id, .name = _name, .parent_name = _parent, \
.regs = ð_cg_regs, .shift = _shift, \
.ops = &mtk_clk_gate_ops_no_setclr_inv, \
+ .flags = _flags, \
}
static const struct mtk_gate eth_clks[] __initconst = {
- GATE_ETH(CLK_ETH_FE_EN, "eth_fe_en", "netsys_2x_sel", 6),
- GATE_ETH(CLK_ETH_GP2_EN, "eth_gp2_en", "sgm_325m_sel", 7),
- GATE_ETH(CLK_ETH_GP1_EN, "eth_gp1_en", "sgm_325m_sel", 8),
- GATE_ETH(CLK_ETH_WOCPU1_EN, "eth_wocpu1_en", "netsys_mcu_sel", 14),
- GATE_ETH(CLK_ETH_WOCPU0_EN, "eth_wocpu0_en", "netsys_mcu_sel", 15),
+ GATE_ETH(CLK_ETH_FE_EN, "eth_fe_en", "netsys_2x_sel", 6, CLK_IS_CRITICAL),
+ GATE_ETH(CLK_ETH_GP2_EN, "eth_gp2_en", "sgm_325m_sel", 7, CLK_IS_CRITICAL),
+ GATE_ETH(CLK_ETH_GP1_EN, "eth_gp1_en", "sgm_325m_sel", 8, CLK_IS_CRITICAL),
+ GATE_ETH(CLK_ETH_WOCPU1_EN, "eth_wocpu1_en", "netsys_mcu_sel", 14, CLK_IS_CRITICAL),
+ GATE_ETH(CLK_ETH_WOCPU0_EN, "eth_wocpu0_en", "netsys_mcu_sel", 15, CLK_IS_CRITICAL),
};
static void __init mtk_sgmiisys_0_init(struct device_node *node)
Not sure if it is correct way though as I don't have hardware documentation.
from bpi-router-linux.
thx, but please send this to linux kernel mailinglist (scripts/get_maintainer.pl drivers/clk/mediatek/clk-mt7986-eth.c) and let discussion begin :)
from bpi-router-linux.
@ejka have you send patch to mailing-list? looks like this is really a mt7986-only problem, so i guess you found the right solution
code seems to be different now, so i cannot apply the patch on 6.6-rc1, params for GATE_ETH are passed to external macro GATE_MTK...maybe we can set clocks to critical in another way
maybe we can use GATE_MTK_FLAGS instead of GATE_MTK defined both in drivers/clk/mediatek/clk-gate.h
as you use critical for all clocks we can set this in macro...have you tried with only some of them defined critical?
something like this:
diff --git a/drivers/clk/mediatek/clk-mt7986-eth.c b/drivers/clk/mediatek/clk-mt7986-eth.c
index 7ab78e0f49a1..bcb90e78fb26 100644
--- a/drivers/clk/mediatek/clk-mt7986-eth.c
+++ b/drivers/clk/mediatek/clk-mt7986-eth.c
@@ -53,7 +53,7 @@ static const struct mtk_gate_regs eth_cg_regs = {
};
#define GATE_ETH(_id, _name, _parent, _shift) \
- GATE_MTK(_id, _name, _parent, ð_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
+ GATE_MTK_FLAGS(_id, _name, _parent, ð_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv, CLK_IS_CRITICAL)
static const struct mtk_gate eth_clks[] = {
GATE_ETH(CLK_ETH_FE_EN, "eth_fe_en", "netsys_2x_sel", 6),
from bpi-router-linux.
Ah, if this is due to clocks being disabled after boot, there is a boot param to stop them being disabled. One can use the boot param until the driver supports enabling the clock it needs. So, I don't think one really needs to add critical to them.
Boot param is “clk_ignore_unused”.
from bpi-router-linux.
Related Issues (20)
- bpi-r3 branch 6.3-rc missing SFP support / transmit queue timeout HOT 38
- BPI-r3 expose pps HOT 8
- adding CONFIG_NTP_PPS module not 6.2-main brach HOT 1
- build.sh Deb Pack Gen debarch if statement backwards HOT 2
- Wireguard support BPI-R3 HOT 2
- WiFi doesn't work on kernel 5.15 HOT 9
- bpi-r2, kernel 5.15.129 - compilation errors (mediatek) - arm-linux-gnueabihf-gcc (Debian 13.2.0-2) HOT 4
- [bpi-r2pro/linux 6.1] how to populate spi devices in /dev HOT 1
- bpi-r3 will it be able to support armbian? HOT 1
- i2c rtcs HOT 2
- [BPI-R3][Kernel 6.1] LVM issue HOT 2
- BPI-R3 Mini HOT 8
- 6.9-rc kernel wifi not working - here is the fix HOT 5
- SFP interface does not work on you 6.9-rc branch HOT 36
- Wifi advanced features do not work on your 6.9-rc HOT 4
- [BPI-R4] File missing: ./arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso etc. HOT 2
- mt7615 wifi doesn't work properly on kernel 5.15 HOT 2
- arm64 linux-headers-6.6.25-bpi-r3-main package ships with x86-64 files HOT 5
- Buidl Fail , dt-bindings not found HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bpi-router-linux.