Skip to content

Commit be8cde8

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] aic79xx: check for non-NULL scb in ahd_handle_nonpkt_busfree [SCSI] zfcp: Set hardware timeout as requested by BSG request. [SCSI] zfcp: Introduce bsg_timeout callback. [SCSI] scsi_transport_fc: Allow LLD to reset FC BSG timeout [SCSI] zfcp: add missing compat ptr conversion [SCSI] zfcp: Fix linebreak in hba trace [SCSI] zfcp: Issue zfcp_fc_wka_port_put after FC CT BSG request [SCSI] qla2xxx: Update version number to 8.03.01-k10. [SCSI] fc-transport: Use packed modifier for fc_bsg_request structure. [SCSI] qla2xxx: Perform fast mailbox read of flash regardless of size nor address alignment. [SCSI] qla2xxx: Correct FCP2 recovery handling. [SCSI] scsi_lib: Fix bug in completion of bidi commands [SCSI] mptsas: Fix issue with chain pools allocation on katmai [SCSI] aacraid: fix File System going into read-only mode [SCSI] lpfc: fix file permissions
2 parents 981a2ed + 534ef05 commit be8cde8

25 files changed

Lines changed: 291 additions & 126 deletions

‎drivers/message/fusion/mptbase.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4330,6 +4330,8 @@ initChainBuffers(MPT_ADAPTER *ioc)
43304330

43314331
if (ioc->bus_type == SPI)
43324332
num_chain *= MPT_SCSI_CAN_QUEUE;
4333+
else if (ioc->bus_type == SAS)
4334+
num_chain *= MPT_SAS_CAN_QUEUE;
43334335
else
43344336
num_chain *= MPT_FC_CAN_QUEUE;
43354337

‎drivers/s390/scsi/zfcp_cfdc.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <linux/types.h>
1414
#include <linux/miscdevice.h>
15+
#include <asm/compat.h>
1516
#include <asm/ccwdev.h>
1617
#include "zfcp_def.h"
1718
#include "zfcp_ext.h"
@@ -163,7 +164,7 @@ static void zfcp_cfdc_req_to_sense(struct zfcp_cfdc_data *data,
163164
}
164165

165166
static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
166-
unsigned long buffer)
167+
unsigned long arg)
167168
{
168169
struct zfcp_cfdc_data *data;
169170
struct zfcp_cfdc_data __user *data_user;
@@ -175,7 +176,11 @@ static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
175176
if (command != ZFCP_CFDC_IOC)
176177
return -ENOTTY;
177178

178-
data_user = (void __user *) buffer;
179+
if (is_compat_task())
180+
data_user = compat_ptr(arg);
181+
else
182+
data_user = (void __user *)arg;
183+
179184
if (!data_user)
180185
return -EINVAL;
181186

‎drivers/s390/scsi/zfcp_dbf.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static void zfcp_dbf_hba_view_response(char **p,
327327
break;
328328
zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->u.fcp.cmnd);
329329
zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->u.fcp.serial);
330-
p += sprintf(*p, "\n");
330+
*p += sprintf(*p, "\n");
331331
break;
332332

333333
case FSF_QTCB_OPEN_PORT_WITH_DID:

‎drivers/s390/scsi/zfcp_ext.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ extern void zfcp_fc_wka_ports_force_offline(struct zfcp_fc_wka_ports *);
108108
extern int zfcp_fc_gs_setup(struct zfcp_adapter *);
109109
extern void zfcp_fc_gs_destroy(struct zfcp_adapter *);
110110
extern int zfcp_fc_exec_bsg_job(struct fc_bsg_job *);
111+
extern int zfcp_fc_timeout_bsg_job(struct fc_bsg_job *);
111112

