paulenuta
Posts: 29
Joined: Fri Oct 28, 2016 5:59 am
Location: Romania

Overlay for GPIO connected fan

Tue Sep 11, 2018 2:30 pm

Hi,
I want to have an overlay to control a fan connected to PI gpio12 (BCM) and turn it on/off depending on cpu temperature (on gpio18 I have a buzzer, both are connected to gpios via N-MOSFET 22N7002).
Similar to https://github.com/raspberrypi/linux/bl ... verlay.dts.

Starting from https://github.com/raspberrypi/linux/bl ... hermal.txt,
https://github.com/raspberrypi/linux/bl ... io-fan.txt and above dts file I have created 2 new dts file:
"gpio-fan.dts"

Code: Select all

/*
 * Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12.
 * sudo dtc -W no-unit_address_vs_reg [email protected] -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan.dts
 * nano /boot/config.txt , dtoverlay=gpio-fan
 * or 
 * sudo sed -i '25,/pwm-fan/s/pwm-fan/"gpio-fan/' /boot/config.txt 
 *
 */
/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2708";

	[email protected] {
		target-path = "/";
		__overlay__ {
			fan0: [email protected] {
				compatible = "gpio-fan";
				gpios = <&gpio 12 1>;
				gpio-fan,speed-map = <0 0 3000 1>;
				#cooling-cells = <2>;
				status = "okay";
			};
		};
	};

	[email protected] {
		target = <&cpu_thermal>;
		__overlay__ {
			trips {
				threshold: [email protected] {
					temperature = <45000>;
					hysteresis = <5000>;
					type = "active";
				};
				target: trip-poi[email protected] {
					temperature = <50000>;
					hysteresis = <2000>;
					type = "active";
				};
				cpu_hot: [email protected] {
					temperature = <55000>;
					hysteresis = <2000>;
					type = "active";
				};
			};
			cooling-maps {
				map0 {
					trip = <&threshold>;
					cooling-device = <&fan0 0 1>;
				};
				map1 {
					trip = <&target>;
					cooling-device = <&fan0 1 1>;
				};
				map2 {
					trip = <&cpu_hot>;
					cooling-device = <&fan0 1 1>;
				};
			};
		};
	};
};
and
"pwm-fan.dts"

Code: Select all

/*
 * Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12.
 * sudo dtc -W no-unit_address_vs_reg [email protected] -I dts -O dtb -o /boot/overlays/pwm-fan.dtbo pwm-fan.dts
 * nano /boot/config.txt , dtoverlay=pwm-fan
 * or
 * sudo sed -i '25,/gpio-fan/s/gpio-fan/pwm-fan/' /boot/config.txt 
 */
/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2708";

	[email protected] {
		target = <&gpio>;
		__overlay__ {
			fan0: pwm-fan {
				compatible = "pwm-fan";
				cooling-min-state = <0>;
				cooling-max-state = <3>;
				#cooling-cells = <2>;
				pwms = <&pwm 0 10000 0>;
				cooling-levels = <0 255 255 255>;
			};
		};
	};

	[email protected] {
		target = <&cpu_thermal>;
		__overlay__ {
			trips {
				threshold: [email protected] {
					temperature = <44000>;
					hysteresis = <5000>;
					type = "active";
				};
				target: [email protected] {
					temperature = <50000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu_hot: [email protected] {
					temperature = <55000>;
					hysteresis = <2000>;
					type = "active";
				};
			};
			cooling-maps {
				map0 {
					trip = <&threshold>;
					cooling-device = <&fan0 0 1>;
				};
				map1 {
					trip = <&target>;
					cooling-device = <&fan0 1 2>;
				};
				map2 {
					trip = <&cpu_hot>;
					cooling-device = <&fan0 1 3>;
				};
			};
		};
	};
};
add to the /boot/config.txt as "dtoverlay=gpio-fan" or "dtoverlay=pwm-fan" (not at same time), run a stress test but without any physical result (eq. fan rotating).

Please advise what am I doing wrong.

Thank you,
Paul

EDIT: config.txt

Code: Select all

[email protected]:/home/pi# cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Enable PI_OS LivePIN
dtoverlay=gpio-poweroff,gpiopin=27,active_low

# Enable MCP74912 RTC
dtoverlay=i2c-rtc,mcp7941x

# ttySC2, ttySC3
dtoverlay=sc16is752-i2c-02
# ttySC0, ttySC1
dtoverlay=sc16is752-i2c-01

# Enable SPI TPM
dtoverlay=letstrust-tpm

# Enable PI UART
enable_uart=1

# Enable GPIO12 Fan
dtoverlay=gpio-fan
#dtoverlay=pwm,pin=12,func=4
#using "dtoverlay=pwm,pin=12,func=4" and sysfs commands fan is working properly.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1814
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Overlay for GPIO connected fan

Tue Sep 11, 2018 2:55 pm

Neither of those fan drivers is enabled by default in the RPi kernel configurations. You will need to add CONFIG_SENSORS_GPIO_FAN=m and CONFIG_SENSORS_PWM_FAN=m. Once you've built a kernel with those modules, start with the gpio-fan overlay and watch for changes on GPIO12.

paulenuta
Posts: 29
Joined: Fri Oct 28, 2016 5:59 am
Location: Romania

Re: Overlay for GPIO connected fan

Tue Sep 11, 2018 5:46 pm

That's a bad news, I broked my Ubuntu kernel cross-building machine on Saturday...
I need put back online now.

paulenuta
Posts: 29
Joined: Fri Oct 28, 2016 5:59 am
Location: Romania

Re: Overlay for GPIO connected fan

Thu Sep 13, 2018 8:47 am

Hi Phil,

I've made the kernel with gpio-fan module activated and bellow overlay on which I want to have the fan started at 55C and stopped at 45C, but it stops at 50C? Can I achieve this, or the hysteresis doesn't work this way?

Thanks a lot,
Paul

Code: Select all

/*
 * Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12.
 * Optional parameter "gpiopin=12"
 * Requires: 
 *	- kernel configurations: CONFIG_SENSORS_GPIO_FAN=m and CONFIG_SENSORS_PWM_FAN=m; 
 *	- kernel rebuid;
 *	- DC Fan connected to GPIO via a N-MOSFET (2N7002)
 *
 *                   ┌─────────────────────┐
 *                   │Fan negative terminal│
 *                   └┬────────────────────┘
 *                    │
 *                 │──┘
 * [GPIO12]──────┤ │<─┐  2N7002
 *                 │──┤
 *                    │
 *                   ─┴─
 *                   GND
 *
 * sudo dtc -W no-unit_address_vs_reg [email protected] -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan.dts
 * sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12"
 * or 
 * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan\n' >> /boot/config.txt"
 * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan,gpiopin=12\n' >> /boot/config.txt"
 *
 */
/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2708";

	[email protected] {
		target-path = "/";
		__overlay__ {
			fan0: [email protected] {
				compatible = "gpio-fan";
				gpios = <&gpio 12 1>;
				gpio-fan,speed-map = <0 0 5000 1>;
				#cooling-cells = <2>;
				status = "okay";
			};
		};
	};

	[email protected] {
		target = <&cpu_thermal>;
		polling-delay = <1000>;	/* milliseconds */
		__overlay__ {
			trips {
				target: [email protected] {
					temperature = <55000>;	/* (millicelsius) Fan started at 55°C */
					hysteresis = <10000>;	/* (millicelsius) Fan stopped at 45°C? */
					type = "active";
				};
			};
			cooling-maps {
				map0 {
					trip = <&target>;
					cooling-device = <&fan0 1 1>;
				};
			};
		};
	};
	__overrides__ {
		gpiopin =       <&fan0>,"gpios:4",
				<&fan0>,"brcm,pins:0";
	};
};

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1814
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Overlay for GPIO connected fan

Thu Sep 13, 2018 9:14 am

You've reached the limits of my knowledge in this area, but there are a few things I would try:

1) See what effect changing the cooling-device declaration to "<&fan 0 1>" has.
2) Move the trip point and see if the 50C off point moves accordingly.
3) Change the hysteresis and see if the 50C off point moves accordingly.

paulenuta
Posts: 29
Joined: Fri Oct 28, 2016 5:59 am
Location: Romania

Re: Overlay for GPIO connected fan

Thu Sep 13, 2018 10:23 am

I only got maximum 5C hysteresis but I would say it is 3C, the difference is from the fan inertial (& my eyes :)).
Maybe someone else can have a better understanding of the usage and scale of the hysteresis
https://github.com/raspberrypi/linux/bl ... al.txt#L92

