Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1116196ybt; Tue, 7 Jul 2020 08:08:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdz0WNPFCqTlZqGywV2vB7c2TMl3LlQN5HSOje28MqzDyjY2eNCxEMas3N0nGsnzycinXZ X-Received: by 2002:a17:906:1357:: with SMTP id x23mr50522648ejb.148.1594134520553; Tue, 07 Jul 2020 08:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594134520; cv=none; d=google.com; s=arc-20160816; b=wuDOzGX4N4SSqDugTJ6T4Ol3purXfDO4msNnB5fOd5nqpP3hW1076yccQYiufDfS4u cO8QBHWDGVVVpScadyLscweQO798Ls5u4oj0Wk1S5QGVNS7KnJjH2+9KtPAgEAnYsKfO 0IonvOBaTFiw9LMBikB3j8WOcTKABx4W6hpzBDuXeqMdG/pqvS1rOL3qP9hsjJakr9LH GfXGWclNGcO/N0ZcOjtlfKHOE0Eg/5h+vT5ku2rBoiJJIRqCruHpnBH19BHByk8gT6r2 y0UV9hzJ69HYHBWMWGeAxULON/8NdLADA+X3Am6/qXsIWB1U7thm0I2UUA5G5Q83gwmo W61A== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Cj5YHVMEb1Skcs4Bgm6WovZ+60YcaX0yJ/fN2fOst+g=; b=VdD6vAvtFSgKercObVY8gTqht7aGDN4YAXzD/57phfGAG50B0cSRl/Xp5pnbLzTRoj GUVO4RnFNuwu8IreH+0EN+MjHHgulO80QWPuH7ijj+ClpQfTAgwLH1ViZ/c97mS9iqtH YaohpC4s/XEQvp9d1SHFks5Ol5YfcOx3Irrm1YsHBnYDydpdDgNUchsTpwrl+1y491hB koNhj2/cOSfhfIxnw4xVrV91qbgkjXAtU0zW9629CJjnZXua3rIzQ0ee6AK9f5uMHOdC tyHpoi05YJjlCqXSPr/kmlzGdDnBuGsCIR9Cmt8smmBwWQjwAVM501IiPh/G7XNGvixI E2Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ViObSl1Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz22si13620236ejb.742.2020.07.07.08.08.16; Tue, 07 Jul 2020 08:08:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ViObSl1Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728126AbgGGPHn (ORCPT + 99 others); Tue, 7 Jul 2020 11:07:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbgGGPHn (ORCPT ); Tue, 7 Jul 2020 11:07:43 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E0DBC061755; Tue, 7 Jul 2020 08:07:43 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id b92so18647231pjc.4; Tue, 07 Jul 2020 08:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Cj5YHVMEb1Skcs4Bgm6WovZ+60YcaX0yJ/fN2fOst+g=; b=ViObSl1ZKpdciiuiNFoSHCk5YRn01KNsWY0LK+HmrnV1MqDayYTmP09uakkSE9Oave 5Z6J2fusmaBC1BtqDsnhUO6FvJMblkUrvXV7QeoJgmJHeWLtWo9a/N6vpL6jIcL7L1Hu 9xt+yO49i5RQUVxCO88mM5b49xuIlDH5BDxbkzS+pBqsEAuyRkGQNlX5loUyRfVOCvA8 n8DrIp1sgKmV0ae9UvWWKWWnPw/U0/ZgU8V7NmUC67FUjASPBc1aEmswsx3zz1xd9Wwo QVQxvZ4GQ7TmA00rFZCj8E1/Y5VdeTCikQGa5kVwZOZrpaatXeQdt7SuP7D50rHxjyGV rI0g== 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:content-transfer-encoding; bh=Cj5YHVMEb1Skcs4Bgm6WovZ+60YcaX0yJ/fN2fOst+g=; b=ItInun/AoQmJgSxOxuWABryBOQg/voyHx0g60UdMKjY/tz7wmIzNoWu2SfoTCt3kOr 9xArLsJKRcK5EqWdX5v1Jvr7V6Ex8/Ezy8qqmkult0GwIOT2srLBta8sLzAgkP+B6oT3 zr0AZI/9AVb8Hx2EJ1pYARwQtRKludGE2sVcQi949PgahfeYzv8k0Pw0sJVat5Ts5qZm HnqBTgapQUKZXjlQQiPYOB5Wov/wv0FfdCOXLT40q+e5jxz6UtOU2FMX4yKkrZlHLt7w stSIhsqeZLdvCO8QIE5z1zFlRUghicYxLljGdVuoyhLpIx3i0AqiNxS1LZlwF4esX9wj xrSw== X-Gm-Message-State: AOAM533dlyJu3TlTfalzrgaS/BikkCtGu5AjEmzDwPxXy2CmD0+WQN/Y ZwgwW6IjsZ5MxXEsnC5rCT9+I6mjwJBM8bG89C0= X-Received: by 2002:a17:902:7288:: with SMTP id d8mr46952213pll.18.1594134462903; Tue, 07 Jul 2020 08:07:42 -0700 (PDT) MIME-Version: 1.0 References: <20200705133038.161547-1-mans0n@gorani.run> <15d8ae43-6905-b861-3b50-d1ba780edf2d@gorani.run> In-Reply-To: <15d8ae43-6905-b861-3b50-d1ba780edf2d@gorani.run> From: Andy Shevchenko Date: Tue, 7 Jul 2020 18:07:26 +0300 Message-ID: Subject: Re: [PATCH v5 1/2] gpio: add GPO driver for PCA9570 To: Sungbo Eo Cc: Bartosz Golaszewski , Linus Walleij , Michael Walle , LKML , linux-gpio Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 7, 2020 at 5:03 PM Sungbo Eo wrote: > On 20. 7. 6. =EC=98=A4=ED=9B=84 9:00, Andy Shevchenko wrote: ... > But I don't really understand what mutex does here. The driver does not > need consecutive commands, it only sends/receives only one byte at a > time. And AFAIK each i2c_smbus function is already protected by a mutex. > So what should be exactly inside the lock? Should we protect the output > buffer as well? I'm not an expert on this so please enlighten me. There are questions, answering them will give you a solution: - Since we have two functions doing i2c communications, can they clash? If so, does the i2c framework guarantee the serialisation? - Since we have a shared resource (buf), can accessors clash? How do we guarantee serialization? --=20 With Best Regards, Andy Shevchenko