[PATCH] [SCSI] advansys: change buildtime warning into runtime error

2012-11-05 Thread Paul Bolle
Building advansys.o triggers this warning:
drivers/scsi/advansys.c:71:2: warning: #warning this driver is still not 
properly converted to the DMA API [-Wcpp]

This warning can be traced back to a patch called advansys: add warning
and convert #includes which was included in v2.6.10. That patch also
marked the driver as BROKEN.

Commit 4661e3eace2c7b8433476b5bf0ee437ab3c7dfd4 ([SCSI] advansys
driver: limp along on x86) enabled this driver for x86-32. And commit
9d511a4b29de6764931343d03e493f2e04df0271 ([SCSI] advansys: Changes to
work on parisc) enabled this driver for all architectures. But the
commit explanation stated:
I haven't removed the #warning yet because virt_to_bus/bus_to_virt are
only eliminated for narrow boards.  Wide boards need more work.

Five years have passed and, apparently, those wide boards still need
more work. So let's change the buildtime warning into a runtime error,
only printed for those wide boards. Perhaps that might push the people
using those wide boards to convert this driver. And for all others
there's now one less buildtime warning to ignore.

Signed-off-by: Paul Bolle pebo...@tiscali.nl
---
Compile tested only. I don't have any AdvanSys SCSI boards (neither
narrow nor wide).

 drivers/scsi/advansys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 374c4ed..23d347d 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -68,7 +68,6 @@
  *  7. advansys_info is not safe against multiple simultaneous callers
  *  8. Add module_param to override ISA/VLB ioport array
  */
-#warning this driver is still not properly converted to the DMA API
 
 /* Enable driver /proc statistics. */
 #define ADVANSYS_STATS
@@ -12772,6 +12771,7 @@ advansys_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
pdev-device == PCI_DEVICE_ID_38C0800_REV1 ||
pdev-device == PCI_DEVICE_ID_38C1600_REV1) {
board-flags |= ASC_IS_WIDE_BOARD;
+   pr_err(This driver is still not properly converted to the DMA 
API);
}
 
err = advansys_board_found(shost, ioport, ASC_IS_PCI);
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [SCSI] aic94xx: Remove broken fallback for missing 'Ctrl-A' user settings

2012-11-05 Thread Ben Hutchings
asd_process_ctrl_a_user() attempts to find user settings in flash, and
if they are missing it prepares a substitute structure containing
default values for PHY settings.  But having done so, it will still
try to read user settings - from some random address in flash, as the
local variable 'offs' has not been initialised.

Since asd_common_setup() already sets default PHY settings, there
seems to be no need to repeat them here, and we can just return 0.
This matches what is done if any empty user settings area is found.

Signed-off-by: Ben Hutchings b...@decadent.org.uk
---
Compile-tested only.