Code: Select all

- hysteresis:		A low hysteresis value on temperature property (above).
  Type: unsigned	This is a relative value, in millicelsius.
  Size: one cell
Paul

Code: Select all

/*
 * Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12.
 * Optional parameter "gpiopin=12"
 * Requires: 
 *	- kernel configurations: CONFIG_SENSORS_GPIO_FAN=m and CONFIG_SENSORS_PWM_FAN=m; 
 *	- kernel rebuild;
 *	- DC Fan connected to GPIO via a N-MOSFET (2N7002)
 *
 *                   ┌─────────────────────┐
 *                   │Fan negative terminal│
 *                   └┬────────────────────┘
 *                    │
 *                 │──┘
 * [GPIO12]──────┤ │<─┐  2N7002
 *                 │──┤
 *                    │
 *                   ─┴─
 *                   GND
 *
 * sudo dtc -W no-unit_address_vs_reg [email protected] -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan.dts
 * sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12"
 * or 
 * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan\n' >> /boot/config.txt"
 * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan,gpiopin=12\n' >> /boot/config.txt"
 *
 */
/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2708";

	[email protected] {
		target-path = "/";
		__overlay__ {
			fan0: [email protected] {
				compatible = "gpio-fan";
				gpios = <&gpio 12 1>;
				gpio-fan,speed-map = <0    0>,
									 <5000 1>;
				#cooling-cells = <2>;
				status = "okay";
			};
		};
	};

	[email protected] {
		target = <&cpu_thermal>;
		polling-delay = <1000>;	/* milliseconds */
		__overlay__ {
			trips {
				target: [email protected] {
					temperature = <55000>;	/* (millicelsius) Fan started at 55°C */
					hysteresis = <5000>;	/* (millicelsius) Fan stopped at 50°C */
					type = "active";
				};
			};
			cooling-maps {
				map0 {
					trip = <&target>;
					cooling-device = <&fan0 1 1>;
				};
			};
		};
	};
	__overrides__ {
		gpiopin =       <&fan0>,"gpios:4",
				<&fan0>,"brcm,pins:0";
	};
};

paulenuta
Posts: 29
Joined: Fri Oct 28, 2016 5:59 am
Location: Romania

Re: Overlay for GPIO connected fan

Thu Sep 13, 2018 12:38 pm

I also added configuration parameter for temperature, input is in millicelsius 45C = 45000.

Code: Select all

/*
 * Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12.
 * Optional parameters:
 *	- "gpiopin"	- default GPIO12
 * 	- "temp"	- default 55000
 * Requires: 
 *	- kernel configurations: CONFIG_SENSORS_GPIO_FAN=m and CONFIG_SENSORS_PWM_FAN=m; 
 *	- kernel rebuid;
 *	- DC Fan connected to GPIO via a N-MOSFET (2N7002)
 *
 *                   ┌─────────────────────┐
 *                   │Fan negative terminal│
 *                   └┬────────────────────┘
 *                    │
 *                 │──┘
 * [GPIO12]──────┤ │<─┐  2N7002
 *                 │──┤
 *                    │
 *                   ─┴─
 *                   GND
 *
 * sudo dtc -W no-unit_address_vs_reg [email protected] -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan.dts
 * sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000"
 * or 
 * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan\n' >> /boot/config.txt"
 * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan,gpiopin=12\n' >> /boot/config.txt"
 *
 */
/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2708";

	[email protected] {
		target-path = "/";
		__overlay__ {
			fan0: [email protected] {
				compatible = "gpio-fan";
				gpios = <&gpio 12 1>;
				gpio-fan,speed-map = <0    0>,
									 <5000 1>;
				#cooling-cells = <2>;
			};
		};
	};

	[email protected] {
		target = <&cpu_thermal>;
		polling-delay = <2000>;	/* milliseconds */
		__overlay__ {
			trips {
				cpu_hot: [email protected] {
					temperature = <55000>;	/* (millicelsius) Fan started at 55°C */
					hysteresis = <5000>;	/* (millicelsius) Fan stopped at 50°C */
					type = "active";
				};
			};
			cooling-maps {
				map0 {
					trip = <&cpu_hot>;
					cooling-device = <&fan0 1 1>;
				};
			};
		};
	};
	__overrides__ {
		gpiopin = <&fan0>,"gpios:4", <&fan0>,"brcm,pins:0";
		temp = <&cpu_hot>,"temperature:0";
	};
};

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1814
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Overlay for GPIO connected fan

