linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Prarit Bhargava <prarit@sgi.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH]: [RFC] Fix error handlnig in hwif-init and sgiioc4 driver
Date: Thu, 3 Feb 2005 15:46:54 +0100	[thread overview]
Message-ID: <58cb370e050203064648e81449@mail.gmail.com> (raw)
In-Reply-To: <41F79A30.4040900@sgi.com>

On Wed, 26 Jan 2005 08:25:04 -0500, Prarit Bhargava <prarit@sgi.com> wrote:
> I didn't see any ACKs on this so I'm resubmitting....

sorry for the delay

> I discovered an issue where a hwif_init failure lead to /proc/ide files
> being created for devices that failed probes.  This resulted in

create_proc_ide_interfaces() doesn't create /proc/ide files for
hwif->present == 0 interfaces but hwif_init() sets hwif->present
to 0 too late.  Also this hwif->present games are silly and should
be removed after your patch is applied and locking is verified.

> The second part of the fix is to the core IDE layer and to the SGI IOC4
> IDE driver which need to handle errors properly from failed hwif
> initializations.  This patch is attached for review.

please remember about Signed-off-by:

> ===== drivers/ide/ide-probe.c 1.90 vs edited =====
> --- 1.90/drivers/ide/ide-probe.c        2004-12-10 14:12:14 -05:00
> +++ edited/drivers/ide/ide-probe.c      2005-01-14 08:18:43 -05:00
> @@ -841,7 +841,10 @@
>         if (fixup)
>                 fixup(hwif);
> 
> -       hwif_init(hwif);
> +       if (!hwif_init(hwif)) {
> +               printk("%s: Failed to initialize IDE interface\n", hwif->name);
> +               return -1;
> +       }

Could you fix hwif_init() to return meaningful error codes
and return error from hwif_init() instead of '-1'?

>         if (hwif->present) {
>                 u16 unit = 0;
> ===== drivers/ide/pci/sgiioc4.c 1.22 vs edited =====
> --- 1.22/drivers/ide/pci/sgiioc4.c      2005-01-06 20:35:35 -05:00
> +++ edited/drivers/ide/pci/sgiioc4.c    2005-01-14 08:18:56 -05:00
> @@ -669,7 +669,10 @@
>                 printk(KERN_INFO "%s: %s Bus-Master DMA disabled\n",
>                        hwif->name, d->name);
> 
> -       probe_hwif_init(hwif);
> +       if (probe_hwif_init(hwif)) {
> +               printk(KERN_INFO "%s: initialization failed\n", hwif->name);

redundant, error message is printed in probe_hwif_init()

> +               return -EIO;

please fix probe_hwif_init() to return error codes

> +       }
> 
>         /* Create /proc/ide entries */
>         create_proc_ide_interfaces();

I removed redundant printk and applied the patch

  reply	other threads:[~2005-02-03 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-26 13:25 [PATCH]: [RFC] Fix error handlnig in hwif-init and sgiioc4 driver Prarit Bhargava
2005-02-03 14:46 ` Bartlomiej Zolnierkiewicz [this message]
2005-02-08 14:10   ` Prarit Bhargava
2005-02-08 15:53     ` Prarit Bhargava
2005-02-08 16:16       ` Bartlomiej Zolnierkiewicz
2005-02-08 16:49         ` Prarit Bhargava

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=58cb370e050203064648e81449@mail.gmail.com \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=prarit@sgi.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;
as well as URLs for NNTP newsgroup(s).