From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 268103AD53F for ; Mon, 6 Jul 2026 17:35:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783359346; cv=none; b=KBvO3N8PmESttF1XAzzhRDpof6sGgAak81XI7Q5sckQZZ/7YhjN56RZ2wWsjWtaRjkfDj3+zYXCNmLKj9T4qY472MWcGb4FebmTQkXvyO/FujutOPSiWbRtC+s7ogevSgizH3xFCEP7rZRGsz9ACu0/DdzFuMOOIby4jtpLOheQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783359346; c=relaxed/simple; bh=iE9Rqytq9j4TtYnjqooQxruw/aEebfL0s2eGNLX3cws=; h=Date:To:From:Subject:Message-Id; b=iQwGtpCHpHV5O5eijW6ChJL1We8lH3vojuFlLwVUAXs3MGTfPRkLMt9/dW5b/MLPdSyK2Can4E5Ze/0DlMWja1REvupir3gkQNy4LkOc1tyw8f3Cy26q8vGhsqu4jUsf8jaQQ7nEPH8Z3C6CXbkoxJk8d8XrMSuodPBsyWBQzfk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=yW/YhykA; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="yW/YhykA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A03D71F000E9; Mon, 6 Jul 2026 17:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783359344; bh=3IO1tBwfTt7LO5Bh6dVrjJO0MFn8h3L96YqlNGz4gRw=; h=Date:To:From:Subject; b=yW/YhykAribxfMl3RvYzjmSlfGlIMc9YgHdia0wBXIX813b4Os7MomQtsL3CTte1z sgO25nLsgy+ijWuUE/VkxBJ5zhabgDE5UK9ercxflOjdjekpRn9jOYTi91PL8lhstR x3DjUYo5ilrmOIBXEfkUjAIvrMzbLZhLSKarga+k= Date: Mon, 06 Jul 2026 10:35:44 -0700 To: mm-commits@vger.kernel.org,giometti@enneenne.com,calvin@wbinvd.org,akpm@linux-foundation.org From: Andrew Morton Subject: + pps-gpio-remove-dead-capture_clear-code.patch added to mm-nonmm-unstable branch Message-Id: <20260706173544.A03D71F000E9@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: pps-gpio: remove dead capture_clear code has been added to the -mm mm-nonmm-unstable branch. Its filename is pps-gpio-remove-dead-capture_clear-code.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/pps-gpio-remove-dead-capture_clear-code.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Calvin Owens Subject: pps-gpio: remove dead capture_clear code Date: Mon, 6 Jul 2026 10:19:07 -0700 The capture_clear field is never set, and all code conditional on it being set has been unreachable since the platform data logic was removed from pps-gpio in ee89646619ba ("pps: clients: gpio: Get rid of legacy platform data"). I think the only logical thing to do here is to remove it all, since no in-tree code ever actually used it in the first place, and it has been completely dead code for over five years (since v5.13). Sashiko asked some questions about the gpiod_get_value() call which caused me to look deeper and figure this out, but it did not actually notice capture_clear is never set. Link: https://lore.kernel.org/f70196bafcf75d9782dd36ed784e42345b6e8a1b.1783355507.git.calvin@wbinvd.org Fixes: ee89646619ba ("pps: clients: gpio: Get rid of legacy platform data") Signed-off-by: Calvin Owens Closes: https://sashiko.dev/#/patchset/cover.1779733602.git.calvin%40wbinvd.org?part=1 Acked-by: Rodolfo Giometti Signed-off-by: Andrew Morton --- drivers/pps/clients/pps-gpio.c | 35 ++----------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) --- a/drivers/pps/clients/pps-gpio.c~pps-gpio-remove-dead-capture_clear-code +++ a/drivers/pps/clients/pps-gpio.c @@ -32,7 +32,6 @@ struct pps_gpio_device_data { struct gpio_desc *echo_pin; struct timer_list echo_timer; /* timer to reset echo active state */ bool assert_falling_edge; - bool capture_clear; unsigned int echo_active_ms; /* PPS echo active duration */ unsigned long echo_timeout; /* timer timeout value in jiffies */ struct pps_event_time ts; /* timestamp captured in hardirq */ @@ -62,19 +61,8 @@ static irqreturn_t pps_gpio_irq_hardirq( static irqreturn_t pps_gpio_irq_thread(int irq, void *data) { struct pps_gpio_device_data *info = data; - int rising_edge; - rising_edge = info->capture_clear ? - gpiod_get_value(info->gpio_pin) : !info->assert_falling_edge; - if ((rising_edge && !info->assert_falling_edge) || - (!rising_edge && info->assert_falling_edge)) - pps_event(info->pps, &info->ts, PPS_CAPTUREASSERT, data); - else if (info->capture_clear && - ((rising_edge && info->assert_falling_edge) || - (!rising_edge && !info->assert_falling_edge))) - pps_event(info->pps, &info->ts, PPS_CAPTURECLEAR, data); - else - dev_warn_ratelimited(&info->pps->dev, "IRQ did not trigger any PPS event\n"); + pps_event(info->pps, &info->ts, PPS_CAPTUREASSERT, data); return IRQ_HANDLED; } @@ -90,11 +78,6 @@ static void pps_gpio_echo(struct pps_dev if (pps->params.mode & PPS_ECHOASSERT) gpiod_set_value(info->echo_pin, 1); break; - - case PPS_CAPTURECLEAR: - if (pps->params.mode & PPS_ECHOCLEAR) - gpiod_set_value(info->echo_pin, 1); - break; } /* fire the timer */ @@ -156,15 +139,8 @@ static int pps_gpio_setup(struct device static unsigned long get_irqf_trigger_flags(const struct pps_gpio_device_data *data) { - unsigned long flags = data->assert_falling_edge ? - IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING; - - if (data->capture_clear) { - flags |= ((flags & IRQF_TRIGGER_RISING) ? - IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING); - } - - return flags; + return data->assert_falling_edge ? IRQF_TRIGGER_FALLING : + IRQF_TRIGGER_RISING; } static int pps_gpio_probe(struct platform_device *pdev) @@ -197,9 +173,6 @@ static int pps_gpio_probe(struct platfor /* initialize PPS specific parts of the bookkeeping data structure. */ data->info.mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT | PPS_ECHOASSERT | PPS_CANWAIT | PPS_TSFMT_TSPEC; - if (data->capture_clear) - data->info.mode |= PPS_CAPTURECLEAR | PPS_OFFSETCLEAR | - PPS_ECHOCLEAR; data->info.owner = THIS_MODULE; snprintf(data->info.name, PPS_MAX_NAME_LEN - 1, "%s.%d", pdev->name, pdev->id); @@ -211,8 +184,6 @@ static int pps_gpio_probe(struct platfor /* register PPS source */ pps_default_params = PPS_CAPTUREASSERT | PPS_OFFSETASSERT; - if (data->capture_clear) - pps_default_params |= PPS_CAPTURECLEAR | PPS_OFFSETCLEAR; data->pps = pps_register_source(&data->info, pps_default_params); if (IS_ERR(data->pps)) { dev_err(dev, "failed to register IRQ %d as PPS source\n", _ Patches currently in -mm which might be from calvin@wbinvd.org are pps-dont-try-to-wait-for-negative-timeouts-in-pps_fetch.patch pps-dont-allow-pps_kc_bind-on-removed-devices.patch pps-gpio-remove-dead-capture_clear-code.patch