All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: amd: don't load pinctrl-amd on Gigabyte AM4 boards
@ 2017-05-25  4:00 Kai-Heng Feng
  2017-05-26 10:09 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Kai-Heng Feng @ 2017-05-25  4:00 UTC (permalink / raw)
  To: linus.walleij; +Cc: linux-gpio, linux-kernel, Kai-Heng Feng

On Gigabyte AM4 boards, pinctrl-amd generates tons of irq, makes the
system not able to boot properly.

Don't load the module until Gigabyte fixes the issue.

BugLink: https://bugs.launchpad.net/bugs/1671360
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/pinctrl/pinctrl-amd.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 1482d132fbb8..5b015d3552b8 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -29,6 +29,7 @@
 #include <linux/interrupt.h>
 #include <linux/list.h>
 #include <linux/bitops.h>
+#include <linux/dmi.h>
 #include <linux/pinctrl/pinconf.h>
 #include <linux/pinctrl/pinconf-generic.h>
 
@@ -739,6 +740,26 @@ static struct pinctrl_desc amd_pinctrl_desc = {
 	.owner = THIS_MODULE,
 };
 
+static bool amd_gpio_is_gigabyte_am4(void)
+{
+	const char *board_name;
+
+	if (!dmi_match(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."))
+		return false;
+
+	board_name = dmi_get_system_info(DMI_BOARD_NAME);
+
+	if (!board_name)
+		return false;
+
+	if (strstr(board_name, "A320") ||
+		strstr(board_name, "B350") ||
+		strstr(board_name, "X370"))
+		return true;
+
+	return false;
+}
+
 static int amd_gpio_probe(struct platform_device *pdev)
 {
 	int ret = 0;
@@ -746,6 +767,10 @@ static int amd_gpio_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct amd_gpio *gpio_dev;
 
+	/* Don't load this module if it's a Gigabyte AM4 board */
+	if (amd_gpio_is_gigabyte_am4())
+		return -ENODEV;
+
 	gpio_dev = devm_kzalloc(&pdev->dev,
 				sizeof(struct amd_gpio), GFP_KERNEL);
 	if (!gpio_dev)
-- 
2.13.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: amd: don't load pinctrl-amd on Gigabyte AM4 boards
  2017-05-25  4:00 [PATCH] pinctrl: amd: don't load pinctrl-amd on Gigabyte AM4 boards Kai-Heng Feng
@ 2017-05-26 10:09 ` Thomas Gleixner
  2017-05-26 10:18   ` Kai-Heng Feng
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2017-05-26 10:09 UTC (permalink / raw)
  To: Kai-Heng Feng; +Cc: linus.walleij, linux-gpio, LKML, Borislav Petkov

On Thu, 25 May 2017, Kai-Heng Feng wrote:

> On Gigabyte AM4 boards, pinctrl-amd generates tons of irq, makes the
> system not able to boot properly.
> 
> Don't load the module until Gigabyte fixes the issue.

NAK. 

That's the completely wrong approach. This crap will surface on a gazillion
of other boards and will hit users faster than you can keep that DMI list
up to date.

There is a proper solution to this problem:

http://lkml.kernel.org/r/alpine.DEB.2.20.1705232307330.2409@nanos

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: amd: don't load pinctrl-amd on Gigabyte AM4 boards
  2017-05-26 10:09 ` Thomas Gleixner
@ 2017-05-26 10:18   ` Kai-Heng Feng
  0 siblings, 0 replies; 3+ messages in thread
From: Kai-Heng Feng @ 2017-05-26 10:18 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linus.walleij, linux-gpio, LKML, Borislav Petkov

On Fri, May 26, 2017 at 6:09 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Thu, 25 May 2017, Kai-Heng Feng wrote:
>
>> On Gigabyte AM4 boards, pinctrl-amd generates tons of irq, makes the
>> system not able to boot properly.
>>
>> Don't load the module until Gigabyte fixes the issue.
>
> NAK.
>
> That's the completely wrong approach. This crap will surface on a gazillion
> of other boards and will hit users faster than you can keep that DMI list
> up to date.

Yea. I'll try to understand your patch, and hopefully I can find
correct solutions next time.

>
> There is a proper solution to this problem:
>
> http://lkml.kernel.org/r/alpine.DEB.2.20.1705232307330.2409@nanos

Wow, this is great news for Gigabyte AM4 users!

Thanks for the patch, I'll build a custom Ubuntu kernel and get
feedback from users.

>
> Thanks,
>
>         tglx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-26 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-25  4:00 [PATCH] pinctrl: amd: don't load pinctrl-amd on Gigabyte AM4 boards Kai-Heng Feng
2017-05-26 10:09 ` Thomas Gleixner
2017-05-26 10:18   ` Kai-Heng Feng

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.