s390: network device driver fixes
Subsystems (5)
cover s390: network device driver fixes
Hi Jeff,
following eight patches are all fixes for s390 network device driver qeth, claw and netiucv.
I would be glad to see them going into 2.6.22 although I know it is quite late .
Thank you.
Frank
PATCH 1/8 s390: print correct level for HiperSockets devices
From: Ursula Braun <[email protected]>
For real HiperSockets the EBCDIC-ASCII conversion is not necessary. This is only needed for z/VM GuestLAN devices.
--- drivers/s390/net/qeth_main.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-)
drivers/s390/net/qeth_main.c +11 -9
@@ -7797,15 +7797,17 @@ qeth_print_status_message(struct qeth_card *card) }/* fallthrough */ case QETH_CARD_TYPE_IQD : - card->info.mcl_level[0 ] = (char ) _ebcasc[(__u8 ) - card->info.mcl_level[0 ]]; - card->info.mcl_level[1 ] = (char ) _ebcasc[(__u8 ) - card->info.mcl_level[1 ]]; - card->info.mcl_level[2 ] = (char ) _ebcasc[(__u8 ) - card->info.mcl_level[2 ]]; - card->info.mcl_level[3 ] = (char ) _ebcasc[(__u8 ) - card->info.mcl_level[3 ]]; - card->info.mcl_level[QETH_MCL_LENGTH ] =0 ; +if (card->info.guestlan) { + card->info.mcl_level[0 ] = (char ) _ebcasc[(__u8 ) + card->info.mcl_level[0 ]]; + card->info.mcl_level[1 ] = (char ) _ebcasc[(__u8 ) + card->info.mcl_level[1 ]]; + card->info.mcl_level[2 ] = (char ) _ebcasc[(__u8 ) + card->info.mcl_level[2 ]]; + card->info.mcl_level[3 ] = (char ) _ebcasc[(__u8 ) + card->info.mcl_level[3 ]]; + card->info.mcl_level[QETH_MCL_LENGTH ] =0 ; + }break ;default :memset (&card->info.mcl_level[0 ],0 ,QETH_MCL_LENGTH +1 );
Signature · 1 line
1.5.2.1
Re: [PATCH 1/8] s390: print correct level for HiperSockets devices
Quoted 10 lines · Frank Pavlic
From: Ursula Braun <[email protected]>
For real HiperSockets the EBCDIC-ASCII conversion is not necessary. This is only needed for z/VM GuestLAN devices.
Signed-off-by Ursula Braun <[email protected]>Signed-off-by Frank Pavlic <[email protected]>--- drivers/s390/net/qeth_main.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-)
applied 1-8 to #upstream-fixes
PATCH 2/8 s390: qeth driver does not recover
In reply to Frank PavlicFrom: Ursula Braun <[email protected]>
While first recovery continues, the card issues
a STARTLAN command itself. In this case qeth
schedules another recovery. This second
recovery is cancelled because of an already running first recovery. Stop first recovery in case of 0xe080.
--- drivers/s390/net/qeth_main.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/s390/net/qeth_main.c +6 -6
@@ -986,15 +986,15 @@ qeth_recover(void *ptr) card->use_hard_stop =1 ;__qeth_set_offline (card->gdev,1 ); rc =__qeth_set_online (card->gdev,1 ); +/* don't run another scheduled recovery */ +qeth_clear_thread_start_bit (card,QETH_RECOVER_THREAD ); +qeth_clear_thread_running_bit (card,QETH_RECOVER_THREAD );if (!rc)PRINT_INFO ("Device %s successfully recovered!\n" ,CARD_BUS_ID (card));else PRINT_INFO ("Device %s could not be recovered!\n" ,CARD_BUS_ID (card)); -/* don't run another scheduled recovery */ -qeth_clear_thread_start_bit (card,QETH_RECOVER_THREAD ); -qeth_clear_thread_running_bit (card,QETH_RECOVER_THREAD );return 0 ; }
@@ -7476,11 +7476,11 @@ qeth_softsetup_card(struct qeth_card *card)QETH_DBF_TEXT_ (setup,2 ,"1err%d" , rc);if (rc ==0xe080 ){PRINT_WARN ("LAN on card %s if offline! " -"Continuing softsetup.\n" , +"Waiting for STARTLAN from card.\n" ,CARD_BUS_ID (card)); card->lan_online =0 ; - }else -return rc; + } +return rc; }else card->lan_online =1 ;if (card->info.type==QETH_CARD_TYPE_OSN )
Signature · 1 line
1.5.2.1
PATCH 3/8 s390: avoid inconsistent lock state in qeth
In reply to Frank PavlicFrom: Ursula Braun <[email protected]>
ipv6_regen_rndid in net/ipv6/addrconf.c makes use of "write_lock_bh" for its inet6_dev->lock. It may run in softirq-context. qeth makes use of "read_lock" for the same inet6_dev->lock. To avoid a potential deadlock situation, qeth should make use of "read_lock_bh" for its usages of inet6_dev->lock.
--- drivers/s390/net/qeth_main.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/s390/net/qeth_main.c +4 -4
@@ -5850,9 +5850,9 @@ qeth_add_vlan_mc6(struct qeth_card *card) in_dev =in6_dev_get (netdev);if (!in_dev)continue ; -read_lock (&in_dev->lock); +read_lock_bh (&in_dev->lock);qeth_add_mc6 (card,in_dev); -read_unlock (&in_dev->lock); +read_unlock_bh (&in_dev->lock); in6_dev_put(in_dev); }#endif /* CONFIG_QETH_VLAN */
@@ -5869,10 +5869,10 @@ qeth_add_multicast_ipv6(struct qeth_card *card) in6_dev =in6_dev_get (card->dev);if (in6_dev ==NULL )return ; -read_lock (&in6_dev->lock); +read_lock_bh (&in6_dev->lock);qeth_add_mc6 (card, in6_dev);qeth_add_vlan_mc6 (card); -read_unlock (&in6_dev->lock); +read_unlock_bh (&in6_dev->lock); in6_dev_put(in6_dev); }#endif /* CONFIG_QETH_IPV6 */
Signature · 1 line
1.5.2.1
PATCH 4/8 s390: qeth: wrong packet length in qdio header
In reply to Frank PavlicFrom: Frank Pavlic <[email protected]>
Packets Length in qdio header is broken when using
EDDP on Layer2 devices. This leads to skb_under_panic on receiver system when running on z/VM GuestLAN devices.
--- drivers/s390/net/qeth_eddp.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/s390/net/qeth_eddp.c +1 -2
@@ -424,8 +424,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,/* prepare qdio hdr */ if (eddp->qh.hdr.l2.id ==QETH_HEADER_TYPE_LAYER2 ){ eddp->qh.hdr.l2.pkt_length = data_len +ETH_HLEN + - eddp->nhl + eddp->thl - -sizeof (struct qeth_hdr ); + eddp->nhl + eddp->thl;#ifdef CONFIG_QETH_VLAN if (eddp->mac.h_proto ==__constant_htons (ETH_P_8021Q )) eddp->qh.hdr.l2.pkt_length +=VLAN_HLEN ;
Signature · 1 line
1.5.2.1
PATCH 5/8 s390: Use ccw_device_get_id() in qeth/claw drivers
In reply to Frank PavlicFrom: Cornelia Huck <[email protected]>
Use ccw_device_get_id() to get a device number
instead of parsing the ccw device's bus id.
--- drivers/s390/net/claw.c | 13 ++++++++----- drivers/s390/net/qeth_main.c | 12 +++--------- 2 files changed, 11 insertions(+), 14 deletions(-)
drivers/s390/net/claw.c +8 -5
@@ -3912,6 +3912,7 @@ static int add_channel(struct ccw_device *cdev,int i,struct claw_privbk *privptr) { struct chbk *p_ch; +struct ccw_dev_id dev_id;#ifdef FUNCTRACE printk (KERN_INFO "%s:%s Enter\n" ,cdev->dev.bus_id,__FUNCTION__);
@@ -3921,7 +3922,8 @@ add_channel(struct ccw_device *cdev,int i,struct claw_privbk *privptr) p_ch = &privptr->channel[i]; p_ch->cdev = cdev;snprintf (p_ch->id,CLAW_ID_SIZE ,"cl-%s" , cdev->dev.bus_id); -sscanf (cdev->dev.bus_id+4 ,"%x" ,&p_ch->devno); +ccw_device_get_id (cdev, &dev_id); + p_ch->devno = dev_id.devno;if ((p_ch->irb =kmalloc (sizeof (struct irb ),GFP_KERNEL )) ==NULL ) {printk (KERN_WARNING "%s Out of memory in %s for irb\n" , p_ch->id,__FUNCTION__);
@@ -3955,6 +3957,7 @@ claw_new_device(struct ccwgroup_device *cgdev)struct claw_env *p_env;struct net_device *dev;int ret; +struct ccw_dev_id dev_id;pr_debug ("%s() called\n" , __FUNCTION__);printk (KERN_INFO "claw: add for %s\n" ,cgdev->cdev[READ ]->dev.bus_id);
@@ -3965,10 +3968,10 @@ claw_new_device(struct ccwgroup_device *cgdev)if (!privptr)return -ENODEV ; p_env = privptr->p_env; -sscanf (cgdev->cdev[READ ]->dev.bus_id+4 ,"%x" , - &p_env->devno[READ ]); -sscanf (cgdev->cdev[WRITE ]->dev.bus_id+4 ,"%x" , - &p_env->devno[WRITE ]); +ccw_device_get_id (cgdev->cdev[READ ], &dev_id); + p_env->devno[READ ] = dev_id.devno; +ccw_device_get_id (cgdev->cdev[WRITE ], &dev_id); + p_env->devno[WRITE ] = dev_id.devno; ret =add_channel (cgdev->cdev[0 ],0 ,privptr);if (ret ==0 ) ret =add_channel (cgdev->cdev[1 ],1 ,privptr);
drivers/s390/net/qeth_main.c +3 -9
@@ -2176,13 +2176,6 @@ qeth_ulp_enable(struct qeth_card *card) } -static inline __u16 -__raw_devno_from_bus_id (char *id) -{ - id += (strlen (id) -4 ); -return (__u16 )simple_strtoul (id, &id,16 ); -} -static int qeth_ulp_setup_cb (struct qeth_card *card,struct qeth_reply *reply,unsigned long data)
@@ -2205,6 +2198,7 @@ qeth_ulp_setup(struct qeth_card *card)int rc;__u16 temp;struct qeth_cmd_buffer *iob; +struct ccw_dev_id dev_id;QETH_DBF_TEXT (setup,2 ,"ulpsetup" );
@@ -2218,8 +2212,8 @@ qeth_ulp_setup(struct qeth_card *card)memcpy (QETH_ULP_SETUP_FILTER_TOKEN (iob->data), &card->token.ulp_filter_r,QETH_MPC_TOKEN_LENGTH ); - temp =__raw_devno_from_bus_id (CARD_DDEV_ID (card)); -memcpy (QETH_ULP_SETUP_CUA (iob->data), &temp,2 ); +ccw_device_get_id (CARD_DDEV (card), &dev_id); +memcpy (QETH_ULP_SETUP_CUA (iob->data), &dev_id.devno,2 ); temp = (card->info.cula <<8 ) + card->info.unit_addr2;memcpy (QETH_ULP_SETUP_REAL_DEVADDR (iob->data), &temp,2 ); rc = qeth_send_control_data(card, ULP_SETUP_SIZE, iob,
Signature · 1 line
1.5.2.1
PATCH 6/8 s390: don't call iucv_path_connect from tasklet context
In reply to Frank PavlicFrom: Ursula Braun <[email protected]>
net/iucv/iucv.c creates the requirement for iucv_path_connect not to be called from tasklet context anymore. An extra checking is added in case of a failing netiucv_tx to fulfil this requirement for netiucv.
--- drivers/s390/net/netiucv.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/s390/net/netiucv.c +2 -1
@@ -1315,7 +1315,8 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)* and throw away packet. */ if (fsm_getstate (privptr->fsm) !=DEV_STATE_RUNNING ) { -fsm_event (privptr->fsm,DEV_EVENT_START , dev); +if (!in_atomic ()) +fsm_event (privptr->fsm,DEV_EVENT_START , dev);dev_kfree_skb (skb); privptr->stats.tx_dropped++; privptr->stats.tx_errors++;
Signature · 1 line
1.5.2.1
PATCH 7/8 s390: netiucv spinlock initializer cleanup
In reply to Frank PavlicFrom: Thomas Gleixner <[email protected]>
spinlock initializer cleanup in netiucv.c
--- drivers/s390/net/netiucv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/s390/net/netiucv.c +1 -1
@@ -212,7 +212,7 @@ struct iucv_connection {*/ static struct list_head iucv_connection_list =LIST_HEAD_INIT (iucv_connection_list); -static rwlock_t iucv_connection_rwlock =RW_LOCK_UNLOCKED ; +static DEFINE_RWLOCK (iucv_connection_rwlock);/** * Representation of event-data for the
Signature · 1 line
1.5.2.1
PATCH 8/8 s390: netiucv inlining cleanup
In reply to Frank PavlicFrom: Martin Schwidefsky <[email protected]>
The recent iucv rework patches re-introduced some unnecessary inlines. Remove them again.
--- drivers/s390/net/netiucv.c | 18 +++--------------- 1 files changed, 3 insertions(+), 15 deletions(-)
drivers/s390/net/netiucv.c +3 -15
@@ -134,18 +134,6 @@ PRINT_##importance(header "%02x %02x %02x %02x %02x %02x %02x %02x " \ *(((char *)ptr)+28 ),*(((char *)ptr)+29 ), \ *(((char*)ptr)+30),*(((char*)ptr)+31)); -static inline void iucv_hex_dump (unsigned char *buf,size_t len) -{ -size_t i; - -for (i =0 ; i < len; i++) { -if (i && !(i %16 )) -printk ("\n" ); -printk ("%02x " , *(buf + i)); - } -printk ("\n" ); -} -#define PRINTK_HEADER " iucv: "/* for debugging */ static struct device_driver netiucv_driver = {
@@ -280,7 +268,7 @@ static u8 iucvMagic[16] = {* * @returns The printable string (static data!!) */ -static inline char *netiucv_printname (char *name) +static char *netiucv_printname (char *name) {static char tmp[9 ];char *p = tmp;
@@ -1730,7 +1718,7 @@ static struct attribute_group netiucv_stat_attr_group = { .attrs = netiucv_stat_attrs, }; -static inline int netiucv_add_files (struct device *dev) +static int netiucv_add_files (struct device *dev) {int ret;
@@ -1744,7 +1732,7 @@ static inline int netiucv_add_files(struct device *dev)return ret; } -static inline void netiucv_remove_files (struct device *dev) +static void netiucv_remove_files (struct device *dev) {IUCV_DBF_TEXT (trace,3 , __FUNCTION__);sysfs_remove_group (&dev->kobj, &netiucv_stat_attr_group);
Signature · 1 line
1.5.2.1