Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp72574imd; Wed, 31 Oct 2018 14:53:29 -0700 (PDT) X-Google-Smtp-Source: AJdET5dKE/59MmlPhdkTAjpTrV+YbC7s53HyzEyvf34Re+Yqbj4ZsAVrgVLJbgmakhjraMKn7VhJ X-Received: by 2002:a62:1095:: with SMTP id 21-v6mr4997216pfq.227.1541022809035; Wed, 31 Oct 2018 14:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541022809; cv=none; d=google.com; s=arc-20160816; b=mjwGQJaQ0JKe3O5NKTG/lEZ9qFWyrba3kJGfyS6q0iejPlaGqnDbPu6UeQJfwOrj6+ +7Hh2s/RZJsEQEZRZEHDm9cjgqQONYClj5MDYtx4emPNIEOrSPVtzTglhH6+HbQo0lSf xW3ROHXvvcVJgOsvcaZkPs99aL/o+SEbb4lJom/r/ZVu6HFI44JXjR71vILEuyHiWB21 Q3tXueMaI7Y6s3DKHRvW6us0GHtqA2GmrYj6QKO2iBz39LF/QTpzQszRF4VQwLE6fbDi /Dk6rra2o6WjQE9CzRgS+uFv+0/V/aChv1QzA2TWHlMKrtrETpI3czCSFr0zZoDLqZ0D KKdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=9Y1RtC7a//bD6nhJAolmd7KfQi0hetRzg8L+qGggbco=; b=MP76t1L9JLagkOCiePq/rxwqaOTeBKqKG6IJfU8Latk80W2K/qHGYAmG3/uudl0deG OXkRuTzNjQiZpM8MF86oozadKzGFLTdBlgHZpoaDBBWMwkHLkBkEHOEbNJyKLJ+dpW5W DcbsFwBZpEp5GL4rI4Crr+m8MCl0X3DufRmZTbKLay9HQTRPj8WvPC55eFqJYtFaU/A0 yP8uOl46DbEa47OgccfTRjbM8Kev7WhPv9YKYb6W2zfICg8RTfMfyw2q59SeRxjOYMkQ GIl0jytvkb2DM18QG7pzbQv0ZlkL3Veh7Ukq+MDDBaWOEke6mAIOEBhPIes3aRdypEIG 5wJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@as-electronics.de header.s=strato-dkim-0002 header.b=ELu9BL15; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11-v6si22268283pgm.102.2018.10.31.14.53.12; Wed, 31 Oct 2018 14:53:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@as-electronics.de header.s=strato-dkim-0002 header.b=ELu9BL15; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726220AbeKAGwg (ORCPT + 99 others); Thu, 1 Nov 2018 02:52:36 -0400 Received: from mo4-p05-ob.smtp.rzone.de ([85.215.255.131]:26051 "EHLO mo4-p05-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbeKAGwg (ORCPT ); Thu, 1 Nov 2018 02:52:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1541022759; s=strato-dkim-0002; d=as-electronics.de; h=Message-Id:Date:Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=9Y1RtC7a//bD6nhJAolmd7KfQi0hetRzg8L+qGggbco=; b=ELu9BL15qZpLL7uG59LPHLPORzOE5jyZctqRMWsolkM/KYIm5po/eljoaesQvytyYw KmsMCzQS0fOVaUBk0PA3G5WuV8MQXE1ph1cLQ4AuJdRRn7nU7uuRGm1GW8Ddo+0r3ykI B7c6wD6g60HG20sOzrslo7zEMrt0WSqkg6De7dvnyZwpB/Y/pglAkdj2OSwmZcPUyW5r SG52AqcW5s1tpB5kyZV9mQCYAr7bcHjA1IdwJOzBdUKuIhLd+XUliaNvTBC6FleWKlan 5OPIAbTqM61AOJj70HO9S/JEtqFCSiHbqEHOgP67LwUixwmRmbfhBXCCCAh2YprC+9x9 N+qQ== X-RZG-AUTH: ":LX8JdEmkW/4tAFwMkcNJIloh1hrA5u3owhPk7bdT5Fx22AatU+eLaHfutoZdl+X9BETxn4/4+IVqx+QKE8uPUyz7H84id4F0yi4r+BiOwjaTFJDezg==" X-RZG-CLASS-ID: mo05 Received: from fs-work.fritz.box by smtp.strato.de (RZmta 44.3 AUTH) with ESMTPSA id j097e4u9VLqb3bC (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 31 Oct 2018 22:52:37 +0100 (CET) From: Frieder Schrempf To: steve.glendinning@shawell.net, UNGLinuxDriver@microchip.com Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Frieder Schrempf , stable@vger.kernel.org Subject: [PATCH v2] usbnet: smsc95xx: disable carrier check while suspending Date: Wed, 31 Oct 2018 22:52:19 +0100 Message-Id: <1541022739-24678-1-git-send-email-frieder.schrempf@kontron.de> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need to make sure, that the carrier check polling is disabled while suspending. Otherwise we can end up with usbnet_read_cmd() being issued when only usbnet_read_cmd_nopm() is allowed. If this happens, read operations lock up. Fixes: d69d169493 ("usbnet: smsc95xx: fix link detection for disabled autonegotiation") Cc: Signed-off-by: Frieder Schrempf --- Changes in v2: * move cancel_delayed_work_sync() to correct error path drivers/net/usb/smsc95xx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 262e7a3..2d17f3b 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -1598,6 +1598,8 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) return ret; } + cancel_delayed_work_sync(&pdata->carrier_check); + if (pdata->suspend_flags) { netdev_warn(dev->net, "error during last resume\n"); pdata->suspend_flags = 0; @@ -1840,6 +1842,11 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) */ if (ret && PMSG_IS_AUTO(message)) usbnet_resume(intf); + + if (ret) + schedule_delayed_work(&pdata->carrier_check, + CARRIER_CHECK_DELAY); + return ret; } -- 2.7.4