Thu Sep 13, 2018 12:40 pm

Nice!

paulenuta
Posts: 29
Joined: Fri Oct 28, 2016 5:59 am
Location: Romania

Re: Overlay for GPIO connected fan

Thu Sep 13, 2018 1:52 pm

I don't know if they are related, but now my "gpio-poweroff" is not working properly every time, meaning it doesn't change the state at pi poweroff/shutdown (sometimes).
I wonder is it the "gpio-fan" or the builded kernel "Linux 4.14.69-v7+"

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1814
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Overlay for GPIO connected fan

Thu Sep 13, 2018 1:57 pm

There are reports of reboot problems in 4.14.67 (and later) - see https://github.com/Hexxeh/rpi-firmware/issues/186.

paulenuta
Posts: 29
Joined: Fri Oct 28, 2016 5:59 am
Location: Romania

Re: Overlay for GPIO connected fan

Thu Sep 13, 2018 2:07 pm

I mostly do poweroff's, aka:

Code: Select all

#!/bin/bash
while true
   do
      bt=`i2cget -y 1 0x10`
      if [ $bt == "0x01" ]; then /home/pi/beep && sudo poweroff;  fi
      sleep 2
   done
and I have an official rpi-display attached which goes blank and looks like a normal shutdown, but after some cycles GPIO27 doesn't change his state anymore.

paulenuta
Posts: 29
Joined: Fri Oct 28, 2016 5:59 am
Location: Romania

Re: Overlay for GPIO connected fan

Fri Sep 14, 2018 6:49 am

Hi Phil,
how do i clone the 4.14.62 kernel version from https://github.com/raspberrypi/linux?

Thanks,
Paul

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1814
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Overlay for GPIO connected fan

Fri Sep 14, 2018 8:12 am

Finding the commits in an rpi- branch for a particular kernel version is a bit tricky because of the way the upstream commits are merged into our tree, but it can be done. It's easiest if you stick to versions that correspond to merge points - sometimes a few versions are merged at once.

"git log --oneline --graph" gives a semi-intelligible history. This is how it looks run today on rpi-4.14.y:

Code: Select all

*   27e84c6 Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
|\  
| * 7fe7a0f Linux 4.14.69
| * 29245d3 arm64: mm: always enable CONFIG_HOLES_IN_ZONE
| * 3098933 fs/quota: Fix spectre gadget in do_quotactl
| * 0682e02 crypto: caam/qi - fix error path in xts setkey
| * ccb38942 crypto: caam/jr - fix descriptor DMA unmapping
| * be6f98b crypto: caam - fix DMA mapping direction for RSA forms 2 & 3
| * 9f830cf crypto: vmx - Fix sleep-in-atomic bugs
27e84c6 is a downstream commit merging in some upstream changes, which follow it. If you go down a bit further you'll find the next merge:

Code: Select all

| * 4a22629 net: mac802154: tx: expand tailroom if necessary
| * 54c0fa8 net: 6lowpan: fix reserved space for single frames
* |   8c8666f Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
|\ \  
| |/  
| * ee13f7e Linux 4.14.68
| * 77d1658 gcc-plugins: Use dynamic initializers
| * 616d41d gcc-plugins: Add include required by GCC release 8
What we want to do is find the point where Linux 4.14.62 is merged in. It may be bundled in with more recent versions, but in this case it isn't. The "--graph" order makes it slightly easier to see the merges, and it also groups together commits that were merged in, rather than interleaving them with the main branch in the order they were committed.

You can force the same viewing order in the non-graphical version using the "--topo-order" flag. Combining this with a suitable "grep" command shows the major decision points:

Code: Select all

