Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177929
b: refs/heads/master
c: 729c845
h: refs/heads/master
i:
  177927: 9815185
v: v3
  • Loading branch information
Anil Ravindranath authored and James Bottomley committed Dec 10, 2009
1 parent ce1251d commit fef0dec
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 48de68a40aef032a2e198437f4781a83bfb938db
refs/heads/master: 729c845666be7092a52bf6fcdcf223fe4d9287a4
34 changes: 25 additions & 9 deletions trunk/drivers/scsi/pmcraid.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*
* pmcraid.c -- driver for PMC Sierra MaxRAID controller adapters
*
* Written By: PMC Sierra Corporation
* Written By: Anil Ravindranath<anil_ravindranath@pmc-sierra.com>
* PMC-Sierra Inc
*
* Copyright (C) 2008, 2009 PMC Sierra Inc
*
Expand Down Expand Up @@ -79,7 +80,7 @@ DECLARE_BITMAP(pmcraid_minor, PMCRAID_MAX_ADAPTERS);
/*
* Module parameters
*/
MODULE_AUTHOR("PMC Sierra Corporation, anil_ravindranath@pmc-sierra.com");
MODULE_AUTHOR("Anil Ravindranath<anil_ravindranath@pmc-sierra.com>");
MODULE_DESCRIPTION("PMC Sierra MaxRAID Controller Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(PMCRAID_DRIVER_VERSION);
Expand Down Expand Up @@ -162,10 +163,10 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev)
spin_lock_irqsave(&pinstance->resource_lock, lock_flags);
list_for_each_entry(temp, &pinstance->used_res_q, queue) {

/* do not expose VSETs with order-ids >= 240 */
/* do not expose VSETs with order-ids > MAX_VSET_TARGETS */
if (RES_IS_VSET(temp->cfg_entry)) {
target = temp->cfg_entry.unique_flags1;
if (target >= PMCRAID_MAX_VSET_TARGETS)
if (target > PMCRAID_MAX_VSET_TARGETS)
continue;
bus = PMCRAID_VSET_BUS_ID;
lun = 0;
Expand Down Expand Up @@ -1210,7 +1211,7 @@ static int pmcraid_expose_resource(struct pmcraid_config_table_entry *cfgte)
int retval = 0;

if (cfgte->resource_type == RES_TYPE_VSET)
retval = ((cfgte->unique_flags1 & 0xFF) < 0xFE);
retval = ((cfgte->unique_flags1 & 0x80) == 0);
else if (cfgte->resource_type == RES_TYPE_GSCSI)
retval = (RES_BUS(cfgte->resource_address) !=
PMCRAID_VIRTUAL_ENCL_BUS_ID);
Expand Down Expand Up @@ -1361,16 +1362,18 @@ static int pmcraid_notify_aen(struct pmcraid_instance *pinstance, u8 type)
* Return value:
* none
*/

static void pmcraid_handle_config_change(struct pmcraid_instance *pinstance)
{
struct pmcraid_config_table_entry *cfg_entry;
struct pmcraid_hcam_ccn *ccn_hcam;
struct pmcraid_cmd *cmd;
struct pmcraid_cmd *cfgcmd;
struct pmcraid_resource_entry *res = NULL;
u32 new_entry = 1;
unsigned long lock_flags;
unsigned long host_lock_flags;
u32 new_entry = 1;
u32 hidden_entry = 0;
int rc;

ccn_hcam = (struct pmcraid_hcam_ccn *)pinstance->ccn.hcam;
Expand Down Expand Up @@ -1406,9 +1409,15 @@ static void pmcraid_handle_config_change(struct pmcraid_instance *pinstance)
}

/* If this resource is not going to be added to mid-layer, just notify
* applications and return
* applications and return. If this notification is about hiding a VSET
* resource, check if it was exposed already.
*/
if (!pmcraid_expose_resource(cfg_entry))
if (pinstance->ccn.hcam->notification_type ==
NOTIFICATION_TYPE_ENTRY_CHANGED &&
cfg_entry->resource_type == RES_TYPE_VSET &&
cfg_entry->unique_flags1 & 0x80) {
hidden_entry = 1;
} else if (!pmcraid_expose_resource(cfg_entry))
goto out_notify_apps;

spin_lock_irqsave(&pinstance->resource_lock, lock_flags);
Expand All @@ -1424,6 +1433,12 @@ static void pmcraid_handle_config_change(struct pmcraid_instance *pinstance)

if (new_entry) {

if (hidden_entry) {
spin_unlock_irqrestore(&pinstance->resource_lock,
lock_flags);
goto out_notify_apps;
}

/* If there are more number of resources than what driver can
* manage, do not notify the applications about the CCN. Just
* ignore this notifications and re-register the same HCAM
Expand Down Expand Up @@ -1454,8 +1469,9 @@ static void pmcraid_handle_config_change(struct pmcraid_instance *pinstance)
sizeof(struct pmcraid_config_table_entry));

if (pinstance->ccn.hcam->notification_type ==
NOTIFICATION_TYPE_ENTRY_DELETED) {
NOTIFICATION_TYPE_ENTRY_DELETED || hidden_entry) {
if (res->scsi_dev) {
res->cfg_entry.unique_flags1 &= 0x7F;
res->change_detected = RES_CHANGE_DEL;
res->cfg_entry.resource_handle =
PMCRAID_INVALID_RES_HANDLE;
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/scsi/pmcraid.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/*
* pmcraid.h -- PMC Sierra MaxRAID controller driver header file
*
* Written By: Anil Ravindranath<anil_ravindranath@pmc-sierra.com>
* PMC-Sierra Inc
*
* Copyright (C) 2008, 2009 PMC Sierra Inc.
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -106,7 +109,7 @@
#define PMCRAID_VSET_LUN_ID 0x0
#define PMCRAID_PHYS_BUS_ID 0x0
#define PMCRAID_VIRTUAL_ENCL_BUS_ID 0x8
#define PMCRAID_MAX_VSET_TARGETS 240
#define PMCRAID_MAX_VSET_TARGETS 0x7F
#define PMCRAID_MAX_VSET_LUNS_PER_TARGET 8

#define PMCRAID_IOA_MAX_SECTORS 32767
Expand Down

0 comments on commit fef0dec

Please sign in to comment.