All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: Sudip Mukherjee
	<sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Andy Shevchenko
	<andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Wim Van Sebroeck <wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org>,
	Haavard Skinnemoen
	<hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Hans-Christian Egtvedt
	<egtvedt-BrfabpQBY5qlHtIdYg32fQ@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Chris Mason <clm-b10kYP2dOMg@public.gmane.org>
Subject: Re: [PATCH] watchdog: dw_wdt: dont build for avr32
Date: Sat, 30 Apr 2016 17:04:40 -0700	[thread overview]
Message-ID: <57254818.5020008@roeck-us.net> (raw)
In-Reply-To: <20160430183828.GC25043@sudip-laptop>

On 04/30/2016 11:38 AM, Sudip Mukherjee wrote:
> On Tue, Apr 12, 2016 at 11:01:28AM -0700, Guenter Roeck wrote:
>> On Tue, Apr 12, 2016 at 05:58:20PM +0300, Andy Shevchenko wrote:
>>> On Tue, Apr 12, 2016 at 4:39 PM, Sudip Mukherjee
>>> <sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> On Tuesday 12 April 2016 06:36 PM, Guenter Roeck wrote:
>>>>>
>>>>> On 04/11/2016 10:51 PM, Sudip Mukherjee wrote:
>>>>>>
>>>>>> The build of avr32 allmodconfig fails with the error:
>>>>>> ERROR: "__avr32_udiv64" [drivers/watchdog/kempld_wdt.ko] undefined!
>>>>>>
>>>>> This means there is a direct 64 bit divide operation in the driver,
>>>>> which we should identify and fix.
>>>
>>> This driver will quite likely never be used on AVR32. Do we need to
>>> fix this due to some other architectures?
>>>
>>>> yes, there is.
>>>>
>>>> in function: kempld_wdt_set_stage_timeout()
>>>> remainder = do_div(stage_timeout64, prescaler);
>>>
>>>> Any idea how to fix it?
>>>
>>> Not easy, however, prescaler value is ((1 << 21) - 1) which someone
>>> might consider as (1 << 21) with lost in precision.
>>>
>>> Thus, shift on 20 bits right, add last bit to the value and shift on 1
>>> bit right more.
>>>
>> Sorry, I am missing something. do_div() should work fine with any 32 bit value
>> as divisor, no matter what that value is. Why does it fail here ? And why does
>> it work if I pass 0x1fffff as second parameter to do_div() directly ?
>
> Please let me know what i can do here to help solve the problem.
> linux-next continues to fail for avr32, and to make matters worse we
> also have the similar problem in btrfs.
>
> ERROR: "__avr32_udiv64" [fs/btrfs/btrfs.ko] undefined!
> ERROR: "__avr32_udiv64" [drivers/watchdog/kempld_wdt.ko] undefined!
>

Pretty much what I suspected would happen. Oddly enough, the symbol was defined
in early avr32 patch sets [1], but dropped in the final commit after some
discussion [2]. Makes me wonder if the problem was always known.

Guenter

> Adding Chris to CC if he has some idea how to solve this error for btrfs.
> Build log for next-20160429 is at:
> https://travis-ci.org/sudipm-mukherjee/parport/jobs/126581065
>
> regards
> sudip
>
---
[1] https://kldp.org/files/linux-2.6.16.11-avr32-20060626.patch_.txt
[2] http://fa.linux.kernel.narkive.com/4UhaxiM4/avr32-architecture-patch-against-linux-2-6-18-rc1-available

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Wim Van Sebroeck <wim@iguana.be>,
	Haavard Skinnemoen <hskinnemoen@gmail.com>,
	Hans-Christian Egtvedt <egtvedt@samfundet.no>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kernel-testers@vger.kernel.org, linux-watchdog@vger.kernel.org,
	Chris Mason <clm@fb.com>
Subject: Re: [PATCH] watchdog: dw_wdt: dont build for avr32
Date: Sat, 30 Apr 2016 17:04:40 -0700	[thread overview]
Message-ID: <57254818.5020008@roeck-us.net> (raw)
In-Reply-To: <20160430183828.GC25043@sudip-laptop>

