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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 B0A1CC2D0CE for ; Tue, 21 Jan 2020 14:40:38 +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 7ED8724125 for ; Tue, 21 Jan 2020 14:40:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BAV4tv11"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="ZcgPsiCF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ED8724125 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lunn.ch 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FIkG5jd9mPDdIETyPsC5nLLYEgjun06dTIcL5IWBWzM=; b=BAV4tv11T/a+Gj iDpliKf8YO7ygJk7Z99DjPAYgeAlKbZ8DrFMhYgDc5H0lKjomYpNk33vy0yDWRsinJ9ay1VtKU22/ tYOXXnU6G4tFcCGcubRvCI4HV1B5YJVxGp+QLKa4KPi+Sx0TZuBSmr0ycLnFZ5MKrwihgqVtdPpl5 QJHPjkHpkkAdxfsU7F4GoTwSgJD6LHvoKbPmhYfy3sY5k4J7MHPgdHMOY90i/R9VcIzHS4/cnDS1z h5He61FIu0uMTuAzlmZbx/gnuRcm+geo38ozlf5JQKcyac25xCyZX1DzsXBJgx2jBwt62kIU3Y4dV XwhJQCpwzuNsEOvBYFtA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ituho-0002pG-Uv; Tue, 21 Jan 2020 14:40:36 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ituhj-0002o2-FE for linux-arm-kernel@lists.infradead.org; Tue, 21 Jan 2020 14:40:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=eanzNlQOXiyQv7SY2HxEu4R1QjiEvG/A8Il3e6bRKMk=; b=ZcgPsiCF79tdrPQ/9tIwj0ppNQ WhFSPgtG//uXN5jaJouR/qFhNXHIFbuZUm97Gls0sURalRsyDyDMMxxApWK3hv/2a2Qw+EkQxIxQo eUeKPlt9kBn0hAMIzrnfDp+Fx+e+tFhUrSakt0R7dEyQynYb6HMvQ+mMxFJKpHehIgpY=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1ituhX-0004hj-5C; Tue, 21 Jan 2020 15:40:19 +0100 Date: Tue, 21 Jan 2020 15:40:19 +0100 From: Andrew Lunn To: Chen-Yu Tsai Subject: Re: No master_xfer_atomic for i2c-mv64xxx.c Message-ID: <20200121144019.GD16902@lunn.ch> References: <20200121094023.jywheey6sjsgrr44@gilmour.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200121_064031_507980_0C0A9A59 X-CRM114-Status: GOOD ( 11.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Gregory Clement , Florian Fainelli , Linux Kernel Mailing List , Maxime Ripard 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 > > However, I'm not entirely sure how we could implement it without > > sleeping. The controller is basically a state machine that triggers an > > interrupt on each state change, so you first set the address, get an > > interrupt, then set the direction, then you get an interrupt, etc. > > > > I guess we could implement it using polling, but I'm not sure if > > that's wise in an interrupt context either. > > I believe that is actually how some of the other drivers handle it, > using polling. You can mask or disable the interrupts while in the > xfer_atomic callback, and the i2c core won't schedule two transfers > at the same time anyway. The ocore driver is similar to the Marvell driver, a big state machine. It implements polling for atomic transfers. It needs polling support anyway, because some instantiations of the hardware have broken interrupts :-( Maybe there is some code which can be copied from the ocore driver? Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel