public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Brent Casavant <bcasavan@sgi.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 2/2] external interrupts: IOC4 driver
Date: Sat, 20 Aug 2005 10:52:09 +0100	[thread overview]
Message-ID: <20050820095209.GD21698@infradead.org> (raw)
In-Reply-To: <20050819161213.B87000@chenjesu.americas.sgi.com>

> +config EXTINT_SGI_IOC4
> +	tristate "Device driver for SGI IOC4 external interrupts"
> +	depends on (IA64_GENERIC || IA64_SGI_SN2) && EXTINT && BLK_DEV_SGIIOC4

Is the ioc4 core abstraction config symbol really BLK_DEV_SGIIOC4?
That probably wants fixing in a separate patch.

> +	  This option enables support for the external interrupt ingest
> +	  and generation capabilities of SGI IOC4 IO controllers.  If
> +	  you have an SGI Altix with an IOC4 based IO card, say Y.
> +	  Otherwise, say N.

Is there any Altix without an ioc4?

> + */
> +static ssize_t ioc4_extint_get_modelist(struct extint_device *ed, char *buf) {

opening brace on a separate line please.

> +#if PAGE_SIZE <= IOC4_A_INT_OUT_LENGTH
> +	/* Only set up INT_OUT register alias page if the system page size
> +	 * is equal to or less than the register alias page size.  Otherwise
> +	 * the user would have access to registers other than INT_OUT.
> +	 */
> +	a_int_out = pci_resource_start(ied->idd->idd_pdev, 0) +
> +	    IOC4_A_INT_OUT_OFFSET;
> +	if (!a_int_out) {
> +		printk(KERN_WARNING
> +		       "%s: Unable to get IOC4 int_out alias mapping "
> +		       "for pci_dev 0x%p.\n", __FUNCTION__, ied->idd->idd_pdev);
> +		goto skip_alias;
> +	}
> +	if (!request_region(a_int_out, IOC4_A_INT_OUT_LENGTH,
> +			    "ioc4_a_int_out")) {

This looks rather bad.  So the driver silently has less functionality
when using a bigger page size?

> +	/* Enable interrupt input */
> +	ret = ioc4_extint_input_enable(ied);
> +	if (ret)
> +		goto out_enable;
> +
> +	return 0;
> +
> +out_enable:
> +	extint_device_unregister(idd->idd_extint_data);
> +out_register:
> +	ioc4_extint_device_destroy(ied);
> +out_device:
> +	ioc4_extint_input_teardown(ied);
> +	ioc4_extint_output_teardown(ied);
> +	kfree(ied);
> +out:
> +	return ret;
> +}
> +
> +static int ioc4_extint_remove(struct ioc4_driver_data *idd)
> +{
> +	struct extint_device *ed = idd->idd_extint_data;
> +	struct ioc4_extint_device *ied;
> +
> +	/* If probe failed, avoid trying to remove */
> +	if (ed)
> +		ied = extint_get_devdata(ed);
> +	else
> +		return -ENXIO;

This should at lease be written:

	if (!ed)
		return -ENXIO;
	ied = extint_get_devdata(ed);

but I don't understand how it can happen anyway.  ->remove shoould
never be called unless ->probe initialized the device fully and
returned 0


  reply	other threads:[~2005-08-20  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-19 21:56 [PATCH 2/2] external interrupts: IOC4 driver Brent Casavant
2005-08-20  9:52 ` Christoph Hellwig [this message]
2005-08-23 22:17   ` Brent Casavant
  -- strict thread matches above, loose matches on Subject: below --
2005-07-28 21:13 Brent Casavant

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=20050820095209.GD21698@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@osdl.org \
    --cc=bcasavan@sgi.com \
    --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