On 04/30/2016 11:38 AM, Sudip Mukherjee wrote:
> On Tue, Apr 12, 2016 at 11:01:28AM -0700, Guenter Roeck wrote:
>> On Tue, Apr 12, 2016 at 05:58:20PM +0300, Andy Shevchenko wrote:
>>> On Tue, Apr 12, 2016 at 4:39 PM, Sudip Mukherjee
>>> <sudipm.mukherjee@gmail.com> wrote:
>>>> On Tuesday 12 April 2016 06:36 PM, Guenter Roeck wrote:
>>>>>
>>>>> On 04/11/2016 10:51 PM, Sudip Mukherjee wrote:
>>>>>>
>>>>>> The build of avr32 allmodconfig fails with the error:
>>>>>> ERROR: "__avr32_udiv64" [drivers/watchdog/kempld_wdt.ko] undefined!
>>>>>>
>>>>> This means there is a direct 64 bit divide operation in the driver,
>>>>> which we should identify and fix.
>>>
>>> This driver will quite likely never be used on AVR32. Do we need to
>>> fix this due to some other architectures?
>>>
>>>> yes, there is.
>>>>
>>>> in function: kempld_wdt_set_stage_timeout()
>>>> remainder = do_div(stage_timeout64, prescaler);
>>>
>>>> Any idea how to fix it?
>>>
>>> Not easy, however, prescaler value is ((1 << 21) - 1) which someone
>>> might consider as (1 << 21) with lost in precision.
>>>
>>> Thus, shift on 20 bits right, add last bit to the value and shift on 1
>>> bit right more.
>>>
>> Sorry, I am missing something. do_div() should work fine with any 32 bit value
>> as divisor, no matter what that value is. Why does it fail here ? And why does
>> it work if I pass 0x1fffff as second parameter to do_div() directly ?
>
> Please let me know what i can do here to help solve the problem.
> linux-next continues to fail for avr32, and to make matters worse we
> also have the similar problem in btrfs.
>
> ERROR: "__avr32_udiv64" [fs/btrfs/btrfs.ko] undefined!
> ERROR: "__avr32_udiv64" [drivers/watchdog/kempld_wdt.ko] undefined!
>

Pretty much what I suspected would happen. Oddly enough, the symbol was defined
in early avr32 patch sets [1], but dropped in the final commit after some
discussion [2]. Makes me wonder if the problem was always known.

Guenter

> Adding Chris to CC if he has some idea how to solve this error for btrfs.
> Build log for next-20160429 is at:
> https://travis-ci.org/sudipm-mukherjee/parport/jobs/126581065
>
> regards
> sudip
>
---
[1] https://kldp.org/files/linux-2.6.16.11-avr32-20060626.patch_.txt
[2] http://fa.linux.kernel.narkive.com/4UhaxiM4/avr32-architecture-patch-against-linux-2-6-18-rc1-available

  reply	other threads:[~2016-05-01  0:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12  5:51 [PATCH] watchdog: dw_wdt: dont build for avr32 Sudip Mukherjee
2016-04-12  5:51 ` Sudip Mukherjee
     [not found] ` <1460440303-20640-1-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-12 13:06   ` Guenter Roeck
2016-04-12 13:06     ` Guenter Roeck
     [not found]     ` <570CF2CB.2050200-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-04-12 13:39       ` Sudip Mukherjee
2016-04-12 13:39         ` Sudip Mukherjee
     [not found]         ` <570CFA90.4060100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-12 14:58           ` Andy Shevchenko
2016-04-12 14:58             ` Andy Shevchenko
2016-04-12 15:29             ` Sudip Mukherjee
     [not found]             ` <CAHp75VcrmiP0GWR-zCBmqc7zA6uiC4dD8-HDikmWZxyEwXkRLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-12 18:01               ` Guenter Roeck
2016-04-12 18:01                 ` Guenter Roeck
     [not found]                 ` <20160412180128.GA6965-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-04-12 18:17                   ` Andy Shevchenko
2016-04-12 18:17                     ` Andy Shevchenko
2016-04-30 18:38                   ` Sudip Mukherjee
2016-04-30 18:38                     ` Sudip Mukherjee
2016-05-01  0:04                     ` Guenter Roeck [this message]
2016-05-01  0:04                       ` Guenter Roeck
2016-05-01  0:36                     ` Guenter Roeck
2016-05-01  0:36                       ` Guenter Roeck
     [not found]                       ` <20160501003651.GA28804-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-05-01  1:13                         ` Guenter Roeck
2016-05-01  1:13                           ` Guenter Roeck
2016-05-01  9:04                           ` Sudip Mukherjee
     [not found]                             ` <5725C698.1090504-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-01 14:09                               ` Guenter Roeck
2016-05-01 14:09                                 ` Guenter Roeck
     [not found]                                 ` <57260E10.5050601-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-05-01 16:30                                   ` Sudip Mukherjee
2016-05-01 16:30                                     ` Sudip Mukherjee
2016-04-12 13:07   ` Guenter Roeck
2016-04-12 13:07     ` Guenter Roeck

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=57254818.5020008@roeck-us.net \
    --to=linux-0h96xk9xttrk1umjsbkqmq@public.gmane.org \
    --cc=andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=clm-b10kYP2dOMg@public.gmane.org \
    --cc=egtvedt-BrfabpQBY5qlHtIdYg32fQ@public.gmane.org \
    --cc=hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.