$ git log --oneline --topo-order | grep -1 rpi-4.14.y
27e84c6 Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
7fe7a0f Linux 4.14.69
--
54c0fa8 net: 6lowpan: fix reserved space for single frames
8c8666f Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
ee13f7e Linux 4.14.68
--
0f937c8 PoE HAT driver cleanup
55de35d Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
f4c8845 Linux 4.14.67
--
c90694c dtoverlays: Add support for ADV7280-M, ADV7281-M and ADV7281-MA chips.
ceeaae1 Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
c5f7d3c Linux 4.14.66
--
7f80068 staging: bcm2835-camera: Skip ISP pass to eliminate padding.
1f89ad7 Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
1aa1166 Linux 4.14.62
--
bf844d6 End log messages in one newline, not two.
52d350f Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
2ae6c04 Linux 4.14.61
...
This shows that 1f89ad7 is the merge point for 4.14.62, and that may be exactly what you want, but you may prefer to pick up all downstream commits before the next version was merged in case they include fixes or workarounds for new issues. For this you want the ancestor of the previous merge commit (ceeaae1^):

Code: Select all

$ git log --oneline --topo-order ceeaae1^
23bf198 Revert "Revert "softirq: Let ksoftirqd do its job""
00f0e83 Revert "mm: alloc_contig: re-allow CMA to compact FS pages"
786d721 staging: bcm2835-camera: Ensure timestamps never go backwards.
...
ad111b4 staging: bcm2835-camera: Match MMAL buffer count to V4L2.
ace65e2 staging: bcm2835-camera: Remove bulk_mutex as it is not required
e4fb34e staging: bcm2835-camera: Allocate context once per buffer
7f80068 staging: bcm2835-camera: Skip ISP pass to eliminate padding.
1f89ad7 Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
1aa1166 Linux 4.14.62
7d29fb5 jfs: Fix inconsistency between memory allocation and ea_buf->max_size
59f35b9 xfs: don't call xfs_da_shrink_inode with NULL bp
Once you've satisfied yourself that ceeaae1^ (a.k.a. 23bf198) is the correct commit, you can checkout a new branch to point to that commit with:

Code: Select all

$ git checkout -b my_4.14.62 ceeaae1^
In preparing this answer I discovered another useful option - "--first-parent" - that filters out all of the commits that are merged in, just showing the downstream commits and merge points (which can be useful to double-check your choice of commit):

Code: Select all

$ git log --oneline --first-parent rpi-4.14.y
27e84c6 Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
8c8666f Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
3dc96a2 qmi_wwan: apply SET_DTR quirk to the SIMCOM shared device ID
8fd26c5 ASoC: cs4265: SOC_SINGLE register value error fix
bfe25d6 ASoC: cs4265: Add native 32bit I2S transport
e8e23d9 ASoC: cs4265: Add a S/PDIF enable switch
0f937c8 PoE HAT driver cleanup
55de35d Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
0ae646c Add support for audioinjector.net ultra soundcard. (#2664)
f6da082 bcm2835: interpolate audio delay
c90694c dtoverlays: Add support for ADV7280-M, ADV7281-M and ADV7281-MA chips.
ceeaae1 Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
23bf198 Revert "Revert "softirq: Let ksoftirqd do its job""
00f0e83 Revert "mm: alloc_contig: re-allow CMA to compact FS pages"
786d721 staging: bcm2835-camera: Ensure timestamps never go backwards.
...

paulenuta
Posts: 29
Joined: Fri Oct 28, 2016 5:59 am
Location: Romania

Re: Overlay for GPIO connected fan

Mon Sep 17, 2018 8:14 am

Thanks a lot Phil!

I manage to build my custom configured kernel version 4.14.62-v7+, do some tests, and I can confirm that it was the same issue as you referenced before.

Conclusion:
I run more than 28 PowerON-PowerOFF cycles on both "standard 4.14.62-v7+" and "custom 4.14.62-v7+" (spi_tpm & gpio_fan activated) and every cycle was conform (no gpio-poweroff or reboot issues).

I can also confirm that on "4.14.69-v7+" both poweroff and reboot were randomly end with fault.

So "gpio-fan.dts" is working fine,

Could'it be possible to add it to the https://github.com/raspberrypi/firmware/?

Paul

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1814
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Overlay for GPIO connected fan

Tue Sep 18, 2018 10:19 am

I think I've found the problematic commit that is causing crashes since rpi-4.14.63, but it needs some more soak testing before I push the reversion. If you want you can try reverting f6ec33f ("Bluetooth: hci_ldisc: Allow sleeping while proto locks are held.") yourself and seeing if the reboot crashes go away.

The gpio-fan overlay (and the gpio-fan module) will be in the next firmware release.

Return to “Device Tree”

Who is online

Users browsing this forum: No registered users and 5 guests