Ben.

 drivers/scsi/aic94xx/aic94xx_sds.c |   19 +++
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c 
b/drivers/scsi/aic94xx/aic94xx_sds.c
index edb43fd..7b13ccc 100644
--- a/drivers/scsi/aic94xx/aic94xx_sds.c
+++ b/drivers/scsi/aic94xx/aic94xx_sds.c
@@ -981,29 +981,16 @@ static int asd_process_ctrla_phy_settings(struct 
asd_ha_struct *asd_ha,
 static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha,
   struct asd_flash_dir *flash_dir)
 {
-   int err, i;
+   int err;
u32 offs, size;
struct asd_ll_el *el;
struct asd_ctrla_phy_settings *ps;
-   struct asd_ctrla_phy_settings dflt_ps;
 
err = asd_find_flash_de(flash_dir, FLASH_DE_CTRL_A_USER, offs, size);
if (err) {
ASD_DPRINTK(couldn't find CTRL-A user settings section\n);
-   ASD_DPRINTK(Creating default CTRL-A user settings section\n);
-
-   dflt_ps.id0 = 'h';
-   dflt_ps.num_phys = 8;
-   for (i =0; i  ASD_MAX_PHYS; i++) {
-   memcpy(dflt_ps.phy_ent[i].sas_addr,
-  asd_ha-hw_prof.sas_addr, SAS_ADDR_SIZE);
-   dflt_ps.phy_ent[i].sas_link_rates = 0x98;
-   dflt_ps.phy_ent[i].flags = 0x0;
-   dflt_ps.phy_ent[i].sata_link_rates = 0x0;
-   }
-
-   size = sizeof(struct asd_ctrla_phy_settings);
-   ps = dflt_ps;
+   ASD_DPRINTK(Using default settings\n);
+   return 0;
}
 
if (size == 0)


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [SCSI] mv_sas: Fix confusion between enum sas_device_type and enum sas_dev_type

2012-11-05 Thread Ben Hutchings
The enumeration of standard types is called enum sas_device_type and
is defined in scsi/scsi_transport_sas.h along with the Linux
internal structures, whereas the enumeration with Linux extensions is
called enum sas_dev_type and is defined in scsi/sas.h along with the
standard-defined structures.  All clear?  Apparently not; I can't
think why.

Signed-off-by: Ben Hutchings b...@decadent.org.uk
---
 drivers/scsi/mvsas/mv_sas.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
index a3776d6..9f91359 100644
--- a/drivers/scsi/mvsas/mv_sas.c
+++ b/drivers/scsi/mvsas/mv_sas.c
@@ -1153,10 +1153,10 @@ void mvs_update_phyinfo(struct mvs_info *mvi, int i, 
int get_st)
phy-identify.device_type =
phy-att_dev_info  PORT_DEV_TYPE_MASK;
 
-   if (phy-identify.device_type == SAS_END_DEV)
+   if (phy-identify.device_type == SAS_END_DEVICE)
phy-identify.target_port_protocols =
SAS_PROTOCOL_SSP;
-   else if (phy-identify.device_type != NO_DEVICE)
+   else if (phy-identify.device_type != SAS_PHY_UNUSED)
phy-identify.target_port_protocols =
SAS_PROTOCOL_SMP;
if (oob_done)

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch,v2 01/10] scsi: add scsi_host_alloc_node

2012-11-05 Thread Jeff Moyer
Bart Van Assche bvanass...@acm.org writes:

 On 11/02/12 22:45, Jeff Moyer wrote:
 diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
 index 593085a..7d7ad8b 100644
 --- a/drivers/scsi/hosts.c
 +++ b/drivers/scsi/hosts.c
 @@ -336,16 +336,25 @@ static struct device_type scsi_host_type = {
**/
   struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int 
 privsize)
   {
 +return scsi_host_alloc_node(sht, privsize, -1);

 Using NUMA_NO_NODE here might improve readability.

Agreed, I'll fix that.

 diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
 index 4908480..a1b5c8e 100644
 --- a/include/scsi/scsi_host.h
 +++ b/include/scsi/scsi_host.h
 @@ -733,6 +733,12 @@ struct Scsi_Host {
  struct device *dma_dev;

  /*
 + * Numa node this device is closest to, used for allocating
 + * data structures locally.
 + */
 +int numa_node;

 Have you considered using #ifdef CONFIG_NUMA / #endif here ? I've
 noticed that all other numa_node members in structures under include/
 have this.

That was an oversight, thanks for pointing it out.  I'll fix it up.

Cheers,
Jeff
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch,v2 04/10] scsi: allocate scsi_cmnd-s from the device's local numa node

2012-11-05 Thread Jeff Moyer
Bart Van Assche bvanass...@acm.org writes:

 On 11/02/12 22:45, Jeff Moyer wrote:
 diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
 index 2936b44..4db6973 100644
 --- a/drivers/scsi/scsi.c
 +++ b/drivers/scsi/scsi.c
 @@ -173,16 +173,20 @@ static DEFINE_MUTEX(host_cmd_pool_mutex);
* NULL on failure
*/
   static struct scsi_cmnd *
 -scsi_pool_alloc_command(struct scsi_host_cmd_pool *pool, gfp_t gfp_mask)
 +scsi_pool_alloc_command(struct scsi_host_cmd_pool *pool, gfp_t gfp_mask,
 +int node)
   {
  struct scsi_cmnd *cmd;

 -cmd = kmem_cache_zalloc(pool-cmd_slab, gfp_mask | pool-gfp_mask);
 +cmd = kmem_cache_alloc_node(pool-cmd_slab,
 +gfp_mask | pool-gfp_mask | __GFP_ZERO,
 +node);
  if (!cmd)
  return NULL;

 -cmd-sense_buffer = kmem_cache_alloc(pool-sense_slab,
 - gfp_mask | pool-gfp_mask);
 +cmd-sense_buffer = kmem_cache_alloc_node(pool-sense_slab,
 +gfp_mask | pool-gfp_mask | __GFP_ZERO,
 +node);

 It's not clear to me why __GFP_ZERO is added to the allocation flags ?

Hmm, seems I thought this was another case of kmem_cache_zalloc.  I'll
fix it up.

Cheers,
Jeff
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch,v2 05/10] sd: use alloc_disk_node

2012-11-05 Thread Jeff Moyer
Bart Van Assche bvanass...@acm.org writes:

 On 11/02/12 22:45, Jeff Moyer wrote:
 Signed-off-by: Jeff Moyer jmo...@redhat.com
 ---
   drivers/scsi/sd.c |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

 diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
 index 12f6fdf..8deb915 100644
 --- a/drivers/scsi/sd.c
 +++ b/drivers/scsi/sd.c
 @@ -2714,7 +2714,7 @@ static int sd_probe(struct device *dev)
  if (!sdkp)
  goto out;

 -gd = alloc_disk(SD_MINORS);
 +gd = alloc_disk_node(SD_MINORS, dev_to_node(dev));
  if (!gd)
  goto out_free;

 shost-numa_node can be another NUMA node than dev_to_node(dev). Have
 you considered using shost-numa_node here ?

It can?  How?

Just so I'm clear, you're suggesting I use the scsi_device's host
pointer to get to the Scsi_Host, and that *will* be filled in that this
point, right?

Cheers,
Jeff
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch,v2 05/10] sd: use alloc_disk_node

2012-11-05 Thread Bart Van Assche

On 11/05/12 15:12, Jeff Moyer wrote:

Bart Van Assche bvanass...@acm.org writes:


On 11/02/12 22:45, Jeff Moyer wrote:

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
   drivers/scsi/sd.c |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 12f6fdf..8deb915 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2714,7 +2714,7 @@ static int sd_probe(struct device *dev)
if (!sdkp)
goto out;

-   gd = alloc_disk(SD_MINORS);
+   gd = alloc_disk_node(SD_MINORS, dev_to_node(dev));
if (!gd)
goto out_free;


shost-numa_node can be another NUMA node than dev_to_node(dev). Have
you considered using shost-numa_node here ?


It can?  How?


E.g. if the LLD allows the user to specify the value of numa_node and 
passes that value to scsi_host_alloc_node() (see also 
http://lkml.org/lkml/2012/10/23/477 for further information).



Just so I'm clear, you're suggesting I use the scsi_device's host
pointer to get to the Scsi_Host, and that *will* be filled in that this
point, right?


As far as I can see the sdev-host pointer is set in scsi_alloc_sdev() 
and that happens before sd_probe() is invoked.


Bart.

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch,v2 05/10] sd: use alloc_disk_node

2012-11-05 Thread taco

On 11/05/2012 10:57 PM, Bart Van Assche wrote:

On 11/05/12 15:12, Jeff Moyer wrote:

Bart Van Assche bvanass...@acm.org writes:


On 11/02/12 22:45, Jeff Moyer wrote:

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
   drivers/scsi/sd.c |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 12f6fdf..8deb915 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2714,7 +2714,7 @@ static int sd_probe(struct device *dev)
   if (!sdkp)
   goto out;

-gd = alloc_disk(SD_MINORS);
+gd = alloc_disk_node(SD_MINORS, dev_to_node(dev));
   if (!gd)
   goto out_free;


shost-numa_node can be another NUMA node than dev_to_node(dev). Have
you considered using shost-numa_node here ?


It can?  How?


E.g. if the LLD allows the user to specify the value of numa_node and 
passes that value to scsi_host_alloc_node() (see also 
http://lkml.org/lkml/2012/10/23/477 for further information).



Just so I'm clear, you're suggesting I use the scsi_device's host
pointer to get to the Scsi_Host, and that *will* be filled in that this
point, right?


As far as I can see the sdev-host pointer is set in scsi_alloc_sdev() 
and that happens before sd_probe() is invoked.



yes, struct scsi_device was created before sd, sd is the top layer.

Bart.

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: merging printk and WARN

2012-11-05 Thread David Sterba
On Sun, Nov 04, 2012 at 09:25:53PM +0100, Julia Lawall wrote:
 It looks like these patches were not a good idea, because in each case the
 printk provides an error level, and WARN then provides another one.

I think this is not a problem within btrfs at the place where this has
changed.

david
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] [SCSI] mvsas: fix multiple shift issues

2012-11-05 Thread Xi Wang
The main issue is that bit(n) is defined as:

(u32)1  n

Thus bit(n) with n = 32 will produce 0 or 1, depending on the
architecture.  This is also undefined behavior in C.

The OR with sata_reg_set (u64) then doesn't work because bit()
does a 32-bit shift, which should have been a 64-bit shift:

if (i = 32) {
mvi-sata_reg_set |= bit(i);
...
}

The other two patches fix similar oversized shift issues.

Xi Wang (3):
  [SCSI] mvsas: fix shift in mvs_94xx_assign_reg_set()
  [SCSI] mvsas: fix shift in mvs_94xx_free_reg_set()
  [SCSI] mvsas: fix shift in mv_ffc64()

 drivers/scsi/mvsas/mv_94xx.c |8 +---
 drivers/scsi/mvsas/mv_94xx.h |   14 ++
 drivers/scsi/mvsas/mv_sas.h  |2 +-
 3 files changed, 8 insertions(+), 16 deletions(-)

-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] [SCSI] mvsas: fix shift in mvs_94xx_assign_reg_set()

