Skip to contentSkip to conversation

PATCH: Fix 32bitism in SDHCI

PATCH Alan Cox 5 participants 11 messages Jun 15, 2006 MMC, SD and SDIO

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

The data field is ulong, pointers fit in ulongs. Casting them to int is bad for 64bit systems.

drivers/mmc/sdhci.c +1 -1
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.17-rc6/drivers/mmc/sdhci.c linux-2.6.17-rc6/drivers/mmc/sdhci.c
@@ -1073,7 +1073,7 @@
 	tasklet_init(&host->finish_tasklet,
 		sdhci_tasklet_finish, (unsigned long)host);
 
-	setup_timer(&host->timer, sdhci_timeout_timer, (int)host);
+	setup_timer(&host->timer, sdhci_timeout_timer, (unsigned long)host);
 
 	ret = request_irq(host->irq, sdhci_irq, SA_SHIRQ,
 		host->slot_descr, host);
#1 lore raw
Quoted 2 lines · Alan Cox

The data field is ulong, pointers fit in ulongs. Casting them to int is bad for 64bit systems.

It's in my (rather large) queue. I'm just waiting for a merge window. :)

#2 lore raw
Quoted 5 lines · Pierre Ossman
Quoted 2 lines · Alan Cox

The data field is ulong, pointers fit in ulongs. Casting them to int is bad for 64bit systems.

It's in my (rather large) queue. I'm just waiting for a merge window. :)

I didn't see the original message, but I suspect this is about the following, which you can see is already queued up for Linus.

# Base git commit: 0e838b72d54ed189033939258a961f2a0cd59647
# (Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev)
#
# Author: Andrew Morton (Mon Jun 12 22:10:22 BST 2006)
# Committer: Russell King (Mon Jun 12 22:10:22 BST 2006) #
# [MMC] sdhci truncated pointer fix
#
# On 64-bit machines, we just lost the uppermost 32 bits.
#
# Signed-off-by: Andrew Morton
# Signed-off-by: Russell King
#
# drivers/mmc/sdhci.c | 2 +-
# 1 files changed, 1 insertions(+), 1 deletions(-)
#

drivers/mmc/sdhci.c +1 -1
@@ -1073,7 +1073,7 @@ static int __devinit sdhci_probe_slot(st
 	tasklet_init(&host->finish_tasklet,
 		sdhci_tasklet_finish, (unsigned long)host);
 
-	setup_timer(&host->timer, sdhci_timeout_timer, (int)host);
+	setup_timer(&host->timer, sdhci_timeout_timer, (long)host);
 
 	ret = request_irq(host->irq, sdhci_irq, SA_SHIRQ,
 		host->slot_descr, host);
Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
#3 lore raw
Quoted 4 lines · Russell King
Quoted 2 lines · Pierre Ossman

Alan Cox wrote:

Quoted 10 lines
Quoted 5 lines
Quoted 3 lines

The data field is ulong, pointers fit in ulongs. Casting them to int is bad for 64bit systems.

It's in my (rather large) queue. I'm just waiting for a merge window. :)

I didn't see the original message, but I suspect this is about the following, which you can see is already queued up for Linus.

Yup. Now who's the scoundrel that forgot to cc me on that patch? :)

Rgds
Pierre

author
#4 lore raw
In reply to Pierre Ossman

Ar Iau, 2006-06-15 am 18:59 +0200, ysgrifennodd Pierre Ossman:

Quoted 5 lines
Quoted 2 lines · Alan Cox

The data field is ulong, pointers fit in ulongs. Casting them to int is bad for 64bit systems.

It's in my (rather large) queue. I'm just waiting for a merge window. :)

I'd have thought that one was a "Duh whoops, fix it now" kind of submission for 2.6.17

#5 lore raw
Quoted 8 lines · Alan Cox

Ar Iau, 2006-06-15 am 18:59 +0200, ysgrifennodd Pierre Ossman:

Quoted 4 lines
Quoted 2 lines · Alan Cox

The data field is ulong, pointers fit in ulongs. Casting them to int is bad for 64bit systems.

It's in my (rather large) queue. I'm just waiting for a merge window. :)

I'd have thought that one was a "Duh whoops, fix it now" kind of submission for 2.6.17

Same here. Simple & obvious bug fixes shouldn't need a "merge window".

Cheers

#6 lore raw
In reply to Alan Cox
Quoted 4 lines · Alan Cox

I'd have thought that one was a "Duh whoops, fix it now" kind of submission for 2.6.17

Yes and no. It's for a code path that's never supposed to be hit (and isn't except for hardware so broken it doesn't work anyway). So I figured I might as well send it in with the rest of the patches.

I'm fine either way though. I'll just pop that patch from my set.

Rgds
Pierre

author
#7 lore raw

Ar Iau, 2006-06-15 am 20:50 +0200, ysgrifennodd Pierre Ossman:

Quoted 2 lines

Yes and no. It's for a code path that's never supposed to be hit (and isn't except for hardware so broken it doesn't work anyway).

Oh I see, I didn't realise it was just for the obscure corner case

#8 lore raw
In reply to Alan Cox
Quoted 9 lines · Alan Cox

Ar Iau, 2006-06-15 am 18:59 +0200, ysgrifennodd Pierre Ossman:

Quoted 5 lines
Quoted 2 lines · Alan Cox

The data field is ulong, pointers fit in ulongs. Casting them to int is bad for 64bit systems.

It's in my (rather large) queue. I'm just waiting for a merge window. :)

I'd have thought that one was a "Duh whoops, fix it now" kind of submission for 2.6.17

akpm sent it to me, so I merged it into my tree, and now I've been sitting on it all this week because I've taken the decision that I do not want to put anything further into Linus' tree until we actually see 2.6.17.

If you look at what Linus said when he released -rc7, the reason we had -rc7 instead of -final was that we had too many changes. We can either go on throwing more and more changes, albiet 100% correct bug fix changes, and carry on releasing -rc after -rc, but at some point there must be an end to this, and -final must happen.

It's been three months since 2.6.16 was released. I'm not prepared to be the reason that we have another week of -rc-ism because of too many small but apparantly correct changes.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
#9 lore raw
In reply to Pierre Ossman

Hi Pierre,

Quoted 1 line · Pierre Ossman

It's in my (rather large) queue. I'm just waiting for a merge window. :)

Is your queue publicised anywhere? I have a new laptop, which has a card reader supposedly supported by sdhci, but it doesn't work. I would like to confirm that I am running the latest code before I start diagnosing it...

Thanks
Daniel

#10 lore raw
Quoted 5 lines · Daniel Drake

Is your queue publicised anywhere? I have a new laptop, which has a card reader supposedly supported by sdhci, but it doesn't work. I would like to confirm that I am running the latest code before I start diagnosing it...

Not in a git format as I use StGIT and it tends to be incompatible with pulls. My patches usually circulate a bit on the sdhci-devel list before I pass them on to Russell. This time the set is rather large though:

http://list.drzeus.cx/pipermail/sdhci-devel/2006-May/000809.html

Rgds
Pierre