public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Moore <eric.moore@lsil.com>
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@SteelEye.com
Subject: [PATCH] sas transport sysfs write attributes bug fix
Date: Tue, 25 Apr 2006 17:35:28 -0600	[thread overview]
Message-ID: <20060425233528.GA9238@lsil.com> (raw)

The SAS Transport Layers SySFS write attributes were recently broke when
SETUP_OPTIONAL_PORT_ATTRIBUTE_WRONLY was added.  This fix's the following
write attributes:

	/sys/class/sas_phy/phy-0:0/hard_reset
	/sys/class/sas_phy/phy-0:0/link_reset

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>


diff -uarN b/drivers/scsi/scsi_transport_sas.c a/drivers/scsi/scsi_transport_sas.c
--- b/drivers/scsi/scsi_transport_sas.c	2006-04-20 17:23:04.000000000 -0600
+++ a/drivers/scsi/scsi_transport_sas.c	2006-04-25 17:13:21.000000000 -0600
@@ -982,6 +982,13 @@
 	if (test)							\
 		count++
 
+#define SETUP_TEMPLATE_WRONLY(attrb, field, perm, test)				\
+	i->private_##attrb[count] = class_device_attr_##field;		\
+	i->private_##attrb[count].attr.mode = perm;			\
+	i->private_##attrb[count].show = NULL;				\
+	i->attrb[count] = &i->private_##attrb[count];			\
+	if (test)							\
+		count++
 
 #define SETUP_RPORT_ATTRIBUTE(field) 					\
 	SETUP_TEMPLATE(rphy_attrs, field, S_IRUGO, 1)
@@ -996,10 +1003,10 @@
 	SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, i->f->func)
 
 #define SETUP_PORT_ATTRIBUTE_WRONLY(field)				\
-	SETUP_TEMPLATE(phy_attrs, field, S_IWUGO, 1)
+	SETUP_TEMPLATE_WRONLY(phy_attrs, field, S_IWUGO, 1)
 
 #define SETUP_OPTIONAL_PORT_ATTRIBUTE_WRONLY(field, func)		\
-	SETUP_TEMPLATE(phy_attrs, field, S_IWUGO, i->f->func)
+	SETUP_TEMPLATE_WRONLY(phy_attrs, field, S_IWUGO, i->f->func)
 
 #define SETUP_END_DEV_ATTRIBUTE(field)					\
 	SETUP_TEMPLATE(end_dev_attrs, field, S_IRUGO, 1)

             reply	other threads:[~2006-04-25 23:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-25 23:35 Eric Moore [this message]
2006-04-25 23:57 ` [PATCH] sas transport sysfs write attributes bug fix James Bottomley
2006-04-26  5:18   ` Moore, Eric

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=20060425233528.GA9238@lsil.com \
    --to=eric.moore@lsil.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linux-scsi@vger.kernel.org \
    /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