Re: ni_usb: bug when setting kernel timer

Derek Kozel <[email protected]>
Newsgroups gmane.linux.hardware.gpib.general
Message-ID <CAO27avAQBcq3VbuLQQTW6XSGX38A311NkPnfacyFSTMO3Fw7Jw@mail.gmail.com>
My change to the kernel version requirement was incorrect. Kernel 4.14.0
has unsigned long as the timer_list function argument type.

https://elixir.bootlin.com/linux/v4.14/source/include/linux/timer.h#L20
https://sourceforge.net/p/linux-gpib/code/1752/tree//trunk/linux-gpib-kernel/compat/include/linux/timer.h#l29

I'll look more into the redefinition error. Comparing 4.13, 4.14, and 4.15
declarations of setup_timer it looks like there were a few changes between
each so I maybe just particularly unlucky in kernel versions.

https://elixir.bootlin.com/linux/v4.13/source/include/linux/timer.h#L154
https://elixir.bootlin.com/linux/v4.14/source/include/linux/timer.h#L175
https://elixir.bootlin.com/linux/v4.15/source/include/linux/timer.h#L131

Regards,
Derek

On Mon, May 28, 2018 at 7:49 PM, Derek Kozel <[email protected]> wrote:

> Hello,
>
> I've just had a chance to try the newly separated source trees and
> encountered an error with the setup_timer compat header. The make log is
> attached as linux-gpib-r1752-setup_timer-error.txt.
>
> I'm running Ubuntu 16.04 with kernel 4.14.0-041400-generic. I have SVN rev
> 1752.
>
> As the error was setup_timer being redefined I changed the kernel version
> check to < 4.14 and attempted to recompile. Many drivers succeeded, but
> then I encountered an incompatible pointer type error. The log for that is
> also attached, I reran make after the first error to abbreviate the output.
> My guess is that I'll have to try understanding the code a bit more to fix
> this error, but I'm also slightly surprised it hasn't been encountered by
> anyone else. Can anyone shed light on it?
>
> Many thanks,
> Derek
>
> On Tue, May 8, 2018 at 3:41 PM, Frank Mori Hess <[email protected]> wrote:
>
>> On Mon, May 7, 2018 at 10:46 AM, Stefan Mahr <[email protected]>
>> wrote:
>> > Hi,
>> >
>> > There's a timer initialisation bug in ni_usb driver, especially
>> > for NI_USB_B. The timer is setup after first use of mod_timer
>> > (ni_usb_b_read_serial_number->usb_send_bulk_msg), so kernel throws a
>> > bug in timer.c: BUG_ON(!timer->function);
>> >
>> > Attached patch should fix this issue.
>> >
>>
>> Thanks, I'm going to try implementing timer_setup using setup_timer in
>> a compatibility header later today, to get rid of needing to #ifdef
>> every timer setup.  I'll incorporate your change into that.
>>
>>
>> --
>> Frank
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Linux-gpib-general mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/linux-gpib-general
>>
>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Linux-gpib-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-gpib-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.