Re: [PATCH 11/12] IPMI: Fix BT long busy

From: Andrew Morton
Date: Sun Dec 03 2006 - 16:27:55 EST


On Fri, 1 Dec 2006 22:39:21 -0600
Corey Minyard <minyard@xxxxxxx> wrote:

>
> The IPMI BT subdriver has been patched to survive "long busy"
> timeouts seen during firmware upgrades and resets. The patch
> never returns the HOSED state, synthesizes response messages with
> meaningful completion codes, and recovers gracefully when the
> hardware finishes the long busy. The subdriver now issues a "Get BT
> Capabilities" command and properly uses those results.
> More informative completion codes are returned on error from
> transaction starts; this logic was propogated to the KCS and
> SMIC subdrivers. Finally, indent and other style quirks were
> normalized.
>
> ...
>
> + BT_CONTROL(BT_CLR_WR_PTR); /* always reset */

argh.

#define BT_STATUS bt->io->inputb(bt->io, 0)
#define BT_CONTROL(x) bt->io->outputb(bt->io, 0, x)

#define BMC2HOST bt->io->inputb(bt->io, 1)
#define HOST2BMC(x) bt->io->outputb(bt->io, 1, x)

#define BT_INTMASK_R bt->io->inputb(bt->io, 2)
#define BT_INTMASK_W(x) bt->io->outputb(bt->io, 2, x)

Please don't write macros which require that the caller have a particular
local variable of a particular name.

In fact, please don't write macros.

All the above would be perfectly nice as

static inline void bt_control(struct si_sm_data *bt, int val)
{
bt->io->outputb(bt->io, val);
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/