Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1197571imm; Tue, 3 Jul 2018 07:11:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK7PQcN8wOgZ2hxiruIJ8rh873cqRFErp0FVUrxMaFG2opL+yhgLcmSIxeV/nfn0Wyd5P+A X-Received: by 2002:a65:62c7:: with SMTP id m7-v6mr25298254pgv.286.1530627066789; Tue, 03 Jul 2018 07:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530627066; cv=none; d=google.com; s=arc-20160816; b=gM8csEDqS5mvACIGJBKxn6qzPGnH1QbOe0iM8F4iRSed+CZi85XPsx+4OOmdA8v3sO 6fflEvDSKM9o6lbPDSDZKJ4r4VXkABHhZHKy+EYjndHcdhnLUPqBDMRSSLz0k0oYlvYB vHmUdzHzduLfzpfd/mkIJsM2AbwSb/RPzA/4eWBPV4Tn8ETsm15F+MZJJwkAM+aG+RtH p7hqbHoYVRNLnpan28VOO4dibZVsdwnDk//igyxYm8Ne6XVzQA7YL0XTuT4WWSppf4HC yS0gq667IE1vMfnksKaiUWbBb3gojVyP4ZHxe9roMqdV61nqf2zRFAdiY7awgR0uW6Ao CEGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=iVR30J47380nK954MqEqn0eYaDvuOJtexXGDvUQgAnY=; b=XIzDH7Te3O060SYB4LZQIQEw6+FQ2LiMtXNoX4OZaDSw7hlRlvjzqgDAmvAIsVup1/ DSY0gMxqR8Hz1xngr4fTn+7Rhnq9rzcnHWjIe1b7a69fg4OeKkPNDICHR/kB+Ot3TfjZ lRhXyayRrqFH9T2qpeky+fWK9QqLdUaFiM7h5Ce1MVjipsj/kpI/nu1mHuP7lPT9XhtA 4q0p80p6+zxslvtLBoN3AmVEGCKY/gKq+0V8AiovKjFoe4eq9WKll4PC5/jFxeJApEMk gsizIMs8HD6rBgPRnWKPREk/Qcl0sHyXxpDmDNcQx3pc1Kap9f3touvG6J5XsdEqiOI5 2MzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ChDK2pq2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v65-v6si1220286pfb.324.2018.07.03.07.10.52; Tue, 03 Jul 2018 07:11:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ChDK2pq2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753519AbeGCOKL (ORCPT + 99 others); Tue, 3 Jul 2018 10:10:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:49138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752088AbeGCOKJ (ORCPT ); Tue, 3 Jul 2018 10:10:09 -0400 Received: from [192.168.1.125] (cpe-24-28-70-126.austin.res.rr.com [24.28.70.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DFAF224B1C; Tue, 3 Jul 2018 14:10:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530627008; bh=cL3D3RkLE8+n7vTl58HpGLxZSVtwFc+02re0uwD0SpQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ChDK2pq2BJb6seJ2DfGLmdl+xdlT+xMNMbVTxqtPCXo/lxdn6K8QGFOYrufYuU5Ed Bb2fYNlkpnAKvqJf7F2YpYyX91+uBNhAu+w4JrWaiw67PjoVflE7JhCbbL5KWLECKs haP0vI/T7Lawb62RsvmIfEzQXb9OQWUL8dhly8ks= Subject: Re: [PATCH v3 6/6] crypto: qcom: Add ACPI support To: Vinod Koul , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bjorn Andersson , Matt Mackall , Herbert Xu , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, Stephen Boyd , Jeffrey Hugo References: <20180703060434.19293-1-vkoul@kernel.org> <20180703060434.19293-7-vkoul@kernel.org> From: Timur Tabi Message-ID: <0d523023-52e8-4154-2e5d-69d54458caa0@kernel.org> Date: Tue, 3 Jul 2018 09:10:06 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180703060434.19293-7-vkoul@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/3/18 1:04 AM, Vinod Koul wrote: > Add support for probing on ACPI systems, with ACPI HID QCOM8160. > > On ACPI systems, clocks are always enabled, the PRNG should > already be enabled, and the register region is read-only. > The driver only verifies that the hardware is already > enabled never tries to disable or configure it. > > Signed-off-by: Timur Tabi > [port to crypto API] > Signed-off-by: Vinod Koul I've asked a colleague who still works at Qualcomm to test this code on silicon. It looks okay, but I just want to be sure. > + /* > + * ACPI systems have v2 hardware. The clocks are always enabled, > + * the PRNG register space is read-only and the PRNG should > + * already be enabled. > + */ > + if (has_acpi_companion(&pdev->dev)) { > + val = readl(rng->base + PRNG_CONFIG); > + if (!(val & PRNG_CONFIG_HW_ENABLE)) { > + dev_err(&pdev->dev, "device is not enabled\n"); > + return -ENODEV; > + } I'm having second thoughts about this PRNG_CONFIG_HW_ENABLE check. The PRNG on the QDF2400 is the same as the one on the 8996, so it should have the same register interface. Currently, the ACPI table points to a full PRNG register block, but I'm beginning to believe that it should instead point to a "reduced" block that doesn't have a PRNG_CONFIG register.