Re: [PATCH] n64cart: fix the dma address in n64cart_do_bvec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux