From: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: achim_leubner@adaptec.com,
SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] fix gcc warning on 64 bit compile of gdth
Date: Tue, 4 Jan 2005 04:52:03 +0000 [thread overview]
Message-ID: <20050104045203.GA26051@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <1104796418.5506.81.camel@mulgrave>
On Mon, Jan 03, 2005 at 05:53:38PM -0600, James Bottomley wrote:
> On Mon, 2005-01-03 at 22:54 +0000, Al Viro wrote:
> > ... and dma_handle *is* dma_addr_t and gets used in exact same driver to
> > store the results of the same function (grep for pci_map_page in there).
>
> Fine. But I usually observe the rule of tamper minimally ... drivers
> have a nasty habit of sticking to you if you do more than that.
>
> Indeed, now I look at the cleaned up patch, the think will leak DMA
> mappings if sense_paddr is zero (which is quite possible, since zero is
> a valid bus physical address). However, I'm declaring this too minimal
> to bother with ... unless you want to fix it?
After looking at the source some more... NAK. Turns out that there was
a reason to avoid reuse of ->dma_handle here. What happens is that we might
map *two* things in gdth_fill_raw_command() - scp->sense_data and
possibly scp->request_buffer. So yes, there is a reason for not reusing
->dma_handle - it's used for the latter.
So ->dma_handle is not a solution. However, "shove it into ->Buffer
and ->host_scribble" is not a solution either, AFAICS.
a) the problem you've found with code that unmaps stuff. Probably
should be handled by looking at ->SCp.Status instead of ->SCp.Buffer and
setting a bit in .Status in the same place where we are currently setting
.Buffer.
b) AFAICS, driver blindly assumes that pci_map_page() and friends
never fail. Probably should be checked in gdth_fill_..._cmd() so we could
bail out before we feed fsck knows what to the hardware...
c) this "shove dma_address_t into two pointers" is, indeed, fscking
ugly and brittle (note e.g. the bug with checking lower 32 bits first and
then adding upper 32 from ->host_scribble only if they were not all 0).
What do other drivers do when they want more than one mapping?
Comments?
next prev parent reply other threads:[~2005-01-04 4:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-03 21:45 [PATCH] fix gcc warning on 64 bit compile of gdth James Bottomley
2005-01-03 22:43 ` Al Viro
2005-01-03 22:49 ` James Bottomley
2005-01-03 22:54 ` Al Viro
2005-01-03 23:53 ` James Bottomley
2005-01-04 4:52 ` Al Viro [this message]
2005-01-04 8:27 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2005-01-04 9:29 Leubner, Achim
2005-01-04 9:32 ` Arjan van de Ven
2005-01-04 10:29 ` Al Viro
2005-01-05 11:19 ` Christoph Hellwig
2005-01-04 14:55 ` James Bottomley
2005-01-05 11:19 ` Christoph Hellwig
2005-01-04 10:57 Leubner, Achim
2005-01-04 11:53 ` Al Viro
2005-01-04 12:08 Leubner, Achim
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=20050104045203.GA26051@parcelfarce.linux.theplanet.co.uk \
--to=viro@parcelfarce.linux.theplanet.co.uk \
--cc=James.Bottomley@SteelEye.com \
--cc=achim_leubner@adaptec.com \
--cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox