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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 E5864C43381 for ; Thu, 28 Mar 2019 08:10:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B450521773 for ; Thu, 28 Mar 2019 08:10:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bFutqhhh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B450521773 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.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=19y98OOZ/WibDwRwlj6Mmr6yn9VYimfbhx3FOSYj7sc=; b=bFutqhhh24d/yQ 2qDbhJhkRboKlcweiUIr3PmpY5aNBkYMibw3E8oOf6He2OnpLhjybGq9+3gBNF9zbSgtKPS38JDOK b2b7+YzPKrk4yczKFeCgJB8K3GiTAtfvKDxLnfLYRveLdqjAEESsfdf04H7ZHdDfjCKPErOH1TG0i Lz9HjXZYjGJ+dXkqsZfO6uTL45/VBMsqV1Jk2tUhEyLhIwLnSCItqe1wsj49YU2IEzCisjTecGlQL Qdki+drB0VB4WHcujAZiK9NsPeIziquHQTk/C1ujiFAjTwLqAVIpLxcfBKVzS7ft93BohxlcNI8YY UN1Cko4pGS08ohPmIWFQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9Q7D-0003Rf-6Q; Thu, 28 Mar 2019 08:10:23 +0000 Received: from mail-ua1-f65.google.com ([209.85.222.65]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9Q77-0003Qg-PM for linux-arm-kernel@lists.infradead.org; Thu, 28 Mar 2019 08:10:21 +0000 Received: by mail-ua1-f65.google.com with SMTP id g8so6568274uaj.0 for ; Thu, 28 Mar 2019 01:10:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jRUgvZGmNWliE3jaTuWfhB/x9qfmX7QfxZz8gk2Gg5I=; b=rrhwYcPth7ggF0x2P/gHAREyYMRfcEDXUdjlKsWwadFHwPKLedn9YfH5Q/WeeCiAsr jUjjUqZSfagLbbQwLzoPqgZy0ovjQWtAxQJOyLS0dIsrtlmMO8yHvsBJdEwssrNhZsI3 kVFwIJYSW1upPXgo3laevlCOMqz5twvWCp7MvsTEI+RUk+TCp8vcT6l5yBZ3jRMbmmc8 JXIDN9VobEqwQYGi0xn8TzyX8OSg3AIMtIMi2JfK1cjOuD7IY5WiQsCC9hxqglPEwTs9 LE3AXfAYL0lhxI38NK3tlQ5o2BZx1GB4qlAwXMnD4g0MVRCPTE5phq25KFl53SOuiPmF 5kRQ== X-Gm-Message-State: APjAAAXBIQhghXld2ryjy2EqSqvfpqNozpyF8lBjS2Ir9hAD6FMaSBP/ stZx76GLLdGaVxo4plYbXky7AIg2Iq79s0ydmR4= X-Google-Smtp-Source: APXvYqz9r3Gh7bqhhyIqSeKx56Zfi3q4bPl3CeVHfVgMQZ6Vvv4NssofolIX1PK2Zc+CffLJa89q5Snt+H7vqdnTQ7M= X-Received: by 2002:a9f:3fce:: with SMTP id m14mr24440126uaj.96.1553760615463; Thu, 28 Mar 2019 01:10:15 -0700 (PDT) MIME-Version: 1.0 References: <20190327211256.17232-1-wsa+renesas@sang-engineering.com> In-Reply-To: <20190327211256.17232-1-wsa+renesas@sang-engineering.com> From: Geert Uytterhoeven Date: Thu, 28 Mar 2019 09:10:02 +0100 Message-ID: Subject: Re: [RFC PATCH] i2c: remove use of in_atomic() To: Wolfram Sang X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_011017_824401_1D0FB64C X-CRM114-Status: GOOD ( 16.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Frederic Weisbecker , Linux Kernel Mailing List , Linux-Renesas , Linux I2C , Ingo Molnar , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Wolfram, On Wed, Mar 27, 2019 at 10:13 PM Wolfram Sang wrote: > Commit cea443a81c9c ("i2c: Support i2c_transfer in atomic contexts") > added in_atomic() to the I2C core. However, the use of in_atomic() > outside of core kernel code is discouraged and was already[1] when this > code was added in early 2008. The above commit was a preparation for > b7a3670131c7 ("i2c-pxa: Add polling transfer"). Its commit message says > explicitly it was added "for cases where I2C transactions have to occur > at times interrups are disabled". So, the intention was 'disabled > interrupts'. This matches the use cases for atomic I2C transfers I have > seen so far: very late communication (mostly to a PMIC) to powerdown or > reboot the system. For those cases, interrupts are disabled then. It > doesn't seem that in_atomic() adds value. > > Note that only ~10 out of ~120 bus master drivers support atomic > transfers, mostly by polling always when no irq is supplied. A generic > I2C client driver cannot assume support for atomic transfers. This is > currently a platform-dependent corner case. > > The I2C core will soon gain an extra callback into bus drivers > especially for atomic transfers to make them more generic. The code > deciding which transfer to use (atomic/non-atomic) should mimic the > behaviour which locking to use (trylock/lock). Because I don't want to > add more in_atomic() to the I2C core, this patch simply removes it. > > [1] https://lwn.net/Articles/274695/ > > Signed-off-by: Wolfram Sang LGTM, so: Ackeded-by: Geert Uytterhoeven But please wait for Peter and/or Frederic to give their fiat, too. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel