Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1064858ybt; Tue, 7 Jul 2020 07:03:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg5HqIgMrXDyxMdUMb3XyVd4S5ZfrUqM8LOy2pRwVqcWTI6vIdz0EGC9befwDZtGFPrM+S X-Received: by 2002:a17:906:2296:: with SMTP id p22mr46437734eja.510.1594130626988; Tue, 07 Jul 2020 07:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594130626; cv=none; d=google.com; s=arc-20160816; b=KVwJCw/dY85g5+hSEhTROR1y91k0UsZb+fOJ2f9OgUiX69DKbo2SCjyxhPY6Y9/KbS ISCQCeM2pCIOhS5mEudPZWMo0x10PgqgrOok819g32MNObqVz43Yzpd+/DL3EVhqMjW0 VI4jInR4Hi+nkPhMTj5CDaTWM030QdqEvT55TFX7SU7cF5m8hVDgYOK+Tn0Z9IgZAuTj Xf9uPMjYcu9+wircMN9kzVOheIMQNYeFM6lPBCImHAAAOGVT/UGopJLGQXy5NSaWKrOb aJno88qRm+zSce/TlocEc8fASdEXBdl+9vGZM3HE5tlhMdmRTmJT4zzsdNHjpVsBEFr5 sSGg== 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 :content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject:dkim-signature; bh=ll7gVSOL9XzROZUsvjqsjM/q+j59gZ3tVsoc4JCDtNA=; b=V1WaEGtdLfnvZls8Ly5gn+VLmP2QCTP4vD168hvA49aT/WTbbAAYiKX09Z58QcbwH4 hRsPAj8XfdydDeEXTxx/yZ6THYcTFJC1YhXR1ORQQg/a5bQo+5SSkaUpkkmElf4F1n2T K17rVbEICjgducdb058G8bBMrvOtKaEt2f3383QdeLOnHX7GSgozkHLGxBCeXMDQRC8w JbCLhXi/pxMk8MGhDHTiWm4L7fOxnuyEb9ZeXTm+MK3qMN60NSZbUCtW82MueUGRMJV+ MTGJhZjL4E+oTBi4m81CJBArlMeOF6nPAKcJkjtJpSYdXdyWtZFlCa1aARDQlvlq8TKM 1i7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gorani.run header.s=MBO0001 header.b=ZS2vQUAe; 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=NONE dis=NONE) header.from=gorani.run Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r5si15006821edo.130.2020.07.07.07.03.24; Tue, 07 Jul 2020 07:03:46 -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=@gorani.run header.s=MBO0001 header.b=ZS2vQUAe; 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=NONE dis=NONE) header.from=gorani.run Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727987AbgGGODP (ORCPT + 99 others); Tue, 7 Jul 2020 10:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbgGGODP (ORCPT ); Tue, 7 Jul 2020 10:03:15 -0400 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050::465:202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC712C061755; Tue, 7 Jul 2020 07:03:14 -0700 (PDT) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4B1PKW5V4WzQlH2; Tue, 7 Jul 2020 16:03:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gorani.run; s=MBO0001; t=1594130589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ll7gVSOL9XzROZUsvjqsjM/q+j59gZ3tVsoc4JCDtNA=; b=ZS2vQUAeQJHJPZt1jny2VGDtSVHRhegIw8xtPLsbJocmWRMiL5uVguvw1FWnkqtYb6g7q6 AdMEjo0BFuMFRATOn5oElrxBJWvbqmyma+Mc+NAo0aKypOcTQmk5Myd5v++BNafQDp32b2 +bigyB6DFx+jbTfxFDcREMbZJhTRGdkr/LgF0gY4i/qy1c2qO7+cLekhLc+SBNR4pGZity xJYXCmnpPyORS35HePL4T4Bg+FRA5TYmlN9T8/ORs8DIvYQFOEMj2RJNLbb80Qm20dwPV1 /NvEVW8MXCzf4LOv06HV8mpDURY6xZS3+uimkweMl2B9rkp3sn/fxaRHl1RYtg== Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id aMe3dxk8w6IU; Tue, 7 Jul 2020 16:03:08 +0200 (CEST) Subject: Re: [PATCH v5 1/2] gpio: add GPO driver for PCA9570 To: Andy Shevchenko , Bartosz Golaszewski Cc: Linus Walleij , Michael Walle , LKML , linux-gpio References: <20200705133038.161547-1-mans0n@gorani.run> From: Sungbo Eo Message-ID: <15d8ae43-6905-b861-3b50-d1ba780edf2d@gorani.run> Date: Tue, 7 Jul 2020 23:03:00 +0900 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: 0 X-Rspamd-Score: -4.05 / 15.00 / 15.00 X-Rspamd-Queue-Id: 78083178A X-Rspamd-UID: 2ba226 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20. 7. 6. 오후 9:00, Andy Shevchenko wrote: > On Mon, Jul 6, 2020 at 2:21 PM Bartosz Golaszewski > wrote:> >> On Sun, Jul 5, 2020 at 3:31 PM Sungbo Eo wrote: >>> >>> NXP PCA9570 is a 4-bit I2C GPO expander without interrupt functionality. >>> Its ports are controlled only by a data byte without register address. >>> > >>> Datasheet: https://www.nxp.com/docs/en/data-sheet/PCA9570.pdf >>> > > No blank line here. > >>> Signed-off-by: Sungbo Eo > >> This driver looks nice now but why did you remove the mutex in v3? I >> think when Andy commented on that, he meant not understanding why the >> error check is protected, not the i2c operations. > > Right. Oh, probably I misunderstood the comment... :( 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. Thanks for your kind reviews, as always. :) > >> Are you sure you don't need this lock? > > It's a good point! >