linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Schlemmer <azarah@nosferatu.za.org>
To: Alan Cox <alan@redhat.com>
Cc: linux-ide@vger.kernel.org,
	Linux Kernel Mailing Lists <linux-kernel@vger.kernel.org>,
	torvalds@osdl.org
Subject: Re: PATCH: fixup incomplete ident blocks on ITE raid volumes
Date: Sun, 15 Aug 2004 22:28:13 +0200	[thread overview]
Message-ID: <1092601693.8976.140.camel@nosferatu.lan> (raw)
In-Reply-To: <20040815144527.GA7983@devserv.devel.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2602 bytes --]

On Sun, 2004-08-15 at 16:45, Alan Cox wrote:
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.8-rc3/drivers/ide/ide-probe.c linux-2.6.8-rc3/drivers/ide/ide-probe.c
> --- linux.vanilla-2.6.8-rc3/drivers/ide/ide-probe.c	2004-08-09 15:51:00.000000000 +0100
> +++ linux-2.6.8-rc3/drivers/ide/ide-probe.c	2004-08-14 21:03:03.000000000 +0100
> @@ -542,7 +542,51 @@
>  }
>  
>  /**
> - *	probe_for_drives	-	upper level drive probe
> + *	ident_quirks	-	drive ident mangler
> + *	@drive: drive to check
> + *
> + *	Take the returned ident block for the drive and see if it
> + *	is one of the broken ones. We still broken ident fixups in
> + *	multiple places, we should migrate some of the others here.
> + */
> +static void ident_quirks(ide_drive_t *drive)
> +{
> +	struct hd_driveid *id = drive->id;
> +	u16 *idbits = (u16 *)id;
> +	
> +	if(strstr(id->model, "Integrated Technology Express"))
> +	{
> +		/* IT821x raid volume with bogus ident block */
> +		if(id->lba_capacity >= 0x200000)
> +		{
> +			id->sectors = 63;
> +			id->heads = 255;
> +		}
> +		else
> +		{
> +			id->sectors = 32;
> +			id->heads = 64;
> +		}
> +		id->cyls = 1 + id->lba_capacity_2 / (id->heads * id->sectors);
> +		/* LBA28 is ok, DMA is ok, UDMA data is valid */
> +		id->capability |= 3;
> +		id->field_valid |= 7;
> +		/* LBA48 is ok */
> +		id->command_set_2 |= 0x0400;
> +		id->cfs_enable_2 |= 0x0400;
> +		/* Flush is ok */
> +		id->cfs_enable_2 |= 0x3000;
> +		printk(KERN_WARNING "%s: IT8212 %sRAID %d volume",
> +			drive->name,
> +			idbits[147] ? "Bootable ":"",
> +			idbits[129]);
> +		if(idbits[129] != 1)
> +			printk("(%dK stripe)", idbits[146]);
> +		printk(".\n");
> +	}		
> +}
> +/**
> + *	probe_for_drive	-	upper level drive probe
>   *	@drive: drive to probe for
>   *
>   *	probe_for_drive() tests for existence of a given drive using do_probe()
> @@ -553,7 +597,7 @@
>   *			   still be 0)
>   */
>   
> -static inline u8 probe_for_drive (ide_drive_t *drive)
> +static u8 probe_for_drive(ide_drive_t *drive)
>  {
>  	/*
>  	 *	In order to keep things simple we have an id
> @@ -602,6 +646,7 @@
>  				drive->present = 0;
>  			}
>  		}
> +		ident_quirks(drive);
>  		/* drive was found */
>  	}
>  	if(!drive->present)
> 
> 
> Signed-off-by: Alan Cox
> 

This one is cause this:

---
  LD      .tmp_vmlinux1
drivers/built-in.o(.text+0x6ef1f): In function `ident_quirks':
: undefined reference to `__udivdi3'
make: *** [.tmp_vmlinux1] Error 1
---


Regards,

-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-08-15 20:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-15 14:45 PATCH: fixup incomplete ident blocks on ITE raid volumes Alan Cox
2004-08-15 20:28 ` Martin Schlemmer [this message]
2004-08-15 20:27   ` Alan Cox
2004-08-16 15:16 ` Bartlomiej Zolnierkiewicz
2004-08-16 15:28   ` Alan Cox
2004-08-16 14:57     ` Alan Cox

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=1092601693.8976.140.camel@nosferatu.lan \
    --to=azarah@nosferatu.za.org \
    --cc=alan@redhat.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 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).