112113
/* zfcp_fsf.c */
113114
extern int zfcp_fsf_open_port(struct zfcp_erp_action *);
@@ -129,9 +130,9 @@ extern void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *);
129130
extern int zfcp_fsf_status_read(struct zfcp_qdio *);
130131
extern int zfcp_status_read_refill(struct zfcp_adapter *adapter);
131132
extern int zfcp_fsf_send_ct(struct zfcp_fc_wka_port *, struct zfcp_fsf_ct_els *,
132-
mempool_t *);
133+
mempool_t *, unsigned int);
133134
extern int zfcp_fsf_send_els(struct zfcp_adapter *, u32,
134-
struct zfcp_fsf_ct_els *);
135+
struct zfcp_fsf_ct_els *, unsigned int);
135136
extern int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *,
136137
struct scsi_cmnd *);
137138
extern void zfcp_fsf_req_free(struct zfcp_fsf_req *);

‎drivers/s390/scsi/zfcp_fc.c‎

Lines changed: 57 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ static int zfcp_fc_ns_gid_pn_request(struct zfcp_port *port,
258258
gid_pn->gid_pn_req.gid_pn.fn_wwpn = port->wwpn;
259259

260260
ret = zfcp_fsf_send_ct(&adapter->gs->ds, &gid_pn->ct,
261-
adapter->pool.gid_pn_req);
261+
adapter->pool.gid_pn_req,
262+
ZFCP_FC_CTELS_TMO);
262263
if (!ret) {
263264
wait_for_completion(&completion);
264265
zfcp_fc_ns_gid_pn_eval(gid_pn);
@@ -421,7 +422,8 @@ static int zfcp_fc_adisc(struct zfcp_port *port)
421422
hton24(adisc->adisc_req.adisc_port_id,
422423
fc_host_port_id(adapter->scsi_host));
423424

424-
ret = zfcp_fsf_send_els(adapter, port->d_id, &adisc->els);
425+
ret = zfcp_fsf_send_els(adapter, port->d_id, &adisc->els,
426+
ZFCP_FC_CTELS_TMO);
425427
if (ret)
426428
kmem_cache_free(zfcp_data.adisc_cache, adisc);
427429

@@ -532,7 +534,8 @@ static int zfcp_fc_send_gpn_ft(struct zfcp_fc_gpn_ft *gpn_ft,
532534
ct->req = &gpn_ft->sg_req;
533535
ct->resp = gpn_ft->sg_resp;
534536

535-
ret = zfcp_fsf_send_ct(&adapter->gs->ds, ct, NULL);
537+
ret = zfcp_fsf_send_ct(&adapter->gs->ds, ct, NULL,
538+
ZFCP_FC_CTELS_TMO);
536539
if (!ret)
537540
wait_for_completion(&completion);
538541
return ret;
@@ -677,6 +680,44 @@ static void zfcp_fc_ct_els_job_handler(void *data)
677680
job->job_done(job);
678681
}
679682

683+
static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct fc_bsg_job *job)
684+
{
685+
u32 preamble_word1;
686+
u8 gs_type;
687+
struct zfcp_adapter *adapter;
688+
689+
preamble_word1 = job->request->rqst_data.r_ct.preamble_word1;
690+
gs_type = (preamble_word1 & 0xff000000) >> 24;
691+
692+
adapter = (struct zfcp_adapter *) job->shost->hostdata[0];
693+
694+
switch (gs_type) {
695+
case FC_FST_ALIAS:
696+
return &adapter->gs->as;
697+
case FC_FST_MGMT:
698+
return &adapter->gs->ms;
699+
case FC_FST_TIME:
700+
return &adapter->gs->ts;
701+
break;
702+
case FC_FST_DIR:
703+
return &adapter->gs->ds;
704+
break;
705+
default:
706+
return NULL;
707+
}
708+
}
709+
710+
static void zfcp_fc_ct_job_handler(void *data)
711+
{
712+
struct fc_bsg_job *job = data;
713+
struct zfcp_fc_wka_port *wka_port;
714+
715+
wka_port = zfcp_fc_job_wka_port(job);
716+
zfcp_fc_wka_port_put(wka_port);
717+
718+
zfcp_fc_ct_els_job_handler(data);
719+
}
720+
680721
static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
681722
struct zfcp_adapter *adapter)
682723
{
@@ -695,43 +736,27 @@ static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
695736
} else
696737
d_id = ntoh24(job->request->rqst_data.h_els.port_id);
697738

