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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 97D7CC433E0 for ; Tue, 16 Feb 2021 10:20:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 628B564DAF for ; Tue, 16 Feb 2021 10:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbhBPKUA (ORCPT ); Tue, 16 Feb 2021 05:20:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:56818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbhBPKTy (ORCPT ); Tue, 16 Feb 2021 05:19:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4744164DE0; Tue, 16 Feb 2021 10:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613470753; bh=eY3mTlj51VDYTzN/HdqXV4UVbM576klVPmjNaB7BtAE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rh+goMEe6guEquXfbwF4p/banP+VlKviFUn9KeZpAkmv8y3GfNI82iVu6B1a0WUIE yJXvBuYad7dsukXs4KvDRmvXIVsDfZ2sejfXfi6+ftkhGMG4DMhIPUAwPqwRBZRAJi ebWB2ntvXZXlfawafzxB6dth2N7fvOd1RLc4p1UBmcX9mAw4yMy5Ti60xRd+kESDKV eTOKRF3HYietQXaMe4/gAyeyoGuZ+sYPvKg1bvfg1nKDEURdM8dHeMcmbLM+Ee+dLY u+/8w2/vM+CRK1ouUKeGOsAmYKxkQifPC9ZSdDVRPnP9JZsMRdP2eCXEpyVlHJkDHn ugTurxEvzFh5g== Received: by mail-ot1-f43.google.com with SMTP id q4so8538998otm.9; Tue, 16 Feb 2021 02:19:13 -0800 (PST) X-Gm-Message-State: AOAM533Cw8RUVddswmW23uki/i7swCFFjVZ4QejdSv+x+ih+PvJNQr2Q sxno6rzhQQ0TSYvEb1DkUz+NULfZ2ORh9g9VzQk= X-Google-Smtp-Source: ABdhPJzeQJWVf1L+wYwbHinVXK9KvU0k5wankDGEsyl+37JLP8P0mp30rvYs7XPlpwchpnDqw4uCBBoiq7ecsbMHDRU= X-Received: by 2002:a9d:6c11:: with SMTP id f17mr14202610otq.210.1613470752538; Tue, 16 Feb 2021 02:19:12 -0800 (PST) MIME-Version: 1.0 References: <20210215121713.57687-1-marcan@marcan.st> <20210215121713.57687-24-marcan@marcan.st> <20210215191748.uhus2e6gclkwgjo5@kozik-lap> In-Reply-To: <20210215191748.uhus2e6gclkwgjo5@kozik-lap> From: Arnd Bergmann Date: Tue, 16 Feb 2021 11:18:56 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 23/25] tty: serial: samsung_tty: Add earlycon support for Apple UARTs To: Krzysztof Kozlowski Cc: Hector Martin , Linux ARM , Marc Zyngier , Rob Herring , Olof Johansson , Mark Kettenis , Tony Lindgren , Mohamed Mediouni , Stan Skowronek , Alexander Graf , Will Deacon , Linus Walleij , Mark Rutland , DTML , "linux-kernel@vger.kernel.org" , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 15, 2021 at 8:19 PM Krzysztof Kozlowski wrote: > On Mon, Feb 15, 2021 at 09:17:11PM +0900, Hector Martin wrote: > > + > > +/* Apple S5L */ > > +static int __init apple_s5l_early_console_setup(struct earlycon_device *device, > > + const char *opt) > > +{ > > + /* Close enough to S3C2410 for earlycon... */ > > + device->port.private_data = &s3c2410_early_console_data; > > + > > +#ifdef CONFIG_ARM64 > > if IS_ENABLED() > (unless it cannot be used due to missing symbol?) > > > + /* ... but we need to override the existing fixmap entry as nGnRnE */ > > + __set_fixmap(FIX_EARLYCON_MEM_BASE, device->port.mapbase, > > + __pgprot(PROT_DEVICE_nGnRnE)); > > +#endif It has to be a preprocessor conditional because PROT_DEVICE_nGnRnE is only defined on arm64. We could add a FIXMAP_PAGE_NONPOSTED alias for it that defaults to FIXMAP_PAGE_IO, but in the end this is really an architecture specific thing and I think leaving it guarded by the architecture is appropriate. > > + return samsung_early_console_setup(device, opt); > > Don't you need to handle the error code - set PROT_DEFAULT() or whatever > was there before? __set_fixmap() has no return value, it just writes a page table entry and does not fail. Arnd 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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 90AEAC433E0 for ; Tue, 16 Feb 2021 10:21:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 40EC464D99 for ; Tue, 16 Feb 2021 10:21:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40EC464D99 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9r8O3kLvpEEAoVyb11SsDZ5i5xlhvOazmgZsXzaXpM0=; b=W5Q8PmDwnnK2EzLeptMRbSabI uczZZ6YoOaaEuckr1ImqZNVbtAybpJ/NjMGrrm501LkhNQmz/BjPaJUDMLb8Rcl1hza2HwMhn/0jD DYR1vkswPRUhjVKWCeN1caNqA2+ifu5YMvq0PeGStWRD0RWfvdnzAu0BkaBe+VGoCMi2scuA4/Uvs WG/3Bowl8MpbJujQdVMmPNOMfjC0ZokM6FMrXiXpBJbTUhzGzISLPeQr0hI3qPLODdL/c4aCZob65 L3qsx4kWS6jW8q7kP8vk+GppCgC5H0etDisPuu/xnyG26VlLL96547+GVCGuWFlAC6breo/m3FLuu wEor4eXmA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBxRu-00074I-Au; Tue, 16 Feb 2021 10:19:18 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBxRq-00073m-Fw for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2021 10:19:15 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3A2FD64DAF for ; Tue, 16 Feb 2021 10:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613470753; bh=eY3mTlj51VDYTzN/HdqXV4UVbM576klVPmjNaB7BtAE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rh+goMEe6guEquXfbwF4p/banP+VlKviFUn9KeZpAkmv8y3GfNI82iVu6B1a0WUIE yJXvBuYad7dsukXs4KvDRmvXIVsDfZ2sejfXfi6+ftkhGMG4DMhIPUAwPqwRBZRAJi ebWB2ntvXZXlfawafzxB6dth2N7fvOd1RLc4p1UBmcX9mAw4yMy5Ti60xRd+kESDKV eTOKRF3HYietQXaMe4/gAyeyoGuZ+sYPvKg1bvfg1nKDEURdM8dHeMcmbLM+Ee+dLY u+/8w2/vM+CRK1ouUKeGOsAmYKxkQifPC9ZSdDVRPnP9JZsMRdP2eCXEpyVlHJkDHn ugTurxEvzFh5g== Received: by mail-ot1-f46.google.com with SMTP id c16so8590077otp.0 for ; Tue, 16 Feb 2021 02:19:13 -0800 (PST) X-Gm-Message-State: AOAM530ezsSjeT7oY7Pv7Juob/jy5IdW/sectMQS58v8YB2UXueAD2q3 rR1MfANPRGmeH/hd6pN61iA1kiS3rA8y8LTSKNc= X-Google-Smtp-Source: ABdhPJzeQJWVf1L+wYwbHinVXK9KvU0k5wankDGEsyl+37JLP8P0mp30rvYs7XPlpwchpnDqw4uCBBoiq7ecsbMHDRU= X-Received: by 2002:a9d:6c11:: with SMTP id f17mr14202610otq.210.1613470752538; Tue, 16 Feb 2021 02:19:12 -0800 (PST) MIME-Version: 1.0 References: <20210215121713.57687-1-marcan@marcan.st> <20210215121713.57687-24-marcan@marcan.st> <20210215191748.uhus2e6gclkwgjo5@kozik-lap> In-Reply-To: <20210215191748.uhus2e6gclkwgjo5@kozik-lap> From: Arnd Bergmann Date: Tue, 16 Feb 2021 11:18:56 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 23/25] tty: serial: samsung_tty: Add earlycon support for Apple UARTs To: Krzysztof Kozlowski X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210216_051915_170520_7B2B4CBD X-CRM114-Status: GOOD ( 18.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Rob Herring , Arnd Bergmann , DTML , Tony Lindgren , Marc Zyngier , Linus Walleij , Hector Martin , "linux-kernel@vger.kernel.org" , Alexander Graf , Olof Johansson , Mohamed Mediouni , Stan Skowronek , Will Deacon , Linux ARM , Mark Kettenis Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 15, 2021 at 8:19 PM Krzysztof Kozlowski wrote: > On Mon, Feb 15, 2021 at 09:17:11PM +0900, Hector Martin wrote: > > + > > +/* Apple S5L */ > > +static int __init apple_s5l_early_console_setup(struct earlycon_device *device, > > + const char *opt) > > +{ > > + /* Close enough to S3C2410 for earlycon... */ > > + device->port.private_data = &s3c2410_early_console_data; > > + > > +#ifdef CONFIG_ARM64 > > if IS_ENABLED() > (unless it cannot be used due to missing symbol?) > > > + /* ... but we need to override the existing fixmap entry as nGnRnE */ > > + __set_fixmap(FIX_EARLYCON_MEM_BASE, device->port.mapbase, > > + __pgprot(PROT_DEVICE_nGnRnE)); > > +#endif It has to be a preprocessor conditional because PROT_DEVICE_nGnRnE is only defined on arm64. We could add a FIXMAP_PAGE_NONPOSTED alias for it that defaults to FIXMAP_PAGE_IO, but in the end this is really an architecture specific thing and I think leaving it guarded by the architecture is appropriate. > > + return samsung_early_console_setup(device, opt); > > Don't you need to handle the error code - set PROT_DEFAULT() or whatever > was there before? __set_fixmap() has no return value, it just writes a page table entry and does not fail. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel