openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Andrew Jeffery" <andrew@aj.id.au>
To: "Joel Stanley" <joel@jms.id.au>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH linux dev-5.10 2/7] ipmi: kcs_bmc: Add a "raw" character device interface
Date: Wed, 23 Jun 2021 12:50:26 +0930	[thread overview]
Message-ID: <444e0bdf-7cd4-4682-84a2-7ba0eae419d6@www.fastmail.com> (raw)
In-Reply-To: <CACPK8Xei9yNygb3_AO+jyoJwoWJ_=SEuZONqwrzGZDX+KmaURg@mail.gmail.com>



On Wed, 23 Jun 2021, at 10:34, Joel Stanley wrote:
> On Wed, 23 Jun 2021 at 00:48, Andrew Jeffery <andrew@aj.id.au> wrote:
> >
> >
> >
> > On Fri, 18 Jun 2021, at 13:28, Andrew Jeffery wrote:
> > > +static int kcs_bmc_raw_add_device(struct kcs_bmc_device *kcs_bmc)
> > > +{
> > > +     struct kcs_bmc_raw *priv;
> > > +     int rc;
> > > +
> > > +     priv = devm_kzalloc(kcs_bmc->dev, sizeof(*priv), GFP_KERNEL);
> > > +     if (!priv)
> > > +             return -ENOMEM;
> > > +
> > > +     priv->client.dev = kcs_bmc;
> > > +     priv->client.ops = &kcs_bmc_raw_client_ops;
> > > +
> > > +     init_waitqueue_head(&priv->queue);
> > > +     priv->writable = false;
> > > +     priv->readable = false;
> > > +
> > > +     priv->miscdev.minor = MISC_DYNAMIC_MINOR;
> > > +     priv->miscdev.name = devm_kasprintf(kcs_bmc->dev, GFP_KERNEL, "%s%u",
> > > DEVICE_NAME,
> > > +                                        kcs_bmc->channel);
> > > +     if (!priv->miscdev.name)
> > > +             return -EINVAL;
> > > +
> > > +     priv->miscdev.fops = &kcs_bmc_raw_fops;
> > > +
> > > +     /* Initialise our expected events. Listen for IBF but ignore OBE
> > > until necessary */
> > > +     kcs_bmc_raw_update_event_mask(priv, (KCS_BMC_EVENT_TYPE_IBF |
> > > KCS_BMC_EVENT_TYPE_OBE),
> > > +                                   KCS_BMC_EVENT_TYPE_IBF);
> >
> > Ah, this is now wrong wrt to some other rework that went on, we should be disabling IBF and OBE until the chardev is opened.
> >
> > With the code as it is we can get a "nobody cared" WARN().
> >
> > I'll send a v2.
> 
> Best to put it on the upstream lists. We can pull it in if you need it sooner.

This driver is just a stop-gap until we get Jeremy's socket-based MCTP work merged. It replaces the pile of hacks known as the mctp-lpc driver.

I've explained a bit more in the cover letter:

https://lore.kernel.org/openbmc/20210618035858.4024689-1-andrew@aj.id.au/

Andrew

  reply	other threads:[~2021-06-23  3:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18  3:58 [PATCH linux dev-5.10 0/7] Rework use of KCS devices for P10 platforms Andrew Jeffery
2021-06-18  3:58 ` [PATCH linux dev-5.10 1/7] ipmi: kcs_bmc_aspeed: Fix less than zero comparison of a unsigned int Andrew Jeffery
2021-06-18  3:58 ` [PATCH linux dev-5.10 2/7] ipmi: kcs_bmc: Add a "raw" character device interface Andrew Jeffery
2021-06-23  0:47   ` Andrew Jeffery
2021-06-23  1:04     ` Joel Stanley
2021-06-23  3:20       ` Andrew Jeffery [this message]
2021-06-18  3:58 ` [PATCH linux dev-5.10 3/7] ARM: configs: Enable IPMI KCS raw chardev Andrew Jeffery
2021-06-18  3:58 ` [PATCH linux dev-5.10 4/7] ARM: dts: rainier: Drop the openbmc, mctp-lpc node Andrew Jeffery
2021-06-18  3:58 ` [PATCH linux dev-5.10 5/7] misc: Remove obsolete mctp-lpc chardev Andrew Jeffery
2021-06-18  3:58 ` [PATCH linux dev-5.10 6/7] ARM: dts: rainier: Switch to KCS 3 for MCTP binding Andrew Jeffery
2021-06-18  3:58 ` [PATCH linux dev-5.10 7/7] ARM: dts: rainier: Enable KCS channel 2 Andrew Jeffery

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=444e0bdf-7cd4-4682-84a2-7ba0eae419d6@www.fastmail.com \
    --to=andrew@aj.id.au \
    --cc=joel@jms.id.au \
    --cc=openbmc@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).