From: Steven Scholz <steven.scholz@imc-berlin.de>
To: Sergey Vlasov <vsu@altlinux.ru>
Cc: linux-ide@vger.kernel.org
Subject: Re: hotplug event on fdisk?
Date: Mon, 18 Jul 2005 08:49:00 +0200 [thread overview]
Message-ID: <42DB50DC.3040404@imc-berlin.de> (raw)
In-Reply-To: <20050716212452.531e0a84.vsu@altlinux.ru>
Sergey,
>> ...
>>Why is it so? And what is the system suposed to do? Actually remove
>>the device?
>
>
> Looking at the size of your device (512 MB), I guess that it is some
> king of flash drive. Such devices pretend to be removable hard disks -
> and here the "removable" bit causes trouble.
Indeed I was talking about a CF Flash Card in a CF socket.
> ...
> Anyway, here is the patch with such workaround for CompactFlash (against
> the current git tree, but it should also apply to earlier kernels with
> some fuzz).
>
> ---
> Subject: [PATCH] Avoid superfluous rechecking of partitions for IDE flash drives
>
> For some reason, IDE flash drives report that they have removable media,
> which is not really correct - the drive as a whole is removed, therefore
> rescanning of the partition table on the first open of such devices is
> just a waste of time.
>
> Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
>
> diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
> --- a/drivers/ide/ide-disk.c
> +++ b/drivers/ide/ide-disk.c
> @@ -1174,6 +1174,14 @@ static int idedisk_media_changed(struct
> struct ide_disk_obj *idkp = ide_disk_g(disk);
> ide_drive_t *drive = idkp->drive;
>
> + /*
> + * PCMCIA flash drives report themselves as removable, but can be
> + * treated as fixed - when such device is removed, its IDE controller
> + * also disappears.
> + */
> + if (drive->is_flash)
> + return 0;
> +
> /* do not scan partitions twice if this is a removable device */
> if (drive->attach) {
> drive->attach = 0;
Is "drive->is_flash" set for mechanical PCMCIA hard disk drives (like
Microdrives) as well?
--
Steven
prev parent reply other threads:[~2005-07-18 6:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-12 15:57 hotplug event on fdisk? Steven Scholz
2005-07-16 17:24 ` Sergey Vlasov
2005-07-18 6:49 ` Steven Scholz [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=42DB50DC.3040404@imc-berlin.de \
--to=steven.scholz@imc-berlin.de \
--cc=linux-ide@vger.kernel.org \
--cc=vsu@altlinux.ru \
/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).