@@ -212,24 +212,28 @@ static void ionic_adminq_flush(struct ionic_lif *lif)
212
212
spin_unlock_irqrestore (& lif -> adminq_lock , irqflags );
213
213
}
214
214
215
+ void ionic_adminq_netdev_err_print (struct ionic_lif * lif , u8 opcode ,
216
+ u8 status , int err )
217
+ {
218
+ netdev_err (lif -> netdev , "%s (%d) failed: %s (%d)\n" ,
219
+ ionic_opcode_to_str (opcode ), opcode ,
220
+ ionic_error_to_str (status ), err );
221
+ }
222
+
215
223
static int ionic_adminq_check_err (struct ionic_lif * lif ,
216
224
struct ionic_admin_ctx * ctx ,
217
- bool timeout )
225
+ const bool timeout ,
226
+ const bool do_msg )
218
227
{
219
- struct net_device * netdev = lif -> netdev ;
220
- const char * opcode_str ;
221
- const char * status_str ;
222
228
int err = 0 ;
223
229
224
230
if (ctx -> comp .comp .status || timeout ) {
225
- opcode_str = ionic_opcode_to_str (ctx -> cmd .cmd .opcode );
226
- status_str = ionic_error_to_str (ctx -> comp .comp .status );
227
231
err = timeout ? - ETIMEDOUT :
228
232
ionic_error_to_errno (ctx -> comp .comp .status );
229
233
230
- netdev_err ( netdev , "%s (%d) failed: %s (%d)\n" ,
231
- opcode_str , ctx -> cmd .cmd .opcode ,
232
- timeout ? "TIMEOUT" : status_str , err );
234
+ if ( do_msg )
235
+ ionic_adminq_netdev_err_print ( lif , ctx -> cmd .cmd .opcode ,
236
+ ctx -> comp . comp . status , err );
233
237
234
238
if (timeout )
235
239
ionic_adminq_flush (lif );
@@ -298,7 +302,8 @@ int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx)
298
302
return err ;
299
303
}
300
304
301
- int ionic_adminq_wait (struct ionic_lif * lif , struct ionic_admin_ctx * ctx , int err )
305
+ int ionic_adminq_wait (struct ionic_lif * lif , struct ionic_admin_ctx * ctx ,
306
+ const int err , const bool do_msg )
302
307
{
303
308
struct net_device * netdev = lif -> netdev ;
304
309
unsigned long time_limit ;
@@ -310,7 +315,7 @@ int ionic_adminq_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, int er
310
315
name = ionic_opcode_to_str (ctx -> cmd .cmd .opcode );
311
316
312
317
if (err ) {
313
- if (!test_bit (IONIC_LIF_F_FW_RESET , lif -> state ))
318
+ if (do_msg && !test_bit (IONIC_LIF_F_FW_RESET , lif -> state ))
314
319
netdev_err (netdev , "Posting of %s (%d) failed: %d\n" ,
315
320
name , ctx -> cmd .cmd .opcode , err );
316
321
return err ;
@@ -328,8 +333,9 @@ int ionic_adminq_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, int er
328
333
329
334
/* interrupt the wait if FW stopped */
330
335
if (test_bit (IONIC_LIF_F_FW_RESET , lif -> state )) {
331
- netdev_err (netdev , "%s (%d) interrupted, FW in reset\n" ,
332
- name , ctx -> cmd .cmd .opcode );
336
+ if (do_msg )
337
+ netdev_err (netdev , "%s (%d) interrupted, FW in reset\n" ,
338
+ name , ctx -> cmd .cmd .opcode );
333
339
return - ENXIO ;
334
340
}
335
341
@@ -339,7 +345,9 @@ int ionic_adminq_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, int er
339
345
dev_dbg (lif -> ionic -> dev , "%s: elapsed %d msecs\n" ,
340
346
__func__ , jiffies_to_msecs (time_done - time_start ));
341
347
342
- return ionic_adminq_check_err (lif , ctx , time_after_eq (time_done , time_limit ));
348
+ return ionic_adminq_check_err (lif , ctx ,
349
+ time_after_eq (time_done , time_limit ),
350
+ do_msg );
343
351
}
344
352
345
353
int ionic_adminq_post_wait (struct ionic_lif * lif , struct ionic_admin_ctx * ctx )
@@ -348,7 +356,16 @@ int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx)
348
356
349
357
err = ionic_adminq_post (lif , ctx );
350
358
351
- return ionic_adminq_wait (lif , ctx , err );
359
+ return ionic_adminq_wait (lif , ctx , err , true);
360
+ }
361
+
362
+ int ionic_adminq_post_wait_nomsg (struct ionic_lif * lif , struct ionic_admin_ctx * ctx )
363
+ {
364
+ int err ;
365
+
366
+ err = ionic_adminq_post (lif , ctx );
367
+
368
+ return ionic_adminq_wait (lif , ctx , err , false);
352
369
}
353
370
354
371
static void ionic_dev_cmd_clean (struct ionic * ionic )
0 commit comments