Skip to contentSkip to conversation

ERROR: "__aeabi_uldivmod" [drivers/pinctrl/pinctrl-single.ko] undefined!

DISCUSSION Russell King - ARM Linux 3 participants 3 messages Jan 11, 2013

lore
Share & tools
lore
#0 lore raw

Linus,

The above error happens in builds including pinctrl-single - the reason is this, where resource_size_t may be 64-bit.

                gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes;
                gpio->range.npins = (r.end - r.start) / mux_bytes + 1;

This leads to a 64-bit division by an extended 64-bit, resulting in the call to our (unimplemented) 64-bit-by-64-bit division routines.

This needs fixing - you probably want to cast the difference down to an 'unsigned' first, and also maybe check that it does fit in an unsigned too?

#1 lore raw
Quoted 6 lines · Russell King - ARM Linux

The above error happens in builds including pinctrl-single - the reason is this, where resource_size_t may be 64-bit.

                gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes;
                gpio->range.npins = (r.end - r.start) / mux_bytes + 1;
Quoted 6 lines

This leads to a 64-bit division by an extended 64-bit, resulting in the call to our (unimplemented) 64-bit-by-64-bit division routines.

This needs fixing - you probably want to cast the difference down to an 'unsigned' first, and also maybe check that it does fit in an unsigned too?

Agreed, Haojian can you provide a tested patch for this? I think you added this code...

Tony: please check and ACK.

Yours,
Linus Walleij

#2 lore raw
Quoted 12 lines · Linus Walleij
Quoted 9 lines · Russell King - ARM Linux

The above error happens in builds including pinctrl-single - the reason is this, where resource_size_t may be 64-bit.

                gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes;
                gpio->range.npins = (r.end - r.start) / mux_bytes + 1;

This leads to a 64-bit division by an extended 64-bit, resulting in the call to our (unimplemented) 64-bit-by-64-bit division routines.

Quoted 8 lines
Quoted 3 lines

This needs fixing - you probably want to cast the difference down to an 'unsigned' first, and also maybe check that it does fit in an unsigned too?

Agreed, Haojian can you provide a tested patch for this? I think you added this code...

Tony: please check and ACK.

OK will check and ack.

Tony