Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH 8/9] GenWQE: Simplify sysfs buffer printouts

4 views
Skip to first unread message

Frank Haverkamp

unread,
Nov 4, 2013, 12:10:01 PM11/4/13
to
Rework code which was inteneded to print out multiple lines via sysfs
attributes. This is not needed anymore. We just print one item.

Signed-off-by: Frank Haverkamp <ha...@linux.vnet.ibm.com>
---
drivers/misc/genwqe/card_sysfs.c | 59 +++++++++-----------------------------
1 files changed, 14 insertions(+), 45 deletions(-)

diff --git a/drivers/misc/genwqe/card_sysfs.c b/drivers/misc/genwqe/card_sysfs.c
index 6a51ad7..f29ce55 100644
--- a/drivers/misc/genwqe/card_sysfs.c
+++ b/drivers/misc/genwqe/card_sysfs.c
@@ -48,82 +48,65 @@ static const char * const genwqe_types[] = {
static ssize_t status_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- ssize_t len = 0;
struct genwqe_dev *cd = dev_get_drvdata(dev);
const char *cs[GENWQE_CARD_STATE_MAX] = { "unused", "used", "error" };

- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "%s\n", cs[cd->card_state]);
- return len;
+ return scnprintf(buf, PAGE_SIZE, "%s\n", cs[cd->card_state]);
}
static DEVICE_ATTR_RO(status);

static ssize_t appid_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- ssize_t len = 0;
char app_name[5];
struct genwqe_dev *cd = dev_get_drvdata(dev);

genwqe_read_app_id(cd, app_name, sizeof(app_name));
- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "%s\n", app_name);
- return len;
+ return scnprintf(buf, PAGE_SIZE, "%s\n", app_name);
}
static DEVICE_ATTR_RO(appid);

static ssize_t version_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- ssize_t len = 0;
u64 slu_id, app_id;
struct genwqe_dev *cd = dev_get_drvdata(dev);

slu_id = __genwqe_readq(cd, IO_SLU_UNITCFG);
app_id = __genwqe_readq(cd, IO_APP_UNITCFG);

- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "%016llx.%016llx\n", slu_id, app_id);
- return len;
+ return scnprintf(buf, PAGE_SIZE, "%016llx.%016llx\n", slu_id, app_id);
}
static DEVICE_ATTR_RO(version);

static ssize_t type_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- ssize_t len = 0;
u8 card_type;
struct genwqe_dev *cd = dev_get_drvdata(dev);

card_type = genwqe_card_type(cd);
- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "%s\n", (card_type >= ARRAY_SIZE(genwqe_types)) ?
+ return scnprintf(buf, PAGE_SIZE, "%s\n",
+ (card_type >= ARRAY_SIZE(genwqe_types)) ?
"invalid" : genwqe_types[card_type]);
- return len;
}
static DEVICE_ATTR_RO(type);

static ssize_t driver_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- ssize_t len = 0;
- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "%s\n", DRV_VERS_STRING);
- return len;
+ return scnprintf(buf, PAGE_SIZE, "%s\n", DRV_VERS_STRING);
}
static DEVICE_ATTR_RO(driver);

static ssize_t tempsens_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- ssize_t len = 0;
u64 tempsens;
struct genwqe_dev *cd = dev_get_drvdata(dev);

tempsens = __genwqe_readq(cd, IO_SLU_TEMPERATURE_SENSOR);
- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "%016llx\n", tempsens);
- return len;
+ return scnprintf(buf, PAGE_SIZE, "%016llx\n", tempsens);
}
static DEVICE_ATTR_RO(tempsens);

@@ -131,14 +114,11 @@ static ssize_t base_clock_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- ssize_t len = 0;
u64 base_clock;
struct genwqe_dev *cd = dev_get_drvdata(dev);

base_clock = genwqe_base_clock_frequency(cd);
- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "%lld\n", base_clock);
- return len;
+ return scnprintf(buf, PAGE_SIZE, "%lld\n", base_clock);
}
static DEVICE_ATTR_RO(base_clock);

@@ -160,17 +140,13 @@ static DEVICE_ATTR_RO(base_clock);
* image.
*/
static ssize_t curr_bitstream_show(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+ struct device_attribute *attr, char *buf)
{
- ssize_t len = 0;
int curr_bitstream;
struct genwqe_dev *cd = dev_get_drvdata(dev);

curr_bitstream = __genwqe_readq(cd, IO_SLU_BITSTREAM) & 0x1;
- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "%d\n", curr_bitstream);
- return len;
+ return scnprintf(buf, PAGE_SIZE, "%d\n", curr_bitstream);
}
static DEVICE_ATTR_RO(curr_bitstream);

@@ -180,10 +156,8 @@ static DEVICE_ATTR_RO(curr_bitstream);
* IO_SLC_CFGREG_SOFTRESET: This register can only be accessed by the PF.
*/
static ssize_t next_bitstream_show(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+ struct device_attribute *attr, char *buf)
{
- ssize_t len = 0;
int next_bitstream;
struct genwqe_dev *cd = dev_get_drvdata(dev);

@@ -198,9 +172,7 @@ static ssize_t next_bitstream_show(struct device *dev,
next_bitstream = -1;
break; /* error */
}
- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "%d\n", next_bitstream);
- return len;
+ return scnprintf(buf, PAGE_SIZE, "%d\n", next_bitstream);
}

