Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5217828yba; Tue, 30 Apr 2019 11:00:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYeL2rTxAMX+KQ95BTg+vztahwS7NmMp0S+Xe9/Id3AvrnmvqpnhCyNyz6EYpLAN8w2FPL X-Received: by 2002:a63:7f0b:: with SMTP id a11mr63871488pgd.234.1556647204621; Tue, 30 Apr 2019 11:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556647204; cv=none; d=google.com; s=arc-20160816; b=0qF3OTigu23VngPFX/H2sgc43n4Xq5dEdsKBnvHg2HkwzYWe0SQ3B2hMsf1RAxDQf+ KiBMKyMAgtlnv1gJ63WbU/E7l+CTh9sNJlbtvRzLjvQ3YMql2Ss5BXUq9DaMsGXb9DzZ loob35pUdZILo1vy2KhMCyS3e15PWRAPUeLfvBxy96076+xh9ZBEpZMj1v94ROCZVVQW OQ0sERQmgl2O7rTi752neU5k/43sVG3+q1E8Ws0KWxVThuUfih1GTUpPprUhGNQFn3NO IGEAiCVkUpdMmOoUg9C3eGRb3K4PzQ9IiuiXMPGH3W7x1Ccrl7ZAGJl1hMk6gRhbST1y d5NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=7exa6L8fuGDcfctJPQ/8wIoLgof53+9RiFo6pzkmgzo=; b=1KvymRtFyNIkHWRuDmLpiOn9JY5gJbjkrf5NU8YerFHEDR5FoMWFyHImPm4S1D3hoY YSw/AxJYj7vzPePEwExPGj1inDRAF6ceV3pzorMXTFSzqLSfjIXnSwEcNW0iDnJ24nWk vedk5QjqGl6FLv6ctV6c+EcvE3vWhKPl4o9cQr2hzAQkX6/P66DYCCnmr8zcXPwpv9ax jgv6t/QfZ1jZKh6pZ+jfOe0hS3rTiX5Dso5tV8XCpgMZOWclM+Lm6Ac2GKd99i8IqLXC kiVC6gP/Ywdu7wq3sHqnBS36AzBHPHSoDrZOMNfsHyPyq2BB+X7l50mvxnIVPr+345kb 9SHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d90si28069288pld.356.2019.04.30.10.59.48; Tue, 30 Apr 2019 11:00:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726731AbfD3R6w (ORCPT + 99 others); Tue, 30 Apr 2019 13:58:52 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:57075 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725942AbfD3R6w (ORCPT ); Tue, 30 Apr 2019 13:58:52 -0400 Received: from Internal Mail-Server by MTLPINE2 (envelope-from asmaa@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Apr 2019 20:58:50 +0300 Received: from farm-1.mtbu.labs.mlnx (farm-1.mtbu.labs.mlnx [10.15.2.31]) by mtbu-labmailer.labs.mlnx (8.14.4/8.14.4) with ESMTP id x3UHwmIm027615; Tue, 30 Apr 2019 13:58:48 -0400 Received: (from asmaa@localhost) by farm-1.mtbu.labs.mlnx (8.14.7/8.13.8/Submit) id x3UHwma6006703; Tue, 30 Apr 2019 13:58:48 -0400 From: Asmaa Mnebhi To: minyard@acm.org, wsa@the-dreams.de, vadimp@mellanox.com, michaelsh@mellanox.com Cc: Asmaa Mnebhi , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [PATCH v4 0/1] Add support for IPMB driver Date: Tue, 30 Apr 2019 13:58:44 -0400 Message-Id: X-Mailer: git-send-email 2.1.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you for your feedback Vadim. I have addressed your comments. 1) You are correct. This driver is not specific to Mellanox so I have removed the Mellanox attribute. 2) I have added a documentation file called IPMB.txt which explains how this module works and how it should be instantiated. It is very similar to the existing linux i2c-slave-eeprom module. The HW for my testing works as follows: A BMC is connected to a Satellite MC via I2C (I2C is equivalent to IPMB). The BMC initiates the IPMB requests and sends them via I2C. Obviously the BMC needs its own driver to do this which I haven't included in this code. We have no intent of upstreaming that at the moment. This ipmb-dev-int driver is to be loaded and instantiated on the Satellite MC to be able to receive IPMB requests. These IPMB request messages will be picked up by a user space program such (in my case it is OpenIPMI) to handle the request and generate a response. The response will be then passed from the user program back to kernel space. Then this driver would send that response back to the BMC. 3) You asked the following: "Is it expected to be zero in vaid case?" The 8 least significant bits of the sum is always expected to be 0 in the case where the checksum is valid. I have added a comment for clarifications. "why do you need this cast?" buf[++ipmb_dev_p->msg_idx]=(u8)(client->addr<<1) This is because client->addr is of type unsigned short which is 2 bytes so it is safer to typecast it to u8 (u8* buf) "It could be only single ipmb-dev within the system? Couldn't it be few, like master/slave for example?" My understanding of your question is that: what if we have multiple instances of ipmb-dev-int, that we register it under different addresses? This driver only works as a slave so it will only be instantiated once on the Satellite MC under one slave address. Asmaa Mnebhi (1): Add support for IPMB driver Documentation/IPMB.txt | 53 ++++++ drivers/char/ipmi/Kconfig | 8 + drivers/char/ipmi/Makefile | 1 + drivers/char/ipmi/ipmb_dev_int.c | 381 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 443 insertions(+) create mode 100644 Documentation/IPMB.txt create mode 100644 drivers/char/ipmi/ipmb_dev_int.c -- 2.1.2