From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no 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 3AFC1C282DD for ; Tue, 7 Jan 2020 19:15:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E313208C4 for ; Tue, 7 Jan 2020 19:15:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rkQzotOI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728821AbgAGTPM (ORCPT ); Tue, 7 Jan 2020 14:15:12 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:34675 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728652AbgAGTPM (ORCPT ); Tue, 7 Jan 2020 14:15:12 -0500 Received: by mail-io1-f68.google.com with SMTP id z193so539853iof.1; Tue, 07 Jan 2020 11:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yl2wbUAzHAKbcOb1Vl7UvKqELmoqXyVI0Xh3B+s9l6w=; b=rkQzotOI2WHHWwl7HXrjtEqiFBUizAnXJy0V8EQAuovXuZcIet+WvPqNR5SjCRKpX3 RBOmcSr49Rvp4qGRrH8iXEmGIh1XxFKeoUYJC3G0jk3Ln6y1IfZjD6/eLB3cwp6f9L8B V5xp35Kp4/+p+M+E/8RZ7RVnE289Ouaw8GJ/JTCsju3xsMP9NfaE8X4KXapOYPEOFbx9 8c1UEuszme5mHl5SDsWoFPTH89wgrj0jW9rjSb06Enjkys1L2KrVbLlRB6qEJiCUkvjm jTv08XipmW3TZppSYqz1ljOQawAKLULX/rRIeXP6mAV1b6DoU12kV8x5Uzfj0ZhR0DV6 WhCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yl2wbUAzHAKbcOb1Vl7UvKqELmoqXyVI0Xh3B+s9l6w=; b=j5QiUShOfDHIRnT9AKN1VJ+RPrMDSwRcB7Xy6rZQezNLQkngJWPZhyymAbOaLJx3iA Wr0Vn9RscRWCmFzPEchSq+wL+PRpywbOKuAyXuhj0o2xL9tQBSDJgkQBdun0rArpx7p4 fmAQgNfp/jXABGvRxh+9qjhEG9NIe0hEuHOJpz+HYKURf3pI2OZJ7CWVifgNOfb1/2r+ bAgBDQAQXgDQv4j6idLYP/P0Hu/W9c/2e9VxMFSLInxMeICbC1edAt5GYMaDySeiXjcP 8B8KT6M8Df5+7AMYxvOeiB3OAyP8PE6gS7UM8Q4uWmh6R0ca90O80lDAnA3wlZ+cZeL/ mrpg== X-Gm-Message-State: APjAAAWWvI0TZUFyjMqa0s7dRD/ankYDFiHSiQ8xBIdLFdhS7qNNlp9P stmD1dEj6srUe7qWW+OrcSUm0/Fg3q3S2epWh1n0wfONJ3A= X-Google-Smtp-Source: APXvYqz9PvnXo6JBf/ETXrEq1+jj6hv8iMvI1zUApsw3LhkJjvDhAUAxswe1B7GebdiWNs1qbym12yJE7R7vujQvTMM= X-Received: by 2002:a6b:c8c8:: with SMTP id y191mr430846iof.104.1578424511057; Tue, 07 Jan 2020 11:15:11 -0800 (PST) MIME-Version: 1.0 References: <20200106203700.21009-1-tony@atomide.com> In-Reply-To: From: Frank Lee Date: Wed, 8 Jan 2020 03:14:59 +0800 Message-ID: Subject: Re: [PATCH] clocksource: timer-ti-dm: Fix regression To: Olof Johansson Cc: Tony Lindgren , Daniel Lezcano , Thomas Gleixner , Linux Kernel Mailing List , linux-omap , Linux ARM Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 7, 2020 at 5:07 AM Olof Johansson wrote: > > On Mon, Jan 6, 2020 at 12:37 PM Tony Lindgren wrote: > > > > Clean-up commit 8c82723414d5 ("clocksource/drivers/timer-ti-dm: Switch to > > platform_get_irq") caused a regression where we now try to access > > uninitialized data for timer: > > > > drivers/clocksource/timer-ti-dm.c: In function 'omap_dm_timer_probe': > > drivers/clocksource/timer-ti-dm.c:798:13: warning: 'timer' may be used > > uninitialized in this function [-Wmaybe-uninitialized] > > > > On boot we now get: > > > > Unable to handle kernel NULL pointer dereference at virtual address > > 00000004 > > ... > > (omap_dm_timer_probe) from [] (platform_drv_probe+0x48/0x98) > > (platform_drv_probe) from [] (really_probe+0x1dc/0x348) > > (really_probe) from [] (driver_probe_device+0x5c/0x160) > > > > Let's fix the issue by moving platform_get_irq to happen after timer has > > been allocated. > > > > Fixes: 8c82723414d5 ("clocksource/drivers/timer-ti-dm: Switch to platform_get_irq") > > Cc: Yangtao Li > > Signed-off-by: Tony Lindgren > > Acked-by: Olof Johansson Acked-by: Yangtao Li I am sorry. I will pay attention next time. > > > --- > > > > I did not notice simlar issue with other patches in the series, but > > please do double check Yangtao. > > Yeah, this even seems to be caught at build (but our builds have been > so noisy with warnings lately that they're hard to spot): > > /build/drivers/clocksource/timer-ti-dm.c: In function 'omap_dm_timer_probe': > /build/drivers/clocksource/timer-ti-dm.c:798:13: warning: 'timer' may > be used uninitialized in this function [-Wmaybe-uninitialized] > 798 | timer->irq = platform_get_irq(pdev, 0); > | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > -Olof