static ssize_t next_bitstream_store(struct device *dev,
@@ -233,12 +205,9 @@ static DEVICE_ATTR_RW(next_bitstream);
* FIXME Implement me!
*/
static ssize_t cpld_version_show(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+ struct device_attribute *attr, char *buf)
{
- ssize_t len = 0;
- len += scnprintf(&buf[len], PAGE_SIZE - len, "unknown (FIXME)\n");
- return len;
+ return scnprintf(buf, PAGE_SIZE, "unknown (FIXME)\n");
}
static DEVICE_ATTR_RO(cpld_version);

--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Frank Haverkamp

unread,
Nov 4, 2013, 12:10:02 PM11/4/13
to
The module parameter genwqe_vf_jobtimeout_msec is changed into
a debugfs interface:
/sys/kernel/debug/genwqe/genwqe<n>_card/vf<0..14>_jobtimeout_msec
The setting is applied when the virtual functions are enabled.
Switching during operation is not allowed.

The following thow former module parameters are now constants:
genwqe_pf_jobtimeout_msec
genwqe_health_check_interval

Signed-off-by: Frank Haverkamp <ha...@linux.vnet.ibm.com>
---
Documentation/ABI/testing/debugfs-driver-genwqe | 13 +++
drivers/misc/genwqe/card_base.c | 93 ++++++++++-------------
drivers/misc/genwqe/card_base.h | 9 +-
drivers/misc/genwqe/card_debugfs.c | 15 ++++-
4 files changed, 71 insertions(+), 59 deletions(-)

diff --git a/Documentation/ABI/testing/debugfs-driver-genwqe b/Documentation/ABI/testing/debugfs-driver-genwqe
index c3503a4..548883a 100644
--- a/Documentation/ABI/testing/debugfs-driver-genwqe
+++ b/Documentation/ABI/testing/debugfs-driver-genwqe
@@ -55,3 +55,16 @@ Date: Oct 2013
Contact: ha...@linux.vnet.ibm.com
Description: Possibility to inject error cases to ensure that the drivers
error handling code works well.
+
+What: /sys/kernel/debug/genwqe/genwqe<n>_card/vf<0..14>_jobtimeout_msec
+Date: Oct 2013
+Contact: ha...@linux.vnet.ibm.com
+Description: Default VF timeout 250ms. Testing might require 1000ms.
+ Using 0 will use the cards default value (whatever that is).
+
+ The timeout depends on the max number of available cards
+ in the system and the maximum allowed queue size.
+
+ The driver ensures that the settings are done just before
+ the VFs get enabled. Changing the timeouts in flight is not
+ possible.
diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c
index c649ef7..67ca5bc 100644
--- a/drivers/misc/genwqe/card_base.c
+++ b/drivers/misc/genwqe/card_base.c
@@ -52,40 +52,6 @@ MODULE_DESCRIPTION("GenWQE Card");
MODULE_VERSION(DRV_VERS_STRING);
MODULE_LICENSE("GPL");

-/*
- * We like to be able to disable the health checking entirely in some
- * cases e.g. if a card is broken and needs to be analyzed. I
- * considered using debugfs/sysfs attributes, but I did not see a way
- * to prevent the thread from being started at driver load time other
- * than starting it later manually, what I did not like either
- * in this case (e.g. like the new SRIOV enablement).
- */
-static int genwqe_health_check_interval = 4; /* <= 0: disabled */
-module_param(genwqe_health_check_interval, int, 0644); /* read/writeable */
-MODULE_PARM_DESC(genwqe_health_check_interval,
- "check card health every N seconds (0 = disabled)");
-
-/*
- * GenWQE Driver: Need SLC timeout set to 250ms (temporary setting for
- * testing of 1000ms due to decompressor testcase failing)
- *
- * There is a requirement by the card users that the timeout must not
- * exceed the 250ms.
- *
- * In this case the settings must be done before any interaction to
- * the device can be done, since we cannot change the settings without
- * stopping the queues.
- */
-int genwqe_vf_jobtimeout_msec = 250;
-module_param(genwqe_vf_jobtimeout_msec, int, 0444); /* readable */
-MODULE_PARM_DESC(genwqe_vf_jobtimeout_msec,
- "Job timeout for virtual functions");
-
-int genwqe_pf_jobtimeout_msec = 8000; /* 8sec should be ok */
-module_param(genwqe_pf_jobtimeout_msec, int, 0444); /* readable */
-MODULE_PARM_DESC(genwqe_pf_jobtimeout_msec,
- "Job timeout for physical function");
-
static char genwqe_driver_name[] = GENWQE_DEVNAME;
static struct class *class_genwqe;
static struct dentry *debugfs_genwqe;
@@ -156,7 +122,7 @@ MODULE_DEVICE_TABLE(pci, genwqe_device_table);
*/
static struct genwqe_dev *genwqe_dev_alloc(void)
{
- int i = 0;
+ unsigned int i = 0, j;
struct genwqe_dev *cd;

for (i = 0; i < GENWQE_CARD_NO_MAX; i++) {
@@ -185,6 +151,9 @@ static struct genwqe_dev *genwqe_dev_alloc(void)
cd->ddcb_software_timeout = genwqe_ddcb_software_timeout;
cd->kill_timeout = genwqe_kill_timeout;

+ for (j = 0; j < GENWQE_MAX_VFS; j++)
+ cd->vf_jobtimeout_msec[j] = genwqe_vf_jobtimeout_msec;
+
genwqe_devices[i] = cd;
return cd;
}
@@ -338,7 +307,7 @@ static int genwqe_T_psec(struct genwqe_dev *cd)
}

/**
- * genwqe_setup_jtimer() - Setup PF/VF hardware timeouts for DDCB execution
+ * genwqe_setup_pf_jtimer() - Setup PF hardware timeouts for DDCB execution
*
* Do this _after_ card_reset() is called. Otherwise the values will
* vanish. The settings need to be done when the queues are inactive.
@@ -346,32 +315,43 @@ static int genwqe_T_psec(struct genwqe_dev *cd)
* The max. timeout value is 2^(10+x) * T (6ns for 166MHz) * 15/16.
* The min. timeout value is 2^(10+x) * T (6ns for 166MHz) * 14/16.
*/
-static int genwqe_setup_jtimer(struct genwqe_dev *cd)
+static bool genwqe_setup_pf_jtimer(struct genwqe_dev *cd)
{
- int vf;
u32 T = genwqe_T_psec(cd);
u64 x;

- if (genwqe_pf_jobtimeout_msec != -1) {
- /* PF: large value needed, due to flash update 2sec
- per block */
- x = ilog2(genwqe_pf_jobtimeout_msec *
- 16000000000uL/(T * 15)) - 10;
- genwqe_write_jtimer(cd, 0, (0xff00 | (x & 0xff)));
- }
+ if (genwqe_pf_jobtimeout_msec == 0)
+ return false;
+
+ /* PF: large value needed, flash update 2sec per block */
+ x = ilog2(genwqe_pf_jobtimeout_msec *
+ 16000000000uL/(T * 15)) - 10;

- if (genwqe_vf_jobtimeout_msec != -1) {
- if (cd->num_vfs < 0)
- return cd->num_vfs;
+ genwqe_write_jtimer(cd, 0, (0xff00 | (x & 0xff)));
+ return true;
+}

- x = ilog2(genwqe_vf_jobtimeout_msec *
+/**
+ * genwqe_setup_vf_jtimer() - Setup VF hardware timeouts for DDCB execution
+ */
+static bool genwqe_setup_vf_jtimer(struct genwqe_dev *cd)
+{
+ struct pci_dev *pci_dev = cd->pci_dev;
+ unsigned int vf;
+ u32 T = genwqe_T_psec(cd);
+ u64 x;
+
+ for (vf = 0; vf < pci_sriov_get_totalvfs(pci_dev); vf++) {
+
+ if (cd->vf_jobtimeout_msec[vf] == 0)
+ continue;
+
+ x = ilog2(cd->vf_jobtimeout_msec[vf] *
16000000000uL/(T * 15)) - 10;

- for (vf = 0; vf < cd->num_vfs; vf++)
- genwqe_write_jtimer(cd, vf + 1, (0xff00 | (x & 0xff)));
+ genwqe_write_jtimer(cd, vf + 1, (0xff00 | (x & 0xff)));
}
-
- return 0;
+ return true;
}

static int genwqe_ffdc_buffs_alloc(struct genwqe_dev *cd)
@@ -537,7 +517,9 @@ static int genwqe_start(struct genwqe_dev *cd)

if (genwqe_is_privileged(cd)) { /* code is running _after_ reset */
genwqe_tweak_hardware(cd);
- genwqe_setup_jtimer(cd); /* queues must not run */
+
+ genwqe_setup_pf_jtimer(cd);
+ genwqe_setup_vf_jtimer(cd);
}

err = genwqe_device_create(cd);
@@ -1142,7 +1124,10 @@ static void genwqe_err_resume(struct pci_dev *dev)

static int genwqe_sriov_configure(struct pci_dev *dev, int numvfs)
{
+ struct genwqe_dev *cd = dev_get_drvdata(&dev->dev);
+
if (numvfs > 0) {
+ genwqe_setup_vf_jtimer(cd);
pci_enable_sriov(dev, numvfs);
return numvfs;
}
diff --git a/drivers/misc/genwqe/card_base.h b/drivers/misc/genwqe/card_base.h
index 62c2356..21cef33 100644
--- a/drivers/misc/genwqe/card_base.h
+++ b/drivers/misc/genwqe/card_base.h
@@ -43,6 +43,7 @@
#define GENWQE_MSI_IRQS 4 /* Just one supported, no MSIx */
#define GENWQE_FLAG_MSI_ENABLED (1 << 0)

+#define GENWQE_MAX_VFS 15 /* maximum 15 VFs are possible */
#define GENWQE_MAX_FUNCS 16 /* 1 PF and 15 VFs */
#define GENWQE_CARD_NO_MAX (16 * GENWQE_MAX_FUNCS)

@@ -51,10 +52,9 @@
#define genwqe_polling_enabled 0 /* in case of irqs not working */
#define genwqe_ddcb_software_timeout 10 /* timeout per DDCB in seconds */
#define genwqe_kill_timeout 8 /* time until process gets killed */
-
-/* Module parameters */
-extern int genwqe_pf_jobtimeout_msec;
-extern int genwqe_vf_jobtimeout_msec;
+#define genwqe_vf_jobtimeout_msec 250 /* 250 msec */
+#define genwqe_pf_jobtimeout_msec 8000 /* 8 sec should be ok */
+#define genwqe_health_check_interval 4 /* <= 0: disabled */

/*
* Config space for Genwqe5 A7:
@@ -318,6 +318,7 @@ struct genwqe_dev {
void __iomem *mmio; /* BAR-0 MMIO start */
unsigned long mmio_len;
u16 num_vfs;
+ u32 vf_jobtimeout_msec[GENWQE_MAX_VFS];
int is_privileged; /* access to all regs possible */

/* config regs which we need often */
diff --git a/drivers/misc/genwqe/card_debugfs.c b/drivers/misc/genwqe/card_debugfs.c
index 6a048a1..ebf2f93 100644
--- a/drivers/misc/genwqe/card_debugfs.c
+++ b/drivers/misc/genwqe/card_debugfs.c
@@ -271,7 +271,7 @@ static int genwqe_jtimer_show(struct seq_file *s, void *unused)
for (vf_num = 0; vf_num < cd->num_vfs; vf_num++) {
jtimer = genwqe_read_jtimer(cd, vf_num + 1);
seq_printf(s, " VF%-2d 0x%016llx %d msec\n", vf_num, jtimer,
- genwqe_vf_jobtimeout_msec);
+ cd->vf_jobtimeout_msec[vf_num]);
}
return 0;
}
@@ -425,6 +425,8 @@ int genwqe_init_debugfs(struct genwqe_dev *cd)
struct dentry *file;
int ret, priv;
char card_name[64];
+ char name[64];
+ unsigned int i;

sprintf(card_name, "%s%u_card", GENWQE_DEVNAME, cd->card_idx);

@@ -538,6 +540,17 @@ int genwqe_init_debugfs(struct genwqe_dev *cd)
goto err1;
}

+ for (i = 0; i < GENWQE_MAX_VFS; i++) {
+ sprintf(name, "vf%d_jobtimeout_msec", i);
+
+ file = debugfs_create_u32(name, 0666, root,
+ &cd->vf_jobtimeout_msec[i]);
+ if (!file) {
+ ret = -ENOMEM;
+ goto err1;
+ }
+ }
+
file = debugfs_create_file("jobtimer", S_IRUGO, root, cd,
&genwqe_jtimer_fops);
if (!file) {

Frank Haverkamp

unread,
Nov 4, 2013, 12:10:02 PM11/4/13
to
New version for this release.

Signed-off-by: Frank Haverkamp <ha...@linux.vnet.ibm.com>
---
drivers/misc/genwqe/genwqe_driver.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/genwqe/genwqe_driver.h b/drivers/misc/genwqe/genwqe_driver.h
index c8601c9..b8df630 100644
--- a/drivers/misc/genwqe/genwqe_driver.h
+++ b/drivers/misc/genwqe/genwqe_driver.h
@@ -35,7 +35,7 @@

#include <linux/genwqe/genwqe_card.h>

-#define DRV_VERS_STRING "1.1.35"
+#define DRV_VERS_STRING "2.0.0"

/*
* Static minor number assignement, until we decide/implement

Frank Haverkamp

unread,
Nov 4, 2013, 12:10:03 PM11/4/13
to
Selecting interface names via configuration option is obsolete.

Signed-off-by: Frank Haverkamp <ha...@linux.vnet.ibm.com>
---
drivers/misc/genwqe/Kconfig | 14 ++------------
include/linux/genwqe/genwqe_card.h | 6 +-----
2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/misc/genwqe/Kconfig b/drivers/misc/genwqe/Kconfig
index bbf137d..6069d8c 100644
--- a/drivers/misc/genwqe/Kconfig
+++ b/drivers/misc/genwqe/Kconfig
@@ -9,15 +9,5 @@ menuconfig GENWQE
default n
help
Enables PCIe card driver for IBM GenWQE accelerators.
- The user-space interface is described in
- include/linux/genwqe/genwqe_card.h.
-
-if GENWQE
-
-config GENWQE_DEVNAME
- string "Name for sysfs and device nodes"
- default "genwqe"
- help
- Select alternate name for sysfs and device nodes.
-
-endif
+ The user-space interface is described in
+ include/linux/genwqe/genwqe_card.h.
diff --git a/include/linux/genwqe/genwqe_card.h b/include/linux/genwqe/genwqe_card.h
index 2c33db1..ffed142 100644
--- a/include/linux/genwqe/genwqe_card.h
+++ b/include/linux/genwqe/genwqe_card.h
@@ -41,11 +41,7 @@
#endif

/* Basename of sysfs, debugfs and /dev interfaces */
-#if defined(CONFIG_GENWQE_DEVNAME)
-# define GENWQE_DEVNAME CONFIG_GENWQE_DEVNAME
-#else
-# define GENWQE_DEVNAME "genwqe"
-#endif
+#define GENWQE_DEVNAME "genwqe"

#define GENWQE_TYPE_ALTERA_230 0x00 /* GenWQE4 Stratix-IV-230 */
#define GENWQE_TYPE_ALTERA_530 0x01 /* GenWQE4 Stratix-IV-530 */

Frank Haverkamp

unread,
Nov 4, 2013, 12:10:03 PM11/4/13
to
The GenWQE device is a PCIe card used to acclerate different tasks.
Since it is configurable, it can be adjusted to different purposes.
Our initial task for the card is to do zlib style compression/decompression
RFC1950, RFC1951, and RFC1952.

I kindly ask for your feedback on the code, such that I can do
any change which helps me to get it integrated smoothly.

Frank Haverkamp (9):
Generic WorkQueue Engine (GenWQE) device driver (v4)
GenWQE: Remove option to select name
GenWQE: Remove obsolete constants
GenWQE: Rework comments
GenWQE: Move comments
GenWQE: Remove/rework module parameters
GenWQE: Start using sysfs attribute groups
GenWQE: Simplify sysfs buffer printouts
GenWQE: Increment driver internal version number

Documentation/ABI/testing/debugfs-driver-genwqe | 70 ++
Documentation/ABI/testing/sysfs-driver-genwqe | 55 +
drivers/misc/Kconfig | 1 +
drivers/misc/Makefile | 1 +
drivers/misc/genwqe/Kconfig | 13 +
drivers/misc/genwqe/Makefile | 8 +
drivers/misc/genwqe/card_base.c | 1203 ++++++++++++++++++
drivers/misc/genwqe/card_base.h | 570 +++++++++
drivers/misc/genwqe/card_ddcb.c | 1380 +++++++++++++++++++++
drivers/misc/genwqe/card_ddcb.h | 188 +++
drivers/misc/genwqe/card_debugfs.c | 579 +++++++++
drivers/misc/genwqe/card_dev.c | 1499 +++++++++++++++++++++++
drivers/misc/genwqe/card_sysfs.c | 290 +++++
drivers/misc/genwqe/card_utils.c | 983 +++++++++++++++
drivers/misc/genwqe/genwqe_driver.h | 75 ++
include/linux/genwqe/genwqe_card.h | 547 +++++++++
16 files changed, 7462 insertions(+), 0 deletions(-)
create mode 100644 Documentation/ABI/testing/debugfs-driver-genwqe
create mode 100644 Documentation/ABI/testing/sysfs-driver-genwqe
create mode 100644 drivers/misc/genwqe/Kconfig
create mode 100644 drivers/misc/genwqe/Makefile
create mode 100644 drivers/misc/genwqe/card_base.c
create mode 100644 drivers/misc/genwqe/card_base.h
create mode 100644 drivers/misc/genwqe/card_ddcb.c
create mode 100644 drivers/misc/genwqe/card_ddcb.h
create mode 100644 drivers/misc/genwqe/card_debugfs.c
create mode 100644 drivers/misc/genwqe/card_dev.c
create mode 100644 drivers/misc/genwqe/card_sysfs.c
create mode 100644 drivers/misc/genwqe/card_utils.c
create mode 100644 drivers/misc/genwqe/genwqe_driver.h
create mode 100644 include/linux/genwqe/genwqe_card.h

Frank Haverkamp

unread,
Nov 4, 2013, 12:10:04 PM11/4/13
to
Some leftovers from the comment cleanup. Fix them up such that
they match the requested format.

Signed-off-by: Frank Haverkamp <ha...@linux.vnet.ibm.com>
---
include/linux/genwqe/genwqe_card.h | 40 +++++++++++++++++++----------------
1 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/include/linux/genwqe/genwqe_card.h b/include/linux/genwqe/genwqe_card.h
index aa3f1b9..5a75147 100644
--- a/include/linux/genwqe/genwqe_card.h
+++ b/include/linux/genwqe/genwqe_card.h
@@ -383,7 +383,7 @@ struct chip_bitstream {
uint32_t progress; /* progress code from processing */
};

-/* issuing a specific DDCB command */
+/* Issuing a specific DDCB command */
#define DDCB_LENGTH 256 /* for debug data */
#define DDCB_ASIV_LENGTH 104 /* len of the DDCB ASIV array */
#define DDCB_ASIV_LENGTH_ATS 96 /* ASIV in ATS architecture */
@@ -427,10 +427,12 @@ struct genwqe_debug_data {
#define ATS_GET_FLAGS(_ats, _byte_offs) \
(((_ats) >> (44 - (4 * ((_byte_offs) / 8)))) & 0xf)

-/*
- * User parameter for generic DDCB commands. On the way into the
- * kernel the driver will read the whole data structure. On the way
- * out the driver will not copy the ASIV data back to userland.
+/**
+ * struct genwqe_ddcb_cmd - User parameter for generic DDCB commands
+ *
+ * On the way into the kernel the driver will read the whole data
+ * structure. On the way out the driver will not copy the ASIV data
+ * back to user-space.
*/
struct genwqe_ddcb_cmd {
/* ------ START of data copied to/from driver ---------------------- */
@@ -495,7 +497,12 @@ static inline void genwqe_ddcb_cmd_init(struct genwqe_ddcb_cmd *cmd)
#define GENWQE_GET_CARD_STATE _IOR(GENWQE_IOC_CODE, 36, \
enum genwqe_card_state *)

-/*
+/**
+ * struct genwqe_mem - Memory pinning/unpinning information
+ * @addr: virtual user space address
+ * @size: size of the area pin/dma-map/unmap
+ * direction: 0: read/1: read and write
+ *
* Avoid pinning and unpinning of memory pages dynamically. Instead
* the idea is to pin the whole buffer space required for DDCB
* opertionas in advance. The driver will reuse this pinning and the
@@ -509,26 +516,23 @@ static inline void genwqe_ddcb_cmd_init(struct genwqe_ddcb_cmd *cmd)
* memory.
*/
struct genwqe_mem {
- unsigned long addr; /* virtual user space address */
- unsigned long size; /* size of the area pin/dma-map/unmap */
- int direction; /* 0: read/1: read and write */
+ unsigned long addr;
+ unsigned long size;
+ int direction;
};

#define GENWQE_PIN_MEM _IOWR(GENWQE_IOC_CODE, 40, struct genwqe_mem *)
#define GENWQE_UNPIN_MEM _IOWR(GENWQE_IOC_CODE, 41, struct genwqe_mem *)

/*
- * @brief Generic synchronous DDCB execution interface.
+ * Generic synchronous DDCB execution interface.
* Synchronously execute a DDCB.
*
- * @param [in] fd open file descriptor to the genwqe_card device.
- * @param [inout] cmd DDCB execution request
- * @return 0 on success or negative error code.
- * -EINVAL: Invalid parameters (ASIV_LEN, ASV_LEN, illegal fixups
- * no mappings found/could not create mappings.
- * -EFAULT: illegal addresses in fixups.
- * purging failed.
- * -EBADMSG: enqueing failed, retc != DDCB_RETC_COMPLETE.
+ * Return: 0 on success or negative error code.
+ * -EINVAL: Invalid parameters (ASIV_LEN, ASV_LEN, illegal fixups
+ * no mappings found/could not create mappings
+ * -EFAULT: illegal addresses in fixups, purging failed
+ * -EBADMSG: enqueing failed, retc != DDCB_RETC_COMPLETE
*/
#define GENWQE_EXECUTE_DDCB \
_IOWR(GENWQE_IOC_CODE, 50, struct genwqe_ddcb_cmd *)
--
1.7.1

Frank Haverkamp

unread,
Nov 4, 2013, 12:10:04 PM11/4/13
to
Use the existing sysfs infrastructure to create multiple attributes
instead of doing things manually. Use the is_visible callback now
to determine if an attribute is visible or not.

Signed-off-by: Frank Haverkamp <ha...@linux.vnet.ibm.com>
---
drivers/misc/genwqe/card_base.h | 6 +-
drivers/misc/genwqe/card_dev.c | 6 +-
drivers/misc/genwqe/card_sysfs.c | 199 ++++++++++++++++++++------------------
3 files changed, 113 insertions(+), 98 deletions(-)

diff --git a/drivers/misc/genwqe/card_base.h b/drivers/misc/genwqe/card_base.h
index 21cef33..76ebfca 100644
--- a/drivers/misc/genwqe/card_base.h
+++ b/drivers/misc/genwqe/card_base.h
@@ -416,11 +416,11 @@ int genwqe_device_create(struct genwqe_dev *cd);
int genwqe_device_remove(struct genwqe_dev *cd);

/* sysfs */
-int create_card_sysfs(struct genwqe_dev *cd);
-void remove_card_sysfs(struct genwqe_dev *cd);
+int genwqe_init_sysfs(struct genwqe_dev *cd);
+void genwqe_exit_sysfs(struct genwqe_dev *cd);

/* debugfs */
-int genwqe_init_debugfs(struct genwqe_dev *cd);
+int genwqe_init_debugfs(struct genwqe_dev *cd);
void genqwe_exit_debugfs(struct genwqe_dev *cd);

int genwqe_read_softreset(struct genwqe_dev *cd);
diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c
index 9faab2b..fabf749 100644
--- a/drivers/misc/genwqe/card_dev.c
+++ b/drivers/misc/genwqe/card_dev.c
@@ -1389,7 +1389,7 @@ int genwqe_device_create(struct genwqe_dev *cd)
}
dev_set_drvdata(cd->dev, cd);

- rc = create_card_sysfs(cd);
+ rc = genwqe_init_sysfs(cd);
if (rc != 0)
goto err_sysfs;

@@ -1400,7 +1400,7 @@ int genwqe_device_create(struct genwqe_dev *cd)
return 0;

err_debugfs:
- remove_card_sysfs(cd);
+ genwqe_exit_sysfs(cd);
err_sysfs:
device_destroy(cd->class_genwqe, cd->devnum_genwqe);
err_cdev:
@@ -1489,7 +1489,7 @@ int genwqe_device_remove(struct genwqe_dev *cd)
}

genqwe_exit_debugfs(cd);
- remove_card_sysfs(cd);
+ genwqe_exit_sysfs(cd);
device_destroy(cd->class_genwqe, cd->devnum_genwqe);
cdev_del(&cd->cdev_genwqe);
unregister_chrdev_region(cd->devnum_genwqe, GENWQE_MAX_MINOR);
diff --git a/drivers/misc/genwqe/card_sysfs.c b/drivers/misc/genwqe/card_sysfs.c
index cac2e06..6a51ad7 100644
--- a/drivers/misc/genwqe/card_sysfs.c
+++ b/drivers/misc/genwqe/card_sysfs.c
@@ -20,9 +20,8 @@

/*
* Sysfs interfaces for the GenWQE card. There are attributes to query
- * the version of the bitstream as well as some for the
- * driver. Additionally there are some attributes which help to debug
- * potential problems.
+ * the version of the bitstream as well as some for the driver. For
+ * debugging, please also see the debugfs interfaces of this driver.
*/

#include <linux/version.h>
@@ -34,6 +33,7 @@
#include <linux/fs.h>
#include <linux/sysfs.h>
#include <linux/ctype.h>
+#include <linux/device.h>

#include "card_base.h"
#include "card_ddcb.h"
@@ -45,9 +45,8 @@ static const char * const genwqe_types[] = {
[GENWQE_TYPE_ALTERA_A7] = "GenWQE5-A7",
};

-static ssize_t show_card_status(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t status_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
{
ssize_t len = 0;
struct genwqe_dev *cd = dev_get_drvdata(dev);
@@ -57,10 +56,10 @@ static ssize_t show_card_status(struct device *dev,
"%s\n", cs[cd->card_state]);
return len;
}
+static DEVICE_ATTR_RO(status);

-static ssize_t show_card_appid(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t appid_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
{
ssize_t len = 0;
char app_name[5];
@@ -71,10 +70,10 @@ static ssize_t show_card_appid(struct device *dev,
"%s\n", app_name);
return len;
}
+static DEVICE_ATTR_RO(appid);

-static ssize_t show_card_version(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t version_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
{
ssize_t len = 0;
u64 slu_id, app_id;
@@ -87,23 +86,10 @@ static ssize_t show_card_version(struct device *dev,
"%016llx.%016llx\n", slu_id, app_id);
return len;
}
+static DEVICE_ATTR_RO(version);

-/**
- * FIXME Implement me!
- */
-static ssize_t show_cpld_version(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- ssize_t len = 0;
- len += scnprintf(&buf[len], PAGE_SIZE - len,
- "unknown (FIXME)\n");
- return len;
-}
-
-static ssize_t show_card_type(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t type_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
{
ssize_t len = 0;
u8 card_type;
@@ -115,20 +101,20 @@ static ssize_t show_card_type(struct device *dev,
"invalid" : genwqe_types[card_type]);
return len;
}
+static DEVICE_ATTR_RO(type);

-static ssize_t show_card_driver(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t driver_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
{
ssize_t len = 0;
len += scnprintf(&buf[len], PAGE_SIZE - len,
"%s\n", DRV_VERS_STRING);
return len;
}
+static DEVICE_ATTR_RO(driver);

-static ssize_t show_card_tempsens(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t tempsens_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
{
ssize_t len = 0;
u64 tempsens;
@@ -139,10 +125,11 @@ static ssize_t show_card_tempsens(struct device *dev,
"%016llx\n", tempsens);
return len;
}
+static DEVICE_ATTR_RO(tempsens);

-static ssize_t show_card_base_clock(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t base_clock_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
{
ssize_t len = 0;
u64 base_clock;
@@ -153,9 +140,10 @@ static ssize_t show_card_base_clock(struct device *dev,
"%lld\n", base_clock);
return len;
}
+static DEVICE_ATTR_RO(base_clock);

/**
- * show_card_curr_bitstream() - Show the current bitstream id
+ * curr_bitstream_show() - Show the current bitstream id
*
* There is a bug in some old versions of the CPLD which selects the
* bitstream, which causes the IO_SLU_BITSTREAM register to report
@@ -171,9 +159,9 @@ static ssize_t show_card_base_clock(struct device *dev,
* on the backup partition (0) to identify problems while loading the
* image.
*/
-static ssize_t show_card_curr_bitstream(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t curr_bitstream_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
{
ssize_t len = 0;
int curr_bitstream;
@@ -184,21 +172,22 @@ static ssize_t show_card_curr_bitstream(struct device *dev,
"%d\n", curr_bitstream);
return len;
}
+static DEVICE_ATTR_RO(curr_bitstream);

/**
- * show_card_next_bitstream() - Show the next activated bitstream
+ * next_bitstream_show() - Show the next activated bitstream
*
* IO_SLC_CFGREG_SOFTRESET: This register can only be accessed by the PF.
*/
-static ssize_t show_card_next_bitstream(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t next_bitstream_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
{
ssize_t len = 0;
int next_bitstream;
struct genwqe_dev *cd = dev_get_drvdata(dev);

- switch ((cd->softreset & 0xCull) >> 2) {
+ switch ((cd->softreset & 0xcull) >> 2) {
case 0x2:
next_bitstream = 0;
break;
@@ -214,9 +203,9 @@ static ssize_t show_card_next_bitstream(struct device *dev,
return len;
}

-static ssize_t store_card_next_bitstream(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
+static ssize_t next_bitstream_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
u64 partition;
struct genwqe_dev *cd = dev_get_drvdata(dev);
@@ -238,69 +227,95 @@ static ssize_t store_card_next_bitstream(struct device *dev,
__genwqe_writeq(cd, IO_SLC_CFGREG_SOFTRESET, cd->softreset);
return count;
}
+static DEVICE_ATTR_RW(next_bitstream);
+
+/**
+ * FIXME Implement me!
+ */
+static ssize_t cpld_version_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ ssize_t len = 0;
+ len += scnprintf(&buf[len], PAGE_SIZE - len, "unknown (FIXME)\n");
+ return len;
+}
+static DEVICE_ATTR_RO(cpld_version);

/*
* Create device_attribute structures / params: name, mode, show, store
* additional flag if valid in VF
*/
-struct genwqe_dev_attrib {
- struct device_attribute att; /* sysfs entry attributes */
- int vf; /* may exist in VF or not */
+static struct attribute *genwqe_attributes[] = {
+ &dev_attr_tempsens.attr,
+ &dev_attr_next_bitstream.attr,
+ &dev_attr_curr_bitstream.attr,
+ &dev_attr_base_clock.attr,
+ &dev_attr_driver.attr,
+ &dev_attr_type.attr,
+ &dev_attr_version.attr,
+ &dev_attr_appid.attr,
+ &dev_attr_status.attr,
+ &dev_attr_cpld_version.attr,
+ NULL,
};

-static struct genwqe_dev_attrib dev_attr_tab[] = {
- {__ATTR(tempsens, S_IRUGO, show_card_tempsens, NULL), 0},
- {__ATTR(next_bitstream, (S_IRUGO | S_IWUSR),
- show_card_next_bitstream, store_card_next_bitstream), 0},
- {__ATTR(curr_bitstream, S_IRUGO, show_card_curr_bitstream, NULL), 0},
- {__ATTR(cpld_version, S_IRUGO, show_cpld_version, NULL), 0},
- {__ATTR(base_clock, S_IRUGO, show_card_base_clock, NULL), 0},
-
- {__ATTR(driver, S_IRUGO, show_card_driver, NULL), 1},
- {__ATTR(type, S_IRUGO, show_card_type, NULL), 1},
- {__ATTR(version, S_IRUGO, show_card_version, NULL), 1},
- {__ATTR(appid, S_IRUGO, show_card_appid, NULL), 1},
- {__ATTR(status, S_IRUGO, show_card_status, NULL), 1},
+static struct attribute *genwqe_normal_attributes[] = {
+ &dev_attr_driver.attr,
+ &dev_attr_type.attr,
+ &dev_attr_version.attr,
+ &dev_attr_appid.attr,
+ &dev_attr_status.attr,
+ NULL,
};

/**
- * create_card_sysfs() - Setup sysfs entries of the card device
+ * genwqe_is_visible() - Determine if sysfs attribute should be visible or not
*
* VFs have restricted mmio capabilities, so not all sysfs entries
* are allowed in VFs.
*/
-int create_card_sysfs(struct genwqe_dev *cd)
+static umode_t genwqe_is_visible(struct kobject *kobj,
+ struct attribute *attr, int n)
{
- int rc, priv;
- unsigned int i;
-
- priv = genwqe_is_privileged(cd);
- for (i = 0; i < ARRAY_SIZE(dev_attr_tab); i++) {
- struct genwqe_dev_attrib *dev_attr = &dev_attr_tab[i];
- if (dev_attr->vf || priv) {
- rc = device_create_file(cd->dev, &dev_attr->att);
- if (rc != 0)
- goto err_exit;
- }
- }
+ unsigned int j;
+ struct device *dev = container_of(kobj, struct device, kobj);
+ struct genwqe_dev *cd = dev_get_drvdata(dev);
+ umode_t mode = attr->mode;
+
+ if (genwqe_is_privileged(cd))
+ return mode;
+
+ for (j = 0; genwqe_normal_attributes[j] != NULL; j++)
+ if (genwqe_normal_attributes[j] == attr)
+ return mode;
+
return 0;
+}
+
+static struct attribute_group genwqe_attribute_group = {
+ .is_visible = genwqe_is_visible,
+ .attrs = genwqe_attributes,
+};

- err_exit:
- return -ENXIO;
+/**
+ * genwqe_init_sysfs() - Setup sysfs entries of the card device
+ */
+int genwqe_init_sysfs(struct genwqe_dev *cd)
+{
+ int rc;
+
+ rc = sysfs_create_group(&cd->dev->kobj, &genwqe_attribute_group);
+ if (rc)
+ return -ENXIO;
+
+ return 0;
}

/**
- * remove_card_sysfs() - Remove sysfs entries
+ * genwqe_exit_sysfs() - Remove sysfs entries
*/
-void remove_card_sysfs(struct genwqe_dev *cd)
+void genwqe_exit_sysfs(struct genwqe_dev *cd)
{
- int priv;
- unsigned int i;
-
- priv = genwqe_is_privileged(cd);
- for (i = 0; i < ARRAY_SIZE(dev_attr_tab); i++) {
- struct genwqe_dev_attrib *dev_attr = &dev_attr_tab[i];
- if (dev_attr->vf || priv)
- device_remove_file(cd->dev, &dev_attr->att);
- }
+ sysfs_remove_group(&cd->dev->kobj, &genwqe_attribute_group);
}
--
1.7.1

Frank Haverkamp

unread,
Nov 4, 2013, 12:10:02 PM11/4/13
to
Move documentation from driver sources to appropriate place in the
sysfs documentation file for this driver

Signed-off-by: Frank Haverkamp <ha...@linux.vnet.ibm.com>
---
Documentation/ABI/testing/sysfs-driver-genwqe | 9 +++++++++
drivers/misc/genwqe/card_base.c | 20 --------------------
2 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-driver-genwqe b/Documentation/ABI/testing/sysfs-driver-genwqe
index d85c076..0976901 100644
--- a/Documentation/ABI/testing/sysfs-driver-genwqe
+++ b/Documentation/ABI/testing/sysfs-driver-genwqe
@@ -44,3 +44,12 @@ What: /sys/class/genwqe/genwqe<n>_card/base_clock
Date: Oct 2013
Contact: ha...@linux.vnet.ibm.com
Description: Base clock frequency of the card.
+
+What: /sys/class/genwqe/genwqe<n>_card/device/sriov_numvfs
+Date: Oct 2013
+Contact: ha...@linux.vnet.ibm.com
+Description: Enable VFs (1..15):
+ sudo sh -c 'echo 15 > \
+ /sys/bus/pci/devices/0000\:1b\:00.0/sriov_numvfs'
+ Disable VFs:
+ Write a 0 into the same sysfs entry.
diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c
index 271d957..c649ef7 100644
--- a/drivers/misc/genwqe/card_base.c
+++ b/drivers/misc/genwqe/card_base.c
@@ -22,16 +22,6 @@
* Module initialization and PCIe setup. Card health monitoring and
* recovery functionality. Character device creation and deletion are
* controlled from here.
- *
- * Please use the new sysfs interfaces to enable the VFs after PF
- * driver loading.
- *
- * Enable VFs:
- * sudo sh -c 'echo 15 > /sys/bus/pci/devices/0000\:1b\:00.0/sriov_numvfs'
- * or
- * sudo sh -c 'echo 15 > /sys/class/genwqe/genwqe0_card/device/sriov_numvfs'
- * Disable VFs:
- * Write a 0 into the same sysfs entries.
*/

#include <linux/module.h>
@@ -798,22 +788,12 @@ static u64 genwqe_fir_checking(struct genwqe_dev *cd)
*
* This thread must only exit if kthread_should_stop() becomes true.
*
- * Testing bind/unbind with:
- * sudo sh -c "echo -n 0000:20:00.0 > /sys/bus/pci/drivers/genwqe/unbind"
- * sudo sh -c "echo -n 0000:20:00.0 > /sys/bus/pci/drivers/genwqe/bind"
- *
* Condition for the health-thread to trigger:
* a) when a kthread_stop() request comes in or
* b) a critical GFIR occured
*
* Informational GFIRs are checked and potentially printed in
* health_check_interval seconds.
- *
- * Testcase to trigger this code:
- * Fatal GFIR:
- * sudo ./tools/genwqe_poke -C0 0x00000008 0x001
- * Info GFIR by writing to VF:
- * sudo ./tools/genwqe_poke -C2 0x00020020 0x800
*/
static int genwqe_health_thread(void *data)
{
--
1.7.1

Frank Haverkamp

unread,
Nov 4, 2013, 12:20:03 PM11/4/13
to
The removed constants should not be part of the user-space kernel
interface.

Signed-off-by: Frank Haverkamp <ha...@linux.vnet.ibm.com>
---
include/linux/genwqe/genwqe_card.h | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/include/linux/genwqe/genwqe_card.h b/include/linux/genwqe/genwqe_card.h
index ffed142..aa3f1b9 100644
--- a/include/linux/genwqe/genwqe_card.h
+++ b/include/linux/genwqe/genwqe_card.h
@@ -390,18 +390,6 @@ struct chip_bitstream {
#define DDCB_ASV_LENGTH 64 /* len of the DDCB ASV array */
#define DDCB_FIXUPS 12 /* maximum number of fixups */

-/*
- * We might have addresses within the ASIV data. Those need to be
- * replaced by valid DMA addresses to the buffer, sg-list or
- * child-block in the kernel driver handling the request.
- */
-#define GENWQE_DMA_TYPE_MASK 0x18 /* mask off type */
-#define GENWQE_DMA_TYPE_RAW 0x00 /* no DMA addr */
-#define GENWQE_DMA_TYPE_FLAT 0x08 /* contignous DMA block */
-#define GENWQE_DMA_TYPE_SGLIST 0x10 /* DMA sg-list */
-#define GENWQE_DMA_TYPE_CHILD 0x18 /* DMA child-block */
-#define GENWQE_DMA_WRITEABLE 0x04 /* memory writeable? */
-
struct genwqe_debug_data {
char driver_version[64];
uint64_t slu_unitcfg;
--
1.7.1

Ryan Mallon

unread,
Nov 4, 2013, 5:00:03 PM11/4/13
to
On 05/11/13 04:08, Frank Haverkamp wrote:
> Selecting interface names via configuration option is obsolete.

Don't do this. You are adding completely new code, so there is no reason
to post a patch full of code that is known to be incorrect, followed by
a set of patches fixing things. Just post the correct code to start
with. This makes the git history cleaner, and makes the code easier to
review.

You can use tools like git interactive rebase to split your work into
multiple patches. It should be quite easy for this because you mostly
just want to break down things to the file level, so even:

git reset --soft <your-first-commit>

and then manually staging and commiting things from there would probably
be enough. You can use git add --interactive to stage individual file
hunks if you want to break things down further.

~Ryan

Greg KH

unread,
Nov 4, 2013, 5:20:02 PM11/4/13
to
On Mon, Nov 04, 2013 at 06:08:01PM +0100, Frank Haverkamp wrote:
> +if GENWQE
> +
> +config GENWQE_DEVNAME
> + string "Name for sysfs and device nodes"
> + default "genwqe"
> + help
> + Select alternate name for sysfs and device nodes.
> +
> +endif

Why is this still here? I thought you said you had removed this?

Frank Haverkamp

unread,
Nov 5, 2013, 2:30:01 AM11/5/13
to
Am Montag, den 04.11.2013, 14:12 -0800 schrieb Greg KH:
> On Mon, Nov 04, 2013 at 06:08:01PM +0100, Frank Haverkamp wrote:
> > +if GENWQE
> > +
> > +config GENWQE_DEVNAME
> > + string "Name for sysfs and device nodes"
> > + default "genwqe"
> > + help
> > + Select alternate name for sysfs and device nodes.
> > +
> > +endif
>
> Why is this still here? I thought you said you had removed this?
>

I posted my original v4 version of the code plus the requested changes
on top of it. But I think, I should rather follow Ryans suggestion how
to split the code into multiple patches. See his last mail. So I will
need to spend some time today to get the patch into the form he
suggested.

Regards

Frank

Frank Haverkamp

unread,
Nov 5, 2013, 4:10:02 AM11/5/13
to
Hi Ryan,

Am Dienstag, den 05.11.2013, 08:55 +1100 schrieb Ryan Mallon:
> On 05/11/13 04:08, Frank Haverkamp wrote:
> > Selecting interface names via configuration option is obsolete.
>
> Don't do this. You are adding completely new code, so there is no reason
> to post a patch full of code that is known to be incorrect, followed by
> a set of patches fixing things. Just post the correct code to start
> with. This makes the git history cleaner, and makes the code easier to
> review.

Agreed.

> You can use tools like git interactive rebase to split your work into
> multiple patches. It should be quite easy for this because you mostly
> just want to break down things to the file level, so even:
>
> git reset --soft <your-first-commit>
>
> and then manually staging and commiting things from there would probably
> be enough. You can use git add --interactive to stage individual file
> hunks if you want to break things down further.

I have sent "Generic WorkQueue Engine (GenWQE) device driver (v6)" now
which hopefully is what you wanted.

Regards

Frank
0 new messages