mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Johnston <matt@codeconstruct.com.au>
To: Corey Minyard <corey@minyard.net>,
	 Andrew Manley <andrew.manley@sealingtech.com>
Cc: Corey Minyard <minyard@acm.org>,
	 openipmi-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	 Matt Johnston <matt@codeconstruct.com.au>
Subject: [PATCH] ipmi: ipmb: initialise event handler read bytes
Date: Tue, 13 Jan 2026 17:41:34 +0800	[thread overview]
Message-ID: <20260113-ipmb-read-init-v1-1-a9cbce7b94e3@codeconstruct.com.au> (raw)

IPMB doesn't use i2c reads, but the handler needs to set a value.
Otherwise an i2c read will return an uninitialised value from the bus
driver.

Fixes: 63c4eb347164 ("ipmi:ipmb: Add initial support for IPMI over IPMB")
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
---
 drivers/char/ipmi/ipmi_ipmb.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/char/ipmi/ipmi_ipmb.c b/drivers/char/ipmi/ipmi_ipmb.c
index 3a51e58b24875497699c7af7a4af1c73b47653f3..28818952a7a4bf814b95bdfb7046672ad4526cf2 100644
--- a/drivers/char/ipmi/ipmi_ipmb.c
+++ b/drivers/char/ipmi/ipmi_ipmb.c
@@ -202,11 +202,16 @@ static int ipmi_ipmb_slave_cb(struct i2c_client *client,
 		break;
 
 	case I2C_SLAVE_READ_REQUESTED:
+		*val = 0xff;
+		ipmi_ipmb_check_msg_done(iidev);
+		break;
+
 	case I2C_SLAVE_STOP:
 		ipmi_ipmb_check_msg_done(iidev);
 		break;
 
 	case I2C_SLAVE_READ_PROCESSED:
+		*val = 0xff;
 		break;
 	}
 

---
base-commit: b71e635feefc852405b14620a7fc58c4c80c0f73
change-id: 20260113-ipmb-read-init-5b97dfbcd3b9

Best regards,
-- 
Matt Johnston <matt@codeconstruct.com.au>


             reply	other threads:[~2026-01-13  9:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13  9:41 Matt Johnston [this message]
2026-01-13 12:13 ` Markus Elfring
2026-01-13 16:00 ` Corey Minyard
2026-01-14  2:10   ` Matt Johnston
2026-01-14 15:18     ` Corey Minyard

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=20260113-ipmb-read-init-v1-1-a9cbce7b94e3@codeconstruct.com.au \
    --to=matt@codeconstruct.com.au \
    --cc=andrew.manley@sealingtech.com \
    --cc=corey@minyard.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@acm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®