[PATCH v2, RESEND] Separate target visibility from reaped state information
Instead of representing the states "visible in sysfs" and "has been removed from the target list" by a single state variable, use two variables to represent this information. This patch avoids that SCSI device removal can trigger a soft lockup. See also: * "scsi: restart list search after unlock in scsi_remove_target" (commit 40998193560d). * "scsi_remove_target: fix softlockup regression on hot remove" (commit bc3f02a795d3). Reported-by: Sebastian HerbsztTested-by: Sebastian Herbszt Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Johannes Thumshirn Cc: Dan Williams Cc: stable --- drivers/scsi/scsi_scan.c | 31 +++ drivers/scsi/scsi_sysfs.c | 7 --- include/scsi/scsi_device.h | 9 ++--- 3 files changed, 9 insertions(+), 38 deletions(-) See also: - http://thread.gmane.org/gmane.linux.scsi/107245. - http://thread.gmane.org/gmane.linux.scsi/108614. Changes compared to v1: - Renamed "visible" into "is_visible" for consistency with the rest of the SCSI initiator code. - Removed the scsi_target_state since it is no longer used. diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 8324539..6accec3 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -314,7 +314,6 @@ static void scsi_target_destroy(struct scsi_target *starget) struct Scsi_Host *shost = dev_to_shost(dev->parent); unsigned long flags; - starget->state = STARGET_DEL; transport_destroy_device(dev); spin_lock_irqsave(shost->host_lock, flags); if (shost->hostt->target_destroy) @@ -379,19 +378,15 @@ static void scsi_target_reap_ref_release(struct kref *kref) struct scsi_target *starget = container_of(kref, struct scsi_target, reap_ref); - /* -* if we get here and the target is still in the CREATED state that -* means it was allocated but never made visible (because a scan -* turned up no LUNs), so don't call device_del() on it. -*/ - if (starget->state != STARGET_CREATED) { + if (starget->is_visible) { + starget->is_visible = false; transport_remove_device(>dev); device_del(>dev); } scsi_target_destroy(starget); } -static void scsi_target_reap_ref_put(struct scsi_target *starget) +void scsi_target_reap(struct scsi_target *starget) { kref_put(>reap_ref, scsi_target_reap_ref_release); } @@ -437,7 +432,6 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, starget->can_queue = 0; INIT_LIST_HEAD(>siblings); INIT_LIST_HEAD(>devices); - starget->state = STARGET_CREATED; starget->scsi_level = SCSI_2; starget->max_target_blocked = SCSI_DEFAULT_TARGET_BLOCKED; retry: @@ -498,25 +492,6 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, } /** - * scsi_target_reap - check to see if target is in use and destroy if not - * @starget: target to be checked - * - * This is used after removing a LUN or doing a last put of the target - * it checks atomically that nothing is using the target and removes - * it if so. - */ -void scsi_target_reap(struct scsi_target *starget) -{ - /* -* serious problem if this triggers: STARGET_DEL is only set in the if -* the reap_ref drops to zero, so we're trying to do another final put -* on an already released kref -*/ - BUG_ON(starget->state == STARGET_DEL); - scsi_target_reap_ref_put(starget); -} - -/** * sanitize_inquiry_string - remove non-graphical chars from an INQUIRY result string * @s: INQUIRY result string to sanitize * @len: length of the string diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 8d23122..c5ea634 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -1000,7 +1000,7 @@ static int scsi_target_add(struct scsi_target *starget) { int error; - if (starget->state != STARGET_CREATED) + if (starget->is_visible) return 0; error = device_add(>dev); @@ -1009,7 +1009,7 @@ static int scsi_target_add(struct scsi_target *starget) return error; } transport_add_device(>dev); - starget->state = STARGET_RUNNING; + starget->is_visible = true; pm_runtime_set_active(>dev); pm_runtime_enable(>dev); @@ -1198,10 +1198,11 @@ void scsi_remove_target(struct device *dev) restart: spin_lock_irqsave(shost->host_lock, flags); list_for_each_entry(starget, >__targets, siblings) { - if (starget->state == STARGET_DEL) + if (starget->reaped) continue; if (starget->dev.parent == dev || >dev == dev) {
[PATCH v2] ipr: fix out-of-bounds null overwrite
Return value of snprintf is not bound by size value, 2nd argument. (https://www.kernel.org/doc/htmldocs/kernel-api/API-snprintf.html). Return value is number of printed chars, can be larger than 2nd argument. Therefore, it can write null byte out of bounds ofbuffer. Since snprintf puts null, it does not need to put additional null byte. Signed-off-by: Insu Yun--- drivers/scsi/ipr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 536cd5a..caf63f9 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -4003,13 +4003,12 @@ static ssize_t ipr_store_update_fw(struct device *dev, struct ipr_sglist *sglist; char fname[100]; char *src; - int len, result, dnld_size; + int result, dnld_size; if (!capable(CAP_SYS_ADMIN)) return -EACCES; - len = snprintf(fname, 99, "%s", buf); - fname[len-1] = '\0'; + snprintf(fname, 99, "%s", buf); if (request_firmware(_entry, fname, _cfg->pdev->dev)) { dev_err(_cfg->pdev->dev, "Firmware file %s not found\n", fname); -- 1.9.1 -- 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 net-next 2/3] libcxgbi: add pdu parsing of LRO'ed skbs
The skbs could contain both paritial pdus and multiple completed pdus. Signed-off-by: Karen XieSigned-off-by: Manoj Malviya Signed-off-by: Hariprasad Shenai --- drivers/scsi/cxgbi/libcxgbi.c | 415 +- drivers/scsi/cxgbi/libcxgbi.h | 4 + 2 files changed, 330 insertions(+), 89 deletions(-) diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index f3bb7af..dc9b470 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -35,6 +35,7 @@ static unsigned int dbg_level; #include "libcxgbi.h" +#include "cxgbi_lro.h" #define DRV_MODULE_NAME"libcxgbi" #define DRV_MODULE_DESC"Chelsio iSCSI driver library" @@ -533,6 +534,7 @@ static void sock_put_port(struct cxgbi_sock *csk) /* * iscsi tcp connection */ +static void skb_lro_hold_done(struct cxgbi_sock *csk); void cxgbi_sock_free_cpl_skbs(struct cxgbi_sock *csk) { if (csk->cpl_close) { @@ -547,6 +549,11 @@ void cxgbi_sock_free_cpl_skbs(struct cxgbi_sock *csk) kfree_skb(csk->cpl_abort_rpl); csk->cpl_abort_rpl = NULL; } + if (csk->skb_lro_hold) { + skb_lro_hold_done(csk); + kfree_skb(csk->skb_lro_hold); + csk->skb_lro_hold = NULL; + } } EXPORT_SYMBOL_GPL(cxgbi_sock_free_cpl_skbs); @@ -1145,15 +1152,15 @@ static int cxgbi_sock_send_pdus(struct cxgbi_sock *csk, struct sk_buff *skb) if (unlikely(skb_headroom(skb) < cdev->skb_tx_rsvd)) { pr_err("csk 0x%p, skb head %u < %u.\n", - csk, skb_headroom(skb), cdev->skb_tx_rsvd); + csk, skb_headroom(skb), cdev->skb_tx_rsvd); err = -EINVAL; goto out_err; } if (frags >= SKB_WR_LIST_SIZE) { pr_err("csk 0x%p, frags %d, %u,%u >%u.\n", - csk, skb_shinfo(skb)->nr_frags, skb->len, - skb->data_len, (uint)(SKB_WR_LIST_SIZE)); + csk, skb_shinfo(skb)->nr_frags, skb->len, + skb->data_len, (uint)(SKB_WR_LIST_SIZE)); err = -EINVAL; goto out_err; } @@ -1776,10 +1783,8 @@ EXPORT_SYMBOL_GPL(cxgbi_conn_tx_open); /* * pdu receive, interact with libiscsi_tcp */ -static inline int read_pdu_skb(struct iscsi_conn *conn, - struct sk_buff *skb, - unsigned int offset, - int offloaded) +static inline int read_pdu_skb(struct iscsi_conn *conn, struct sk_buff *skb, + unsigned int offset, int offloaded) { int status = 0; int bytes_read; @@ -1817,7 +1822,8 @@ static inline int read_pdu_skb(struct iscsi_conn *conn, } } -static int skb_read_pdu_bhs(struct iscsi_conn *conn, struct sk_buff *skb) +static int skb_read_pdu_bhs(struct iscsi_conn *conn, struct sk_buff *skb, + unsigned int offset, unsigned long *flag) { struct iscsi_tcp_conn *tcp_conn = conn->dd_data; @@ -1831,18 +1837,18 @@ static int skb_read_pdu_bhs(struct iscsi_conn *conn, struct sk_buff *skb) return -EIO; } - if (conn->hdrdgst_en && - cxgbi_skcb_test_flag(skb, SKCBF_RX_HCRC_ERR)) { + if (conn->hdrdgst_en && test_bit(SKCBF_RX_HCRC_ERR, flag)) { pr_info("conn 0x%p, skb 0x%p, hcrc.\n", conn, skb); iscsi_conn_failure(conn, ISCSI_ERR_HDR_DGST); return -EIO; } - return read_pdu_skb(conn, skb, 0, 0); + return read_pdu_skb(conn, skb, offset, 0); } static int skb_read_pdu_data(struct iscsi_conn *conn, struct sk_buff *lskb, -struct sk_buff *skb, unsigned int offset) +struct sk_buff *skb, unsigned int offset, +unsigned long *flag) { struct iscsi_tcp_conn *tcp_conn = conn->dd_data; bool offloaded = 0; @@ -1850,12 +1856,11 @@ static int skb_read_pdu_data(struct iscsi_conn *conn, struct sk_buff *lskb, log_debug(1 << CXGBI_DBG_PDU_RX, "conn 0x%p, skb 0x%p, len %u, flag 0x%lx.\n", - conn, skb, skb->len, cxgbi_skcb_flags(skb)); + conn, skb, skb->len, *flag); - if (conn->datadgst_en && - cxgbi_skcb_test_flag(lskb, SKCBF_RX_DCRC_ERR)) { + if (conn->datadgst_en && test_bit(SKCBF_RX_DCRC_ERR, flag)) { pr_info("conn 0x%p, skb 0x%p, dcrc 0x%lx.\n", - conn, lskb, cxgbi_skcb_flags(lskb)); + conn, lskb, *flag); iscsi_conn_failure(conn, ISCSI_ERR_DATA_DGST); return
[PATCH net-next 0/3] cxgb4/cxgb4i: add iscsi LRO support for chelsio t4/t5 adapters
Hi This patch series adds LRO iscsi support for chelsio T4/T5 adapters. This patch series has been created against net-next tree and includes patches on cxgb4 and cxgb4i driver. We have included all the maintainers of respective drivers. Kindly review the change and let us know in case of any review comments. Thanks Hariprasad Shenai (3): cxgb4: Add LRO infrastructure for cxgb4i driver libcxgbi: add pdu parsing of LRO'ed skbs cxgb4i: add iscsi LRO for chelsio t4/t5 adapters drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 15 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 40 ++- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h | 5 + drivers/net/ethernet/chelsio/cxgb4/sge.c| 10 +- drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 396 +- drivers/scsi/cxgbi/libcxgbi.c | 415 +++- drivers/scsi/cxgbi/libcxgbi.h | 4 + 7 files changed, 768 insertions(+), 117 deletions(-) -- 2.3.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 net-next 3/3] cxgb4i: add iscsi LRO for chelsio t4/t5 adapters
Signed-off-by: Karen XieSigned-off-by: Manoj Malviya Signed-off-by: Hariprasad Shenai --- drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 396 +++-- 1 file changed, 382 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c index 804806e..68e94e6 100644 --- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c @@ -33,6 +33,7 @@ static unsigned int dbg_level; #include "../libcxgbi.h" +#include "../cxgbi_lro.h" #defineDRV_MODULE_NAME "cxgb4i" #define DRV_MODULE_DESC"Chelsio T4/T5 iSCSI Driver" @@ -81,13 +82,6 @@ static int t4_uld_rx_handler(void *, const __be64 *, const struct pkt_gl *); static int t4_uld_state_change(void *, enum cxgb4_state state); static inline int send_tx_flowc_wr(struct cxgbi_sock *); -static const struct cxgb4_uld_info cxgb4i_uld_info = { - .name = DRV_MODULE_NAME, - .add = t4_uld_add, - .rx_handler = t4_uld_rx_handler, - .state_change = t4_uld_state_change, -}; - static struct scsi_host_template cxgb4i_host_template = { .module = THIS_MODULE, .name = DRV_MODULE_NAME, @@ -1182,8 +1176,9 @@ static void do_rx_data_ddp(struct cxgbi_device *cdev, } log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_PDU_RX, - "csk 0x%p,%u,0x%lx, skb 0x%p,0x%x, lhdr 0x%p.\n", - csk, csk->state, csk->flags, skb, status, csk->skb_ulp_lhdr); + "csk 0x%p,%u,0x%lx, skb 0x%p,0x%x, lhdr 0x%p, len %u.\n", + csk, csk->state, csk->flags, skb, status, csk->skb_ulp_lhdr, + ntohs(rpl->len)); spin_lock_bh(>lock); @@ -1212,13 +1207,13 @@ static void do_rx_data_ddp(struct cxgbi_device *cdev, csk->tid, ntohs(rpl->len), cxgbi_skcb_rx_pdulen(lskb)); if (status & (1 << CPL_RX_DDP_STATUS_HCRC_SHIFT)) { - pr_info("csk 0x%p, lhdr 0x%p, status 0x%x, hcrc bad 0x%lx.\n", - csk, lskb, status, cxgbi_skcb_flags(lskb)); + pr_info("csk 0x%p, lhdr 0x%p, status 0x%x, hcrc bad.\n", + csk, lskb, status); cxgbi_skcb_set_flag(lskb, SKCBF_RX_HCRC_ERR); } if (status & (1 << CPL_RX_DDP_STATUS_DCRC_SHIFT)) { - pr_info("csk 0x%p, lhdr 0x%p, status 0x%x, dcrc bad 0x%lx.\n", - csk, lskb, status, cxgbi_skcb_flags(lskb)); + pr_info("csk 0x%p, lhdr 0x%p, status 0x%x, dcrc bad.\n", + csk, lskb, status); cxgbi_skcb_set_flag(lskb, SKCBF_RX_DCRC_ERR); } if (status & (1 << CPL_RX_DDP_STATUS_PAD_SHIFT)) { @@ -1311,6 +1306,12 @@ static int alloc_cpls(struct cxgbi_sock *csk) 0, GFP_KERNEL); if (!csk->cpl_abort_rpl) goto free_cpls; + + csk->skb_lro_hold = alloc_skb(LRO_SKB_MIN_HEADROOM, GFP_KERNEL); + if (unlikely(!csk->skb_lro_hold)) + goto free_cpls; + memset(csk->skb_lro_hold->data, 0, LRO_SKB_MIN_HEADROOM); + return 0; free_cpls: @@ -1539,7 +1540,7 @@ int cxgb4i_ofld_init(struct cxgbi_device *cdev) cdev->csk_alloc_cpls = alloc_cpls; cdev->csk_init_act_open = init_act_open; - pr_info("cdev 0x%p, offload up, added.\n", cdev); + pr_info("cdev 0x%p, offload up, added, f 0x%x.\n", cdev, cdev->flags); return 0; } @@ -1891,6 +1892,373 @@ static int t4_uld_state_change(void *handle, enum cxgb4_state state) return 0; } +static void proc_ddp_status(unsigned int tid, struct cpl_rx_data_ddp *cpl, + struct cxgbi_rx_pdu_cb *pdu_cb) +{ + unsigned int status = ntohl(cpl->ddpvld); + + cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_STATUS); + + pdu_cb->ddigest = ntohl(cpl->ulp_crc); + pdu_cb->pdulen = ntohs(cpl->len); + + if (status & (1 << CPL_RX_DDP_STATUS_HCRC_SHIFT)) { + pr_info("tid 0x%x, status 0x%x, hcrc bad.\n", tid, status); + cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_HCRC_ERR); + } + if (status & (1 << CPL_RX_DDP_STATUS_DCRC_SHIFT)) { + pr_info("tid 0x%x, status 0x%x, dcrc bad.\n", tid, status); + cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_DCRC_ERR); + } + if (status & (1 << CPL_RX_DDP_STATUS_PAD_SHIFT)) { + pr_info("tid 0x%x, status 0x%x, pad bad.\n", tid, status); + cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_PAD_ERR); + } + if ((status & (1 << CPL_RX_DDP_STATUS_DDP_SHIFT)) && + !cxgbi_rx_cb_test_flag(pdu_cb, SKCBF_RX_DATA)) { + cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_DATA_DDPD); + } +} + +static void lro_skb_add_packet_rsp(struct sk_buff *skb, u8 op, + const __be64 *rsp) +{ +
Re: [PATCH v2, RESEND] Separate target visibility from reaped state information
Looks good, Reviewed-by: Christoph Hellwig-- 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 net-next 1/3] cxgb4: Add LRO infrastructure for cxgb4i driver
Signed-off-by: Hariprasad Shenai--- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 15 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 40 ++--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h | 5 drivers/net/ethernet/chelsio/cxgb4/sge.c| 10 +-- 4 files changed, 56 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index ec6e849..a89e64e 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h @@ -508,6 +508,16 @@ struct pkt_gl { typedef int (*rspq_handler_t)(struct sge_rspq *q, const __be64 *rsp, const struct pkt_gl *gl); +typedef void (*rspq_flush_handler_t)(struct sge_rspq *q); + +/* LRO related declarations for ULD */ +struct t4_lro_mgr { +#define MAX_LRO_SESSIONS 64 + u8 lro_session_cnt; /* # of sessions to aggregate */ + unsigned long lro_pkts; /* # of LRO super packets */ + unsigned long lro_merged; /* # of wire packets merged by LRO */ + struct sk_buff *skb_head, *skb_tail; /* list of aggregated sessions */ +}; struct sge_rspq { /* state for an SGE response queue */ struct napi_struct napi; @@ -532,6 +542,8 @@ struct sge_rspq { /* state for an SGE response queue */ struct adapter *adap; struct net_device *netdev; /* associated net device */ rspq_handler_t handler; + rspq_flush_handler_t flush_handler; + struct t4_lro_mgr lro_mgr; #ifdef CONFIG_NET_RX_BUSY_POLL #define CXGB_POLL_STATE_IDLE 0 #define CXGB_POLL_STATE_NAPI BIT(0) /* NAPI owns this poll */ @@ -1107,7 +1119,8 @@ int t4_mgmt_tx(struct adapter *adap, struct sk_buff *skb); int t4_ofld_send(struct adapter *adap, struct sk_buff *skb); int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, struct net_device *dev, int intr_idx, -struct sge_fl *fl, rspq_handler_t hnd, int cong); +struct sge_fl *fl, rspq_handler_t hnd, +rspq_flush_handler_t flush_hnd, int cong); int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq, struct net_device *dev, struct netdev_queue *netdevq, unsigned int iqid); diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index b8a5fb0..68c2aae 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -640,6 +640,13 @@ out: return 0; } +/* Flush the aggregated lro sessions */ +static void uldrx_flush_handler(struct sge_rspq *q) +{ + if (ulds[q->uld].lro_flush) + ulds[q->uld].lro_flush(>lro_mgr); +} + /** * uldrx_handler - response queue handler for ULD queues * @q: the response queue that received the packet @@ -653,6 +660,8 @@ static int uldrx_handler(struct sge_rspq *q, const __be64 *rsp, const struct pkt_gl *gl) { struct sge_ofld_rxq *rxq = container_of(q, struct sge_ofld_rxq, rspq); + unsigned int napi_id = q->napi.napi_id; + int ret; /* FW can send CPLs encapsulated in a CPL_FW4_MSG. */ @@ -660,7 +669,15 @@ static int uldrx_handler(struct sge_rspq *q, const __be64 *rsp, ((const struct cpl_fw4_msg *)(rsp + 1))->type == FW_TYPE_RSSCPL) rsp += 2; - if (ulds[q->uld].rx_handler(q->adap->uld_handle[q->uld], rsp, gl)) { + if (q->flush_handler) + ret = ulds[q->uld].lro_rx_handler(q->adap->uld_handle[q->uld], + rsp, gl, >lro_mgr, + napi_id); + else + ret = ulds[q->uld].rx_handler(q->adap->uld_handle[q->uld], + rsp, gl); + + if (ret) { rxq->stats.nomem++; return -1; } @@ -960,7 +977,7 @@ static void enable_rx(struct adapter *adap) static int alloc_ofld_rxqs(struct adapter *adap, struct sge_ofld_rxq *q, unsigned int nq, unsigned int per_chan, int msi_idx, - u16 *ids) + u16 *ids, bool lro) { int i, err; @@ -970,7 +987,8 @@ static int alloc_ofld_rxqs(struct adapter *adap, struct sge_ofld_rxq *q, err = t4_sge_alloc_rxq(adap, >rspq, false, adap->port[i / per_chan], msi_idx, q->fl.size ? >fl : NULL, - uldrx_handler, 0); + uldrx_handler, + lro ? uldrx_flush_handler : NULL, 0); if
Re: [PATCH net-next 2/3] libcxgbi: add pdu parsing of LRO'ed skbs
Hi Hariprasad, [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Hariprasad-Shenai/cxgb4-Add-LRO-infrastructure-for-cxgb4i-driver/20160106-203040 config: i386-allmodconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386 All errors (new ones prefixed by >>): >> drivers/scsi/cxgbi/libcxgbi.c:38:23: fatal error: cxgbi_lro.h: No such file >> or directory compilation terminated. vim +38 drivers/scsi/cxgbi/libcxgbi.c 32 #include 33 #include 34 35 static unsigned int dbg_level; 36 37 #include "libcxgbi.h" > 38 #include "cxgbi_lro.h" 39 40 #define DRV_MODULE_NAME "libcxgbi" 41 #define DRV_MODULE_DESC "Chelsio iSCSI driver library" --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
Re: [PATCH net-next 3/3] cxgb4i: add iscsi LRO for chelsio t4/t5 adapters
Hi Hariprasad, [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Hariprasad-Shenai/cxgb4-Add-LRO-infrastructure-for-cxgb4i-driver/20160106-203040 config: i386-allmodconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386 All errors (new ones prefixed by >>): >> drivers/scsi/cxgbi/cxgb4i/cxgb4i.c:36:26: fatal error: ../cxgbi_lro.h: No >> such file or directory compilation terminated. vim +36 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c 30 #include "cxgb4i.h" 31 #include "clip_tbl.h" 32 33 static unsigned int dbg_level; 34 35 #include "../libcxgbi.h" > 36 #include "../cxgbi_lro.h" 37 38 #define DRV_MODULE_NAME "cxgb4i" 39 #define DRV_MODULE_DESC "Chelsio T4/T5 iSCSI Driver" --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
Re: st driver doesn't seem to grok LTO partitioning
Thanks Doug Trying that now Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services - Original Message - From: "Douglas Gilbert"To: "Laurence Oberman" , "Emmanuel Florac" Cc: "Laurence Oberman" , "Kai Makisara" , linux-scsi@vger.kernel.org Sent: Wednesday, January 6, 2016 10:48:44 AM Subject: Re: st driver doesn't seem to grok LTO partitioning On 16-01-06 10:32 AM, Laurence Oberman wrote: > Firmware update fails as follows: > > Still researching. This is the only LTO5 I have access to so unless Shane has > one I may not be able to make progress. > (Its way long out of warranty and support) > > We mostly use this for generic st driver and changer testing for RHEL and it > has not been updated for at least two years. > > Performing FUP operation... > > Checking image file (/root/V3210A011-E00.IMG) > > Checking device readiness > > Sending image file to the device > > Redetecting device > Fup drive command failed: Unknown error! (status = -100) > > Host adapter status = 0x00 > Driver status = 0x08 > Error buffer = 'MSG: FupDrive() - Error committing image file to drive > (/root/V3210A011-E00.IMG) 1584236 of 1584236 bytes written. > SCSI: WriteBuffer()::DevIo() - ErrorCode (0x70h) ,Sense Key (0x05h) ILLEGAL > REQUEST, INVALID FIELD IN PARAMETER LIST. ASC(0x26h), ASCQ(0x00h) - ) > ' > > Unable to perform FUP operation. The 1584236 byte firmware image might be too big for a single WRITE BUFFER command. You might try getting a recent version of sg3_utils and doing something like: sg_write_buffer -b 4k -I V3210A011-E00.IMG -m 7 /dev/sg3 where /dev/sg3 corresponds to your tape drive. 'lsscsi -g' will show you the mapping. The above technique works fine for recent Seagate SAS disks (with ".LOD" firmware images). Doug Gilbert > - Original Message - > From: "Laurence Oberman" > To: "Emmanuel Florac" > Cc: "Laurence Oberman" , "Kai Makisara" > , linux-scsi@vger.kernel.org > Sent: Wednesday, January 6, 2016 10:25:37 AM > Subject: Re: st driver doesn't seem to grok LTO partitioning > > I left the log of the failure to partition out > > Here it is > > # mt -f /dev/nst0 mkpartition 1 > /dev/nst0: Input/output error > > [ 5499.341648] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. > [ 5499.342903] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL > 8 > [ 5499.343523] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 > [ 5499.344114] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 > blocks). > [ 5499.344702] st 0:0:0:0: [st0] Loading tape. > [ 5499.359733] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. > [ 5499.360970] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL > 8 > [ 5499.361584] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 > [ 5499.362165] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 > blocks). > [ 5499.363851] st 0:0:0:0: [st0] Partition page length is 10 bytes. > [ 5499.364468] st 0:0:0:0: [st0] PP: max 0, add 0, xdp 0, psum 03, pofmetc > 0,rec 03, units 09, sizes: 1541 65535 > [ 5499.365074] st 0:0:0:0: [st0] MP: 11 08 00 00 18 03 09 00 06 05 ff ff > [ 5499.365658] st 0:0:0:0: [st0] psd_cnt 2, max.parts 0, nbr_parts 0 > [ 5499.366246] st 0:0:0:0: [st0] Formatting tape with two partitions (FDP). > [ 5499.366826] st 0:0:0:0: [st0] Sent partition page length is 12 bytes. > needs_format: 0 > [ 5499.367424] st 0:0:0:0: [st0] PP: max 0, add 1, xdp 4, psum 03, pofmetc 0 > rec 03, units 00, sizes: 65535 65535 > [ 5499.368024] st 0:0:0:0: [st0] MP: 11 0a 00 01 98 03 00 00 ff ff ff ff > [ 5499.369842] st 0:0:0:0: [st0] Error: 802, cmd: 15 10 0 0 18 0 > [ 5499.370495] st 0:0:0:0: [st0] Sense Key : Illegal Request [current] > [ 5499.371109] st 0:0:0:0: [st0] Add. Sense: Invalid field in parameter list > [ 5499.371714] st 0:0:0:0: [st0] Partitioning of tape failed. > > Laurence Oberman > Principal Software Maintenance Engineer > Red Hat Global Support Services > > - Original Message - > From: "Laurence Oberman" > To: "Emmanuel Florac" > Cc: "Laurence Oberman" , "Kai Makisara" > , linux-scsi@vger.kernel.org > Sent: Wednesday, January 6, 2016 10:23:34 AM > Subject: Re: st driver doesn't seem to grok LTO partitioning > > Hello Emanuel > > I am using this device, its an Ultrium 5 (LTO5) > Its an older changer and I am unable to update the firmware, still working on > that. > > What version of mt are you using, as I am testing using a RHEL7.2 base and > the upstream patched kernel. > > Linux example.redhat.com 4.3.3 #1 SMP Tue Jan 5 15:58:47 EST 2016 x86_64 > x86_64 x86_64 GNU/Linux > > # tapeinfo -f /dev/st0 > Product Type: Tape Drive > Vendor ID: 'QUANTUM '
Re: st driver doesn't seem to grok LTO partitioning
Le Wed, 6 Jan 2016 10:23:34 -0500 (EST) Laurence Obermanécrivait: > MaxPartitions: 0 > > Drive is working fine, > > # mt -f /dev/st0 status > SCSI 2 tape drive: > File number=0, block number=0, partition=0. > Tape block size 512 bytes. Density code 0x58 (no translation). > Soft error count since last status=0 > General status bits on (4101): > BOT ONLINE IM_REP_EN > > This is what I get when I try and partition and I believe this may be > a firmware issue for me. Yes probably, it reports "MaxPartitions 0", should be 1 for an LTO-5 drive. Weird. -- Emmanuel Florac | Direction technique | Intellique | | +33 1 78 94 84 02 -- 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: st driver doesn't seem to grok LTO partitioning
Le Wed, 6 Jan 2016 17:10:15 +0100 Emmanuel Floracécrivait: > Works OK with LTO-5 (HP). Sizing the partitions is quite difficult, as > you can see. To get one "wrap" in the first partition, "140" and > "1424000" work, but "145" doesn't. Same for LTO-6 (I'm still > looking for the proper size). > Looks like the proper size for a "one wrap" 38 GB partition 0 on LTO-6 is "245". Go figure. -- Emmanuel Florac | Direction technique | Intellique | | +33 1 78 94 84 02 -- 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: st driver doesn't seem to grok LTO partitioning
Hello Emanuel I am using this device, its an Ultrium 5 (LTO5) Its an older changer and I am unable to update the firmware, still working on that. What version of mt are you using, as I am testing using a RHEL7.2 base and the upstream patched kernel. Linux example.redhat.com 4.3.3 #1 SMP Tue Jan 5 15:58:47 EST 2016 x86_64 x86_64 x86_64 GNU/Linux # tapeinfo -f /dev/st0 Product Type: Tape Drive Vendor ID: 'QUANTUM ' Product ID: 'ULTRIUM 5 ' Revision: '3060' Attached Changer API: No SerialNumber: 'HU1023AKHE' MinBlock: 1 MaxBlock: 16777215 SCSI ID: 0 SCSI LUN: 0 Ready: yes BufferedMode: yes Medium Type: Not Loaded Density Code: 0x58 BlockSize: 512 DataCompEnabled: yes DataCompCapable: yes DataDeCompEnabled: yes CompType: 0x1 DeCompType: 0x1 BOP: yes Block Position: 0 Partition 0 Remaining Kbytes: 1541692 Partition 0 Size in Kbytes: 1541692 ActivePartition: 0 EarlyWarningSize: 0 NumPartitions: 0 MaxPartitions: 0 Drive is working fine, # mt -f /dev/st0 status SCSI 2 tape drive: File number=0, block number=0, partition=0. Tape block size 512 bytes. Density code 0x58 (no translation). Soft error count since last status=0 General status bits on (4101): BOT ONLINE IM_REP_EN This is what I get when I try and partition and I believe this may be a firmware issue for me. mt -f /dev/st0 stsetoption can-partitions [ 5343.620005] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. [ 5343.621424] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8 [ 5343.622005] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 [ 5343.622606] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 blocks). [ 5343.623208] st 0:0:0:0: [st0] Mode 0 options: buffer writes: 1, async writes: 1, read ahead: 1 [ 5343.623810] st 0:0:0:0: [st0] can bsr: 1, two FMs: 0, fast mteom: 0, auto lock: 0, [ 5343.624413] st 0:0:0:0: [st0] defs for wr: 0, no block limits: 0, partitions: 1, s2 log: 0 [ 5343.625011] st 0:0:0:0: [st0] sysv: 0 nowait: 0 sili: 0 nowait_filemark: 0 [ 5343.625623] st 0:0:0:0: [st0] debugging: 1 [ 5343.626222] st 0:0:0:0: [st0] Rewinding tape. # mt -f /dev/nst0 mkpartition 1 /dev/nst0: Input/output error Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services - Original Message - From: "Emmanuel Florac"To: "Laurence Oberman" Cc: "Laurence Oberman" , "Kai Makisara" , linux-scsi@vger.kernel.org Sent: Wednesday, January 6, 2016 10:10:49 AM Subject: Re: st driver doesn't seem to grok LTO partitioning Le Tue, 5 Jan 2016 16:55:04 -0500 (EST) Laurence Oberman écrivait: > mt -f /dev/nst0 mkpartition 1 > What is the type of drive exactly? I still couldn't test with the LTO-5 drive as the machine it's connected to is being reinstalled. -- Emmanuel Florac | Direction technique | Intellique | | +33 1 78 94 84 02 -- 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: st driver doesn't seem to grok LTO partitioning
Firmware update fails as follows: Still researching. This is the only LTO5 I have access to so unless Shane has one I may not be able to make progress. (Its way long out of warranty and support) We mostly use this for generic st driver and changer testing for RHEL and it has not been updated for at least two years. Performing FUP operation... Checking image file (/root/V3210A011-E00.IMG) Checking device readiness Sending image file to the device Redetecting device Fup drive command failed: Unknown error! (status = -100) Host adapter status = 0x00 Driver status = 0x08 Error buffer = 'MSG: FupDrive() - Error committing image file to drive (/root/V3210A011-E00.IMG) 1584236 of 1584236 bytes written. SCSI: WriteBuffer()::DevIo() - ErrorCode (0x70h) ,Sense Key (0x05h) ILLEGAL REQUEST, INVALID FIELD IN PARAMETER LIST. ASC(0x26h), ASCQ(0x00h) - ) ' Unable to perform FUP operation. Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services - Original Message - From: "Laurence Oberman"To: "Emmanuel Florac" Cc: "Laurence Oberman" , "Kai Makisara" , linux-scsi@vger.kernel.org Sent: Wednesday, January 6, 2016 10:25:37 AM Subject: Re: st driver doesn't seem to grok LTO partitioning I left the log of the failure to partition out Here it is # mt -f /dev/nst0 mkpartition 1 /dev/nst0: Input/output error [ 5499.341648] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. [ 5499.342903] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8 [ 5499.343523] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 [ 5499.344114] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 blocks). [ 5499.344702] st 0:0:0:0: [st0] Loading tape. [ 5499.359733] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. [ 5499.360970] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8 [ 5499.361584] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 [ 5499.362165] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 blocks). [ 5499.363851] st 0:0:0:0: [st0] Partition page length is 10 bytes. [ 5499.364468] st 0:0:0:0: [st0] PP: max 0, add 0, xdp 0, psum 03, pofmetc 0,rec 03, units 09, sizes: 1541 65535 [ 5499.365074] st 0:0:0:0: [st0] MP: 11 08 00 00 18 03 09 00 06 05 ff ff [ 5499.365658] st 0:0:0:0: [st0] psd_cnt 2, max.parts 0, nbr_parts 0 [ 5499.366246] st 0:0:0:0: [st0] Formatting tape with two partitions (FDP). [ 5499.366826] st 0:0:0:0: [st0] Sent partition page length is 12 bytes. needs_format: 0 [ 5499.367424] st 0:0:0:0: [st0] PP: max 0, add 1, xdp 4, psum 03, pofmetc 0 rec 03, units 00, sizes: 65535 65535 [ 5499.368024] st 0:0:0:0: [st0] MP: 11 0a 00 01 98 03 00 00 ff ff ff ff [ 5499.369842] st 0:0:0:0: [st0] Error: 802, cmd: 15 10 0 0 18 0 [ 5499.370495] st 0:0:0:0: [st0] Sense Key : Illegal Request [current] [ 5499.371109] st 0:0:0:0: [st0] Add. Sense: Invalid field in parameter list [ 5499.371714] st 0:0:0:0: [st0] Partitioning of tape failed. Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services - Original Message - From: "Laurence Oberman" To: "Emmanuel Florac" Cc: "Laurence Oberman" , "Kai Makisara" , linux-scsi@vger.kernel.org Sent: Wednesday, January 6, 2016 10:23:34 AM Subject: Re: st driver doesn't seem to grok LTO partitioning Hello Emanuel I am using this device, its an Ultrium 5 (LTO5) Its an older changer and I am unable to update the firmware, still working on that. What version of mt are you using, as I am testing using a RHEL7.2 base and the upstream patched kernel. Linux example.redhat.com 4.3.3 #1 SMP Tue Jan 5 15:58:47 EST 2016 x86_64 x86_64 x86_64 GNU/Linux # tapeinfo -f /dev/st0 Product Type: Tape Drive Vendor ID: 'QUANTUM ' Product ID: 'ULTRIUM 5 ' Revision: '3060' Attached Changer API: No SerialNumber: 'HU1023AKHE' MinBlock: 1 MaxBlock: 16777215 SCSI ID: 0 SCSI LUN: 0 Ready: yes BufferedMode: yes Medium Type: Not Loaded Density Code: 0x58 BlockSize: 512 DataCompEnabled: yes DataCompCapable: yes DataDeCompEnabled: yes CompType: 0x1 DeCompType: 0x1 BOP: yes Block Position: 0 Partition 0 Remaining Kbytes: 1541692 Partition 0 Size in Kbytes: 1541692 ActivePartition: 0 EarlyWarningSize: 0 NumPartitions: 0 MaxPartitions: 0 Drive is working fine, # mt -f /dev/st0 status SCSI 2 tape drive: File number=0, block number=0, partition=0. Tape block size 512 bytes. Density code 0x58 (no translation). Soft error count since last status=0 General status bits on (4101): BOT ONLINE IM_REP_EN This is what I get when I try and partition and I believe this may be a firmware issue for me. mt -f /dev/st0 stsetoption can-partitions [ 5343.620005] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. [ 5343.621424] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8
Re: st driver doesn't seem to grok LTO partitioning
On 16-01-06 10:32 AM, Laurence Oberman wrote: Firmware update fails as follows: Still researching. This is the only LTO5 I have access to so unless Shane has one I may not be able to make progress. (Its way long out of warranty and support) We mostly use this for generic st driver and changer testing for RHEL and it has not been updated for at least two years. Performing FUP operation... Checking image file (/root/V3210A011-E00.IMG) Checking device readiness Sending image file to the device Redetecting device Fup drive command failed: Unknown error! (status = -100) Host adapter status = 0x00 Driver status = 0x08 Error buffer = 'MSG: FupDrive() - Error committing image file to drive (/root/V3210A011-E00.IMG) 1584236 of 1584236 bytes written. SCSI: WriteBuffer()::DevIo() - ErrorCode (0x70h) ,Sense Key (0x05h) ILLEGAL REQUEST, INVALID FIELD IN PARAMETER LIST. ASC(0x26h), ASCQ(0x00h) - ) ' Unable to perform FUP operation. The 1584236 byte firmware image might be too big for a single WRITE BUFFER command. You might try getting a recent version of sg3_utils and doing something like: sg_write_buffer -b 4k -I V3210A011-E00.IMG -m 7 /dev/sg3 where /dev/sg3 corresponds to your tape drive. 'lsscsi -g' will show you the mapping. The above technique works fine for recent Seagate SAS disks (with ".LOD" firmware images). Doug Gilbert - Original Message - From: "Laurence Oberman"To: "Emmanuel Florac" Cc: "Laurence Oberman" , "Kai Makisara" , linux-scsi@vger.kernel.org Sent: Wednesday, January 6, 2016 10:25:37 AM Subject: Re: st driver doesn't seem to grok LTO partitioning I left the log of the failure to partition out Here it is # mt -f /dev/nst0 mkpartition 1 /dev/nst0: Input/output error [ 5499.341648] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. [ 5499.342903] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8 [ 5499.343523] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 [ 5499.344114] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 blocks). [ 5499.344702] st 0:0:0:0: [st0] Loading tape. [ 5499.359733] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. [ 5499.360970] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8 [ 5499.361584] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 [ 5499.362165] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 blocks). [ 5499.363851] st 0:0:0:0: [st0] Partition page length is 10 bytes. [ 5499.364468] st 0:0:0:0: [st0] PP: max 0, add 0, xdp 0, psum 03, pofmetc 0,rec 03, units 09, sizes: 1541 65535 [ 5499.365074] st 0:0:0:0: [st0] MP: 11 08 00 00 18 03 09 00 06 05 ff ff [ 5499.365658] st 0:0:0:0: [st0] psd_cnt 2, max.parts 0, nbr_parts 0 [ 5499.366246] st 0:0:0:0: [st0] Formatting tape with two partitions (FDP). [ 5499.366826] st 0:0:0:0: [st0] Sent partition page length is 12 bytes. needs_format: 0 [ 5499.367424] st 0:0:0:0: [st0] PP: max 0, add 1, xdp 4, psum 03, pofmetc 0 rec 03, units 00, sizes: 65535 65535 [ 5499.368024] st 0:0:0:0: [st0] MP: 11 0a 00 01 98 03 00 00 ff ff ff ff [ 5499.369842] st 0:0:0:0: [st0] Error: 802, cmd: 15 10 0 0 18 0 [ 5499.370495] st 0:0:0:0: [st0] Sense Key : Illegal Request [current] [ 5499.371109] st 0:0:0:0: [st0] Add. Sense: Invalid field in parameter list [ 5499.371714] st 0:0:0:0: [st0] Partitioning of tape failed. Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services - Original Message - From: "Laurence Oberman" To: "Emmanuel Florac" Cc: "Laurence Oberman" , "Kai Makisara" , linux-scsi@vger.kernel.org Sent: Wednesday, January 6, 2016 10:23:34 AM Subject: Re: st driver doesn't seem to grok LTO partitioning Hello Emanuel I am using this device, its an Ultrium 5 (LTO5) Its an older changer and I am unable to update the firmware, still working on that. What version of mt are you using, as I am testing using a RHEL7.2 base and the upstream patched kernel. Linux example.redhat.com 4.3.3 #1 SMP Tue Jan 5 15:58:47 EST 2016 x86_64 x86_64 x86_64 GNU/Linux # tapeinfo -f /dev/st0 Product Type: Tape Drive Vendor ID: 'QUANTUM ' Product ID: 'ULTRIUM 5 ' Revision: '3060' Attached Changer API: No SerialNumber: 'HU1023AKHE' MinBlock: 1 MaxBlock: 16777215 SCSI ID: 0 SCSI LUN: 0 Ready: yes BufferedMode: yes Medium Type: Not Loaded Density Code: 0x58 BlockSize: 512 DataCompEnabled: yes DataCompCapable: yes DataDeCompEnabled: yes CompType: 0x1 DeCompType: 0x1 BOP: yes Block Position: 0 Partition 0 Remaining Kbytes: 1541692 Partition 0 Size in Kbytes: 1541692 ActivePartition: 0 EarlyWarningSize: 0 NumPartitions: 0 MaxPartitions: 0 Drive is working fine, # mt -f /dev/st0 status SCSI 2 tape drive: File number=0, block number=0, partition=0. Tape block size 512 bytes. Density code 0x58 (no translation). Soft
Re: [PATCH v2, RESEND] Separate target visibility from reaped state information
On Wed, 2016-01-06 at 09:24 +0100, Bart Van Assche wrote: > Instead of representing the states "visible in sysfs" and > "has been removed from the target list" by a single state > variable, use two variables to represent this information. > > This patch avoids that SCSI device removal can trigger a > soft lockup. It does? When I asked you this the last time, you said the soft lockup was fixed by a prior patch: http://thread.gmane.org/gmane.linux.scsi/107248 If you've actually caught a problem, can we have details because the distro people will want to know what gets fixed by this. Thanks, James > See also: > * "scsi: restart list search after unlock in scsi_remove_target" > (commit 40998193560d). > * "scsi_remove_target: fix softlockup regression on hot remove" > (commit bc3f02a795d3). > > Reported-by: Sebastian Herbszt> Tested-by: Sebastian Herbszt > Signed-off-by: Bart Van Assche > Cc: Christoph Hellwig > Cc: Johannes Thumshirn > Cc: Dan Williams > Cc: stable > --- > drivers/scsi/scsi_scan.c | 31 +++ > drivers/scsi/scsi_sysfs.c | 7 --- > include/scsi/scsi_device.h | 9 ++--- > 3 files changed, 9 insertions(+), 38 deletions(-) > > See also: > - http://thread.gmane.org/gmane.linux.scsi/107245. > - http://thread.gmane.org/gmane.linux.scsi/108614. > > Changes compared to v1: > - Renamed "visible" into "is_visible" for consistency with the rest > of the > SCSI initiator code. > - Removed the scsi_target_state since it is no longer used. > > diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c > index 8324539..6accec3 100644 > --- a/drivers/scsi/scsi_scan.c > +++ b/drivers/scsi/scsi_scan.c > @@ -314,7 +314,6 @@ static void scsi_target_destroy(struct > scsi_target *starget) > struct Scsi_Host *shost = dev_to_shost(dev->parent); > unsigned long flags; > > - starget->state = STARGET_DEL; > transport_destroy_device(dev); > spin_lock_irqsave(shost->host_lock, flags); > if (shost->hostt->target_destroy) > @@ -379,19 +378,15 @@ static void scsi_target_reap_ref_release(struct > kref *kref) > struct scsi_target *starget > = container_of(kref, struct scsi_target, reap_ref); > > - /* > - * if we get here and the target is still in the CREATED > state that > - * means it was allocated but never made visible (because a > scan > - * turned up no LUNs), so don't call device_del() on it. > - */ > - if (starget->state != STARGET_CREATED) { > + if (starget->is_visible) { > + starget->is_visible = false; > transport_remove_device(>dev); > device_del(>dev); > } > scsi_target_destroy(starget); > } > > -static void scsi_target_reap_ref_put(struct scsi_target *starget) > +void scsi_target_reap(struct scsi_target *starget) > { > kref_put(>reap_ref, scsi_target_reap_ref_release); > } > @@ -437,7 +432,6 @@ static struct scsi_target > *scsi_alloc_target(struct device *parent, > starget->can_queue = 0; > INIT_LIST_HEAD(>siblings); > INIT_LIST_HEAD(>devices); > - starget->state = STARGET_CREATED; > starget->scsi_level = SCSI_2; > starget->max_target_blocked = SCSI_DEFAULT_TARGET_BLOCKED; > retry: > @@ -498,25 +492,6 @@ static struct scsi_target > *scsi_alloc_target(struct device *parent, > } > > /** > - * scsi_target_reap - check to see if target is in use and destroy > if not > - * @starget: target to be checked > - * > - * This is used after removing a LUN or doing a last put of the > target > - * it checks atomically that nothing is using the target and removes > - * it if so. > - */ > -void scsi_target_reap(struct scsi_target *starget) > -{ > - /* > - * serious problem if this triggers: STARGET_DEL is only set > in the if > - * the reap_ref drops to zero, so we're trying to do another > final put > - * on an already released kref > - */ > - BUG_ON(starget->state == STARGET_DEL); > - scsi_target_reap_ref_put(starget); > -} > - > -/** > * sanitize_inquiry_string - remove non-graphical chars from an > INQUIRY result string > * @s: INQUIRY result string to sanitize > * @len: length of the string > diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c > index 8d23122..c5ea634 100644 > --- a/drivers/scsi/scsi_sysfs.c > +++ b/drivers/scsi/scsi_sysfs.c > @@ -1000,7 +1000,7 @@ static int scsi_target_add(struct scsi_target > *starget) > { > int error; > > - if (starget->state != STARGET_CREATED) > + if (starget->is_visible) > return 0; > > error = device_add(>dev); > @@ -1009,7 +1009,7 @@ static int scsi_target_add(struct scsi_target > *starget) > return error; > } > transport_add_device(>dev); > - starget->state =
Re: [dm-devel] [PATCH 01/35] block/fs/drivers: remove rw argument from submit_bio
On 01/05/2016 09:53 PM, mchri...@redhat.com wrote: From: Mike ChristieThis has callers of submit_bio/submit_bio_wait set the bio->bi_rw instead of passing it in. This makes that use the same as generic_make_request and how we set the other bio fields. Reviewed-by: Bart Van Assche -- 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: st driver doesn't seem to grok LTO partitioning
Le Mon, 4 Jan 2016 12:46:26 +0100 Emmanuel Floracécrivait: > That works fine for me. I'm going to do some testing with other drives > I have (LTO-3 -- should fail -- and LTO-5). > Works OK with LTO-5 (HP). Sizing the partitions is quite difficult, as you can see. To get one "wrap" in the first partition, "140" and "1424000" work, but "145" doesn't. Same for LTO-6 (I'm still looking for the proper size). # mt -f /dev/st0 mkpartition 1 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Block limits 1 - 16777215 bytes. Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Mode sense. Length 11, medium 0, WBS 10, BLL 8 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Density 58, tape length: 0, drv buffer: 1 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Block size: 0, buffer size: 4096 (1 blocks). Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Updating partition number in status. Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Got tape pos. blk 0 part 0. Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Loading tape. Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Block limits 1 - 16777215 bytes. Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Mode sense. Length 11, medium 0, WBS 10, BLL 8 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Density 58, tape length: 0, drv buffer: 1 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Block size: 0, buffer size: 4096 (1 blocks). Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Partition page length is 12 bytes. Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: PP: max 1, add 0, xdp 1, psum 03, pofmetc 4, rec 03, units 09, sizes: 1529 0 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: MP: 11 0a 01 00 3c 03 09 00 05 f9 00 00 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: psd_cnt 2, max.parts 1, nbr_parts 0 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Formatting tape with two partitions (FDP). Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Sent partition page length is 12 bytes. needs_format: 1 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: PP: max 1, add 1, xdp 4, psum 03, pofmetc 4, rec 03, units 00, sizes: 65535 0 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: MP: 11 0a 01 01 9c 03 00 00 ff ff 00 00 Jan 6 16:38:42 taiko kernel: st 6:0:0:0: st0: Sending FORMAT MEDIUM Jan 6 16:38:56 taiko kernel: st 6:0:0:0: st0: Rewinding tape. # tapeinfo -f /dev/sg1 Product Type: Tape Drive Vendor ID: 'HP ' Product ID: 'Ultrium 5-SCSI ' Revision: 'Z61U' Attached Changer API: No SerialNumber: 'HU1249TP88' MinBlock: 1 MaxBlock: 16777215 SCSI ID: 0 SCSI LUN: 0 Ready: yes BufferedMode: yes Medium Type: Not Loaded Density Code: 0x58 BlockSize: 0 DataCompEnabled: yes DataCompCapable: yes DataDeCompEnabled: yes CompType: 0x1 DeCompType: 0x1 BOP: yes Block Position: 0 Partition 0 Remaining Kbytes: 1459056 Partition 0 Size in Kbytes: 1459056 ActivePartition: 0 EarlyWarningSize: 0 NumPartitions: 1 MaxPartitions: 1 Partition0: 1453 Partition1: 38 # mt -f /dev/st0 setpartition 1 Jan 6 16:40:20 taiko kernel: st 6:0:0:0: st0: Block limits 1 - 16777215 bytes. Jan 6 16:40:20 taiko kernel: st 6:0:0:0: st0: Mode sense. Length 11, medium 0, WBS 10, BLL 8 Jan 6 16:40:20 taiko kernel: st 6:0:0:0: st0: Density 58, tape length: 0, drv buffer: 1 Jan 6 16:40:20 taiko kernel: st 6:0:0:0: st0: Block size: 0, buffer size: 4096 (1 blocks). Jan 6 16:40:20 taiko kernel: st 6:0:0:0: st0: Setting block to 0 and partition to 1. Jan 6 16:40:20 taiko kernel: st 6:0:0:0: st0: Got tape pos. blk 0 part 0. Jan 6 16:40:20 taiko kernel: st 6:0:0:0: st0: Visited block 0 for partition 0 saved. Jan 6 16:40:20 taiko kernel: st 6:0:0:0: st0: Trying to change partition from 0 to 1 Jan 6 16:40:25 taiko kernel: st 6:0:0:0: st0: Rewinding tape. # mt -f /dev/st0 mkpartition 1453 Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Block limits 1 - 16777215 bytes. Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Mode sense. Length 11, medium 0, WBS 10, BLL 8 Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Density 58, tape length: 0, drv buffer: 1 Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Block size: 0, buffer size: 4096 (1 blocks). Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Loading tape. Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Block limits 1 - 16777215 bytes. Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Mode sense. Length 11, medium 0, WBS 10, BLL 8 Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Density 58, tape length: 0, drv buffer: 1 Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Block size: 0, buffer size: 4096 (1 blocks). Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Partition page length is 12 bytes. Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: PP: max 1, add 1, xdp 1, psum 03, pofmetc 4, rec 03, units 09, sizes: 1453 38 Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: MP: 11 0a 01 01 3c 03 09 00 05 ad 00 26 Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: psd_cnt 2, max.parts 1, nbr_parts 1 Jan 6 16:42:22 taiko kernel: st 6:0:0:0: st0: Formatting tape
Re: st driver doesn't seem to grok LTO partitioning
Le Tue, 5 Jan 2016 16:55:04 -0500 (EST) Laurence Obermanécrivait: > mt -f /dev/nst0 mkpartition 1 > What is the type of drive exactly? I still couldn't test with the LTO-5 drive as the machine it's connected to is being reinstalled. -- Emmanuel Florac | Direction technique | Intellique | | +33 1 78 94 84 02 -- 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: st driver doesn't seem to grok LTO partitioning
I left the log of the failure to partition out Here it is # mt -f /dev/nst0 mkpartition 1 /dev/nst0: Input/output error [ 5499.341648] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. [ 5499.342903] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8 [ 5499.343523] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 [ 5499.344114] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 blocks). [ 5499.344702] st 0:0:0:0: [st0] Loading tape. [ 5499.359733] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. [ 5499.360970] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8 [ 5499.361584] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 [ 5499.362165] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 blocks). [ 5499.363851] st 0:0:0:0: [st0] Partition page length is 10 bytes. [ 5499.364468] st 0:0:0:0: [st0] PP: max 0, add 0, xdp 0, psum 03, pofmetc 0,rec 03, units 09, sizes: 1541 65535 [ 5499.365074] st 0:0:0:0: [st0] MP: 11 08 00 00 18 03 09 00 06 05 ff ff [ 5499.365658] st 0:0:0:0: [st0] psd_cnt 2, max.parts 0, nbr_parts 0 [ 5499.366246] st 0:0:0:0: [st0] Formatting tape with two partitions (FDP). [ 5499.366826] st 0:0:0:0: [st0] Sent partition page length is 12 bytes. needs_format: 0 [ 5499.367424] st 0:0:0:0: [st0] PP: max 0, add 1, xdp 4, psum 03, pofmetc 0 rec 03, units 00, sizes: 65535 65535 [ 5499.368024] st 0:0:0:0: [st0] MP: 11 0a 00 01 98 03 00 00 ff ff ff ff [ 5499.369842] st 0:0:0:0: [st0] Error: 802, cmd: 15 10 0 0 18 0 [ 5499.370495] st 0:0:0:0: [st0] Sense Key : Illegal Request [current] [ 5499.371109] st 0:0:0:0: [st0] Add. Sense: Invalid field in parameter list [ 5499.371714] st 0:0:0:0: [st0] Partitioning of tape failed. Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services - Original Message - From: "Laurence Oberman"To: "Emmanuel Florac" Cc: "Laurence Oberman" , "Kai Makisara" , linux-scsi@vger.kernel.org Sent: Wednesday, January 6, 2016 10:23:34 AM Subject: Re: st driver doesn't seem to grok LTO partitioning Hello Emanuel I am using this device, its an Ultrium 5 (LTO5) Its an older changer and I am unable to update the firmware, still working on that. What version of mt are you using, as I am testing using a RHEL7.2 base and the upstream patched kernel. Linux example.redhat.com 4.3.3 #1 SMP Tue Jan 5 15:58:47 EST 2016 x86_64 x86_64 x86_64 GNU/Linux # tapeinfo -f /dev/st0 Product Type: Tape Drive Vendor ID: 'QUANTUM ' Product ID: 'ULTRIUM 5 ' Revision: '3060' Attached Changer API: No SerialNumber: 'HU1023AKHE' MinBlock: 1 MaxBlock: 16777215 SCSI ID: 0 SCSI LUN: 0 Ready: yes BufferedMode: yes Medium Type: Not Loaded Density Code: 0x58 BlockSize: 512 DataCompEnabled: yes DataCompCapable: yes DataDeCompEnabled: yes CompType: 0x1 DeCompType: 0x1 BOP: yes Block Position: 0 Partition 0 Remaining Kbytes: 1541692 Partition 0 Size in Kbytes: 1541692 ActivePartition: 0 EarlyWarningSize: 0 NumPartitions: 0 MaxPartitions: 0 Drive is working fine, # mt -f /dev/st0 status SCSI 2 tape drive: File number=0, block number=0, partition=0. Tape block size 512 bytes. Density code 0x58 (no translation). Soft error count since last status=0 General status bits on (4101): BOT ONLINE IM_REP_EN This is what I get when I try and partition and I believe this may be a firmware issue for me. mt -f /dev/st0 stsetoption can-partitions [ 5343.620005] st 0:0:0:0: [st0] Block limits 1 - 16777215 bytes. [ 5343.621424] st 0:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8 [ 5343.622005] st 0:0:0:0: [st0] Density 58, tape length: 0, drv buffer: 1 [ 5343.622606] st 0:0:0:0: [st0] Block size: 512, buffer size: 4096 (8 blocks). [ 5343.623208] st 0:0:0:0: [st0] Mode 0 options: buffer writes: 1, async writes: 1, read ahead: 1 [ 5343.623810] st 0:0:0:0: [st0] can bsr: 1, two FMs: 0, fast mteom: 0, auto lock: 0, [ 5343.624413] st 0:0:0:0: [st0] defs for wr: 0, no block limits: 0, partitions: 1, s2 log: 0 [ 5343.625011] st 0:0:0:0: [st0] sysv: 0 nowait: 0 sili: 0 nowait_filemark: 0 [ 5343.625623] st 0:0:0:0: [st0] debugging: 1 [ 5343.626222] st 0:0:0:0: [st0] Rewinding tape. # mt -f /dev/nst0 mkpartition 1 /dev/nst0: Input/output error Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services - Original Message - From: "Emmanuel Florac" To: "Laurence Oberman" Cc: "Laurence Oberman" , "Kai Makisara" , linux-scsi@vger.kernel.org Sent: Wednesday, January 6, 2016 10:10:49 AM Subject: Re: st driver doesn't seem to grok LTO partitioning Le Tue, 5 Jan 2016 16:55:04 -0500 (EST) Laurence Oberman écrivait: > mt -f /dev/nst0 mkpartition 1 > What is the type of drive exactly? I still couldn't test with the LTO-5 drive
[PATCH v3] ipr: fix out-of-bounds null overwrite
Return value of snprintf is not bound by size value, 2nd argument. (https://www.kernel.org/doc/htmldocs/kernel-api/API-snprintf.html). Return value is number of printed chars, can be larger than 2nd argument. Therefore, it can write null byte out of bounds ofbuffer. Since snprintf puts null, it does not need to put additional null byte. Signed-off-by: Insu Yun--- drivers/scsi/ipr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 536cd5a..1c3759b 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -4003,13 +4003,12 @@ static ssize_t ipr_store_update_fw(struct device *dev, struct ipr_sglist *sglist; char fname[100]; char *src; - int len, result, dnld_size; + int result, dnld_size; if (!capable(CAP_SYS_ADMIN)) return -EACCES; - len = snprintf(fname, 99, "%s", buf); - fname[len-1] = '\0'; + snprintf(fname, sizeof(fname), "%s", buf); if (request_firmware(_entry, fname, _cfg->pdev->dev)) { dev_err(_cfg->pdev->dev, "Firmware file %s not found\n", fname); -- 1.9.1 -- 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 00/16] qla2xxx: Patches for target-pending branch
Hi Nic, On 12/20/15, 10:57 PM, "Nicholas A. Bellinger"wrote: >Hi Himanshu & Co, > >On Thu, 2015-12-17 at 14:56 -0500, Himanshu Madhani wrote: >> Hi Nic, >> >> Please apply this series to target-pending at your earliest convenience. >> >> changes from v1 -> v2 >> >> o Added Reviewed-by tag for reviewed patches. >> >> o Dropped following patches for rework. >> - qla2xxx: Change check_stop_free to always return 1 >> - qla2xxx: Fix interaction issue between qla2xxx and Target Core >>Module >> - qla2xxx: Add TAS detection for kernel 3.15 n newer >> - target/tmr: LUN reset cause cmd premature free. >> > >Thanks for dropping these for the moment. > >I'll be following up on outstanding TMR LUN_RESET reference counting >bugs over the holiday. > >> o Fixed patch description on following patches >> - qla2xxx: Enable Extended Login support >> - qla2xxx: Enable Exchange offload support. >> >> o Fixed patch description as well as kbuild warning for >> - qla2xxx: Added interface to send explicit LOGO. >> >> o Fixed kbuild warning for >> - qla2xxx: Remove dependency on hardware_lock to reduce lock >> contention. >> >> Thanks, >> Himanshu >> >> Alexei Potashnik (2): >> qla2xxx: Delete session if initiator is gone from FW >> qla2xxx: Wait for all conflicts before ack'ing PLOGI >> >> Dilip Kumar Uppugandla (1): >> qla2xxx: Check for online flag instead of active reset when >> transmitting responses >> >> Himanshu Madhani (4): >> qla2xxx: Enable Extended Logins support >> qla2xxx: Enable Exchange offload support. >> qla2xxx: Enable Target counters in DebugFS. >> qla2xxx: Added interface to send explicit LOGO. >> >> Quinn Tran (9): >> qla2xxx: Add FW resource count in DebugFS. >> qla2xxx: Replace QLA_TGT_STATE_ABORTED with a bit. >> qla2xxx: Remove dependency on hardware_lock to reduce lock >> contention. >> qla2xxx: Add irq affinity notification >> qla2xxx: Add selective command queuing >> qla2xxx: Move atioq to a different lock to reduce lock contention >> qla2xxx: Disable ZIO at start time. >> qla2xxx: Set all queues to 4k >> qla2xxx: Add bulk send for atio & ctio completion paths. >> >> drivers/scsi/qla2xxx/qla_attr.c| 36 ++ >> drivers/scsi/qla2xxx/qla_dbg.c | 19 +- >> drivers/scsi/qla2xxx/qla_def.h | 86 - >> drivers/scsi/qla2xxx/qla_dfs.c | 106 + >> drivers/scsi/qla2xxx/qla_gbl.h | 18 +- >> drivers/scsi/qla2xxx/qla_init.c| 58 ++- >> drivers/scsi/qla2xxx/qla_inline.h |2 + >> drivers/scsi/qla2xxx/qla_iocb.c| 188 + >> drivers/scsi/qla2xxx/qla_isr.c | 129 ++- >> drivers/scsi/qla2xxx/qla_mbx.c | 265 - >> drivers/scsi/qla2xxx/qla_os.c | 165 - >> drivers/scsi/qla2xxx/qla_target.c | 690 >>+--- >> drivers/scsi/qla2xxx/qla_target.h | 36 ++- >> drivers/scsi/qla2xxx/tcm_qla2xxx.c | 107 - >> drivers/target/target_core_transport.c |5 +- >> include/target/target_core_base.h |1 + >> 16 files changed, 1671 insertions(+), 240 deletions(-) >> > >Applied patches #1 -> #14 + #16 to target-pending/for-next code. > >Adding commenting inline for patch #15. > >Thank you, > >--nab We need to rework patch #11 (³qla2xxx: Add selective command queuing²) to address review comments from Bart and Christoph. Can you please drop it from your queue. We¹ll send updated patch once its ready. Thanks, Himanshu > <>
Re: [PATCH v2] ipr: fix out-of-bounds null overwrite
On Jan 6, 2016, at 7:53 AM, Insu Yunwrote: > > Return value of snprintf is not bound by size value, 2nd argument. > (https://www.kernel.org/doc/htmldocs/kernel-api/API-snprintf.html). > Return value is number of printed chars, can be larger than 2nd argument. > Therefore, it can write null byte out of bounds ofbuffer. > Since snprintf puts null, it does not need to put additional null byte. > > Signed-off-by: Insu Yun > --- > drivers/scsi/ipr.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c > index 536cd5a..caf63f9 100644 > --- a/drivers/scsi/ipr.c > +++ b/drivers/scsi/ipr.c > @@ -4003,13 +4003,12 @@ static ssize_t ipr_store_update_fw(struct device *dev, > struct ipr_sglist *sglist; > char fname[100]; > char *src; > - int len, result, dnld_size; > + int result, dnld_size; > > if (!capable(CAP_SYS_ADMIN)) > return -EACCES; > > - len = snprintf(fname, 99, "%s", buf); > - fname[len-1] = '\0'; > + snprintf(fname, 99, "%s", buf); Changing the 99 to sizeof(fname) as part of this change would also make for cleaner code in my opinion. Will leave it up to you if you'd like to do a v3. Reviewed-by: Matthew R. Ochs -- 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: st driver doesn't seem to grok LTO partitioning
Le Mon, 4 Jan 2016 12:22:34 +0200 (EET) Kai Makisaraécrivait: > The patch has been tested with my DDS-4 drive. Oh BTW, may be you could correct this one while you're at it :) I don't think my kernel is so old... :) ~# mt -f /dev/st0 stshowopt Your kernel (3.18.25) may be too old for this command. The options set: buffer-writes async-writes read-ahead debug can-bsr can-partitions -- Emmanuel Florac | Direction technique | Intellique | | +33 1 78 94 84 02 -- 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 V2 5/9] aacraid: Set correct msix count for EEH recovery
From: Raghava Aditya RenukuntaDuring EEH recovery number of online CPU's might change thereby changing the number of MSIx vectors. Since each fib is allocated to a vector, changes in the number of vectors causes fib to be sent thru invalid vectors.In addition the correct number of MSIx vectors is not updated in the INIT struct sent to the controller, when it is reinitialized. Fixed by reassigning vectors to fibs based on the updated number of MSIx vectors and updating the INIT structure before sending to controller. Changes in V2: Replaced fib vector allocation code with aac_fib_vector_assign Fixes: MSI-X vector calculation for suspend/resume Cc: sta...@vger.kernel.org Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/linit.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 08c6835..6d79181 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1410,8 +1410,18 @@ static int aac_acquire_resources(struct aac_dev *dev) aac_adapter_enable_int(dev); - if (!dev->sync_mode) + /*max msix may change after EEH +* Re-assign vectors to fibs +*/ + aac_fib_vector_assign(dev); + + if (!dev->sync_mode) { + /* After EEH recovery or suspend resume, max_msix count +* may change, therfore updating in init as well. +*/ aac_adapter_start(dev); + dev->init->Sa_MSIXVectors = cpu_to_le32(dev->max_msix); + } return 0; error_iounmap: -- 1.9.1 -- 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 V2 0/9] aacraid: Patchset for aacraid driver version 41052
This patchset includes the following changes (bug fixes and new feature support) specific to aacraid driver. V2: Removed aac_fib_free_tag function Setup relevant fib variables only once Created aac_fib_vector_assign function Made EEH functions static Added character device status macros changed location of aac->shutdown to prevent race condition Withdrew patch that disables device ID wild card binding Added Reviewed-by, Cc and Fixes tags from mailing list Raghava Aditya Renukunta (9): [SCSI] aacraid: SCSI blk tag support [SCSI] aacraid: Fix RRQ overload [SCSI] aacraid: Added EEH support [SCSI] aacraid: Fix memory leak in aac_fib_map_free [SCSI] aacraid: Set correct msix count for EEH recovery [SCSI] aacraid: Fundamental reset support for Series 7 [SCSI] aacraid: Fix AIF triggered IOP_RESET [SCSI] aacraid: Fix character device re-initialization [SCSI] aacraid: Update driver version drivers/scsi/aacraid/aachba.c | 27 +++--- drivers/scsi/aacraid/aacraid.h | 13 ++- drivers/scsi/aacraid/comminit.c | 4 +- drivers/scsi/aacraid/commsup.c | 69 +-- drivers/scsi/aacraid/dpcsup.c | 2 - drivers/scsi/aacraid/linit.c| 181 ++-- drivers/scsi/aacraid/src.c | 30 ++- 7 files changed, 269 insertions(+), 57 deletions(-) -- 1.9.1 -- 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 V2 2/9] aacraid: Fix RRQ overload
From: Raghava Aditya RenukuntaThe driver utilizes an array of atomic variables to keep track of IO submissions to each vector. To submit an IO multiple threads iterate through the array to find a vector which has empty slots to send an IO. The reading and updating of the variable is not atomic, causing race conditions when a thread uses a full vector to submit an IO. Fixed by mapping each FIB to a vector, the submission path then uses said vector to submit IO thereby removing the possibly of a race condition.The vector assignment is started from 1 since vector 0 is reserved for the use of AIF management FIBS.If the number of MSIx vectors is 1 (MSI or INTx mode) then all the fibs are allocated to vector 0. Changes in V2: Created function aac_fib_vector_assign to assign vector numbers to fib and to prevent code duplication Fixes: 495c0217 "aacraid: MSI-x support" Cc: sta...@vger.kernel.org # v4.1 Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Reviewed-by: Tomas Henzl --- drivers/scsi/aacraid/aacraid.h | 2 ++ drivers/scsi/aacraid/commsup.c | 28 drivers/scsi/aacraid/src.c | 30 +++--- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index f51f0a0..fff1306 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -944,6 +944,7 @@ struct fib { */ struct list_headfiblink; void*data; + u32 vector_no; struct hw_fib *hw_fib_va; /* Actual shared object */ dma_addr_t hw_fib_pa; /* physical address of hw_fib*/ }; @@ -2113,6 +2114,7 @@ static inline unsigned int cap_to_cyls(sector_t capacity, unsigned divisor) int aac_acquire_irq(struct aac_dev *dev); void aac_free_irq(struct aac_dev *dev); const char *aac_driverinfo(struct Scsi_Host *); +void aac_fib_vector_assign(struct aac_dev *dev); struct fib *aac_fib_alloc(struct aac_dev *dev); struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd); int aac_fib_setup(struct aac_dev *dev); diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 6b286b3..e9f6e70 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -90,6 +90,28 @@ void aac_fib_map_free(struct aac_dev *dev) dev->hw_fib_pa = 0; } +void aac_fib_vector_assign(struct aac_dev *dev) +{ + u32 i = 0; + u32 vector = 1; + struct fib *fibptr = NULL; + + for (i = 0, fibptr = >fibs[i]; + i < (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); + i++, fibptr++) { + if ((dev->max_msix == 1) || + (i > ((dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB - 1) + - dev->vector_cap))) { + fibptr->vector_no = 0; + } else { + fibptr->vector_no = vector; + vector++; + if (vector == dev->max_msix) + vector = 1; + } + } +} + /** * aac_fib_setup - setup the fibs * @dev: Adapter to set up @@ -152,6 +174,12 @@ int aac_fib_setup(struct aac_dev * dev) hw_fib_pa = hw_fib_pa + dev->max_fib_size + sizeof(struct aac_fib_xporthdr); } + + /* +*Assign vector numbers to fibs +*/ + aac_fib_vector_assign(dev); + /* * Add the fib chain to the free list */ diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c index 2aa34ea..bc0203f 100644 --- a/drivers/scsi/aacraid/src.c +++ b/drivers/scsi/aacraid/src.c @@ -156,8 +156,8 @@ static irqreturn_t aac_src_intr_message(int irq, void *dev_id) break; if (dev->msi_enabled && dev->max_msix > 1) atomic_dec(>rrq_outstanding[vector_no]); - aac_intr_normal(dev, handle-1, 0, isFastResponse, NULL); dev->host_rrq[index++] = 0; + aac_intr_normal(dev, handle-1, 0, isFastResponse, NULL); if (index == (vector_no + 1) * dev->vector_cap) index = vector_no * dev->vector_cap; dev->host_rrq_idx[vector_no] = index; @@ -452,36 +452,20 @@ static int aac_src_deliver_message(struct fib *fib) #endif u16 hdr_size = le16_to_cpu(fib->hw_fib_va->header.Size); + u16 vector_no; atomic_inc(>numpending); if (dev->msi_enabled && fib->hw_fib_va->header.Command != AifRequest && dev->max_msix > 1) { - u_int16_t vector_no,
[PATCH V2 6/9] aacraid: Fundamental reset support for Series 7
From: Raghava Aditya RenukuntaSeries 7 does not support PCI hot reset used by EEH. Enabled fundamental reset only for Series 7 Changes in V2: None Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn --- drivers/scsi/aacraid/linit.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 6d79181..6944560 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1135,6 +1135,12 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) u64 dmamask; extern int aac_sync_mode; + /* +* Only series 7 needs freset. +*/ +if (pdev->device == PMC_DEVICE_S7) + pdev->needs_freset = 1; + list_for_each_entry(aac, _devices, entry) { if (aac->id > unique_id) break; -- 1.9.1 -- 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 V2 1/9] aacraid: SCSI blk tag support
From: Raghava Aditya RenukuntaThe method to allocate and free FIB's in the present code utilizes spinlocks.Multiple IO's have to wait on the spinlock to acquire or free fibs creating a performance bottleneck. An alternative solution would be to use block layer tags to keep track of the fibs allocated and freed. To this end aac_fib_alloc_tag was created to utilize the blk layer tags to plug into the Fib pool.These functions are used exclusively in the IO path. 8 fibs are reserved for the use of AIF management software and utilize the previous spinlock based implementations. Changes in V2: Removed aac_fib_free_tag since it was a stub function Moved population of fib fields that are constant to aac_fib_setup Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/aachba.c | 27 --- drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/commsup.c | 32 +--- drivers/scsi/aacraid/dpcsup.c | 2 -- drivers/scsi/aacraid/linit.c | 2 ++ 5 files changed, 44 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index e4c2437..7dfd0fa 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -323,7 +323,6 @@ static inline int aac_valid_context(struct scsi_cmnd *scsicmd, if (unlikely(!scsicmd || !scsicmd->scsi_done)) { dprintk((KERN_WARNING "aac_valid_context: scsi command corrupt\n")); aac_fib_complete(fibptr); - aac_fib_free(fibptr); return 0; } scsicmd->SCp.phase = AAC_OWNER_MIDLEVEL; @@ -331,7 +330,6 @@ static inline int aac_valid_context(struct scsi_cmnd *scsicmd, if (unlikely(!device || !scsi_device_online(device))) { dprintk((KERN_WARNING "aac_valid_context: scsi device corrupt\n")); aac_fib_complete(fibptr); - aac_fib_free(fibptr); return 0; } return 1; @@ -541,7 +539,6 @@ static void get_container_name_callback(void *context, struct fib * fibptr) scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; aac_fib_complete(fibptr); - aac_fib_free(fibptr); scsicmd->scsi_done(scsicmd); } @@ -557,7 +554,8 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd) dev = (struct aac_dev *)scsicmd->device->host->hostdata; - if (!(cmd_fibcontext = aac_fib_alloc(dev))) + cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); + if (!cmd_fibcontext) return -ENOMEM; aac_fib_init(cmd_fibcontext); @@ -586,7 +584,6 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd) printk(KERN_WARNING "aac_get_container_name: aac_fib_send failed with status: %d.\n", status); aac_fib_complete(cmd_fibcontext); - aac_fib_free(cmd_fibcontext); return -1; } @@ -1024,7 +1021,6 @@ static void get_container_serial_callback(void *context, struct fib * fibptr) scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; aac_fib_complete(fibptr); - aac_fib_free(fibptr); scsicmd->scsi_done(scsicmd); } @@ -1040,7 +1036,8 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd) dev = (struct aac_dev *)scsicmd->device->host->hostdata; - if (!(cmd_fibcontext = aac_fib_alloc(dev))) + cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); + if (!cmd_fibcontext) return -ENOMEM; aac_fib_init(cmd_fibcontext); @@ -1068,7 +1065,6 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd) printk(KERN_WARNING "aac_get_container_serial: aac_fib_send failed with status: %d.\n", status); aac_fib_complete(cmd_fibcontext); - aac_fib_free(cmd_fibcontext); return -1; } @@ -1869,7 +1865,6 @@ static void io_callback(void *context, struct fib * fibptr) break; } aac_fib_complete(fibptr); - aac_fib_free(fibptr); scsicmd->scsi_done(scsicmd); } @@ -1954,7 +1949,8 @@ static int aac_read(struct scsi_cmnd * scsicmd) /* * Alocate and initialize a Fib */ - if (!(cmd_fibcontext = aac_fib_alloc(dev))) { + cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); + if (!cmd_fibcontext) { printk(KERN_WARNING "aac_read: fib allocation failed\n"); return -1; } @@ -2051,7 +2047,8 @@ static int aac_write(struct scsi_cmnd * scsicmd) /* * Allocate and initialize a Fib then setup a BlockWrite command */ - if (!(cmd_fibcontext = aac_fib_alloc(dev))) { + cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); + if (!cmd_fibcontext) { /* FIB temporarily unavailable,not catastrophic failure */ /*
Re: [PATCH 02/35] block: add REQ_OP definitions and bi_op/op fields
> "Mike" == mchristiwrites: +enum req_op { + REQ_OP_READ, + REQ_OP_WRITE= REQ_WRITE, + REQ_OP_DISCARD = REQ_DISCARD, + REQ_OP_WRITE_SAME = REQ_WRITE_SAME, +}; + I have been irked by the REQ_ prefix in bios since the flags were consolidated a while back. When I attempted to fix the READ/WRITE mess I used a BLK_ prefix as a result. Anyway. Just bikeshedding... -- Martin K. Petersen Oracle Linux Engineering -- 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 0/9] aacraid: Patchset for aacraid driver version 41052
Hello Martin, > -Original Message- > From: Martin K. Petersen [mailto:martin.peter...@oracle.com] > Sent: Monday, January 4, 2016 6:08 PM > To: Raghava Aditya Renukunta > Cc: jbottom...@parallels.com; linux-scsi@vger.kernel.org; Mahesh > Rajashekhara; Murthy Bhat; zzzSantosh Akula; Gana Sridaran; aacraid@pmc- > sierra.com; Scott Benesh > Subject: Re: [PATCH V2 0/9] aacraid: Patchset for aacraid driver version 41052 > > > "Raghava" == Raghava Aditya Renukunta >writes: > > Raghava> This patchset includes the following changes (bug fixes and new > Raghava> feature support) specific to aacraid driver. > > Raghava> V2: Removed aac_fib_free_tag function Setup relevant fib > Raghava> variables only in once Created aac_fib_vector_assign function > Raghava> Made EEH functions static Added character device status macros > Raghava> Changed location of aac->shutdown to prevent race condition > Raghava> Withdrew patch that disables device ID wild card binding > > You dropped all the review/fix/stable tags you had received from Tomas > and Johannes. > > Please apply the relevant tags and resubmit this series. Thank you for pointing that out I will resubmit this series with necessary changes. Regards, Raghava Aditya > > -- > Martin K. PetersenOracle Linux Engineering -- 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 V2 9/9] aacraid: Update driver version
From: Raghava Aditya RenukuntaUpdated diver version to 41052 Changes in V2: None Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn --- drivers/scsi/aacraid/aacraid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index a440840..22130b3 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -62,7 +62,7 @@ enum { #definePMC_GLOBAL_INT_BIT0 0x0001 #ifndef AAC_DRIVER_BUILD -# define AAC_DRIVER_BUILD 41010 +# define AAC_DRIVER_BUILD 41052 # define AAC_DRIVER_BRANCH "-ms" #endif #define MAXIMUM_NUM_CONTAINERS 32 -- 1.9.1 -- 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 V2 4/9] aacraid: Fix memory leak in aac_fib_map_free
From: Raghava Aditya Renukuntaaac_fib_map_free() calls pci_free_consistent() without checking that dev->hw_fib_va is not NULL and dev->max_fib_size is not zero.If they are indeed NULL/0, this will result in a hang as pci_free_consistent() will attempt to invalidate cache for the entire 64-bit address space (which would take a very long time). Fixed by adding a check to make sure that dev->hw_fib_va and dev->max_fib_size are not NULL and 0 respectively. Changes in V2: None Fixes: 9ad5204d6 - "[SCSI]aacraid: incorrect dma mapping mask during blinked recover or user initiated reset" Cc: sta...@vger.kernel.org Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Reviewed-by: Tomas Henzl --- drivers/scsi/aacraid/commsup.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index e9f6e70..55459b4 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -83,9 +83,12 @@ static int fib_map_alloc(struct aac_dev *dev) void aac_fib_map_free(struct aac_dev *dev) { - pci_free_consistent(dev->pdev, - dev->max_fib_size * (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB), - dev->hw_fib_va, dev->hw_fib_pa); + if (dev->hw_fib_va && dev->max_fib_size) { + pci_free_consistent(dev->pdev, + (dev->max_fib_size * + (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB)), + dev->hw_fib_va, dev->hw_fib_pa); + } dev->hw_fib_va = NULL; dev->hw_fib_pa = 0; } -- 1.9.1 -- 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 V2 3/9] aacraid: Added EEH support
From: Raghava Aditya RenukuntaAdded support for PCI EEH(extended error handling). Changes in V2: Made local functions static Removed call to aac_fib_free_tag Set adapter_shutdown flag when PCI error detected Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Tomas Henzl --- drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/linit.c | 140 + 2 files changed, 141 insertions(+) diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index fff1306..2916288 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -1235,6 +1235,7 @@ struct aac_dev struct msix_entry msixentry[AAC_MAX_MSIX]; struct aac_msix_ctx aac_msix[AAC_MAX_MSIX]; /* context */ u8 adapter_shutdown; + u32 handle_pci_error; }; #define aac_adapter_interrupt(dev) \ diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 129a515..08c6835 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -1298,6 +1299,9 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto out_deinit; scsi_scan_host(shost); + pci_enable_pcie_error_reporting(pdev); + pci_save_state(pdev); + return 0; out_deinit: @@ -1501,6 +1505,141 @@ static void aac_remove_one(struct pci_dev *pdev) } } +static void aac_flush_ios(struct aac_dev *aac) +{ + int i; + struct scsi_cmnd *cmd; + + for (i = 0; i < aac->scsi_host_ptr->can_queue; i++) { + cmd = (struct scsi_cmnd *)aac->fibs[i].callback_data; + if (cmd && (cmd->SCp.phase == AAC_OWNER_FIRMWARE)) { + scsi_dma_unmap(cmd); + + if (aac->handle_pci_error) + cmd->result = DID_NO_CONNECT << 16; + else + cmd->result = DID_RESET << 16; + + cmd->scsi_done(cmd); + } + } +} + +static pci_ers_result_t aac_pci_error_detected(struct pci_dev *pdev, + enum pci_channel_state error) +{ + struct Scsi_Host *shost = pci_get_drvdata(pdev); + struct aac_dev *aac = shost_priv(shost); + + dev_err(>dev, "aacraid: PCI error detected %x\n", error); + + switch (error) { + case pci_channel_io_normal: + return PCI_ERS_RESULT_CAN_RECOVER; + case pci_channel_io_frozen: + + aac->handle_pci_error = 1; + aac->adapter_shutdown = 1; + + scsi_block_requests(aac->scsi_host_ptr); + aac_flush_ios(aac); + aac_release_resources(aac); + + pci_disable_pcie_error_reporting(pdev); + aac_adapter_ioremap(aac, 0); + + return PCI_ERS_RESULT_NEED_RESET; + case pci_channel_io_perm_failure: + aac->handle_pci_error = 1; + aac->adapter_shutdown = 1; + + aac_flush_ios(aac); + return PCI_ERS_RESULT_DISCONNECT; + } + + return PCI_ERS_RESULT_NEED_RESET; +} + +static pci_ers_result_t aac_pci_mmio_enabled(struct pci_dev *pdev) +{ + dev_err(>dev, "aacraid: PCI error - mmio enabled\n"); + return PCI_ERS_RESULT_NEED_RESET; +} + +static pci_ers_result_t aac_pci_slot_reset(struct pci_dev *pdev) +{ + dev_err(>dev, "aacraid: PCI error - slot reset\n"); + pci_restore_state(pdev); + if (pci_enable_device(pdev)) { + dev_warn(>dev, + "aacraid: failed to enable slave\n"); + goto fail_device; + } + + pci_set_master(pdev); + + if (pci_enable_device_mem(pdev)) { + dev_err(>dev, "pci_enable_device_mem failed\n"); + goto fail_device; + } + + return PCI_ERS_RESULT_RECOVERED; + +fail_device: + dev_err(>dev, "aacraid: PCI error - slot reset failed\n"); + return PCI_ERS_RESULT_DISCONNECT; +} + + +static void aac_pci_resume(struct pci_dev *pdev) +{ + struct Scsi_Host *shost = pci_get_drvdata(pdev); + struct scsi_device *sdev = NULL; + struct aac_dev *aac = (struct aac_dev *)shost_priv(shost); + + pci_cleanup_aer_uncorrect_error_status(pdev); + + if (aac_adapter_ioremap(aac, aac->base_size)) { + + dev_err(>dev, "aacraid: ioremap failed\n"); + /* remap failed, go back ... */ + aac->comm_interface = AAC_COMM_PRODUCER; + if (aac_adapter_ioremap(aac, AAC_MIN_FOOTPRINT_SIZE)) { + dev_warn(>dev, + "aacraid: unable to map adapter.\n"); + +
[PATCH V2 8/9] aacraid: Fix character device re-initialization
From: Raghava Aditya RenukuntaDuring EEH PCI hotplug activity kernel unloads and loads the driver, causing character device to be unregistered(aac_remove_one).When the driver is loaded back using aac_probe_one the character device needs to be registered again for the AIF management tools to work. Fixed by adding code to register character device in aac_probe_one if it is unregistered in aac_remove_one. Changes in V2: Added macros to track character device state Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/aacraid.h | 7 +++ drivers/scsi/aacraid/linit.c | 21 ++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 2916288..a440840 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -94,6 +94,13 @@ enum { #define aac_phys_to_logical(x) ((x)+1) #define aac_logical_to_phys(x) ((x)?(x)-1:0) +/* + * These macros are for keeping track of + * character device state. + */ +#define AAC_CHARDEV_UNREGISTERED (-1) +#define AAC_CHARDEV_NEEDS_REINIT (-2) + /* #define AAC_DETAILED_STATUS_INFO */ struct diskparm diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 6944560..fea1ba1 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -80,7 +80,7 @@ MODULE_VERSION(AAC_DRIVER_FULL_VERSION); static DEFINE_MUTEX(aac_mutex); static LIST_HEAD(aac_devices); -static int aac_cfg_major = -1; +static int aac_cfg_major = AAC_CHARDEV_UNREGISTERED; char aac_driver_version[] = AAC_DRIVER_FULL_VERSION; /* @@ -1123,6 +1123,13 @@ static void __aac_shutdown(struct aac_dev * aac) else if (aac->max_msix > 1) pci_disable_msix(aac->pdev); } +static void aac_init_char(void) +{ + aac_cfg_major = register_chrdev(0, "aac", _cfg_fops); + if (aac_cfg_major < 0) { + pr_err("aacraid: unable to register \"aac\" device.\n"); + } +} static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) { @@ -1180,6 +1187,9 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) shost->max_cmd_len = 16; shost->use_cmd_list = 1; + if (aac_cfg_major == AAC_CHARDEV_NEEDS_REINIT) + aac_init_char(); + aac = (struct aac_dev *)shost->hostdata; aac->base_start = pci_resource_start(pdev, 0); aac->scsi_host_ptr = shost; @@ -1517,7 +1527,7 @@ static void aac_remove_one(struct pci_dev *pdev) pci_disable_device(pdev); if (list_empty(_devices)) { unregister_chrdev(aac_cfg_major, "aac"); - aac_cfg_major = -1; + aac_cfg_major = AAC_CHARDEV_NEEDS_REINIT; } } @@ -1680,11 +1690,8 @@ static int __init aac_init(void) if (error < 0) return error; - aac_cfg_major = register_chrdev( 0, "aac", _cfg_fops); - if (aac_cfg_major < 0) { - printk(KERN_WARNING - "aacraid: unable to register \"aac\" device.\n"); - } + aac_init_char(); + return 0; } -- 1.9.1 -- 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 V2 7/9] aacraid: Fix AIF triggered IOP_RESET
From: Raghava Aditya Renukuntawhile driver removal is in progress or PCI shutdown is invoked, driver kills AIF aacraid thread, but IOCTL requests from the management tools re-start AIF thread leading to IOP_RESET. Fixed by setting adapter_shutdown flag when PCI shutdown is invoked. Changes in V2: Set adapter_shutdown flag before shutdown command is sent to \ controller Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/comminit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index 0e954e3..fe08854 100644 --- a/drivers/scsi/aacraid/comminit.c +++ b/drivers/scsi/aacraid/comminit.c @@ -212,8 +212,9 @@ int aac_send_shutdown(struct aac_dev * dev) return -ENOMEM; aac_fib_init(fibctx); - cmd = (struct aac_close *) fib_data(fibctx); + dev->adapter_shutdown = 1; + cmd = (struct aac_close *) fib_data(fibctx); cmd->command = cpu_to_le32(VM_CloseAll); cmd->cid = cpu_to_le32(0xfffe); @@ -229,7 +230,6 @@ int aac_send_shutdown(struct aac_dev * dev) /* FIB should be freed only after getting the response from the F/W */ if (status != -ERESTARTSYS) aac_fib_free(fibctx); - dev->adapter_shutdown = 1; if ((dev->pdev->device == PMC_DEVICE_S7 || dev->pdev->device == PMC_DEVICE_S8 || dev->pdev->device == PMC_DEVICE_S9) && -- 1.9.1 -- 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 00/35 v2] separate operations from flags in the bio/request structs
> "Mike" == mchristiwrites: Mike> The following patches begin to cleanup the request->cmd_flags and bio-> bi_rw mess. We currently use cmd_flags to specify the operation, Mike> attributes and state of the request. For bi_rw we use it for Mike> similar info and also the priority but then also have another Mike> bi_flags field for state. At some point, we abused them so much we Mike> just made cmd_flags 64 bits, so we could add more. Mike> The following patches seperate the operation (read, write discard, Mike> flush, etc) from cmd_flags/bi_rw. Mike> This patchset was made against linux-next from today Jan 5 2016. Mike> (git tag next-20160105). Very nice work. Thanks for doing this! I think it's a much needed cleanup. I focused mainly on the core block, discard, write same and sd.c pieces and everything looks sensible to me. I wonder what the best approach is to move a patch set with this many stakeholders forward? Set a "speak now or forever hold your peace" review deadline? -- Martin K. Petersen Oracle Linux Engineering -- 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 13/35] xfs: set bi_op to REQ_OP
On Tue, Jan 05, 2016 at 02:53:16PM -0600, mchri...@redhat.com wrote: > From: Mike Christie> > This patch has xfs set the bio bi_op to a REQ_OP, and > rq_flag_bits to bi_rw. > > Note: > I have run xfs tests on these btrfs patches. There were some failures > with and without the patches. I have not had time to track down why > xfstest fails without the patches. > > Signed-off-by: Mike Christie > --- > fs/xfs/xfs_aops.c | 3 ++- > fs/xfs/xfs_buf.c | 27 +++ > 2 files changed, 17 insertions(+), 13 deletions(-) Not sure which patches your note is refering to here. The XFS change here looks fine. Acked-by: Dave Chinner -Dave. -- Dave Chinner da...@fromorbit.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
Re: [PATCH v2 0/6] cxlflash: Miscellaneous fixes and updates
> "Uma" == Uma Krishnanwrites: Uma> This patch set contains miscellaneous fixes and adds support for a Uma> future IBM CXL adapter. This series is intended for 4.5 and is Uma> bisectable. Please reference the changelog below for details on Uma> what has been altered from previous versions of this patch set. Applied to 4.5/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering -- 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 00/35 v2] separate operations from flags in the bio/request structs
On Wed, Jan 06, 2016 at 08:40:09PM -0500, Martin K. Petersen wrote: > > "Mike" == mchristiwrites: > > Mike> The following patches begin to cleanup the request->cmd_flags and > bio-> bi_rw mess. We currently use cmd_flags to specify the operation, > Mike> attributes and state of the request. For bi_rw we use it for > Mike> similar info and also the priority but then also have another > Mike> bi_flags field for state. At some point, we abused them so much we > Mike> just made cmd_flags 64 bits, so we could add more. > > Mike> The following patches seperate the operation (read, write discard, > Mike> flush, etc) from cmd_flags/bi_rw. > > Mike> This patchset was made against linux-next from today Jan 5 2016. > Mike> (git tag next-20160105). > > Very nice work. Thanks for doing this! > > I think it's a much needed cleanup. I focused mainly on the core block, > discard, write same and sd.c pieces and everything looks sensible to me. > > I wonder what the best approach is to move a patch set with this many > stakeholders forward? Set a "speak now or forever hold your peace" > review deadline? I say just ask Linus to pull it immediately after the next merge window closes Cheers, Dave. -- Dave Chinner da...@fromorbit.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
Re: [PATCH v4 00/78] More fixes, cleanup and modernization for NCR5380 drivers
> "Finn" == Finn Thainwrites: Finn> Like my previous work on the NCR5380 drivers, this patch series Finn> has bug fixes, code cleanup and modernization. These drivers Finn> suffer from mistakes, poor style and neglect and this long series Finn> addresses the worst of it, covering all ten wrapper drivers and Finn> both of the core driver forks. The combined size of the drivers is Finn> reduced by over 700 LoC. I have staged this for inclusion in a separate branch. Will pull it into the main queue unless kbuild complains. http://git.kernel.org/cgit/linux/kernel/git/mkp/scsi.git/log/?h=4.5/ncr5380 -- Martin K. Petersen Oracle Linux Engineering -- 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 1/1] mvsas: add SGPIO support to Marvell 94xx
> "Wilfried" == Wilfried Weissmannwrites: Wilfried> add SGPIO support to Marvell 94xx Applied to 4.5/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering -- 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 00/16] qla2xxx: Patches for target-pending branch
On Wed, 2016-01-06 at 17:00 +, Himanshu Madhani wrote: > Hi Nic, > > > On 12/20/15, 10:57 PM, "Nicholas A. Bellinger"wrote: > > >Hi Himanshu & Co, > > > >On Thu, 2015-12-17 at 14:56 -0500, Himanshu Madhani wrote: > >> Hi Nic, > >> > >> Please apply this series to target-pending at your earliest convenience. > >> > >> changes from v1 -> v2 > >> > >> o Added Reviewed-by tag for reviewed patches. > >> > >> o Dropped following patches for rework. > >> - qla2xxx: Change check_stop_free to always return 1 > >> - qla2xxx: Fix interaction issue between qla2xxx and Target Core > >>Module > >> - qla2xxx: Add TAS detection for kernel 3.15 n newer > >> - target/tmr: LUN reset cause cmd premature free. > >> > > > >Thanks for dropping these for the moment. > > > >I'll be following up on outstanding TMR LUN_RESET reference counting > >bugs over the holiday. > > > >> o Fixed patch description on following patches > >> - qla2xxx: Enable Extended Login support > >> - qla2xxx: Enable Exchange offload support. > >> > >> o Fixed patch description as well as kbuild warning for > >> - qla2xxx: Added interface to send explicit LOGO. > >> > >> o Fixed kbuild warning for > >> - qla2xxx: Remove dependency on hardware_lock to reduce lock > >> contention. > >> > > > >Applied patches #1 -> #14 + #16 to target-pending/for-next code. > > > >Adding commenting inline for patch #15. > > > >Thank you, > > > >--nab > > We need to rework patch #11 (³qla2xxx: Add selective command queuing²) to > address review comments from Bart and Christoph. > Can you please drop it from your queue. We¹ll send updated patch once its > ready. > No need to resend the whole patch. Just address the comments with an incremental patch, and I'll fold into the original when applying. -- 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 25/35] target: set bi_op to REQ_OP
Hi Mike, On Tue, 2016-01-05 at 14:53 -0600, mchri...@redhat.com wrote: > From: Mike Christie> > This patch has the target modules set the bio bi_op to a REQ_OP, and > rq_flag_bits to bi_rw. > > This patch is compile tested only. > > Signed-off-by: Mike Christie > --- > drivers/target/target_core_iblock.c | 38 > ++--- > drivers/target/target_core_pscsi.c | 2 +- > 2 files changed, 24 insertions(+), 16 deletions(-) > Nice work to clean this long standing abuse. ;) For the target/iblock bit: Acked-by: Nicholas Bellinger -- 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: mvsas: fix indenting on return error code
> "Colin" == Colin Kingwrites: Colin, Colin> The return code and error return is incorrectly indented which Colin> may cause some confusion as it appears at first sight to be Colin> associated with a device not ready error (with missing { } Colin> braces) rather than a DEV_IS_GONE() failure. This problem has already been addressed: https://git.kernel.org/cgit/linux/kernel/git/mkp/scsi.git/commit/?h=4.5/scsi-queue=7789cd39274c -- Martin K. Petersen Oracle Linux Engineering -- 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, RESEND] Separate target visibility from reaped state information
James Bottomley wrote: > On Wed, 2016-01-06 at 09:24 +0100, Bart Van Assche wrote: > > Instead of representing the states "visible in sysfs" and > > "has been removed from the target list" by a single state > > variable, use two variables to represent this information. > > > > This patch avoids that SCSI device removal can trigger a > > soft lockup. > > It does? When I asked you this the last time, you said the soft lockup > was fixed by a prior patch: > > http://thread.gmane.org/gmane.linux.scsi/107248 > > If you've actually caught a problem, can we have details because the > distro people will want to know what gets fixed by this. > > Thanks, > > James Which details do you need? > > See also: > > * "scsi: restart list search after unlock in scsi_remove_target" > > (commit 40998193560d). > > * "scsi_remove_target: fix softlockup regression on hot remove" > > (commit bc3f02a795d3). > > > > Reported-by: Sebastian Herbszt> > Tested-by: Sebastian Herbszt > > Signed-off-by: Bart Van Assche > > Cc: Christoph Hellwig > > Cc: Johannes Thumshirn > > Cc: Dan Williams > > Cc: stable > > --- > > drivers/scsi/scsi_scan.c | 31 +++ > > drivers/scsi/scsi_sysfs.c | 7 --- > > include/scsi/scsi_device.h | 9 ++--- > > 3 files changed, 9 insertions(+), 38 deletions(-) > > > > See also: > > - http://thread.gmane.org/gmane.linux.scsi/107245. I was able to hit a soft lockup and reported it here: > > - http://thread.gmane.org/gmane.linux.scsi/108614. Sebastian -- 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 v3 0/4] scsi: cleanup ioctl headers and provide UAPI versions
> "Paolo" == Paolo Bonziniwrites: >> This is v3 of the series to provide an "official" sg.h header (and >> scsi_ioctl.h too, though it's basically obsolete) together with the >> other userspace API definitions. The change from v2 to v3 is that >> defaults for sg.c are not exported in include/uapi/linux/sg.c. Paolo> What happened to these patches?... They predate me being patch monkey. Please repost with any review tags or acks you may have received. -- Martin K. Petersen Oracle Linux Engineering -- 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 V4 0/4] scsi: storvsc: Properly support FC hosts
> "KYS" == K Y Srinivasanwrites: The template discussion appears to have lost momentum and since the concerns were minor I have applied your latest series to 4.5/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering -- 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