Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp11922286pxu; Fri, 1 Jan 2021 03:31:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzf2hiQIlANIy0OMPSTzT9RjyKhzbntQpzUB2SgX3iIp53puToHX9TEPg0SUyl7ZX8E9in X-Received: by 2002:a50:ed04:: with SMTP id j4mr60169935eds.84.1609500670860; Fri, 01 Jan 2021 03:31:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609500670; cv=none; d=google.com; s=arc-20160816; b=Rf2cRHcajIPC6sW8yvFc4jYNAIFqNukEY5UZ9zbBfQVg+I/J20r0fmrIuxnrWxRxDe jRorwMSufoTR2u8MLcLwGuYtbMKMYL9464ArM4GQgNF7Ta8PUADSfmxTq6HQ6iCpchNO GjrAsT5aUz9CCdfjdMxtdRToYfuO65nA9ZxhwFLB24N3kjswUea8I4bsA0AyhXcvXj9a StAgKSBHpZp9OUaxwIJmfRXxU07F7eSBzSpWRs7E9DEwWQRb92f0DOzqX9ccmssuYM8g 8ww/oQqBPvgowb4m29JMFfdLiKURMAiRnw2Dt37Jfaa27nv8S9anWukyzx5gTEZrKDEk S4IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:date:message-id:from:references:cc:to :subject; bh=DtxThOe8g1lJEekdVhIDhmv6KJrSptQBWlinWqAdZus=; b=dSSpwvOIqhmCORezlrkMEnqB83U2PxUP0StDneOLTFonYAhU680wS8FrfqoD8Iqnel jVzKoE6kuUsDZIBsmvQttH9VoGKlmHugRmKixPHUWM2Qb8d3rKYlY1nJT73eAbUgThpn SOtu8cdFkT0oz0fIGxyEVzYPtZibZuomEzy0nAob6dRXq4j5ej9lJzCLc3udZxyKlZjO fPFVnQKgH1xHaXp873e0PnJ57cQ1Jf9i8LsUDLIGp7c+9ot6gu4QM6KNzM1K+nHnYRtj pmPaCS25hugITXhu0jqkWpSfcCjj+ccBPp0B5RuSgTCY3MGElnwNsEe0HLkpu2PP9NJg mlUw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fy24si24269701ejb.348.2021.01.01.03.30.28; Fri, 01 Jan 2021 03:31:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726957AbhAAL20 (ORCPT + 99 others); Fri, 1 Jan 2021 06:28:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726134AbhAAL2Z (ORCPT ); Fri, 1 Jan 2021 06:28:25 -0500 Received: from yawp.biot.com (yawp.biot.com [IPv6:2a01:4f8:10a:8e::fce2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD9D6C061573 for ; Fri, 1 Jan 2021 03:27:44 -0800 (PST) Received: from debian-spamd by yawp.biot.com with sa-checked (Exim 4.93) (envelope-from ) id 1kvIas-00B5Jw-9h for linux-kernel@vger.kernel.org; Fri, 01 Jan 2021 12:27:42 +0100 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on yawp X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.4 Received: from [2a02:578:460c:1:ae1f:6bff:fed1:9ca8] by yawp.biot.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kvIas-00B5Js-4P; Fri, 01 Jan 2021 12:27:42 +0100 Subject: Re: [PATCH RESEND v2 2/2] Add support for Realtek RTL838x/RTL839x SoC SPI controllers To: Lukas Wunner Cc: Mark Brown , Rob Herring , Birger Koblitz , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201229231904.2558916-1-bert@biot.com> <20201229231904.2558916-2-bert@biot.com> <20201231142319.GA28104@wunner.de> From: Bert Vermeulen Message-ID: Date: Fri, 1 Jan 2021 12:27:41 +0100 MIME-Version: 1.0 In-Reply-To: <20201231142319.GA28104@wunner.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/31/20 3:23 PM, Lukas Wunner wrote: > On Wed, Dec 30, 2020 at 12:19:04AM +0100, Bert Vermeulen wrote: >> +static inline void wait_ready(struct rtspi *rtspi) >> +{ >> + while (!(readl(REG(RTL8380_SPI_SFCSR)) & RTL8380_SPI_SFCSR_RDY)) >> + ; >> +} > > I'd suggest calling cpu_relax() in the loop's body. > > >> + err = devm_spi_register_controller(&pdev->dev, ctrl); > > Since you're invoking devm_spi_register_controller() on probe, > the controller must not be unregistered explicitly on remove. > So the ->remove hook can be dropped altogether: > >> +static int realtek_spi_remove(struct platform_device *pdev) >> +{ >> + struct spi_controller *ctrl = platform_get_drvdata(pdev); >> + >> + spi_unregister_controller(ctrl); >> + >> + return 0; >> +} > [...] >> + .remove = realtek_spi_remove, > > The ->probe hook otherwise LGTM. Thanks Lukas, will fix those issues. -- Bert Vermeulen bert@biot.com