From b09965693f68b21abe33e99211218d21e99a5e17 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 18 Feb 2021 11:44:28 +0100 Subject: [PATCH 4/6] net: qualcomm: bam-dmux: Always open/close channel with network interface Doesn't seem to cause issues and just seems cleaner... --- drivers/net/ethernet/qualcomm/bam-dmux.c | 28 +++++------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/bam-dmux.c b/drivers/net/ethernet/qualcomm/bam-dmux.c index 171af41eb10a..880e0ca14beb 100644 --- a/drivers/net/ethernet/qualcomm/bam-dmux.c +++ b/drivers/net/ethernet/qualcomm/bam-dmux.c @@ -90,7 +90,6 @@ struct bam_dmux { struct bam_dmux_netdev { struct bam_dmux *dmux; u8 ch; - bool open; }; static void bam_dmux_pc_vote(struct bam_dmux *dmux, bool enable) @@ -289,37 +288,22 @@ static int bam_dmux_send_cmd(struct bam_dmux_netdev *bndev, u8 cmd) static int bam_dmux_netdev_open(struct net_device *netdev) { struct bam_dmux_netdev *bndev = netdev_priv(netdev); - struct bam_dmux *dmux = bndev->dmux; int ret; - /* Need to resume before starting the queue */ - ret = pm_runtime_get_sync(dmux->dev); - if (ret < 0) { - pm_runtime_put_noidle(dmux->dev); + ret = bam_dmux_send_cmd(bndev, BAM_DMUX_HDR_CMD_OPEN); + if (ret) return ret; - } - - if (!bndev->open) { - ret = bam_dmux_send_cmd(bndev, BAM_DMUX_HDR_CMD_OPEN); - if (ret) - goto err; - - bndev->open = true; - } else { - ret = 0; - } netif_start_queue(netdev); - -err: - pm_runtime_mark_last_busy(dmux->dev); - pm_runtime_put_autosuspend(dmux->dev); - return ret; + return 0; } static int bam_dmux_netdev_stop(struct net_device *netdev) { + struct bam_dmux_netdev *bndev = netdev_priv(netdev); + netif_stop_queue(netdev); + bam_dmux_send_cmd(bndev, BAM_DMUX_HDR_CMD_CLOSE); return 0; } -- 2.30.1