Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp820238rwi; Mon, 31 Oct 2022 07:58:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Lb197HatxSr6toqE0flQ7qtIKzyhUvozX7RC7hNF9yInLtcWK4X2eU1S6D4tNwTqOvs8p X-Received: by 2002:a17:90b:11d5:b0:213:ce33:4a4a with SMTP id gv21-20020a17090b11d500b00213ce334a4amr8890888pjb.206.1667228335107; Mon, 31 Oct 2022 07:58:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667228335; cv=none; d=google.com; s=arc-20160816; b=q4I5xnB10lTlYjw1WZHaGoe2o7kOoi5Oyr1+WEUJ5lJSvsgrzzfGaqsn7EXNzRXgpy L8EzytzMNTWkOMHVrJ/kuHAuUMClyZCs/oVg97T2LMq8VcZCAK1GGFKU55C1ZgpM6G2h vOiNGlEx0JtrExDNzig36vtcs5ezUABMKsqowC+euU1mp7mgPfnLzZaQ8rnBrQ0i/viI iGHqoibacXFYwf9fa3Gz8EnXn3g/Ou7yuIoVOE+vjs+Sibjz2M+1eCB/OjeenBFKZWkc tsty7Q65SOBnER5FXti7gG9ZTQxkiVOvEwj6t8Znd3ql+D50dbbaOqWJ+o+8QY38r/I3 eUDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kKV7aE0TxR3j7oQ5UpL5QeWqb8LMrLP1KR71Ce0rJdQ=; b=o9ftaT5MpX7bceCrPOpDPDPZYLX+EzpheyiC/zY6o6Mlab/BczXNLjEwfMhfV9S1/n dSObgSsA8gA4bYY5ZjMpUfSfWbOfiTwT1S6PliAD4X0s9XYrOYN6zn3HX4C23e2tl8Zl U7G1JexQTfwi9Wqn9U49fSEDXNYmCFi7PF0aIX39mBcniW3F9gxtwbBYtYnrxSQos5c7 Os/awj/gsqofh0CURsKhJJeJhW9rijJ0VcHP9pSNPV8XFTYuJcTjXesYlB7XOaz4kSUK xVHVh7l4E5I5k8QesKh2CCo1QA41ZWEU/nn8MNillr3/3MeMjrdgPuXu1Z/xi/cTuREw 9Skw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Rhf10q6s; 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 x18-20020a170902ea9200b0017d9b373175si8217948plb.415.2022.10.31.07.58.41; Mon, 31 Oct 2022 07:58:55 -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=Rhf10q6s; 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 S231643AbiJaOey (ORCPT + 99 others); Mon, 31 Oct 2022 10:34:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231514AbiJaOew (ORCPT ); Mon, 31 Oct 2022 10:34:52 -0400 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F12281C7; Mon, 31 Oct 2022 07:34:51 -0700 (PDT) Received: by mail-qv1-xf30.google.com with SMTP id i12so8460748qvs.2; Mon, 31 Oct 2022 07:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kKV7aE0TxR3j7oQ5UpL5QeWqb8LMrLP1KR71Ce0rJdQ=; b=Rhf10q6s3JMCa80g+eJaEamzQZpN1yURXdbXndhTf19Lbs3ezO4iuqo9uCGZW7Qm5P OHoKidMajn+7raOR+VijMDz1lfTx5Ij4kHzoiy5yHFJetjbXtPUKr40IOUzdPieqj/JQ RIghApZkawv0hVCb5r00KXhtyRLVm2JqKOHXnh0tlHrGvUaBs8dJ5ilwrXDVyzSqewrV w67gXZBGThncWtznOjXrW65E/z9KhCBsp5JNzgC5/hXUDVWl7jrlGaGrm9uD+lASH20f eEVc2pKGC2je1ff8W3kyK9KtemtXtOpACjwljeIdHdw93OfVeDEmLhb8vp96rVVDZBTJ MnoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kKV7aE0TxR3j7oQ5UpL5QeWqb8LMrLP1KR71Ce0rJdQ=; b=IBbu/lQa6fVZhjRLtaleWndsn0qnLX6dqftGX3XdmJ0PeoZviDmkNod/mrZEfCetRA IcdrApNr2peS4r80gDoahw9bKTQepMNZM5urHCYdn6VNGD2HYWYVA6VMlUGbWp+qWyII +WTkEYqDsW1pTnHLfL+n9IQD96X6347EQtJFLAoYTlReQSkZiKCwmjS4SGt+niwJDNPt UE7k9vIg672k/2oW9MeSrvSBDjjsqiOWbhz2QSb1mATnhiZJ+9R42Ogeizrq1KDRlbU2 2lxXln40sZ/D91BcQmAAeT2B771cgy0QBGIU1ilu7GyCwYvu+YVMgIsVnK7lA8rpvlse +cfg== X-Gm-Message-State: ACrzQf1eoao/n5aGP7eqPIASrceRZ8ZqIG4H+RCfk1f8vtUyzH2Az06m 25SAFcU0/gHWX2nM+oVQhZaznopz5xaJwE14iWw= X-Received: by 2002:a0c:f00f:0:b0:4bb:6167:d338 with SMTP id z15-20020a0cf00f000000b004bb6167d338mr11256789qvk.11.1667226891093; Mon, 31 Oct 2022 07:34:51 -0700 (PDT) MIME-Version: 1.0 References: <20211217115708.882525-1-tanureal@opensource.cirrus.com> <20211217115708.882525-8-tanureal@opensource.cirrus.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 31 Oct 2022 16:34:14 +0200 Message-ID: Subject: Re: [PATCH v6 07/10] hda: cs35l41: Add support for CS35L41 in HDA systems To: Dmitry Torokhov Cc: Lucas Tanure , "Rafael J . Wysocki" , Len Brown , Hans de Goede , Mark Gross , Liam Girdwood , Jaroslav Kysela , Mark Brown , Takashi Iwai , ALSA Development Mailing List , ACPI Devel Maling List , patches@opensource.cirrus.com, Platform Driver , Linux Kernel Mailing List 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 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 On Mon, Oct 31, 2022 at 7:38 AM Dmitry Torokhov wrote: > On Thu, Jan 06, 2022 at 02:29:58PM +0200, Andy Shevchenko wrote: > > On Fri, Dec 17, 2021 at 5:45 PM Lucas Tanure > > wrote: ... > > > + cs35l41->reset_gpio = fwnode_gpiod_get_index(&adev->fwnode, "reset", cs35l41->index, > > > > Please, do not dereference fwnode pointers. > > Also, why can't you use the device instead of fwnode? > > We are doing "acpi_dev_put(adev);" a few lines above, so using adev in > the call to fwnode_gpiod_get_index() is technically use-after-free, > isn't it? Right, but I believe this is in response to the author and not to me. > Also, why can't we do > > cs35l41->reset_gpio = gpiod_get_index(acpi_dev, "reset", > cs35l41->index, > GPIOD_OUT_LOW); > > since acpi_dev is device structure corresponding to adev and we are > getting the rest of the properties from it? I remembered that I have also stumbled over that, but IIRC the point here is that ACPI tables might be broken (since the multi-instance device is a gray area to begin with). So we need clarification from Cirrus to understand what the cases they want to cover with this twisted code to get a GPIO. > I saw downthread that there was supposed to be a patch addressing > several issues raised by Andy, was it ever submitted? -- With Best Regards, Andy Shevchenko