From patchwork Wed May 26 18:00:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 448520 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D852DC47082 for ; Wed, 26 May 2021 18:01:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8AF3613F0 for ; Wed, 26 May 2021 18:01:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234013AbhEZSDE (ORCPT ); Wed, 26 May 2021 14:03:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233378AbhEZSDC (ORCPT ); Wed, 26 May 2021 14:03:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6FC15611C2; Wed, 26 May 2021 18:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622052091; bh=spI6wnpdljd5in/X7+N2RYCH//J+BMXhffbP7RA4Ijs=; h=From:To:Cc:Subject:Date:From; b=PVuXLDjra+WjF1t2uvohTK74BwG6t7WjTWT8mMXEDyDUIy3BH0eztPdRXn+/JFSti Vz0CzUdzbNLuEzlwf8Fem0ANTod8ybtAz8H7iRDnBHCBVr/aTtLrERfEMeoRN8lh4s Ettqa4bQOeU35MvjnyZlgB/RmuLC2G7spj20xQzZA/bGS/fwKTg4bvefypMPsOfbm9 xPlwXY4cM5I2EFHeBJZ2rdc7/Y47lE13ASpRaQcKfaz5CJK3U7d8B0KQPOokodK/p4 oi5Pfr5Ejq553HfxFQhi7o2w4nWOw8TaGZB1R+FFyOaSkCaS+uoRXzSv8cFJpQxmpC exEl4NE9stwZw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: linux-leds@vger.kernel.org Cc: netdev@vger.kernel.org, Pavel Machek , Dan Murphy , Russell King , Andrew Lunn , Matthias Schiffer , Jacek Anaszewski , Mauro Carvalho Chehab , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH leds v1 0/5] Add support for offloading netdev trigger to HW Date: Wed, 26 May 2021 20:00:15 +0200 Message-Id: <20210526180020.13557-1-kabel@kernel.org> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Hello, I am sending the first non-RFC version of the series adding support for offloading LED triggers to HW, with the netdev trigger being the first user. I have addressed the issues with the RFC version from October. This version only implements the offloading API and adds support for offloading to the netdev trigger. In the RFC I also added one user of this API (Marvell ethernet PHY driver). I plan to continue the work on those patches once the offloading API is finally merged. Also, there is now other possible user for this API: leds-nuc driver by Mauro. Changes since RFC: - split the patch adding HW offloading support to netdev trigger into several separate patches (suggested by Pavel): 1. move trigger data structure to include/linux/ledtrig.h 2. support HW offloading 3. change spinlock to mutex - fixed bug where the .offloaded variable was not set to false when offloading was disabled (suggested by Pavel) - removed the code saving one call to set_baseline_state() on the NETDEV_CHANGE event. It is not needed, the trigger_offload() method can handle this situation on its own (suggested by Pavel) - documentation now explicitly says that when offloading is being disabled, the function must return 0 (no error) (suggested by Pavel) Marek BehĂșn (5): leds: trigger: netdev: don't explicitly zero kzalloced data leds: trigger: add API for HW offloading of triggers leds: trigger: netdev: move trigger data structure to global include dir leds: trigger: netdev: support HW offloading leds: trigger: netdev: change spinlock to mutex Documentation/leds/leds-class.rst | 22 +++++++++++++ drivers/leds/led-triggers.c | 1 + drivers/leds/trigger/ledtrig-netdev.c | 47 ++++++++------------------- include/linux/leds.h | 29 +++++++++++++++++ include/linux/ledtrig.h | 40 +++++++++++++++++++++++ 5 files changed, 105 insertions(+), 34 deletions(-) create mode 100644 include/linux/ledtrig.h Reviewed-by: Andrew Lunn