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=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 CB930C433E2 for ; Sun, 17 May 2020 12:20:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A616B2070A for ; Sun, 17 May 2020 12:20:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="vG/oYm1r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727833AbgEQMUI (ORCPT ); Sun, 17 May 2020 08:20:08 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:45694 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727969AbgEQMUI (ORCPT ); Sun, 17 May 2020 08:20:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1589718006; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9lAqsVvAIASjKFbEhPDBxhbFVPKcLMddVhVPAD4MtNs=; b=vG/oYm1r0CrhRofO/eXELE3n5/czRaZ1Mk0pnntlYvJyV4JqsSm+HtaxMXipIy2tzyGoYL s8Ob0J1DuXgXhwqeMWHTJGIt3Y6zzy7vUxrwt9qBFhCqAtz6wHeQ7Nj9rivo8NPUWvYWnq YAtndBgSbClCsZJN0j+Vcwm4HxmvV/w= Date: Sun, 17 May 2020 14:19:54 +0200 From: Paul Cercueil Subject: Re: [PATCH 05/12] gpu/drm: Ingenic: Fix opaque pointer casted to wrong type To: Sam Ravnborg Cc: David Airlie , Daniel Vetter , Rob Herring , Greg Kroah-Hartman , "Rafael J . Wysocki" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, od@zcrc.me, dri-devel@lists.freedesktop.org Message-Id: <696HAQ.LSNC2851KFSC@crapouillou.net> In-Reply-To: <20200517062105.GD609600@ravnborg.org> References: <20200516215057.392609-1-paul@crapouillou.net> <20200516215057.392609-5-paul@crapouillou.net> <20200517062105.GD609600@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Sam, Le dim. 17 mai 2020 =E0 8:21, Sam Ravnborg a =E9crit : > On Sat, May 16, 2020 at 11:50:50PM +0200, Paul Cercueil wrote: >> The opaque pointer passed to the IRQ handler is a pointer to the >> drm_device, not a pointer to our ingenic_drm structure. >>=20 >> It still worked, because our ingenic_drm structure contains the >> drm_device as its first field, so the pointer received had the same >> value, but this was not semantically correct. >>=20 >> Cc: stable@vger.kernel.org # v5.3 >> Fixes: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx=20 >> SoCs") >> Signed-off-by: Paul Cercueil > Acked-by: Sam Ravnborg Pushed to drm-misc-fixes, thanks for the review. -Paul >> --- >> drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c=20 >> b/drivers/gpu/drm/ingenic/ingenic-drm.c >> index 0c472382a08b..97244462599b 100644 >> --- a/drivers/gpu/drm/ingenic/ingenic-drm.c >> +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c >> @@ -476,7 +476,7 @@ static int=20 >> ingenic_drm_encoder_atomic_check(struct drm_encoder *encoder, >>=20 >> static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg) >> { >> - struct ingenic_drm *priv =3D arg; >> + struct ingenic_drm *priv =3D drm_device_get_priv(arg); >> unsigned int state; >>=20 >> regmap_read(priv->map, JZ_REG_LCD_STATE, &state); >> -- >> 2.26.2 >>=20 >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel 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=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 F0F22C433DF for ; Mon, 18 May 2020 10:14:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B879720801 for ; Mon, 18 May 2020 10:14:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="vG/oYm1r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B879720801 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B3D3F6E152; Mon, 18 May 2020 10:14:40 +0000 (UTC) Received: from crapouillou.net (outils.crapouillou.net [89.234.176.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id C4A1489E1B for ; Sun, 17 May 2020 12:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1589718006; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9lAqsVvAIASjKFbEhPDBxhbFVPKcLMddVhVPAD4MtNs=; b=vG/oYm1r0CrhRofO/eXELE3n5/czRaZ1Mk0pnntlYvJyV4JqsSm+HtaxMXipIy2tzyGoYL s8Ob0J1DuXgXhwqeMWHTJGIt3Y6zzy7vUxrwt9qBFhCqAtz6wHeQ7Nj9rivo8NPUWvYWnq YAtndBgSbClCsZJN0j+Vcwm4HxmvV/w= Date: Sun, 17 May 2020 14:19:54 +0200 From: Paul Cercueil Subject: Re: [PATCH 05/12] gpu/drm: Ingenic: Fix opaque pointer casted to wrong type To: Sam Ravnborg Message-Id: <696HAQ.LSNC2851KFSC@crapouillou.net> In-Reply-To: <20200517062105.GD609600@ravnborg.org> References: <20200516215057.392609-1-paul@crapouillou.net> <20200516215057.392609-5-paul@crapouillou.net> <20200517062105.GD609600@ravnborg.org> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 18 May 2020 10:14:39 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, od@zcrc.me, "Rafael J . Wysocki" , David Airlie , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Rob Herring , dri-devel@lists.freedesktop.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Sam, Le dim. 17 mai 2020 =E0 8:21, Sam Ravnborg a =E9crit : > On Sat, May 16, 2020 at 11:50:50PM +0200, Paul Cercueil wrote: >> The opaque pointer passed to the IRQ handler is a pointer to the >> drm_device, not a pointer to our ingenic_drm structure. >> = >> It still worked, because our ingenic_drm structure contains the >> drm_device as its first field, so the pointer received had the same >> value, but this was not semantically correct. >> = >> Cc: stable@vger.kernel.org # v5.3 >> Fixes: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx = >> SoCs") >> Signed-off-by: Paul Cercueil > Acked-by: Sam Ravnborg Pushed to drm-misc-fixes, thanks for the review. -Paul >> --- >> drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> = >> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c = >> b/drivers/gpu/drm/ingenic/ingenic-drm.c >> index 0c472382a08b..97244462599b 100644 >> --- a/drivers/gpu/drm/ingenic/ingenic-drm.c >> +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c >> @@ -476,7 +476,7 @@ static int = >> ingenic_drm_encoder_atomic_check(struct drm_encoder *encoder, >> = >> static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg) >> { >> - struct ingenic_drm *priv =3D arg; >> + struct ingenic_drm *priv =3D drm_device_get_priv(arg); >> unsigned int state; >> = >> regmap_read(priv->map, JZ_REG_LCD_STATE, &state); >> -- >> 2.26.2 >> = >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel