All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Kamlakant Patel <kamlakantp@marvell.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jayachandran Chandrasekharan Nair <jnair@marvell.com>,
	"openipmi-developer@lists.sourceforge.net" 
	<openipmi-developer@lists.sourceforge.net>
Subject: Re: [PATCH] ipmi:ssif: compare block number correctly for multi-part return messages
Date: Wed, 24 Apr 2019 08:53:40 -0500	[thread overview]
Message-ID: <20190424135340.GD6623@minyard.net> (raw)
In-Reply-To: <1556106615-18722-1-git-send-email-kamlakantp@marvell.com>

On Wed, Apr 24, 2019 at 11:50:43AM +0000, Kamlakant Patel wrote:
> According to ipmi spec, block number is a number that is incremented,
> starting with 0, for each new block of message data returned using the
> Middle transaction.
> 
> Here, the 'blocknum' is data[0] which always starts from zero(0) and
> 'ssif_info->multi_pos' starts from 1.
> So, we need to add +1 to blocknum while comparing with multi_pos.

Indeed, I think you are right.  I hope there's no other hardware that
mis-interprets this like I did.  I'll need to fix my qemu simulation,
too.  The funny thing is, the comment is correct. Hmm.

I'll hand-apply this, as it has DOS newlines, too.

-corey

> 
> This change fixes ("ipmi:ssif: Fix handling of multi-part return
> messages").
> 
> Reported-by: Kiran Kolukuluru <kirank@ami.com>
> Signed-off-by: Kamlakant Patel <kamlakantp@marvell.com>
> ---
>  drivers/char/ipmi/ipmi_ssif.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
> index 8b5aec5..2b03845 100644
> --- a/drivers/char/ipmi/ipmi_ssif.c
> +++ b/drivers/char/ipmi/ipmi_ssif.c
> @@ -727,7 +727,7 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
>  			/* End of read */
>  			len = ssif_info->multi_len;
>  			data = ssif_info->data;
> -		} else if (blocknum != ssif_info->multi_pos) {
> +		} else if (blocknum + 1 != ssif_info->multi_pos) {
>  			/*
>  			 * Out of sequence block, just abort.  Block
>  			 * numbers start at zero for the second block,
> -- 
> 1.8.3.1
> 

      reply	other threads:[~2019-04-24 13:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 11:50 [PATCH] ipmi:ssif: compare block number correctly for multi-part return messages Kamlakant Patel
2019-04-24 13:53 ` Corey Minyard [this message]

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=20190424135340.GD6623@minyard.net \
    --to=minyard@acm.org \
    --cc=jnair@marvell.com \
    --cc=kamlakantp@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    /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.