From patchwork Thu Jun 28 13:07:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 140439 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2165529ljj; Thu, 28 Jun 2018 06:07:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJdp/ee6Dh8EnCjon7GgKUKvKuqUgvodOje0mRXVUa3cmTW8XFqHTiAp+SD+/5q97MbxZFQ X-Received: by 2002:a63:6a89:: with SMTP id f131-v6mr8873991pgc.311.1530191259848; Thu, 28 Jun 2018 06:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530191259; cv=none; d=google.com; s=arc-20160816; b=EI9HD51cQ3OYsqNvzG8Jkyf5GGGd9pgshrcC/4yV6lRbB5AM/z5Mb9ibNAjw30Vwyf O2smcjNajUhqtOGY+TBF09Oci4ivBdwmPIzTQlWlmWOllp7NRnOjvUgGS0UZAfAsIVRO AXr4et3wFvJ8STQhEDc8ZIwmdXM8XfaSHFxYBwdAGNT/10TeCubBU6xV/H2gU/2DLFQW D3MjNs1cdpjkAaJGXT3gjtKLAs7uB7mR6IA5f3CRxUeHCHtiQTL9QKnOd/V+j7sIiJ6T pmJATCm9J/PLhtR6dHnFs8pqDaoIcYx4PeyOVJ05qXgnoNvw1iwV5rSc0P+JDLBr4j2/ lqzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=awd2jvEyEmmZRePhnDihWg10R3+ZTozX7h2ek8tKBfE=; b=eNSp+gRKEUdhXCXK0V2rn5LeWEIIY5bZ1IMXPGptY79/BhgbKbdiVvS5TdSATALglX koOvjnAOtAn/zGGS1q+wYwPyDrCarjSYFYS8UsqkKQT1ZEyRRXnwVvOI7P/9v4qQwiIZ YOA7wXqEgMFpOXD87iCJWXV1PgAOwUvPQuy6Vd35thkHKE4ts1ABNd6L0bl5PPnkV0T2 eGkmVNNNUy0Gz4+p/+FCwo63dvTDJ3AkMEcABgaTgIBq8MphqC3h3oBr75EEayw7twWK gUFXaaL6ZdG7iUEcV33NAIoRoZjGfPMdYB6n2a1VTVp/mf04zrD49MJGN4e5TTyV4Bpi R8qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JOq09eum; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6-v6si1703418pls.419.2018.06.28.06.07.39; Thu, 28 Jun 2018 06:07:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@linaro.org header.s=google header.b=JOq09eum; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965012AbeF1NHi (ORCPT + 1 other); Thu, 28 Jun 2018 09:07:38 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37325 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964849AbeF1NHi (ORCPT ); Thu, 28 Jun 2018 09:07:38 -0400 Received: by mail-lj1-f196.google.com with SMTP id c11-v6so4453912lja.4 for ; Thu, 28 Jun 2018 06:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=awd2jvEyEmmZRePhnDihWg10R3+ZTozX7h2ek8tKBfE=; b=JOq09eumRNaSzhUbD9wJ4CeqGIKij5/OPDW0dzb1PYNWywjO9rMc+caTvyTqcth2z9 rioeVEBvxe257AAqioK2/5GvPnjml6GgwrH5yvAiZrnUovlFreuAmgn3lXXl/lbbBxG3 65+reISvKAEpaqZUxVEAFCZ9/chUzyb6qGT3Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=awd2jvEyEmmZRePhnDihWg10R3+ZTozX7h2ek8tKBfE=; b=cKazqzhp/oXl3cxTR/xMJqbEFvOy87jg0QiHKNpxW7i8OuSaLpnFKI8GEQxjnmQ23I 7D1ydJR0b5OgZH04Rg49hF55Qmg/QvCJGFvUtR0ZgGiv3QervcKzR63NeTY2OwxWsBFQ eVinlPFdCnEQOnN8oLpQ2bzMdMVeSSi3+A5WdnpJB65dodIjttIFyPNB2/4dKp2YrEGI 9ua9/JhaAbbEkihVgGqfw8iHsB0t6zwjFZqv0bI06Nfinq2b6Ogr37HtaNwOKKGhia3i 3QSq2bWqtc0ECFGqDa3HFOJR9yshyQzmYgOxLvvZDem593w8QySNUar0MD++M7CS/gyI hZfw== X-Gm-Message-State: APt69E0ZpNU7wfE5KvE+ENlMw/yYnVYFGXIgU+xCpkTOxnv31PkN3y3q 6sn4aRWiTOFQ1E8TFgmK0Ov7BXuvreQ= X-Received: by 2002:a2e:534e:: with SMTP id t14-v6mr6878194ljd.73.1530191256625; Thu, 28 Jun 2018 06:07:36 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id d24-v6sm1314649lfl.53.2018.06.28.06.07.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Jun 2018 06:07:35 -0700 (PDT) From: Linus Walleij To: linux-crypto@vger.kernel.org, Herbert Xu , Tudor Ambarus Cc: Linus Walleij Subject: [PATCH 2/9 v2] crypto: atmel-ecc: Just warn on missing clock frequency Date: Thu, 28 Jun 2018 15:07:22 +0200 Message-Id: <20180628130729.17589-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180628130729.17589-1-linus.walleij@linaro.org> References: <20180628130729.17589-1-linus.walleij@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The Atmel ECC driver contains a check for the I2C bus clock frequency, so as to check that the I2C adapter in use satisfies the device specs. If the device is connected to a device tree node that does not contain a clock frequency setting, such as an I2C mux or gate, this blocks the probe. Make the probe continue with a warning if no clock frequency can be found, assuming it is safe. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Instead of silently ignoring the missing clock frequency, issue a warning and continue. --- drivers/crypto/atmel-ecc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.17.0 diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c index e66f18a0ddd0..33773920e4bf 100644 --- a/drivers/crypto/atmel-ecc.c +++ b/drivers/crypto/atmel-ecc.c @@ -659,12 +659,9 @@ static int atmel_ecc_probe(struct i2c_client *client, ret = of_property_read_u32(client->adapter->dev.of_node, "clock-frequency", &bus_clk_rate); - if (ret) { - dev_err(dev, "of: failed to read clock-frequency property\n"); - return ret; - } - - if (bus_clk_rate > 1000000L) { + if (ret) + dev_warn(dev, "i2c host missing clock frequency information\n"); + else if (bus_clk_rate > 1000000L) { dev_err(dev, "%d exceeds maximum supported clock frequency (1MHz)\n", bus_clk_rate); return -EINVAL;