From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC/PATCH] Block device for the ISS simulator
Date: Fri, 03 Oct 2008 22:21:04 +1000 [thread overview]
Message-ID: <1223036464.12264.183.camel@pasglop> (raw)
In-Reply-To: <20081003120305.GA2229@yoda.jdub.homelinux.org>
On Fri, 2008-10-03 at 08:03 -0400, Josh Boyer wrote:
> On Fri, Oct 03, 2008 at 10:08:42AM +1000, Benjamin Herrenschmidt wrote:
> >+static void iss_blk_setup(struct iss_blk *ib)
> >+{
> >+ unsigned long flags;
> >+ u32 stat;
> >+
> >+ pr_debug("iss_blk_setup %d\n", ib->devno);
> >+
> >+ spin_lock_irqsave(&iss_blk_reglock, flags);
> >+ out_8(iss_blk_regs->data, 0);
> >+ out_be32(&iss_blk_regs->devno, ib->devno);
> >+ out_8(&iss_blk_regs->cmd, ISS_BD_CMD_OPEN);
> >+ stat = in_be32(&iss_blk_regs->stat);
>
> Should probably use the ioread/iowrite functions instead of raw out/in.
> Same comment throughout.
Yeah well, old habits :-)
> >+ pr_debug(" -> ending request, rc = %d\n", rc);
> >+ if (rc)
> >+ end_request(req, 0); /* failure */
> >+ else
> >+ end_request(req, 1); /* success */
>
> Could possibly just do:
>
> end_request(req, (!rc));
I knew copy/pasting from a crap driver was going to come back and bite
me :)
> of_find_node_by_path increments the refcount for that node. Need to
> do an of_node_put when you are done.
Yup, suppose so.
> Shouldn't you unmap iss_blk_regs at this point?
Might be a good idea yeah.
Ben.
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: [RFC/PATCH] Block device for the ISS simulator
Date: Fri, 03 Oct 2008 22:21:04 +1000 [thread overview]
Message-ID: <1223036464.12264.183.camel@pasglop> (raw)
In-Reply-To: <20081003120305.GA2229@yoda.jdub.homelinux.org>
On Fri, 2008-10-03 at 08:03 -0400, Josh Boyer wrote:
> On Fri, Oct 03, 2008 at 10:08:42AM +1000, Benjamin Herrenschmidt wrote:
> >+static void iss_blk_setup(struct iss_blk *ib)
> >+{
> >+ unsigned long flags;
> >+ u32 stat;
> >+
> >+ pr_debug("iss_blk_setup %d\n", ib->devno);
> >+
> >+ spin_lock_irqsave(&iss_blk_reglock, flags);
> >+ out_8(iss_blk_regs->data, 0);
> >+ out_be32(&iss_blk_regs->devno, ib->devno);
> >+ out_8(&iss_blk_regs->cmd, ISS_BD_CMD_OPEN);
> >+ stat = in_be32(&iss_blk_regs->stat);
>
> Should probably use the ioread/iowrite functions instead of raw out/in.
> Same comment throughout.
Yeah well, old habits :-)
> >+ pr_debug(" -> ending request, rc = %d\n", rc);
> >+ if (rc)
> >+ end_request(req, 0); /* failure */
> >+ else
> >+ end_request(req, 1); /* success */
>
> Could possibly just do:
>
> end_request(req, (!rc));
I knew copy/pasting from a crap driver was going to come back and bite
me :)
> of_find_node_by_path increments the refcount for that node. Need to
> do an of_node_put when you are done.
Yup, suppose so.
> Shouldn't you unmap iss_blk_regs at this point?
Might be a good idea yeah.
Ben.
next prev parent reply other threads:[~2008-10-03 12:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-03 0:08 [RFC/PATCH] Block device for the ISS simulator Benjamin Herrenschmidt
2008-10-03 0:08 ` Benjamin Herrenschmidt
2008-10-03 4:44 ` Andi Kleen
2008-10-03 4:44 ` Andi Kleen
2008-10-03 8:35 ` Christoph Hellwig
2008-10-03 8:35 ` Christoph Hellwig
2008-10-03 9:29 ` Benjamin Herrenschmidt
2008-10-03 9:29 ` Benjamin Herrenschmidt
2008-10-03 12:03 ` Josh Boyer
2008-10-03 12:03 ` Josh Boyer
2008-10-03 12:21 ` Benjamin Herrenschmidt [this message]
2008-10-03 12:21 ` Benjamin Herrenschmidt
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=1223036464.12264.183.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=jwboyer@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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.