lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230607170009.9458-1-giorgi.marco.96@disroot.org>
Date: Wed,  7 Jun 2023 19:00:07 +0200
From: Marco Giorgi <giorgi.marco.96@...root.org>
To: netdev@...r.kernel.org
Cc: krzysztof.kozlowski@...aro.org,
	u.kleine-koenig@...gutronix.de,
	davem@...emloft.net,
	michael@...le.cc,
	kuba@...nel.org,
	linux-kernel@...r.kernel.org,
	Marco Giorgi <giorgi.marco.96@...root.org>
Subject: [PATCH RFC net 0/2] nfc: nxp-nci: Fix i2c read on ThinkPad hardware

This patch addresses issues with "I2C" read on ThinkPad hardware.

My machine (ThinkPad T590) is equipped with an NXP1001 NFC reader, although
working flawlessly with Lenovo's Windows drivers, on Linux the driver
implementation doesn't work.

My speculation on the error is that the IRQ which is associated with the device
doesn't take into account the device's IRQ GPIO value. This patch addresses
that by exiting from the IRQ if the GPIO is low.

With this, I've been able to read a tag with neard's nfctool.

This is the behavior of the mainline `nxp_nci_i2c` driver:

# nfctool -d nfc0 -1 
Connection timed out
# dmesg -Wtd 
[<   0.000000>] nxp-nci_i2c i2c-NXP1001:00: NFC: Read failed with error -121 
[<   5.142581>] nci: __nci_request: wait_for_completion_interruptible_timeout failed 0 
[<   0.013474>] nxp-nci_i2c i2c-NXP1001:00: NFC: Read failed with error -121 

This is the patched `nxp_nci_i2c` driver:

# nfctool -d nfc0 -1 
nfc0: 
         Tags: [ ] 
         Devices: [ ] 
         Protocols: [ Felica MIFARE Jewel ISO-DEP NFC-DEP ] 
         Powered: Yes 
         RF Mode: None 
         lto: 0 
         rw: 0 
         miux: 0 
 
# nfctool -d nfc0 -p 
Start polling on nfc0 as initiator 
 
Targets found for nfc0 
 Tags: [ tag0 ] 
 Devices: [ ] 


No output from `dmesg`

Marco Giorgi (2):
  nfc: nxp-nci: Fix i2c read on ThinkPad hardware
  nfc: nxp-nci: Fix i2c read on ThinkPad hardware

 drivers/nfc/nxp-nci/i2c.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)


base-commit: 44f8baaf230c655c249467ca415b570deca8df77
-- 
2.41.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