linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: TOMARI Hisanobu <posco.grubb@gmail.com>
Cc: linux-ide@vger.kernel.org, bzolnier@gmail.com, benh@kernel.crashing.org
Subject: Re: [PATCH] IDE cable detection on Apple PowerBook
Date: Mon, 23 Mar 2009 13:57:03 +0300	[thread overview]
Message-ID: <49C76AFF.5090008@ru.mvista.com> (raw)
In-Reply-To: <20090322101704.80473ee8.posco.grubb@gmail.com>

TOMARI Hisanobu wrote:

> This patch against 2.6.28.8 modifies the behavior of 80c cable detection 
> of drivers/ide/pmac.c.
> As IDE cable used on Apple PowerBook/iBook laptops are always of "Short 40" 
> type when the firmware says it's 80 conductor one, the cable detection should 
> return ATA_CBL_PATA40_SHORT on those machines.
> This enables to automatically use UDMA5 even with drives that doesn't correctly 
> detect those cables on Apple laptops.

> Signed-off-by: TOMARI Hisanobu <posco.grubb@gmail.com>

> --- linux-2.6.28.8/drivers/ide/pmac.c.orig	2009-03-21 23:07:19.177956922 +0900
> +++ linux-2.6.28.8/drivers/ide/pmac.c	2009-03-22 09:57:58.774048828 +0900
> @@ -917,10 +917,19 @@ static u8 pmac_ide_cable_detect(ide_hwif
>  		(pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
>  	struct device_node *np = pmif->node;
>  	const char *cable = of_get_property(np, "cable-type", NULL);
> +	struct device_node *root = of_find_node_by_path("/");
> +	const char *model = of_get_property(root, "model", NULL);
>  
>  	/* Get cable type from device-tree. */
>  	if (cable && !strncmp(cable, "80-", 3))
> +	  {

    Unacceptable style, brace should be on the same line with *if*; run your 
patch thru scripts/checkpatch.pl please...

> +	    /* Some drives fail to detect 80c cable in PowerBook */
> +	    /* These machine use proprietary short IDE cable anyway */

    s/machine/machines/

> +	    if (!strncmp(model,"PowerBook", 9))
> +		return ATA_CBL_PATA40_SHORT;
> +	    else
>  		return ATA_CBL_PATA80;
> +	  }
>  
>  	/*
>  	 * G5's seem to have incorrect cable type in device-tree.

WBR, Sergei

  reply	other threads:[~2009-03-23 10:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-22  1:17 [PATCH] IDE cable detection on Apple PowerBook TOMARI Hisanobu
2009-03-23 10:57 ` Sergei Shtylyov [this message]
2009-03-23 11:11   ` TOMARI Hisanobu
2009-03-23 20:09     ` Bartlomiej Zolnierkiewicz
2009-03-23 23:44       ` TOMARI Hisanobu

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=49C76AFF.5090008@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=benh@kernel.crashing.org \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=posco.grubb@gmail.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).