linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Rouxel <benjamin.rouxel@uva.nl>
To: linux-rt-users@vger.kernel.org
Subject: Re: Boot issue on odroid-XU4
Date: Wed, 24 Jul 2019 19:07:46 +0200	[thread overview]
Message-ID: <d6033713-25b7-7ef0-b0ad-8b7100d7d4b0@uva.nl> (raw)
In-Reply-To: <cfa2b805-380d-39fd-2955-ab19c5a11aaa@uva.nl>

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

Hi,

I thought it would be harder to debug/fix. Please find attached a patch
that corrects this boot issue, the exynos5 i2c driver was still using
the "spinlock_t" structure and all initial utility functions, I just
changed it to use the "raw_spinlock_t" struct.

Was it the good fix?

Best,

Benjamin Rouxel.

Le 24/07/2019 à 18:17, Benjamin Rouxel a écrit :
> Hi,
>
> platform: odroid-xu4
>
> kernel: 4.14.134 + hardkernel drivers
>
> rt patch: patch-4.14.134-rt63
>
> preempt rt: full
>
> I am having issues at boot time for the aforementioned
> platform+kernel+rt patch. Adding "initcall_debug" to the kernel
> parameter made me realise that the call to "exynos5_i2c_driver_init"
> never returns, so I believe it is lock somehow. I am requesting some
> help to debug and fix it please. Attached is the bootlog. What else
> should I provide?
>
> Best,
>
> Benjamin Rouxel.
>

[-- Attachment #2: patch-xu4-preempt-rt-full.txt --]
[-- Type: text/plain, Size: 1979 bytes --]

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index b02428498f6d..9a2a32f42c54 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -189,7 +189,7 @@ struct exynos5_i2c {
 	struct device		*dev;
 	int			state;
 
-	spinlock_t		lock;		/* IRQ synchronization */
+	raw_spinlock_t		lock;		/* IRQ synchronization */
 
 	/*
 	 * Since the TRANS_DONE bit is cleared on read, and we may read it
@@ -414,7 +414,7 @@ static irqreturn_t exynos5_i2c_irq(int irqno, void *dev_id)
 
 	i2c->state = -EINVAL;
 
-	spin_lock(&i2c->lock);
+	raw_spin_lock(&i2c->lock);
 
 	int_status = readl(i2c->regs + HSI2C_INT_STATUS);
 	writel(int_status, i2c->regs + HSI2C_INT_STATUS);
@@ -513,7 +513,7 @@ static irqreturn_t exynos5_i2c_irq(int irqno, void *dev_id)
 		complete(&i2c->msg_complete);
 	}
 
-	spin_unlock(&i2c->lock);
+	raw_spin_unlock(&i2c->lock);
 
 	return IRQ_HANDLED;
 }
@@ -602,7 +602,7 @@ static void exynos5_i2c_message_start(struct exynos5_i2c *i2c, int stop)
 	 * Enable interrupts before starting the transfer so that we don't
 	 * miss any INT_I2C interrupts.
 	 */
-	spin_lock_irqsave(&i2c->lock, flags);
+	raw_spin_lock_irqsave(&i2c->lock, flags);
 	writel(int_en, i2c->regs + HSI2C_INT_ENABLE);
 
 	if (stop == 1)
@@ -610,7 +610,7 @@ static void exynos5_i2c_message_start(struct exynos5_i2c *i2c, int stop)
 	i2c_auto_conf |= i2c->msg->len;
 	i2c_auto_conf |= HSI2C_MASTER_RUN;
 	writel(i2c_auto_conf, i2c->regs + HSI2C_AUTO_CONF);
-	spin_unlock_irqrestore(&i2c->lock, flags);
+	raw_spin_unlock_irqrestore(&i2c->lock, flags);
 }
 
 static int exynos5_i2c_xfer_msg(struct exynos5_i2c *i2c,
@@ -747,7 +747,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
 	/* Clear pending interrupts from u-boot or misc causes */
 	exynos5_i2c_clr_pend_irq(i2c);
 
-	spin_lock_init(&i2c->lock);
+	raw_spin_lock_init(&i2c->lock);
 	init_completion(&i2c->msg_complete);
 
 	i2c->irq = ret = platform_get_irq(pdev, 0);

  reply	other threads:[~2019-07-24 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 16:17 Boot issue on odroid-XU4 Benjamin Rouxel
2019-07-24 17:07 ` Benjamin Rouxel [this message]
2019-08-13  9:00   ` Sebastian Andrzej Siewior
2019-08-13 10:02     ` Benjamin Rouxel
2019-08-13 10:22       ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6033713-25b7-7ef0-b0ad-8b7100d7d4b0@uva.nl \
    --to=benjamin.rouxel@uva.nl \
    --cc=linux-rt-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).