From: Richard Purdie <rpurdie@rpsys.net>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Linux-ide <linux-ide@vger.kernel.org>
Subject: Re: [PATCH 10/11] LED: Add IDE disk activity LED trigger
Date: Sat, 04 Feb 2006 15:29:54 +0000 [thread overview]
Message-ID: <1139066994.8064.12.camel@localhost.localdomain> (raw)
In-Reply-To: <58cb370e0601310944l421174f8j1802d94f1ae93a01@mail.gmail.com>
Hi,
On Tue, 2006-01-31 at 18:44 +0100, Bartlomiej Zolnierkiewicz wrote:
> > The trigger started out as just being ide-disk.c based but there is no
> > place where the IDE end request function could be hooked within it due
> > to its use of generic functions. The trigger therefore had to move into
> > more generic code. If there was a point in ide-disk where an IDE end
> > request could be hooked it, it could be confined to that file.
>
> Isn't ->end_request hook in ide_driver_t enough?
>
> I see no reason why the custom ->end_request function cannot
> be added to ide-disk. All needed infrastructure is there.
Not quite as I tried that once and it didn't intercept every
->end_request call. I've just traced this to an explicit call to
ide_end_request() rather than drv->end_request() in ide-taskfile.c
The patch below might or might not be an appropriate fix. With this
applied, the led trigger simplifies to:
http://www.rpsys.net/openzaurus/patches/led_ide-r3.patch
Richard
Ensure ide-taskfile.c calls any driver specific end_request function
if present.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Index: linux-2.6.15/drivers/ide/ide-taskfile.c
===================================================================
--- linux-2.6.15.orig/drivers/ide/ide-taskfile.c 2006-01-03 03:21:10.000000000 +0000
+++ linux-2.6.15/drivers/ide/ide-taskfile.c 2006-02-04 14:02:23.000000000 +0000
@@ -372,7 +372,13 @@
}
}
- ide_end_request(drive, 1, rq->hard_nr_sectors);
+ if (rq->rq_disk) {
+ ide_driver_t *drv;
+
+ drv = *(ide_driver_t **)rq->rq_disk->private_data;;
+ drv->end_request(drive, 1, rq->hard_nr_sectors);
+ } else
+ ide_end_request(drive, 1, rq->hard_nr_sectors);
}
/*
prev parent reply other threads:[~2006-02-04 15:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1138714918.6869.139.camel@localhost.localdomain>
[not found] ` <58cb370e0601310646y263acb96h62c422435e7016e@mail.gmail.com>
[not found] ` <1138724479.6869.201.camel@localhost.localdomain>
2006-01-31 17:44 ` [PATCH 10/11] LED: Add IDE disk activity LED trigger Bartlomiej Zolnierkiewicz
2006-01-31 20:29 ` Jens Axboe
2006-01-31 22:08 ` Benjamin Herrenschmidt
2006-01-31 23:39 ` Richard Purdie
2006-02-04 15:29 ` Richard Purdie [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=1139066994.8064.12.camel@localhost.localdomain \
--to=rpurdie@rpsys.net \
--cc=benh@kernel.crashing.org \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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