Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1052419rwe; Thu, 25 Aug 2022 14:32:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR4giUAraRugLZWTka39SBx9l+WVhEV69Z6amOnqnR1+eFpbEOMtf2A4pq3vuWvEClt8BO7j X-Received: by 2002:a05:6402:3509:b0:43e:d80b:44a8 with SMTP id b9-20020a056402350900b0043ed80b44a8mr4703400edd.255.1661463144224; Thu, 25 Aug 2022 14:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661463144; cv=none; d=google.com; s=arc-20160816; b=ZuHUCflkrF8SQx9vZziDT34OM/Dyu8qmXEKzx6Vd2zeTOTBiLI0G90kv6ae7/vck93 +dZUYGXwK4a5Yt2StlIernZaj2uOuEGb6FFQdfAHl6cLty85NXDaVm6MCRCS6SH9EDzb li0bjktTgW3fGIcHgo7cl7o/nJquD1w/tFADddTo6w05rvzkxImV/Hm3gygHSpUyJFo1 FgIs3uP6tXpmIQANgUibMOgrrTsea/t7qdpDqYIzXFhLvIOz54QIvA/aj68sh43goRFg 0viYYtauAGCJYJj8N4yOAUfXIR/G7JbkkZrFcYN0dGEMzEnMMx2G8BYdqU2R5bY6YlxC tp9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DXT4YXU5YfePq29aQAo5O8wvrpSNVuJynC49Ki0/9po=; b=t46XdKBSAw1gzl7LIYTrsj/hVoDet6KiAKRRxydDEV2w5oyfl+LMN1/cr3V6pe77mJ 8uCe1Q/uxqB2ETgqlhsjRtx1xBolFnda6YBTST0lc+sHuJWD6OLrwNX7RX7+XilRG9pt Od44mFlbz9fGFL4iCniO7DARdquVscviDaV7Gf6eaBp2im0kaoWy0Se/IhDolB08Bmcl vHz2srteH7l/tzJoXtsnmvcx4j1B3R+VPzvjcjo1n+Q4D7j+rKWZPESOeFp5c51eZz3+ IaJvPDRxO2/aEnZj1+uhB/aF5OWszw8mx5HMOZWuAVVvQ37lCg5A4FsRduRXmzi8lS2Z Chgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dnkzm9sr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz11-20020a1709077d8b00b00730ac298aa9si143125ejc.783.2022.08.25.14.31.51; Thu, 25 Aug 2022 14:32:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dnkzm9sr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237455AbiHYVE5 (ORCPT + 99 others); Thu, 25 Aug 2022 17:04:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232136AbiHYVEz (ORCPT ); Thu, 25 Aug 2022 17:04:55 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AC5BB1DA; Thu, 25 Aug 2022 14:04:53 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id z14-20020a7bc7ce000000b003a5db0388a8so3338525wmk.1; Thu, 25 Aug 2022 14:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=DXT4YXU5YfePq29aQAo5O8wvrpSNVuJynC49Ki0/9po=; b=dnkzm9sreAWheeae/qavwTiTCcN31riVCLaNVZYSSD1GGVEZnwz1BhpuBtRgKU54Zn 0+YPXV17eAtXDi2KkDDv5Lpeu/woF/E2S4Qpe8ABN4hVfKg1CDipFSqB931vxnt0kvlW Gh9vFaT7+ifcNaltOzHZN8pAxzpVmxErxUp5lDw+axFvYo6l6KkUNYnXJfIdjsvybvZ7 Lg35te6K++gUfFuGwGKZmlda99s6Cisu4Mw3BCNIHrPMhxie6ghNMNRASr3EHhaAPa8F BGz4hbsyj3EkWNuLUL6MIrfLl7kWFfXzSDHUjjyrCwthX97uLLutzQyPjnSaT9g51JBb zJww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=DXT4YXU5YfePq29aQAo5O8wvrpSNVuJynC49Ki0/9po=; b=26hJL2GjK8Zjnkl6f/YKPdHuNPl/Tu3vqayB6gOEKZ/M9oUIMYbS+K2jBrRgfEnmV3 LlPkDZ8wSIdxQ+cI3S4kgh1IkiFqSfcukcbVmFrnOAlugOEFaU9jRg5mamN5Svgn1C+2 ZS87NENjNUR/cWJQC1a8laqAtNqahguC9YPWnV2xNW7yWcYcCtL5QGBE/IMt6bi2q0kx 45AvdNvzWlpfmGzZrtCKWULomnaCGUK5iNE3kYd4g/X2D7eScphRr+jQRjK+w2vEHoDg NnnGHRGo1I+AZmPhiTnogRTUJwATzh9DmMAtSKP3isHd/agVXLUqepmOe/SCM0AEKuSZ Vnaw== X-Gm-Message-State: ACgBeo1yjD4vty2G19EsgBeoszfmehbJ/Fx/lyTiveBo1TEc13enQoY+ z/4IDdvK6dPEJFqqvoGYvHmr5XjyR19Xbg== X-Received: by 2002:a05:600c:2e47:b0:3a6:75fe:82a9 with SMTP id q7-20020a05600c2e4700b003a675fe82a9mr3412937wmf.189.1661461492119; Thu, 25 Aug 2022 14:04:52 -0700 (PDT) Received: from kista.localnet (82-149-1-172.dynamic.telemach.net. [82.149.1.172]) by smtp.gmail.com with ESMTPSA id i14-20020a05600c354e00b003a4f08495b7sm6953492wmq.34.2022.08.25.14.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 14:04:51 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: linux-media@vger.kernel.org, Maxime Ripard , Paul Kocialkowski , Mauro Carvalho Chehab , Greg Kroah-Hartman , Chen-Yu Tsai , Samuel Holland , Nicolas Dufresne , Dmitry Osipenko Cc: kernel@collabora.com, stable@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: Re: [PATCH v1 2/3] media: cedrus: Set the platform driver data earlier Date: Thu, 25 Aug 2022 23:04:50 +0200 Message-ID: <3448453.iIbC2pHGDl@kista> In-Reply-To: <6a8f2555-1bd4-ac81-390e-b597e3c886f6@collabora.com> References: <20220818203308.439043-1-nicolas.dufresne@collabora.com> <4733096.GXAFRqVoOG@jernej-laptop> <6a8f2555-1bd4-ac81-390e-b597e3c886f6@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne nedelja, 21. avgust 2022 ob 22:40:21 CEST je Dmitry Osipenko napisal(a): > On 8/20/22 11:25, Jernej =C5=A0krabec wrote: > > Dne petek, 19. avgust 2022 ob 17:37:20 CEST je Nicolas Dufresne=20 napisal(a): > >> Le vendredi 19 ao=C3=BBt 2022 =C3=A0 06:17 +0200, Jernej =C5=A0krabec = a =C3=A9crit : > >>> Dne =C4=8Detrtek, 18. avgust 2022 ob 22:33:07 CEST je Nicolas Dufresne > >=20 > > napisal(a): > >>>> From: Dmitry Osipenko > >>>>=20 > >>>> The cedrus_hw_resume() crashes with NULL deference on driver probe if > >>>> runtime PM is disabled because it uses platform data that hasn't been > >>>> set up yet. Fix this by setting the platform data earlier during pro= be. > >>>=20 > >>> Does it even work without PM? Maybe it would be better if Cedrus would > >>> select PM in Kconfig. > >>=20 > >> I cannot comment myself on this, but it does not seem to invalidate th= is > >> Dmitry's fix. > >=20 > > If NULL pointer dereference happens only when PM is disabled, then it > > does. I have PM always enabled and I never experienced above issue. >=20 > Originally this fix was needed when I changed cedrus_hw_probe() to do > the rpm-resume while was debugging the hang issue and then also noticed > that the !PM should be broken. It's a good common practice for all > drivers to have the drv data set early to avoid such problems, hence it > won't hurt to make this change anyways. Ok, as others pointed out, this is still a good thing, so: Acked-by: Jernej Skrabec >=20 > In practice nobody disables PM other than for debugging purposes and !PM > handling is often broken in drivers. I assume that it might be even > better to enable PM for all Allwiner SoCs and remove !PM handling from > all the affected drivers, like it was done for Tegra some time ago. >=20 Maybe in the future :) Best regards, Jernej > -- > Best regards, > Dmitry