Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/807859/?format=api
{ "id": 807859, "url": "http://patchwork.ozlabs.org/api/patches/807859/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openbmc/patch/20170830185536.71307-3-cbostic@linux.vnet.ibm.com/", "project": { "id": 56, "url": "http://patchwork.ozlabs.org/api/projects/56/?format=api", "name": "OpenBMC development", "link_name": "openbmc", "list_id": "openbmc.lists.ozlabs.org", "list_email": "openbmc@lists.ozlabs.org", "web_url": "http://github.com/openbmc/", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170830185536.71307-3-cbostic@linux.vnet.ibm.com>", "list_archive_url": null, "date": "2017-08-30T18:55:36", "name": "[2/2] hwmon: (ucd9000) Add sysfs attribute to clear logged faults", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "1197e5ab191a8baa6940b907c51fef33ec8c8619", "submitter": { "id": 70879, "url": "http://patchwork.ozlabs.org/api/people/70879/?format=api", "name": "Christopher Bostic", "email": "cbostic@linux.vnet.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/openbmc/patch/20170830185536.71307-3-cbostic@linux.vnet.ibm.com/mbox/", "series": [ { "id": 686, "url": "http://patchwork.ozlabs.org/api/series/686/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openbmc/list/?series=686", "date": "2017-08-30T18:55:34", "name": "hwmon: (ucd9000) Add sysfs interface to clear logged faults", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/686/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/807859/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807859/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "openbmc@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "openbmc@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjF9Y2ShNz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 04:57:05 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xjF9Y1LtszDqXv\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 04:57:05 +1000 (AEST)", "from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xjF8P5LXwzDqNc\n\tfor <openbmc@lists.ozlabs.org>; Thu, 31 Aug 2017 04:56:05 +1000 (AEST)", "from pps.filterd (m0098419.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7UIsY8H070023\n\tfor <openbmc@lists.ozlabs.org>; Wed, 30 Aug 2017 14:56:03 -0400", "from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2cp0gjgfmp-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <openbmc@lists.ozlabs.org>; Wed, 30 Aug 2017 14:56:03 -0400", "from localhost\n\tby e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <openbmc@lists.ozlabs.org> from <cbostic@linux.vnet.ibm.com>;\n\tWed, 30 Aug 2017 14:56:03 -0400", "from b01cxnp23033.gho.pok.ibm.com (9.57.198.28)\n\tby e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 30 Aug 2017 14:55:59 -0400", "from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com\n\t[9.57.199.110])\n\tby b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v7UItw4Q2883854; Wed, 30 Aug 2017 18:55:58 GMT", "from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 03B23AE03B;\n\tWed, 30 Aug 2017 14:56:23 -0400 (EDT)", "from christophersmbp.austin.ibm.com (unknown [9.83.1.36])\n\tby b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id A453DAE04B;\n\tWed, 30 Aug 2017 14:56:18 -0400 (EDT)" ], "From": "Christopher Bostic <cbostic@linux.vnet.ibm.com>", "To": "jdelvare@suse.com, linux@roeck-us.net, corbet@lwn.net,\n\tlinux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org", "Subject": "[PATCH 2/2] hwmon: (ucd9000) Add sysfs attribute to clear logged\n\tfaults", "Date": "Wed, 30 Aug 2017 13:55:36 -0500", "X-Mailer": "git-send-email 2.10.1 (Apple Git-78)", "In-Reply-To": "<20170830185536.71307-1-cbostic@linux.vnet.ibm.com>", "References": "<20170830185536.71307-1-cbostic@linux.vnet.ibm.com>", "X-TM-AS-GCONF": "00", "x-cbid": "17083018-0056-0000-0000-000003BECF98", "X-IBM-SpamModules-Scores": "", "X-IBM-SpamModules-Versions": "BY=3.00007637; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00909848; UDB=6.00456361;\n\tIPR=6.00690132; \n\tBA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016931;\n\tXFM=3.00000015; UTC=2017-08-30 18:56:01", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17083018-0057-0000-0000-000007F500A1", "Message-Id": "<20170830185536.71307-3-cbostic@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-30_08:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708300288", "X-BeenThere": "openbmc@lists.ozlabs.org", "X-Mailman-Version": "2.1.23", "Precedence": "list", "List-Id": "Development list for OpenBMC <openbmc.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/openbmc/>", "List-Post": "<mailto:openbmc@lists.ozlabs.org>", "List-Help": "<mailto:openbmc-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=subscribe>", "Cc": "openbmc@lists.ozlabs.org, Christopher Bostic <cbostic@linux.vnet.ibm.com>", "Errors-To": "openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org", "Sender": "\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>" }, "content": "Add ability to clear logged faults via sysfs.\n\nSigned-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>\n---\n drivers/hwmon/pmbus/ucd9000.c | 45 ++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 44 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/hwmon/pmbus/ucd9000.c b/drivers/hwmon/pmbus/ucd9000.c\nindex b74dbec..8bd8cb1 100644\n--- a/drivers/hwmon/pmbus/ucd9000.c\n+++ b/drivers/hwmon/pmbus/ucd9000.c\n@@ -27,6 +27,8 @@\n #include <linux/slab.h>\n #include <linux/i2c.h>\n #include <linux/pmbus.h>\n+#include <linux/sysfs.h>\n+#include <linux/hwmon-sysfs.h>\n #include \"pmbus.h\"\n \n enum chips { ucd9000, ucd90120, ucd90124, ucd90160, ucd9090, ucd90910 };\n@@ -35,6 +37,7 @@\n #define UCD9000_NUM_PAGES\t\t0xd6\n #define UCD9000_FAN_CONFIG_INDEX\t0xe7\n #define UCD9000_FAN_CONFIG\t\t0xe8\n+#define UCD9000_LOGGED_FAULTS\t\t0xea\n #define UCD9000_DEVICE_ID\t\t0xfd\n \n #define UCD9000_MON_TYPE(x)\t(((x) >> 5) & 0x07)\n@@ -109,6 +112,36 @@ static int ucd9000_read_byte_data(struct i2c_client *client, int page, int reg)\n \treturn ret;\n }\n \n+static ssize_t ucd9000_clear_logged_faults(struct device *dev,\n+\t\t\tstruct device_attribute *attr, const char *buf,\n+\t\t\tsize_t count)\n+{\n+\tstruct i2c_client *client = to_i2c_client(dev);\n+\tint ret;\n+\n+\t/* No page set required */\n+\tret = i2c_smbus_write_byte_data(client, UCD9000_LOGGED_FAULTS, 0);\n+\tif (ret) {\n+\t\tdev_err(&client->dev, \"Failed to clear logged faults: %d\\n\",\n+\t\t\tret);\n+\t\treturn ret;\n+\t}\n+\n+\treturn count;\n+}\n+\n+static DEVICE_ATTR(clear_logged_faults, 0200, NULL,\n+\t\t\tucd9000_clear_logged_faults);\n+\n+static struct attribute *ucd9000_attributes[] = {\n+\t&dev_attr_clear_logged_faults.attr,\n+\tNULL\n+};\n+\n+static const struct attribute_group ucd9000_attr_group = {\n+\t.attrs = ucd9000_attributes,\n+};\n+\n static const struct i2c_device_id ucd9000_id[] = {\n \t{\"ucd9000\", ucd9000},\n \t{\"ucd90120\", ucd90120},\n@@ -263,9 +296,19 @@ static int ucd9000_probe(struct i2c_client *client,\n \t\t | PMBUS_HAVE_FAN34 | PMBUS_HAVE_STATUS_FAN34;\n \t}\n \n+\tret = sysfs_create_group(&client->dev.kobj, &ucd9000_attr_group);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n \treturn pmbus_do_probe(client, mid, info);\n }\n \n+static int ucd9000_remove(struct i2c_client *client)\n+{\n+\tsysfs_remove_group(&client->dev.kobj, &ucd9000_attr_group);\n+\treturn pmbus_do_remove(client);\n+}\n+\n /* This is the driver that will be inserted */\n static struct i2c_driver ucd9000_driver = {\n \t.driver = {\n@@ -273,7 +316,7 @@ static int ucd9000_probe(struct i2c_client *client,\n \t\t.of_match_table = of_match_ptr(ucd9000_of_match),\n \t},\n \t.probe = ucd9000_probe,\n-\t.remove = pmbus_do_remove,\n+\t.remove = ucd9000_remove,\n \t.id_table = ucd9000_id,\n };\n \n", "prefixes": [ "2/2" ] }