From patchwork Mon Aug 27 19:08:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10577525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0745D139B for ; Mon, 27 Aug 2018 19:08:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E114D2A07D for ; Mon, 27 Aug 2018 19:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D50DE2A083; Mon, 27 Aug 2018 19:08:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87D662A07D for ; Mon, 27 Aug 2018 19:08:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbeH0W4k (ORCPT ); Mon, 27 Aug 2018 18:56:40 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:44290 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727274AbeH0W4k (ORCPT ); Mon, 27 Aug 2018 18:56:40 -0400 Received: by mail-oi0-f68.google.com with SMTP id l82-v6so24718oih.11 for ; Mon, 27 Aug 2018 12:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=3/ZB8j8ZHPc5CojXdCfQqa+W/XwV+vs0mcQfgmBbt6Y=; b=EYdaCr9SZ62romQLdWHd2JwHkfCLUtSDPlyoKbb/Etr481G0GX4b5HRKVvfmliuZ3o Ub1WmSQW9gAQg8jAPw0EmOGTXxPL9IsXWHyEHmdULa5Mtmi+WB2Q+Zsqsy7j1Hrm/vh7 VAqGhDlKdF4DHXBG+u5zsiKVXCoK3x8azR7rgqwPV8+uwItlXXVkSALw6GVDya6BDuyl Rr0e7NPBTQ3Ypapxg7qFdHhHmkglGudQvzq3XzF/cvuBmoCkQchyxxxkzs7tblg641qe J4xOhgb4KSUDloIHQcqvyw/xGD0mTvjp5bVfjZCILuHL4kyTnmGDLUgXnoxt7e5ggNIJ nD0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=3/ZB8j8ZHPc5CojXdCfQqa+W/XwV+vs0mcQfgmBbt6Y=; b=j4uJz/kJAqkAbX1QbQe4IgeX1YdOd5zGtp53pduBFD80dkPnpARI3vhKDFRItzKeoZ l7OgRC6fQedOgq55izAFBqqx3RjRHWP8bVXasfN1ZPmKfqHYSKfp8RbbTn5fh1fbgF5a lLlPLNZ9pZTheW+lyhbykHcmSpUEEl/AhjD3ZIOAWWsPqqwQUFwhaDZ8RZS/pWRRqYDD e+apUpqQYDgtxtLRy21KWq47NMrjmmTFbUbuYXZMVHvKufxsB/x/DhA5U4hHofVOhU5b KV1zPApuw2SvGWAAyI9lpfgAqyKcK8rKsyAmCsSYYjqACZNLsVkv7UA4yP9E2ixqnQqr 7sxg== X-Gm-Message-State: APzg51DiXx+nKEO9S6iqztZlh4XumTScmodBEhO44/Qa4mZTqnaiwi/O FuH+UKyQ+2+9wvo1L5XPFffjEnr1ZL2Ta863vVdCeIVf X-Google-Smtp-Source: ANB0Vdb1D0IequkhDemZAdZ7gJJj4VZbclsxCSCFFbmvGSEYKwNtHCK4VZdibYfaje3VpVhZFPHo7FQ7frG2Od0+QYw= X-Received: by 2002:aca:e184:: with SMTP id y126-v6mr12512157oig.313.1535396928137; Mon, 27 Aug 2018 12:08:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:284e:0:0:0:0:0 with HTTP; Mon, 27 Aug 2018 12:08:47 -0700 (PDT) From: Fabio Estevam Date: Mon, 27 Aug 2018 16:08:47 -0300 Message-ID: Subject: Reading from the MC13892 ADC channels causes shutdown To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , David Jander , Andrey Gusakov Cc: linux-hwmon@vger.kernel.org, Guenter Roeck Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, Has anyone managed to read ADC values from the MC13892 ADC recently? I am running 4.19-rc1 on a imx51-babbage board and after trying to read a channel: # cat /sys/class/hwmon/hwmon0/device/in7_input the PMIC shuts down completely, which causes the entire board to die. I don't know if this is a regression or not. I can try to run a bisect, but I would be interested to know if anyone knows if MC13892 ADC readings worked at some point in the past. Also noticed that the shutdow happens after writing to the ADC1 register. Removing the line below makes the ADC reading to timeout, but at least the PMIC does not shut down: Any ideas are welcome. Thanks, Fabio Estevam --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c @@ -327,7 +327,6 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, mc13xxx_handler_adcdone, __func__, &adcdone_data); mc13xxx_reg_write(mc13xxx, MC13XXX_ADC0, adc0); - mc13xxx_reg_write(mc13xxx, MC13XXX_ADC1, adc1); mc13xxx_unlock(mc13xxx);