From: Jeff Garzik <jeff@garzik.org>
To: Grant Grundler <grundler@google.com>
Cc: Ke Wei <kewei.mv@gmail.com>,
linux-scsi@vger.kernel.org, kewei@marvell.com,
qswang@marvell.com, jfeng@marvell.com, qzhao@marvell.com
Subject: Re: [PATCH] Marvell 6440 SAS/SATA driver
Date: Fri, 25 Jan 2008 17:12:50 -0500 [thread overview]
Message-ID: <479A5EE2.1010908@garzik.org> (raw)
In-Reply-To: <da824cf30801250924i5e8cd5c6pe07215a4298ab8a4@mail.gmail.com>
Grant Grundler wrote:
> On Jan 25, 2008 8:43 AM, Ke Wei <kewei.mv@gmail.com> wrote:
>> The attached is Marvell 6440 SAS/SATA driver. I will try to send email
>> by git-send-email.
>
> I know this isn't part of this patch:
> #define mr32(reg) readl(regs + MVS_##reg)
> #define mw32(reg,val) writel((val), regs + MVS_##reg)
>
> But can "regs" be declared a parameter to the macro?
This is a common technique in drivers (especially net drivers),
eliminating the redundant-across-the-entire-driver argument passed to
each register read or write. The result is infinitely more readable and
compact.
val = mr32(IRQ_STAT);
immediately communicates all the necessary information you need.
> + MODE_AUTO_DET_PORT7 = (1U << 15), /* port0 SAS/SATA autodetect */
> + MODE_AUTO_DET_PORT6 = (1U << 14),
> + MODE_AUTO_DET_PORT5 = (1U << 13),
> + MODE_AUTO_DET_PORT4 = (1U << 12),
> + MODE_AUTO_DET_PORT3 = (1U << 11),
> + MODE_AUTO_DET_PORT2 = (1U << 10),
> + MODE_AUTO_DET_PORT1 = (1U << 9),
> + MODE_AUTO_DET_PORT0 = (1U << 8),
>
> These really aren't needed.
Like James noted, without public docs, we don't want to be removing any
hardware definitions.
> Have to stop for now...but I'm wonder how this driver ever worked
> given the number of HW register bits that were changed (assuming
> they were wrong before this patch). And this driver looks _alot_
> better than the previous Marvell drivers I've looked at. Please keep
> up the good work! :)
Before this patch, the driver did not work. As I do with all other
drivers I write, I write the entire driver from the datasheet before
testing anything.
Jeff
next prev parent reply other threads:[~2008-01-25 22:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080122151857.GA8680@ubuntu.domain>
2008-01-22 15:24 ` [PATCH] Marvell 6440 SAS/SATA driver Ke Wei
2008-01-23 3:58 ` Jeff Garzik
2008-01-23 10:54 ` Ke Wei
2008-01-23 11:41 ` Jeff Garzik
2008-01-25 16:43 ` Ke Wei
2008-01-25 17:24 ` Grant Grundler
2008-01-25 17:38 ` James Bottomley
2008-01-25 22:12 ` Jeff Garzik [this message]
2008-01-25 17:38 ` Grant Grundler
2008-01-25 22:39 ` James Bottomley
2008-01-27 15:10 ` Ke Wei
2008-01-27 15:27 ` Ke Wei
2008-01-27 18:13 ` James Bottomley
2008-02-05 13:19 ` Ke Wei
2008-02-05 21:00 ` Luben Tuikov
2008-02-07 0:33 ` Jeff Garzik
2008-01-25 23:00 ` James Bottomley
2008-01-25 23:05 ` Jeff Garzik
2008-01-25 21:27 ` James Bottomley
2008-01-23 19:23 ` Grant Grundler
[not found] <FE3F06125A99254E8D92161AA4569C6F02310B1A@sc-exch02.marvell.com>
2008-02-22 16:26 ` Jeff Garzik
2008-02-22 16:38 ` James Bottomley
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=479A5EE2.1010908@garzik.org \
--to=jeff@garzik.org \
--cc=grundler@google.com \
--cc=jfeng@marvell.com \
--cc=kewei.mv@gmail.com \
--cc=kewei@marvell.com \
--cc=linux-scsi@vger.kernel.org \
--cc=qswang@marvell.com \
--cc=qzhao@marvell.com \
/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.