From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932473AbcFKBBD (ORCPT ); Fri, 10 Jun 2016 21:01:03 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:33859 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752608AbcFKBBA (ORCPT ); Fri, 10 Jun 2016 21:01:00 -0400 From: Vincent Palatin To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Andrew Lunn , Douglas Anderson , Giuseppe Cavallaro , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Shunqian Zheng Subject: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Date: Fri, 10 Jun 2016 18:00:36 -0700 Message-Id: <1465606839-7722-1-git-send-email-vpalatin@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to support Wake-On-Lan when using the RK3288 integrated MAC (with an external RGMII PHY), we need to avoid shutting down the regulator of the external PHY when the MAC is suspended as it's currently done in the MAC platform code. As a first step, create independant callbacks for suspend/resume rather than re-using exit/init callbacks. So the dwmac platform driver can behave differently on suspend where it might skip shutting the PHY and at module unloading. Then update the dwmac-rk driver to switch off the PHY regulator only if we are not planning to wake up from the LAN. Finally add the PMT interrupt to the MAC device tree configuration, so we can wake up the core from it when the PHY has received the magic packet.