public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Wiegley <jeffw@cyte.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, john stultz <johnstul@us.ibm.com>,
	Andi Kleen <ak@muc.de>,
	"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
Subject: Re: amd64 cdrom access locks system
Date: Thu, 09 Jun 2005 12:38:59 -0700	[thread overview]
Message-ID: <42A89AD3.4050704@cyte.com> (raw)
In-Reply-To: <20050609160045.69c579d2.akpm@osdl.org>

Your workaround does indeed seem to work around the problem.
I can rip tracks from a cd now and I don't get a lock up
anymore.

But the first time I do something with the CD I get this...

warning: many lost ticks.
Your time source seems to be instable or some driver is hogging interupts.
rip __do_softirq+0x48/0xb0
Falling back to HPET

 From then on I'm guessing I'm using the HPET and I don't
get any more of these warnings.

I did check on DMA on for the device. I can't get it
to support DMA...

root@mail:/root# hdparm -d 1 /dev/hda

/dev/hda:
  setting using_dma to 1 (on)
  HDIO_SET_DMA failed: Operation not permitted
  using_dma    =  0 (off)

I don't know what else to "fiddle" with to get it working. My guess is 
that DMA is not currently supported at all for the chipset/motherboard
I have. (As I said before, lspci seems to indicate that a lot of stuff
on this motherboard is "unknown" hardware; would be nice to get it
"known" but I don't know how. I can only be somebody's guinea pig for
patches ;-) Or maybe I am missing some trick to enabling DMA? I have
it enabled by default in my kernel .config

Anyhow, thanks for the work around. I can at least use my burner now.
Though I suspect you want a "real" fix sometime as for why the HPET
tick obtained a 0 value.  If you want me to test another patch
towards this goal just let me know.

- Jeff

Andrew Morton wrote:
> Jeff Wiegley <jeffw@cyte.com> wrote:
> 
>>warning: many lost ticks.
>>Your time source seems to be instable or some driver is hogging interupts
>>rip default_idle+0x24/0x30
>>Falling back to HPET
>>divide error: 0000 [1] PREEMPT
>>...
>>RIP: 0010:[<ffffffff80112704>] <ffffffff80112704>{timer_interrupt+244}
> 
> 
> The timer code got confused, fell back to the HPET timer and then got a
> divide-by-zero in timer_interrupt().  Probably because variable hpet_tick
> is zero.
> 
> - It's probably a bug that the cdrom code is holding interrupts off for
>   too long.
> 
>   Use hdparm and dmesg to see whether the driver is using DMA.  If it
>   isn't, fiddle with it until it is.
> 
> - It's possibly a bug that we're falling back to HPET mode just because
>   the cdrom driver is being transiently silly.
> 
> - It's surely a bug that hpet_tick is zero after we've switched to HPET mode.
> 
> 
> 
> 
> Please test this workaround:
> 
> 
>  arch/x86_64/kernel/time.c |   13 +++++++++----
>  1 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff -puN arch/x86_64/kernel/time.c~x86_64-div-by-zero-fix arch/x86_64/kernel/time.c
> --- 25/arch/x86_64/kernel/time.c~x86_64-div-by-zero-fix	Thu Jun  9 15:51:50 2005
> +++ 25-akpm/arch/x86_64/kernel/time.c	Thu Jun  9 15:53:08 2005
> @@ -75,6 +75,11 @@ unsigned long __wall_jiffies __section_w
>  struct timespec __xtime __section_xtime;
>  struct timezone __sys_tz __section_sys_tz;
>  
> +static inline unsigned long fixed_hpet_tick(void)
> +{
> +	return hpet_tick ? hpet_tick : 1;
> +}
> +
>  static inline void rdtscll_sync(unsigned long *tsc)
>  {
>  #ifdef CONFIG_SMP
> @@ -305,7 +310,7 @@ unsigned long long monotonic_clock(void)
>  
>  		} while (read_seqretry(&xtime_lock, seq));
>  		offset = (this_offset - last_offset);
> -		offset *=(NSEC_PER_SEC/HZ)/hpet_tick;
> +		offset *=(NSEC_PER_SEC/HZ)/fixed_hpet_tick();
>  		return base + offset;
>  	}else{
>  		do {
> @@ -393,11 +398,11 @@ static irqreturn_t timer_interrupt(int i
>  
>  	if (vxtime.mode == VXTIME_HPET) {
>  		if (offset - vxtime.last > hpet_tick) {
> -			lost = (offset - vxtime.last) / hpet_tick - 1;
> +			lost = (offset - vxtime.last) / fixed_hpet_tick() - 1;
>  		}
>  
> -		monotonic_base += 
> -			(offset - vxtime.last)*(NSEC_PER_SEC/HZ) / hpet_tick;
> +		monotonic_base +=  (offset - vxtime.last)*(NSEC_PER_SEC/HZ) /
> +					fixed_hpet_tick();
>  
>  		vxtime.last = offset;
>  #ifdef CONFIG_X86_PM_TIMER
> _


-- 
Jeff Wiegley, PhD
Cyte.Com, LLC
(ignore:cea2d3a38843531c7def1deff59114de)

  reply	other threads:[~2005-06-10  2:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-08  1:09 amd64 cdrom access locks system Jeff Wiegley
2005-06-08 12:23 ` Andrew Morton
2005-06-09 15:36   ` Jeff Wiegley
2005-06-09 23:00     ` Andrew Morton
2005-06-09 19:38       ` Jeff Wiegley [this message]
2005-06-09 21:58       ` Jeff Wiegley
2005-06-09 23:32       ` Venkatesh Pallipadi
2005-06-09 18:23         ` Jeff Wiegley
2005-06-13 16:35       ` Jeff Wiegley
2005-06-14  7:55         ` Bartlomiej Zolnierkiewicz
2005-06-14 10:35           ` Jeff Wiegley
2005-06-14 18:16             ` Bartlomiej Zolnierkiewicz
2005-12-15  9:15               ` Aric Cyr
     [not found] <4d3Xi-33s-31@gated-at.bofh.it>
     [not found] ` <4d7Rk-6fq-49@gated-at.bofh.it>
     [not found]   ` <4dE0F-77V-17@gated-at.bofh.it>
     [not found]     ` <4dEk0-7ua-1@gated-at.bofh.it>
     [not found]       ` <4dJWr-38Z-33@gated-at.bofh.it>
2005-06-11 16:02         ` Robert Hancock
  -- strict thread matches above, loose matches on Subject: below --
2005-08-09  7:47 David C. Young
     [not found] <S1750841AbWAQXWc/20060117232242Z+104@vger.kernel.org>
2006-01-18  0:31 ` Christer Bäckström
2006-01-18  9:18   ` Alan Cox
2006-01-18 12:15     ` Christer Bäckström
2006-01-18 10:01   ` Bartlomiej Zolnierkiewicz
2006-02-05 12:14   ` Erwin Rol

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=42A89AD3.4050704@cyte.com \
    --to=jeffw@cyte.com \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=venkatesh.pallipadi@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox