All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Cc: Mikael Pettersson <mikpe@it.uu.se>,
	alan@lxorguk.ukuu.org.uk, benh@kernel.crashing.org,
	arnd@arndb.de, kou.ishizaki@toshiba.co.jp, linas@austin.ibm.com,
	linux-ide@vger.kernel.org, linuxppc-dev@ozlabs.org,
	paulus@samba.org
Subject: Re: [PATCH 2/4] libata-core.c: add another IRQ calls
Date: Wed, 24 Jan 2007 20:17:49 -0500	[thread overview]
Message-ID: <45B8053D.3000007@garzik.org> (raw)
In-Reply-To: <200701180055.l0I0tl6M021051@toshiba.co.jp>

Akira Iguchi wrote:
>> The real benefits from identifying a common case is to inline
>> the code for it. So the fact that the common case is still a
>> full-blown function call here and not inline code means that
>> there's much less benefit from rewriting an indirect call as
>> an if/indirect/direct sequence.
> 
> According to your comment, this patch adds IRQ calls (irq_on, irq_ack)
> to each driver and always uses these indirect calls.
> 
> For irq_on, most drivers use ata_irq_on(). Some drivers
> (ahci.c, sata_sil24.c) use ata_dummy_irq_on() because they
> don't have either explicit or implicit assignment (ex: ata_pci_init_one)
> of ctl_addr.
> 
> For irq_ack, ata_irq_ack() is used.
> 
> Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
> Signed-off-by: Akira Iguchi <akira2.iguchi@toshiba.co.jp>

very close to perfect :)

ahci and sata_sil24 need dummy functions for ->irq_ack().  As you can 
see, ata_irq_ack() is only used in debug situations, and it [the current 
code] is very wrong for ahci and sata_sil24.

Also, please split up the patch into two pieces:  (1) update core and 
headers, and (2) update every driver.