698-
return zfcp_fsf_send_els(adapter, d_id, els);
739+
els->handler = zfcp_fc_ct_els_job_handler;
740+
return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ);
699741
}
700742

701743
static int zfcp_fc_exec_ct_job(struct fc_bsg_job *job,
702744
struct zfcp_adapter *adapter)
703745
{
704746
int ret;
705-
u8 gs_type;
706747
struct zfcp_fsf_ct_els *ct = job->dd_data;
707748
struct zfcp_fc_wka_port *wka_port;
708-
u32 preamble_word1;
709749

710-
preamble_word1 = job->request->rqst_data.r_ct.preamble_word1;
711-
gs_type = (preamble_word1 & 0xff000000) >> 24;
712-
713-
switch (gs_type) {
714-
case FC_FST_ALIAS:
715-
wka_port = &adapter->gs->as;
716-
break;
717-
case FC_FST_MGMT:
718-
wka_port = &adapter->gs->ms;
719-
break;
720-
case FC_FST_TIME:
721-
wka_port = &adapter->gs->ts;
722-
break;
723-
case FC_FST_DIR:
724-
wka_port = &adapter->gs->ds;
725-
break;
726-
default:
727-
return -EINVAL; /* no such service */
728-
}
750+
wka_port = zfcp_fc_job_wka_port(job);
751+
if (!wka_port)
752+
return -EINVAL;
729753

730754
ret = zfcp_fc_wka_port_get(wka_port);
731755
if (ret)
732756
return ret;
733757

734-
ret = zfcp_fsf_send_ct(wka_port, ct, NULL);
758+
ct->handler = zfcp_fc_ct_job_handler;
759+
ret = zfcp_fsf_send_ct(wka_port, ct, NULL, job->req->timeout / HZ);
735760
if (ret)
736761
zfcp_fc_wka_port_put(wka_port);
737762

@@ -752,7 +777,6 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job)
752777

753778
ct_els->req = job->request_payload.sg_list;
754779
ct_els->resp = job->reply_payload.sg_list;
755-
ct_els->handler = zfcp_fc_ct_els_job_handler;
756780
ct_els->handler_data = job;
757781

758782
switch (job->request->msgcode) {
@@ -767,6 +791,12 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job)
767791
}
768792
}
769793

794+
int zfcp_fc_timeout_bsg_job(struct fc_bsg_job *job)
795+
{
796+
/* hardware tracks timeout, reset bsg timeout to not interfere */
797+
return -EAGAIN;
798+
}
799+
770800
int zfcp_fc_gs_setup(struct zfcp_adapter *adapter)
771801
{
772802
struct zfcp_fc_wka_ports *wka_ports;

‎drivers/s390/scsi/zfcp_fc.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#define ZFCP_FC_GPN_FT_MAX_ENT (ZFCP_FC_GPN_FT_NUM_BUFS * \
2828
(ZFCP_FC_GPN_FT_ENT_PAGE + 1))
2929

