From: Paul Mundt <lethal@linux-sh.org>
To: Adrian McMenamin <lkmladrian@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>,
linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] SH/Dreamcast - add support for GD-Rom device
Date: Thu, 27 Dec 2007 08:18:22 +0000 [thread overview]
Message-ID: <20071227081822.GA22693@linux-sh.org> (raw)
In-Reply-To: <8b67d60712261726l28960f69u2eb2756a6f5176e1@mail.gmail.com>
On Thu, Dec 27, 2007 at 01:26:47AM +0000, Adrian McMenamin wrote:
> This patch adds support for the CD-Rom drive on the SEGA Dreamcast.
>
Please fix your mailer to inline the patch, preferably without word
wrapping. This is not a difficult thing, send yourself some test mails
until you get it sorted out.
> diff -rupN linux-2.6-orig/drivers/block/Kconfig linux-2.6/drivers/block/Kconfig
> --- linux-2.6-orig/drivers/block/Kconfig 2007-12-26 17:27:14.000000000 +0000
> +++ linux-2.6/drivers/block/Kconfig 2007-12-27 00:08:39.000000000 +0000
> @@ -105,6 +105,18 @@ config PARIDE
> "MicroSolutions backpack protocol", "DataStor Commuter protocol"
> etc.).
>
> +config GDROM
Why is this using a tab?
> + tristate "SEGA Dreamcast GD-ROM drive"
> + depends on SH_DREAMCAST
> + help
> + A standard SEGA Dreamcast comes with a modified CD ROM drive called a
> + "GD-ROM" by SEGA to signify it is capable of reading special disks
> + with up to 1 GB of data. This drive will also read standard CD ROM
> + disks. Select this option to access any disks in your GD ROM drive.
> + Most users will want to say "Y" here.
> + You can also build this as a module which will be called gdrom.ko
> +
> +
Superfluous whitespace.
> +static int gdrom_get_last_session(struct cdrom_device_info *cd_info, struct cdrom_multisession *ms_info)
> +{
> + int fentry, lentry, track, data, tocuse, err;
> + kfree(gd.toc);
> + gd.toc = kzalloc(sizeof(struct gdromtoc), GFP_KERNEL);
Er, what? The size of this never changes, allocate it once, and just
overload it every time you step in to this function. There's no reason to
free it and reallocate every time. Shove it in your probe routine with
the rest of your kzallocs.
> +/* keep the function loioking like the universal CD Rom specification - returning int*/
looking.
> +static int gdrom_set_command_interrupt_handler(void)
> +{
> + /* need a queue to wait in */
> + init_waitqueue_head(&command_queue);
> + return request_irq(HW_EVENT_GDROM_CMD, gdrom_command_interrupt, IRQF_DISABLED, "gdrom_command", &gd);
> +}
> +
> +static int gdrom_set_dma_interrupt_handler(void)
> +{
> + init_waitqueue_head(&request_queue);
> + return request_irq(HW_EVENT_GDROM_DMA, gdrom_dma_interrupt, IRQF_DISABLED, "gdrom_dma", &gd);
> +}
> +
Having separate functions for these is pretty pointless.
> + spin_lock(&gdrom_lock);
> + list_for_each_safe(elem, next, &gdrom_deferred) {
> + req = list_entry(elem, struct request, queuelist);
> + spin_unlock(&gdrom_lock);
[snip]
> + /* now seek to take the request spinlock
> + * before handling ending the request */
> + spin_lock(&gdrom_lock);
> + list_del_init(&req->queuelist);
> + blk_requeue_request(gd.gdrom_rq, req);
> + if (err)
> + end_request(req, 0);
> + else
> + end_request(req, 1);
> + }
> + spin_unlock(&gdrom_lock);
> + kfree(read_command);
> +}
> +
This locking is all over the place. What is this lock supposed to be
accomplishing?
next prev parent reply other threads:[~2007-12-27 8:18 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-27 1:26 [PATCH] SH/Dreamcast - add support for GD-Rom device Adrian McMenamin
2007-12-27 8:18 ` Paul Mundt [this message]
2007-12-27 12:49 ` Adrian McMenamin
2007-12-27 19:52 ` Jens Axboe
2007-12-27 19:11 ` Mike Frysinger
2007-12-27 16:52 ` Adrian McMenamin
2007-12-27 20:56 ` Adrian McMenamin
2007-12-27 22:20 ` Paul Mundt
2007-12-27 22:58 ` Joe Perches
2007-12-28 0:18 ` Simon Holm Thøgersen
2007-12-29 1:57 ` Joe Perches
2007-12-29 12:03 ` Adrian McMenamin
2007-12-29 12:10 ` Adrian McMenamin
2007-12-29 18:07 ` Joe Perches
2007-12-28 0:49 ` Mike Frysinger
2007-12-28 3:41 ` Paul Mundt
2007-12-28 19:17 ` Gino Badouri
2007-12-28 22:09 ` Joe Perches
2007-12-30 13:38 ` Adrian McMenamin
2007-12-31 5:23 ` Paul Mundt
2008-01-10 23:25 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Adrian McMenamin
2008-01-11 21:56 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-12 11:57 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Jens Axboe
2008-01-12 13:36 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Andrew Morton
2008-01-12 14:14 ` Adrian McMenamin
2008-01-12 19:15 ` Andrew Morton
2008-01-13 18:24 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Adrian McMenamin
2008-01-14 23:00 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-14 23:17 ` Adrian McMenamin
2008-01-15 0:29 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Paul Mundt
2008-01-15 20:41 ` Adrian McMenamin
2008-01-16 23:57 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-17 1:27 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Paul Mundt
2008-01-17 22:30 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Adrian McMenamin
2008-01-18 0:56 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Paul Mundt
2008-01-28 5:33 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on Andrew Morton
2008-01-28 5:53 ` [PATCH] SH/Dreamcast - add support for GD-Rom CDROM drive on SEGA Dreamcast Paul Mundt
2008-01-16 1:57 ` Paul Mundt
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=20071227081822.GA22693@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=lkmladrian@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