Skip to contentSkip to conversation

mmc: at91_mci: reorder timer setup and mmc_add_host() call

PATCH In review Nicolas Ferre 3 participants 3 messages Nov 27, 2008 – Nov 30, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: at91_mci: reorder timer setup and mmc_add_host() call

As said in function comment mmc_add_host() requires that:
"The host must be prepared to start servicing requests before this function completes."

During this function, at91_mci_request() can be invoqued without timer beeing setup leading to a kernel Oops. This has been reported inserting this driver as a module.

---
drivers/mmc/host/at91_mci.c | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/at91_mci.c +0 -0
index 1f8b5b3..e556d42 100644
@@ -1088,6 +1088,8 @@ static int __init at91_mci_probe(struct platform_device *pdev)
		goto fail0;
	}

+ setup_timer(&host->timer, at91_timeout_timer, (unsigned long)host);
+

	platform_set_drvdata(pdev, mmc);

	/*

@@ -1101,8 +1103,6 @@ static int __init at91_mci_probe(struct platform_device *pdev)

	mmc_add_host(mmc);

- setup_timer(&host->timer, at91_timeout_timer, (unsigned long)host);
-

	/*
	 * monitor card insertion/removal if we can
	 */
Signature · 1 line
1.5.3.7
#1 lore raw
Quoted 10 lines · Nicolas Ferre

As said in function comment mmc_add_host() requires that:
"The host must be prepared to start servicing requests before this function completes."

During this function, at91_mci_request() can be invoqued without timer beeing setup leading to a kernel Oops. This has been reported inserting this driver as a module.

Bug introduced by me ;)

Ack

Best regards

Marc

#2 lore raw
In reply to Nicolas Ferre
Quoted 11 lines · On Thu, 27 Nov 2008 17:23:49 +0100 Nicolas Ferre <[email protected]>…

As said in function comment mmc_add_host() requires that:
"The host must be prepared to start servicing requests before this function completes."

During this function, at91_mci_request() can be invoqued without timer beeing setup leading to a kernel Oops. This has been reported inserting this driver as a module.

---

Queued up.

Signature · 6 lines
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.