All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch v4 0/4] memory: tegra: Add MC channels and error logging
@ 2022-03-02  8:43 Ashish Mhetre
  2022-03-02  8:43 ` [Patch v4 1/4] arm64: tegra: Add memory controller channels Ashish Mhetre
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Ashish Mhetre @ 2022-03-02  8:43 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski, thierry.reding, jonathanh, digetx,
	linux-kernel, devicetree, linux-tegra
  Cc: vdumpa, Snikam, amhetre

From tegra186 onward, memory controllers support multiple channels.
Add memory controller channels in device tree and add support to map
address spaces of these channels in tegra MC driver.
When memory controller interrupt occurs, registers from these channels
are required to be read in order to get error information.
Add error logging support from tegra186 onward for memory controller
interrupts.

Ashish Mhetre (4):
  arm64: tegra: Add memory controller channels
  dt-bindings: memory: Update reg maxitems for tegra186
  memory: tegra: Add memory controller channels support
  memory: tegra: Add MC error logging on tegra186 onward

---
Changes in v4:
- Added memory controller channels support
- Added newlines after every break statement of all switch cases
- Fixed compile error with W=1 build
- Fixed the interrupt mask bit logic

Changes in v3:
- Removed unnecessary ifdefs
- Grouped newly added MC registers with existing MC registers
- Removed unnecessary initialization of variables
- Updated code to use newly added field 'has_addr_hi_reg' instead of ifdefs

Changes in v2:
- Updated patch subject and commit message
- Removed separate irq handlers
- Updated tegra30_mc_handle_irq to be used for tegra186 onwards as well

 .../memory-controllers/nvidia,tegra186-mc.yaml     |   2 +-
 arch/arm64/boot/dts/nvidia/tegra186.dtsi           |   7 +-
 arch/arm64/boot/dts/nvidia/tegra194.dtsi           |  21 +++-
 arch/arm64/boot/dts/nvidia/tegra234.dtsi           |  21 +++-
 drivers/memory/tegra/mc.c                          | 108 ++++++++++++++++++---
 drivers/memory/tegra/mc.h                          |  37 ++++++-
 drivers/memory/tegra/tegra186.c                    |  67 +++++++++++++
 drivers/memory/tegra/tegra194.c                    |  46 +++++++++
 drivers/memory/tegra/tegra234.c                    |   1 +
 include/soc/tegra/mc.h                             |  10 ++
 10 files changed, 296 insertions(+), 24 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [Patch v4 4/4] memory: tegra: Add MC error logging on tegra186 onward
  2022-03-02  8:43 ` [Patch v4 4/4] memory: tegra: Add MC error logging on tegra186 onward Ashish Mhetre
  2022-03-02 19:44   ` Krzysztof Kozlowski
@ 2022-03-03 12:31 ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2022-03-03  4:44 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 7801 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <1646210609-21943-5-git-send-email-amhetre@nvidia.com>
References: <1646210609-21943-5-git-send-email-amhetre@nvidia.com>
TO: Ashish Mhetre <amhetre@nvidia.com>
TO: robh+dt(a)kernel.org
TO: krzysztof.kozlowski(a)canonical.com
TO: thierry.reding(a)gmail.com
TO: jonathanh(a)nvidia.com
TO: digetx(a)gmail.com
TO: linux-kernel(a)vger.kernel.org
TO: devicetree(a)vger.kernel.org
TO: linux-tegra(a)vger.kernel.org
CC: vdumpa(a)nvidia.com
CC: Snikam(a)nvidia.com
CC: amhetre(a)nvidia.com

Hi Ashish,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tegra/for-next]
[also build test WARNING on next-20220302]
[cannot apply to robh/for-next linux/master linus/master v5.17-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ashish-Mhetre/memory-tegra-Add-MC-channels-and-error-logging/20220302-164625
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
:::::: branch date: 20 hours ago
:::::: commit date: 20 hours ago
config: openrisc-randconfig-m031-20220302 (https://download.01.org/0day-ci/archive/20220303/202203031247.0bBX70B3-lkp(a)intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/memory/tegra/mc.c:593 tegra30_mc_handle_irq() error: uninitialized symbol 'channel'.

Old smatch warnings:
drivers/memory/tegra/mc.c:673 tegra30_mc_handle_irq() error: uninitialized symbol 'channel'.

vim +/channel +593 drivers/memory/tegra/mc.c

cc84c62c96f257 Ashish Mhetre   2022-03-02  516  
cc84c62c96f257 Ashish Mhetre   2022-03-02  517  irqreturn_t tegra30_mc_handle_irq(int irq, void *data)
89184651631713 Thierry Reding  2014-04-16  518  {
89184651631713 Thierry Reding  2014-04-16  519  	struct tegra_mc *mc = data;
1c74d5c0de0c2c Dmitry Osipenko 2018-04-09  520  	unsigned long status;
89184651631713 Thierry Reding  2014-04-16  521  	unsigned int bit;
cc84c62c96f257 Ashish Mhetre   2022-03-02  522  	int channel;
cc84c62c96f257 Ashish Mhetre   2022-03-02  523  
cc84c62c96f257 Ashish Mhetre   2022-03-02  524  	if (mc->soc->num_channels && mc->soc->get_int_channel) {
cc84c62c96f257 Ashish Mhetre   2022-03-02  525  		int err;
cc84c62c96f257 Ashish Mhetre   2022-03-02  526  
cc84c62c96f257 Ashish Mhetre   2022-03-02  527  		err = mc->soc->get_int_channel(mc, &channel);
cc84c62c96f257 Ashish Mhetre   2022-03-02  528  		if (err < 0)
cc84c62c96f257 Ashish Mhetre   2022-03-02  529  			return IRQ_NONE;
89184651631713 Thierry Reding  2014-04-16  530  
89184651631713 Thierry Reding  2014-04-16  531  		/* mask all interrupts to avoid flooding */
cc84c62c96f257 Ashish Mhetre   2022-03-02  532  		status = mc_ch_readl(mc, channel, MC_INTSTATUS) & mc->soc->intmask;
cc84c62c96f257 Ashish Mhetre   2022-03-02  533  	} else {
1c74d5c0de0c2c Dmitry Osipenko 2018-04-09  534  		status = mc_readl(mc, MC_INTSTATUS) & mc->soc->intmask;
cc84c62c96f257 Ashish Mhetre   2022-03-02  535  	}
cc84c62c96f257 Ashish Mhetre   2022-03-02  536  
bf3fbdfbec947c Dmitry Osipenko 2018-04-09  537  	if (!status)
bf3fbdfbec947c Dmitry Osipenko 2018-04-09  538  		return IRQ_NONE;
89184651631713 Thierry Reding  2014-04-16  539  
89184651631713 Thierry Reding  2014-04-16  540  	for_each_set_bit(bit, &status, 32) {
1079a66bc32ff0 Thierry Reding  2021-06-02  541  		const char *error = tegra_mc_status_names[bit] ?: "unknown";
89184651631713 Thierry Reding  2014-04-16  542  		const char *client = "unknown", *desc;
89184651631713 Thierry Reding  2014-04-16  543  		const char *direction, *secure;
cc84c62c96f257 Ashish Mhetre   2022-03-02  544  		u32 status_reg, addr_reg;
cc84c62c96f257 Ashish Mhetre   2022-03-02  545  		u32 intmask = BIT(bit);
89184651631713 Thierry Reding  2014-04-16  546  		phys_addr_t addr = 0;
cc84c62c96f257 Ashish Mhetre   2022-03-02  547  #ifdef CONFIG_PHYS_ADDR_T_64BIT
cc84c62c96f257 Ashish Mhetre   2022-03-02  548  		u32 addr_hi_reg = 0;
cc84c62c96f257 Ashish Mhetre   2022-03-02  549  #endif
89184651631713 Thierry Reding  2014-04-16  550  		unsigned int i;
89184651631713 Thierry Reding  2014-04-16  551  		char perm[7];
89184651631713 Thierry Reding  2014-04-16  552  		u8 id, type;
89184651631713 Thierry Reding  2014-04-16  553  		u32 value;
89184651631713 Thierry Reding  2014-04-16  554  
cc84c62c96f257 Ashish Mhetre   2022-03-02  555  		switch (intmask) {
cc84c62c96f257 Ashish Mhetre   2022-03-02  556  		case MC_INT_DECERR_VPR:
cc84c62c96f257 Ashish Mhetre   2022-03-02  557  			status_reg = MC_ERR_VPR_STATUS;
cc84c62c96f257 Ashish Mhetre   2022-03-02  558  			addr_reg = MC_ERR_VPR_ADR;
cc84c62c96f257 Ashish Mhetre   2022-03-02  559  			break;
cc84c62c96f257 Ashish Mhetre   2022-03-02  560  
cc84c62c96f257 Ashish Mhetre   2022-03-02  561  		case MC_INT_SECERR_SEC:
cc84c62c96f257 Ashish Mhetre   2022-03-02  562  			status_reg = MC_ERR_SEC_STATUS;
cc84c62c96f257 Ashish Mhetre   2022-03-02  563  			addr_reg = MC_ERR_SEC_ADR;
cc84c62c96f257 Ashish Mhetre   2022-03-02  564  			break;
cc84c62c96f257 Ashish Mhetre   2022-03-02  565  
cc84c62c96f257 Ashish Mhetre   2022-03-02  566  		case MC_INT_DECERR_MTS:
cc84c62c96f257 Ashish Mhetre   2022-03-02  567  			status_reg = MC_ERR_MTS_STATUS;
cc84c62c96f257 Ashish Mhetre   2022-03-02  568  			addr_reg = MC_ERR_MTS_ADR;
cc84c62c96f257 Ashish Mhetre   2022-03-02  569  			break;
cc84c62c96f257 Ashish Mhetre   2022-03-02  570  
cc84c62c96f257 Ashish Mhetre   2022-03-02  571  		case MC_INT_DECERR_GENERALIZED_CARVEOUT:
cc84c62c96f257 Ashish Mhetre   2022-03-02  572  			status_reg = MC_ERR_GENERALIZED_CARVEOUT_STATUS;
cc84c62c96f257 Ashish Mhetre   2022-03-02  573  			addr_reg = MC_ERR_GENERALIZED_CARVEOUT_ADR;
cc84c62c96f257 Ashish Mhetre   2022-03-02  574  			break;
cc84c62c96f257 Ashish Mhetre   2022-03-02  575  
cc84c62c96f257 Ashish Mhetre   2022-03-02  576  		case MC_INT_DECERR_ROUTE_SANITY:
cc84c62c96f257 Ashish Mhetre   2022-03-02  577  			status_reg = MC_ERR_ROUTE_SANITY_STATUS;
cc84c62c96f257 Ashish Mhetre   2022-03-02  578  			addr_reg = MC_ERR_ROUTE_SANITY_ADR;
cc84c62c96f257 Ashish Mhetre   2022-03-02  579  			break;
cc84c62c96f257 Ashish Mhetre   2022-03-02  580  
cc84c62c96f257 Ashish Mhetre   2022-03-02  581  		default:
cc84c62c96f257 Ashish Mhetre   2022-03-02  582  			status_reg = MC_ERR_STATUS;
cc84c62c96f257 Ashish Mhetre   2022-03-02  583  			addr_reg = MC_ERR_ADR;
cc84c62c96f257 Ashish Mhetre   2022-03-02  584  
cc84c62c96f257 Ashish Mhetre   2022-03-02  585  #ifdef CONFIG_PHYS_ADDR_T_64BIT
cc84c62c96f257 Ashish Mhetre   2022-03-02  586  			if (mc->soc->has_addr_hi_reg)
cc84c62c96f257 Ashish Mhetre   2022-03-02  587  				addr_hi_reg = MC_ERR_ADR_HI;
cc84c62c96f257 Ashish Mhetre   2022-03-02  588  #endif
cc84c62c96f257 Ashish Mhetre   2022-03-02  589  			break;
cc84c62c96f257 Ashish Mhetre   2022-03-02  590  		}
cc84c62c96f257 Ashish Mhetre   2022-03-02  591  
cc84c62c96f257 Ashish Mhetre   2022-03-02  592  		if (mc->soc->num_channels)
cc84c62c96f257 Ashish Mhetre   2022-03-02 @593  			value = mc_ch_readl(mc, channel, status_reg);
cc84c62c96f257 Ashish Mhetre   2022-03-02  594  		else
cc84c62c96f257 Ashish Mhetre   2022-03-02  595  			value = mc_readl(mc, status_reg);
89184651631713 Thierry Reding  2014-04-16  596  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-03-09  8:56 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02  8:43 [Patch v4 0/4] memory: tegra: Add MC channels and error logging Ashish Mhetre
2022-03-02  8:43 ` [Patch v4 1/4] arm64: tegra: Add memory controller channels Ashish Mhetre
2022-03-02 19:32   ` Krzysztof Kozlowski
2022-03-02  8:43 ` [Patch v4 2/4] dt-bindings: memory: Update reg maxitems for tegra186 Ashish Mhetre
2022-03-02 17:51   ` Rob Herring
2022-03-02 19:31     ` Krzysztof Kozlowski
2022-03-02  8:43 ` [Patch v4 3/4] memory: tegra: Add memory controller channels support Ashish Mhetre
2022-03-02 19:35   ` Krzysztof Kozlowski
2022-03-09  8:56     ` Jon Hunter
2022-03-02  8:43 ` [Patch v4 4/4] memory: tegra: Add MC error logging on tegra186 onward Ashish Mhetre
2022-03-02 19:44   ` Krzysztof Kozlowski
2022-03-07 19:02     ` Ashish Mhetre
2022-03-03  4:44 kernel test robot
2022-03-03 12:31 ` Dan Carpenter
2022-03-03 12:31 ` Dan Carpenter
2022-03-03 13:03 ` Krzysztof Kozlowski
2022-03-03 13:03   ` Krzysztof Kozlowski
2022-03-07 19:47   ` Ashish Mhetre
2022-03-07 19:47   ` Ashish Mhetre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.