forked from openbmc/openbmc
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openbmc#101 from eddiejames/OP940
kernel: Revert to 5.3.1 and add PSU driver fix
- Loading branch information
Showing
4 changed files
with
139 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
...recipes-kernel/linux/linux-aspeed/0001-hwmon-pmbus-ibm-cffps-Fix-LED-blink-behavior.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
From 0c7358da0edb842314a795a791dfc7fb880c2caa Mon Sep 17 00:00:00 2001 | ||
From: Eddie James <eajames@linux.ibm.com> | ||
Date: Wed, 6 Nov 2019 14:01:06 -0600 | ||
Subject: [PATCH 1/2] hwmon: (pmbus/ibm-cffps) Fix LED blink behavior | ||
|
||
The LED blink_set function incorrectly did not tell the PSU LED to blink | ||
if brightness was LED_OFF. Fix this, and also correct the LED_OFF | ||
command data, which should give control of the LED back to the PSU | ||
firmware. Also prevent I2C failures from getting the driver LED state | ||
out of sync and add some dev_dbg statements. | ||
|
||
OpenBMC-Staging-Count: 1 | ||
Signed-off-by: Eddie James <eajames@linux.ibm.com> | ||
Link: https://lore.kernel.org/r/20191106200106.29519-3-eajames@linux.ibm.com | ||
Fixes: ef9e1cdf419a3 ("hwmon: (pmbus/cffps) Add led class device for power supply fault led") | ||
Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
Signed-off-by: Joel Stanley <joel@jms.id.au> | ||
--- | ||
drivers/hwmon/pmbus/ibm-cffps.c | 27 +++++++++++++++++++-------- | ||
1 file changed, 19 insertions(+), 8 deletions(-) | ||
|
||
diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c | ||
index d44745e498e7..54563851ce86 100644 | ||
--- a/drivers/hwmon/pmbus/ibm-cffps.c | ||
+++ b/drivers/hwmon/pmbus/ibm-cffps.c | ||
@@ -39,9 +39,13 @@ | ||
#define CFFPS_MFR_VAUX_FAULT BIT(6) | ||
#define CFFPS_MFR_CURRENT_SHARE_WARNING BIT(7) | ||
|
||
+/* | ||
+ * LED off state actually relinquishes LED control to PSU firmware, so it can | ||
+ * turn on the LED for faults. | ||
+ */ | ||
+#define CFFPS_LED_OFF 0 | ||
#define CFFPS_LED_BLINK BIT(0) | ||
#define CFFPS_LED_ON BIT(1) | ||
-#define CFFPS_LED_OFF BIT(2) | ||
#define CFFPS_BLINK_RATE_MS 250 | ||
|
||
enum { | ||
@@ -296,23 +300,31 @@ static void ibm_cffps_led_brightness_set(struct led_classdev *led_cdev, | ||
enum led_brightness brightness) | ||
{ | ||
int rc; | ||
+ u8 next_led_state; | ||
struct ibm_cffps *psu = container_of(led_cdev, struct ibm_cffps, led); | ||
|
||
if (brightness == LED_OFF) { | ||
- psu->led_state = CFFPS_LED_OFF; | ||
+ next_led_state = CFFPS_LED_OFF; | ||
} else { | ||
brightness = LED_FULL; | ||
+ | ||
if (psu->led_state != CFFPS_LED_BLINK) | ||
- psu->led_state = CFFPS_LED_ON; | ||
+ next_led_state = CFFPS_LED_ON; | ||
+ else | ||
+ next_led_state = CFFPS_LED_BLINK; | ||
} | ||
|
||
+ dev_dbg(&psu->client->dev, "LED brightness set: %d. Command: %d.\n", | ||
+ brightness, next_led_state); | ||
+ | ||
pmbus_set_page(psu->client, 0); | ||
|
||
rc = i2c_smbus_write_byte_data(psu->client, CFFPS_SYS_CONFIG_CMD, | ||
- psu->led_state); | ||
+ next_led_state); | ||
if (rc < 0) | ||
return; | ||
|
||
+ psu->led_state = next_led_state; | ||
led_cdev->brightness = brightness; | ||
} | ||
|
||
@@ -323,10 +335,7 @@ static int ibm_cffps_led_blink_set(struct led_classdev *led_cdev, | ||
int rc; | ||
struct ibm_cffps *psu = container_of(led_cdev, struct ibm_cffps, led); | ||
|
||
- psu->led_state = CFFPS_LED_BLINK; | ||
- | ||
- if (led_cdev->brightness == LED_OFF) | ||
- return 0; | ||
+ dev_dbg(&psu->client->dev, "LED blink set.\n"); | ||
|
||
pmbus_set_page(psu->client, 0); | ||
|
||
@@ -335,6 +344,8 @@ static int ibm_cffps_led_blink_set(struct led_classdev *led_cdev, | ||
if (rc < 0) | ||
return rc; | ||
|
||
+ psu->led_state = CFFPS_LED_BLINK; | ||
+ led_cdev->brightness = LED_FULL; | ||
*delay_on = CFFPS_BLINK_RATE_MS; | ||
*delay_off = CFFPS_BLINK_RATE_MS; | ||
|
||
-- | ||
2.24.0 | ||
|
34 changes: 34 additions & 0 deletions
34
...kernel/linux/linux-aspeed/0002-hwmon-pmbus-ibm-cffps-Don-t-relinquish-control-of-LE.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From a5f54dc0d87c4ea82165fa647abaa04d99c63462 Mon Sep 17 00:00:00 2001 | ||
From: Eddie James <eajames@linux.ibm.com> | ||
Date: Thu, 9 Apr 2020 09:47:40 -0500 | ||
Subject: [PATCH 2/2] hwmon: (pmbus/ibm-cffps) Don't relinquish control of LED | ||
|
||
The Linux driver shouldn't let the PSU firmware control the LED ever. | ||
|
||
Signed-off-by: Eddie James <eajames@linux.ibm.com> | ||
--- | ||
drivers/hwmon/pmbus/ibm-cffps.c | 6 +----- | ||
1 file changed, 1 insertion(+), 5 deletions(-) | ||
|
||
diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c | ||
index 54563851ce86..f4a9f80fd494 100644 | ||
--- a/drivers/hwmon/pmbus/ibm-cffps.c | ||
+++ b/drivers/hwmon/pmbus/ibm-cffps.c | ||
@@ -39,13 +39,9 @@ | ||
#define CFFPS_MFR_VAUX_FAULT BIT(6) | ||
#define CFFPS_MFR_CURRENT_SHARE_WARNING BIT(7) | ||
|
||
-/* | ||
- * LED off state actually relinquishes LED control to PSU firmware, so it can | ||
- * turn on the LED for faults. | ||
- */ | ||
-#define CFFPS_LED_OFF 0 | ||
#define CFFPS_LED_BLINK BIT(0) | ||
#define CFFPS_LED_ON BIT(1) | ||
+#define CFFPS_LED_OFF BIT(2) | ||
#define CFFPS_BLINK_RATE_MS 250 | ||
|
||
enum { | ||
-- | ||
2.24.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
KBRANCH ?= "dev-5.3" | ||
LINUX_VERSION ?= "5.3.15" | ||
LINUX_VERSION ?= "5.3.1" | ||
|
||
SRCREV="fdc60468f3e452364d432f1a7c3f83d58bba1b84" | ||
SRCREV="7e560ad8594fa4b7ae4417721c45116f8b785ca4" | ||
|
||
require linux-aspeed.inc |