Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/ncsi: Don't deselect package in suspend if active

When a package is deselected all channels of that package cease
communication. If there are other channels active on the package of the
suspended channel this will disable them as well, so only send a
deselect-package command if no other channels are active.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Samuel Mendoza-Jonas and committed by
David S. Miller
cd09ab09 8e13f70b

+13 -2
+13 -2
net/ncsi/ncsi-manage.c
··· 440 440 static void ncsi_suspend_channel(struct ncsi_dev_priv *ndp) 441 441 { 442 442 struct ncsi_dev *nd = &ndp->ndev; 443 - struct ncsi_package *np = ndp->active_package; 444 - struct ncsi_channel *nc = ndp->active_channel; 443 + struct ncsi_package *np; 444 + struct ncsi_channel *nc, *tmp; 445 445 struct ncsi_cmd_arg nca; 446 446 unsigned long flags; 447 447 int ret; 448 448 449 + np = ndp->active_package; 450 + nc = ndp->active_channel; 449 451 nca.ndp = ndp; 450 452 nca.req_flags = NCSI_REQ_FLAG_EVENT_DRIVEN; 451 453 switch (nd->state) { ··· 523 521 if (ret) 524 522 goto error; 525 523 524 + NCSI_FOR_EACH_CHANNEL(np, tmp) { 525 + /* If there is another channel active on this package 526 + * do not deselect the package. 527 + */ 528 + if (tmp != nc && tmp->state == NCSI_CHANNEL_ACTIVE) { 529 + nd->state = ncsi_dev_state_suspend_done; 530 + break; 531 + } 532 + } 526 533 break; 527 534 case ncsi_dev_state_suspend_deselect: 528 535 ndp->pending_req_num = 1;