30+
#define ZFCP_FC_CTELS_TMO (2 * FC_DEF_R_A_TOV / 1000)
31+
3032
/**
3133
* struct zfcp_fc_gid_pn_req - container for ct header plus gid_pn request
3234
* @ct_hdr: FC GS common transport header

‎drivers/s390/scsi/zfcp_fsf.c‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,20 +1068,20 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
10681068
static int zfcp_fsf_setup_ct_els(struct zfcp_fsf_req *req,
10691069
struct scatterlist *sg_req,
10701070
struct scatterlist *sg_resp,
1071-
int max_sbals)
1071+
int max_sbals, unsigned int timeout)
10721072
{
10731073
int ret;
1074-
unsigned int fcp_chan_timeout;
10751074

10761075
ret = zfcp_fsf_setup_ct_els_sbals(req, sg_req, sg_resp, max_sbals);
10771076
if (ret)
10781077
return ret;
10791078

10801079
/* common settings for ct/gs and els requests */
1081-
fcp_chan_timeout = 2 * FC_DEF_R_A_TOV / 1000;
1080+
if (timeout > 255)
1081+
timeout = 255; /* max value accepted by hardware */
10821082
req->qtcb->bottom.support.service_class = FSF_CLASS_3;
1083-
req->qtcb->bottom.support.timeout = fcp_chan_timeout;
1084-
zfcp_fsf_start_timer(req, (fcp_chan_timeout + 10) * HZ);
1083+
req->qtcb->bottom.support.timeout = timeout;
1084+
zfcp_fsf_start_timer(req, (timeout + 10) * HZ);
10851085

10861086
return 0;
10871087
}
@@ -1092,7 +1092,8 @@ static int zfcp_fsf_setup_ct_els(struct zfcp_fsf_req *req,
10921092
* @pool: if non-null this mempool is used to allocate struct zfcp_fsf_req
10931093
*/
10941094
int zfcp_fsf_send_ct(struct zfcp_fc_wka_port *wka_port,
1095-
struct zfcp_fsf_ct_els *ct, mempool_t *pool)
1095+
struct zfcp_fsf_ct_els *ct, mempool_t *pool,
1096+
unsigned int timeout)
10961097
{
10971098
struct zfcp_qdio *qdio = wka_port->adapter->qdio;
10981099
struct zfcp_fsf_req *req;
@@ -1111,7 +1112,7 @@ int zfcp_fsf_send_ct(struct zfcp_fc_wka_port *wka_port,
11111112

11121113
req->status |= ZFCP_STATUS_FSFREQ_CLEANUP;
11131114
ret = zfcp_fsf_setup_ct_els(req, ct->req, ct->resp,
1114-
FSF_MAX_SBALS_PER_REQ);
1115+
FSF_MAX_SBALS_PER_REQ, timeout);
11151116
if (ret)
11161117
goto failed_send;
11171118

@@ -1188,7 +1189,7 @@ static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req)
11881189
* @els: pointer to struct zfcp_send_els with data for the command
11891190
*/
11901191
int zfcp_fsf_send_els(struct zfcp_adapter *adapter, u32 d_id,
1191-
struct zfcp_fsf_ct_els *els)
1192+
struct zfcp_fsf_ct_els *els, unsigned int timeout)
11921193
{
11931194
struct zfcp_fsf_req *req;
11941195
struct zfcp_qdio *qdio = adapter->qdio;
@@ -1206,7 +1207,7 @@ int zfcp_fsf_send_els(struct zfcp_adapter *adapter, u32 d_id,
12061207
}
12071208

12081209
req->status |= ZFCP_STATUS_FSFREQ_CLEANUP;
1209-
ret = zfcp_fsf_setup_ct_els(req, els->req, els->resp, 2);
1210+
ret = zfcp_fsf_setup_ct_els(req, els->req, els->resp, 2, timeout);
12101211

12111212
if (ret)
12121213
goto failed_send;

‎drivers/s390/scsi/zfcp_scsi.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ struct fc_function_template zfcp_transport_functions = {
652652
.show_host_port_state = 1,
653653
.show_host_active_fc4s = 1,
654654
.bsg_request = zfcp_fc_exec_bsg_job,
655+
.bsg_timeout = zfcp_fc_timeout_bsg_job,
655656
/* no functions registered for following dynamic attributes but
656657
directly set by LLDD */
657658
.show_host_port_type = 1,

0 commit comments

Comments
 (0)