> diff -uprN -X linux-2.6.20-rc4/Documentation/dontdiff linux-2.6.20-rc4/include/linux/libata.h linux-2.6.20-rc4.mod/include/linux/libata.h
> --- linux-2.6.20-rc4/include/linux/libata.h	2007-01-17 23:23:27.000000000 +0900
> +++ linux-2.6.20-rc4.mod/include/linux/libata.h	2007-01-17 23:24:49.000000000 +0900
> @@ -638,6 +638,8 @@ struct ata_port_operations {
>  
>  	irq_handler_t irq_handler;
>  	void (*irq_clear) (struct ata_port *);
> +	u8 (*irq_on) (struct ata_port *);
> +	u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
>  
>  	u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
>  	void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
> @@ -761,6 +763,7 @@ extern void ata_port_queue_task(struct a
>  extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
>  			     unsigned long interval_msec,
>  			     unsigned long timeout_msec);
> +u8 ata_irq_on(struct ata_port *ap);
>  
>  /*
>   * Default driver ops implementations
> @@ -1202,6 +1205,8 @@ static inline u8 ata_irq_ack(struct ata_
>  	return status;
>  }
>  
> +static inline u8 ata_dummy_irq_on (struct ata_port *ap)	{ return 0; }
> +

This won't work, you need to create a non-inline function and 
EXPORT_SYMBOL_GPL it.

	Jeff



WARNING: multiple messages have this Message-ID (diff)
From: Jeff Garzik <jeff@garzik.org>
To: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Cc: Mikael Pettersson <mikpe@it.uu.se>,
	arnd@arndb.de, linuxppc-dev@ozlabs.org,
	linux-ide@vger.kernel.org, paulus@samba.org,
	alan@lxorguk.ukuu.org.uk
Subject: Re: [PATCH 2/4] libata-core.c: add another IRQ calls
Date: Wed, 24 Jan 2007 20:17:49 -0500	[thread overview]
Message-ID: <45B8053D.3000007@garzik.org> (raw)
In-Reply-To: <200701180055.l0I0tl6M021051@toshiba.co.jp>

Akira Iguchi wrote:
>> The real benefits from identifying a common case is to inline
>> the code for it. So the fact that the common case is still a
>> full-blown function call here and not inline code means that
>> there's much less benefit from rewriting an indirect call as
>> an if/indirect/direct sequence.
> 
> According to your comment, this patch adds IRQ calls (irq_on, irq_ack)
> to each driver and always uses these indirect calls.
> 
> For irq_on, most drivers use ata_irq_on(). Some drivers
> (ahci.c, sata_sil24.c) use ata_dummy_irq_on() because they
> don't have either explicit or implicit assignment (ex: ata_pci_init_one)
> of ctl_addr.
> 
> For irq_ack, ata_irq_ack() is used.
> 
> Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
> Signed-off-by: Akira Iguchi <akira2.iguchi@toshiba.co.jp>

very close to perfect :)

ahci and sata_sil24 need dummy functions for ->irq_ack().  As you can 
see, ata_irq_ack() is only used in debug situations, and it [the current 
code] is very wrong for ahci and sata_sil24.

Also, please split up the patch into two pieces:  (1) update core and 
headers, and (2) update every driver.


> diff -uprN -X linux-2.6.20-rc4/Documentation/dontdiff linux-2.6.20-rc4/include/linux/libata.h linux-2.6.20-rc4.mod/include/linux/libata.h
> --- linux-2.6.20-rc4/include/linux/libata.h	2007-01-17 23:23:27.000000000 +0900
> +++ linux-2.6.20-rc4.mod/include/linux/libata.h	2007-01-17 23:24:49.000000000 +0900
> @@ -638,6 +638,8 @@ struct ata_port_operations {
>  
>  	irq_handler_t irq_handler;
>  	void (*irq_clear) (struct ata_port *);
> +	u8 (*irq_on) (struct ata_port *);
> +	u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
>  
>  	u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
>  	void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
> @@ -761,6 +763,7 @@ extern void ata_port_queue_task(struct a
>  extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
>  			     unsigned long interval_msec,
>  			     unsigned long timeout_msec);
> +u8 ata_irq_on(struct ata_port *ap);
>  
>  /*
>   * Default driver ops implementations
> @@ -1202,6 +1205,8 @@ static inline u8 ata_irq_ack(struct ata_
>  	return status;
>  }
>  
> +static inline u8 ata_dummy_irq_on (struct ata_port *ap)	{ return 0; }
> +

This won't work, you need to create a non-inline function and 
EXPORT_SYMBOL_GPL it.

	Jeff

  parent reply	other threads:[~2007-01-25  1:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-17  9:24 [PATCH 2/4] libata-core.c: add another IRQ calls Mikael Pettersson
2007-01-17  9:24 ` Mikael Pettersson
2007-01-17 16:49 ` Jeff Garzik
2007-01-17 16:49   ` Jeff Garzik
2007-01-17 20:31   ` Mikael Pettersson
2007-01-17 20:31     ` Mikael Pettersson
2007-01-18  0:55     ` Akira Iguchi
2007-01-18  1:29       ` [PATCH] driver/ata: PATA driver for Celleb Akira Iguchi
2007-01-25  1:20         ` Jeff Garzik
2007-01-25  1:20           ` Jeff Garzik
2007-01-25  3:45           ` Benjamin Herrenschmidt
2007-01-25  3:45             ` Benjamin Herrenschmidt
2007-01-18  1:29       ` Akira Iguchi
2007-01-25  1:17       ` Jeff Garzik [this message]
2007-01-25  1:17         ` [PATCH 2/4] libata-core.c: add another IRQ calls Jeff Garzik
2007-01-18  0:55     ` Akira Iguchi
  -- strict thread matches above, loose matches on Subject: below --
2007-01-16 10:46 Akira Iguchi
2007-01-16 12:03 ` Alan
2007-01-16 12:03   ` Alan
2007-01-16 22:04   ` Jeff Garzik
2007-01-16 22:04     ` Jeff Garzik
2007-01-16 10:46 Akira Iguchi

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=45B8053D.3000007@garzik.org \
    --to=jeff@garzik.org \
    --cc=akira2.iguchi@toshiba.co.jp \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=kou.ishizaki@toshiba.co.jp \
    --cc=linas@austin.ibm.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikpe@it.uu.se \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.