@@ -125,7 +125,7 @@ static int create_cpu_loop(int cpu){intchip=cpu/2;intcore=cpu&1;-structsmu_sdbp_header*hdr;+structsmu_sdbp_header*hdr,*hdr2;structsmu_sdbp_cpupiddata*piddata;structwf_cpu_pid_parampid;structwf_control*main_fan=cpu_fans[0];
@@ -141,9 +141,9 @@ static int create_cpu_loop(int cpu)piddata=(structsmu_sdbp_cpupiddata*)&hdr[1];/* Get FVT params to get Tmax; if not found, assume default */-hdr=smu_sat_get_sdb_partition(chip,0xC4+core,NULL);-if(hdr){-structsmu_sdbp_fvt*fvt=(structsmu_sdbp_fvt*)&hdr[1];+hdr2=smu_sat_get_sdb_partition(chip,0xC4+core,NULL);+if(hdr2){+structsmu_sdbp_fvt*fvt=(structsmu_sdbp_fvt*)&hdr2[1];tmax=fvt->maxtemp<<16;}elsetmax=95<<16;/* default to 95 degrees C */
@@ -174,6 +174,10 @@ static int create_cpu_loop(int cpu)pid.min=fmin;wf_cpu_pid_init(&cpu_pid[cpu],&pid);++kfree(hdr);+kfree(hdr2);+return0;}
@@ -125,7 +125,7 @@ static int create_cpu_loop(int cpu){intchip=cpu/2;intcore=cpu&1;-structsmu_sdbp_header*hdr;+structsmu_sdbp_header*hdr,*hdr2;structsmu_sdbp_cpupiddata*piddata;structwf_cpu_pid_parampid;structwf_control*main_fan=cpu_fans[0];
@@ -141,9 +141,9 @@ static int create_cpu_loop(int cpu)piddata=(structsmu_sdbp_cpupiddata*)&hdr[1];/* Get FVT params to get Tmax; if not found, assume default */-hdr=smu_sat_get_sdb_partition(chip,0xC4+core,NULL);-if(hdr){-structsmu_sdbp_fvt*fvt=(structsmu_sdbp_fvt*)&hdr[1];+hdr2=smu_sat_get_sdb_partition(chip,0xC4+core,NULL);+if(hdr2){+structsmu_sdbp_fvt*fvt=(structsmu_sdbp_fvt*)&hdr2[1];tmax=fvt->maxtemp<<16;}elsetmax=95<<16;/* default to 95 degrees C */
@@ -174,6 +174,10 @@ static int create_cpu_loop(int cpu)pid.min=fmin;wf_cpu_pid_init(&cpu_pid[cpu],&pid);++kfree(hdr);+kfree(hdr2);+return0;}
--
You are receiving this mail because:
You are watching the assignee of the bug.
--- Comment #4 from Erhard F. (erhard_f@mailbox.org) ---
(In reply to mpe from comment #3)
Can you try this patch?
Applied your patch on top of 5.6-rc4 +
https://patchwork.ozlabs.org/patch/1248350/ and let the G5 do a few hours
compiling.
Only getting those nice memleaks from bug #206203 but no windfarm_pm112 memleak
any longer. So your patch works well it seems. Thanks!
--
You are receiving this mail because:
You are watching the assignee of the bug.
--- Comment #4 from Erhard F. (erhard_f@mailbox.org) ---
(In reply to mpe from comment #3)
quoted
Can you try this patch?
Applied your patch on top of 5.6-rc4 +
https://patchwork.ozlabs.org/patch/1248350/ and let the G5 do a few hours
compiling.
Only getting those nice memleaks from bug #206203 but no windfarm_pm112 memleak
any longer. So your patch works well it seems. Thanks!
Thanks.
Can you try this one instead, it changes the order of operations to make
the code flow a bit nicer.
cheers
@@ -132,14 +132,6 @@ static int create_cpu_loop(int cpu)s32tmax;intfmin;-/* Get PID params from the appropriate SAT */-hdr=smu_sat_get_sdb_partition(chip,0xC8+core,NULL);-if(hdr==NULL){-printk(KERN_WARNING"windfarm: can't get CPU PID fan config\n");-return-EINVAL;-}-piddata=(structsmu_sdbp_cpupiddata*)&hdr[1];-/* Get FVT params to get Tmax; if not found, assume default */hdr=smu_sat_get_sdb_partition(chip,0xC4+core,NULL);if(hdr){
@@ -152,6 +144,16 @@ static int create_cpu_loop(int cpu)if(tmax<cpu_all_tmax)cpu_all_tmax=tmax;+kfree(hdr);++/* Get PID params from the appropriate SAT */+hdr=smu_sat_get_sdb_partition(chip,0xC8+core,NULL);+if(hdr==NULL){+printk(KERN_WARNING"windfarm: can't get CPU PID fan config\n");+return-EINVAL;+}+piddata=(structsmu_sdbp_cpupiddata*)&hdr[1];+/**Darwinhasaminimumfanspeedof1000rpmforthe4-wayand*515forthe2-way.Thatappearstobeoverkill,sofornow,
@@ -174,6 +176,9 @@ static int create_cpu_loop(int cpu)pid.min=fmin;wf_cpu_pid_init(&cpu_pid[cpu],&pid);++kfree(hdr);+return0;}
--- Comment #4 from Erhard F. (erhard_f@mailbox.org) ---
(In reply to mpe from comment #3)
quoted
Can you try this patch?
Applied your patch on top of 5.6-rc4 +
https://patchwork.ozlabs.org/patch/1248350/ and let the G5 do a few hours
compiling.
Only getting those nice memleaks from bug #206203 but no windfarm_pm112
memleak
any longer. So your patch works well it seems. Thanks!
Thanks.
Can you try this one instead, it changes the order of operations to make
the code flow a bit nicer.
cheers
diff --git a/drivers/macintosh/windfarm_pm112.c
b/drivers/macintosh/windfarm_pm112.c
index 4150301a89a5..e8377ce0a95a 100644
@@ -132,14 +132,6 @@ static int create_cpu_loop(int cpu)s32tmax;intfmin;-/* Get PID params from the appropriate SAT */-hdr=smu_sat_get_sdb_partition(chip,0xC8+core,NULL);-if(hdr==NULL){-printk(KERN_WARNING"windfarm: can't get CPU PID fan config\n");-return-EINVAL;-}-piddata=(structsmu_sdbp_cpupiddata*)&hdr[1];-/* Get FVT params to get Tmax; if not found, assume default */hdr=smu_sat_get_sdb_partition(chip,0xC4+core,NULL);if(hdr){
@@ -152,6 +144,16 @@ static int create_cpu_loop(int cpu)if(tmax<cpu_all_tmax)cpu_all_tmax=tmax;+kfree(hdr);++/* Get PID params from the appropriate SAT */+hdr=smu_sat_get_sdb_partition(chip,0xC8+core,NULL);+if(hdr==NULL){+printk(KERN_WARNING"windfarm: can't get CPU PID fan config\n");+return-EINVAL;+}+piddata=(structsmu_sdbp_cpupiddata*)&hdr[1];+/**Darwinhasaminimumfanspeedof1000rpmforthe4-wayand*515forthe2-way.Thatappearstobeoverkill,sofornow,
@@ -174,6 +176,9 @@ static int create_cpu_loop(int cpu)pid.min=fmin;wf_cpu_pid_init(&cpu_pid[cpu],&pid);++kfree(hdr);+return0;}
--
You are receiving this mail because:
You are watching the assignee of the bug.
https://bugzilla.kernel.org/show_bug.cgi?id=206695
Michael Ellerman (michael@ellerman.id.au) changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |michael@ellerman.id.au
--
You are receiving this mail because:
You are watching the assignee of the bug.
https://bugzilla.kernel.org/show_bug.cgi?id=206695
Dennis Clarke (dclarke@blastwave.org) changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dclarke@blastwave.org
--- Comment #8 from Dennis Clarke (dclarke@blastwave.org) ---
123456789+123456789+123456789+123456789+123456789+123456789+123456789+
I will apply the patch and try with Linux 5.7-rc2 and post any results
seen.
Also this does close off : https://bugzilla.kernel.org/show_bug.cgi?id=199471
I see Wolfram Sang has commented there. OKay ... good stuff.
Dennis Clarke
--
You are receiving this mail because:
You are watching the assignee of the bug.
--- Comment #9 from Dennis Clarke (dclarke@blastwave.org) ---
I see this has not gone upstream to 5.7-rc3 and thus I am applying
it manually and building now.
Shall report on the kmem leak shortly. I hope.
Dennis
--
You are receiving this mail because:
You are watching the assignee of the bug.