From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14875C19F29 for ; Thu, 28 Jul 2022 14:24:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231445AbiG1OYM (ORCPT ); Thu, 28 Jul 2022 10:24:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231624AbiG1OYJ (ORCPT ); Thu, 28 Jul 2022 10:24:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 235C754AF0; Thu, 28 Jul 2022 07:24:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 905DB6102A; Thu, 28 Jul 2022 14:24:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34B56C433D7; Thu, 28 Jul 2022 14:24:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1659018247; bh=jGICmRzkN3mB2vVHmw3SJO6pEzZUPArOLL2IhzvWYfo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cKDLWHduHYMvzFo69JVaBPtGcczE9v78EFedXugXg2Q26iUlJ+zz6lt6L+Rdgw3VQ VBZnZaYkjxvvx7eGqz0ffgyRIocMxEqtCGGFUBGBB8LkAWlrcugzepIfw4CnYpBYzh B3JtbldrLfFtDib0fdO2L8i3L9UusHFledAW7N18= Date: Thu, 28 Jul 2022 16:24:04 +0200 From: Greg KH To: Appana Durga Kedareswara rao Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, michal.simek@xilinx.com, derek.kiernan@xilinx.com, dragan.cvetic@xilinx.com, arnd@arndb.de, appanad@amd.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@amd.com, git@xilinx.com, Appana Durga Kedareswara rao Subject: Re: [PATCH v2 4/4] drivers: misc: Add Support for TMR Inject IP Message-ID: References: <20220720060016.1646317-1-appana.durga.kedareswara.rao@amd.com> <20220720060016.1646317-5-appana.durga.kedareswara.rao@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220720060016.1646317-5-appana.durga.kedareswara.rao@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 20, 2022 at 11:30:16AM +0530, Appana Durga Kedareswara rao wrote: > From: Appana Durga Kedareswara rao > > The Triple Modular Redundancy(TMR) provides functional fault injection by > changing selected MicroBlaze instructions, which provides the possibility > to verify that the TMR subsystem error detection and fault recovery logic > is working properly, provided sysfs entries which allow the user to inject > a fault. We already have a fault-injection api, why are you not using that? > > Usage: > echo 1 > /sys/devices/platform/amba_pl/44a30000.tmr_inject/inject_err > > Signed-off-by: Appana Durga Kedareswara rao > Signed-off-by: Appana Durga Kedareswara rao Odd, just one is needed. > --- > Changes for v2: > --> Added Examples for sysfs entries > --> Removed uneeded struct dev from the driver private structure > --> Updated driver to use sysfs_emit() API instead of sprintf() API > --> Added error checks wherever applicable. > --> Fixed sysfs registration. > .../testing/sysfs-driver-xilinx-tmr-inject | 16 ++ > MAINTAINERS | 7 + > drivers/misc/Kconfig | 10 + > drivers/misc/Makefile | 1 + > drivers/misc/xilinx_tmr_inject.c | 186 ++++++++++++++++++ > 5 files changed, 220 insertions(+) > create mode 100644 Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject > create mode 100644 drivers/misc/xilinx_tmr_inject.c > > diff --git a/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject b/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject > new file mode 100644 > index 000000000000..d274b30ee24c > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject > @@ -0,0 +1,16 @@ > +What: /sys/devices/platform/amba_pl//inject_err > +Date: June 2022 It's not June anymore, even when you sent this patch :( > +Contact: appana.durga.rao@xilinx.com > +Description: This control file allows to inject fault using tmr inject. > + This file is write only. > + Example: > + # echo 1 > /sys/devices/platform/amba_pl/44a30000.tmr_inject/inject_err > + > +What: /sys/devices/platform/amba_pl//inject_cpuid > +Date: June 2022 > +Contact: appana.durga.rao@xilinx.com > +Description: This control file allows to configure the CPU identifier > + to enable fault injection. > + This file is write only. > + Example: > + # echo 1 > /sys/devices/platform/amba_pl/44a30000.tmr_inject/inject_cpuid What errors and faults happen? Where is that documented? What happens when you write to these sysfs files? Does the system crash? Why would you want to use them ever? > diff --git a/MAINTAINERS b/MAINTAINERS > index 732fd9ae7d9f..c903b45c204a 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -13087,6 +13087,13 @@ F: Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager > F: Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml > F: drivers/misc/xilinx_tmr_manager.c > > +MICROBLAZE TMR INJECT > +M: Appana Durga Kedareswara rao > +S: Supported > +F: Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject > +F: Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml > +F: drivers/misc/xilinx_tmr_inject.c > + > MICROCHIP AT91 DMA DRIVERS > M: Ludovic Desroches > M: Tudor Ambarus > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > index 555ae2e33b91..0989c36f3051 100644 > --- a/drivers/misc/Kconfig > +++ b/drivers/misc/Kconfig > @@ -493,6 +493,16 @@ config TMR_MANAGER > > Say N here unless you know what you are doing. > > +config TMR_INJECT > + bool "Select TMR Inject" > + depends on TMR_MANAGER > + help > + This option enables the driver developed for TMR Inject. > + The Triple Modular Redundancy(TMR) Inject provides > + fault injection. > + > + Say N here unless you know what you are doing. Why can't this be a module? > + > source "drivers/misc/c2port/Kconfig" > source "drivers/misc/eeprom/Kconfig" > source "drivers/misc/cb710/Kconfig" > diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile > index 28b9803f909b..e9d0a709e207 100644 > --- a/drivers/misc/Makefile > +++ b/drivers/misc/Makefile > @@ -61,3 +61,4 @@ obj-$(CONFIG_HISI_HIKEY_USB) += hisi_hikey_usb.o > obj-$(CONFIG_HI6421V600_IRQ) += hi6421v600-irq.o > obj-$(CONFIG_OPEN_DICE) += open-dice.o > obj-$(CONFIG_TMR_MANAGER) += xilinx_tmr_manager.o > +obj-$(CONFIG_TMR_INJECT) += xilinx_tmr_inject.o > diff --git a/drivers/misc/xilinx_tmr_inject.c b/drivers/misc/xilinx_tmr_inject.c > new file mode 100644 > index 000000000000..930d89e90b61 > --- /dev/null > +++ b/drivers/misc/xilinx_tmr_inject.c > @@ -0,0 +1,186 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Driver for Xilinx TMR Inject IP. > + * > + * Copyright (C) 2022 Xilinx, Inc. > + * > + * Description: > + * This driver is developed for TMR Inject IP,The Triple Modular Redundancy(TMR) > + * Inject provides fault injection. > + * Fault injection and detection features are provided through sysfs entries > + * which allow the user to generate a fault. > + */ > + > +#include > +#include > +#include > + > +/* TMR Inject Register offsets */ > +#define XTMR_INJECT_CR_OFFSET 0x0 > +#define XTMR_INJECT_AIR_OFFSET 0x4 > +#define XTMR_INJECT_IIR_OFFSET 0xC > +#define XTMR_INJECT_EAIR_OFFSET 0x10 > +#define XTMR_INJECT_ERR_OFFSET 0x204 > + > +/* Register Bitmasks/shifts */ > +#define XTMR_INJECT_CR_CPUID_SHIFT 8 > +#define XTMR_INJECT_CR_IE_SHIFT 10 > +#define XTMR_INJECT_IIR_ADDR_MASK GENMASK(31, 16) > + > +#define XTMR_INJECT_MAGIC_MAX_VAL 255 > + > +/** > + * struct xtmr_inject_dev - Driver data for TMR Inject > + * @regs: device physical base address > + * @cr_val: control register value > + * @magic: Magic hardware configuration value > + * @err_cnt: error statistics count > + */ > +struct xtmr_inject_dev { > + void __iomem *regs; > + u32 cr_val; > + u32 magic; > + u32 err_cnt; > +}; > + > +/* IO accessors */ > +static inline void xtmr_inject_write(struct xtmr_inject_dev *xtmr_inject, > + u32 addr, u32 value) > +{ > + iowrite32(value, xtmr_inject->regs + addr); > +} > + > +static inline u32 xtmr_inject_read(struct xtmr_inject_dev *xtmr_inject, > + u32 addr) > +{ > + return ioread32(xtmr_inject->regs + addr); > +} > + > +static ssize_t inject_err_store(struct device *dev, > + struct device_attribute *attr, const char *buf, > + size_t size) > +{ > + int ret; > + long value; > + > + ret = kstrtoul(buf, 16, &value); > + if (ret) > + return ret; > + > + if (value > 1) > + return -EINVAL; That does not match your documentation :( > + > + xmb_inject_err(); > + > + return size; > +} > +static DEVICE_ATTR_WO(inject_err); > + > +static ssize_t inject_cpuid_store(struct device *dev, > + struct device_attribute *attr, > + const char *buf, size_t size) > +{ > + struct xtmr_inject_dev *xtmr_inject = dev_get_drvdata(dev); > + int ret; > + long value; > + > + ret = kstrtoul(buf, 0, &value); > + if (ret) > + return ret; > + > + if (value > 3) > + return -EINVAL; Again, does not match the documentation at all. confused, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B788C04A68 for ; Thu, 28 Jul 2022 14:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qc/oThyNALA1Y8Svk4jdeGidYqM990vnr47ng/yyq/s=; b=120qQdTIFxK3jf jgunEhWSxT6yyQtWNuNE24WeXoCGq7OQequ2/azBHDJUyhLBfHD2BCijJjLQ8sAi5ru5StHvm25fR 6+PNu5NsSDK96giC+foNazs9L72TX/gt6P/AeXtgGzfwZTBcQUhF/qfGYzUQFonLfPGDwh7UcHp4+ EGhREsSI233C/KBf69P+YNB9I5GMWdom17PlqsskOzaFdIJw7nEsjznnOmbY/CEcNpaFtZFyje3K9 y9B/Pj+4OSdOMh60TSVkxmPjaLxC9jMHJlOJQ6biI5km90NDcQZbX0W9VZFBXnFA6Pd5jXXY20qtg jtb69kiQBmLz0hhHIHkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oH4Qt-00A6Nz-Kk; Thu, 28 Jul 2022 14:24:11 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oH4Qq-00A6MW-Bi for linux-arm-kernel@lists.infradead.org; Thu, 28 Jul 2022 14:24:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 93C9961041; Thu, 28 Jul 2022 14:24:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34B56C433D7; Thu, 28 Jul 2022 14:24:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1659018247; bh=jGICmRzkN3mB2vVHmw3SJO6pEzZUPArOLL2IhzvWYfo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cKDLWHduHYMvzFo69JVaBPtGcczE9v78EFedXugXg2Q26iUlJ+zz6lt6L+Rdgw3VQ VBZnZaYkjxvvx7eGqz0ffgyRIocMxEqtCGGFUBGBB8LkAWlrcugzepIfw4CnYpBYzh B3JtbldrLfFtDib0fdO2L8i3L9UusHFledAW7N18= Date: Thu, 28 Jul 2022 16:24:04 +0200 From: Greg KH To: Appana Durga Kedareswara rao Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, michal.simek@xilinx.com, derek.kiernan@xilinx.com, dragan.cvetic@xilinx.com, arnd@arndb.de, appanad@amd.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@amd.com, git@xilinx.com, Appana Durga Kedareswara rao Subject: Re: [PATCH v2 4/4] drivers: misc: Add Support for TMR Inject IP Message-ID: References: <20220720060016.1646317-1-appana.durga.kedareswara.rao@amd.com> <20220720060016.1646317-5-appana.durga.kedareswara.rao@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220720060016.1646317-5-appana.durga.kedareswara.rao@amd.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220728_072408_502626_E2BF69FD X-CRM114-Status: GOOD ( 35.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 20, 2022 at 11:30:16AM +0530, Appana Durga Kedareswara rao wrote: > From: Appana Durga Kedareswara rao > > The Triple Modular Redundancy(TMR) provides functional fault injection by > changing selected MicroBlaze instructions, which provides the possibility > to verify that the TMR subsystem error detection and fault recovery logic > is working properly, provided sysfs entries which allow the user to inject > a fault. We already have a fault-injection api, why are you not using that? > > Usage: > echo 1 > /sys/devices/platform/amba_pl/44a30000.tmr_inject/inject_err > > Signed-off-by: Appana Durga Kedareswara rao > Signed-off-by: Appana Durga Kedareswara rao Odd, just one is needed. > --- > Changes for v2: > --> Added Examples for sysfs entries > --> Removed uneeded struct dev from the driver private structure > --> Updated driver to use sysfs_emit() API instead of sprintf() API > --> Added error checks wherever applicable. > --> Fixed sysfs registration. > .../testing/sysfs-driver-xilinx-tmr-inject | 16 ++ > MAINTAINERS | 7 + > drivers/misc/Kconfig | 10 + > drivers/misc/Makefile | 1 + > drivers/misc/xilinx_tmr_inject.c | 186 ++++++++++++++++++ > 5 files changed, 220 insertions(+) > create mode 100644 Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject > create mode 100644 drivers/misc/xilinx_tmr_inject.c > > diff --git a/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject b/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject > new file mode 100644 > index 000000000000..d274b30ee24c > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject > @@ -0,0 +1,16 @@ > +What: /sys/devices/platform/amba_pl//inject_err > +Date: June 2022 It's not June anymore, even when you sent this patch :( > +Contact: appana.durga.rao@xilinx.com > +Description: This control file allows to inject fault using tmr inject. > + This file is write only. > + Example: > + # echo 1 > /sys/devices/platform/amba_pl/44a30000.tmr_inject/inject_err > + > +What: /sys/devices/platform/amba_pl//inject_cpuid > +Date: June 2022 > +Contact: appana.durga.rao@xilinx.com > +Description: This control file allows to configure the CPU identifier > + to enable fault injection. > + This file is write only. > + Example: > + # echo 1 > /sys/devices/platform/amba_pl/44a30000.tmr_inject/inject_cpuid What errors and faults happen? Where is that documented? What happens when you write to these sysfs files? Does the system crash? Why would you want to use them ever? > diff --git a/MAINTAINERS b/MAINTAINERS > index 732fd9ae7d9f..c903b45c204a 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -13087,6 +13087,13 @@ F: Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager > F: Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml > F: drivers/misc/xilinx_tmr_manager.c > > +MICROBLAZE TMR INJECT > +M: Appana Durga Kedareswara rao > +S: Supported > +F: Documentation/ABI/testing/sysfs-driver-xilinx-tmr-inject > +F: Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml > +F: drivers/misc/xilinx_tmr_inject.c > + > MICROCHIP AT91 DMA DRIVERS > M: Ludovic Desroches > M: Tudor Ambarus > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > index 555ae2e33b91..0989c36f3051 100644 > --- a/drivers/misc/Kconfig > +++ b/drivers/misc/Kconfig > @@ -493,6 +493,16 @@ config TMR_MANAGER > > Say N here unless you know what you are doing. > > +config TMR_INJECT > + bool "Select TMR Inject" > + depends on TMR_MANAGER > + help > + This option enables the driver developed for TMR Inject. > + The Triple Modular Redundancy(TMR) Inject provides > + fault injection. > + > + Say N here unless you know what you are doing. Why can't this be a module? > + > source "drivers/misc/c2port/Kconfig" > source "drivers/misc/eeprom/Kconfig" > source "drivers/misc/cb710/Kconfig" > diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile > index 28b9803f909b..e9d0a709e207 100644 > --- a/drivers/misc/Makefile > +++ b/drivers/misc/Makefile > @@ -61,3 +61,4 @@ obj-$(CONFIG_HISI_HIKEY_USB) += hisi_hikey_usb.o > obj-$(CONFIG_HI6421V600_IRQ) += hi6421v600-irq.o > obj-$(CONFIG_OPEN_DICE) += open-dice.o > obj-$(CONFIG_TMR_MANAGER) += xilinx_tmr_manager.o > +obj-$(CONFIG_TMR_INJECT) += xilinx_tmr_inject.o > diff --git a/drivers/misc/xilinx_tmr_inject.c b/drivers/misc/xilinx_tmr_inject.c > new file mode 100644 > index 000000000000..930d89e90b61 > --- /dev/null > +++ b/drivers/misc/xilinx_tmr_inject.c > @@ -0,0 +1,186 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Driver for Xilinx TMR Inject IP. > + * > + * Copyright (C) 2022 Xilinx, Inc. > + * > + * Description: > + * This driver is developed for TMR Inject IP,The Triple Modular Redundancy(TMR) > + * Inject provides fault injection. > + * Fault injection and detection features are provided through sysfs entries > + * which allow the user to generate a fault. > + */ > + > +#include > +#include > +#include > + > +/* TMR Inject Register offsets */ > +#define XTMR_INJECT_CR_OFFSET 0x0 > +#define XTMR_INJECT_AIR_OFFSET 0x4 > +#define XTMR_INJECT_IIR_OFFSET 0xC > +#define XTMR_INJECT_EAIR_OFFSET 0x10 > +#define XTMR_INJECT_ERR_OFFSET 0x204 > + > +/* Register Bitmasks/shifts */ > +#define XTMR_INJECT_CR_CPUID_SHIFT 8 > +#define XTMR_INJECT_CR_IE_SHIFT 10 > +#define XTMR_INJECT_IIR_ADDR_MASK GENMASK(31, 16) > + > +#define XTMR_INJECT_MAGIC_MAX_VAL 255 > + > +/** > + * struct xtmr_inject_dev - Driver data for TMR Inject > + * @regs: device physical base address > + * @cr_val: control register value > + * @magic: Magic hardware configuration value > + * @err_cnt: error statistics count > + */ > +struct xtmr_inject_dev { > + void __iomem *regs; > + u32 cr_val; > + u32 magic; > + u32 err_cnt; > +}; > + > +/* IO accessors */ > +static inline void xtmr_inject_write(struct xtmr_inject_dev *xtmr_inject, > + u32 addr, u32 value) > +{ > + iowrite32(value, xtmr_inject->regs + addr); > +} > + > +static inline u32 xtmr_inject_read(struct xtmr_inject_dev *xtmr_inject, > + u32 addr) > +{ > + return ioread32(xtmr_inject->regs + addr); > +} > + > +static ssize_t inject_err_store(struct device *dev, > + struct device_attribute *attr, const char *buf, > + size_t size) > +{ > + int ret; > + long value; > + > + ret = kstrtoul(buf, 16, &value); > + if (ret) > + return ret; > + > + if (value > 1) > + return -EINVAL; That does not match your documentation :( > + > + xmb_inject_err(); > + > + return size; > +} > +static DEVICE_ATTR_WO(inject_err); > + > +static ssize_t inject_cpuid_store(struct device *dev, > + struct device_attribute *attr, > + const char *buf, size_t size) > +{ > + struct xtmr_inject_dev *xtmr_inject = dev_get_drvdata(dev); > + int ret; > + long value; > + > + ret = kstrtoul(buf, 0, &value); > + if (ret) > + return ret; > + > + if (value > 3) > + return -EINVAL; Again, does not match the documentation at all. confused, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel