Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp547941ybz; Fri, 17 Apr 2020 06:01:09 -0700 (PDT) X-Google-Smtp-Source: APiQypIeGsn9FAvGlVCby3Hay8oqVtKtMr+HBAANjQLuAAfomOpn+gytzk/bzRyaT0qvP8vsvbqv X-Received: by 2002:a17:906:2548:: with SMTP id j8mr2837029ejb.378.1587128468956; Fri, 17 Apr 2020 06:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587128468; cv=none; d=google.com; s=arc-20160816; b=PIkFN1bHB8oBFKbl6+HjI7kRMxr6vxHII3zudONVu1bnfysaS+Oe0+qJ0LTobLb+Yv XTnO4caghJD3U8gEJ/GmJzSUOWcl1ZaMFs4rSDfRVtwgcRSsPezTdmc7n8et9rqxMlWS cTQx5lPMqf2O3vT8bZID9wL2kzVjUGWvoIog+F3z5E4D1Vc07Ze29HEumpWiwtPu/kXb 2eQciTsHoWVVAG/YUC3K9tqyDPyDZ2feEi9uvX/+RGntfRd8lPxq9j0ZWVJM7/gFkdYr TW0Be+ZFOzasbXcUYveu1QtKBhQSkbOQGxp4F8m8dOSCeTitQh+Q2Whx88Lnxbx/zyae Bs4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:ironport-sdr :dkim-signature; bh=4Q0h4mBHg/3InZWd3fahyPxAG3o8Hiq9rvfV1cBFcbM=; b=EBwLrMRE3k2XN/YAMRjF7N6BRoxoaQYeGW3OX30QC29gkMj6bOHvNp6Mq0rngRBTdM yRecORd40oCt9t/6o2AZkNlPj1s3+aO8a24gxRa2g9U6p9wA5pX3tn1ljhwROfuxPYnB ZmaJZkv+zRYDdp7k6Famaex2JIPyxCrrinA0fqaO9xz2Hq5aUmK3lRalxh4t8V0JYHsT FMDlLbQTvzj9MLFMj4ggQMkraA2oAo5I9exs9aYDGpWJJN7LE6sURQ3ezKq38qJXKm8D /Vn5KC54KPn8KBIR1f+uvnmkKL26h/2oGjq9h4J3giZB04iMmHN2OWq3uyKjhuyoeuU6 PIwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=CSeYgX9X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si7647258ejx.280.2020.04.17.06.00.45; Fri, 17 Apr 2020 06:01:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=CSeYgX9X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729923AbgDQM5j (ORCPT + 99 others); Fri, 17 Apr 2020 08:57:39 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:48125 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729034AbgDQM5j (ORCPT ); Fri, 17 Apr 2020 08:57:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1587128258; x=1618664258; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=Ew4XnWdKx8Yo/vg5CuEUoLqg3uZ1q1ugduFZ1gg4Zo0=; b=CSeYgX9Xl01m84dldnWoCkbNrv+QjuKPi9xOZYkGdMDXGmjW3iGKMIjS L0mNzWl0+gxE/CiE6zHlAkkXE4XttJOOtDO2lqRL/EBXV/bk2WV5FcPZ1 OPwCTjioMyFI6xUVnSLm3620ELmfonDDK8vLMSu5uM52wTadHiq5jvPda UvmZ/d7pKKAYUbb3zG6cC3fkJwY0+tOuhafeOLltMmuC878aLAv/yujkQ zjoLQfPFKolQROXyLvNYuAoYYppxiAkHev/DovV1TyzTXKt2wPkNe+IkD 9Iai9ZskD67hc96T4egCT8fPjX6HCxcH50vh2kF/0eX80bNW3glBGRxv2 w==; IronPort-SDR: 0mHhU6xW5jYa0gqmqanFE4tSK3UAVzOjw5acDrYaN7LBhfWb2ovNjS/kDasbC4xXs5LIKWQPh7 8VSh2K2JUOckp2khKniaon5rvj0lFIvNq5rOIALJkLXowIIMQo/lZPgHk/IbxioFj2GCqVHYfj llBltPxhXq8/XnDfoeXkdyfMjQJK0Mwbl7jVzwCjx/rUvLttPnllJTXPH0C71xPls41rQ12wz5 v4nt8j/10W4Aq2dXuHy4RIPGYSd4HOHEm2rez52b+GOKYzJeHFon/tyBOShuntwjlA+gA+FipR 3Jc= X-IronPort-AV: E=Sophos;i="5.72,395,1580799600"; d="scan'208";a="9536051" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Apr 2020 05:57:38 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 17 Apr 2020 05:57:37 -0700 Received: from [10.205.29.56] (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 17 Apr 2020 05:57:12 -0700 Subject: Re: [PATCH 4/5] net: macb: WoL support for GEM type of Ethernet controller To: Florian Fainelli , , , "Claudiu Beznea" , CC: , "David S. Miller" , Alexandre Belloni , , , , , , References: <56bb7a742093cec160c4465c808778a14b2607e7.1587058078.git.nicolas.ferre@microchip.com> <6fc99e01-6d64-4248-3627-aa14a914df72@gmail.com> From: Nicolas Ferre Organization: microchip Message-ID: Date: Fri, 17 Apr 2020 14:57:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <6fc99e01-6d64-4248-3627-aa14a914df72@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Florian, Thank you for your review of the series! On 16/04/2020 at 21:25, Florian Fainelli wrote: > On 4/16/2020 10:44 AM, nicolas.ferre@microchip.com wrote: >> From: Nicolas Ferre >> >> Adapt the Wake-on-Lan feature to the Cadence GEM Ethernet controller. >> This controller has different register layout and cannot be handled by >> previous code. >> We disable completely interrupts on all the queues but the queue 0. >> Handling of WoL interrupt is done in another interrupt handler >> positioned depending on the controller version used, just between >> suspend() and resume() calls. >> It allows to lower pressure on the generic interrupt hot path by >> removing the need to handle 2 tests for each IRQ: the first figuring out >> the controller revision, the second for actually knowing if the WoL bit >> is set. >> >> Queue management in suspend()/resume() functions inspired from RFC patch >> by Harini Katakam , thanks! >> >> Signed-off-by: Nicolas Ferre >> --- > > [snip] > >> >> +static irqreturn_t gem_wol_interrupt(int irq, void *dev_id) >> +{ >> + struct macb_queue *queue = dev_id; >> + struct macb *bp = queue->bp; >> + u32 status; >> + >> + status = queue_readl(queue, ISR); >> + >> + if (unlikely(!status)) >> + return IRQ_NONE; >> + >> + spin_lock(&bp->lock); >> + >> + if (status & GEM_BIT(WOL)) { >> + queue_writel(queue, IDR, GEM_BIT(WOL)); >> + gem_writel(bp, WOL, 0); >> + netdev_vdbg(bp->dev, "GEM WoL: queue = %u, isr = 0x%08lx\n", >> + (unsigned int)(queue - bp->queues), >> + (unsigned long)status); >> + if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE) >> + queue_writel(queue, ISR, GEM_BIT(WOL)); > > You would also need a pm_wakeup_event() call here to record that this > device did wake-up the system. Oh yes, indeed that's missing. I'll add it to my v2. Thanks. Best regards, Nicolas -- Nicolas Ferre