linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: bzolnier@gmail.com, linux-ide@vger.kernel.org, mcherkashin@ru.mvista.com
Subject: Re: [PATCH] palm_bk3710: fix IDECLK period calculation
Date: Wed, 09 Jul 2008 18:46:58 +0400	[thread overview]
Message-ID: <4874CF62.6080103@ru.mvista.com> (raw)
In-Reply-To: <200807081829.06199.sshtylyov@ru.mvista.com>

Hello, I wrote:

> The driver uses completely bogus rounding formula for calculating period from
> the IDECLK frequency which gives one-off period values (e.g. 11 ns with 100 MHz
> IDECLK) which in turn can lead to overclocked IDE transfer timings.  Actually,
> rounding is just wrong in this case, so use a mere division for a safe result.

> While at it, also:

> - give 'ide_palm_clk' variable a more suitable name;

> - get rid of the useless 'ideclkp' variable;

> - drop the LISP stype 'p' postfix from the 'clkp' variable's name. :-)

> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

> Index: linux-2.6/drivers/ide/arm/palm_bk3710.c
> ===================================================================
> --- linux-2.6.orig/drivers/ide/arm/palm_bk3710.c
> +++ linux-2.6/drivers/ide/arm/palm_bk3710.c
[...]
> @@ -350,22 +348,22 @@ static const struct ide_port_info __devi
>  
>  static int __devinit palm_bk3710_probe(struct platform_device *pdev)
>  {
> -	struct clk *clkp;
> +	struct clk *clk;
>  	struct resource *mem, *irq;
>  	ide_hwif_t *hwif;
> -	unsigned long base;
> +	unsigned long base, rate;
>  	int i;
>  	hw_regs_t hw;
>  	u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
>  
> -	clkp = clk_get(NULL, "IDECLK");
> -	if (IS_ERR(clkp))
> +	clk = clk_get(NULL, "IDECLK");
> +	if (IS_ERR(clk))
>  		return -ENODEV;

    Oh, crap! My original patch had NULL changed to &pdev->dev here but I 
mis-fixed the reject when importing it to the recent tree... Well, too late 
now, so till next time. :-)

MBR, Sergei


      parent reply	other threads:[~2008-07-09 14:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-08 14:29 [PATCH] palm_bk3710: fix IDECLK period calculation Sergei Shtylyov
2008-07-08 17:18 ` Bartlomiej Zolnierkiewicz
2008-07-09 14:46 ` Sergei Shtylyov [this message]

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=4874CF62.6080103@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=mcherkashin@ru.mvista.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;
as well as URLs for NNTP newsgroup(s).