2012-11-05 Thread Xi Wang
The macro bit(n) is defined as ((u32)1  n), and thus it doesn't
work with n = 32, such as in mvs_94xx_assign_reg_set():

if (i = 32) {
mvi-sata_reg_set |= bit(i);
...
}

The shift ((u32)1  n) with n = 32 also leads to undefined behavior.
The result varies depending on the architecture.

This patch changes bit(n) to do a 64-bit shift.

Signed-off-by: Xi Wang xi.w...@gmail.com
---
 drivers/scsi/mvsas/mv_sas.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mvsas/mv_sas.h b/drivers/scsi/mvsas/mv_sas.h
index c04a4f5..da24955 100644
--- a/drivers/scsi/mvsas/mv_sas.h
+++ b/drivers/scsi/mvsas/mv_sas.h
@@ -69,7 +69,7 @@ extern struct kmem_cache *mvs_task_list_cache;
 #define DEV_IS_EXPANDER(type)  \
((type == EDGE_DEV) || (type == FANOUT_DEV))
 
-#define bit(n) ((u32)1  n)
+#define bit(n) ((u64)1  n)
 
 #define for_each_phy(__lseq_mask, __mc, __lseq)\
for ((__mc) = (__lseq_mask), (__lseq) = 0;  \
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] [SCSI] mvsas: fix shift in mvs_94xx_free_reg_set()

2012-11-05 Thread Xi Wang
Invoking bit(n) with n = 64 is undefined behavior, since bit(n) does
a 64-bit shift.  This patch adds a check on the shifting amount.

Signed-off-by: Xi Wang xi.w...@gmail.com
---
 drivers/scsi/mvsas/mv_94xx.c |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/mvsas/mv_94xx.c b/drivers/scsi/mvsas/mv_94xx.c
index 7e423e5..e1f35d4 100644
--- a/drivers/scsi/mvsas/mv_94xx.c
+++ b/drivers/scsi/mvsas/mv_94xx.c
@@ -715,11 +715,13 @@ static void mvs_94xx_free_reg_set(struct mvs_info *mvi, 
u8 *tfs)
if (*tfs == MVS_ID_NOT_MAPPED)
return;
 
-   mvi-sata_reg_set = ~bit(reg_set);
-   if (reg_set  32)
+   if (reg_set  32) {
+   mvi-sata_reg_set = ~bit(reg_set);
w_reg_set_enable(reg_set, (u32)mvi-sata_reg_set);
-   else
+   } else if (reg_set  64) {
+   mvi-sata_reg_set = ~bit(reg_set);
w_reg_set_enable(reg_set, (u32)(mvi-sata_reg_set  32));
+   }
 
*tfs = MVS_ID_NOT_MAPPED;
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] [SCSI] mvsas: fix shift in mv_ffc64()

2012-11-05 Thread Xi Wang
Invoking ffz(x) with x = ~0 is undefined.  This patch returns -1
for this case, and invokes __ffs64() instead.

Signed-off-by: Xi Wang xi.w...@gmail.com
---
 drivers/scsi/mvsas/mv_94xx.h |   14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/mvsas/mv_94xx.h b/drivers/scsi/mvsas/mv_94xx.h
index 8f7eb4f..487aa6f 100644
--- a/drivers/scsi/mvsas/mv_94xx.h
+++ b/drivers/scsi/mvsas/mv_94xx.h
@@ -258,21 +258,11 @@ enum sas_sata_phy_regs {
 #define SPI_ADDR_VLD_94XX  (1U  1)
 #define SPI_CTRL_SpiStart_94XX (1U  0)
 
-#define mv_ffc(x)   ffz(x)
-
 static inline int
 mv_ffc64(u64 v)
 {
-   int i;
-   i = mv_ffc((u32)v);
-   if (i = 0)
-   return i;
-   i = mv_ffc((u32)(v32));
-
-   if (i != 0)
-   return 32 + i;
-
-   return -1;
+   u64 x = ~v;
+   return x ? __ffs64(x) : -1;
 }
 
 #define r_reg_set_enable(i) \
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [osd-dev] [PATCH] osduld: Add osdname systemid sysfs at scsi_osd class

2012-11-05 Thread Boaz Harrosh
On 10/24/2012 02:55 PM, Boaz Harrosh wrote:
 On 10/24/2012 02:51 PM, Boaz Harrosh wrote:

 This patch adds the support for the following two read-only sysfs attributes
 to scsi_osd class members : osdname  systemid

 These attributes will show up as below in sysfs class hierarchy:
 /sys/class/scsi_osd/osdX/osdname
 /sys/class/scsi_osd/osdX/systemid

 The osdname  systemid are OSD device attributes which uniquely
 identify a device on the network, while it's IP and certainly
 it's /dev/osdX device path might change.
 Userspace utilities (e.g. mkfs.exofs) can parse these attributes to
 identify the correct OSD in safer and faster way.

 (Today osd apps open each device in the system and send a
  attributes query for these, in order to access the user
  requested device)

 Signed-off-by: Sachin Bhamare sbham...@panasas.com
 Signed-off-by: Boaz Harrosh bharr...@panasas.com
 
 James hi.
 
 This is for the next (v3.8) merge window. Please submit to scsi-misc tree.
 

James ping!

Do you want that I push it through my osd tree?

Thanks
Boaz

 It is actually a very old well tested, but forgotten patch.
 
 Thanks
 Boaz
 
 ---
  drivers/scsi/osd/osd_uld.c |   28 
  1 files changed, 28 insertions(+), 0 deletions(-)

 diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c
 index d4ed9eb..4375417 100644
 --- a/drivers/scsi/osd/osd_uld.c
 +++ b/drivers/scsi/osd/osd_uld.c
 @@ -97,9 +97,37 @@ struct osd_dev_handle {
  
  static DEFINE_IDA(osd_minor_ida);
  
 +/*
 + * scsi sysfs attribute operations
 + */
 +static ssize_t osdname_show(struct device *dev, struct device_attribute 
 *attr,
 +char *buf)
 +{
 +struct osd_uld_device *ould = container_of(dev, struct osd_uld_device,
 +   class_dev);
 +return sprintf(buf, %s\n, ould-odi.osdname);
 +}
 +
 +static ssize_t systemid_show(struct device *dev, struct device_attribute 
 *attr,
 +char *buf)
 +{
 +struct osd_uld_device *ould = container_of(dev, struct osd_uld_device,
 +   class_dev);
 +
 +memcpy(buf, ould-odi.systemid, ould-odi.systemid_len);
 +return ould-odi.systemid_len;
 +}
 +
 +static struct device_attribute osd_uld_attrs[] = {
 +__ATTR(osdname, S_IRUGO, osdname_show, NULL),
 +__ATTR(systemid, S_IRUGO, systemid_show, NULL),
 +__ATTR_NULL,
 +};
 +
  static struct class osd_uld_class = {
  .owner  = THIS_MODULE,
  .name   = scsi_osd,
 +.dev_attrs  = osd_uld_attrs,
  };
  
  /*

 
 
 ___
 osd-dev mailing list
 osd-...@open-osd.org
 http://mailman.open-osd.org/mailman/listinfo/osd-dev
 


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [SCSI] bnx2fc: fix NULL checking in bnx2fc_initiate_tmf()

2012-11-05 Thread Bhanu Prakash Gollapudi

On 11/04/2012 10:15 PM, Xi Wang wrote:

The dereference rport-data should come after the NULL check of rport.

Signed-off-by: Xi Wang xi.w...@gmail.com
---
  drivers/scsi/bnx2fc/bnx2fc_io.c |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 8d4626c..eebe93c 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -686,7 +686,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 
tm_flags)
  {
struct fc_lport *lport;
struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd-device));
-   struct fc_rport_libfc_priv *rp = rport-dd_data;
+   struct fc_rport_libfc_priv *rp;
struct fcoe_port *port;
struct bnx2fc_interface *interface;
struct bnx2fc_rport *tgt;
@@ -712,6 +712,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 
tm_flags)
rc = FAILED;
goto tmf_err;
}
+   rp = rport-dd_data;
  
  	rc = fc_block_scsi_eh(sc_cmd);

if (rc)
I thought I acked similar patch sometime back, but this did not make it 
to the tree yet.


doing it again. Thanks!

Acked-by: Bhanu Prakash Gollapudi bprak...@broadcom.com


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


linux-next: build failure after merge of the pci tree

2012-11-05 Thread Stephen Rothwell
Hi Bjorn,

After merging the pci tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

drivers/staging/telephony/ixj.c: In function 'ixj_probe_pci':
drivers/staging/telephony/ixj.c:7732:13: warning: assignment makes integer from 
pointer without a cast [enabled by default]
drivers/staging/telephony/ixj.c:7732:38: error: expected ';' before 
'pci_resource_start'

Exposed by commit 545974a28f78 (PCI: Convert pci_resource_foo macros to
static inlines).  The macro version of pci_resource_start() made this
RHS look like a function call and now it isn't.

Maybe it is time this driver just went away.

drivers/scsi/gdth.c: In function 'gdth_init_pci':
drivers/scsi/gdth.c::34: error: lvalue required as left operand of 
assignment

This was also exposed by the above commit, but is caused by the driver
expecting to be able to assign to the result of pci_resource_start().

I have applied the following patch for today (the scsi one could probably
be done more correctly):

From: Stephen Rothwell s...@canb.auug.org.au
Date: Tue, 6 Nov 2012 11:23:45 +1100
Subject: [PATCH] PCI: fixups for pci_resource_start conversion

Signed-off-by: Stephen Rothwell s...@canb.auug.org.au
---
 drivers/scsi/gdth.c   |2 +-
 drivers/staging/telephony/Kconfig |1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 5d72274..5209e81 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -1108,7 +1108,7 @@ static int __devinit gdth_init_pci(struct pci_dev *pdev, 
gdth_pci_str *pcistr,
 command |= 6;
pci_write_config_word(pdev, PCI_COMMAND, command);
if (pci_resource_start(pdev, 8) == 1UL)
-   pci_resource_start(pdev, 8) = 0UL;
+   pdev-resource[8].start = 0UL;
 i = 0xFEFF0001UL;
pci_write_config_dword(pdev, PCI_ROM_ADDRESS, i);
 gdth_delay(1);
diff --git a/drivers/staging/telephony/Kconfig 
b/drivers/staging/telephony/Kconfig
index b5f78b6..c5893e2 100644
--- a/drivers/staging/telephony/Kconfig
+++ b/drivers/staging/telephony/Kconfig
@@ -20,6 +20,7 @@ if PHONE
 config PHONE_IXJ
tristate QuickNet Internet LineJack/PhoneJack support
depends on ISA || PCI
+   depends on BROKEN
---help---
  Say M if you have a telephony card manufactured by Quicknet
  Technologies, Inc.  These include the Internet PhoneJACK and
-- 
1.7.10.280.gaa39

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp2UGRAiHzzg.pgp
Description: PGP signature


Re: linux-next: build failure after merge of the pci tree

2012-11-05 Thread Greg Kroah-Hartman
On Tue, Nov 06, 2012 at 11:27:29AM +1100, Stephen Rothwell wrote:
 Hi Bjorn,
 
 After merging the pci tree, today's linux-next build (x86_64 allmodconfig)
 failed like this:
 
 drivers/staging/telephony/ixj.c: In function 'ixj_probe_pci':
 drivers/staging/telephony/ixj.c:7732:13: warning: assignment makes integer 
 from pointer without a cast [enabled by default]
 drivers/staging/telephony/ixj.c:7732:38: error: expected ';' before 
 'pci_resource_start'
 
 Exposed by commit 545974a28f78 (PCI: Convert pci_resource_foo macros to
 static inlines).  The macro version of pci_resource_start() made this
 RHS look like a function call and now it isn't.
 
 Maybe it is time this driver just went away.

It is gone in my tree, and it should be deleted in yours, do you not see
that?

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html