**** BEGIN LOGGING AT Sat Jun 11 02:59:58 2016 Jun 11 12:34:50 jic23: there? Jun 11 12:35:17 jic23: I think I will do the ak8975 myself.. Jun 11 12:35:54 jic23: have you build a kernel module by using the android mpu driver?? I have a strange feeling that it will work if you cross compile it.. Jun 11 12:36:07 what do you think? Jun 11 14:28:00 Hi ! Jun 11 14:28:13 what the benefit of using kfifo ? Jun 11 14:28:34 why cant we just use copy_to_user() Jun 11 14:28:46 or copy_from_user Jun 11 14:29:03 adn place it in a buffer we have in our driver Jun 11 14:30:34 like for example a simple char buff in our read() ? and not using a kfifo ? Jun 11 14:31:20 and even when we are allowing file to be opened only by one application at a time ? Jun 11 14:32:27 nerdboy: ds2 Abhishek_ ^ Jun 11 14:33:06 and should a kfifo be used for in-kernel communication too ? Jun 11 14:55:54 okay i guess its used when the device is expected to be slower than the expected input .. right ? Jun 11 14:58:52 and that is probably why we use it only in read functions. Jun 11 15:21:01 I am here now Jun 11 15:23:45 hey m_w :) Jun 11 15:23:56 whats up? Jun 11 15:24:14 I am fine . I got y driver up and speaking to pru Jun 11 15:24:19 *my Jun 11 15:25:00 excellent Jun 11 15:25:02 and had some simple doubts .. should repost ? its just the last part in the logs ? Jun 11 15:25:12 what the benefit of using kfifo ? Jun 11 15:25:12 why cant we just use copy_to_user() Jun 11 15:25:12 or copy_from_user Jun 11 15:25:12 adn place it in a buffer we have in our driver Jun 11 15:25:12 like for example a simple char buff in our read() ? and not using a kfifo ? Jun 11 15:25:12 and even when we are allowing file to be opened only by one application at a time ? Jun 11 15:25:14 nerdboy: ds2 Abhishek_ ^ Jun 11 15:25:15 all nighter paid off a bit Jun 11 15:25:16 and should a kfifo be used for in-kernel communication too ? Jun 11 15:25:18 okay i guess its used when the device is expected to be slower than the expected input .. right ? Jun 11 15:25:21 and that is probably why we use it only in read functions. Jun 11 15:25:59 yeah. Actually, I fell asleep at 3 or maybe 4 am. And then, it all is really confusing. Jun 11 15:26:52 I will write a post, but once I gain enough confidence that i understand all this. Jun 11 15:28:34 m_w: ^ ? Jun 11 15:28:45 is that correct ? about kfifo Jun 11 15:28:46 ? Jun 11 15:29:19 trying to get my head around what you are asking Jun 11 15:30:45 so you want to put data to transfer from the PRU into a kfifo? Jun 11 15:31:14 nope, from kfifo to pru. Jun 11 15:31:26 and from the /dev file into fifo Jun 11 15:31:31 *kfifo Jun 11 15:31:41 what is going to the PRU? Jun 11 15:31:58 data from the cdev file. Jun 11 15:32:10 what data? Jun 11 15:32:37 any data, I am just testing the working. like, sending a number 'n'. Jun 11 15:32:53 okay Jun 11 15:33:03 and getting the leds blink n times as an output. Jun 11 15:33:32 sure okay Jun 11 15:33:45 So I saw that some driver were using kfifo to take data from cdev file, while other were using simple char array. Jun 11 15:34:00 my question was what to use ? Jun 11 15:34:17 depends on how much data is passed and how it is structured Jun 11 15:34:46 so, if I am expecting large input and comparatively slower comm to the device, I should use kfifo right ? Jun 11 15:35:13 yeah Jun 11 15:35:32 and I that is true for in-kernel communication as well ? Jun 11 15:35:47 the fifo is needed in case the driver is flooded with information and can process it immediately Jun 11 15:36:37 can't process it immediately Jun 11 15:37:15 yeah okay, So even in case of in-kernel communication ? like if one driver sends data to another driver through and API ? Jun 11 15:37:29 *so thats true even in case Jun 11 15:37:31 pretty much Jun 11 15:37:43 okay. Jun 11 15:37:49 Thank you :) Jun 11 15:38:29 if you want to send configuration information from the userspace to the driver you should probably use ioctl Jun 11 15:39:42 data can be passed using read/write and copy_to/from_user Jun 11 15:41:20 yeah, okay. Jun 11 15:41:33 I am not focusing much on user interaction. Jun 11 15:41:49 in our case, we just need to reach upto IIO subsystem Jun 11 15:42:27 something like that Jun 11 15:47:07 pmezydlo: you here? Jun 11 15:47:19 yes i am, hi Jun 11 15:47:24 m_w:^ Jun 11 15:48:33 I'm trying to do something with pm_runtime Jun 11 15:49:27 okay Jun 11 15:50:18 the pm_runtime is disabling the clock after a timeout and it is woke by a sync Jun 11 15:50:30 I am looking who it is done in a spi master which use interrupt Jun 11 15:51:13 well with the master, the driver controls when the transaction happens so it can run the sync when necessary Jun 11 15:51:23 for a slave this is not the case Jun 11 15:51:58 the slave must handle the transactions asyncronously and cannot be sure when it is going to happen Jun 11 15:54:17 yeah I know, when interrupt is caused We must sync again Jun 11 15:54:51 This will not be the optimal Jun 11 15:56:34 m_w: no terminal after reset is clear Jun 11 15:58:11 perhaps we can manage the clock directly Jun 11 15:58:33 just enable it in the probe and disable it in the remove Jun 11 15:59:03 Yes, exactly Jun 11 15:59:22 In the master driver it works Jun 11 16:01:54 try setting the delay negative with pm_runtime_set_autosuspend_delay Jun 11 16:02:21 this should prevent autosuspend Jun 11 16:03:30 #define SPI_AUTOSUSPEND_TIMEOUT -1 Jun 11 16:06:29 m_w: did you anytime try compiling the android invensense drivers on beaglebone black? Jun 11 16:07:41 kiran4399: no I have only dealt with the mainline driver Jun 11 16:07:57 m_w: driver again reset bbb Jun 11 16:08:44 m_w: I will commit the current code on github Jun 11 16:08:57 okay Jun 11 16:09:05 something strange is going on Jun 11 16:10:10 when spi slave driver isn't intall master receiver only 0 when slave is install master receive FF Jun 11 16:11:07 but slave board in this moment is reset Jun 11 16:11:49 so as soon as the SCLK toggles? Jun 11 16:12:12 you can try toggling it manually and see if it causes the reset Jun 11 16:13:17 https://github.com/pmezydlo/SPI_slave_driver_implementation/blob/master/driver/spi-mcspi-slave.c Jun 11 16:14:09 ok I will try Jun 11 16:14:33 https://github.com/pmezydlo/SPI_slave_driver_implementation/blob/master/driver/spi-mcspi-slave.c#L269 Jun 11 16:14:36 what is this? Jun 11 16:15:55 take that out Jun 11 16:16:53 I started writing support for interrupts. This is trick would the compiler does not give warnings Jun 11 16:17:22 oh Jun 11 16:17:51 perhaps you should take the pr_info out of the interrupt function Jun 11 16:18:03 and see if that helps Jun 11 16:19:07 meanwhile I will power up my BBB Jun 11 16:21:35 m_w:still reset Jun 11 16:22:15 so as soon as the sclk toggles Jun 11 16:23:02 simply remove the SCLK pin Jun 11 16:25:57 :-/ Jun 11 16:29:07 I really need a USB to serial ttl adapter for this board Jun 11 16:39:30 building the driver now Jun 11 16:40:56 travis not built, I'm checking log Jun 11 16:41:23 kernel coding style error Jun 11 16:43:07 :D Jun 11 16:43:09 so Jun 11 16:43:28 I get a NULL pointer dereference when I load the dtbo Jun 11 16:44:22 echo SPI0_slave > /sys/devices/platform/bone_capemgr/slots Jun 11 16:44:36 blaaaaaaaaah Jun 11 16:44:50 haha Jun 11 16:46:13 maybe I missed a step Jun 11 16:46:34 like blacklisting the other module Jun 11 16:53:31 okay it loaded Jun 11 16:58:37 I am toggling the clock and it is not resetting Jun 11 16:59:57 oops wrong channel Jun 11 17:00:42 yup it is resetting Jun 11 17:01:43 ohh no Jun 11 17:02:00 it actually seemed to halt mine Jun 11 17:02:11 the led stopped blinking Jun 11 17:06:17 the driver cries a little when you rmmod it Jun 11 17:06:40 when you use devm_request_irq you don't explicitly free it Jun 11 17:06:48 it happens automatically Jun 11 17:07:16 fine I don't know Jun 11 17:07:33 What do you think , What's going on? Jun 11 17:08:01 Does anybody know how to compile a kernel module for beaglebone black? Jun 11 17:08:58 :D Jun 11 17:09:20 we are compiling a module right now Jun 11 17:09:44 I am a bit confused as to what is happening Jun 11 17:12:00 This is a hardware problem? Jun 11 17:12:35 I hope not Jun 11 17:15:44 very strange Jun 11 17:17:35 kiran4399: make KDIR=/path/to/kernel/header/dir ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOCALVERSION=-ti-r29 SUBDIRS=/to/the/module/dir modules Jun 11 17:17:43 ? Jun 11 17:22:31 ZeekHuge: Nothing to be done for all error? Jun 11 17:22:43 make: Nothing to be done for all Jun 11 17:24:15 probably check where you are (the dir ) , and KDIR and SUBDIRS . Jun 11 17:24:26 kiran4399: exact command ? Jun 11 17:24:33 I have used that many times. Jun 11 17:25:04 you have a make file at SUBDIRS right ? Jun 11 17:25:24 http://pastebin.com/hm3jvmYg Jun 11 17:25:48 I have this makefile in the repository where the entire source code is there.. Jun 11 17:29:04 okay so compiling on the BBB itself. Jun 11 17:29:11 makefile is wrong Jun 11 17:29:24 newline after all: Jun 11 17:29:27 and clean: Jun 11 17:30:08 kiran4399: ^ Jun 11 17:30:41 did that work ! Jun 11 17:30:43 ? Jun 11 17:30:47 kiran4399: ^ Jun 11 17:36:53 kiran4399: http://paste.debian.net/737836/ Jun 11 17:37:34 m_w: ? Jun 11 17:40:02 you should consider looking at (MCSPI_SYSCONFIG) Jun 11 17:58:39 ZeekHuge: copy_to_user/copy_from_user is exactly how beaglelogic does it Jun 11 17:59:21 It has ioctl calls but also it has sysfs attributes that can be changes Jun 11 17:59:24 *charged Jun 11 17:59:34 *changed Jun 11 18:01:07 Abhishek_: okay, but in our case, we will just come up to IIO subsystem, so dont need to much worry about it . right ? Jun 11 18:01:50 jic23 will be able to answer the specifics in this case. Jun 11 18:02:12 I was basically thinking, if we will have to use kfifo for in-kernel messaging . and I think, we should , isnt it ? Jun 11 18:03:35 Abhishek_: okay, I'll ask him about this. I was saying this with reference to page 4 https://docs.google.com/document/d/1GfnoWusWUeH2VsLbt1qJaRi20uNxCC8O_Xw1CHoGY9A/edit Jun 11 18:03:44 the proposal that is Jun 11 18:06:36 pmezydlo1: 172: 4 INTC 65 Level spi-mcspi-slave Jun 11 18:06:40 ;) Jun 11 18:07:09 I must set SIDLEMODE register? Jun 11 18:07:12 ? Jun 11 18:07:19 172: 4 INTC 65 Level spi-mcspi-slave? Jun 11 18:07:35 you need to clear the interrupts in the interrupt service routine Jun 11 18:08:58 MCSPI_IRQSTATUS? Jun 11 18:09:00 mcspi_slave_write_reg(slave->base, MCSPI_IRQSTATUS, 0xffffffff); Jun 11 18:09:24 in mcspi_slave_irq Jun 11 18:09:29 yeah Jun 11 18:13:27 anything else? Jun 11 18:14:06 I must set in SYSCONFIG? Jun 11 18:14:30 m_w: ^^ Jun 11 18:14:55 it seems not require with the setup code that you currently have Jun 11 18:15:20 required Jun 11 18:16:04 http://pastebin.com/4fCvfqd0 Jun 11 18:16:10 thanks Jun 11 18:16:26 no problem Jun 11 18:16:36 of to the grocery store Jun 11 18:16:37 I see interrupt Jun 11 18:16:38 off Jun 11 18:17:10 you should be okay to continue now Jun 11 18:17:54 email if you run into more troubles Jun 11 18:28:21 Hi all, very brief visit. Kiran adding somewhat aged android driver will prob be more of a pain than the few patches to do it with mainline driver. Jun 11 18:28:48 Kiran4399^^ Jun 11 18:30:11 Plus aim is to work with upstream. The android driver mess is never going to be accepted upstream as that way we need to have two copies of every driver ( 3 actually as St have a part with same rough hardware) Jun 11 18:30:22 Back later Jun 11 18:49:24 kiran4399: did you figure everything out? Jun 11 19:00:36 * nerdboy has a decent test image build but still no sdcard_img bbclass Jun 11 19:00:52 hey m_w I have a doubt in a makefile. Can you help out? Jun 11 19:01:19 *me Jun 11 19:01:32 Wormo, ^^ Jun 11 19:01:45 hi, what's the question? Jun 11 19:02:32 Wormo,Please take a look at the makefile here:https://github.com/chanakya-vc/PRU-I2C_SPI_master/tree/wip_on_spi Jun 11 19:02:36 In the repo Jun 11 19:03:10 Now if you see the makefile,there is the include path field and lib field,which I have set to my local path Jun 11 19:03:39 line 21 and line 22 Jun 11 19:03:50 yes Jun 11 19:04:14 Now I don't want people to always open the makefile and change that path to their local path Jun 11 19:04:44 Wormo, Is there a way to define a variable like PRU_CGT(as they have done in the beginning) Jun 11 19:05:03 the most basic improvement is to turn those into variables, yes Jun 11 19:05:47 So that the user simply sets that variable and they can set those paths? Can you please guide me?I know how to declare a variable in a makefile Jun 11 19:06:08 LIBS and INCLUDE are variables :) Jun 11 19:06:28 Wormo, But how do I prompt the user to set them? Jun 11 19:06:57 You would actually make another variable that is used in both of those Jun 11 19:07:15 see how there is a base path in common right Jun 11 19:07:26 substitute a variable value for those parts Jun 11 19:07:38 And the way to set them would be to say: export LIBS =? Jun 11 19:07:57 don't have them export LIBS directly Jun 11 19:08:20 factor out the path to the PRU software, and have them set that, PRU_SW_PATH or something Jun 11 19:08:48 export PRU_SW_PATH=/home/vc/Desktop/beagle-gsoc/compile/pru-software-support-package Jun 11 19:08:53 and so forth Jun 11 19:09:27 Okay got it .Take a common variable and let it point to the PRU software pkg,because after that the path is known right? Jun 11 19:09:27 then rewrite LIBS and INCLUDE in terms of that common path Jun 11 19:09:33 yes Jun 11 19:10:31 like how TARGET and MAP in lines 32&33 are defined by adding different suffix to common variables Jun 11 19:11:36 One more fundamental doubt I have,is that in linux when you do export var=<>,then does bash initialize a variable by that name?Because before the makefile the variable PRU_SW_PATH would not be defined anywhere else right? Jun 11 19:12:25 It creates the variable with 'export' yes, you don't need to pre-declare like in C Jun 11 19:12:34 Wormo, I mean the makefile must look into the host computer for a variable by that name and then update its own value right? Jun 11 19:12:41 Okay Jun 11 19:13:12 'make' looks in the environment if you have not set the variable in the Makefile Jun 11 19:13:59 Okay. And I am modifying this TI makefile,so how do I go about any copyright stuff? Jun 11 19:14:02 Wormo, ^^ Jun 11 19:14:05 there is also a syntax to create default values in the Makefile, where it will only use the value if user has not already stated a value in the environmenet Jun 11 19:15:00 What was the copyright on the original PRU source from TI? Jun 11 19:15:16 *Nothing is written on the makefile Jun 11 19:15:26 The whole package Jun 11 19:15:53 It can be in a license file for the whole thing Jun 11 19:16:31 the license per file is good practice, but it's still valid if you put it in a separate file distributed with the software Jun 11 19:17:01 It is actually an example given in the PRU sw support pkg. Jun 11 19:17:19 yes, so what is the license for the PRU sw support pkg Jun 11 19:17:33 examples fall under that unless otherwise stated Jun 11 19:19:22 btw GNU Makefile syntax for default values overrideable from environment: 'VAR ?= DEFAULT_VALUE' Jun 11 19:19:33 Wormo, There is a notice on top of the example code which says http://pastebin.com/7U37RysM Jun 11 19:19:59 This is on top of the firmware code given along with the makefile Jun 11 19:20:26 I havenot used the firmware code,Just modified the makefile Jun 11 19:23:41 Looks like a BSD style license, where they pretty much just want their notice to accompany any used code Jun 11 19:24:55 Paste this information on top of the makefile then Wormo ? Jun 11 19:25:04 you can turn that into a Makefile style comment, saying 'this makefile based TI PRU compiler examples/Makefile, with following license:' Jun 11 19:25:19 And add myself as one of authors? Jun 11 19:25:24 yes Jun 11 19:25:55 Okay I have not idea about how to write that in legal terms and stuff Jun 11 19:25:56 your code can use a different license of course Jun 11 19:26:55 Basically getting their notice in literally is legal Jun 11 19:27:33 pointing to where the original Makefile came from is not a legal requirement but it's common sense Jun 11 19:28:21 Wormo, For the moment can I just write before the TI license, Adapted and modified by:Vaibhav Choudhay and then maybe write rights reserved and then just paste the TI license after that? Jun 11 19:29:06 yes 'Adapted and modified by Vaibhav Choudhay' followed by TI license is fine Jun 11 19:29:07 I will worry about my license at the end when I am done Jun 11 19:29:22 Okay Jun 11 19:29:32 Thanks Wormo Jun 11 19:29:38 welcome Jun 11 19:38:42 * nerdboy getting too big with the CORE_IMAGE_EXTRA_INSTALL list in local.conf Jun 11 19:38:57 how long :) Jun 11 19:39:02 i think i passed the point of "time to make an image recipe" a while back... Jun 11 19:42:07 chanakya_vc: If the code you adapt gets significantly changed, you add your copyright alongside other authors Jun 11 19:42:18 below them in the line Jun 11 19:46:17 https://archive.org/details/skce2009-06-16.mtx.miller.99764.flac16 Jun 11 19:55:50 one question, if two different drivers call devm_kzalloc() with same dev as first argument, does it allocate different memories ? or just returns pointer to same memory location ? Jun 11 19:56:49 Wormo: nerdboy Abhishek_ ^ Jun 11 19:57:18 IIRC two different allocations happen Jun 11 19:57:23 it's dynamic allocation, different pointer on different calls Jun 11 19:57:47 the device is used to track what list of pointers should be freed if device goes away Jun 11 19:58:16 okay so then I read somewhere that if such global alloc is made, we should use mutex locks while changing the values in the ds Jun 11 19:58:25 so why that ? Jun 11 19:58:45 You don't want another call to change something else while you are changing a value Jun 11 19:59:01 because you might depend on some value that got changed in-between you making a change Jun 11 19:59:44 if you're really anal you can enable "prove locking correctness" in the kernel config... Jun 11 20:00:09 who else will come and change it ? if everyone has a different pointer ? Jun 11 20:00:37 might not be a bad idea... Jun 11 20:01:20 nerdboy: and what will that do ? Jun 11 20:01:52 are you sure it was dev_kzalloc() that was supposed to be locked? Jun 11 20:02:32 the lock debugging config option is a good idea, it keeps track of the order that locks have been acquired Jun 11 20:02:38 It may be a data structure allocated using devm_kzalloc Jun 11 20:02:55 no ! it was said that when we change values at global alloc made by commands such as devm_kzalloc() Jun 11 20:03:35 we should use mutex_locks Jun 11 20:04:32 I am unable to find or even recall where i read that (did a lot of reading from various sources in last some days) Jun 11 20:04:48 e.g. if you have one function gets mutex A then mutex B, and another function that accidentally tries to get B then A, then with just the wrong timing you can get a deadlock Jun 11 20:04:52 ZeekHuge, sounds crazy over generalised statement! Jun 11 20:06:13 lock debugger notices this problem even if you were lucky to avoid deadlock by fuctions not running at about the same time Jun 11 20:06:22 On your stuff for now you may need a lock to ensure access from userspace to buffers does not mess with them getting filled from hardware. Jun 11 20:06:55 Lock debugger is cool but you shouldn't need it for a simple driver! Jun 11 20:07:09 Interesting to read up on though. Jun 11 20:07:33 okay. Jun 11 20:08:09 but I was just trying to understand and possibly use it as i might need that in further development. Jun 11 20:08:12 IMO good when devs get in the habit of giving it a try sometimes, nerdboy has found some warnings in vendor kernels especially Jun 11 20:08:25 Be cynical if I were you. Write driver initially without locks then work out where they are needed later. Jun 11 20:08:51 Yeah, I have had the odd lockdep warning :) Jun 11 20:08:58 Oops :/ Jun 11 20:10:25 Don't flood Zeekhuge with all the tools to early :) never get anything done! Jun 11 20:10:30 Too Jun 11 20:10:49 Back later maybe... Jun 11 20:10:54 :) Jun 11 20:20:52 Abhishek_, Got it. I am going to just write what Wormo suggested me to as of now Jun 11 20:21:23 Abhishek_,Thanks! : ) Jun 11 20:38:01 SG Jun 11 22:47:59 i'm pretty sure lockdep tests are separate from proof setting **** ENDING LOGGING AT Sun Jun 12 02:59:58 2016