All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Mark Haverkamp <markh@osdl.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Mark Salyzyn <mark_salyzyn@adaptec.com>
Subject: Re: [PATCH] 2.6 aacraid: rx check health function update
Date: Fri, 5 Nov 2004 08:25:24 +0100	[thread overview]
Message-ID: <20041105072524.GD16649@suse.de> (raw)
In-Reply-To: <1099613392.6249.16.camel@markh1.pdx.osdl.net>

On Thu, Nov 04 2004, Mark Haverkamp wrote:
> This patch updates the rx check health function.  My previous only
> updated the rkt check health code.  This and the previous patch should
> fix the kmalloc return checking bug:
> 
> http://bugme.osdl.org/show_bug.cgi?id=3699 
> 
> Signed-off-by: Mark Haverkamp <markh@osdl.org>
> 
> 
> ===== drivers/scsi/aacraid/rx.c 1.12 vs edited =====
> --- 1.12/drivers/scsi/aacraid/rx.c	2004-11-04 09:32:56 -08:00
> +++ edited/drivers/scsi/aacraid/rx.c	2004-11-04 09:37:33 -08:00
> @@ -274,7 +274,7 @@
>   */
>  static int aac_rx_check_health(struct aac_dev *dev)
>  {
> -	long status = rx_readl(dev, IndexRegs.Mailbox[7]);
> +	u32 status = le32_to_cpu(rx_readl(dev, MUnit.OMRx[0]));
>  
>  	/*
>  	 *	Check to see if the board failed any self tests.
> @@ -285,29 +285,39 @@
>  	 *	Check to see if the board panic'd.
>  	 */
>  	if (status & KERNEL_PANIC) {
> -		char * buffer = kmalloc(512, GFP_KERNEL);
> +		char * buffer;
>  		struct POSTSTATUS {
>  			u32 Post_Command;
>  			u32 Post_Address;
> -		} * post = kmalloc(sizeof(struct POSTSTATUS), GFP_KERNEL);
> -		dma_addr_t paddr = pci_map_single(dev->pdev, post, sizeof(struct POSTSTATUS), 2);
> -		dma_addr_t baddr = pci_map_single(dev->pdev, buffer, 512, 1);
> -		u32 status = -1;
> -		int ret = -2;
> +		} * post;
> +		dma_addr_t paddr, baddr;
> +		int ret;
> +
> +		if ((status & 0xFF000000L) == 0xBC000000L)
> +			return (status >> 16) & 0xFF;
> +		buffer = pci_alloc_consistent(dev->pdev, 512, &baddr);
> +		ret = -2;
> +		if (buffer == NULL)
> +			return ret;

I don't think it's a good idea to return bad adapter health, because you
have an allocation failure.

-- 
Jens Axboe


  reply	other threads:[~2004-11-05  7:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-05  0:09 [PATCH] 2.6 aacraid: rx check health function update Mark Haverkamp
2004-11-05  7:25 ` Jens Axboe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-11-05 13:06 Salyzyn, Mark
2004-11-05 13:16 ` Jens Axboe

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=20041105072524.GD16649@suse.de \
    --to=axboe@suse.de \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mark_salyzyn@adaptec.com \
    --cc=markh@osdl.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.