From: Christoph Hellwig <hch@lst.de>
To: Lauri Kasanen <cand@gmx.com>
Cc: Christoph Hellwig <hch@lst.de>,
axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH] n64cart: fix the dma address in n64cart_do_bvec
Date: Wed, 4 Aug 2021 12:02:03 +0200 [thread overview]
Message-ID: <20210804100203.GA20072@lst.de> (raw)
In-Reply-To: <20210804130136.55f633eeb4522f844463159a@gmx.com>
On Wed, Aug 04, 2021 at 01:01:36PM +0300, Lauri Kasanen wrote:
> > diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c
> > index 7b4dd10af9ec..c84be0028f63 100644
> > --- a/drivers/block/n64cart.c
> > +++ b/drivers/block/n64cart.c
> > @@ -74,7 +74,7 @@ static bool n64cart_do_bvec(struct device *dev, struct bio_vec *bv, u32 pos)
> >
> > n64cart_wait_dma();
> >
> > - n64cart_write_reg(PI_DRAM_REG, dma_addr + bv->bv_offset);
> > + n64cart_write_reg(PI_DRAM_REG, dma_addr);
> > n64cart_write_reg(PI_CART_REG, (bstart | CART_DOMAIN) & CART_MAX);
> > n64cart_write_reg(PI_WRITE_REG, bv->bv_len - 1);
>
> Hm, then how did it work? Does it always happen to be zero?
It isn't always zero, but for your use cases it might. That is if
you have a page aligned buffer (e.g. the page cache) it tends to be
zero.
> Have you tested this? I don't have the equipment currently.
No, I don't. I'm just auditing uses of bv_offset and this one is
clearly bogus.
next prev parent reply other threads:[~2021-08-04 10:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 9:49 [PATCH] n64cart: fix the dma address in n64cart_do_bvec Christoph Hellwig
2021-08-04 10:01 ` Lauri Kasanen
2021-08-04 10:02 ` Christoph Hellwig [this message]
2021-08-04 10:16 ` Lauri Kasanen
2021-08-04 17:15 ` 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=20210804100203.GA20072@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=cand@gmx.com \
--cc=linux-block@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 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.