From: James Bottomley <James.Bottomley@SteelEye.com>
To: Mark Haverkamp <markh@osdl.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
Mark Salyzyn <mark_salyzyn@adaptec.com>
Subject: Re: [PATCH] 2.6 aacraid: Variable FIB size
Date: Mon, 16 May 2005 10:09:24 -0500 [thread overview]
Message-ID: <1116256165.5040.10.camel@mulgrave> (raw)
In-Reply-To: <1115763750.10955.5.camel@markh1.pdx.osdl.net>
On Tue, 2005-05-10 at 15:22 -0700, Mark Haverkamp wrote:
> rcode = fib_send(RequestAdapterInfo,
> - fibptr,
> - sizeof(struct aac_adapter_info),
> - FsaNormal,
> - 1, 1,
> - NULL,
> + fibptr,
> + sizeof(*info),
> + FsaNormal,
> + 1, 1,
> + NULL,
> + NULL);
This is a formatting change that makes the driver harder to read. If
you want one argument per line, they should at least line up with the
opening bracket of the function.
> for (i = 0; i < sg_count; i++) {
> - psg->sg[i].addr = cpu_to_le32(sg_dma_address(sg));
> - psg->sg[i].count = cpu_to_le32(sg_dma_len(sg));
> - byte_count += sg_dma_len(sg);
> + int count = sg_dma_len(sg);
> + u32 addr = sg_dma_address(sg);
> + if (host->max_sectors < AAC_MAX_32BIT_SGBCOUNT)
> + while (count > 65536) {
> + psg->sg[i].addr = cpu_to_le32(addr);
> + psg->sg[i].count = cpu_to_le32(65536);
> + ++i;
> + if (++sg_count > host->sg_tablesize) {
> + BUG();
> + }
> + byte_count += 65536;
> + addr += 65536;
> + count -= 65536;
> + }
This is wrong. You're basically assuming the block layer is returning
something that goes over your segment descriptor size.
There's no API for this in SCSI, but what you should be doing is
blk_queue_max_segment_size(sdev->request_queue, 65536);
in your slave_configure routine.
James
next prev parent reply other threads:[~2005-05-16 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-10 22:22 [PATCH] 2.6 aacraid: Variable FIB size Mark Haverkamp
2005-05-16 15:09 ` James Bottomley [this message]
2005-05-16 18:28 ` [PATCH] 2.6 aacraid: Variable FIB size (updated patch) Mark Haverkamp
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=1116256165.5040.10.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mark_salyzyn@adaptec.com \
--cc=markh@osdl.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