Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1692155pxb; Wed, 9 Feb 2022 02:19:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzP2Em0DyiMR8a74Fwqma7CrmsOApoKKbjjgPpW0ZCqpJWoA8yviMqPAfzfh5+FA58lNt/T X-Received: by 2002:a17:903:240a:: with SMTP id e10mr1466482plo.31.1644401989328; Wed, 09 Feb 2022 02:19:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644401989; cv=none; d=google.com; s=arc-20160816; b=vvm3ivUQ5fjZBaRHPKxkF5vkT8dxvGoJTk7L0MZripw/EsC5GGTJ4DF6mSbn4/DTrA 0w3DQezUToAwpmxfU6co2eG9Qe/w1CFrOKcCJQakTMwW1HDxC8k/sFSqA1PQbZ+HCQfG JSJGZrlkVLWuseJzyYO8MtNSIZaG17mcXpZjYVSzBthWuWXLRbIsRahN1QH23LOzQtuO U61xlEYnF8Eo6wwtnSPmnKkFaUFdr2lvOTFM3OjbqD5mX20Xj+gCvfkTn04hTPmGLN7x Ce7F0mWkF0LUzlyqOqFj0IpPWCrhybDiuJ0mzl6HPSNwPz5kQI/xQ1Mwwm/P/NgmIDRS Qu1A== 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=v3+9Y32cf+Ax3G/iWkV5vM08y7nrpNijPcp38VaOUAE=; b=X235p1SHHSKaKwaKLnQBOVO7mbxrbjzsZVxzferkPOqaGX+ItRIu02+FEianlNLzFp 7nyaO/1DnwCn3jy4L7J/m2rJkYtNgg0qfatdhuw+ki/c/0oNTwXobOtiKy3u/RvHbI0l DV6KIVRIbnHeZJfTKA/FvW+KZIGDH7oEfYNtsY6F/EOMIONbk9U4PI1oqL2eZI8Hh4we mGWvEB+droekENdg9515PwvR/r980dbSv46r07FBjZs9Dqkm3RTbN06SinG5IMIOgPwx L+XNaVtYhsLNKm72vC50sNAJyLySS8wxk0bjNpAgmI1wpBcrqziA5ywsiPm+pLHDmXgj sgFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Kw06RO75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c7si6182128plh.350.2022.02.09.02.19.36; Wed, 09 Feb 2022 02:19:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Kw06RO75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1359113AbiBHL1r (ORCPT + 99 others); Tue, 8 Feb 2022 06:27:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356333AbiBHKc2 (ORCPT ); Tue, 8 Feb 2022 05:32:28 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58749C03FEC0; Tue, 8 Feb 2022 02:32:27 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id co28so9394010edb.1; Tue, 08 Feb 2022 02:32:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v3+9Y32cf+Ax3G/iWkV5vM08y7nrpNijPcp38VaOUAE=; b=Kw06RO75rbLUFrLHJ93ga19ZxxshO5/eizKWNfLYjMLV3cJLg4d6s+I98J5q0VdCGo NS6bdVcwDSY89lrxKuzs2BAoT4Fpucs1BIEecy7QnncI/TKM2grUufsKf8mumEt7xgzB gElndbyM+A7LeU83VNqK8dqsVA2jgtQfpn0Ew0uTKWbBmFbbM9waSxznq4LOd2UFOfIi 5AoAAcr/B87VPn5AjrWpUQgsdKowxCKuJIGRJwVMstEcDgP+PZ/CajWf3g7IBNv9uLXt 1s0Ml5wnJw0nag6BMDmDNPHTcbRIdl6rALNKSZTP67OzwrJaU5Q7Edci0gw/YsRFEyCp XiQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v3+9Y32cf+Ax3G/iWkV5vM08y7nrpNijPcp38VaOUAE=; b=pYlp37jRKIhFlVBCUt9GLmcknxEzsOO1OzQ5+iBlcqzwuXhXFVDTxiM+iInwIvPgiZ FY+Ccuj8mCVzscoQ9M4wCxpLZIvwIa9VPeKCOnrfZ6+dhvnoBw3fVQ2wnmbmseoDT5ic 3LfdygKlaQIE+4YZ93iun+XiRbseuig9ynwkIGnryMkcKXxD/Yb3V+KX+ez1mPygIK3x vdk1IUs8hYOEM1PzuhOvNnG1es0tlsRHvay3nQrmloxwAz72wwCEV91WnZj7bnKYgA8i jd0nO4pNIy6aT+0Q44CcuW0KiyNnQ9IPYa4ywj4ETG2VJODz5+qvqC8AgBKy1tdvNVyn RyQw== X-Gm-Message-State: AOAM530gdBl8apMDHCHG83EFqJFWjFXFqplOlolnvDo+qwoXsP+Xgfek g/t4Qus1AhnDuI9XyVh0SmIopHrRAbrYMAz6jtY= X-Received: by 2002:a05:6402:2741:: with SMTP id z1mr3760419edd.264.1644316345736; Tue, 08 Feb 2022 02:32:25 -0800 (PST) MIME-Version: 1.0 References: <20220207232129.402882-1-athierry@redhat.com> In-Reply-To: <20220207232129.402882-1-athierry@redhat.com> From: Andy Shevchenko Date: Tue, 8 Feb 2022 12:31:49 +0200 Message-ID: Subject: Re: [PATCH v3] serial: 8250_bcm2835aux: Add ACPI support To: Adrien Thierry Cc: "open list:SERIAL DRIVERS" , linux-rpi-kernel , linux-arm Mailing List , Linux Kernel Mailing List , Jeremy Linton , Greg Kroah-Hartman , Jiri Slaby , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-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,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 On Tue, Feb 8, 2022 at 11:13 AM Adrien Thierry wrote: > > Add ACPI support to 8250_bcm2835aux driver. This makes it possible to > use the miniuart on the Raspberry Pi with the tianocore/edk2 UEFI TianoCore EDK II > firmware. ... > /* get the clock - this also enables the HW */ > - data->clk = devm_clk_get(&pdev->dev, NULL); > - if (IS_ERR(data->clk)) > - return dev_err_probe(&pdev->dev, PTR_ERR(data->clk), "could not get clk\n"); You shouldn't remove the error handling. Even if optional there may be other types of errors that need to be reported. > + data->clk = devm_clk_get_optional(&pdev->dev, NULL); ... > + bcm_data = device_get_match_data(&pdev->dev); Move this closer to the condition where it's used the first time. > + /* Some UEFI implementations (e.g. tianocore/edk2 for the Raspberry Pi) . If there are some not doing that, can we end up in the situation when for the same ID we have different offset? Also, Why not go and fix that implementation? Can you provide a DSDT excerpt to show how it looks there? TianoCore EDK II /* * Multi-line comments should look * like this. */ > + * describe the miniuart with a base address that encompasses the auxiliary > + * registers shared between the miniuart and spi. SPI > + * > + * This is due to historical reasons, see discussion here : > + * https://edk2.groups.io/g/devel/topic/87501357#84349 > + * > + * We need to add the offset between the miniuart and auxiliary > + * registers to get the real miniuart base address. > + */ > + if (bcm_data) > + offset = bcm_data->offset; ... > +static const struct acpi_device_id bcm2835aux_serial_acpi_match[] = { > + { "BCM2836", (kernel_ulong_t)&bcm2835_acpi_data }, > + { } > +}; I believe this ID is allocated by Broadcom. Can we have a confirmation, please? -- With Best Regards, Andy Shevchenko